sveld 0.37.0 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,300 +0,0 @@
1
- import{createRequire as Wp}from"node:module";var Mp=Object.create;var{getPrototypeOf:Bp,defineProperty:$s,getOwnPropertyNames:$p}=Object;var xa=Object.prototype.hasOwnProperty;function Fp(i){return this[i]}var jp,Vp,we=(i,ve,Ae)=>{var _e=i!=null&&typeof i==="object";if(_e){var Ne=ve?jp??=new WeakMap:Vp??=new WeakMap,Re=Ne.get(i);if(Re)return Re}Ae=i!=null?Mp(Bp(i)):{};let Ie=ve||!i||!i.__esModule||!xa.call(i,"default")?$s(Ae,"default",{value:i,enumerable:!0}):Ae;if(i&&typeof i==="object"||typeof i==="function"){for(let Le of $p(i))if(!xa.call(Ie,Le))$s(Ie,Le,{get:Fp.bind(i,Le),enumerable:!0})}if(_e)Ne.set(i,Ie);return Ie};var o=(i,ve)=>()=>(ve||i((ve={exports:{}}).exports,ve),ve.exports);var qp=(i)=>i;function Up(i,ve){this[i]=qp.bind(null,ve)}var Gp=(i,ve)=>{for(var Ae in ve)$s(i,Ae,{get:ve[Ae],enumerable:!0,configurable:!0,set:Up.bind(ve,Ae)})};var P=Wp(import.meta.url);var Hp={li:{direct:["li"]},dt:{descendant:["dt","dd"]},dd:{descendant:["dt","dd"]},p:{descendant:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","menu","nav","ol","p","pre","section","table","ul"]},rt:{descendant:["rt","rp"]},rp:{descendant:["rt","rp"]},optgroup:{descendant:["optgroup"]},option:{descendant:["option","optgroup"]},thead:{direct:["tbody","tfoot"]},tbody:{direct:["tbody","tfoot"]},tfoot:{direct:["tbody"]},tr:{direct:["tr","tbody"]},td:{direct:["td","th","tr"]},th:{direct:["td","th","tr"]}};function ba(i,ve){let Ae=Hp[i];if(!Ae)return!1;if(!ve)return!0;return(Ae.direct??Ae.descendant??[]).includes(ve)}var Zs={};Gp(Zs,{Node:()=>ln,Parser:()=>wt,Position:()=>Vr,SourceLocation:()=>on,TokContext:()=>er,Token:()=>jn,TokenType:()=>mt,defaultOptions:()=>Nn,getLineInfo:()=>Hs,isIdentifierChar:()=>Kt,isIdentifierStart:()=>Ft,isNewLine:()=>Rr,keywordTypes:()=>On,lineBreak:()=>jt,lineBreakG:()=>wa,nonASCIIwhitespace:()=>Ws,parse:()=>Qs,parseExpressionAt:()=>Pu,tokContexts:()=>kt,tokTypes:()=>je,tokenizer:()=>_u,version:()=>ao});var Kp=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Ta=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],zp="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Aa="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Fs={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},js="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Xp={5:js,"5module":js+" export import",6:js+" const class extends export import super"},ka=/^in(stanceof)?$/,Jp=new RegExp("["+Aa+"]"),Yp=new RegExp("["+Aa+zp+"]");function Vs(i,ve){var Ae=65536;for(var _e=0;_e<ve.length;_e+=2){if(Ae+=ve[_e],Ae>i)return!1;if(Ae+=ve[_e+1],Ae>=i)return!0}return!1}function Ft(i,ve){if(i<65)return i===36;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&Jp.test(String.fromCharCode(i));if(ve===!1)return!1;return Vs(i,Ta)}function Kt(i,ve){if(i<48)return i===36;if(i<58)return!0;if(i<65)return!1;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&Yp.test(String.fromCharCode(i));if(ve===!1)return!1;return Vs(i,Ta)||Vs(i,Kp)}var mt=function(ve,Ae){if(Ae===void 0)Ae={};this.label=ve,this.keyword=Ae.keyword,this.beforeExpr=!!Ae.beforeExpr,this.startsExpr=!!Ae.startsExpr,this.isLoop=!!Ae.isLoop,this.isAssign=!!Ae.isAssign,this.prefix=!!Ae.prefix,this.postfix=!!Ae.postfix,this.binop=Ae.binop||null,this.updateContext=null};function Qt(i,ve){return new mt(i,{beforeExpr:!0,binop:ve})}var Zt={beforeExpr:!0},Ht={startsExpr:!0},On={};function dt(i,ve){if(ve===void 0)ve={};return ve.keyword=i,On[i]=new mt(i,ve)}var je={num:new mt("num",Ht),regexp:new mt("regexp",Ht),string:new mt("string",Ht),name:new mt("name",Ht),privateId:new mt("privateId",Ht),eof:new mt("eof"),bracketL:new mt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new mt("]"),braceL:new mt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new mt("}"),parenL:new mt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new mt(")"),comma:new mt(",",Zt),semi:new mt(";",Zt),colon:new mt(":",Zt),dot:new mt("."),question:new mt("?",Zt),questionDot:new mt("?."),arrow:new mt("=>",Zt),template:new mt("template"),invalidTemplate:new mt("invalidTemplate"),ellipsis:new mt("...",Zt),backQuote:new mt("`",Ht),dollarBraceL:new mt("${",{beforeExpr:!0,startsExpr:!0}),eq:new mt("=",{beforeExpr:!0,isAssign:!0}),assign:new mt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new mt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new mt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Qt("||",1),logicalAND:Qt("&&",2),bitwiseOR:Qt("|",3),bitwiseXOR:Qt("^",4),bitwiseAND:Qt("&",5),equality:Qt("==/!=/===/!==",6),relational:Qt("</>/<=/>=",7),bitShift:Qt("<</>>/>>>",8),plusMin:new mt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Qt("%",10),star:Qt("*",10),slash:Qt("/",10),starstar:new mt("**",{beforeExpr:!0}),coalesce:Qt("??",1),_break:dt("break"),_case:dt("case",Zt),_catch:dt("catch"),_continue:dt("continue"),_debugger:dt("debugger"),_default:dt("default",Zt),_do:dt("do",{isLoop:!0,beforeExpr:!0}),_else:dt("else",Zt),_finally:dt("finally"),_for:dt("for",{isLoop:!0}),_function:dt("function",Ht),_if:dt("if"),_return:dt("return",Zt),_switch:dt("switch"),_throw:dt("throw",Zt),_try:dt("try"),_var:dt("var"),_const:dt("const"),_while:dt("while",{isLoop:!0}),_with:dt("with"),_new:dt("new",{beforeExpr:!0,startsExpr:!0}),_this:dt("this",Ht),_super:dt("super",Ht),_class:dt("class",Ht),_extends:dt("extends",Zt),_export:dt("export"),_import:dt("import",Ht),_null:dt("null",Ht),_true:dt("true",Ht),_false:dt("false",Ht),_in:dt("in",{beforeExpr:!0,binop:7}),_instanceof:dt("instanceof",{beforeExpr:!0,binop:7}),_typeof:dt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:dt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:dt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},jt=/\r\n?|\n|\u2028|\u2029/,wa=new RegExp(jt.source,"g");function Rr(i){return i===10||i===13||i===8232||i===8233}function Pa(i,ve,Ae){if(Ae===void 0)Ae=i.length;for(var _e=ve;_e<Ae;_e++){var Ne=i.charCodeAt(_e);if(Rr(Ne))return _e<Ae-1&&Ne===13&&i.charCodeAt(_e+1)===10?_e+2:_e+1}return-1}var Ws=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,It=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,_a=Object.prototype,{hasOwnProperty:Qp,toString:Zp}=_a,qr=Object.hasOwn||function(i,ve){return Qp.call(i,ve)},Ea=Array.isArray||function(i){return Zp.call(i)==="[object Array]"},Ca=Object.create(null);function Sr(i){return Ca[i]||(Ca[i]=new RegExp("^(?:"+i.replace(/ /g,"|")+")$"))}function fr(i){if(i<=65535)return String.fromCharCode(i);return i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320)}var eu=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Vr=function(ve,Ae){this.line=ve,this.column=Ae};Vr.prototype.offset=function(ve){return new Vr(this.line,this.column+ve)};var on=function(ve,Ae,_e){if(this.start=Ae,this.end=_e,ve.sourceFile!==null)this.source=ve.sourceFile};function Hs(i,ve){for(var Ae=1,_e=0;;){var Ne=Pa(i,_e,ve);if(Ne<0)return new Vr(Ae,ve-_e);++Ae,_e=Ne}}var Nn={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},va=!1;function tu(i){var ve={};for(var Ae in Nn)ve[Ae]=i&&qr(i,Ae)?i[Ae]:Nn[Ae];if(ve.ecmaVersion==="latest")ve.ecmaVersion=1e8;else if(ve.ecmaVersion==null){if(!va&&typeof console==="object"&&console.warn)va=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
2
- Defaulting to 2020, but this will stop working in the future.`);ve.ecmaVersion=11}else if(ve.ecmaVersion>=2015)ve.ecmaVersion-=2009;if(ve.allowReserved==null)ve.allowReserved=ve.ecmaVersion<5;if(!i||i.allowHashBang==null)ve.allowHashBang=ve.ecmaVersion>=14;if(Ea(ve.onToken)){var _e=ve.onToken;ve.onToken=function(Ne){return _e.push(Ne)}}if(Ea(ve.onComment))ve.onComment=ru(ve,ve.onComment);if(ve.sourceType==="commonjs"&&ve.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return ve}function ru(i,ve){return function(Ae,_e,Ne,Re,Ie,Le){var Me={type:Ae?"Block":"Line",value:_e,start:Ne,end:Re};if(i.locations)Me.loc=new on(this,Ie,Le);if(i.ranges)Me.range=[Ne,Re];ve.push(Me)}}var Dr=1,Lr=2,Ks=4,Na=8,zs=16,Ia=32,Mn=64,Da=128,Or=256,cn=512,Ra=1024,Bn=Dr|Lr|Or;function Xs(i,ve){return Lr|(i?Ks:0)|(ve?Na:0)}var In=0,Js=1,mr=2,La=3,Oa=4,Ma=5,wt=function(ve,Ae,_e){this.options=ve=tu(ve),this.sourceFile=ve.sourceFile,this.keywords=Sr(Xp[ve.ecmaVersion>=6?6:ve.sourceType==="module"?"5module":5]);var Ne="";if(ve.allowReserved!==!0){if(Ne=Fs[ve.ecmaVersion>=6?6:ve.ecmaVersion===5?5:3],ve.sourceType==="module")Ne+=" await"}this.reservedWords=Sr(Ne);var Re=(Ne?Ne+" ":"")+Fs.strict;if(this.reservedWordsStrict=Sr(Re),this.reservedWordsStrictBind=Sr(Re+" "+Fs.strictBind),this.input=String(Ae),this.containsEsc=!1,this.pos=_e||0,this.curLine=1,ve.startLocation)this.lineStart=this.pos-ve.startLocation.column,this.curLine=ve.startLocation.line;else if(_e){if(this.lineStart=this.input.lastIndexOf(`
3
- `,_e-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(jt).length}else this.lineStart=0;if(this.type=je.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=ve.sourceType==="module",this.strict=this.inModule||ve.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&ve.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Lr:Dr),this.regexpState=null,this.privateNameStack=[]},rr={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};wt.prototype.parse=function(){var ve=this,Ae=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return ve.parseTopLevel(Ae)})};rr.inFunction.get=function(){return(this.currentVarScope().flags&Lr)>0};rr.inGenerator.get=function(){return(this.currentVarScope().flags&Na)>0};rr.inAsync.get=function(){return(this.currentVarScope().flags&Ks)>0};rr.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var ve=this.scopeStack[i],Ae=ve.flags;if(Ae&(Or|cn))return!1;if(Ae&Lr)return(Ae&Ks)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};rr.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Dr)return!0;return!1};rr.allowSuper.get=function(){var i=this.currentThisScope(),ve=i.flags;return(ve&Mn)>0||this.options.allowSuperOutsideMethod};rr.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Da)>0};rr.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};rr.allowNewDotTarget.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var ve=this.scopeStack[i],Ae=ve.flags;if(Ae&(Or|cn)||Ae&Lr&&!(Ae&zs))return!0}return!1};rr.allowUsing.get=function(){var i=this.currentScope(),ve=i.flags;if(ve&Ra)return!1;if(!this.inModule&&ve&Dr)return!1;return!0};rr.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Or)>0};wt.extend=function(){var ve=[],Ae=arguments.length;while(Ae--)ve[Ae]=arguments[Ae];var _e=this;for(var Ne=0;Ne<ve.length;Ne++)_e=ve[Ne](_e);return _e};wt.parse=function(ve,Ae){return new this(Ae,ve).parse()};wt.parseExpressionAt=function(ve,Ae,_e){var Ne=new this(_e,ve,Ae);return Ne.nextToken(),Ne.parseExpression()};wt.tokenizer=function(ve,Ae){return new this(Ae,ve)};Object.defineProperties(wt.prototype,rr);var Ot=wt.prototype,nu=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Ot.strictDirective=function(i){if(this.options.ecmaVersion<5)return!1;for(;;){It.lastIndex=i,i+=It.exec(this.input)[0].length;var ve=nu.exec(this.input.slice(i));if(!ve)return!1;if((ve[1]||ve[2])==="use strict"){It.lastIndex=i+ve[0].length;var Ae=It.exec(this.input),_e=Ae.index+Ae[0].length,Ne=this.input.charAt(_e);return Ne===";"||Ne==="}"||jt.test(Ae[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Ne)||Ne==="!"&&this.input.charAt(_e+1)==="=")}if(i+=ve[0].length,It.lastIndex=i,i+=It.exec(this.input)[0].length,this.input[i]===";")i++}};Ot.eat=function(i){if(this.type===i)return this.next(),!0;else return!1};Ot.isContextual=function(i){return this.type===je.name&&this.value===i&&!this.containsEsc};Ot.eatContextual=function(i){if(!this.isContextual(i))return!1;return this.next(),!0};Ot.catchStackOverflow=function(i){try{return i()}catch(ve){if(ve instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(ve.message)||/\btoo much recursion\b/i.test(ve.message)))this.raise(this.start,"Not enough stack space to parse input");else throw ve}};Ot.expectContextual=function(i){if(!this.eatContextual(i))this.unexpected()};Ot.canInsertSemicolon=function(){return this.type===je.eof||this.type===je.braceR||jt.test(this.input.slice(this.lastTokEnd,this.start))};Ot.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};Ot.semicolon=function(){if(!this.eat(je.semi)&&!this.insertSemicolon())this.unexpected()};Ot.afterTrailingComma=function(i,ve){if(this.type===i){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!ve)this.next();return!0}};Ot.expect=function(i){this.eat(i)||this.unexpected()};Ot.unexpected=function(i){this.raise(i!=null?i:this.start,"Unexpected token")};var $n=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ot.checkPatternErrors=function(i,ve){if(!i)return;if(i.trailingComma>-1)this.raiseRecoverable(i.trailingComma,"Comma is not permitted after the rest element");var Ae=ve?i.parenthesizedAssign:i.parenthesizedBind;if(Ae>-1)this.raiseRecoverable(Ae,ve?"Assigning to rvalue":"Parenthesized pattern")};Ot.checkExpressionErrors=function(i,ve){if(!i)return!1;var{shorthandAssign:Ae,doubleProto:_e}=i;if(!ve)return Ae>=0||_e>=0;if(Ae>=0)this.raise(Ae,"Shorthand property assignments are valid only in destructuring patterns");if(_e>=0)this.raiseRecoverable(_e,"Redefinition of __proto__ property")};Ot.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};Ot.isSimpleAssignTarget=function(i){if(i.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(i.expression);return i.type==="Identifier"||i.type==="MemberExpression"};var st=wt.prototype;st.parseTopLevel=function(i){var ve=Object.create(null);if(!i.body)i.body=[];while(this.type!==je.eof){var Ae=this.parseStatement(null,!0,ve);i.body.push(Ae)}if(this.inModule)for(var _e=0,Ne=Object.keys(this.undefinedExports);_e<Ne.length;_e+=1){var Re=Ne[_e];this.raiseRecoverable(this.undefinedExports[Re].start,"Export '"+Re+"' is not defined")}return this.adaptDirectivePrologue(i.body),this.next(),i.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(i,"Program")};var Ys={kind:"loop"},su={kind:"switch"};st.isLet=function(i){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;It.lastIndex=this.pos;var ve=It.exec(this.input),Ae=this.pos+ve[0].length,_e=this.fullCharCodeAt(Ae);if(_e===91||_e===92)return!0;if(i)return!1;if(_e===123)return!0;if(Ft(_e)){var Ne=Ae;do Ae+=_e<=65535?1:2;while(Kt(_e=this.fullCharCodeAt(Ae)));if(_e===92)return!0;var Re=this.input.slice(Ne,Ae);if(!ka.test(Re))return!0}return!1};st.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;It.lastIndex=this.pos;var i=It.exec(this.input),ve=this.pos+i[0].length,Ae;return!jt.test(this.input.slice(this.pos,ve))&&this.input.slice(ve,ve+8)==="function"&&(ve+8===this.input.length||!(Kt(Ae=this.fullCharCodeAt(ve+8))||Ae===92))};st.isUsingKeyword=function(i,ve){if(this.options.ecmaVersion<17||!this.isContextual(i?"await":"using"))return!1;It.lastIndex=this.pos;var Ae=It.exec(this.input),_e=this.pos+Ae[0].length;if(jt.test(this.input.slice(this.pos,_e)))return!1;if(i){var Ne=_e+5,Re;if(this.input.slice(_e,Ne)!=="using"||Ne===this.input.length||Kt(Re=this.fullCharCodeAt(Ne))||Re===92)return!1;It.lastIndex=Ne;var Ie=It.exec(this.input);if(_e=Ne+Ie[0].length,Ie&&jt.test(this.input.slice(Ne,_e)))return!1}var Le=this.fullCharCodeAt(_e);if(!Ft(Le)&&Le!==92)return!1;var Me=_e;do _e+=Le<=65535?1:2;while(Kt(Le=this.fullCharCodeAt(_e)));if(Le===92)return!0;var $e=this.input.slice(Me,_e);if(ka.test($e))return!1;if(ve&&!i&&$e==="of"){It.lastIndex=_e;var Be=It.exec(this.input);if(_e=_e+Be[0].length,this.input.charCodeAt(_e)!==61||(Le=this.input.charCodeAt(_e+1))===61||Le===62)return!1}return!0};st.isAwaitUsing=function(i){return this.isUsingKeyword(!0,i)};st.isUsing=function(i){return this.isUsingKeyword(!1,i)};st.parseStatement=function(i,ve,Ae){var _e=this.type,Ne=this.startNode(),Re;if(this.isLet(i))_e=je._var,Re="let";switch(_e){case je._break:case je._continue:return this.parseBreakContinueStatement(Ne,_e.keyword);case je._debugger:return this.parseDebuggerStatement(Ne);case je._do:return this.parseDoStatement(Ne);case je._for:return this.parseForStatement(Ne);case je._function:if(i&&(this.strict||i!=="if"&&i!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(Ne,!1,!i);case je._class:if(i)this.unexpected();return this.parseClass(Ne,!0);case je._if:return this.parseIfStatement(Ne);case je._return:return this.parseReturnStatement(Ne);case je._switch:return this.parseSwitchStatement(Ne);case je._throw:return this.parseThrowStatement(Ne);case je._try:return this.parseTryStatement(Ne);case je._const:case je._var:if(Re=Re||this.value,i&&Re!=="var")this.unexpected();return this.parseVarStatement(Ne,Re);case je._while:return this.parseWhileStatement(Ne);case je._with:return this.parseWithStatement(Ne);case je.braceL:return this.parseBlock(!0,Ne);case je.semi:return this.parseEmptyStatement(Ne);case je._export:case je._import:if(this.options.ecmaVersion>10&&_e===je._import){It.lastIndex=this.pos;var Ie=It.exec(this.input),Le=this.pos+Ie[0].length,Me=this.input.charCodeAt(Le);if(Me===40||Me===46)return this.parseExpressionStatement(Ne,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!ve)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return _e===je._import?this.parseImport(Ne):this.parseExport(Ne,Ae);default:if(this.isAsyncFunction()){if(i)this.unexpected();return this.next(),this.parseFunctionStatement(Ne,!0,!i)}var $e=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if($e){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(i)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if($e==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(Ne,!1,$e),this.semicolon(),this.finishNode(Ne,"VariableDeclaration")}var Be=this.value,Ve=this.parseExpression();if(_e===je.name&&Ve.type==="Identifier"&&this.eat(je.colon))return this.parseLabeledStatement(Ne,Be,Ve,i);else return this.parseExpressionStatement(Ne,Ve)}};st.parseBreakContinueStatement=function(i,ve){var Ae=ve==="break";if(this.next(),this.eat(je.semi)||this.insertSemicolon())i.label=null;else if(this.type!==je.name)this.unexpected();else i.label=this.parseIdent(),this.semicolon();var _e=0;for(;_e<this.labels.length;++_e){var Ne=this.labels[_e];if(i.label==null||Ne.name===i.label.name){if(Ne.kind!=null&&(Ae||Ne.kind==="loop"))break;if(i.label&&Ae)break}}if(_e===this.labels.length)this.raise(i.start,"Unsyntactic "+ve);return this.finishNode(i,Ae?"BreakStatement":"ContinueStatement")};st.parseDebuggerStatement=function(i){return this.next(),this.semicolon(),this.finishNode(i,"DebuggerStatement")};st.parseDoStatement=function(i){if(this.next(),this.labels.push(Ys),i.body=this.parseStatement("do"),this.labels.pop(),this.expect(je._while),i.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(je.semi);else this.semicolon();return this.finishNode(i,"DoWhileStatement")};st.parseForStatement=function(i){this.next();var ve=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ys),this.enterScope(0),this.expect(je.parenL),this.type===je.semi){if(ve>-1)this.unexpected(ve);return this.parseFor(i,null)}var Ae=this.isLet();if(this.type===je._var||this.type===je._const||Ae){var _e=this.startNode(),Ne=Ae?"let":this.value;return this.next(),this.parseVar(_e,!0,Ne),this.finishNode(_e,"VariableDeclaration"),this.parseForAfterInit(i,_e,ve)}var Re=this.isContextual("let"),Ie=!1,Le=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Le){var Me=this.startNode();if(this.next(),Le==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Me,!0,Le),this.finishNode(Me,"VariableDeclaration"),this.parseForAfterInit(i,Me,ve)}var $e=this.containsEsc,Be=new $n,Ve=this.start,Ue=ve>-1?this.parseExprSubscripts(Be,"await"):this.parseExpression(!0,Be);if(this.type===je._in||(Ie=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(ve>-1){if(this.type===je._in)this.unexpected(ve);i.await=!0}else if(Ie&&this.options.ecmaVersion>=8){if(Ue.start===Ve&&!$e&&Ue.type==="Identifier"&&Ue.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)i.await=!1}if(Re&&Ie)this.raise(Ue.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(Ue,!1,Be),this.checkLValPattern(Ue),this.parseForIn(i,Ue)}else this.checkExpressionErrors(Be,!0);if(ve>-1)this.unexpected(ve);return this.parseFor(i,Ue)};st.parseForAfterInit=function(i,ve,Ae){if((this.type===je._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&ve.declarations.length===1){if(this.type===je._in){if((ve.kind==="using"||ve.kind==="await using")&&!ve.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Ae>-1)this.unexpected(Ae)}else if(this.options.ecmaVersion>=9)i.await=Ae>-1;return this.parseForIn(i,ve)}if(Ae>-1)this.unexpected(Ae);return this.parseFor(i,ve)};st.parseFunctionStatement=function(i,ve,Ae){return this.next(),this.parseFunction(i,an|(Ae?0:qs),!1,ve)};st.parseIfStatement=function(i){return this.next(),i.test=this.parseParenExpression(),i.consequent=this.parseStatement("if"),i.alternate=this.eat(je._else)?this.parseStatement("if"):null,this.finishNode(i,"IfStatement")};st.parseReturnStatement=function(i){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(je.semi)||this.insertSemicolon())i.argument=null;else i.argument=this.parseExpression(),this.semicolon();return this.finishNode(i,"ReturnStatement")};st.parseSwitchStatement=function(i){this.next(),i.discriminant=this.parseParenExpression(),i.cases=[],this.expect(je.braceL),this.labels.push(su),this.enterScope(Ra);var ve;for(var Ae=!1;this.type!==je.braceR;)if(this.type===je._case||this.type===je._default){var _e=this.type===je._case;if(ve)this.finishNode(ve,"SwitchCase");if(i.cases.push(ve=this.startNode()),ve.consequent=[],this.next(),_e)ve.test=this.parseExpression();else{if(Ae)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Ae=!0,ve.test=null}this.expect(je.colon)}else{if(!ve)this.unexpected();ve.consequent.push(this.parseStatement(null))}if(this.exitScope(),ve)this.finishNode(ve,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(i,"SwitchStatement")};st.parseThrowStatement=function(i){if(this.next(),jt.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return i.argument=this.parseExpression(),this.semicolon(),this.finishNode(i,"ThrowStatement")};var iu=[];st.parseCatchClauseParam=function(){var i=this.parseBindingAtom(),ve=i.type==="Identifier";return this.enterScope(ve?Ia:0),this.checkLValPattern(i,ve?Oa:mr),this.expect(je.parenR),i};st.parseTryStatement=function(i){if(this.next(),i.block=this.parseBlock(),i.handler=null,this.type===je._catch){var ve=this.startNode();if(this.next(),this.eat(je.parenL))ve.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();ve.param=null,this.enterScope(0)}ve.body=this.parseBlock(!1),this.exitScope(),i.handler=this.finishNode(ve,"CatchClause")}if(i.finalizer=this.eat(je._finally)?this.parseBlock():null,!i.handler&&!i.finalizer)this.raise(i.start,"Missing catch or finally clause");return this.finishNode(i,"TryStatement")};st.parseVarStatement=function(i,ve,Ae){return this.next(),this.parseVar(i,!1,ve,Ae),this.semicolon(),this.finishNode(i,"VariableDeclaration")};st.parseWhileStatement=function(i){return this.next(),i.test=this.parseParenExpression(),this.labels.push(Ys),i.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(i,"WhileStatement")};st.parseWithStatement=function(i){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),i.object=this.parseParenExpression(),i.body=this.parseStatement("with"),this.finishNode(i,"WithStatement")};st.parseEmptyStatement=function(i){return this.next(),this.finishNode(i,"EmptyStatement")};st.parseLabeledStatement=function(i,ve,Ae,_e){for(var Ne=0,Re=this.labels;Ne<Re.length;Ne+=1){var Ie=Re[Ne];if(Ie.name===ve)this.raise(Ae.start,"Label '"+ve+"' is already declared")}var Le=this.type.isLoop?"loop":this.type===je._switch?"switch":null;for(var Me=this.labels.length-1;Me>=0;Me--){var $e=this.labels[Me];if($e.statementStart===i.start)$e.statementStart=this.start,$e.kind=Le;else break}return this.labels.push({name:ve,kind:Le,statementStart:this.start}),i.body=this.parseStatement(_e?_e.indexOf("label")===-1?_e+"label":_e:"label"),this.labels.pop(),i.label=Ae,this.finishNode(i,"LabeledStatement")};st.parseExpressionStatement=function(i,ve){return i.expression=ve,this.semicolon(),this.finishNode(i,"ExpressionStatement")};st.parseBlock=function(i,ve,Ae){if(i===void 0)i=!0;if(ve===void 0)ve=this.startNode();if(ve.body=[],this.expect(je.braceL),i)this.enterScope(0);while(this.type!==je.braceR){var _e=this.parseStatement(null);ve.body.push(_e)}if(Ae)this.strict=!1;if(this.next(),i)this.exitScope();return this.finishNode(ve,"BlockStatement")};st.parseFor=function(i,ve){return i.init=ve,this.expect(je.semi),i.test=this.type===je.semi?null:this.parseExpression(),this.expect(je.semi),i.update=this.type===je.parenR?null:this.parseExpression(),this.expect(je.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,"ForStatement")};st.parseForIn=function(i,ve){var Ae=this.type===je._in;if(this.next(),ve.type==="VariableDeclaration"&&ve.declarations[0].init!=null&&(!Ae||this.options.ecmaVersion<8||this.strict||ve.kind!=="var"||ve.declarations[0].id.type!=="Identifier"))this.raise(ve.start,(Ae?"for-in":"for-of")+" loop variable declaration may not have an initializer");return i.left=ve,i.right=Ae?this.parseExpression():this.parseMaybeAssign(),this.expect(je.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,Ae?"ForInStatement":"ForOfStatement")};st.parseVar=function(i,ve,Ae,_e){i.declarations=[],i.kind=Ae;for(;;){var Ne=this.startNode();if(this.parseVarId(Ne,Ae),this.eat(je.eq))Ne.init=this.parseMaybeAssign(ve);else if(!_e&&Ae==="const"&&!(this.type===je._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!_e&&(Ae==="using"||Ae==="await using")&&this.options.ecmaVersion>=17&&this.type!==je._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Ae+" declaration");else if(!_e&&Ne.id.type!=="Identifier"&&!(ve&&(this.type===je._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else Ne.init=null;if(i.declarations.push(this.finishNode(Ne,"VariableDeclarator")),!this.eat(je.comma))break}return i};st.parseVarId=function(i,ve){i.id=ve==="using"||ve==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(i.id,ve==="var"?Js:mr,!1)};var an=1,qs=2,Ba=4;st.parseFunction=function(i,ve,Ae,_e,Ne){if(this.initFunction(i),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!_e){if(this.type===je.star&&ve&qs)this.unexpected();i.generator=this.eat(je.star)}if(this.options.ecmaVersion>=8)i.async=!!_e;if(ve&an){if(i.id=ve&Ba&&this.type!==je.name?null:this.parseIdent(),i.id&&!(ve&qs))this.checkLValSimple(i.id,this.strict||i.generator||i.async?this.treatFunctionsAsVar?Js:mr:La)}var Re=this.yieldPos,Ie=this.awaitPos,Le=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Xs(i.async,i.generator)),!(ve&an))i.id=this.type===je.name?this.parseIdent():null;return this.parseFunctionParams(i),this.parseFunctionBody(i,Ae,!1,Ne),this.yieldPos=Re,this.awaitPos=Ie,this.awaitIdentPos=Le,this.finishNode(i,ve&an?"FunctionDeclaration":"FunctionExpression")};st.parseFunctionParams=function(i){this.expect(je.parenL),i.params=this.parseBindingList(je.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};st.parseClass=function(i,ve){this.next();var Ae=this.strict;this.strict=!0,this.parseClassId(i,ve),this.parseClassSuper(i);var _e=this.enterClassBody(),Ne=this.startNode(),Re=!1;Ne.body=[],this.expect(je.braceL);while(this.type!==je.braceR){var Ie=this.parseClassElement(i.superClass!==null);if(Ie){if(Ne.body.push(Ie),Ie.type==="MethodDefinition"&&Ie.kind==="constructor"){if(Re)this.raiseRecoverable(Ie.start,"Duplicate constructor in the same class");Re=!0}else if(Ie.key&&Ie.key.type==="PrivateIdentifier"&&au(_e,Ie))this.raiseRecoverable(Ie.key.start,"Identifier '#"+Ie.key.name+"' has already been declared")}}return this.strict=Ae,this.next(),i.body=this.finishNode(Ne,"ClassBody"),this.exitClassBody(),this.finishNode(i,ve?"ClassDeclaration":"ClassExpression")};st.parseClassElement=function(i){if(this.eat(je.semi))return null;var ve=this.options.ecmaVersion,Ae=this.startNode(),_e="",Ne=!1,Re=!1,Ie="method",Le=!1;if(this.eatContextual("static")){if(ve>=13&&this.eat(je.braceL))return this.parseClassStaticBlock(Ae),Ae;if(this.isClassElementNameStart()||this.type===je.star)Le=!0;else _e="static"}if(Ae.static=Le,!_e&&ve>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===je.star)&&!this.canInsertSemicolon())Re=!0;else _e="async";if(!_e&&(ve>=9||!Re)&&this.eat(je.star))Ne=!0;if(!_e&&!Re&&!Ne){var Me=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Ie=Me;else _e=Me}if(_e)Ae.computed=!1,Ae.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Ae.key.name=_e,this.finishNode(Ae.key,"Identifier");else this.parseClassElementName(Ae);if(ve<13||this.type===je.parenL||Ie!=="method"||Ne||Re){var $e=!Ae.static&&Dn(Ae,"constructor"),Be=$e&&i;if($e&&Ie!=="method")this.raise(Ae.key.start,"Constructor can't have get/set modifier");Ae.kind=$e?"constructor":Ie,this.parseClassMethod(Ae,Ne,Re,Be)}else this.parseClassField(Ae);return Ae};st.isClassElementNameStart=function(){return this.type===je.name||this.type===je.privateId||this.type===je.num||this.type===je.string||this.type===je.bracketL||this.type.keyword};st.parseClassElementName=function(i){if(this.type===je.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");i.computed=!1,i.key=this.parsePrivateIdent()}else this.parsePropertyName(i)};st.parseClassMethod=function(i,ve,Ae,_e){var Ne=i.key;if(i.kind==="constructor"){if(ve)this.raise(Ne.start,"Constructor can't be a generator");if(Ae)this.raise(Ne.start,"Constructor can't be an async method")}else if(i.static&&Dn(i,"prototype"))this.raise(Ne.start,"Classes may not have a static property named prototype");var Re=i.value=this.parseMethod(ve,Ae,_e);if(i.kind==="get"&&Re.params.length!==0)this.raiseRecoverable(Re.start,"getter should have no params");if(i.kind==="set"&&Re.params.length!==1)this.raiseRecoverable(Re.start,"setter should have exactly one param");if(i.kind==="set"&&Re.params[0].type==="RestElement")this.raiseRecoverable(Re.params[0].start,"Setter cannot use rest params");return this.finishNode(i,"MethodDefinition")};st.parseClassField=function(i){if(Dn(i,"constructor"))this.raise(i.key.start,"Classes can't have a field named 'constructor'");else if(i.static&&Dn(i,"prototype"))this.raise(i.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(je.eq))this.enterScope(cn|Mn),i.value=this.parseMaybeAssign(),this.exitScope();else i.value=null;return this.semicolon(),this.finishNode(i,"PropertyDefinition")};st.parseClassStaticBlock=function(i){i.body=[];var ve=this.labels;this.labels=[],this.enterScope(Or|Mn);while(this.type!==je.braceR){var Ae=this.parseStatement(null);i.body.push(Ae)}return this.next(),this.exitScope(),this.labels=ve,this.finishNode(i,"StaticBlock")};st.parseClassId=function(i,ve){if(this.type===je.name){if(i.id=this.parseIdent(),ve)this.checkLValSimple(i.id,mr,!1)}else{if(ve===!0)this.unexpected();i.id=null}};st.parseClassSuper=function(i){i.superClass=this.eat(je._extends)?this.parseExprSubscripts(null,!1):null};st.enterClassBody=function(){var i={declared:Object.create(null),used:[]};return this.privateNameStack.push(i),i.declared};st.exitClassBody=function(){var i=this.privateNameStack.pop(),{declared:ve,used:Ae}=i;if(!this.options.checkPrivateFields)return;var _e=this.privateNameStack.length,Ne=_e===0?null:this.privateNameStack[_e-1];for(var Re=0;Re<Ae.length;++Re){var Ie=Ae[Re];if(!qr(ve,Ie.name))if(Ne)Ne.used.push(Ie);else this.raiseRecoverable(Ie.start,"Private field '#"+Ie.name+"' must be declared in an enclosing class")}};function au(i,ve){var Ae=ve.key.name,_e=i[Ae],Ne="true";if(ve.type==="MethodDefinition"&&(ve.kind==="get"||ve.kind==="set"))Ne=(ve.static?"s":"i")+ve.kind;if(_e==="iget"&&Ne==="iset"||_e==="iset"&&Ne==="iget"||_e==="sget"&&Ne==="sset"||_e==="sset"&&Ne==="sget")return i[Ae]="true",!1;else if(!_e)return i[Ae]=Ne,!1;else return!0}function Dn(i,ve){var{computed:Ae,key:_e}=i;return!Ae&&(_e.type==="Identifier"&&_e.name===ve||_e.type==="Literal"&&_e.value===ve)}st.parseExportAllDeclaration=function(i,ve){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))i.exported=this.parseModuleExportName(),this.checkExport(ve,i.exported,this.lastTokStart);else i.exported=null;if(this.expectContextual("from"),this.type!==je.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ExportAllDeclaration")};st.parseExport=function(i,ve){if(this.next(),this.eat(je.star))return this.parseExportAllDeclaration(i,ve);if(this.eat(je._default))return this.checkExport(ve,"default",this.lastTokStart),i.declaration=this.parseExportDefaultDeclaration(),this.finishNode(i,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(i.declaration=this.parseExportDeclaration(i),i.declaration.type==="VariableDeclaration")this.checkVariableExport(ve,i.declaration.declarations);else this.checkExport(ve,i.declaration.id,i.declaration.id.start);if(i.specifiers=[],i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}else{if(i.declaration=null,i.specifiers=this.parseExportSpecifiers(ve),this.eatContextual("from")){if(this.type!==je.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause()}else{for(var Ae=0,_e=i.specifiers;Ae<_e.length;Ae+=1){var Ne=_e[Ae];if(this.checkUnreserved(Ne.local),this.checkLocalExport(Ne.local),Ne.local.type==="Literal")this.raise(Ne.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}this.semicolon()}return this.finishNode(i,"ExportNamedDeclaration")};st.parseExportDeclaration=function(i){return this.parseStatement(null)};st.parseExportDefaultDeclaration=function(){var i;if(this.type===je._function||(i=this.isAsyncFunction())){var ve=this.startNode();if(this.next(),i)this.next();return this.parseFunction(ve,an|Ba,!1,i)}else if(this.type===je._class){var Ae=this.startNode();return this.parseClass(Ae,"nullableID")}else{var _e=this.parseMaybeAssign();return this.semicolon(),_e}};st.checkExport=function(i,ve,Ae){if(!i)return;if(typeof ve!=="string")ve=ve.type==="Identifier"?ve.name:ve.value;if(qr(i,ve))this.raiseRecoverable(Ae,"Duplicate export '"+ve+"'");i[ve]=!0};st.checkPatternExport=function(i,ve){var Ae=ve.type;if(Ae==="Identifier")this.checkExport(i,ve,ve.start);else if(Ae==="ObjectPattern")for(var _e=0,Ne=ve.properties;_e<Ne.length;_e+=1){var Re=Ne[_e];this.checkPatternExport(i,Re)}else if(Ae==="ArrayPattern")for(var Ie=0,Le=ve.elements;Ie<Le.length;Ie+=1){var Me=Le[Ie];if(Me)this.checkPatternExport(i,Me)}else if(Ae==="Property")this.checkPatternExport(i,ve.value);else if(Ae==="AssignmentPattern")this.checkPatternExport(i,ve.left);else if(Ae==="RestElement")this.checkPatternExport(i,ve.argument)};st.checkVariableExport=function(i,ve){if(!i)return;for(var Ae=0,_e=ve;Ae<_e.length;Ae+=1){var Ne=_e[Ae];this.checkPatternExport(i,Ne.id)}};st.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};st.parseExportSpecifier=function(i){var ve=this.startNode();return ve.local=this.parseModuleExportName(),ve.exported=this.eatContextual("as")?this.parseModuleExportName():ve.local,this.checkExport(i,ve.exported,ve.exported.start),this.finishNode(ve,"ExportSpecifier")};st.parseExportSpecifiers=function(i){var ve=[],Ae=!0;this.expect(je.braceL);while(!this.eat(je.braceR)){if(!Ae){if(this.expect(je.comma),this.afterTrailingComma(je.braceR))break}else Ae=!1;ve.push(this.parseExportSpecifier(i))}return ve};st.parseImport=function(i){if(this.next(),this.type===je.string)i.specifiers=iu,i.source=this.parseExprAtom();else i.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),i.source=this.type===je.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ImportDeclaration")};st.parseImportSpecifier=function(){var i=this.startNode();if(i.imported=this.parseModuleExportName(),this.eatContextual("as"))i.local=this.parseIdent();else this.checkUnreserved(i.imported),i.local=i.imported;return this.checkLValSimple(i.local,mr),this.finishNode(i,"ImportSpecifier")};st.parseImportDefaultSpecifier=function(){var i=this.startNode();return i.local=this.parseIdent(),this.checkLValSimple(i.local,mr),this.finishNode(i,"ImportDefaultSpecifier")};st.parseImportNamespaceSpecifier=function(){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,mr),this.finishNode(i,"ImportNamespaceSpecifier")};st.parseImportSpecifiers=function(){var i=[],ve=!0;if(this.type===je.name){if(i.push(this.parseImportDefaultSpecifier()),!this.eat(je.comma))return i}if(this.type===je.star)return i.push(this.parseImportNamespaceSpecifier()),i;this.expect(je.braceL);while(!this.eat(je.braceR)){if(!ve){if(this.expect(je.comma),this.afterTrailingComma(je.braceR))break}else ve=!1;i.push(this.parseImportSpecifier())}return i};st.parseWithClause=function(){var i=[];if(!this.eat(je._with))return i;this.expect(je.braceL);var ve={},Ae=!0;while(!this.eat(je.braceR)){if(!Ae){if(this.expect(je.comma),this.afterTrailingComma(je.braceR))break}else Ae=!1;var _e=this.parseImportAttribute(),Ne=_e.key.type==="Identifier"?_e.key.name:_e.key.value;if(qr(ve,Ne))this.raiseRecoverable(_e.key.start,"Duplicate attribute key '"+Ne+"'");ve[Ne]=!0,i.push(_e)}return i};st.parseImportAttribute=function(){var i=this.startNode();if(i.key=this.type===je.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(je.colon),this.type!==je.string)this.unexpected();return i.value=this.parseExprAtom(),this.finishNode(i,"ImportAttribute")};st.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===je.string){var i=this.parseLiteral(this.value);if(eu.test(i.value))this.raise(i.start,"An export name cannot include a lone surrogate.");return i}return this.parseIdent(!0)};st.adaptDirectivePrologue=function(i){for(var ve=0;ve<i.length&&this.isDirectiveCandidate(i[ve]);++ve)i[ve].directive=i[ve].expression.raw.slice(1,-1)};st.isDirectiveCandidate=function(i){return this.options.ecmaVersion>=5&&i.type==="ExpressionStatement"&&i.expression.type==="Literal"&&typeof i.expression.value==="string"&&(this.input[i.start]==='"'||this.input[i.start]==="'")};var nr=wt.prototype;nr.toAssignable=function(i,ve,Ae){if(this.options.ecmaVersion>=6&&i)switch(i.type){case"Identifier":if(this.inAsync&&i.name==="await")this.raise(i.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(i.type="ObjectPattern",Ae)this.checkPatternErrors(Ae,!0);for(var _e=0,Ne=i.properties;_e<Ne.length;_e+=1){var Re=Ne[_e];if(this.toAssignable(Re,ve),Re.type==="RestElement"&&(Re.argument.type==="ArrayPattern"||Re.argument.type==="ObjectPattern"))this.raise(Re.argument.start,"Unexpected token")}break;case"Property":if(i.kind!=="init")this.raise(i.key.start,"Object pattern can't contain getter or setter");this.toAssignable(i.value,ve);break;case"ArrayExpression":if(i.type="ArrayPattern",Ae)this.checkPatternErrors(Ae,!0);this.toAssignableList(i.elements,ve);break;case"SpreadElement":if(i.type="RestElement",this.toAssignable(i.argument,ve),i.argument.type==="AssignmentPattern")this.raise(i.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(i.operator!=="=")this.raise(i.left.end,"Only '=' operator can be used for specifying default value.");i.type="AssignmentPattern",delete i.operator,this.toAssignable(i.left,ve);break;case"ParenthesizedExpression":this.toAssignable(i.expression,ve,Ae);break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!ve)break;default:this.raise(i.start,"Assigning to rvalue")}else if(Ae)this.checkPatternErrors(Ae,!0);return i};nr.toAssignableList=function(i,ve){var Ae=i.length;for(var _e=0;_e<Ae;_e++){var Ne=i[_e];if(Ne)this.toAssignable(Ne,ve)}if(Ae){var Re=i[Ae-1];if(this.options.ecmaVersion===6&&ve&&Re&&Re.type==="RestElement"&&Re.argument.type!=="Identifier")this.unexpected(Re.argument.start)}return i};nr.parseSpread=function(i){var ve=this.startNode();return this.next(),ve.argument=this.parseMaybeAssign(!1,i),this.finishNode(ve,"SpreadElement")};nr.parseRestBinding=function(){var i=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==je.name)this.unexpected();return i.argument=this.parseBindingAtom(),this.finishNode(i,"RestElement")};nr.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case je.bracketL:var i=this.startNode();return this.next(),i.elements=this.parseBindingList(je.bracketR,!0,!0),this.finishNode(i,"ArrayPattern");case je.braceL:return this.parseObj(!0)}return this.parseIdent()};nr.parseBindingList=function(i,ve,Ae,_e){var Ne=[],Re=!0;while(!this.eat(i)){if(Re)Re=!1;else this.expect(je.comma);if(ve&&this.type===je.comma)Ne.push(null);else if(Ae&&this.afterTrailingComma(i))break;else if(this.type===je.ellipsis){var Ie=this.parseRestBinding();if(this.parseBindingListItem(Ie),Ne.push(Ie),this.type===je.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(i);break}else Ne.push(this.parseAssignableListItem(_e))}return Ne};nr.parseAssignableListItem=function(i){var ve=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(ve),ve};nr.parseBindingListItem=function(i){return i};nr.parseMaybeDefault=function(i,ve,Ae){if(Ae=Ae||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(je.eq))return Ae;var _e=this.startNodeAt(i,ve);return _e.left=Ae,_e.right=this.parseMaybeAssign(),this.finishNode(_e,"AssignmentPattern")};nr.checkLValSimple=function(i,ve,Ae){if(ve===void 0)ve=In;var _e=ve!==In;switch(i.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(i.name))this.raiseRecoverable(i.start,(_e?"Binding ":"Assigning to ")+i.name+" in strict mode");if(_e){if(ve===mr&&i.name==="let")this.raiseRecoverable(i.start,"let is disallowed as a lexically bound name");if(Ae){if(qr(Ae,i.name))this.raiseRecoverable(i.start,"Argument name clash");Ae[i.name]=!0}if(ve!==Ma)this.declareName(i.name,ve,i.start)}break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(_e)this.raiseRecoverable(i.start,"Binding member expression");break;case"ParenthesizedExpression":if(_e)this.raiseRecoverable(i.start,"Binding parenthesized expression");return this.checkLValSimple(i.expression,ve,Ae);default:this.raise(i.start,(_e?"Binding":"Assigning to")+" rvalue")}};nr.checkLValPattern=function(i,ve,Ae){if(ve===void 0)ve=In;switch(i.type){case"ObjectPattern":for(var _e=0,Ne=i.properties;_e<Ne.length;_e+=1){var Re=Ne[_e];this.checkLValInnerPattern(Re,ve,Ae)}break;case"ArrayPattern":for(var Ie=0,Le=i.elements;Ie<Le.length;Ie+=1){var Me=Le[Ie];if(Me)this.checkLValInnerPattern(Me,ve,Ae)}break;default:this.checkLValSimple(i,ve,Ae)}};nr.checkLValInnerPattern=function(i,ve,Ae){if(ve===void 0)ve=In;switch(i.type){case"Property":this.checkLValInnerPattern(i.value,ve,Ae);break;case"AssignmentPattern":this.checkLValPattern(i.left,ve,Ae);break;case"RestElement":this.checkLValPattern(i.argument,ve,Ae);break;default:this.checkLValPattern(i,ve,Ae)}};var er=function(ve,Ae,_e,Ne,Re){this.token=ve,this.isExpr=!!Ae,this.preserveSpace=!!_e,this.override=Ne,this.generator=!!Re},kt={b_stat:new er("{",!1),b_expr:new er("{",!0),b_tmpl:new er("${",!1),p_stat:new er("(",!1),p_expr:new er("(",!0),q_tmpl:new er("`",!0,!0,function(i){return i.tryReadTemplateToken()}),f_stat:new er("function",!1),f_expr:new er("function",!0),f_expr_gen:new er("function",!0,!1,null,!0),f_gen:new er("function",!1,!1,null,!0)},Ur=wt.prototype;Ur.initialContext=function(){return[kt.b_stat]};Ur.curContext=function(){return this.context[this.context.length-1]};Ur.braceIsBlock=function(i){var ve=this.curContext();if(ve===kt.f_expr||ve===kt.f_stat)return!0;if(i===je.colon&&(ve===kt.b_stat||ve===kt.b_expr))return!ve.isExpr;if(i===je._return||i===je.name&&this.exprAllowed)return jt.test(this.input.slice(this.lastTokEnd,this.start));if(i===je._else||i===je.semi||i===je.eof||i===je.parenR||i===je.arrow)return!0;if(i===je.braceL)return ve===kt.b_stat;if(i===je._var||i===je._const||i===je.name)return!1;return!this.exprAllowed};Ur.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var ve=this.context[i];if(ve.token==="function")return ve.generator}return!1};Ur.updateContext=function(i){var ve,Ae=this.type;if(Ae.keyword&&i===je.dot)this.exprAllowed=!1;else if(ve=Ae.updateContext)ve.call(this,i);else this.exprAllowed=Ae.beforeExpr};Ur.overrideContext=function(i){if(this.curContext()!==i)this.context[this.context.length-1]=i};je.parenR.updateContext=je.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var i=this.context.pop();if(i===kt.b_stat&&this.curContext().token==="function")i=this.context.pop();this.exprAllowed=!i.isExpr};je.braceL.updateContext=function(i){this.context.push(this.braceIsBlock(i)?kt.b_stat:kt.b_expr),this.exprAllowed=!0};je.dollarBraceL.updateContext=function(){this.context.push(kt.b_tmpl),this.exprAllowed=!0};je.parenL.updateContext=function(i){var ve=i===je._if||i===je._for||i===je._with||i===je._while;this.context.push(ve?kt.p_stat:kt.p_expr),this.exprAllowed=!0};je.incDec.updateContext=function(){};je._function.updateContext=je._class.updateContext=function(i){if(i.beforeExpr&&i!==je._else&&!(i===je.semi&&this.curContext()!==kt.p_stat)&&!(i===je._return&&jt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((i===je.colon||i===je.braceL)&&this.curContext()===kt.b_stat))this.context.push(kt.f_expr);else this.context.push(kt.f_stat);this.exprAllowed=!1};je.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};je.backQuote.updateContext=function(){if(this.curContext()===kt.q_tmpl)this.context.pop();else this.context.push(kt.q_tmpl);this.exprAllowed=!1};je.star.updateContext=function(i){if(i===je._function){var ve=this.context.length-1;if(this.context[ve]===kt.f_expr)this.context[ve]=kt.f_expr_gen;else this.context[ve]=kt.f_gen}this.exprAllowed=!0};je.name.updateContext=function(i){var ve=!1;if(this.options.ecmaVersion>=6&&i!==je.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())ve=!0}this.exprAllowed=ve};var pt=wt.prototype;pt.checkPropClash=function(i,ve,Ae){if(this.options.ecmaVersion>=9&&i.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(i.computed||i.method||i.shorthand))return;var _e=i.key,Ne;switch(_e.type){case"Identifier":Ne=_e.name;break;case"Literal":Ne=String(_e.value);break;default:return}var Re=i.kind;if(this.options.ecmaVersion>=6){if(Ne==="__proto__"&&Re==="init"){if(ve.proto)if(Ae){if(Ae.doubleProto<0)Ae.doubleProto=_e.start}else this.raiseRecoverable(_e.start,"Redefinition of __proto__ property");ve.proto=!0}return}Ne="$"+Ne;var Ie=ve[Ne];if(Ie){var Le;if(Re==="init")Le=this.strict&&Ie.init||Ie.get||Ie.set;else Le=Ie.init||Ie[Re];if(Le)this.raiseRecoverable(_e.start,"Redefinition of property")}else Ie=ve[Ne]={init:!1,get:!1,set:!1};Ie[Re]=!0};pt.parseExpression=function(i,ve){var Ae=this;return this.catchStackOverflow(function(){var{start:_e,startLoc:Ne}=Ae,Re=Ae.parseMaybeAssign(i,ve);if(Ae.type===je.comma){var Ie=Ae.startNodeAt(_e,Ne);Ie.expressions=[Re];while(Ae.eat(je.comma))Ie.expressions.push(Ae.parseMaybeAssign(i,ve));return Ae.finishNode(Ie,"SequenceExpression")}return Re})};pt.parseMaybeAssign=function(i,ve,Ae){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(i);else this.exprAllowed=!1;var _e=!1,Ne=-1,Re=-1,Ie=-1;if(ve)Ne=ve.parenthesizedAssign,Re=ve.trailingComma,Ie=ve.doubleProto,ve.parenthesizedAssign=ve.trailingComma=-1;else ve=new $n,_e=!0;var Le=this.start,Me=this.startLoc;if(this.type===je.parenL||this.type===je.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=i==="await";var $e=this.parseMaybeConditional(i,ve);if(Ae)$e=Ae.call(this,$e,Le,Me);if(this.type.isAssign){var Be=this.startNodeAt(Le,Me);if(Be.operator=this.value,this.type===je.eq)$e=this.toAssignable($e,!1,ve);if(!_e)ve.parenthesizedAssign=ve.trailingComma=ve.doubleProto=-1;if(ve.shorthandAssign>=$e.start)ve.shorthandAssign=-1;if(this.type===je.eq)this.checkLValPattern($e);else this.checkLValSimple($e);if(Be.left=$e,this.next(),Be.right=this.parseMaybeAssign(i),Ie>-1)ve.doubleProto=Ie;return this.finishNode(Be,"AssignmentExpression")}else if(_e)this.checkExpressionErrors(ve,!0);if(Ne>-1)ve.parenthesizedAssign=Ne;if(Re>-1)ve.trailingComma=Re;return $e};pt.parseMaybeConditional=function(i,ve){var Ae=this.start,_e=this.startLoc,Ne=this.parseExprOps(i,ve);if(this.checkExpressionErrors(ve))return Ne;if(!(Ne.type==="ArrowFunctionExpression"&&Ne.start===Ae)&&this.eat(je.question)){var Re=this.startNodeAt(Ae,_e);return Re.test=Ne,Re.consequent=this.parseMaybeAssign(),this.expect(je.colon),Re.alternate=this.parseMaybeAssign(i),this.finishNode(Re,"ConditionalExpression")}return Ne};pt.parseExprOps=function(i,ve){var Ae=this.start,_e=this.startLoc,Ne=this.parseMaybeUnary(ve,!1,!1,i);if(this.checkExpressionErrors(ve))return Ne;return Ne.start===Ae&&Ne.type==="ArrowFunctionExpression"?Ne:this.parseExprOp(Ne,Ae,_e,-1,i)};pt.parseExprOp=function(i,ve,Ae,_e,Ne){var Re=this.type.binop;if(Re!=null&&(!Ne||this.type!==je._in)){if(Re>_e){var Ie=this.type===je.logicalOR||this.type===je.logicalAND,Le=this.type===je.coalesce;if(Le)Re=je.logicalAND.binop;var Me=this.value;this.next();var $e=this.start,Be=this.startLoc,Ve=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Ne),$e,Be,Re,Ne),Ue=this.buildBinary(ve,Ae,i,Ve,Me,Ie||Le);if(Ie&&this.type===je.coalesce||Le&&(this.type===je.logicalOR||this.type===je.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(Ue,ve,Ae,_e,Ne)}}return i};pt.buildBinary=function(i,ve,Ae,_e,Ne,Re){if(_e.type==="PrivateIdentifier")this.raise(_e.start,"Private identifier can only be left side of binary expression");var Ie=this.startNodeAt(i,ve);return Ie.left=Ae,Ie.operator=Ne,Ie.right=_e,this.finishNode(Ie,Re?"LogicalExpression":"BinaryExpression")};pt.parseMaybeUnary=function(i,ve,Ae,_e){var Ne=this.start,Re=this.startLoc,Ie;if(this.isContextual("await")&&this.canAwait)Ie=this.parseAwait(_e),ve=!0;else if(this.type.prefix){var Le=this.startNode(),Me=this.type===je.incDec;if(Le.operator=this.value,Le.prefix=!0,this.next(),Le.argument=this.parseMaybeUnary(null,!0,Me,_e),this.checkExpressionErrors(i,!0),Me)this.checkLValSimple(Le.argument);else if(this.strict&&Le.operator==="delete"&&$a(Le.argument))this.raiseRecoverable(Le.start,"Deleting local variable in strict mode");else if(Le.operator==="delete"&&Us(Le.argument))this.raiseRecoverable(Le.start,"Private fields can not be deleted");else ve=!0;Ie=this.finishNode(Le,Me?"UpdateExpression":"UnaryExpression")}else if(!ve&&this.type===je.privateId){if((_e||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Ie=this.parsePrivateIdent(),this.type!==je._in)this.unexpected()}else{if(Ie=this.parseExprSubscripts(i,_e),this.checkExpressionErrors(i))return Ie;while(this.type.postfix&&!this.canInsertSemicolon()){var $e=this.startNodeAt(Ne,Re);$e.operator=this.value,$e.prefix=!1,$e.argument=Ie,this.checkLValSimple(Ie),this.next(),Ie=this.finishNode($e,"UpdateExpression")}}if(!Ae&&!(Ie.type==="ArrowFunctionExpression"&&Ie.start===Ne)&&this.eat(je.starstar))if(ve)this.unexpected(this.lastTokStart);else return this.buildBinary(Ne,Re,Ie,this.parseMaybeUnary(null,!1,!1,_e),"**",!1);else return Ie};function $a(i){return i.type==="Identifier"||i.type==="ParenthesizedExpression"&&$a(i.expression)}function Us(i){return i.type==="MemberExpression"&&i.property.type==="PrivateIdentifier"||i.type==="ChainExpression"&&Us(i.expression)||i.type==="ParenthesizedExpression"&&Us(i.expression)}pt.parseExprSubscripts=function(i,ve){var Ae=this.start,_e=this.startLoc,Ne=this.parseExprAtom(i,ve);if(Ne.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Ne;var Re=this.parseSubscripts(Ne,Ae,_e,!1,ve);if(i&&Re.type==="MemberExpression"){if(i.parenthesizedAssign>=Re.start)i.parenthesizedAssign=-1;if(i.parenthesizedBind>=Re.start)i.parenthesizedBind=-1;if(i.trailingComma>=Re.start)i.trailingComma=-1}return Re};pt.parseSubscripts=function(i,ve,Ae,_e,Ne){var Re=this.options.ecmaVersion>=8&&i.type==="Identifier"&&i.name==="async"&&this.lastTokEnd===i.end&&!this.canInsertSemicolon()&&i.end-i.start===5&&this.potentialArrowAt===i.start,Ie=!1;while(!0){var Le=this.parseSubscript(i,ve,Ae,_e,Re,Ie,Ne);if(Le.optional)Ie=!0;if(Le===i||Le.type==="ArrowFunctionExpression"){if(Ie){var Me=this.startNodeAt(ve,Ae);Me.expression=Le,Le=this.finishNode(Me,"ChainExpression")}return Le}i=Le}};pt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(je.arrow)};pt.parseSubscriptAsyncArrow=function(i,ve,Ae,_e){return this.parseArrowExpression(this.startNodeAt(i,ve),Ae,!0,_e)};pt.parseSubscript=function(i,ve,Ae,_e,Ne,Re,Ie){var Le=this.options.ecmaVersion>=11,Me=Le&&this.eat(je.questionDot);if(_e&&Me)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var $e=this.eat(je.bracketL);if($e||Me&&this.type!==je.parenL&&this.type!==je.backQuote||this.eat(je.dot)){var Be=this.startNodeAt(ve,Ae);if(Be.object=i,$e)Be.property=this.parseExpression(),this.expect(je.bracketR);else if(this.type===je.privateId&&i.type!=="Super")Be.property=this.parsePrivateIdent();else Be.property=this.parseIdent(this.options.allowReserved!=="never");if(Be.computed=!!$e,Le)Be.optional=Me;i=this.finishNode(Be,"MemberExpression")}else if(!_e&&this.eat(je.parenL)){var Ve=new $n,Ue=this.yieldPos,Ge=this.awaitPos,Xe=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Je=this.parseExprList(je.parenR,this.options.ecmaVersion>=8,!1,Ve);if(Ne&&!Me&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Ve,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=Ue,this.awaitPos=Ge,this.awaitIdentPos=Xe,this.parseSubscriptAsyncArrow(ve,Ae,Je,Ie)}this.checkExpressionErrors(Ve,!0),this.yieldPos=Ue||this.yieldPos,this.awaitPos=Ge||this.awaitPos,this.awaitIdentPos=Xe||this.awaitIdentPos;var Ke=this.startNodeAt(ve,Ae);if(Ke.callee=i,Ke.arguments=Je,Le)Ke.optional=Me;i=this.finishNode(Ke,"CallExpression")}else if(this.type===je.backQuote){if(Me||Re)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var et=this.startNodeAt(ve,Ae);et.tag=i,et.quasi=this.parseTemplate({isTagged:!0}),i=this.finishNode(et,"TaggedTemplateExpression")}return i};pt.parseExprAtom=function(i,ve,Ae){if(this.type===je.slash)this.readRegexp();var _e,Ne=this.potentialArrowAt===this.start;switch(this.type){case je._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(_e=this.startNode(),this.next(),this.type===je.parenL&&!this.allowDirectSuper)this.raise(_e.start,"super() call outside constructor of a subclass");if(this.type!==je.dot&&this.type!==je.bracketL&&this.type!==je.parenL)this.unexpected();return this.finishNode(_e,"Super");case je._this:return _e=this.startNode(),this.next(),this.finishNode(_e,"ThisExpression");case je.name:var Re=this.start,Ie=this.startLoc,Le=this.containsEsc,Me=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Le&&Me.name==="async"&&!this.canInsertSemicolon()&&this.eat(je._function))return this.overrideContext(kt.f_expr),this.parseFunction(this.startNodeAt(Re,Ie),0,!1,!0,ve);if(Ne&&!this.canInsertSemicolon()){if(this.eat(je.arrow))return this.parseArrowExpression(this.startNodeAt(Re,Ie),[Me],!1,ve);if(this.options.ecmaVersion>=8&&Me.name==="async"&&this.type===je.name&&!Le&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Me=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(je.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(Re,Ie),[Me],!0,ve)}}return Me;case je.regexp:var $e=this.value;return _e=this.parseLiteral($e.value),_e.regex={pattern:$e.pattern,flags:$e.flags},_e;case je.num:case je.string:return this.parseLiteral(this.value);case je._null:case je._true:case je._false:return _e=this.startNode(),_e.value=this.type===je._null?null:this.type===je._true,_e.raw=this.type.keyword,this.next(),this.finishNode(_e,"Literal");case je.parenL:var Be=this.start,Ve=this.parseParenAndDistinguishExpression(Ne,ve);if(i){if(i.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ve))i.parenthesizedAssign=Be;if(i.parenthesizedBind<0)i.parenthesizedBind=Be}return Ve;case je.bracketL:return _e=this.startNode(),this.next(),_e.elements=this.parseExprList(je.bracketR,!0,!0,i),this.finishNode(_e,"ArrayExpression");case je.braceL:return this.overrideContext(kt.b_expr),this.parseObj(!1,i);case je._function:return _e=this.startNode(),this.next(),this.parseFunction(_e,0);case je._class:return this.parseClass(this.startNode(),!1);case je._new:return this.parseNew();case je.backQuote:return this.parseTemplate();case je._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Ae);else return this.unexpected();default:return this.parseExprAtomDefault()}};pt.parseExprAtomDefault=function(){this.unexpected()};pt.parseExprImport=function(i){var ve=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===je.parenL&&!i)return this.parseDynamicImport(ve);else if(this.type===je.dot){var Ae=this.startNodeAt(ve.start,ve.loc&&ve.loc.start);return Ae.name="import",ve.meta=this.finishNode(Ae,"Identifier"),this.parseImportMeta(ve)}else this.unexpected()};pt.parseDynamicImport=function(i){if(this.next(),i.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(je.parenR))if(this.expect(je.comma),!this.afterTrailingComma(je.parenR)){if(i.options=this.parseMaybeAssign(),!this.eat(je.parenR)){if(this.expect(je.comma),!this.afterTrailingComma(je.parenR))this.unexpected()}}else i.options=null;else i.options=null;else if(!this.eat(je.parenR)){var ve=this.start;if(this.eat(je.comma)&&this.eat(je.parenR))this.raiseRecoverable(ve,"Trailing comma is not allowed in import()");else this.unexpected(ve)}return this.finishNode(i,"ImportExpression")};pt.parseImportMeta=function(i){this.next();var ve=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="meta")this.raiseRecoverable(i.property.start,"The only valid meta property for import is 'import.meta'");if(ve)this.raiseRecoverable(i.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(i.start,"Cannot use 'import.meta' outside a module");return this.finishNode(i,"MetaProperty")};pt.parseLiteral=function(i){var ve=this.startNode();if(ve.value=i,ve.raw=this.input.slice(this.start,this.end),ve.raw.charCodeAt(ve.raw.length-1)===110)ve.bigint=ve.value!=null?ve.value.toString():ve.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(ve,"Literal")};pt.parseParenExpression=function(){this.expect(je.parenL);var i=this.parseExpression();return this.expect(je.parenR),i};pt.shouldParseArrow=function(i){return!this.canInsertSemicolon()};pt.parseParenAndDistinguishExpression=function(i,ve){var Ae=this.start,_e=this.startLoc,Ne,Re=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Ie=this.start,Le=this.startLoc,Me=[],$e=!0,Be=!1,Ve=new $n,Ue=this.yieldPos,Ge=this.awaitPos,Xe;this.yieldPos=0,this.awaitPos=0;while(this.type!==je.parenR)if($e?$e=!1:this.expect(je.comma),Re&&this.afterTrailingComma(je.parenR,!0)){Be=!0;break}else if(this.type===je.ellipsis){if(Xe=this.start,Me.push(this.parseParenItem(this.parseRestBinding())),this.type===je.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Me.push(this.parseMaybeAssign(!1,Ve,this.parseParenItem));var Je=this.lastTokEnd,Ke=this.lastTokEndLoc;if(this.expect(je.parenR),i&&this.shouldParseArrow(Me)&&this.eat(je.arrow))return this.checkPatternErrors(Ve,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Ue,this.awaitPos=Ge,this.parseParenArrowList(Ae,_e,Me,ve);if(!Me.length||Be)this.unexpected(this.lastTokStart);if(Xe)this.unexpected(Xe);if(this.checkExpressionErrors(Ve,!0),this.yieldPos=Ue||this.yieldPos,this.awaitPos=Ge||this.awaitPos,Me.length>1)Ne=this.startNodeAt(Ie,Le),Ne.expressions=Me,this.finishNodeAt(Ne,"SequenceExpression",Je,Ke);else Ne=Me[0]}else Ne=this.parseParenExpression();if(this.options.preserveParens){var et=this.startNodeAt(Ae,_e);return et.expression=Ne,this.finishNode(et,"ParenthesizedExpression")}else return Ne};pt.parseParenItem=function(i){return i};pt.parseParenArrowList=function(i,ve,Ae,_e){return this.parseArrowExpression(this.startNodeAt(i,ve),Ae,!1,_e)};var ou=[];pt.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var i=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===je.dot){var ve=this.startNodeAt(i.start,i.loc&&i.loc.start);ve.name="new",i.meta=this.finishNode(ve,"Identifier"),this.next();var Ae=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="target")this.raiseRecoverable(i.property.start,"The only valid meta property for new is 'new.target'");if(Ae)this.raiseRecoverable(i.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(i.start,"'new.target' can only be used in functions and class static block");return this.finishNode(i,"MetaProperty")}var _e=this.start,Ne=this.startLoc;if(i.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),_e,Ne,!0,!1),i.callee.type==="Super")this.raiseRecoverable(_e,"Invalid use of 'super'");if(this.eat(je.parenL))i.arguments=this.parseExprList(je.parenR,this.options.ecmaVersion>=8,!1);else i.arguments=ou;return this.finishNode(i,"NewExpression")};pt.parseTemplateElement=function(i){var ve=i.isTagged,Ae=this.startNode();if(this.type===je.invalidTemplate){if(!ve)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Ae.value={raw:this.value.replace(/\r\n?/g,`
4
- `),cooked:null}}else Ae.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
5
- `),cooked:this.value};return this.next(),Ae.tail=this.type===je.backQuote,this.finishNode(Ae,"TemplateElement")};pt.parseTemplate=function(i){if(i===void 0)i={};var ve=i.isTagged;if(ve===void 0)ve=!1;var Ae=this.startNode();this.next(),Ae.expressions=[];var _e=this.parseTemplateElement({isTagged:ve});Ae.quasis=[_e];while(!_e.tail){if(this.type===je.eof)this.raise(this.pos,"Unterminated template literal");this.expect(je.dollarBraceL),Ae.expressions.push(this.parseExpression()),this.expect(je.braceR),Ae.quasis.push(_e=this.parseTemplateElement({isTagged:ve}))}return this.next(),this.finishNode(Ae,"TemplateLiteral")};pt.isAsyncProp=function(i){return!i.computed&&i.key.type==="Identifier"&&i.key.name==="async"&&(this.type===je.name||this.type===je.num||this.type===je.string||this.type===je.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===je.star)&&!jt.test(this.input.slice(this.lastTokEnd,this.start))};pt.parseObj=function(i,ve){var Ae=this.startNode(),_e=!0,Ne={};Ae.properties=[],this.next();while(!this.eat(je.braceR)){if(!_e){if(this.expect(je.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(je.braceR))break}else _e=!1;var Re=this.parseProperty(i,ve);if(!i)this.checkPropClash(Re,Ne,ve);Ae.properties.push(Re)}return this.finishNode(Ae,i?"ObjectPattern":"ObjectExpression")};pt.parseProperty=function(i,ve){var Ae=this.startNode(),_e,Ne,Re,Ie;if(this.options.ecmaVersion>=9&&this.eat(je.ellipsis)){if(i){if(Ae.argument=this.parseIdent(!1),this.type===je.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(Ae,"RestElement")}if(Ae.argument=this.parseMaybeAssign(!1,ve),this.type===je.comma&&ve&&ve.trailingComma<0)ve.trailingComma=this.start;return this.finishNode(Ae,"SpreadElement")}if(this.options.ecmaVersion>=6){if(Ae.method=!1,Ae.shorthand=!1,i||ve)Re=this.start,Ie=this.startLoc;if(!i)_e=this.eat(je.star)}var Le=this.containsEsc;if(this.parsePropertyName(Ae),!i&&!Le&&this.options.ecmaVersion>=8&&!_e&&this.isAsyncProp(Ae))Ne=!0,_e=this.options.ecmaVersion>=9&&this.eat(je.star),this.parsePropertyName(Ae);else Ne=!1;return this.parsePropertyValue(Ae,i,_e,Ne,Re,Ie,ve,Le),this.finishNode(Ae,"Property")};pt.parseGetterSetter=function(i){var ve=i.key.name;this.parsePropertyName(i),i.value=this.parseMethod(!1),i.kind=ve;var Ae=i.kind==="get"?0:1;if(i.value.params.length!==Ae){var _e=i.value.start;if(i.kind==="get")this.raiseRecoverable(_e,"getter should have no params");else this.raiseRecoverable(_e,"setter should have exactly one param")}else if(i.kind==="set"&&i.value.params[0].type==="RestElement")this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params")};pt.parsePropertyValue=function(i,ve,Ae,_e,Ne,Re,Ie,Le){if((Ae||_e)&&this.type===je.colon)this.unexpected();if(this.eat(je.colon))i.value=ve?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Ie),i.kind="init";else if(this.options.ecmaVersion>=6&&this.type===je.parenL){if(ve)this.unexpected();i.method=!0,i.value=this.parseMethod(Ae,_e),i.kind="init"}else if(!ve&&!Le&&this.options.ecmaVersion>=5&&!i.computed&&i.key.type==="Identifier"&&(i.key.name==="get"||i.key.name==="set")&&(this.type!==je.comma&&this.type!==je.braceR&&this.type!==je.eq)){if(Ae||_e)this.unexpected();this.parseGetterSetter(i)}else if(this.options.ecmaVersion>=6&&!i.computed&&i.key.type==="Identifier"){if(Ae||_e)this.unexpected();if(this.checkUnreserved(i.key),i.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Ne;if(ve)i.value=this.parseMaybeDefault(Ne,Re,this.copyNode(i.key));else if(this.type===je.eq&&Ie){if(Ie.shorthandAssign<0)Ie.shorthandAssign=this.start;i.value=this.parseMaybeDefault(Ne,Re,this.copyNode(i.key))}else i.value=this.copyNode(i.key);i.kind="init",i.shorthand=!0}else this.unexpected()};pt.parsePropertyName=function(i){if(this.options.ecmaVersion>=6)if(this.eat(je.bracketL))return i.computed=!0,i.key=this.parseMaybeAssign(),this.expect(je.bracketR),i.key;else i.computed=!1;return i.key=this.type===je.num||this.type===je.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};pt.initFunction=function(i){if(i.id=null,this.options.ecmaVersion>=6)i.generator=i.expression=!1;if(this.options.ecmaVersion>=8)i.async=!1};pt.parseMethod=function(i,ve,Ae){var _e=this.startNode(),Ne=this.yieldPos,Re=this.awaitPos,Ie=this.awaitIdentPos;if(this.initFunction(_e),this.options.ecmaVersion>=6)_e.generator=i;if(this.options.ecmaVersion>=8)_e.async=!!ve;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Xs(ve,_e.generator)|Mn|(Ae?Da:0)),this.expect(je.parenL),_e.params=this.parseBindingList(je.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(_e,!1,!0,!1),this.yieldPos=Ne,this.awaitPos=Re,this.awaitIdentPos=Ie,this.finishNode(_e,"FunctionExpression")};pt.parseArrowExpression=function(i,ve,Ae,_e){var Ne=this.yieldPos,Re=this.awaitPos,Ie=this.awaitIdentPos;if(this.enterScope(Xs(Ae,!1)|zs),this.initFunction(i),this.options.ecmaVersion>=8)i.async=!!Ae;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,i.params=this.toAssignableList(ve,!0),this.parseFunctionBody(i,!0,!1,_e),this.yieldPos=Ne,this.awaitPos=Re,this.awaitIdentPos=Ie,this.finishNode(i,"ArrowFunctionExpression")};pt.parseFunctionBody=function(i,ve,Ae,_e){var Ne=ve&&this.type!==je.braceL,Re=this.strict,Ie=!1;if(Ne)i.body=this.parseMaybeAssign(_e),i.expression=!0,this.checkParams(i,!1);else{var Le=this.options.ecmaVersion>=7&&!this.isSimpleParamList(i.params);if(!Re||Le){if(Ie=this.strictDirective(this.end),Ie&&Le)this.raiseRecoverable(i.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Me=this.labels;if(this.labels=[],Ie)this.strict=!0;if(this.checkParams(i,!Re&&!Ie&&!ve&&!Ae&&this.isSimpleParamList(i.params)),this.strict&&i.id)this.checkLValSimple(i.id,Ma);i.body=this.parseBlock(!1,void 0,Ie&&!Re),i.expression=!1,this.adaptDirectivePrologue(i.body.body),this.labels=Me}this.exitScope()};pt.isSimpleParamList=function(i){for(var ve=0,Ae=i;ve<Ae.length;ve+=1){var _e=Ae[ve];if(_e.type!=="Identifier")return!1}return!0};pt.checkParams=function(i,ve){var Ae=Object.create(null);for(var _e=0,Ne=i.params;_e<Ne.length;_e+=1){var Re=Ne[_e];this.checkLValInnerPattern(Re,Js,ve?null:Ae)}};pt.parseExprList=function(i,ve,Ae,_e){var Ne=[],Re=!0;while(!this.eat(i)){if(!Re){if(this.expect(je.comma),ve&&this.afterTrailingComma(i))break}else Re=!1;var Ie=void 0;if(Ae&&this.type===je.comma)Ie=null;else if(this.type===je.ellipsis){if(Ie=this.parseSpread(_e),_e&&this.type===je.comma&&_e.trailingComma<0)_e.trailingComma=this.start}else Ie=this.parseMaybeAssign(!1,_e);Ne.push(Ie)}return Ne};pt.checkUnreserved=function(i){var{start:ve,end:Ae,name:_e}=i;if(this.inGenerator&&_e==="yield")this.raiseRecoverable(ve,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&_e==="await")this.raiseRecoverable(ve,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&Bn)&&_e==="arguments")this.raiseRecoverable(ve,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(_e==="arguments"||_e==="await"))this.raise(ve,"Cannot use "+_e+" in class static initialization block");if(this.keywords.test(_e))this.raise(ve,"Unexpected keyword '"+_e+"'");if(this.options.ecmaVersion<6&&this.input.slice(ve,Ae).indexOf("\\")!==-1)return;var Ne=this.strict?this.reservedWordsStrict:this.reservedWords;if(Ne.test(_e)){if(!this.inAsync&&_e==="await")this.raiseRecoverable(ve,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(ve,"The keyword '"+_e+"' is reserved")}};pt.parseIdent=function(i){var ve=this.parseIdentNode();if(this.next(!!i),this.finishNode(ve,"Identifier"),!i){if(this.checkUnreserved(ve),ve.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=ve.start}return ve};pt.parseIdentNode=function(){var i=this.startNode();if(this.type===je.name)i.name=this.value;else if(this.type.keyword){if(i.name=this.type.keyword,(i.name==="class"||i.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=je.name}else this.unexpected();return i};pt.parsePrivateIdent=function(){var i=this.startNode();if(this.type===je.privateId)i.name=this.value;else this.unexpected();if(this.next(),this.finishNode(i,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(i.start,"Private field '#"+i.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(i);return i};pt.parseYield=function(i){if(!this.yieldPos)this.yieldPos=this.start;var ve=this.startNode();if(this.next(),this.type===je.semi||this.canInsertSemicolon()||this.type!==je.star&&!this.type.startsExpr)ve.delegate=!1,ve.argument=null;else ve.delegate=this.eat(je.star),ve.argument=this.parseMaybeAssign(i);return this.finishNode(ve,"YieldExpression")};pt.parseAwait=function(i){if(!this.awaitPos)this.awaitPos=this.start;var ve=this.startNode();return this.next(),ve.argument=this.parseMaybeUnary(null,!0,!1,i),this.finishNode(ve,"AwaitExpression")};var Rn=wt.prototype;Rn.raise=function(i,ve){var Ae=Hs(this.input,i);if(ve+=" ("+Ae.line+":"+Ae.column+")",this.sourceFile)ve+=" in "+this.sourceFile;var _e=SyntaxError(ve);throw _e.pos=i,_e.loc=Ae,_e.raisedAt=this.pos,_e};Rn.raiseRecoverable=Rn.raise;Rn.curPosition=function(){if(this.options.locations)return new Vr(this.curLine,this.pos-this.lineStart)};var Tr=wt.prototype,cu=function(ve){this.flags=ve,this.var=[],this.lexical=[],this.functions=[]};Tr.enterScope=function(i){this.scopeStack.push(new cu(i))};Tr.exitScope=function(){this.scopeStack.pop()};Tr.treatFunctionsAsVarInScope=function(i){return i.flags&Lr||!this.inModule&&i.flags&Dr};Tr.declareName=function(i,ve,Ae){var _e=!1;if(ve===mr){var Ne=this.currentScope();if(_e=Ne.lexical.indexOf(i)>-1||Ne.functions.indexOf(i)>-1||Ne.var.indexOf(i)>-1,Ne.lexical.push(i),this.inModule&&Ne.flags&Dr)delete this.undefinedExports[i]}else if(ve===Oa){var Re=this.currentScope();Re.lexical.push(i)}else if(ve===La){var Ie=this.currentScope();if(this.treatFunctionsAsVar)_e=Ie.lexical.indexOf(i)>-1;else _e=Ie.lexical.indexOf(i)>-1||Ie.var.indexOf(i)>-1;Ie.functions.push(i)}else for(var Le=this.scopeStack.length-1;Le>=0;--Le){var Me=this.scopeStack[Le];if(Me.lexical.indexOf(i)>-1&&!(Me.flags&Ia&&Me.lexical[0]===i)||!this.treatFunctionsAsVarInScope(Me)&&Me.functions.indexOf(i)>-1){_e=!0;break}if(Me.var.push(i),this.inModule&&Me.flags&Dr)delete this.undefinedExports[i];if(Me.flags&Bn)break}if(_e)this.raiseRecoverable(Ae,"Identifier '"+i+"' has already been declared")};Tr.checkLocalExport=function(i){if(this.scopeStack[0].lexical.indexOf(i.name)===-1&&this.scopeStack[0].var.indexOf(i.name)===-1)this.undefinedExports[i.name]=i};Tr.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Tr.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var ve=this.scopeStack[i];if(ve.flags&(Bn|cn|Or))return ve}};Tr.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var ve=this.scopeStack[i];if(ve.flags&(Bn|cn|Or)&&!(ve.flags&zs))return ve}};var ln=function(ve,Ae,_e){if(this.type="",this.start=Ae,this.end=0,ve.options.locations)this.loc=new on(ve,_e);if(ve.options.directSourceFile)this.sourceFile=ve.options.directSourceFile;if(ve.options.ranges)this.range=[Ae,0]},pn=wt.prototype;pn.startNode=function(){return new ln(this,this.start,this.startLoc)};pn.startNodeAt=function(i,ve){return new ln(this,i,ve)};function Fa(i,ve,Ae,_e){if(i.type=ve,i.end=Ae,this.options.locations)i.loc.end=_e;if(this.options.ranges)i.range[1]=Ae;return i}pn.finishNode=function(i,ve){return Fa.call(this,i,ve,this.lastTokEnd,this.lastTokEndLoc)};pn.finishNodeAt=function(i,ve,Ae,_e){return Fa.call(this,i,ve,Ae,_e)};pn.copyNode=function(i){var ve=new ln(this,i.start,this.startLoc);for(var Ae in i)ve[Ae]=i[Ae];return ve};var lu="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",ja="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Va=ja+" Extended_Pictographic",qa=Va,Ua=qa+" EBase EComp EMod EPres ExtPict",Ga=Ua,pu=Ga,uu={9:ja,10:Va,11:qa,12:Ua,13:Ga,14:pu},hu="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",fu={9:"",10:"",11:"",12:"",13:"",14:hu},Sa="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Wa="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ha=Wa+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ka=Ha+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",za=Ka+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Xa=za+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",du=Xa+" "+lu,mu={9:Wa,10:Ha,11:Ka,12:za,13:Xa,14:du},Ja={};function gu(i){var ve=Ja[i]={binary:Sr(uu[i]+" "+Sa),binaryOfStrings:Sr(fu[i]),nonBinary:{General_Category:Sr(Sa),Script:Sr(mu[i])}};ve.nonBinary.Script_Extensions=ve.nonBinary.Script,ve.nonBinary.gc=ve.nonBinary.General_Category,ve.nonBinary.sc=ve.nonBinary.Script,ve.nonBinary.scx=ve.nonBinary.Script_Extensions}for(sn=0,_n=[9,10,11,12,13,14];sn<_n.length;sn+=1)Gs=_n[sn],gu(Gs);var Gs,sn,_n,rt=wt.prototype,Ln=function(ve,Ae){this.parent=ve,this.base=Ae||this};Ln.prototype.separatedFrom=function(ve){for(var Ae=this;Ae;Ae=Ae.parent)for(var _e=ve;_e;_e=_e.parent)if(Ae.base===_e.base&&Ae!==_e)return!0;return!1};Ln.prototype.sibling=function(){return new Ln(this.parent,this.base)};var or=function(ve){this.parser=ve,this.validFlags="gim"+(ve.options.ecmaVersion>=6?"uy":"")+(ve.options.ecmaVersion>=9?"s":"")+(ve.options.ecmaVersion>=13?"d":"")+(ve.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ja[ve.options.ecmaVersion>=14?14:ve.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};or.prototype.reset=function(ve,Ae,_e){var Ne=_e.indexOf("v")!==-1,Re=_e.indexOf("u")!==-1;if(this.start=ve|0,this.source=Ae+"",this.flags=_e,Ne&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=Re&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=Re&&this.parser.options.ecmaVersion>=9};or.prototype.raise=function(ve){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+ve)};or.prototype.at=function(ve,Ae){if(Ae===void 0)Ae=!1;var _e=this.source,Ne=_e.length;if(ve>=Ne)return-1;var Re=_e.charCodeAt(ve);if(!(Ae||this.switchU)||Re<=55295||Re>=57344||ve+1>=Ne)return Re;var Ie=_e.charCodeAt(ve+1);return Ie>=56320&&Ie<=57343?(Re<<10)+Ie-56613888:Re};or.prototype.nextIndex=function(ve,Ae){if(Ae===void 0)Ae=!1;var _e=this.source,Ne=_e.length;if(ve>=Ne)return Ne;var Re=_e.charCodeAt(ve),Ie;if(!(Ae||this.switchU)||Re<=55295||Re>=57344||ve+1>=Ne||(Ie=_e.charCodeAt(ve+1))<56320||Ie>57343)return ve+1;return ve+2};or.prototype.current=function(ve){if(ve===void 0)ve=!1;return this.at(this.pos,ve)};or.prototype.lookahead=function(ve){if(ve===void 0)ve=!1;return this.at(this.nextIndex(this.pos,ve),ve)};or.prototype.advance=function(ve){if(ve===void 0)ve=!1;this.pos=this.nextIndex(this.pos,ve)};or.prototype.eat=function(ve,Ae){if(Ae===void 0)Ae=!1;if(this.current(Ae)===ve)return this.advance(Ae),!0;return!1};or.prototype.eatChars=function(ve,Ae){if(Ae===void 0)Ae=!1;var _e=this.pos;for(var Ne=0,Re=ve;Ne<Re.length;Ne+=1){var Ie=Re[Ne],Le=this.at(_e,Ae);if(Le===-1||Le!==Ie)return!1;_e=this.nextIndex(_e,Ae)}return this.pos=_e,!0};rt.validateRegExpFlags=function(i){var{validFlags:ve,flags:Ae}=i,_e=!1,Ne=!1;for(var Re=0;Re<Ae.length;Re++){var Ie=Ae.charAt(Re);if(ve.indexOf(Ie)===-1)this.raise(i.start,"Invalid regular expression flag");if(Ae.indexOf(Ie,Re+1)>-1)this.raise(i.start,"Duplicate regular expression flag");if(Ie==="u")_e=!0;if(Ie==="v")Ne=!0}if(this.options.ecmaVersion>=15&&_e&&Ne)this.raise(i.start,"Invalid regular expression flag")};function yu(i){for(var ve in i)return!0;return!1}rt.validateRegExpPattern=function(i){if(this.regexp_pattern(i),!i.switchN&&this.options.ecmaVersion>=9&&yu(i.groupNames))i.switchN=!0,this.regexp_pattern(i)};rt.regexp_pattern=function(i){if(i.pos=0,i.lastIntValue=0,i.lastStringValue="",i.lastAssertionIsQuantifiable=!1,i.numCapturingParens=0,i.maxBackReference=0,i.groupNames=Object.create(null),i.backReferenceNames.length=0,i.branchID=null,this.regexp_disjunction(i),i.pos!==i.source.length){if(i.eat(41))i.raise("Unmatched ')'");if(i.eat(93)||i.eat(125))i.raise("Lone quantifier brackets")}if(i.maxBackReference>i.numCapturingParens)i.raise("Invalid escape");for(var ve=0,Ae=i.backReferenceNames;ve<Ae.length;ve+=1){var _e=Ae[ve];if(!i.groupNames[_e])i.raise("Invalid named capture referenced")}};rt.regexp_disjunction=function(i){var ve=this.options.ecmaVersion>=16;if(ve)i.branchID=new Ln(i.branchID,null);this.regexp_alternative(i);while(i.eat(124)){if(ve)i.branchID=i.branchID.sibling();this.regexp_alternative(i)}if(ve)i.branchID=i.branchID.parent;if(this.regexp_eatQuantifier(i,!0))i.raise("Nothing to repeat");if(i.eat(123))i.raise("Lone quantifier brackets")};rt.regexp_alternative=function(i){while(i.pos<i.source.length&&this.regexp_eatTerm(i));};rt.regexp_eatTerm=function(i){if(this.regexp_eatAssertion(i)){if(i.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(i)){if(i.switchU)i.raise("Invalid quantifier")}return!0}if(i.switchU?this.regexp_eatAtom(i):this.regexp_eatExtendedAtom(i))return this.regexp_eatQuantifier(i),!0;return!1};rt.regexp_eatAssertion=function(i){var ve=i.pos;if(i.lastAssertionIsQuantifiable=!1,i.eat(94)||i.eat(36))return!0;if(i.eat(92)){if(i.eat(66)||i.eat(98))return!0;i.pos=ve}if(i.eat(40)&&i.eat(63)){var Ae=!1;if(this.options.ecmaVersion>=9)Ae=i.eat(60);if(i.eat(61)||i.eat(33)){if(this.regexp_disjunction(i),!i.eat(41))i.raise("Unterminated group");return i.lastAssertionIsQuantifiable=!Ae,!0}}return i.pos=ve,!1};rt.regexp_eatQuantifier=function(i,ve){if(ve===void 0)ve=!1;if(this.regexp_eatQuantifierPrefix(i,ve))return i.eat(63),!0;return!1};rt.regexp_eatQuantifierPrefix=function(i,ve){return i.eat(42)||i.eat(43)||i.eat(63)||this.regexp_eatBracedQuantifier(i,ve)};rt.regexp_eatBracedQuantifier=function(i,ve){var Ae=i.pos;if(i.eat(123)){var _e=0,Ne=-1;if(this.regexp_eatDecimalDigits(i)){if(_e=i.lastIntValue,i.eat(44)&&this.regexp_eatDecimalDigits(i))Ne=i.lastIntValue;if(i.eat(125)){if(Ne!==-1&&Ne<_e&&!ve)i.raise("numbers out of order in {} quantifier");return!0}}if(i.switchU&&!ve)i.raise("Incomplete quantifier");i.pos=Ae}return!1};rt.regexp_eatAtom=function(i){return this.regexp_eatPatternCharacters(i)||i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)};rt.regexp_eatReverseSolidusAtomEscape=function(i){var ve=i.pos;if(i.eat(92)){if(this.regexp_eatAtomEscape(i))return!0;i.pos=ve}return!1};rt.regexp_eatUncapturingGroup=function(i){var ve=i.pos;if(i.eat(40)){if(i.eat(63)){if(this.options.ecmaVersion>=16){var Ae=this.regexp_eatModifiers(i),_e=i.eat(45);if(Ae||_e){for(var Ne=0;Ne<Ae.length;Ne++){var Re=Ae.charAt(Ne);if(Ae.indexOf(Re,Ne+1)>-1)i.raise("Duplicate regular expression modifiers")}if(_e){var Ie=this.regexp_eatModifiers(i);if(!Ae&&!Ie&&i.current()===58)i.raise("Invalid regular expression modifiers");for(var Le=0;Le<Ie.length;Le++){var Me=Ie.charAt(Le);if(Ie.indexOf(Me,Le+1)>-1||Ae.indexOf(Me)>-1)i.raise("Duplicate regular expression modifiers")}}}}if(i.eat(58)){if(this.regexp_disjunction(i),i.eat(41))return!0;i.raise("Unterminated group")}}i.pos=ve}return!1};rt.regexp_eatCapturingGroup=function(i){if(i.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(i);else if(i.current()===63)i.raise("Invalid group");if(this.regexp_disjunction(i),i.eat(41))return i.numCapturingParens+=1,!0;i.raise("Unterminated group")}return!1};rt.regexp_eatModifiers=function(i){var ve="",Ae=0;while((Ae=i.current())!==-1&&xu(Ae))ve+=fr(Ae),i.advance();return ve};function xu(i){return i===105||i===109||i===115}rt.regexp_eatExtendedAtom=function(i){return i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)||this.regexp_eatInvalidBracedQuantifier(i)||this.regexp_eatExtendedPatternCharacter(i)};rt.regexp_eatInvalidBracedQuantifier=function(i){if(this.regexp_eatBracedQuantifier(i,!0))i.raise("Nothing to repeat");return!1};rt.regexp_eatSyntaxCharacter=function(i){var ve=i.current();if(Ya(ve))return i.lastIntValue=ve,i.advance(),!0;return!1};function Ya(i){return i===36||i>=40&&i<=43||i===46||i===63||i>=91&&i<=94||i>=123&&i<=125}rt.regexp_eatPatternCharacters=function(i){var ve=i.pos,Ae=0;while((Ae=i.current())!==-1&&!Ya(Ae))i.advance();return i.pos!==ve};rt.regexp_eatExtendedPatternCharacter=function(i){var ve=i.current();if(ve!==-1&&ve!==36&&!(ve>=40&&ve<=43)&&ve!==46&&ve!==63&&ve!==91&&ve!==94&&ve!==124)return i.advance(),!0;return!1};rt.regexp_groupSpecifier=function(i){if(i.eat(63)){if(!this.regexp_eatGroupName(i))i.raise("Invalid group");var ve=this.options.ecmaVersion>=16,Ae=i.groupNames[i.lastStringValue];if(Ae)if(ve)for(var _e=0,Ne=Ae;_e<Ne.length;_e+=1){var Re=Ne[_e];if(!Re.separatedFrom(i.branchID))i.raise("Duplicate capture group name")}else i.raise("Duplicate capture group name");if(ve)(Ae||(i.groupNames[i.lastStringValue]=[])).push(i.branchID);else i.groupNames[i.lastStringValue]=!0}};rt.regexp_eatGroupName=function(i){if(i.lastStringValue="",i.eat(60)){if(this.regexp_eatRegExpIdentifierName(i)&&i.eat(62))return!0;i.raise("Invalid capture group name")}return!1};rt.regexp_eatRegExpIdentifierName=function(i){if(i.lastStringValue="",this.regexp_eatRegExpIdentifierStart(i)){i.lastStringValue+=fr(i.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(i))i.lastStringValue+=fr(i.lastIntValue);return!0}return!1};rt.regexp_eatRegExpIdentifierStart=function(i){var ve=i.pos,Ae=this.options.ecmaVersion>=11,_e=i.current(Ae);if(i.advance(Ae),_e===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Ae))_e=i.lastIntValue;if(bu(_e))return i.lastIntValue=_e,!0;return i.pos=ve,!1};function bu(i){return Ft(i,!0)||i===36||i===95}rt.regexp_eatRegExpIdentifierPart=function(i){var ve=i.pos,Ae=this.options.ecmaVersion>=11,_e=i.current(Ae);if(i.advance(Ae),_e===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Ae))_e=i.lastIntValue;if(Eu(_e))return i.lastIntValue=_e,!0;return i.pos=ve,!1};function Eu(i){return Kt(i,!0)||i===36||i===95||i===8204||i===8205}rt.regexp_eatAtomEscape=function(i){if(this.regexp_eatBackReference(i)||this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)||i.switchN&&this.regexp_eatKGroupName(i))return!0;if(i.switchU){if(i.current()===99)i.raise("Invalid unicode escape");i.raise("Invalid escape")}return!1};rt.regexp_eatBackReference=function(i){var ve=i.pos;if(this.regexp_eatDecimalEscape(i)){var Ae=i.lastIntValue;if(i.switchU){if(Ae>i.maxBackReference)i.maxBackReference=Ae;return!0}if(Ae<=i.numCapturingParens)return!0;i.pos=ve}return!1};rt.regexp_eatKGroupName=function(i){if(i.eat(107)){if(this.regexp_eatGroupName(i))return i.backReferenceNames.push(i.lastStringValue),!0;i.raise("Invalid named reference")}return!1};rt.regexp_eatCharacterEscape=function(i){return this.regexp_eatControlEscape(i)||this.regexp_eatCControlLetter(i)||this.regexp_eatZero(i)||this.regexp_eatHexEscapeSequence(i)||this.regexp_eatRegExpUnicodeEscapeSequence(i,!1)||!i.switchU&&this.regexp_eatLegacyOctalEscapeSequence(i)||this.regexp_eatIdentityEscape(i)};rt.regexp_eatCControlLetter=function(i){var ve=i.pos;if(i.eat(99)){if(this.regexp_eatControlLetter(i))return!0;i.pos=ve}return!1};rt.regexp_eatZero=function(i){if(i.current()===48&&!Fn(i.lookahead()))return i.lastIntValue=0,i.advance(),!0;return!1};rt.regexp_eatControlEscape=function(i){var ve=i.current();if(ve===116)return i.lastIntValue=9,i.advance(),!0;if(ve===110)return i.lastIntValue=10,i.advance(),!0;if(ve===118)return i.lastIntValue=11,i.advance(),!0;if(ve===102)return i.lastIntValue=12,i.advance(),!0;if(ve===114)return i.lastIntValue=13,i.advance(),!0;return!1};rt.regexp_eatControlLetter=function(i){var ve=i.current();if(Qa(ve))return i.lastIntValue=ve%32,i.advance(),!0;return!1};function Qa(i){return i>=65&&i<=90||i>=97&&i<=122}rt.regexp_eatRegExpUnicodeEscapeSequence=function(i,ve){if(ve===void 0)ve=!1;var Ae=i.pos,_e=ve||i.switchU;if(i.eat(117)){if(this.regexp_eatFixedHexDigits(i,4)){var Ne=i.lastIntValue;if(_e&&Ne>=55296&&Ne<=56319){var Re=i.pos;if(i.eat(92)&&i.eat(117)&&this.regexp_eatFixedHexDigits(i,4)){var Ie=i.lastIntValue;if(Ie>=56320&&Ie<=57343)return i.lastIntValue=(Ne-55296)*1024+(Ie-56320)+65536,!0}i.pos=Re,i.lastIntValue=Ne}return!0}if(_e&&i.eat(123)&&this.regexp_eatHexDigits(i)&&i.eat(125)&&Cu(i.lastIntValue))return!0;if(_e)i.raise("Invalid unicode escape");i.pos=Ae}return!1};function Cu(i){return i>=0&&i<=1114111}rt.regexp_eatIdentityEscape=function(i){if(i.switchU){if(this.regexp_eatSyntaxCharacter(i))return!0;if(i.eat(47))return i.lastIntValue=47,!0;return!1}var ve=i.current();if(ve!==99&&(!i.switchN||ve!==107))return i.lastIntValue=ve,i.advance(),!0;return!1};rt.regexp_eatDecimalEscape=function(i){i.lastIntValue=0;var ve=i.current();if(ve>=49&&ve<=57){do i.lastIntValue=10*i.lastIntValue+(ve-48),i.advance();while((ve=i.current())>=48&&ve<=57);return!0}return!1};var Za=0,dr=1,tr=2;rt.regexp_eatCharacterClassEscape=function(i){var ve=i.current();if(vu(ve))return i.lastIntValue=-1,i.advance(),dr;var Ae=!1;if(i.switchU&&this.options.ecmaVersion>=9&&((Ae=ve===80)||ve===112)){i.lastIntValue=-1,i.advance();var _e;if(i.eat(123)&&(_e=this.regexp_eatUnicodePropertyValueExpression(i))&&i.eat(125)){if(Ae&&_e===tr)i.raise("Invalid property name");return _e}i.raise("Invalid property name")}return Za};function vu(i){return i===100||i===68||i===115||i===83||i===119||i===87}rt.regexp_eatUnicodePropertyValueExpression=function(i){var ve=i.pos;if(this.regexp_eatUnicodePropertyName(i)&&i.eat(61)){var Ae=i.lastStringValue;if(this.regexp_eatUnicodePropertyValue(i)){var _e=i.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(i,Ae,_e),dr}}if(i.pos=ve,this.regexp_eatLoneUnicodePropertyNameOrValue(i)){var Ne=i.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(i,Ne)}return Za};rt.regexp_validateUnicodePropertyNameAndValue=function(i,ve,Ae){if(!qr(i.unicodeProperties.nonBinary,ve))i.raise("Invalid property name");if(!i.unicodeProperties.nonBinary[ve].test(Ae))i.raise("Invalid property value")};rt.regexp_validateUnicodePropertyNameOrValue=function(i,ve){if(i.unicodeProperties.binary.test(ve))return dr;if(i.switchV&&i.unicodeProperties.binaryOfStrings.test(ve))return tr;i.raise("Invalid property name")};rt.regexp_eatUnicodePropertyName=function(i){var ve=0;i.lastStringValue="";while(eo(ve=i.current()))i.lastStringValue+=fr(ve),i.advance();return i.lastStringValue!==""};function eo(i){return Qa(i)||i===95}rt.regexp_eatUnicodePropertyValue=function(i){var ve=0;i.lastStringValue="";while(Su(ve=i.current()))i.lastStringValue+=fr(ve),i.advance();return i.lastStringValue!==""};function Su(i){return eo(i)||Fn(i)}rt.regexp_eatLoneUnicodePropertyNameOrValue=function(i){return this.regexp_eatUnicodePropertyValue(i)};rt.regexp_eatCharacterClass=function(i){if(i.eat(91)){var ve=i.eat(94),Ae=this.regexp_classContents(i);if(!i.eat(93))i.raise("Unterminated character class");if(ve&&Ae===tr)i.raise("Negated character class may contain strings");return!0}return!1};rt.regexp_classContents=function(i){if(i.current()===93)return dr;if(i.switchV)return this.regexp_classSetExpression(i);return this.regexp_nonEmptyClassRanges(i),dr};rt.regexp_nonEmptyClassRanges=function(i){while(this.regexp_eatClassAtom(i)){var ve=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassAtom(i)){var Ae=i.lastIntValue;if(i.switchU&&(ve===-1||Ae===-1))i.raise("Invalid character class");if(ve!==-1&&Ae!==-1&&ve>Ae)i.raise("Range out of order in character class")}}};rt.regexp_eatClassAtom=function(i){var ve=i.pos;if(i.eat(92)){if(this.regexp_eatClassEscape(i))return!0;if(i.switchU){var Ae=i.current();if(Ae===99||no(Ae))i.raise("Invalid class escape");i.raise("Invalid escape")}i.pos=ve}var _e=i.current();if(_e!==93)return i.lastIntValue=_e,i.advance(),!0;return!1};rt.regexp_eatClassEscape=function(i){var ve=i.pos;if(i.eat(98))return i.lastIntValue=8,!0;if(i.switchU&&i.eat(45))return i.lastIntValue=45,!0;if(!i.switchU&&i.eat(99)){if(this.regexp_eatClassControlLetter(i))return!0;i.pos=ve}return this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)};rt.regexp_classSetExpression=function(i){var ve=dr,Ae;if(this.regexp_eatClassSetRange(i));else if(Ae=this.regexp_eatClassSetOperand(i)){if(Ae===tr)ve=tr;var _e=i.pos;while(i.eatChars([38,38])){if(i.current()!==38&&(Ae=this.regexp_eatClassSetOperand(i))){if(Ae!==tr)ve=dr;continue}i.raise("Invalid character in character class")}if(_e!==i.pos)return ve;while(i.eatChars([45,45])){if(this.regexp_eatClassSetOperand(i))continue;i.raise("Invalid character in character class")}if(_e!==i.pos)return ve}else i.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(i))continue;if(Ae=this.regexp_eatClassSetOperand(i),!Ae)return ve;if(Ae===tr)ve=tr}};rt.regexp_eatClassSetRange=function(i){var ve=i.pos;if(this.regexp_eatClassSetCharacter(i)){var Ae=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassSetCharacter(i)){var _e=i.lastIntValue;if(Ae!==-1&&_e!==-1&&Ae>_e)i.raise("Range out of order in character class");return!0}i.pos=ve}return!1};rt.regexp_eatClassSetOperand=function(i){if(this.regexp_eatClassSetCharacter(i))return dr;return this.regexp_eatClassStringDisjunction(i)||this.regexp_eatNestedClass(i)};rt.regexp_eatNestedClass=function(i){var ve=i.pos;if(i.eat(91)){var Ae=i.eat(94),_e=this.regexp_classContents(i);if(i.eat(93)){if(Ae&&_e===tr)i.raise("Negated character class may contain strings");return _e}i.pos=ve}if(i.eat(92)){var Ne=this.regexp_eatCharacterClassEscape(i);if(Ne)return Ne;i.pos=ve}return null};rt.regexp_eatClassStringDisjunction=function(i){var ve=i.pos;if(i.eatChars([92,113])){if(i.eat(123)){var Ae=this.regexp_classStringDisjunctionContents(i);if(i.eat(125))return Ae}else i.raise("Invalid escape");i.pos=ve}return null};rt.regexp_classStringDisjunctionContents=function(i){var ve=this.regexp_classString(i);while(i.eat(124))if(this.regexp_classString(i)===tr)ve=tr;return ve};rt.regexp_classString=function(i){var ve=0;while(this.regexp_eatClassSetCharacter(i))ve++;return ve===1?dr:tr};rt.regexp_eatClassSetCharacter=function(i){var ve=i.pos;if(i.eat(92)){if(this.regexp_eatCharacterEscape(i)||this.regexp_eatClassSetReservedPunctuator(i))return!0;if(i.eat(98))return i.lastIntValue=8,!0;return i.pos=ve,!1}var Ae=i.current();if(Ae<0||Ae===i.lookahead()&&Tu(Ae))return!1;if(Au(Ae))return!1;return i.advance(),i.lastIntValue=Ae,!0};function Tu(i){return i===33||i>=35&&i<=38||i>=42&&i<=44||i===46||i>=58&&i<=64||i===94||i===96||i===126}function Au(i){return i===40||i===41||i===45||i===47||i>=91&&i<=93||i>=123&&i<=125}rt.regexp_eatClassSetReservedPunctuator=function(i){var ve=i.current();if(ku(ve))return i.lastIntValue=ve,i.advance(),!0;return!1};function ku(i){return i===33||i===35||i===37||i===38||i===44||i===45||i>=58&&i<=62||i===64||i===96||i===126}rt.regexp_eatClassControlLetter=function(i){var ve=i.current();if(Fn(ve)||ve===95)return i.lastIntValue=ve%32,i.advance(),!0;return!1};rt.regexp_eatHexEscapeSequence=function(i){var ve=i.pos;if(i.eat(120)){if(this.regexp_eatFixedHexDigits(i,2))return!0;if(i.switchU)i.raise("Invalid escape");i.pos=ve}return!1};rt.regexp_eatDecimalDigits=function(i){var ve=i.pos,Ae=0;i.lastIntValue=0;while(Fn(Ae=i.current()))i.lastIntValue=10*i.lastIntValue+(Ae-48),i.advance();return i.pos!==ve};function Fn(i){return i>=48&&i<=57}rt.regexp_eatHexDigits=function(i){var ve=i.pos,Ae=0;i.lastIntValue=0;while(to(Ae=i.current()))i.lastIntValue=16*i.lastIntValue+ro(Ae),i.advance();return i.pos!==ve};function to(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}function ro(i){if(i>=65&&i<=70)return 10+(i-65);if(i>=97&&i<=102)return 10+(i-97);return i-48}rt.regexp_eatLegacyOctalEscapeSequence=function(i){if(this.regexp_eatOctalDigit(i)){var ve=i.lastIntValue;if(this.regexp_eatOctalDigit(i)){var Ae=i.lastIntValue;if(ve<=3&&this.regexp_eatOctalDigit(i))i.lastIntValue=ve*64+Ae*8+i.lastIntValue;else i.lastIntValue=ve*8+Ae}else i.lastIntValue=ve;return!0}return!1};rt.regexp_eatOctalDigit=function(i){var ve=i.current();if(no(ve))return i.lastIntValue=ve-48,i.advance(),!0;return i.lastIntValue=0,!1};function no(i){return i>=48&&i<=55}rt.regexp_eatFixedHexDigits=function(i,ve){var Ae=i.pos;i.lastIntValue=0;for(var _e=0;_e<ve;++_e){var Ne=i.current();if(!to(Ne))return i.pos=Ae,!1;i.lastIntValue=16*i.lastIntValue+ro(Ne),i.advance()}return!0};var jn=function(ve){if(this.type=ve.type,this.value=ve.value,this.start=ve.start,this.end=ve.end,ve.options.locations)this.loc=new on(ve,ve.startLoc,ve.endLoc);if(ve.options.ranges)this.range=[ve.start,ve.end]},ht=wt.prototype;ht.next=function(i){if(!i&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new jn(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};ht.getToken=function(){return this.next(),new jn(this)};if(typeof Symbol<"u")ht[Symbol.iterator]=function(){var i=this;return{next:function(){var ve=i.getToken();return{done:ve.type===je.eof,value:ve}}}};ht.nextToken=function(){var i=this.curContext();if(!i||!i.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(je.eof);if(i.override)return i.override(this);else this.readToken(this.fullCharCodeAtPos())};ht.readToken=function(i){if(Ft(i,this.options.ecmaVersion>=6)||i===92)return this.readWord();return this.getTokenFromCode(i)};ht.fullCharCodeAt=function(i){var ve=this.input.charCodeAt(i);if(ve<=55295||ve>=56320)return ve;var Ae=this.input.charCodeAt(i+1);return Ae<=56319||Ae>=57344?ve:(ve<<10)+Ae-56613888};ht.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};ht.skipBlockComment=function(){var i=this.options.onComment&&this.curPosition(),ve=this.pos,Ae=this.input.indexOf("*/",this.pos+=2);if(Ae===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Ae+2,this.options.locations)for(var _e=void 0,Ne=ve;(_e=Pa(this.input,Ne,this.pos))>-1;)++this.curLine,Ne=this.lineStart=_e;if(this.options.onComment)this.options.onComment(!0,this.input.slice(ve+2,Ae),ve,this.pos,i,this.curPosition())};ht.skipLineComment=function(i){var ve=this.pos,Ae=this.options.onComment&&this.curPosition(),_e=this.input.charCodeAt(this.pos+=i);while(this.pos<this.input.length&&!Rr(_e))_e=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(ve+i,this.pos),ve,this.pos,Ae,this.curPosition())};ht.skipSpace=function(){e:while(this.pos<this.input.length){var i=this.input.charCodeAt(this.pos);switch(i){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(i>8&&i<14||i>=5760&&Ws.test(String.fromCharCode(i)))++this.pos;else break e}}};ht.finishToken=function(i,ve){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Ae=this.type;this.type=i,this.value=ve,this.updateContext(Ae)};ht.readToken_dot=function(){var i=this.input.charCodeAt(this.pos+1);if(i>=48&&i<=57)return this.readNumber(!0);var ve=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&i===46&&ve===46)return this.pos+=3,this.finishToken(je.ellipsis);else return++this.pos,this.finishToken(je.dot)};ht.readToken_slash=function(){var i=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(i===61)return this.finishOp(je.assign,2);return this.finishOp(je.slash,1)};ht.readToken_mult_modulo_exp=function(i){var ve=this.input.charCodeAt(this.pos+1),Ae=1,_e=i===42?je.star:je.modulo;if(this.options.ecmaVersion>=7&&i===42&&ve===42)++Ae,_e=je.starstar,ve=this.input.charCodeAt(this.pos+2);if(ve===61)return this.finishOp(je.assign,Ae+1);return this.finishOp(_e,Ae)};ht.readToken_pipe_amp=function(i){var ve=this.input.charCodeAt(this.pos+1);if(ve===i){if(this.options.ecmaVersion>=12){var Ae=this.input.charCodeAt(this.pos+2);if(Ae===61)return this.finishOp(je.assign,3)}return this.finishOp(i===124?je.logicalOR:je.logicalAND,2)}if(ve===61)return this.finishOp(je.assign,2);return this.finishOp(i===124?je.bitwiseOR:je.bitwiseAND,1)};ht.readToken_caret=function(){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(je.assign,2);return this.finishOp(je.bitwiseXOR,1)};ht.readToken_plus_min=function(i){var ve=this.input.charCodeAt(this.pos+1);if(ve===i){if(ve===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||jt.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(je.incDec,2)}if(ve===61)return this.finishOp(je.assign,2);return this.finishOp(je.plusMin,1)};ht.readToken_lt_gt=function(i){var ve=this.input.charCodeAt(this.pos+1),Ae=1;if(ve===i){if(Ae=i===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Ae)===61)return this.finishOp(je.assign,Ae+1);return this.finishOp(je.bitShift,Ae)}if(ve===33&&i===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(ve===61)Ae=2;return this.finishOp(je.relational,Ae)};ht.readToken_eq_excl=function(i){var ve=this.input.charCodeAt(this.pos+1);if(ve===61)return this.finishOp(je.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(i===61&&ve===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(je.arrow);return this.finishOp(i===61?je.eq:je.prefix,1)};ht.readToken_question=function(){var i=this.options.ecmaVersion;if(i>=11){var ve=this.input.charCodeAt(this.pos+1);if(ve===46){var Ae=this.input.charCodeAt(this.pos+2);if(Ae<48||Ae>57)return this.finishOp(je.questionDot,2)}if(ve===63){if(i>=12){var _e=this.input.charCodeAt(this.pos+2);if(_e===61)return this.finishOp(je.assign,3)}return this.finishOp(je.coalesce,2)}}return this.finishOp(je.question,1)};ht.readToken_numberSign=function(){var i=this.options.ecmaVersion,ve=35;if(i>=13){if(++this.pos,ve=this.fullCharCodeAtPos(),Ft(ve,!0)||ve===92)return this.finishToken(je.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+fr(ve)+"'")};ht.getTokenFromCode=function(i){switch(i){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(je.parenL);case 41:return++this.pos,this.finishToken(je.parenR);case 59:return++this.pos,this.finishToken(je.semi);case 44:return++this.pos,this.finishToken(je.comma);case 91:return++this.pos,this.finishToken(je.bracketL);case 93:return++this.pos,this.finishToken(je.bracketR);case 123:return++this.pos,this.finishToken(je.braceL);case 125:return++this.pos,this.finishToken(je.braceR);case 58:return++this.pos,this.finishToken(je.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(je.backQuote);case 48:var ve=this.input.charCodeAt(this.pos+1);if(ve===120||ve===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(ve===111||ve===79)return this.readRadixNumber(8);if(ve===98||ve===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(i);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(i);case 124:case 38:return this.readToken_pipe_amp(i);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(i);case 60:case 62:return this.readToken_lt_gt(i);case 61:case 33:return this.readToken_eq_excl(i);case 63:return this.readToken_question();case 126:return this.finishOp(je.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+fr(i)+"'")};ht.finishOp=function(i,ve){var Ae=this.input.slice(this.pos,this.pos+ve);return this.pos+=ve,this.finishToken(i,Ae)};ht.readRegexp=function(){var i,ve,Ae=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(Ae,"Unterminated regular expression");var _e=this.input.charAt(this.pos);if(jt.test(_e))this.raise(Ae,"Unterminated regular expression");if(!i){if(_e==="[")ve=!0;else if(_e==="]"&&ve)ve=!1;else if(_e==="/"&&!ve)break;i=_e==="\\"}else i=!1;++this.pos}var Ne=this.input.slice(Ae,this.pos);++this.pos;var Re=this.pos,Ie=this.readWord1();if(this.containsEsc)this.unexpected(Re);var Le=this.regexpState||(this.regexpState=new or(this));Le.reset(Ae,Ne,Ie),this.validateRegExpFlags(Le),this.validateRegExpPattern(Le);var Me=null;try{Me=new RegExp(Ne,Ie)}catch($e){}return this.finishToken(je.regexp,{pattern:Ne,flags:Ie,value:Me})};ht.readInt=function(i,ve,Ae){var _e=this.options.ecmaVersion>=12&&ve===void 0,Ne=Ae&&this.input.charCodeAt(this.pos)===48,Re=this.pos,Ie=0,Le=0;for(var Me=0,$e=ve==null?1/0:ve;Me<$e;++Me,++this.pos){var Be=this.input.charCodeAt(this.pos),Ve=void 0;if(_e&&Be===95){if(Ne)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(Le===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Me===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");Le=Be;continue}if(Be>=97)Ve=Be-97+10;else if(Be>=65)Ve=Be-65+10;else if(Be>=48&&Be<=57)Ve=Be-48;else Ve=1/0;if(Ve>=i)break;Le=Be,Ie=Ie*i+Ve}if(_e&&Le===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===Re||ve!=null&&this.pos-Re!==ve)return null;return Ie};function wu(i,ve){if(ve)return parseInt(i,8);return parseFloat(i.replace(/_/g,""))}function so(i){if(typeof BigInt!=="function")return null;return BigInt(i.replace(/_/g,""))}ht.readRadixNumber=function(i){var ve=this.pos;this.pos+=2;var Ae=this.readInt(i);if(Ae==null)this.raise(this.start+2,"Expected number in radix "+i);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Ae=so(this.input.slice(ve,this.pos)),++this.pos;else if(Ft(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(je.num,Ae)};ht.readNumber=function(i){var ve=this.pos;if(!i&&this.readInt(10,void 0,!0)===null)this.raise(ve,"Invalid number");var Ae=this.pos-ve>=2&&this.input.charCodeAt(ve)===48;if(Ae&&this.strict)this.raise(ve,"Invalid number");var _e=this.input.charCodeAt(this.pos);if(!Ae&&!i&&this.options.ecmaVersion>=11&&_e===110){var Ne=so(this.input.slice(ve,this.pos));if(++this.pos,Ft(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(je.num,Ne)}if(Ae&&/[89]/.test(this.input.slice(ve,this.pos)))Ae=!1;if(_e===46&&!Ae)++this.pos,this.readInt(10),_e=this.input.charCodeAt(this.pos);if((_e===69||_e===101)&&!Ae){if(_e=this.input.charCodeAt(++this.pos),_e===43||_e===45)++this.pos;if(this.readInt(10)===null)this.raise(ve,"Invalid number")}if(Ft(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var Re=wu(this.input.slice(ve,this.pos),Ae);return this.finishToken(je.num,Re)};ht.readCodePoint=function(){var i=this.input.charCodeAt(this.pos),ve;if(i===123){if(this.options.ecmaVersion<6)this.unexpected();var Ae=++this.pos;if(ve=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,ve>1114111)this.invalidStringToken(Ae,"Code point out of bounds")}else ve=this.readHexChar(4);return ve};ht.readString=function(i){var ve="",Ae=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var _e=this.input.charCodeAt(this.pos);if(_e===i)break;if(_e===92)ve+=this.input.slice(Ae,this.pos),ve+=this.readEscapedChar(!1),Ae=this.pos;else if(_e===8232||_e===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(Rr(_e))this.raise(this.start,"Unterminated string constant");++this.pos}}return ve+=this.input.slice(Ae,this.pos++),this.finishToken(je.string,ve)};var io={};ht.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(i){if(i===io)this.readInvalidTemplateToken();else throw i}this.inTemplateElement=!1};ht.invalidStringToken=function(i,ve){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw io;else this.raise(i,ve)};ht.readTmplToken=function(){var i="",ve=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var Ae=this.input.charCodeAt(this.pos);if(Ae===96||Ae===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===je.template||this.type===je.invalidTemplate))if(Ae===36)return this.pos+=2,this.finishToken(je.dollarBraceL);else return++this.pos,this.finishToken(je.backQuote);return i+=this.input.slice(ve,this.pos),this.finishToken(je.template,i)}if(Ae===92)i+=this.input.slice(ve,this.pos),i+=this.readEscapedChar(!0),ve=this.pos;else if(Rr(Ae)){switch(i+=this.input.slice(ve,this.pos),++this.pos,Ae){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:i+=`
6
- `;break;default:i+=String.fromCharCode(Ae);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;ve=this.pos}else++this.pos}};ht.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(je.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
7
- `)++this.pos;case`
8
- `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};ht.readEscapedChar=function(i){var ve=this.input.charCodeAt(++this.pos);switch(++this.pos,ve){case 110:return`
9
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return fr(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(i){var Ae=this.pos-1;this.invalidStringToken(Ae,"Invalid escape sequence in template string")}default:if(ve>=48&&ve<=55){var _e=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Ne=parseInt(_e,8);if(Ne>255)_e=_e.slice(0,-1),Ne=parseInt(_e,8);if(this.pos+=_e.length-1,ve=this.input.charCodeAt(this.pos),(_e!=="0"||ve===56||ve===57)&&(this.strict||i))this.invalidStringToken(this.pos-1-_e.length,i?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(Ne)}if(Rr(ve)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(ve)}};ht.readHexChar=function(i){var ve=this.pos,Ae=this.readInt(16,i);if(Ae===null)this.invalidStringToken(ve,"Bad character escape sequence");return Ae};ht.readWord1=function(){this.containsEsc=!1;var i="",ve=!0,Ae=this.pos,_e=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var Ne=this.fullCharCodeAtPos();if(Kt(Ne,_e))this.pos+=Ne<=65535?1:2;else if(Ne===92){this.containsEsc=!0,i+=this.input.slice(Ae,this.pos);var Re=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Ie=this.readCodePoint();if(!(ve?Ft:Kt)(Ie,_e))this.invalidStringToken(Re,"Invalid Unicode escape");i+=fr(Ie),Ae=this.pos}else break;ve=!1}return i+this.input.slice(Ae,this.pos)};ht.readWord=function(){var i=this.readWord1(),ve=je.name;if(this.keywords.test(i))ve=On[i];return this.finishToken(ve,i)};var ao="8.18.0";wt.acorn={Parser:wt,version:ao,defaultOptions:Nn,Position:Vr,SourceLocation:on,getLineInfo:Hs,Node:ln,TokenType:mt,tokTypes:je,keywordTypes:On,TokContext:er,tokContexts:kt,isIdentifierChar:Kt,isIdentifierStart:Ft,Token:jn,isNewLine:Rr,lineBreak:jt,lineBreakG:wa,nonASCIIwhitespace:Ws};function Qs(i,ve){return wt.parse(i,ve)}function Pu(i,ve,Ae){return wt.parseExpressionAt(i,ve,Ae)}function _u(i,ve){return wt.tokenizer(i,ve)}var Yt=!0,Nu=new WeakMap;function Iu(i){let ve=i.Parser.acorn||i,Ae=Nu.get(ve);if(!Ae){let Le=function(tt){return tt===Ge.name||tt===Ge.string||tt===Ge.num||Je.includes(tt)||et.includes(tt)},Me=function(tt){return tt===Ge.name||Je.includes(tt)||et.includes(tt)},$e=function(tt){return tt===Ge.name||et.includes(tt)},Be=function(tt){return tt===Ke.abstract||tt===Ke.declare||tt===Ke.enum||tt===Ke.module||tt===Ke.namespace||tt===Ke.interface||tt===Ke.type},Ve=function(tt){return tt===Ke.keyof||tt===Ke.readonly||tt===Ke.unique},Ue=function(tt){return tt===Ge.invalidTemplate},{tokTypes:Ge,keywordTypes:Xe}=ve,Je=Object.values(Xe),Ke=Ie(),et=Object.values(Ke),ot=Re(),it=Ne(),at=new RegExp(`^(?:${Object.keys(Ke).join("|")})$`);ot.jsxTagStart.updateContext=function(){this.context.push(it.tc_expr),this.context.push(it.tc_oTag),this.exprAllowed=!1},ot.jsxTagEnd.updateContext=function(tt){let xt=this.context.pop();if(xt===it.tc_oTag&&tt===Ge.slash||xt===it.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===it.tc_expr;else this.exprAllowed=!0},Ae={tokTypes:{...Ke,...ot},tokContexts:{...it},keywordsRegExp:at,tokenIsLiteralPropertyName:Le,tokenIsKeywordOrIdentifier:Me,tokenIsIdentifier:$e,tokenIsTSDeclarationStart:Be,tokenIsTSTypeOperator:Ve,tokenIsTemplate:Ue}}return Ae;function _e(Le,Me={}){return new ve.TokenType("name",Me)}function Ne(){return{tc_oTag:new ve.TokContext("<tag",!1,!1),tc_cTag:new ve.TokContext("</tag",!1,!1),tc_expr:new ve.TokContext("<tag>...</tag>",!0,!0)}}function Re(){return{at:new ve.TokenType("@"),jsxName:new ve.TokenType("jsxName"),jsxText:new ve.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new ve.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new ve.TokenType("jsxTagEnd")}}function Ie(){return{assert:_e("assert",{startsExpr:Yt}),asserts:_e("asserts",{startsExpr:Yt}),global:_e("global",{startsExpr:Yt}),keyof:_e("keyof",{startsExpr:Yt}),readonly:_e("readonly",{startsExpr:Yt}),unique:_e("unique",{startsExpr:Yt}),abstract:_e("abstract",{startsExpr:Yt}),declare:_e("declare",{startsExpr:Yt}),enum:_e("enum",{startsExpr:Yt}),module:_e("module",{startsExpr:Yt}),namespace:_e("namespace",{startsExpr:Yt}),interface:_e("interface",{startsExpr:Yt}),type:_e("type",{startsExpr:Yt})}}}var Du=1048576,un=2097152,Wr=1,Un=2,Ru=4,ni=8,Lu=16,mo=64,go=128,Ou=256,Mu=512,yo=1024,Cx=Wr|Un|ni|go,vx=Wr|0|ni|0,Sx=Wr|0|Ru|0,Tx=Wr|0|Lu|0,Ax=0|Un|0|go,kx=0|Un|0|0,Bu=Wr|Un|ni|Ou,wx=0|yo,Px=0|mo,_x=Wr|0|0|mo,Nx=Bu|Mu,Ix=0|yo,xo=4,bo=2,Eo=1,Dx=bo|Eo,Rx=bo|xo,Lx=Eo|xo,$u=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,oo=new RegExp("(?=("+$u.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),hn=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function Fu(i,ve){let Ae="true";if(ve.type==="MethodDefinition"&&(ve.kind==="get"||ve.kind==="set"))Ae=(ve.static?"s":"i")+ve.kind;if(i==="iget"&&Ae==="iset"||i==="iset"&&Ae==="iget"||i==="sget"&&Ae==="sset"||i==="sset"&&Ae==="sget")return[!1,"true"];if(!i)return[!1,Ae];return[!0,i]}function co(i,ve){let{computed:Ae,key:_e}=i;return!Ae&&(_e.type==="Identifier"&&_e.name===ve||_e.type==="Literal"&&_e.value===ve)}var nt={AbstractMethodHasImplementation:({methodName:i})=>`Method '${i}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:i})=>`Property '${i}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:({name:i})=>`Cannot find name '${i}'.`,ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:i})=>`'declare' is not allowed in ${i}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:()=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:i})=>`Duplicate modifier: '${i}'.`,EmptyHeritageClauseType:({token:i})=>`'${i}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",IncompatibleModifiers:({modifiers:i})=>`'${i[0]}' modifier cannot be used with '${i[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:i})=>`Index signatures cannot have an accessibility modifier ('${i}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:i})=>`'${i}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:i})=>`'${i}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:i})=>`'${i}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:i})=>`'${i[0]}' modifier must precede '${i[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:i})=>`Private elements cannot have an accessibility modifier ('${i}').`,PrivateMethodsHasAccessibility:({modifier:i})=>`Private methods cannot have an accessibility modifier ('${i}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:i})=>`Single type parameter ${i} should have a trailing comma. Example usage: <${i},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:i})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${i}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},qn={UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",TrailingDecorator:"Decorators must be attached to a class element.",SpreadElementDecorator:"Decorators can't be used with SpreadElement"};function ju(i,ve,Ae){let{tokTypes:_e}=Ae,{tokTypes:Ne}=ve;return class extends i{takeDecorators(Ie){let Le=this.decoratorStack[this.decoratorStack.length-1];if(Le.length)Ie.decorators=Le,this.resetStartLocationFromNode(Ie,Le[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(Ie){let Le=this.decoratorStack[this.decoratorStack.length-1];while(this.match(Ne.at)){let Me=this.parseDecorator();Le.push(Me)}if(this.match(_e._export)){if(!Ie)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,qn.UnexpectedLeadingDecorator)}parseDecorator(){let Ie=this.startNode();this.next(),this.decoratorStack.push([]);let Le=this.start,Me=this.startLoc,$e;if(this.match(_e.parenL)){let Be=this.start,Ve=this.startLoc;if(this.next(),$e=this.parseExpression(),this.expect(_e.parenR),this.options.preserveParens){let Ue=this.startNodeAt(Be,Ve);Ue.expression=$e,$e=this.finishNode(Ue,"ParenthesizedExpression")}}else{$e=this.parseIdent(!1);while(this.eat(_e.dot)){let Be=this.startNodeAt(Le,Me);Be.object=$e,Be.property=this.parseIdent(!0),Be.computed=!1,$e=this.finishNode(Be,"MemberExpression")}}return Ie.expression=this.parseMaybeDecoratorArguments($e),this.decoratorStack.pop(),this.finishNode(Ie,"Decorator")}parseMaybeDecoratorArguments(Ie){if(this.eat(_e.parenL)){let Le=this.startNodeAtNode(Ie);return Le.callee=Ie,Le.arguments=this.parseExprList(_e.parenR,!1),this.finishNode(Le,"CallExpression")}return Ie}}}var lo={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},Vu=/^[\da-fA-F]+$/,qu=/^\d+$/;function fn(i){if(!i)return i;if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return fn(i.object)+"."+fn(i.property)}function Uu(i,ve,Ae,_e){let Ne=i.tokTypes,Re=ve.tokTypes,{isNewLine:Ie,isIdentifierChar:Le}=i,Me=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},_e||{});return class extends Ae{jsx_readToken(){let Be="",Ve=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let Ue=this.input.charCodeAt(this.pos);switch(Ue){case 60:case 123:if(this.pos===this.start){if(Ue===60&&this.exprAllowed)return++this.pos,this.finishToken(Re.jsxTagStart);return this.getTokenFromCode(Ue)}return Be+=this.input.slice(Ve,this.pos),this.finishToken(Re.jsxText,Be);case 38:Be+=this.input.slice(Ve,this.pos),Be+=this.jsx_readEntity(),Ve=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(Ue===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(Ie(Ue))Be+=this.input.slice(Ve,this.pos),Be+=this.jsx_readNewLine(!0),Ve=this.pos;else++this.pos}}}jsx_readNewLine(Be){let Ve=this.input.charCodeAt(this.pos),Ue;if(++this.pos,Ve===13&&this.input.charCodeAt(this.pos)===10)++this.pos,Ue=Be?`
10
- `:`\r
11
- `;else Ue=String.fromCharCode(Ve);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return Ue}jsx_readString(Be){let Ve="",Ue=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let Ge=this.input.charCodeAt(this.pos);if(Ge===Be)break;if(Ge===38)Ve+=this.input.slice(Ue,this.pos),Ve+=this.jsx_readEntity(),Ue=this.pos;else if(Ie(Ge))Ve+=this.input.slice(Ue,this.pos),Ve+=this.jsx_readNewLine(!1),Ue=this.pos;else++this.pos}return Ve+=this.input.slice(Ue,this.pos++),this.finishToken(Ne.string,Ve)}jsx_readEntity(){let Be="",Ve=0,Ue,Ge=this.input[this.pos];if(Ge!=="&")this.raise(this.pos,"Entity must start with an ampersand");let Xe=++this.pos;while(this.pos<this.input.length&&Ve++<10){if(Ge=this.input[this.pos++],Ge===";"){if(Be[0]==="#"){let Je;if(Be[1]==="x"||Be[1]==="X"){if(Be=Be.substr(2),Vu.test(Be))Je=parseInt(Be,16)}else if(Be=Be.substr(1),qu.test(Be))Je=parseInt(Be,10);if(Je!==void 0&&Je<=1114111)Ue=String.fromCodePoint(Je)}else if(Object.prototype.hasOwnProperty.call(lo,Be))Ue=lo[Be];break}Be+=Ge}if(Ue===void 0)return this.pos=Xe,"&";return Ue}jsx_readWord(){let Be,Ve=this.pos;do Be=this.input.charCodeAt(++this.pos);while(Le(Be)||Be===45);return this.finishToken(Re.jsxName,this.input.slice(Ve,this.pos))}jsx_parseIdentifier(){let Be=this.startNode();if(this.type===Re.jsxName)Be.name=this.value;else if(this.type.keyword)Be.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(Be,"JSXIdentifier")}jsx_parseNamespacedName(){let Be=this.start,Ve=this.startLoc,Ue=this.jsx_parseIdentifier();if(!Me.allowNamespaces||!this.eat(Ne.colon))return Ue;var Ge=this.startNodeAt(Be,Ve);return Ge.namespace=Ue,Ge.name=this.jsx_parseIdentifier(),this.finishNode(Ge,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===Re.jsxTagEnd)return"";let Be=this.start,Ve=this.startLoc,Ue=this.jsx_parseNamespacedName();if(this.type===Ne.dot&&Ue.type==="JSXNamespacedName"&&!Me.allowNamespacedObjects)this.unexpected();while(this.eat(Ne.dot)){let Ge=this.startNodeAt(Be,Ve);Ge.object=Ue,Ge.property=this.jsx_parseIdentifier(),Ue=this.finishNode(Ge,"JSXMemberExpression")}return Ue}jsx_parseAttributeValue(){switch(this.type){case Ne.braceL:let Be=this.jsx_parseExpressionContainer();if(Be.expression.type==="JSXEmptyExpression")this.raise(Be.start,"JSX attributes must only be assigned a non-empty expression");return Be;case Re.jsxTagStart:case Ne.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let Be=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(Be,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let Be=this.startNode();if(this.next(),this.eat(Ne.ellipsis))return Be.expression=this.parseExpression(),this.expect(Ne.braceR),this.finishNode(Be,"JSXSpreadChild");return Be.expression=this.type===Ne.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(Ne.braceR),this.finishNode(Be,"JSXExpressionContainer")}jsx_parseAttribute(){let Be=this.startNode();if(this.eat(Ne.braceL))return this.expect(Ne.ellipsis),Be.argument=this.parseMaybeAssign(),this.expect(Ne.braceR),this.finishNode(Be,"JSXSpreadAttribute");return Be.name=this.jsx_parseNamespacedName(),Be.value=this.eat(Ne.eq)?this.jsx_parseAttributeValue():null,this.finishNode(Be,"JSXAttribute")}jsx_parseOpeningElementAt(Be,Ve){let Ue=this.startNodeAt(Be,Ve);Ue.attributes=[];let Ge=this.jsx_parseElementName();if(Ge)Ue.name=Ge;while(this.type!==Ne.slash&&this.type!==Re.jsxTagEnd)Ue.attributes.push(this.jsx_parseAttribute());return Ue.selfClosing=this.eat(Ne.slash),this.expect(Re.jsxTagEnd),this.finishNode(Ue,Ge?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(Be,Ve){let Ue=this.startNodeAt(Be,Ve),Ge=this.jsx_parseElementName();if(Ge)Ue.name=Ge;return this.expect(Re.jsxTagEnd),this.finishNode(Ue,Ge?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(Be,Ve){let Ue=this.startNodeAt(Be,Ve),Ge=[],Xe=this.jsx_parseOpeningElementAt(Be,Ve),Je=null;if(!Xe.selfClosing){e:for(;;)switch(this.type){case Re.jsxTagStart:if(Be=this.start,Ve=this.startLoc,this.next(),this.eat(Ne.slash)){Je=this.jsx_parseClosingElementAt(Be,Ve);break e}Ge.push(this.jsx_parseElementAt(Be,Ve));break;case Re.jsxText:Ge.push(this.parseExprAtom());break;case Ne.braceL:Ge.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(fn(Je.name)!==fn(Xe.name))this.raise(Je.start,"Expected corresponding JSX closing tag for <"+fn(Xe.name)+">")}let Ke=Xe.name?"Element":"Fragment";if(Ue["opening"+Ke]=Xe,Ue["closing"+Ke]=Je,Ue.children=Ge,this.type===Ne.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(Ue,"JSX"+Ke)}jsx_parseText(){let Be=this.parseLiteral(this.value);return Be.type="JSXText",Be}jsx_parseElement(){let Be=this.start,Ve=this.startLoc;return this.next(),this.jsx_parseElementAt(Be,Ve)}}}function Gu(i,ve,Ae){let{tokTypes:_e}=ve,{tokTypes:Ne}=Ae;return class extends i{parseMaybeImportAttributes(Ie){if(this.type===Ne._with||this.type===_e.assert){this.next();let Le=this.parseImportAttributes();if(Le)Ie.attributes=Le}}parseImportAttributes(){this.expect(Ne.braceL);let Ie=this.parseWithEntries();return this.expect(Ne.braceR),Ie}parseWithEntries(){let Ie=[],Le=new Set;do{if(this.type===Ne.braceR)break;let Me=this.startNode(),$e;if(this.type===Ne.string)$e=this.parseLiteral(this.value);else $e=this.parseIdent(!0);if(this.next(),Me.key=$e,Le.has(Me.key.name))this.raise(this.pos,"Duplicated key in attributes");if(Le.add(Me.key.name),this.type!==Ne.string)this.raise(this.pos,"Only string is supported as an attribute value");Me.value=this.parseLiteral(this.value),Ie.push(this.finishNode(Me,"ImportAttribute"))}while(this.eat(Ne.comma));return Ie}}}var ei=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function Co(){return{_tag:"BufferedParserEvents",segments:[]}}var Wu=Co();function po(i){return i.segments.length>0}var Hu=class{constructor(i,ve){this.options=i,this.state=ve,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let i={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(i),i.depth===0&&this.hasCallbacks)this.activateCallbacks();return i}commit(i){this.close(i);let ve=this.currentFrame();if(ve){if(i.output)this.appendOutput(this.outputFor(ve),i.output);return}if(this.undoLog.length=i.undoMark,i.output)this.flush(i.output)}rollback(i){this.close(i),this.unwind(i.undoMark),this.restore(i)}rollbackWithEvents(i){return this.close(i),this.unwind(i.undoMark),this.restore(i),i.output??Wu}replay(i){if(!po(i))return;let ve=this.currentFrame();if(ve){this.appendOutput(this.outputFor(ve),i);return}this.flush(i)}set(i,ve,Ae){this.willSet(i,ve),i[ve]=Ae}remove(i,ve){this.willSet(i,ve),delete i[ve]}append(i,ve){this.willAppend(i),i.push(ve)}pop(i){return this.willMutateTail(i,1),i.pop()}truncate(i,ve){if(ve<i.length)this.willMutateTail(i,i.length-ve);else this.willAppend(i);i.length=ve}modify(i,ve,Ae){let[_e,Ne]=Ae(i[ve]);return this.set(i,ve,Ne),_e}willAppend(i){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:i,length:i.length})}willMutateTail(i,ve){if(!this.active)return;let Ae=Math.max(0,i.length-ve);this.undoLog.push({_tag:"ArrayTail",target:i,start:Ae,values:i.slice(Ae)})}willSet(i,ve){if(!this.active)return;let Ae=i;this.undoLog.push({_tag:"Property",target:Ae,key:ve,had:Object.prototype.hasOwnProperty.call(Ae,ve),value:Ae[ve]})}captureCallbacks(){let i=!1;for(let ve of ei){let Ae=this.options[ve];if(!Ae)continue;i=!0,this.callbacks[ve]=Ae,this.callbackWrappers[ve]=(..._e)=>{this.emit({name:ve,args:_e})}}return i}activateCallbacks(){for(let i of ei){let ve=this.callbackWrappers[i];if(ve)this.options[i]=ve}}deactivateCallbacks(){for(let i of ei){let ve=this.callbacks[i];if(ve)this.options[i]=ve}}emit(i){let ve=this.currentFrame();if(!ve){this.invoke(i);return}let Ae=this.outputFor(ve).segments,_e=Ae[Ae.length-1];if(Array.isArray(_e))_e.push(i);else Ae.push([i])}appendOutput(i,ve){if(po(ve))i.segments.push(ve)}outputFor(i){return i.output??=Co()}flush(i){let ve=[];for(let Ae=i.segments.length-1;Ae>=0;Ae--)ve.push(i.segments[Ae]);while(ve.length>0){let Ae=ve.pop();if(Array.isArray(Ae)){for(let _e of Ae)this.invoke(_e);continue}for(let _e=Ae.segments.length-1;_e>=0;_e--)ve.push(Ae.segments[_e])}}invoke(i){this.callbacks[i.name]?.apply(this.options,i.args)}currentFrame(){return this.frames[this.frames.length-1]}close(i){if(this.currentFrame()!==i||i.depth!==this.frames.length-1)throw Error("Parse effect scopes must be closed in order");if(this.frames.pop(),this.frames.length===0&&this.hasCallbacks)this.deactivateCallbacks()}restore(i){if(this.state)this.state.restore(i.checkpoint)}unwind(i){for(let ve=this.undoLog.length-1;ve>=i;ve--){let Ae=this.undoLog[ve];switch(Ae._tag){case"ArrayLength":if(Ae.target.length<Ae.length)throw Error("A parse effect shortened an append-only array");Ae.target.length=Ae.length;break;case"ArrayTail":Ae.target.length=Ae.start;for(let _e of Ae.values)Ae.target.push(_e);break;case"Property":if(Ae.had)Ae.target[Ae.key]=Ae.value;else delete Ae.target[Ae.key];break}}this.undoLog.length=i}};function Gr(i,ve,Ae){if(i.length===ve)return i;if(i.length<ve)throw Error(`A parse branch shortened the ${Ae} below its checkpoint`);return i.length=ve,i}function Ku(i){return{lookahead:i.getCurLookaheadState(),context:i.context,contextLength:i.context.length,scopeStack:i.scopeStack,scopeStackLength:i.scopeStack.length,importsStack:i.importsStack,importsStackLength:i.importsStack.length,labels:i.labels,labelsLength:i.labels.length,privateNameStack:i.privateNameStack,privateNameStackLength:i.privateNameStack.length,decoratorStack:i.decoratorStack,decoratorStackLength:i.decoratorStack.length,strict:i.strict,potentialArrowAt:i.potentialArrowAt,potentialArrowInForAwait:i.potentialArrowInForAwait,yieldPos:i.yieldPos,awaitPos:i.awaitPos,awaitIdentPos:i.awaitIdentPos,preValue:i.preValue,preToken:i.preToken,isLookahead:i.isLookahead,isAmbientContext:i.isAmbientContext,inAbstractClass:i.inAbstractClass,inType:i.inType,inDisallowConditionalTypesContext:i.inDisallowConditionalTypesContext,maybeInArrowParameters:i.maybeInArrowParameters,shouldParseArrowReturnType:i.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:i.shouldParseAsyncArrowReturnType,importOrExportOuterKind:i.importOrExportOuterKind}}function zu(i,ve){i.setLookaheadTokenState(ve.lookahead),i.context=Gr(ve.context,ve.contextLength,"token context stack"),i.scopeStack=Gr(ve.scopeStack,ve.scopeStackLength,"scope stack"),i.importsStack=Gr(ve.importsStack,ve.importsStackLength,"import stack"),i.labels=Gr(ve.labels,ve.labelsLength,"label stack"),i.privateNameStack=Gr(ve.privateNameStack,ve.privateNameStackLength,"private-name stack"),i.decoratorStack=Gr(ve.decoratorStack,ve.decoratorStackLength,"decorator stack"),i.strict=ve.strict,i.potentialArrowAt=ve.potentialArrowAt,i.potentialArrowInForAwait=ve.potentialArrowInForAwait,i.yieldPos=ve.yieldPos,i.awaitPos=ve.awaitPos,i.awaitIdentPos=ve.awaitIdentPos,i.regexpState=null,i.preValue=ve.preValue,i.preToken=ve.preToken,i.isLookahead=ve.isLookahead,i.isAmbientContext=ve.isAmbientContext,i.inAbstractClass=ve.inAbstractClass,i.inType=ve.inType,i.inDisallowConditionalTypesContext=ve.inDisallowConditionalTypesContext,i.maybeInArrowParameters=ve.maybeInArrowParameters,i.shouldParseArrowReturnType=ve.shouldParseArrowReturnType,i.shouldParseAsyncArrowReturnType=ve.shouldParseAsyncArrowReturnType,i.importOrExportOuterKind=ve.importOrExportOuterKind}function Xu(i){return{capture:()=>Ku(i),restore:(ve)=>zu(i,ve)}}function Ju(i,ve){let{acornTokenTypes:Ae,typeScriptTokenTypes:_e,scope:Ne}=ve,Re=Ne.SCOPE_TOP|Ne.SCOPE_FUNCTION|Ne.SCOPE_CLASS_STATIC_BLOCK;return class extends i{constructor(Le,Me,$e){super(Le,Me,$e);this.parseEffects=new Hu(this.options,Xu(this))}overrideContext(Le){if(this.curContext()!==Le)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(Le)}takeDecorators(Le){let Me=this.decoratorStack.length-1;if(this.decoratorStack[Me].length>0)this.parseEffects?.willSet(this.decoratorStack,String(Me));return super.takeDecorators(Le)}parseDecorators(Le){let Me=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(Me),super.parseDecorators(Le)}parseDecorator(){return this.parseEffects?.willAppend(this.decoratorStack),super.parseDecorator()}parseIdentNode(){if((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.parseEffects?.willMutateTail(this.context,1);return super.parseIdentNode()}parseLabeledStatement(Le,Me,$e,Be){for(let Ve=this.labels.length-1;Ve>=0;Ve--){let Ue=this.labels[Ve];if(Ue.statementStart!==Le.start)break;this.parseEffects?.willSet(Ue,"statementStart"),this.parseEffects?.willSet(Ue,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(Le,Me,$e,Be)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let Le=this.privateNameStack[this.privateNameStack.length-2];if(Le)this.parseEffects?.willAppend(Le.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let Le=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(Le.used)}return super.parsePrivateIdent()}parseClassField(Le){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(Le)}updateContext(Le){let{type:Me}=this;if(Me===Ae.parenR||Me===Ae.braceR||Me===Ae.braceL||Me===Ae.dollarBraceL||Me===Ae.parenL||Me===Ae._function||Me===Ae._class||Me===Ae.colon||Me===Ae.backQuote||Me===Ae.star||Me===_e.jsxTagStart||Me===_e.jsxTagEnd||Me===Ae.slash&&Le===_e.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(Le)}enterScope(Le){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(Le)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(Le,Me,$e){let Be=this.parseEffects;if(Be?.active)if(Me===Ne.BIND_LEXICAL){let Ve=this.currentScope();if(Be.willAppend(Ve.lexical),this.inModule&&Ve.flags&Ne.SCOPE_TOP)Be.willSet(this.undefinedExports,Le)}else if(Me===Ne.BIND_SIMPLE_CATCH)Be.willAppend(this.currentScope().lexical);else if(Me===Ne.BIND_FUNCTION)Be.willAppend(this.currentScope().functions);else for(let Ve=this.scopeStack.length-1;Ve>=0;Ve--){let Ue=this.scopeStack[Ve];if(Be.willAppend(Ue.var),this.inModule&&Ue.flags&Ne.SCOPE_TOP)Be.willSet(this.undefinedExports,Le);if(Ue.flags&Re)break}return super.declareName(Le,Me,$e)}checkLocalExport(Le){return this.parseEffects?.willSet(this.undefinedExports,Le.name),super.checkLocalExport(Le)}}}var ti=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function uo(i){if(!i)throw Error("Assert fail")}function Yu(i){return i==="accessor"}function Qu(i){return i==="in"||i==="out"}var Vn=1,ho=2,Zu=4,ft={SCOPE_TOP:1,SCOPE_FUNCTION:2,SCOPE_ASYNC:4,SCOPE_GENERATOR:8,SCOPE_ARROW:16,SCOPE_SIMPLE_CATCH:32,SCOPE_SUPER:64,SCOPE_DIRECT_SUPER:128,SCOPE_CLASS_STATIC_BLOCK:256,SCOPE_VAR:256,BIND_NONE:0,BIND_VAR:1,BIND_LEXICAL:2,BIND_FUNCTION:3,BIND_SIMPLE_CATCH:4,BIND_OUTSIDE:5,BIND_TS_TYPE:6,BIND_TS_INTERFACE:7,BIND_TS_NAMESPACE:1032,BIND_FLAGS_TS_EXPORT_ONLY:1024,BIND_FLAGS_TS_IMPORT:4096,BIND_FLAGS_TS_ENUM:256,BIND_FLAGS_TS_CONST_ENUM:512,BIND_TS_ENUM:258,BIND_TS_CONST_ENUM:770,BIND_FLAGS_CLASS:128};function ri(i,ve){return ft.SCOPE_FUNCTION|(i?ft.SCOPE_ASYNC:0)|(ve?ft.SCOPE_GENERATOR:0)}function eh(i){if(i.type!=="MemberExpression")return!1;let{computed:ve,property:Ae}=i;if(ve&&(Ae.type!=="TemplateLiteral"||Ae.expressions.length>0))return!1;return vo(i.object)}function th(i){return i.type==="UnaryExpression"&&(i.operator==="-"||i.operator==="+")&&i.argument.type==="Literal"&&(typeof i.argument.value==="number"||typeof i.argument.value==="bigint")}function vo(i){if(i.type==="Identifier")return!0;if(i.type!=="MemberExpression")return!1;if(i.computed)return!1;return vo(i.object)}function fo(i){return i==="private"||i==="public"||i==="protected"}function rh(i){return Boolean(i.startsExpr)}function nh(i){if(i==null)throw Error(`Unexpected ${i} value.`);return i}function sh(i){switch(i){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function So(i){let{dts:ve=!1}=i||{},Ae=!!i?.jsx;return function(_e){let Ne=_e.acorn||Zs,Re=Iu(Ne),{tokTypes:Ie,keywordTypes:Le,isIdentifierStart:Me,lineBreak:$e,isNewLine:Be,tokContexts:Ve,isIdentifierChar:Ue}=Ne,{tokTypes:Ge,tokContexts:Xe,keywordsRegExp:Je,tokenIsLiteralPropertyName:Ke,tokenIsTemplate:et,tokenIsTSDeclarationStart:ot,tokenIsIdentifier:it,tokenIsKeywordOrIdentifier:at,tokenIsTSTypeOperator:tt}=Re;function xt(De,Oe,Fe=De.length){for(let qe=Oe;qe<Fe;qe++){let We=De.charCodeAt(qe);if(Be(We))return qe<Fe-1&&We===13&&De.charCodeAt(qe+1)===10?qe+2:qe+1}return-1}if(_e=ju(_e,Re,Ne),i?.jsx)_e=Uu(Ne,Re,_e,typeof i.jsx==="boolean"?{}:i.jsx);_e=Gu(_e,Re,Ne);let Nt=Ju(_e,{acornTokenTypes:Ie,typeScriptTokenTypes:Ge,scope:ft});class Tt extends Nt{constructor(De,Oe,Fe){super(De,Oe,Fe);this.preValue=null,this.preToken=null,this.isLookahead=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inType=!1,this.inDisallowConditionalTypesContext=!1,this.maybeInArrowParameters=!1,this.shouldParseArrowReturnType=void 0,this.shouldParseAsyncArrowReturnType=void 0,this.decoratorStack=[[]],this.importsStack=[[]],this.importOrExportOuterKind=void 0,this.tsParseConstModifier=(qe)=>{this.tsParseModifiers({modified:qe,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:nt.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return Re}get acornTypeScript(){return Re}getTokenFromCodeInType(De){if(De===62)return this.finishOp(Ie.relational,1);if(De===60)return this.finishOp(Ie.relational,1);return super.getTokenFromCode(De)}readToken(De){if(!this.inType){let Oe=this.curContext();if(Oe===Xe.tc_expr)return this.jsx_readToken();if(Oe===Xe.tc_oTag||Oe===Xe.tc_cTag){if(Me(De))return this.jsx_readWord();if(De==62)return++this.pos,this.finishToken(Ge.jsxTagEnd);if((De===34||De===39)&&Oe==Xe.tc_oTag)return this.jsx_readString(De)}if(De===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,i?.jsx)return this.finishToken(Ge.jsxTagStart);else return this.finishToken(Ie.relational,"<")}return super.readToken(De)}getTokenFromCode(De){if(this.inType)return this.getTokenFromCodeInType(De);if(De===64)return++this.pos,this.finishToken(Ge.at);return super.getTokenFromCode(De)}isAbstractClass(){return this.ts_isContextual(Ge.abstract)&&this.lookahead().type===Ie._class}isDeclareClass(){if(!this.ts_isContextual(Ge.declare))return!1;let De=this.nextTokenStart();if(this.isUnparsedContextual(De,"class"))return!0;if(!this.isUnparsedContextual(De,"abstract"))return!1;let Oe=this.nextTokenStartSince(De+8);return this.isUnparsedContextual(Oe,"class")}finishNode(De,Oe){if(De.type!==""&&De.end!==0)return De;return super.finishNode(De,Oe)}tryParse(De){let Oe={},Fe=this.beginParseEffectScope(),qe;try{qe=De(()=>{throw Oe})}catch(We){let He=We===Oe;if(!He&&!(We instanceof SyntaxError))throw this.parseEffects.rollback(Fe),We;let ze={events:this.parseEffects.rollbackWithEvents(Fe),selected:!1};return He?{node:null,error:null,thrown:!1,aborted:!0,failState:ze}:{node:null,error:We,thrown:!0,aborted:!1,failState:ze}}return this.parseEffects.commit(Fe),{node:qe,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError(De,Oe){De.optionalParametersLoc=Oe?.loc??this.startLoc}reScan_lt_gt(){if(this.type===Ie.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:De}=this;if(De===Ie.bitShift)return this.pos-=2,this.finishOp(Ie.relational,1),Ie.relational;return De}resetEndLocation(De,Oe=this.lastTokEnd,Fe=this.lastTokEndLoc){if(De.end=Oe,De.loc.end=Fe,this.options.ranges)De.range[1]=Oe}startNodeAtNode(De){return super.startNodeAt(De.start,De.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(De,Oe){return Oe.some((Fe)=>{if(fo(Fe))return De.accessibility===Fe;return!!De[Fe]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(De){De.forEach((Oe)=>{if(Oe?.type==="TSTypeCastExpression")this.raise(Oe.typeAnnotation.start,nt.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(De){return De.type==="Identifier"&&De.name==="async"&&this.lastTokEnd===De.end&&!this.canInsertSemicolon()&&De.end-De.start===5&&De.start===this.potentialArrowAt}tsIsIdentifier(){return it(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(Ie.colon)?this.tsParseTypeOrTypePredicateAnnotation(Ie.colon):void 0}tsTryParseGenericAsyncArrowFunction(De,Oe,Fe){if(!this.tsMatchLeftRelational())return;let qe=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let We=this.tsTryParseAndCatch(()=>{let He=this.startNodeAt(De,Oe);return He.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(He),He.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(Ie.arrow),He});if(this.maybeInArrowParameters=qe,!We)return;return this.parseArrowExpression(We,We.params,!0,Fe)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==Ie.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext(De){let Oe=this.context;this.context=[Oe[0]];try{return De()}finally{this.context=Oe}}tsTryParseTypeAnnotation(){return this.match(Ie.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(De,Oe){let Fe=De+Oe.length;if(this.input.slice(De,Fe)===Oe){let qe=this.input.charCodeAt(Fe);return!(Ue(qe)||(qe&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(Ge.abstract)&&this.lookahead().type===Ie._new}nextTokenStartSince(De){return ti.lastIndex=De,ti.test(this.input)?ti.lastIndex:De}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}createLookaheadState(){this.value=null,this.context=[this.curContext()]}getCurLookaheadState(){return{endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,pos:this.pos,value:this.value,type:this.type,exprAllowed:this.exprAllowed,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,containsEsc:this.containsEsc}}setLookaheadTokenState(De){this.pos=De.pos,this.value=De.value,this.exprAllowed=De.exprAllowed,this.endLoc=De.endLoc,this.lastTokEnd=De.lastTokEnd,this.lastTokStart=De.lastTokStart,this.lastTokStartLoc=De.lastTokStartLoc,this.type=De.type,this.start=De.start,this.end=De.end,this.startLoc=De.startLoc,this.lastTokEndLoc=De.lastTokEndLoc,this.curLine=De.curLine,this.lineStart=De.lineStart,this.containsEsc=De.containsEsc}setLookaheadState(De){this.setLookaheadTokenState(De),this.context=De.context&&De.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult(De){let Oe=De.failState;if(!Oe)return;if(Oe.selected)throw Error("A parse branch result can only be selected once");Oe.selected=!0,this.parseEffects.replay(Oe.events)}tsLookAhead(De){let Oe=this.beginParseEffectScope();try{return De()}finally{this.parseEffects.rollback(Oe)}}lookahead(De){let Oe=this.getCurLookaheadState(),Fe=this.context,qe=this.preValue,We=this.preToken,He=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,De!==void 0)for(let ze=0;ze<De;ze++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(Oe),this.context=Fe,this.preValue=qe,this.preToken=We,this.isLookahead=He}}readWord(){let De=this.readWord1(),Oe=Ie.name;if(this.keywords.test(De))Oe=Le[De];else if(new RegExp(Je).test(De))Oe=Ge[De];return this.finishToken(Oe,De)}skipBlockComment(){let De;if(!this.isLookahead)De=this.options.onComment&&this.curPosition();let Oe=this.pos,Fe=this.input.indexOf("*/",this.pos+=2);if(Fe===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Fe+2,this.options.locations)for(let qe,We=Oe;(qe=xt(this.input,We,this.pos))>-1;)++this.curLine,We=this.lineStart=qe;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(Oe+2,Fe),Oe,this.pos,De,this.curPosition())}skipLineComment(De){let Oe=this.pos,Fe;if(!this.isLookahead)Fe=this.options.onComment&&this.curPosition();let qe=this.input.charCodeAt(this.pos+=De);while(this.pos<this.input.length&&!Be(qe))qe=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(Oe+De,this.pos),Oe,this.pos,Fe,this.curPosition())}finishToken(De,Oe){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let Fe=this.type;if(this.type=De,this.value=Oe,!this.isLookahead)this.updateContext(Fe)}resetStartLocation(De,Oe,Fe){if(De.start=Oe,De.loc.start=Fe,this.options.ranges)De.range[0]=Oe}isLineTerminator(){return this.eat(Ie.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return oo.lastIndex=this.end,oo.test(this.input)}addExtra(De,Oe,Fe,qe=!0){if(!De)return;let We=De.extra=De.extra||{};if(qe)We[Oe]=Fe;else Object.defineProperty(We,Oe,{enumerable:qe,value:Fe})}isLiteralPropertyName(){return Ke(this.type)}hasPrecedingLineBreak(){return $e.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(De,Oe){return De.name=Oe,this.finishNode(De,"Identifier")}resetStartLocationFromNode(De,Oe){this.resetStartLocation(De,Oe.start,Oe.loc.start)}isThisParam(De){return De.type==="Identifier"&&De.name==="this"}isLookaheadContextual(De){let Oe=this.nextTokenStart();return this.isUnparsedContextual(Oe,De)}ts_type_isContextual(De,Oe){return De===Oe&&!this.containsEsc}ts_isContextual(De){return this.type===De&&!this.containsEsc}ts_isContextualWithState(De,Oe){return De.type===Oe&&!De.containsEsc}isContextualWithState(De,Oe){return Oe.type===Ie.name&&Oe.value===De&&!Oe.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(Ie.plusMin))return this.ts_isContextual(Ge.readonly);if(this.ts_isContextual(Ge.readonly))this.next();if(!this.match(Ie.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(Ie._in)}tsInDisallowConditionalTypesContext(De){let Oe=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return De()}finally{this.inDisallowConditionalTypesContext=Oe}}tsTryParseType(){return this.tsEatThenParseType(Ie.colon)}match(De){return this.type===De}matchJsx(De){return this.type===Re.tokTypes[De]}ts_eatWithState(De,Oe,Fe){let qe=Fe.type;if(De===qe){for(let We=0;We<Oe;We++)this.next();return!0}else return!1}ts_eatContextualWithState(De,Oe,Fe){if(Je.test(De)){if(this.ts_isContextualWithState(Fe,Ge[De])){for(let qe=0;qe<Oe;qe++)this.next();return!0}return!1}else{if(!this.isContextualWithState(De,Fe))return!1;for(let qe=0;qe<Oe;qe++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(Ie._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual(De){if(Je.test(De)){if(this.ts_isContextual(Ge[De]))return this.next(),!0;return!1}else return super.eatContextual(De)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let De=this.startNode();if(this.expectContextual("require"),this.expect(Ie.parenL),!this.match(Ie.string))this.unexpected();return De.expression=this.parseExprAtom(),this.expect(Ie.parenR),this.finishNode(De,"TSExternalModuleReference")}tsParseEntityName(De=!0){let Oe=this.parseIdent(De);while(this.eat(Ie.dot)){let Fe=this.startNodeAtNode(Oe);Fe.left=Oe,Fe.right=this.parseIdent(De),Oe=this.finishNode(Fe,"TSQualifiedName")}return Oe}tsParseEnumMember(){let De=this.startNode();if(De.id=this.match(Ie.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(Ie.eq))De.initializer=this.parseMaybeAssign();return this.finishNode(De,"TSEnumMember")}tsParseEnumDeclaration(De,Oe={}){if(Oe.const)De.const=!0;if(Oe.declare)De.declare=!0;this.expectContextual("enum"),De.id=this.parseIdent();let Fe=Oe.const?ft.BIND_TS_CONST_ENUM:ft.BIND_TS_ENUM;return this.checkLValSimple(De.id,Fe),this.expect(Ie.braceL),De.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(Ie.braceR),this.finishNode(De,"TSEnumDeclaration")}tsParseModuleBlock(){let De=this.startNode();this.enterScope(Du),this.expect(Ie.braceL),De.body=[];while(this.type!==Ie.braceR){let Oe=this.parseStatement(null,!0);De.body.push(Oe)}return this.next(),super.exitScope(),this.finishNode(De,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration(De){if(this.ts_isContextual(Ge.global))De.global=!0,De.id=this.parseIdent();else if(this.match(Ie.string))De.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(Ie.braceL))this.enterScope(un),De.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode(De,"TSModuleDeclaration")}tsTryParseDeclare(De){if(this.isLineTerminator())return;let Oe=this.type,Fe;if(this.isContextual("let"))Oe=Ie._var,Fe="let";return this.tsInAmbientContext(()=>{if(Oe===Ie._function)return De.declare=!0,this.parseFunctionStatement(De,!1,!0);if(Oe===Ie._class)return De.declare=!0,this.parseClass(De,!0);if(Oe===Ge.enum)return this.tsParseEnumDeclaration(De,{declare:!0});if(Oe===Ge.global)return this.tsParseAmbientExternalModuleDeclaration(De);if(Oe===Ie._const||Oe===Ie._var){if(!this.match(Ie._const)||!this.isLookaheadContextual("enum"))return De.declare=!0,this.parseVarStatement(De,Fe||this.value,!0);return this.expect(Ie._const),this.tsParseEnumDeclaration(De,{const:!0,declare:!0})}if(Oe===Ge.interface){let qe=this.tsParseInterfaceDeclaration(De,{declare:!0});if(qe)return qe}if(it(Oe))return this.tsParseDeclaration(De,this.value,!0)})}tsIsListTerminator(De){switch(De){case"EnumMembers":case"TypeMembers":return this.match(Ie.braceR);case"HeritageClauseElement":return this.match(Ie.braceL);case"TupleElementTypes":return this.match(Ie.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(De,Oe,Fe,qe){let We=[],He=-1;for(;;){if(this.tsIsListTerminator(De))break;He=-1;let ze=Oe();if(ze==null)return;if(We.push(ze),this.eat(Ie.comma)){He=this.lastTokStart;continue}if(this.tsIsListTerminator(De))break;if(Fe)this.expect(Ie.comma);return}if(qe)qe.value=He;return We}tsParseDelimitedList(De,Oe,Fe){return nh(this.tsParseDelimitedListWorker(De,Oe,!0,Fe))}tsParseBracketedList(De,Oe,Fe,qe,We){if(!qe)if(Fe)this.expect(Ie.bracketL);else this.expect(Ie.relational);let He=this.tsParseDelimitedList(De,Oe,We);if(Fe)this.expect(Ie.bracketR);else this.expect(Ie.relational);return He}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(De){return!this.match(De)?void 0:this.tsNextThenParseType()}tsExpectThenParseType(De){return this.tsDoThenParseType(()=>this.expect(De))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(De){return this.tsInType(()=>(De(),this.tsParseType()))}tsSkipParameterStart(){if(it(this.type)||this.match(Ie._this))return this.next(),!0;if(this.match(Ie.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(Ie.bracketL)){this.next();try{return this.parseBindingList(Ie.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(Ie.parenR)||this.match(Ie.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(Ie.colon)||this.match(Ie.comma)||this.match(Ie.question)||this.match(Ie.eq))return!0;if(this.match(Ie.parenR)){if(this.next(),this.match(Ie.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(Ie.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(De){let Oe=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return De()}finally{this.inDisallowConditionalTypesContext=Oe}}tsParseBindingListForSignature(){return super.parseBindingList(Ie.parenR,!0,!0).map((De)=>{if(De.type!=="Identifier"&&De.type!=="RestElement"&&De.type!=="ObjectPattern"&&De.type!=="ArrayPattern")this.raise(De.start,nt.UnsupportedSignatureParameterKind({type:De.type}));return De})}tsParseTypePredicateAsserts(){if(this.type!==Ge.asserts)return!1;let De=this.containsEsc;if(this.next(),!it(this.type)&&!this.match(Ie._this))return!1;if(De)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let De=this.startNode();return this.next(),this.finishNode(De,"TSThisType")}tsParseTypeAnnotation(De=!0,Oe=this.startNode()){return this.tsInType(()=>{if(De)this.expect(Ie.colon);Oe.typeAnnotation=this.tsParseType()}),this.finishNode(Oe,"TSTypeAnnotation")}tsParseThisTypePredicate(De){this.next();let Oe=this.startNodeAtNode(De);return Oe.parameterName=De,Oe.typeAnnotation=this.tsParseTypeAnnotation(!1),Oe.asserts=!1,this.finishNode(Oe,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let De=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate(De);else return De}tsParseTypePredicatePrefix(){let De=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),De}tsParseTypeOrTypePredicateAnnotation(De){return this.tsInType(()=>{let Oe=this.startNode();this.expect(De);let Fe=this.startNode(),qe=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(qe){let Ze=this.tsParseTypeAnnotation(!1);return Fe.parameterName=qe,Fe.typeAnnotation=Ze,Fe.asserts=!1,Oe.typeAnnotation=this.finishNode(Fe,"TSTypePredicate"),this.finishNode(Oe,"TSTypeAnnotation")}let We=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(We&&this.match(Ie._this)){let Ze=this.tsParseThisTypeOrThisTypePredicate();if(Ze.type==="TSThisType")Fe.parameterName=Ze,Fe.asserts=!0,Fe.typeAnnotation=null,Ze=this.finishNode(Fe,"TSTypePredicate");else this.resetStartLocationFromNode(Ze,Fe),Ze.asserts=!0;return Oe.typeAnnotation=Ze,this.finishNode(Oe,"TSTypeAnnotation")}let He=We&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!He){if(!We)return this.tsParseTypeAnnotation(!1,Oe);return Fe.parameterName=this.parseIdent(),Fe.asserts=We,Fe.typeAnnotation=null,Oe.typeAnnotation=this.finishNode(Fe,"TSTypePredicate"),this.finishNode(Oe,"TSTypeAnnotation")}let ze=this.tsParseTypeAnnotation(!1);return Fe.parameterName=He,Fe.typeAnnotation=ze,Fe.asserts=We,Oe.typeAnnotation=this.finishNode(Fe,"TSTypePredicate"),this.finishNode(Oe,"TSTypeAnnotation")})}tsFillSignature(De,Oe){let Fe=De===Ie.arrow,qe="parameters",We="typeAnnotation";if(Oe.typeParameters=this.tsTryParseTypeParameters(),this.expect(Ie.parenL),Oe.parameters=this.tsParseBindingListForSignature(),Fe)Oe.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(De);else if(this.match(De))Oe.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(De)}tsTryNextParseConstantContext(){if(this.lookahead().type!==Ie._const)return null;this.next();let De=this.tsParseTypeReference();if(De.typeParameters||De.typeArguments)this.raise(De.typeName.start,nt.CannotFindName({name:"const"}));return De}tsParseFunctionOrConstructorType(De,Oe){let Fe=this.startNode();if(De==="TSConstructorType"){if(Fe.abstract=!!Oe,Oe)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(Ie.arrow,Fe)),this.finishNode(Fe,De)}tsParseUnionOrIntersectionType(De,Oe,Fe){let qe=this.startNode(),We=this.eat(Fe),He=[];do He.push(Oe());while(this.eat(Fe));if(He.length===1&&!We)return He[0];return qe.types=He,this.finishNode(qe,De)}tsCheckTypeAnnotationForReadOnly(De){switch(De.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(De.start,nt.UnexpectedReadonly)}}tsParseTypeOperator(){let De=this.startNode(),Oe=this.value;if(this.next(),De.operator=Oe,De.typeAnnotation=this.tsParseTypeOperatorOrHigher(),Oe==="readonly")this.tsCheckTypeAnnotationForReadOnly(De);return this.finishNode(De,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(Ie._extends)){let De=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(Ie.question))return De}}tsParseInferType(){let De=this.startNode();this.expectContextual("infer");let Oe=this.startNode();return Oe.name=this.tsParseTypeParameterName(),Oe.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),De.typeParameter=this.finishNode(Oe,"TSTypeParameter"),this.finishNode(De,"TSInferType")}tsParseLiteralTypeNode(){let De=this.startNode();return De.literal=(()=>{switch(this.type){case Ie.num:case Ie.string:case Ie._true:case Ie._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(De,"TSLiteralType")}tsParseImportType(){let De=this.startNode();if(this.expect(Ie._import),this.expect(Ie.parenL),!this.match(Ie.string))this.raise(this.start,nt.UnsupportedImportTypeArgument);if(De.argument=this.parseExprAtom(),this.expect(Ie.parenR),this.eat(Ie.dot))De.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())De.typeArguments=this.tsParseTypeArguments();return this.finishNode(De,"TSImportType")}tsParseTypeQuery(){let De=this.startNode();if(this.expect(Ie._typeof),this.match(Ie._import))De.exprName=this.tsParseImportType();else De.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())De.typeArguments=this.tsParseTypeArguments();return this.finishNode(De,"TSTypeQuery")}tsParseMappedTypeParameter(){let De=this.startNode();return De.name=this.tsParseTypeParameterName(),De.constraint=this.tsExpectThenParseType(Ie._in),this.finishNode(De,"TSTypeParameter")}tsParseMappedType(){let De=this.startNode();if(this.expect(Ie.braceL),this.match(Ie.plusMin))De.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))De.readonly=!0;if(this.expect(Ie.bracketL),De.typeParameter=this.tsParseMappedTypeParameter(),De.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(Ie.bracketR),this.match(Ie.plusMin))De.optional=this.value,this.next(),this.expect(Ie.question);else if(this.eat(Ie.question))De.optional=!0;return De.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(Ie.braceR),this.finishNode(De,"TSMappedType")}tsParseTypeLiteral(){let De=this.startNode();return De.members=this.tsParseObjectTypeMembers(),this.finishNode(De,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!at(this.type))return!1;let De=this.lookahead();if(De.type===Ie.colon)return!0;if(De.type!==Ie.question)return!1;return this.lookahead(2).type===Ie.colon}tsParseTupleElementType(){let De=this.startLoc,Oe=this.start,Fe=this.eat(Ie.ellipsis),qe;if(this.tsIsTupleElementLabel()){let We=this.startNode();We.label=this.parseIdent(!0),We.optional=this.eat(Ie.question),this.expect(Ie.colon),We.elementType=this.tsParseType(),qe=this.finishNode(We,"TSNamedTupleMember")}else{qe=this.tsParseType();let We=this.eat(Ie.question);if(this.eat(Ie.colon))this.raise(qe.start,nt.InvalidTupleMemberLabel);if(We){let He=this.startNodeAtNode(qe);He.typeAnnotation=qe,qe=this.finishNode(He,"TSOptionalType")}}if(Fe){let We=this.startNodeAt(Oe,De);We.typeAnnotation=qe,qe=this.finishNode(We,"TSRestType")}return qe}tsParseTupleType(){let De=this.startNode();De.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let Oe=!1;return De.elementTypes.forEach((Fe)=>{let{type:qe}=Fe;if(Oe&&qe!=="TSRestType"&&qe!=="TSOptionalType"&&!(qe==="TSNamedTupleMember"&&Fe.optional))this.raise(Fe.start,nt.OptionalTypeBeforeRequired);if(Oe||=qe==="TSNamedTupleMember"&&Fe.optional||qe==="TSOptionalType",qe==="TSRestType")Fe=Fe.typeAnnotation}),this.finishNode(De,"TSTupleType")}tsParseTemplateLiteralType(){let De=this.startNode();return De.literal=this.parseTemplate({isTagged:!1}),this.finishNode(De,"TSLiteralType")}tsParseTypeReference(){let De=this.startNode();if(De.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())De.typeArguments=this.tsParseTypeArguments();return this.finishNode(De,"TSTypeReference")}tsMatchLeftRelational(){return this.match(Ie.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(Ie.relational)&&this.value===">"}tsParseParenthesizedType(){let De=this.startNode();return this.expect(Ie.parenL),De.typeAnnotation=this.tsParseType(),this.expect(Ie.parenR),this.finishNode(De,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case Ie.string:case Ie.num:case Ie._true:case Ie._false:return this.tsParseLiteralTypeNode();case Ie.plusMin:if(this.value==="-"){let De=this.startNode();if(this.lookahead().type!==Ie.num)this.unexpected();return De.literal=this.parseMaybeUnary(),this.finishNode(De,"TSLiteralType")}break;case Ie._this:return this.tsParseThisTypeOrThisTypePredicate();case Ie._typeof:return this.tsParseTypeQuery();case Ie._import:return this.tsParseImportType();case Ie.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case Ie.bracketL:return this.tsParseTupleType();case Ie.parenL:return this.tsParseParenthesizedType();case Ie.backQuote:case Ie.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:De}=this;if(at(De)||De===Ie._void||De===Ie._null){let Oe=De===Ie._void?"TSVoidKeyword":De===Ie._null?"TSNullKeyword":sh(this.value);if(Oe!==void 0&&this.lookaheadCharCode()!==46){let Fe=this.startNode();return this.next(),this.finishNode(Fe,Oe)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let De=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(Ie.bracketL))if(this.match(Ie.bracketR)){let Oe=this.startNodeAtNode(De);Oe.elementType=De,this.expect(Ie.bracketR),De=this.finishNode(Oe,"TSArrayType")}else{let Oe=this.startNodeAtNode(De);Oe.objectType=De,Oe.indexType=this.tsParseType(),this.expect(Ie.bracketR),De=this.finishNode(Oe,"TSIndexedAccessType")}return De}tsParseTypeOperatorOrHigher(){return tt(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),Ie.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),Ie.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(Ie._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){uo(this.inType);let De=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(Ie._extends))return De;let Oe=this.startNodeAtNode(De);return Oe.checkType=De,Oe.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(Ie.question),Oe.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(Ie.colon),Oe.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(Oe,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),it(this.type))return this.next(),this.match(Ie.colon);return!1}tsInType(De){let Oe=this.inType;this.inType=!0;try{return De()}finally{this.inType=Oe}}tsTryParseIndexSignature(De){if(!(this.match(Ie.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(Ie.bracketL);let Oe=this.parseIdent();Oe.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(Oe),this.expect(Ie.bracketR),De.parameters=[Oe];let Fe=this.tsTryParseTypeAnnotation();if(Fe)De.typeAnnotation=Fe;return this.tsParseTypeMemberSemicolon(),this.finishNode(De,"TSIndexSignature")}tsParseNoneModifiers(De){this.tsParseModifiers({modified:De,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:nt.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(De=this.tsParseNoneModifiers.bind(this)){let Oe=this.startNode();return De(Oe),Oe.name=this.tsParseTypeParameterName(),Oe.constraint=this.tsEatThenParseType(Ie._extends),Oe.default=this.tsEatThenParseType(Ie.eq),this.finishNode(Oe,"TSTypeParameter")}tsParseTypeParameters(De){let Oe=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let Fe={value:-1};if(Oe.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,De),!1,!0,Fe),Oe.params.length===0)this.raise(this.start,nt.EmptyTypeParameters);if(Fe.value!==-1)this.addExtra(Oe,"trailingComma",Fe.value);return this.finishNode(Oe,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(De){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(De)}tsTryParse(De){let Oe=this.beginParseEffectScope(),Fe;try{Fe=De()}catch(qe){throw this.parseEffects.rollback(Oe),qe}if(Fe!==void 0&&Fe!==!1)return this.parseEffects.commit(Oe),Fe;this.parseEffects.rollback(Oe);return}tsTokenCanFollowModifier(){return(this.match(Ie.bracketL)||this.match(Ie.braceL)||this.match(Ie.star)||this.match(Ie.ellipsis)||this.match(Ie.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(De,Oe){let Fe=this.value;if(De.indexOf(Fe)!==-1&&!this.containsEsc){if(Oe&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return Fe}return}tsParseModifiersByMap({modified:De,map:Oe}){for(let Fe of Object.keys(Oe))De[Fe]=Oe[Fe]}tsParseModifiers({modified:De,allowedModifiers:Oe,disallowedModifiers:Fe,stopOnStartOfClassStaticBlock:qe,errorTemplate:We=nt.InvalidModifierOnTypeMember}){let He={},ze=(Qe,Ye,lt,bt)=>{if(Ye===lt&&De[bt])this.raise(Qe.column,nt.InvalidModifiersOrder({orderedModifiers:[lt,bt]}))},Ze=(Qe,Ye,lt,bt)=>{if(De[lt]&&Ye===bt||De[bt]&&Ye===lt)this.raise(Qe.column,nt.IncompatibleModifiers({modifiers:[lt,bt]}))};for(;;){let Qe=this.startLoc,Ye=this.tsParseModifier(Oe.concat(Fe??[]),qe);if(!Ye)break;if(fo(Ye))if(De.accessibility)this.raise(this.start,nt.DuplicateAccessibilityModifier());else ze(Qe,Ye,Ye,"override"),ze(Qe,Ye,Ye,"static"),ze(Qe,Ye,Ye,"readonly"),ze(Qe,Ye,Ye,"accessor"),He.accessibility=Ye,De.accessibility=Ye;else if(Qu(Ye))if(De[Ye])this.raise(this.start,nt.DuplicateModifier({modifier:Ye}));else ze(Qe,Ye,"in","out"),He[Ye]=Ye,De[Ye]=!0;else if(Yu(Ye))if(De[Ye])this.raise(this.start,nt.DuplicateModifier({modifier:Ye}));else Ze(Qe,Ye,"accessor","readonly"),Ze(Qe,Ye,"accessor","override"),He[Ye]=Ye,De[Ye]=!0;else if(Ye==="const")if(De[Ye])this.raise(this.start,nt.DuplicateModifier({modifier:Ye}));else He[Ye]=Ye,De[Ye]=!0;else if(Object.hasOwnProperty.call(De,Ye))this.raise(this.start,nt.DuplicateModifier({modifier:Ye}));else ze(Qe,Ye,"static","readonly"),ze(Qe,Ye,"static","override"),ze(Qe,Ye,"override","readonly"),ze(Qe,Ye,"abstract","override"),Ze(Qe,Ye,"declare","override"),Ze(Qe,Ye,"static","abstract"),He[Ye]=Ye,De[Ye]=!0;if(Fe?.includes(Ye))this.raise(this.start,We)}return He}tsParseInOutModifiers(De){this.tsParseModifiers({modified:De,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:nt.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(De){this.tsParseModifiers({modified:De,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:nt.InvalidModifierOnTypeParameter})}parseMaybeUnary(De,Oe,Fe,qe){if(!i?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(De,Oe,Fe,qe)}tsParseTypeAssertion(){if(Ae)this.raise(this.start,nt.ReservedTypeAssertion);let De=this.tryParse(()=>{let Oe=this.startNode(),Fe=this.tsTryNextParseConstantContext();return Oe.typeAnnotation=Fe||this.tsNextThenParseType(),this.expect(Ie.relational),Oe.expression=this.parseMaybeUnary(),this.finishNode(Oe,"TSTypeAssertion")});if(De.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return De.node}tsParseTypeArguments(De=!1){let Oe=this.startNode();if(Oe.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(Ie.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),Oe.params.length===0)this.raise(this.start,nt.EmptyTypeArguments);if(De&&this.curContext()!==Xe.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(Oe,"TSTypeParameterInstantiation")}tsParseHeritageClause(De){let Oe=this.start,Fe=this.tsParseDelimitedList("HeritageClauseElement",()=>{let qe=this.startNode();if(qe.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())qe.typeParameters=this.tsParseTypeArguments();return this.finishNode(qe,"TSExpressionWithTypeArguments")});if(!Fe.length)this.raise(Oe,nt.EmptyHeritageClauseType({token:De}));return Fe}tsParseTypeMemberSemicolon(){if(!this.eat(Ie.comma)&&!this.isLineTerminator())this.expect(Ie.semi)}tsTryParseAndCatch(De){let Oe=this.tryParse((Fe)=>De()||Fe());if(Oe.aborted||!Oe.node)return;return Oe.node}tsParseSignatureMember(De,Oe){return this.tsFillSignature(Ie.colon,Oe),this.tsParseTypeMemberSemicolon(),this.finishNode(Oe,De)}tsParsePropertyOrMethodSignature(De,Oe){if(this.eat(Ie.question))De.optional=!0;let Fe=De;if(this.match(Ie.parenL)||this.tsMatchLeftRelational()){if(Oe)this.raise(De.start,nt.ReadonlyForMethodSignature);let qe=Fe;if(qe.kind&&this.tsMatchLeftRelational())this.raise(this.start,nt.AccesorCannotHaveTypeParameters);this.tsFillSignature(Ie.colon,qe),this.tsParseTypeMemberSemicolon();let We="parameters",He="typeAnnotation";if(qe.kind==="get"){if(qe[We].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(qe[We][0]))this.raise(this.start,nt.AccesorCannotDeclareThisParameter)}}else if(qe.kind==="set"){if(qe[We].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let ze=qe[We][0];if(this.isThisParam(ze))this.raise(this.start,nt.AccesorCannotDeclareThisParameter);if(ze.type==="Identifier"&&ze.optional)this.raise(this.start,nt.SetAccesorCannotHaveOptionalParameter);if(ze.type==="RestElement")this.raise(this.start,nt.SetAccesorCannotHaveRestParameter)}if(qe[He])this.raise(qe[He].start,nt.SetAccesorCannotHaveReturnType)}else qe.kind="method";return this.finishNode(qe,"TSMethodSignature")}else{let qe=Fe;if(Oe)qe.readonly=!0;let We=this.tsTryParseTypeAnnotation();if(We)qe.typeAnnotation=We;return this.tsParseTypeMemberSemicolon(),this.finishNode(qe,"TSPropertySignature")}}tsParseTypeMember(){let De=this.startNode();if(this.match(Ie.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",De);if(this.match(Ie._new)){let Fe=this.startNode();if(this.next(),this.match(Ie.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",De);else return De.key=this.createIdentifier(Fe,"new"),this.tsParsePropertyOrMethodSignature(De,!1)}this.tsParseModifiers({modified:De,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let Oe=this.tsTryParseIndexSignature(De);if(Oe)return Oe;if(this.parsePropertyName(De),!De.computed&&De.key.type==="Identifier"&&(De.key.name==="get"||De.key.name==="set")&&this.tsTokenCanFollowModifier())De.kind=De.key.name,this.parsePropertyName(De);return this.tsParsePropertyOrMethodSignature(De,!!De.readonly)}tsParseList(De,Oe){let Fe=[];while(!this.tsIsListTerminator(De))Fe.push(Oe());return Fe}tsParseObjectTypeMembers(){this.expect(Ie.braceL);let De=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(Ie.braceR),De}tsParseInterfaceDeclaration(De,Oe={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),Oe.declare)De.declare=!0;if(it(this.type)){De.id=this.parseIdent(),this.checkLValSimple(De.id,ft.BIND_TS_INTERFACE);let qe=this.currentScope();this.maybeExportDefined(qe,De.id.name)}else De.id=null,this.raise(this.start,nt.MissingInterfaceName);if(De.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(Ie._extends))De.extends=this.tsParseHeritageClause("extends");let Fe=this.startNode();return Fe.body=this.tsParseInterfaceBody(),De.body=this.finishNode(Fe,"TSInterfaceBody"),this.finishNode(De,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(Ie.braceL);let De=this.inType;this.inType=!0;let Oe=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=De,this.expect(Ie.braceR),Oe}tsParseAbstractDeclaration(De){if(this.match(Ie._class))return De.abstract=!0,this.parseClass(De,!0);else if(this.ts_isContextual(Ge.interface)){if(!this.hasFollowingLineBreak())return De.abstract=!0,this.tsParseInterfaceDeclaration(De)}else this.unexpected(De.start)}tsIsDeclarationStart(){return ot(this.type)}tsParseExpressionStatement(De,Oe){switch(Oe.name){case"declare":{let Fe=this.tsTryParseDeclare(De);if(Fe)return Fe.declare=!0,Fe;break}case"global":if(this.match(Ie.braceL)){this.enterScope(un);let Fe=De;return Fe.global=!0,Fe.id=Oe,Fe.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(Fe,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(De,Oe.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:De}=this,Oe=this.isAsyncFunction(),Fe=this.isLet();if(it(De)){if(Oe&&!this.containsEsc||Fe)return!1;if((De===Ge.type||De===Ge.interface)&&!this.containsEsc){let He=this.lookahead();if(it(He.type)&&!this.isContextualWithState("from",He)||He.type===Ie.braceL)return!1}}else if(!this.match(Ie._default))return!1;let qe=this.nextTokenStart(),We=this.isUnparsedContextual(qe,"from");if(this.input.charCodeAt(qe)===44||it(this.type)&&We)return!0;if(this.match(Ie._default)&&We){let He=this.input.charCodeAt(this.nextTokenStartSince(qe+4));return He===34||He===39}return!1}tsInAmbientContext(De){let Oe=this.isAmbientContext;this.isAmbientContext=!0;try{return De()}finally{this.isAmbientContext=Oe}}tsCheckLineTerminator(De){if(De){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(De,Oe=!1){if(De.id=this.parseIdent(),!Oe)this.checkLValSimple(De.id,ft.BIND_TS_NAMESPACE);if(this.eat(Ie.dot)){let Fe=this.startNode();this.tsParseModuleOrNamespaceDeclaration(Fe,!0),De.body=Fe}else this.enterScope(un),De.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(De,"TSModuleDeclaration")}checkLValSimple(De,Oe=ft.BIND_NONE,Fe){while(De.type==="TSNonNullExpression"||De.type==="TSAsExpression"||De.type==="TSSatisfiesExpression"||De.type==="TSTypeAssertion")De=De.expression;return super.checkLValSimple(De,Oe,Fe)}isSimpleAssignTarget(De){while(De.type==="TSNonNullExpression"||De.type==="TSAsExpression"||De.type==="TSSatisfiesExpression"||De.type==="TSTypeAssertion")De=De.expression;return super.isSimpleAssignTarget(De)}tsParseTypeAliasDeclaration(De){De.id=this.parseIdent(),this.checkLValSimple(De.id,ft.BIND_TS_TYPE);let Oe=this.currentScope();return this.maybeExportDefined(Oe,De.id.name),De.typeAnnotation=this.tsInType(()=>{if(De.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(Ie.eq),this.ts_isContextual(Ge.interface)&&this.lookahead().type!==Ie.dot){let Fe=this.startNode();return this.next(),this.finishNode(Fe,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(De,"TSTypeAliasDeclaration")}tsParseDeclaration(De,Oe,Fe){switch(Oe){case"abstract":if(this.tsCheckLineTerminator(Fe)&&(this.match(Ie._class)||it(this.type)))return this.tsParseAbstractDeclaration(De);break;case"module":if(this.tsCheckLineTerminator(Fe)){if(this.match(Ie.string))return this.tsParseAmbientExternalModuleDeclaration(De);else if(it(this.type))return this.tsParseModuleOrNamespaceDeclaration(De)}break;case"namespace":if(this.tsCheckLineTerminator(Fe)&&it(this.type))return this.tsParseModuleOrNamespaceDeclaration(De);break;case"type":if(this.tsCheckLineTerminator(Fe)&&it(this.type))return this.tsParseTypeAliasDeclaration(De);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(De,Oe){De.isExport=Oe||!1,De.id=this.parseIdent(),this.checkLValSimple(De.id,ft.BIND_LEXICAL),super.expect(Ie.eq);let Fe=this.tsParseModuleReference();if(De.importKind==="type"&&Fe.type!=="TSExternalModuleReference")this.raise(Fe.start,nt.ImportAliasHasImportType);return De.moduleReference=Fe,super.semicolon(),this.finishNode(De,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:De}=this;if(it(De)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((De===Ge.type||De===Ge.interface)&&!this.containsEsc){let qe=this.lookahead();if(it(qe.type)&&!this.isContextualWithState("from",qe)||qe.type===Ie.braceL)return!1}}else if(!this.match(Ie._default))return!1;let Oe=this.nextTokenStart(),Fe=this.isUnparsedContextual(Oe,"from");if(this.input.charCodeAt(Oe)===44||it(this.type)&&Fe)return!0;if(this.match(Ie._default)&&Fe){let qe=this.input.charCodeAt(this.nextTokenStartSince(Oe+4));return qe===34||qe===39}return!1}parseTemplate({isTagged:De=!1}={}){let Oe=this.startNode();this.next(),Oe.expressions=[];let Fe=this.parseTemplateElement({isTagged:De});Oe.quasis=[Fe];while(!Fe.tail){if(this.type===Ie.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Ie.dollarBraceL),Oe.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(Ie.braceR),Oe.quasis.push(Fe=this.parseTemplateElement({isTagged:De}))}return this.next(),this.finishNode(Oe,"TemplateLiteral")}parseFunction(De,Oe,Fe,qe,We){if(this.initFunction(De),this.ecmaVersion>=9||this.ecmaVersion>=6&&!qe){if(this.type===Ie.star&&Oe&ho)this.unexpected();De.generator=this.eat(Ie.star)}if(this.ecmaVersion>=8)De.async=!!qe;if(Oe&Vn)De.id=Oe&Zu&&this.type!==Ie.name?null:this.parseIdent();let He=this.yieldPos,ze=this.awaitPos,Ze=this.awaitIdentPos,Qe=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ri(De.async,De.generator)),!(Oe&Vn))De.id=this.type===Ie.name?this.parseIdent():null;this.parseFunctionParams(De);let Ye=Oe&Vn;if(this.parseFunctionBody(De,Fe,!1,We,{isFunctionDeclaration:Ye}),Ye&&this.isAmbientContext&&De.id){if(this.currentScope().flags&ft.SCOPE_TOP)this.declareName(De.id.name,ft.BIND_FLAGS_TS_EXPORT_ONLY,De.id.start)}if(this.yieldPos=He,this.awaitPos=ze,this.awaitIdentPos=Ze,Oe&Vn&&De.id&&!(Oe&ho))if(De.body)this.checkLValSimple(De.id,this.strict||De.generator||De.async?this.treatFunctionsAsVar?ft.BIND_VAR:ft.BIND_LEXICAL:ft.BIND_FUNCTION);else this.checkLValSimple(De.id,ft.BIND_NONE);return this.maybeInArrowParameters=Qe,this.finishNode(De,Ye?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(De,Oe=!1,Fe=!1,qe=!1,We){if(this.match(Ie.colon))De.returnType=this.tsParseTypeOrTypePredicateAnnotation(Ie.colon);let He=We?.isFunctionDeclaration?"TSDeclareFunction":We?.isClassMethod?"TSDeclareMethod":void 0;if(He&&!this.match(Ie.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode(De,He);if(He==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise(De.start,nt.DeclareFunctionHasImplementation),De.declare)return super.parseFunctionBody(De,Oe,Fe,!1),this.finishNode(De,He)}return super.parseFunctionBody(De,Oe,Fe,qe),De}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let De=this.startNode(),Oe=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(Ie.dot)){De.meta=Oe;let ze=this.containsEsc;if(De.property=this.parseIdent(!0),De.property.name!=="target")this.raiseRecoverable(De.property.start,"The only valid meta property for new is 'new.target'");if(ze)this.raiseRecoverable(De.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(De.start,"'new.target' can only be used in functions and class static block");return this.finishNode(De,"MetaProperty")}let Fe=this.start,qe=this.startLoc,We=this.type===Ie._import;if(De.callee=this.parseSubscripts(this.parseExprAtom(),Fe,qe,!0,!1),We&&De.callee.type==="ImportExpression")this.raise(Fe,"Cannot use new with import()");let{callee:He}=De;if(He.type==="TSInstantiationExpression"&&!He.extra?.parenthesized)De.typeArguments=He.typeArguments,De.callee=He.expression;if(this.eat(Ie.parenL))De.arguments=this.parseExprList(Ie.parenR,this.ecmaVersion>=8,!1);else De.arguments=[];return this.finishNode(De,"NewExpression")}parseExprOp(De,Oe,Fe,qe,We){if(Ie._in.binop>qe&&!this.hasPrecedingLineBreak()){let He;if(this.isContextual("as"))He="TSAsExpression";if(this.isContextual("satisfies"))He="TSSatisfiesExpression";if(He){let ze=this.startNodeAt(Oe,Fe);ze.expression=De;let Ze=this.tsTryNextParseConstantContext();if(Ze)ze.typeAnnotation=Ze;else ze.typeAnnotation=this.tsNextThenParseType();return this.finishNode(ze,He),this.reScan_lt_gt(),this.parseExprOp(ze,Oe,Fe,qe,We)}}return super.parseExprOp(De,Oe,Fe,qe,We)}parseImportSpecifiers(){let De=[],Oe=!0;if(Re.tokenIsIdentifier(this.type)){if(De.push(this.parseImportDefaultSpecifier()),!this.eat(Ie.comma))return De}if(this.type===Ie.star)return De.push(this.parseImportNamespaceSpecifier()),De;this.expect(Ie.braceL);while(!this.eat(Ie.braceR)){if(!Oe){if(this.expect(Ie.comma),this.afterTrailingComma(Ie.braceR))break}else Oe=!1;De.push(this.parseImportSpecifier())}return De}parseImport(De){let Oe=this.lookahead();if(De.importKind="value",this.importOrExportOuterKind="value",it(Oe.type)||this.match(Ie.star)||this.match(Ie.braceL)){let Fe=this.lookahead(2);if(Fe.type!==Ie.comma&&!this.isContextualWithState("from",Fe)&&Fe.type!==Ie.eq&&this.ts_eatContextualWithState("type",1,Oe))this.importOrExportOuterKind="type",De.importKind="type",Oe=this.lookahead(),Fe=this.lookahead(2);if(it(Oe.type)&&Fe.type===Ie.eq){this.next();let qe=this.tsParseImportEqualsDeclaration(De);return this.importOrExportOuterKind="value",qe}}if(this.next(),this.type===Ie.string)De.specifiers=[],De.source=this.parseExprAtom();else De.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),De.source=this.type===Ie.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes(De),this.semicolon(),this.finishNode(De,"ImportDeclaration"),this.importOrExportOuterKind="value",De.importKind==="type"&&De.specifiers.length>1&&De.specifiers[0].type==="ImportDefaultSpecifier")this.raise(De.start,nt.TypeImportCannotSpecifyDefaultAndNamed);return De}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let De=this.startNode();return this.next(),De.abstract=!0,this.parseClass(De,!0)}if(this.match(Ge.interface)){let De=this.tsParseInterfaceDeclaration(this.startNode());if(De)return De}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(De,Oe){if(this.ecmaVersion>=11)if(this.eatContextual("as"))De.exported=this.parseModuleExportName(),this.checkExport(Oe,De.exported,this.lastTokStart);else De.exported=null;if(this.expectContextual("from"),this.type!==Ie.string)this.unexpected();return De.source=this.parseExprAtom(),this.parseMaybeImportAttributes(De),this.semicolon(),this.finishNode(De,"ExportAllDeclaration")}parseDynamicImport(De){if(this.next(),De.source=this.parseMaybeAssign(),this.eat(Ie.comma)){let Oe=this.parseExpression();De.arguments=[Oe]}if(!this.eat(Ie.parenR)){let Oe=this.start;if(this.eat(Ie.comma)&&this.eat(Ie.parenR))this.raiseRecoverable(Oe,"Trailing comma is not allowed in import()");else this.unexpected(Oe)}return this.finishNode(De,"ImportExpression")}parseExport(De,Oe){let Fe=this.lookahead();if(this.ts_eatWithState(Ie._import,2,Fe)){if(this.ts_isContextual(Ge.type)&&this.lookaheadCharCode()!==61)De.importKind="type",this.importOrExportOuterKind="type",this.next();else De.importKind="value",this.importOrExportOuterKind="value";let qe=this.tsParseImportEqualsDeclaration(De,!0);return this.importOrExportOuterKind=void 0,qe}else if(this.ts_eatWithState(Ie.eq,2,Fe)){let qe=De;return qe.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(qe,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,Fe)){let qe=De;return this.expectContextual("namespace"),qe.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(qe,"TSNamespaceExportDeclaration")}else{let qe=this.lookahead(2).type;if(this.ts_isContextualWithState(Fe,Ge.type)&&(qe===Ie.braceL||qe===Ie.star))this.next(),this.importOrExportOuterKind="type",De.exportKind="type";else this.importOrExportOuterKind="value",De.exportKind="value";if(this.next(),this.eat(Ie.star))return this.parseExportAllDeclaration(De,Oe);if(this.eat(Ie._default))return this.checkExport(Oe,"default",this.lastTokStart),De.declaration=this.parseExportDefaultDeclaration(),this.finishNode(De,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(De.declaration=this.parseExportDeclaration(De),De.declaration.type==="VariableDeclaration")this.checkVariableExport(Oe,De.declaration.declarations);else this.checkExport(Oe,De.declaration.id,De.declaration.id.start);De.specifiers=[],De.source=null}else{if(De.declaration=null,De.specifiers=this.parseExportSpecifiers(Oe),this.eatContextual("from")){if(this.type!==Ie.string)this.unexpected();De.source=this.parseExprAtom(),this.parseMaybeImportAttributes(De)}else{for(let We of De.specifiers)if(this.checkUnreserved(We.local),this.checkLocalExport(We.local),We.local.type==="Literal")this.raise(We.local.start,"A string literal cannot be used as an exported binding without `from`.");De.source=null}this.semicolon()}return this.finishNode(De,"ExportNamedDeclaration")}}checkExport(De,Oe,Fe){if(!De)return;if(typeof Oe!=="string")Oe=Oe.type==="Identifier"?Oe.name:Oe.value;De[Oe]=!0}parseMaybeDefault(De,Oe,Fe){let qe=super.parseMaybeDefault(De,Oe,Fe);if(qe.type==="AssignmentPattern"&&qe.typeAnnotation&&qe.right.start<qe.typeAnnotation.start)this.raise(qe.typeAnnotation.start,nt.TypeAnnotationAfterAssign);return qe}typeCastToParameter(De){return De.expression.typeAnnotation=De.typeAnnotation,this.resetEndLocation(De.expression,De.typeAnnotation.end,De.typeAnnotation.loc?.end),De.expression}toAssignableList(De,Oe){if(!De)De=[];for(let Fe=0;Fe<De.length;Fe++){let qe=De[Fe];if(qe?.type==="TSTypeCastExpression")De[Fe]=this.typeCastToParameter(qe)}return super.toAssignableList(De,Oe)}reportReservedArrowTypeParam(De){if(De.params.length===1&&!De.extra?.trailingComma&&Ae)this.raise(De.start,nt.ReservedArrowTypeParam)}parseExprAtom(De,Oe,Fe){if(this.type===Ge.jsxText)return this.jsx_parseText();else if(this.type===Ge.jsxTagStart)return this.jsx_parseElement();else if(this.type===Ge.at)return this.parseDecorators(),this.parseExprAtom();else if(it(this.type)){let qe=this.potentialArrowAt===this.start,We=this.start,He=this.startLoc,ze=this.containsEsc,Ze=this.parseIdent(!1);if(this.ecmaVersion>=8&&!ze&&Ze.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ie._function))return this.overrideContext(Ve.f_expr),this.parseFunction(this.startNodeAt(We,He),0,!1,!0,Oe);if(qe&&!this.canInsertSemicolon()){if(this.eat(Ie.arrow))return this.parseArrowExpression(this.startNodeAt(We,He),[Ze],!1,Oe);if(this.ecmaVersion>=8&&Ze.name==="async"&&this.type===Ie.name&&!ze&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Ze=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Ie.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(We,He),[Ze],!0,Oe)}}return Ze}else return super.parseExprAtom(De,Oe,Fe)}parseExprAtomDefault(){if(it(this.type)){let De=this.potentialArrowAt===this.start,Oe=this.containsEsc,Fe=this.parseIdent();if(!Oe&&Fe.name==="async"&&!this.canInsertSemicolon()){let{type:qe}=this;if(qe===Ie._function)return this.next(),this.parseFunction(this.startNodeAtNode(Fe),void 0,!0,!0);else if(it(qe))if(this.lookaheadCharCode()===61){let We=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(Ie.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(Fe),[We],!0)}else return Fe}if(De&&this.match(Ie.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(Fe),[Fe],!1);return Fe}else this.unexpected()}parseIdentNode(){let De=this.startNode();if(at(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))De.name=this.value;else return super.parseIdentNode();return De}parseVarStatement(De,Oe,Fe=!1){let{isAmbientContext:qe}=this;this.next(),super.parseVar(De,!1,Oe,Fe||qe),this.semicolon();let We=this.finishNode(De,"VariableDeclaration");if(!qe)return We;for(let{id:He,init:ze}of We.declarations){if(!ze)continue;if(Oe!=="const"||!!He.typeAnnotation)this.raise(ze.start,nt.InitializerNotAllowedInAmbientContext);else if(ze.type!=="Literal"&&(ze.type!=="TemplateLiteral"||ze.expressions.length>0)&&!th(ze)&&!eh(ze))this.raise(ze.start,nt.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return We}parseStatement(De,Oe,Fe){if(this.match(Ge.at))this.parseDecorators(!0);if(this.match(Ie._const)&&this.isLookaheadContextual("enum")){let qe=this.startNode();return this.expect(Ie._const),this.tsParseEnumDeclaration(qe,{const:!0})}if(this.ts_isContextual(Ge.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(Ge.interface)){let qe=this.tsParseInterfaceDeclaration(this.startNode());if(qe)return qe}return super.parseStatement(De,Oe,Fe)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(De){if(this.eat(Ie.question))De.optional=!0;if(De.readonly&&this.match(Ie.parenL))this.raise(De.start,nt.ClassMethodHasReadonly);if(De.declare&&this.match(Ie.parenL))this.raise(De.start,nt.ClassMethodHasDeclare)}parseExpressionStatement(De,Oe){return(Oe.type==="Identifier"?this.tsParseExpressionStatement(De,Oe):void 0)||super.parseExpressionStatement(De,Oe)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(Ge.at))return!0;return super.shouldParseExportStatement()}parseConditional(De,Oe,Fe,qe,We){if(this.eat(Ie.question)){let He=this.startNodeAt(Oe,Fe);return He.test=De,He.consequent=this.parseMaybeAssign(),this.expect(Ie.colon),He.alternate=this.parseMaybeAssign(qe),this.finishNode(He,"ConditionalExpression")}return De}parseMaybeConditional(De,Oe){let Fe=this.start,qe=this.startLoc,We=this.parseExprOps(De,Oe);if(this.checkExpressionErrors(Oe))return We;if(!this.maybeInArrowParameters||!this.match(Ie.question))return this.parseConditional(We,Fe,qe,De,Oe);let He=this.tryParse(()=>this.parseConditional(We,Fe,qe,De,Oe));if(!He.node){if(He.error)this.setOptionalParametersError(Oe,He.error);return We}return He.node}parseParenItem(De){let Oe=this.start,Fe=this.startLoc;if(De=super.parseParenItem(De),this.eat(Ie.question))De.optional=!0,this.resetEndLocation(De);if(this.match(Ie.colon)){let qe=this.startNodeAt(Oe,Fe);return qe.expression=De,qe.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(qe,"TSTypeCastExpression")}return De}parseExportDeclaration(De){if(!this.isAmbientContext&&this.ts_isContextual(Ge.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(De));let Oe=this.start,Fe=this.startLoc,qe=this.eatContextual("declare");if(qe&&(this.ts_isContextual(Ge.declare)||!this.shouldParseExportStatement()))this.raise(this.start,nt.ExpectedAmbientAfterExportDeclare);let He=it(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!He)return null;if(He.type==="TSInterfaceDeclaration"||He.type==="TSTypeAliasDeclaration"||qe)De.exportKind="type";if(qe)this.resetStartLocation(He,Oe,Fe),He.declare=!0;return He}parseClassId(De,Oe){if(!Oe&&this.isContextual("implements"))return;super.parseClassId(De,Oe);let Fe=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(Fe)De.typeParameters=Fe}parseClassPropertyAnnotation(De){if(!De.optional){if(this.value==="!"&&this.eat(Ie.prefix))De.definite=!0;else if(this.eat(Ie.question))De.optional=!0}let Oe=this.tsTryParseTypeAnnotation();if(Oe)De.typeAnnotation=Oe}parseClassField(De){if(De.key.type==="PrivateIdentifier"){if(De.abstract)this.raise(De.start,nt.PrivateElementHasAbstract);if(De.accessibility)this.raise(De.start,nt.PrivateElementHasAccessibility({modifier:De.accessibility}));this.parseClassPropertyAnnotation(De)}else{if(this.parseClassPropertyAnnotation(De),this.isAmbientContext&&!(De.readonly&&!De.typeAnnotation)&&this.match(Ie.eq))this.raise(this.start,nt.DeclareClassFieldHasInitializer);if(De.abstract&&this.match(Ie.eq)){let{key:Fe}=De;this.raise(this.start,nt.AbstractPropertyHasInitializer({propertyName:Fe.type==="Identifier"&&!De.computed?Fe.name:`[${this.input.slice(Fe.start,Fe.end)}]`}))}}return super.parseClassField(De)}parseClassMethod(De,Oe,Fe,qe){let We=De.kind==="constructor",He=De.key.type==="PrivateIdentifier",ze=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(He){if(ze)De.typeParameters=ze;if(De.accessibility)this.raise(De.start,nt.PrivateMethodsHasAccessibility({modifier:De.accessibility}))}else if(ze&&We)this.raise(ze.start,nt.ConstructorHasTypeParameters);let{declare:Ze=!1,kind:Qe}=De;if(Ze&&(Qe==="get"||Qe==="set"))this.raise(De.start,nt.DeclareAccessor({kind:Qe}));if(ze)De.typeParameters=ze;let Ye=De.key;if(De.kind==="constructor"){if(Oe)this.raise(Ye.start,"Constructor can't be a generator");if(Fe)this.raise(Ye.start,"Constructor can't be an async method")}else if(De.static&&co(De,"prototype"))this.raise(Ye.start,"Classes may not have a static property named prototype");let lt=De.value=this.parseMethod(Oe,Fe,qe,!0,De);if(De.kind==="get"&&lt.params.length!==0)this.raiseRecoverable(lt.start,"getter should have no params");if(De.kind==="set"&&lt.params.length!==1)this.raiseRecoverable(lt.start,"setter should have exactly one param");if(De.kind==="set"&&lt.params[0].type==="RestElement")this.raiseRecoverable(lt.params[0].start,"Setter cannot use rest params");return this.finishNode(De,"MethodDefinition")}isClassMethod(){return this.match(Ie.relational)}parseClassElement(De){if(this.eat(Ie.semi))return null;let Oe=this.startNode(),Fe="",qe=!1,We=!1,He="method",ze=!1,Ze=["declare","private","public","protected","accessor","override","abstract","readonly","static"],Qe=this.tsParseModifiers({modified:Oe,allowedModifiers:Ze,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:nt.InvalidModifierOnTypeParameterPositions});ze=Boolean(Qe.static);let Ye=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(Oe,Ze))this.raise(this.start,nt.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(Oe),Oe}else{let lt=this.tsTryParseIndexSignature(Oe);if(lt){if(Oe.abstract)this.raise(Oe.start,nt.IndexSignatureHasAbstract);if(Oe.accessibility)this.raise(Oe.start,nt.IndexSignatureHasAccessibility({modifier:Oe.accessibility}));if(Oe.declare)this.raise(Oe.start,nt.IndexSignatureHasDeclare);if(Oe.override)this.raise(Oe.start,nt.IndexSignatureHasOverride);return lt}if(!this.inAbstractClass&&Oe.abstract)this.raise(Oe.start,nt.NonAbstractClassHasAbstractMethod);if(Oe.override){if(!De)this.raise(Oe.start,nt.OverrideNotInSubClass)}if(Oe.static=ze,ze){if(!(this.isClassElementNameStart()||this.type===Ie.star))Fe="static"}if(!Fe&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Ie.star)&&!this.canInsertSemicolon())We=!0;else Fe="async";if(!Fe&&(this.ecmaVersion>=9||!We)&&this.eat(Ie.star))qe=!0;if(!Fe&&!We&&!qe){let bt=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())He=bt;else Fe=bt}if(Fe)Oe.computed=!1,Oe.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Oe.key.name=Fe,this.finishNode(Oe.key,"Identifier");else this.parseClassElementName(Oe);if(this.parsePostMemberNameModifiers(Oe),this.isClassMethod()||this.ecmaVersion<13||this.type===Ie.parenL||He!=="method"||qe||We){let bt=!Oe.static&&co(Oe,"constructor"),gt=bt&&De;if(bt&&He!=="method")this.raise(Oe.key.start,"Constructor can't have get/set modifier");Oe.kind=bt?"constructor":He,this.parseClassMethod(Oe,qe,We,gt)}else this.parseClassField(Oe);return Oe}};if(Oe.declare)this.tsInAmbientContext(Ye);else Ye();return Oe}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper(De){if(super.parseClassSuper(De),De.superClass&&(this.tsMatchLeftRelational()||this.match(Ie.bitShift)))De.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))De.implements=this.tsParseHeritageClause("implements")}parseFunctionParams(De){let Oe=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Oe)De.typeParameters=Oe;super.parseFunctionParams(De)}parseVarId(De,Oe){if(super.parseVarId(De,Oe),De.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(Ie.prefix))De.definite=!0;let Fe=this.tsTryParseTypeAnnotation();if(Fe)De.id.typeAnnotation=Fe,this.resetEndLocation(De.id)}parseArrowExpression(De,Oe,Fe,qe){if(this.match(Ie.colon))De.returnType=this.tsParseTypeAnnotation();let We=this.yieldPos,He=this.awaitPos,ze=this.awaitIdentPos;this.enterScope(ri(Fe,!1)|ft.SCOPE_ARROW),this.initFunction(De);let Ze=this.maybeInArrowParameters;if(this.ecmaVersion>=8)De.async=!!Fe;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,De.params=this.toAssignableList(Oe,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(De,!0,!1,qe),this.yieldPos=We,this.awaitPos=He,this.awaitIdentPos=ze,this.maybeInArrowParameters=Ze,this.finishNode(De,"ArrowFunctionExpression")}parseYield(De){if(!this.yieldPos)this.yieldPos=this.start;let Oe=this.startNode();this.next();let Fe=this.tsMatchLeftRelational();if(!(!this.match(Ie.semi)&&!this.canInsertSemicolon()&&(this.match(Ie.star)||this.type.startsExpr||Fe)))return Oe.delegate=!1,Oe.argument=null,this.finishNode(Oe,"YieldExpression");return Oe.delegate=this.eat(Ie.star),Oe.argument=this.parseMaybeAssign(De),this.finishNode(Oe,"YieldExpression")}parseMaybeAssignOrigin(De,Oe,Fe){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(De);else this.exprAllowed=!1;let qe=!1,We=-1,He=-1,ze=-1;if(Oe)We=Oe.parenthesizedAssign,He=Oe.trailingComma,ze=Oe.doubleProto,Oe.parenthesizedAssign=Oe.trailingComma=-1;else Oe=new hn,qe=!0;let Ze=this.start,Qe=this.startLoc;if(this.type===Ie.parenL||it(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=De==="await";let Ye=this.parseMaybeConditional(De,Oe);if(Fe)Ye=Fe.call(this,Ye,Ze,Qe);if(this.type.isAssign){let lt=this.startNodeAt(Ze,Qe);if(lt.operator=this.value,this.type===Ie.eq)Ye=this.toAssignable(Ye,!0,Oe,!0);if(!qe)Oe.parenthesizedAssign=Oe.trailingComma=Oe.doubleProto=-1;if(Oe.shorthandAssign>=Ye.start)Oe.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===Ie.eq)this.checkLValPattern(Ye);else this.checkLValSimple(Ye);if(lt.left=Ye,this.next(),lt.right=this.parseMaybeAssign(De),ze>-1)Oe.doubleProto=ze;return this.finishNode(lt,"AssignmentExpression")}else if(qe)this.checkExpressionErrors(Oe,!0);if(We>-1)Oe.parenthesizedAssign=We;if(He>-1)Oe.trailingComma=He;return Ye}parseMaybeAssign(De,Oe,Fe){let qe,We;if(i?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(qe=this.tryParse(()=>this.parseMaybeAssignOrigin(De,Oe,Fe)),!qe.error)return qe.node;let Ze=this.context,Qe=Ze[Ze.length-1],Ye=Ze[Ze.length-2];if(Qe===Re.tokContexts.tc_oTag&&Ye===Re.tokContexts.tc_expr)this.parseEffects.pop(Ze),this.parseEffects.pop(Ze);else if(Qe===Re.tokContexts.tc_oTag||Qe===Re.tokContexts.tc_expr)this.parseEffects.pop(Ze)}if(!qe?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(De,Oe,Fe);let He,ze=this.tryParse((Ze)=>{He=this.tsParseTypeParameters(this.tsParseConstModifier);let Qe=this.parseMaybeAssignOrigin(De,Oe,Fe);if(Qe.type!=="ArrowFunctionExpression"||Qe.extra?.parenthesized)Ze();if(He?.params.length!==0)this.resetStartLocationFromNode(Qe,He);return Qe.typeParameters=He,Qe});if(!ze.error&&!ze.aborted){if(He)this.reportReservedArrowTypeParam(He);return ze.node}if(!qe){if(uo(!0),We=this.tryParse(()=>this.parseMaybeAssignOrigin(De,Oe,Fe)),!We.error)return We.node}if(qe?.thrown)throw this.selectTryParseResult(qe),qe.error;if(ze.thrown)throw this.selectTryParseResult(ze),ze.error;if(We?.thrown)throw this.selectTryParseResult(We),We.error;throw qe?.error||ze.error||We?.error}parseAssignableListItem(De){let Oe=[];while(this.match(Ge.at))Oe.push(this.parseDecorator());let Fe=this.start,qe=this.startLoc,We,He=!1,ze=!1;if(De!==void 0){let Ye={};if(this.tsParseModifiers({modified:Ye,allowedModifiers:["public","private","protected","override","readonly"]}),We=Ye.accessibility,ze=Ye.override,He=Ye.readonly,De===!1&&(We||He||ze))this.raise(qe.column,nt.UnexpectedParameterModifier)}let Ze=this.parseMaybeDefault(Fe,qe);this.parseBindingListItem(Ze);let Qe=this.parseMaybeDefault(Ze.start,Ze.loc.start,Ze);if(Oe.length)Qe.decorators=Oe;if(We||He||ze){let Ye=this.startNodeAt(Fe,qe);if(We)Ye.accessibility=We;if(He)Ye.readonly=He;if(ze)Ye.override=ze;if(Qe.type!=="Identifier"&&Qe.type!=="AssignmentPattern")this.raise(Ye.start,nt.UnsupportedParameterPropertyKind);return Ye.parameter=Qe,this.finishNode(Ye,"TSParameterProperty")}return Qe}checkLValInnerPattern(De,Oe=ft.BIND_NONE,Fe){switch(De.type){case"TSParameterProperty":this.checkLValInnerPattern(De.parameter,Oe,Fe);break;default:{super.checkLValInnerPattern(De,Oe,Fe);break}}}parseBindingListItem(De){if(this.eat(Ie.question)){if(De.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise(De.start,nt.PatternIsOptional);De.optional=!0}let Oe=this.tsTryParseTypeAnnotation();if(Oe)De.typeAnnotation=Oe;return this.resetEndLocation(De),De}isAssignable(De,Oe){switch(De.type){case"TSTypeCastExpression":return this.isAssignable(De.expression,Oe);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let Fe=De.properties.length-1;return De.properties.every((qe,We)=>qe.type!=="ObjectMethod"&&(We===Fe||qe.type!=="SpreadElement")&&this.isAssignable(qe))}case"Property":case"ObjectProperty":return this.isAssignable(De.value);case"SpreadElement":return this.isAssignable(De.argument);case"ArrayExpression":return De.elements.every((Fe)=>Fe===null||this.isAssignable(Fe));case"AssignmentExpression":return De.operator==="=";case"ParenthesizedExpression":return this.isAssignable(De.expression);case"MemberExpression":case"OptionalMemberExpression":return!Oe;default:return!1}}toAssignable(De,Oe=!1,Fe=new hn,qe=!1){switch(De.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(De,Oe,Fe,qe);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(Oe);else this.raise(De.start,nt.UnexpectedTypeCastInParameter);let We=this.toAssignable(De.expression,Oe,Fe,qe);if(qe)return De.expression=We,De;return We;case"MemberExpression":break;case"AssignmentExpression":if(!Oe&&De.left.type==="TSTypeCastExpression")De.left=this.typeCastToParameter(De.left);return super.toAssignable(De,Oe,Fe);case"TSTypeCastExpression":return this.typeCastToParameter(De);default:return super.toAssignable(De,Oe,Fe)}return De}toAssignableParenthesizedExpression(De,Oe,Fe,qe=!1){switch(De.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let We=this.toAssignable(De.expression,Oe,Fe,qe);if(qe)return De.expression=We,De;return We;default:return super.toAssignable(De,Oe,Fe)}}parseBindingAtom(){switch(this.type){case Ie._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(De){let Oe;if(this.match(Ie.colon))Oe=De.every((Fe)=>this.isAssignable(Fe,!0));else Oe=!this.canInsertSemicolon();if(Oe){if(this.match(Ie.colon)){let Fe=this.tryParse((qe)=>{let We=this.tsParseTypeOrTypePredicateAnnotation(Ie.colon);if(this.canInsertSemicolon()||!this.match(Ie.arrow))qe();return We});if(Fe.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!Fe.thrown)this.shouldParseArrowReturnType=Fe.node}if(!this.match(Ie.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,Oe}parseParenArrowList(De,Oe,Fe,qe){let We=this.startNodeAt(De,Oe);return We.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(We,Fe,!1,qe)}parseParenAndDistinguishExpression(De,Oe){let Fe=this.start,qe=this.startLoc,We,He=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let ze=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let Ze=this.start,Qe=this.startLoc,Ye=[],lt=!0,bt=!1,gt=new hn,Ut=this.yieldPos,Lt=this.awaitPos,_t;this.yieldPos=0,this.awaitPos=0;while(this.type!==Ie.parenR)if(lt?lt=!1:this.expect(Ie.comma),He&&this.afterTrailingComma(Ie.parenR,!0)){bt=!0;break}else if(this.type===Ie.ellipsis){if(_t=this.start,Ye.push(this.parseParenItem(this.parseRestBinding())),this.type===Ie.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else Ye.push(this.parseMaybeAssign(!1,gt,this.parseParenItem));let vt=this.lastTokEnd,Et=this.lastTokEndLoc;if(this.expect(Ie.parenR),this.maybeInArrowParameters=ze,De&&this.shouldParseArrow(Ye)&&this.eat(Ie.arrow))return this.checkPatternErrors(gt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Ut,this.awaitPos=Lt,this.parseParenArrowList(Fe,qe,Ye,Oe);if(!Ye.length||bt)this.unexpected(this.lastTokStart);if(_t)this.unexpected(_t);if(this.checkExpressionErrors(gt,!0),this.yieldPos=Ut||this.yieldPos,this.awaitPos=Lt||this.awaitPos,Ye.length>1)We=this.startNodeAt(Ze,Qe),We.expressions=Ye,this.finishNodeAt(We,"SequenceExpression",vt,Et);else We=Ye[0]}else We=this.parseParenExpression();if(this.options.preserveParens){let ze=this.startNodeAt(Fe,qe);return ze.expression=We,this.finishNode(ze,"ParenthesizedExpression")}else return We}parseTaggedTemplateExpression(De,Oe,Fe,qe){let We=this.startNodeAt(Oe,Fe);if(We.tag=De,We.quasi=this.parseTemplate({isTagged:!0}),qe)this.raise(Oe,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(We,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(Ie.colon)){let De=this.tryParse((Oe)=>{let Fe=this.tsParseTypeOrTypePredicateAnnotation(Ie.colon);if(this.canInsertSemicolon()||!this.match(Ie.arrow))Oe();return Fe});if(De.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!De.thrown)return this.shouldParseAsyncArrowReturnType=De.node,!this.canInsertSemicolon()&&this.eat(Ie.arrow)}else return!this.canInsertSemicolon()&&this.eat(Ie.arrow)}parseSubscriptAsyncArrow(De,Oe,Fe,qe){let We=this.startNodeAt(De,Oe);return We.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(We,Fe,!0,qe)}parseExprList(De,Oe,Fe,qe){let We=[],He=!0;while(!this.eat(De)){if(!He){if(this.expect(Ie.comma),Oe&&this.afterTrailingComma(De))break}else He=!1;let ze;if(Fe&&this.type===Ie.comma)ze=null;else if(this.type===Ie.ellipsis){if(ze=this.parseSpread(qe),this.maybeInArrowParameters&&this.match(Ie.colon))ze.typeAnnotation=this.tsParseTypeAnnotation();if(qe&&this.type===Ie.comma&&qe.trailingComma<0)qe.trailingComma=this.start}else ze=this.parseMaybeAssign(!1,qe,this.parseParenItem);We.push(ze)}return We}parseMaybeDecoratorArguments(De){let Oe=this.tsMatchLeftRelational()||this.match(Ie.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(Ie.parenL)){let Fe=this.startNodeAtNode(De);if(Fe.callee=De,Fe.arguments=this.parseExprList(Ie.parenR,!1),Oe)Fe.typeArguments=Oe;return this.finishNode(Fe,"CallExpression")}if(Oe){let Fe=this.startNodeAtNode(De);return Fe.expression=De,Fe.typeArguments=Oe,this.finishNode(Fe,"TSInstantiationExpression")}return De}parseSubscript(De,Oe,Fe,qe,We,He,ze){let Ze=He;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(Ie.prefix)){this.exprAllowed=!1,this.next();let gt=this.startNodeAt(Oe,Fe);return gt.expression=De,De=this.finishNode(gt,"TSNonNullExpression"),De}let Qe=!1;if(this.match(Ie.questionDot)&&this.lookaheadCharCode()===60){if(qe)return De;De.optional=!0,Ze=Qe=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(Ie.bitShift)){let gt,Ut=this.tsTryParseAndCatch(()=>{if(!qe&&this.atPossibleAsyncArrow(De)){let Et=this.tsTryParseGenericAsyncArrowFunction(Oe,Fe,ze);if(Et)return De=Et,De}let Lt=this.tsParseTypeArgumentsInExpression();if(!Lt)return De;if(Qe&&!this.match(Ie.parenL))return gt=this.curPosition(),De;if(et(this.type)||this.type===Ie.backQuote){let Et=this.parseTaggedTemplateExpression(De,Oe,Fe,Ze);return Et.typeArguments=Lt,Et}if(!qe&&this.eat(Ie.parenL)){let Et=new hn,Bt=this.startNodeAt(Oe,Fe);if(Bt.callee=De,Bt.arguments=this.parseExprList(Ie.parenR,this.ecmaVersion>=8,!1,Et),this.tsCheckForInvalidTypeCasts(Bt.arguments),Bt.typeArguments=Lt,Ze)Bt.optional=Qe;return this.checkExpressionErrors(Et,!0),De=this.finishNode(Bt,"CallExpression"),De}let _t=this.type;if(this.tsMatchRightRelational()||_t===Ie.bitShift||_t!==Ie.parenL&&rh(_t)&&!this.hasPrecedingLineBreak())return;let vt=this.startNodeAt(Oe,Fe);return vt.expression=De,vt.typeArguments=Lt,this.finishNode(vt,"TSInstantiationExpression")});if(gt)this.unexpected(gt);if(Ut){if(Ut.type==="TSInstantiationExpression"&&(this.match(Ie.dot)||this.match(Ie.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,nt.InvalidPropertyAccessAfterInstantiationExpression);return De=Ut,De}}let Ye=this.ecmaVersion>=11,lt=Ye&&this.eat(Ie.questionDot);if(qe&&lt)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let bt=this.eat(Ie.bracketL);if(bt||lt&&this.type!==Ie.parenL&&this.type!==Ie.backQuote||this.eat(Ie.dot)){let gt=this.startNodeAt(Oe,Fe);if(gt.object=De,bt)gt.property=this.parseExpression(),this.expect(Ie.bracketR);else if(this.type===Ie.privateId&&De.type!=="Super")gt.property=this.parsePrivateIdent();else gt.property=this.parseIdent(this.options.allowReserved!=="never");if(gt.computed=!!bt,Ye)gt.optional=lt;De=this.finishNode(gt,"MemberExpression")}else if(!qe&&this.eat(Ie.parenL)){let gt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let Ut=new hn,Lt=this.yieldPos,_t=this.awaitPos,vt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let Et=this.parseExprList(Ie.parenR,this.ecmaVersion>=8,!1,Ut);if(We&&!lt&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Ut,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=Lt,this.awaitPos=_t,this.awaitIdentPos=vt,De=this.parseSubscriptAsyncArrow(Oe,Fe,Et,ze)}else{this.checkExpressionErrors(Ut,!0),this.yieldPos=Lt||this.yieldPos,this.awaitPos=_t||this.awaitPos,this.awaitIdentPos=vt||this.awaitIdentPos;let Bt=this.startNodeAt(Oe,Fe);if(Bt.callee=De,Bt.arguments=Et,Ye)Bt.optional=lt;De=this.finishNode(Bt,"CallExpression")}this.maybeInArrowParameters=gt}else if(this.type===Ie.backQuote){if(lt||Ze)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let gt=this.startNodeAt(Oe,Fe);gt.tag=De,gt.quasi=this.parseTemplate({isTagged:!0}),De=this.finishNode(gt,"TaggedTemplateExpression")}return De}parseGetterSetter(De){De.kind=De.key.name,this.parsePropertyName(De);let Oe=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(De.value=this.parseMethod(!1),Oe)De.value.typeParameters=Oe;let Fe=De.kind==="get"?0:1,qe=De.value.params[0];if(Fe=qe&&this.isThisParam(qe)?Fe+1:Fe,De.value.params.length!==Fe){let He=De.value.start;if(De.kind==="get")this.raiseRecoverable(He,"getter should have no params");else this.raiseRecoverable(He,"setter should have exactly one param")}else if(De.kind==="set"&&De.value.params[0].type==="RestElement")this.raiseRecoverable(De.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue(De,Oe,Fe,qe,We,He,ze,Ze){if(this.tsMatchLeftRelational()){if(Oe)this.unexpected();De.kind="init",De.method=!0;let Qe=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(De.value=this.parseMethod(Fe,qe),Qe)De.value.typeParameters=Qe;return}return super.parsePropertyValue(De,Oe,Fe,qe,We,He,ze,Ze)}parseProperty(De,Oe){if(!De){let Fe=[];if(this.match(Ge.at))while(this.match(Ge.at))Fe.push(this.parseDecorator());let qe=super.parseProperty(De,Oe);if(qe.type==="SpreadElement"){if(Fe.length)this.raise(qe.start,qn.SpreadElementDecorator)}if(Fe.length)qe.decorators=Fe,Fe=[];return qe}return super.parseProperty(De,Oe)}parseCatchClauseParam(){let De=this.parseBindingAtom(),Oe=De.type==="Identifier";this.enterScope(Oe?ft.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(De,Oe?ft.BIND_SIMPLE_CATCH:ft.BIND_LEXICAL);let Fe=this.tsTryParseTypeAnnotation();if(Fe)De.typeAnnotation=Fe,this.resetEndLocation(De);return this.expect(Ie.parenR),De}parseClass(De,Oe){let Fe=this.inAbstractClass;this.inAbstractClass=!!De.abstract;try{this.next(),this.takeDecorators(De);let qe=this.strict;this.strict=!0,this.parseClassId(De,Oe),this.parseClassSuper(De);let We=this.enterClassBody(),He=this.startNode(),ze=!1;He.body=[];let Ze=[];this.expect(Ie.braceL);while(this.type!==Ie.braceR){if(this.match(Ge.at)){Ze.push(this.parseDecorator());continue}let Qe=this.parseClassElement(De.superClass!==null);if(Ze.length)Qe.decorators=Ze,this.resetStartLocationFromNode(Qe,Ze[0]),Ze=[];if(Qe){if(He.body.push(Qe),Qe.type==="MethodDefinition"&&Qe.kind==="constructor"&&Qe.value.type==="FunctionExpression"){if(ze)this.raiseRecoverable(Qe.start,"Duplicate constructor in the same class");if(ze=!0,Qe.decorators&&Qe.decorators.length>0)this.raise(Qe.start,qn.DecoratorConstructor)}else if(Qe.key&&Qe.key.type==="PrivateIdentifier"&&Qe.value?.type!=="TSDeclareMethod"){let Ye=Qe.key.name;if(this.parseEffects.modify(We,Ye,(bt)=>Fu(bt,Qe)))this.raiseRecoverable(Qe.key.start,`Identifier '#${Ye}' has already been declared`)}}}if(this.strict=qe,this.next(),Ze.length)this.raise(this.start,qn.TrailingDecorator);return De.body=this.finishNode(He,"ClassBody"),this.exitClassBody(),this.finishNode(De,Oe?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=Fe}}parseClassFunctionParams(){let De=this.tsTryParseTypeParameters(),Oe=this.parseBindingList(Ie.parenR,!1,this.ecmaVersion>=8,!0);if(De)Oe.typeParameters=De;return Oe}parseMethod(De,Oe,Fe,qe,We){let He=this.startNode(),ze=this.yieldPos,Ze=this.awaitPos,Qe=this.awaitIdentPos;if(this.initFunction(He),this.ecmaVersion>=6)He.generator=De;if(this.ecmaVersion>=8)He.async=!!Oe;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ri(Oe,He.generator)|ft.SCOPE_SUPER|(Fe?ft.SCOPE_DIRECT_SUPER:0)),this.expect(Ie.parenL),He.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(He,!1,!0,!1,{isClassMethod:qe}),this.yieldPos=ze,this.awaitPos=Ze,this.awaitIdentPos=Qe,We&&We.abstract){if(!!He.body){let{key:lt}=We;this.raise(We.start,nt.AbstractMethodHasImplementation({methodName:lt.type==="Identifier"&&!We.computed?lt.name:`[${this.input.slice(lt.start,lt.end)}]`}))}}return this.finishNode(He,"FunctionExpression")}static parse(De,Oe){if(Oe.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else Oe.locations=!0;let Fe=new this(Oe,De);if(ve)Fe.isAmbientContext=!0;return Fe.parse()}static parseExpressionAt(De,Oe,Fe){if(Fe.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else Fe.locations=!0;let qe=new this(Fe,De,Oe);if(ve)qe.isAmbientContext=!0;return qe.nextToken(),qe.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(Ge.type)){let Oe=this.startNode();return Oe.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(Oe,!0,this.importOrExportOuterKind==="type"),this.finishNode(Oe,"ImportSpecifier")}else{let Oe=super.parseImportSpecifier();return Oe.importKind="value",Oe}}parseExportSpecifier(De){let Oe=this.ts_isContextual(Ge.type);if(!this.match(Ie.string)&&Oe){let qe=this.startNode();return qe.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(qe,!1,this.importOrExportOuterKind==="type"),this.finishNode(qe,"ExportSpecifier"),this.checkExport(De,qe.exported,qe.exported.start),qe}else{let qe=super.parseExportSpecifier(De);return qe.exportKind="value",qe}}parseTypeOnlyImportExportSpecifier(De,Oe,Fe){let qe=Oe?"imported":"local",We=Oe?"local":"exported",He=De[qe],ze,Ze=!1,Qe=!0,Ye=He.start;if(this.isContextual("as")){let bt=this.parseIdent();if(this.isContextual("as")){let gt=this.parseIdent();if(at(this.type))Ze=!0,He=bt,ze=Oe?this.parseIdent():this.parseModuleExportName(),Qe=!1;else ze=gt,Qe=!1}else if(at(this.type))Qe=!1,ze=Oe?this.parseIdent():this.parseModuleExportName();else Ze=!0,He=bt}else if(at(this.type))if(Ze=!0,Oe){if(He=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(He)}else He=this.parseModuleExportName();if(Ze&&Fe)this.raise(Ye,Oe?nt.TypeModifierIsUsedInTypeImports:nt.TypeModifierIsUsedInTypeExports);De[qe]=He,De[We]=ze;let lt=Oe?"importKind":"exportKind";if(De[lt]=Ze?"type":"value",Qe&&this.eatContextual("as"))De[We]=Oe?this.parseIdent():this.parseModuleExportName();if(!De[We])De[We]=this.copyNode(De[qe]);if(Oe)this.checkLValSimple(De[We],ft.BIND_LEXICAL)}raiseCommonCheck(De,Oe,Fe){switch(Oe){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(Ie.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(De,Oe)}return Fe?super.raiseRecoverable(De,Oe):super.raise(De,Oe)}raiseRecoverable(De,Oe){return this.raiseCommonCheck(De,Oe,!0)}raise(De,Oe){return this.raiseCommonCheck(De,Oe,!0)}updateContext(De){let{type:Oe}=this;if(Oe==Ie.braceL){var Fe=this.curContext();if(Fe==Xe.tc_oTag)this.parseEffects.append(this.context,Ve.b_expr);else if(Fe==Xe.tc_expr)this.parseEffects.append(this.context,Ve.b_tmpl);else super.updateContext(De);this.exprAllowed=!0}else if(Oe===Ie.slash&&De===Ge.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,Xe.tc_cTag),this.exprAllowed=!1;else return super.updateContext(De)}jsx_parseOpeningElementAt(De,Oe){let Fe=this.startNodeAt(De,Oe),qe=this.jsx_parseElementName();if(qe)Fe.name=qe;if(this.match(Ie.relational)||this.match(Ie.bitShift)){let We=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(We)Fe.typeArguments=We}Fe.attributes=[];while(this.type!==Ie.slash&&this.type!==Ge.jsxTagEnd)Fe.attributes.push(this.jsx_parseAttribute());return Fe.selfClosing=this.eat(Ie.slash),this.expect(Ge.jsxTagEnd),this.finishNode(Fe,qe?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(De){let Oe=De===un;if(Oe)this.parseEffects.append(this.importsStack,[]);let Fe=Oe?De|ft.SCOPE_CLASS_STATIC_BLOCK:De;super.enterScope(Fe);let qe=super.currentScope();qe.types=[],qe.enums=[],qe.constEnums=[],qe.classes=[],qe.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&un)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport(De,Oe){let Fe=this.importsStack.length;if(this.importsStack[Fe-1].indexOf(De)>-1)return!0;if(!Oe&&Fe>1){for(let qe=0;qe<Fe-1;qe++)if(this.importsStack[qe].indexOf(De)>-1)return!0}return!1}maybeExportDefined(De,Oe){if(this.inModule&&De.flags&ft.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,Oe)}declareName(De,Oe,Fe){if(Oe&ft.BIND_FLAGS_TS_IMPORT){if(this.hasImport(De,!0))this.raise(Fe,`Identifier '${De}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],De);return}let qe=this.currentScope();if(Oe&ft.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(qe,De),this.parseEffects.append(qe.exportOnlyBindings,De);return}if(Oe===ft.BIND_TS_TYPE||Oe===ft.BIND_TS_INTERFACE){if(Oe===ft.BIND_TS_TYPE&&qe.types.includes(De))this.raise(Fe,`type '${De}' has already been declared.`);this.parseEffects.append(qe.types,De)}else if(Oe&ft.BIND_FLAGS_TS_ENUM){if(qe.enums.includes(De))return;super.declareName(De,ft.BIND_LEXICAL,Fe)}else super.declareName(De,Oe,Fe);if(Oe&ft.BIND_FLAGS_TS_ENUM)this.parseEffects.append(qe.enums,De);if(Oe&ft.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(qe.constEnums,De);if(Oe&ft.BIND_FLAGS_CLASS)this.parseEffects.append(qe.classes,De)}checkLocalExport(De){let{name:Oe}=De;if(this.hasImport(Oe))return;let Fe=this.scopeStack.length;for(let qe=Fe-1;qe>=0;qe--){let We=this.scopeStack[qe];if(We.types.indexOf(Oe)>-1||We.exportOnlyBindings.indexOf(Oe)>-1)return}super.checkLocalExport(De)}}return Tt}}function To(i,ve,Ae){let _e=Ae._,Ne=!1,Re=()=>{Ne=!0};function Ie(Me,$e,Be){let Ve=null;$e.push(Me);for(let Ue in Me){if(Ue==="type"||Ue==="__proto__")continue;let Ge=Me[Ue];if(Ge&&typeof Ge==="object")if(Array.isArray(Ge)){let Xe=null,Je=Ge.length;for(let Ke=0;Ke<Je;Ke++){let et=Ge[Ke];if(et&&typeof et==="object"){let ot=Le(et,$e,Be);if(ot)(Xe??=Ge.slice())[Ke]=ot}}if(Xe)(Ve??={})[Ue]=Xe}else{let Xe=Le(Ge,$e,Be);if(Xe)(Ve??={})[Ue]=Xe}}if($e.pop(),Ve)return ih(Me,Ve)}function Le(Me,$e,Be){if(Ne)return;if(!Me.type)return;let Ve=Ae[Me.type];if(!_e&&!Ve)return Ie(Me,$e,Be);let Ue,Ge,Xe=(Ke=Be)=>Ge=Ie(Me,$e,Ke),Je=(Ke,et=Be)=>{$e.push(Me);let ot=Le(Ke,$e,et)??Ke;return $e.pop(),ot};if(_e){let Ke;if(Ue=_e(Me,{path:$e,state:Be,next:(et=Be)=>(Be=et,Ke=Ve?Ve(Me,{path:$e,state:et,next:Xe,stop:Re,visit:Je}):Xe(et),Ke),stop:Re,visit:Je}),!Ue&&Ke)Ue=Ke}else Ue=Ve(Me,{path:$e,state:Be,next:Xe,stop:Re,visit:Je});if(!Ue&&Ge)Ue=Ge;if(Ue)return Ue}return Le(i,[],ve)??i}function ih(i,ve){let Ae={},_e=Object.getOwnPropertyDescriptors(i);for(let Ne in _e)Object.defineProperty(Ae,Ne,_e[Ne]);for(let Ne in ve)Ae[Ne]=ve[Ne];return Ae}var ah=/\n/,oh=/[ \t]/,ch=/^[,) \t]*$/,Gn="",Ao=[];function Wn(i,ve){Gn=i,Ao=ve}function Hn(i,ve,Ae,_e){let Ne=ve;if(i&&ah.test(Ne)){let Re=Ae;while(Re>0&&Gn[Re-1]!==`
12
- `)Re-=1;let Ie=Re;while(oh.test(Gn[Ie]))Ie+=1;let Le=Gn.slice(Re,Ie);Ne=lh(Ne,Le)}Ao.push({type:i?"Block":"Line",value:Ne,start:Ae,end:_e})}function lh(i,ve){if(ve==="")return i;let Ae=i.split(`
13
- `);for(let _e=0;_e<Ae.length;_e++)if(Ae[_e].startsWith(ve))Ae[_e]=Ae[_e].slice(ve.length);return Ae.join(`
14
- `)}function ai(i,ve,Ae,_e){let Ne=ph(Ae,_e);if(Ne>=Ae.length)return;ii(i,void 0,Ae,{index:Ne},ve)}function ph(i,ve){let Ae=0,_e=i.length;while(Ae<_e){let Ne=Ae+_e>>>1;if(i[Ne].start<ve)Ae=Ne+1;else _e=Ne}return Ae}function ii(i,ve,Ae,_e,Ne){while(_e.index<Ae.length&&Ae[_e.index].start<(i.start??0))i.leadingComments??=[],i.leadingComments.push(Ae[_e.index]),_e.index++;if(_e.index>=Ae.length)return;let Re=Object.keys(i);for(let Ie=0;Ie<Re.length;Ie++){let Le=Re[Ie];if(Le==="type"||Le==="leadingComments")continue;let Me=i[Le];if(!Me||typeof Me!=="object")continue;if(Array.isArray(Me)){for(let $e of Me)if($e&&typeof $e==="object"&&typeof $e.type==="string"){if(ii($e,i,Ae,_e,Ne),_e.index>=Ae.length)return}}else if(typeof Me.type==="string"){if(ii(Me,i,Ae,_e,Ne),_e.index>=Ae.length)return}}if(_e.index<Ae.length){let Ie=Ae[_e.index];if(ve===void 0||i.end!==ve.end){let Le=Ne.slice(i.end??0,Ie.start);if((ve?.type==="BlockStatement"||ve?.type==="Program")&&si(ve.body,i)||ve?.type==="ArrayExpression"&&si(ve.elements,i)||ve?.type==="ObjectExpression"&&si(ve.properties,i))while(_e.index<Ae.length){if(ve&&Ae[_e.index].start>=(ve.end??Number.POSITIVE_INFINITY))break;_e.index++}else if((i.end??0)<=Ie.start&&ch.test(Le))_e.index++}}}function si(i,ve){return!!i&&i.indexOf(ve)===i.length-1}var ko=wt,uh=ko.extend(So());function oi(i){return i?uh:ko}var hh={onComment:Hn,sourceType:"module",ecmaVersion:16},fh={onComment:Hn,sourceType:"module",ecmaVersion:16,preserveParens:!0},dh={onComment:Hn,sourceType:"module",ecmaVersion:16};function wo(i,ve,Ae,_e,Ne){if(Ae.length===Ne)return;ai(i,ve,Ae,_e)}function Po(i,ve,Ae){let _e=Ae.length;Wn(i,Ae);let Ne=oi(ve).parse(i,hh);if(Ae.length>0)ai(Ne,i,Ae,_e);return Ne}var mh={count:0};function Hr(i,ve,Ae,_e){mh.count+=1;let Ne=_e.length;Wn(i,_e);let Re=oi(Ae).parseExpressionAt(i,ve,fh);wo(Re,i,_e,ve,Ne);let Ie=_e.length>Ne?_e.at(-1):void 0,Le=Ie&&Ie.end>(Re.end??0)?Ie.end:Re.end??0,Me=Re.end??ve;return{node:gh(i,ve,Me,40)?yh(Re):Re,end:Le}}function gh(i,ve,Ae,_e){for(let Ne=ve;Ne<Ae;Ne++)if(i.charCodeAt(Ne)===_e)return!0;return!1}function _o(i,ve,Ae,_e){let Ne=_e.length,Re=oi(Ae);Wn(i,_e);let Ie=new Re(dh,i,ve);Ie.nextToken();let Le=Ie.parseStatement(null,!0,Object.create(null));return wo(Le,i,_e,ve,Ne),Le}function yh(i){return To(i,null,{ParenthesizedExpression(ve,Ae){return Ae.visit(ve.expression)}})}function Mr(i){if(i===32||i<=13&&i>=9)return!0;if(i<160)return!1;return i===160||i===5760||i>=8192&&i<=8202||i===8232||i===8233||i===8239||i===8287||i===12288||i===65279}class ci{source;index=0;constructor(i){this.source=i}match(i){if(i.length===1)return this.source.charCodeAt(this.index)===i.charCodeAt(0);return this.source.startsWith(i,this.index)}matchRegex(i){i.lastIndex=this.index;let ve=i.exec(this.source);if(!ve||ve.index!==this.index)return null;return ve[0]}eat(i,ve=!1){if(this.match(i))return this.index+=i.length,!0;if(ve)throw new Ar(`Expected token ${JSON.stringify(i)}`,this.index);return!1}read(i){let ve=this.matchRegex(i);if(ve)this.index+=ve.length;return ve}readUntil(i){if(this.index>=this.source.length)throw new Ar("Unexpected end of input",this.source.length);let ve=this.index;i.lastIndex=ve;let Ae=i.exec(this.source);if(Ae)return this.index=Ae.index,this.source.slice(ve,this.index);return this.index=this.source.length,this.source.slice(ve)}readUntilString(i){if(this.index>=this.source.length)throw new Ar("Unexpected end of input",this.source.length);let ve=this.source.indexOf(i,this.index),Ae=ve===-1?this.source.length:ve,_e=this.source.slice(this.index,Ae);return this.index=Ae,_e}allowWhitespace(){while(this.index<this.source.length&&Mr(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!Mr(this.source.charCodeAt(this.index)))throw new Ar("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let i=this.index,ve=i,Ae="",_e=this.source.codePointAt(this.index);if(_e!==void 0&&Ft(_e,!0)){ve+=_e<=65535?1:2;while(ve<this.source.length){let Ne=this.source.codePointAt(ve);if(Ne===void 0||!Kt(Ne,!0))break;ve+=Ne<=65535?1:2}Ae=this.source.slice(i,ve),this.index=ve}return{type:"Identifier",name:Ae,start:i,end:ve}}}class Ar extends Error{position;constructor(i,ve){super(`${i} (at index ${ve})`);this.name="TemplateSyntaxError",this.position=ve}}function Vt(){return{type:"Fragment",nodes:[]}}var xh=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","function","if","implements","import","in","instanceof","interface","let","new","package","private","protected","public","return","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"]),bh=["&&","||","??"],Eh=["===","!==","==","!="];function No(i,ve){let Ae=i.codePointAt(ve);if(Ae===void 0||!Ft(Ae,!0))return ve;let _e=ve+(Ae<=65535?1:2);while(_e<i.length){let Ne=i.codePointAt(_e);if(!Kt(Ne,!0))break;_e+=Ne<=65535?1:2}return _e}function Ch(i,ve){let Ae=ve;while(Ae<i.length){let _e=i.charCodeAt(Ae);if(_e<48||_e>57)break;Ae++}return Ae}function Kn(i,ve){let Ae=ve;while(Ae<i.length&&Mr(i.charCodeAt(Ae)))Ae++;return Ae}function Io(i,ve){let Ae=Ch(i,ve);if(Ae===ve)return null;if(i.charCodeAt(ve)===48&&Ae-ve>1)return null;if(Ae<i.length){let Ne=i.codePointAt(Ae);if(Ne===46||Kt(Ne,!0))return null}let _e=i.slice(ve,Ae);return{type:"Literal",start:ve,end:Ae,value:Number(_e),raw:_e}}function Do(i,ve){let Ae=i.charCodeAt(ve),_e=ve+1;while(_e<i.length){let Ne=i.charCodeAt(_e);if(Ne===Ae){let Re=i.slice(ve,_e+1);return{type:"Literal",start:ve,end:_e+1,value:i.slice(ve+1,_e),raw:Re}}if(Ne===92||Ne===10||Ne===13)return null;_e++}return null}function vh(i,ve){let Ae=i.charCodeAt(ve);if(Ae===34||Ae===39)return Do(i,ve);let _e=No(i,ve);if(_e===ve)return Io(i,ve);let Ne=i.slice(ve,_e);if(Ne==="true"||Ne==="false")return{type:"Literal",start:ve,end:_e,value:Ne==="true",raw:Ne};if(Ne==="null")return{type:"Literal",start:ve,end:_e,value:null,raw:Ne};if(xh.has(Ne))return null;let Re={type:"Identifier",start:ve,end:_e,name:Ne},Ie=_e;while(Ie<i.length){let Le=i.charCodeAt(Ie);if(Le===46){let Me=Ie+1,$e=No(i,Me);if($e===Me)return null;let Be={type:"Identifier",start:Me,end:$e,name:i.slice(Me,$e)};Re={type:"MemberExpression",start:ve,end:$e,object:Re,property:Be,computed:!1,optional:!1},Ie=$e}else if(Le===91){let Me=Ie+1,$e=i.charCodeAt(Me),Be=$e===34||$e===39?Do(i,Me):Io(i,Me);if(!Be||i.charCodeAt(Be.end)!==93)return null;Re={type:"MemberExpression",start:ve,end:Be.end+1,object:Re,property:Be,computed:!0,optional:!1},Ie=Be.end+1}else break}return Re}function li(i,ve){if(i.charCodeAt(ve)!==33||i.charCodeAt(ve+1)===61)return vh(i,ve);let Ae=li(i,Kn(i,ve+1));if(!Ae)return null;return{type:"UnaryExpression",start:ve,end:Ae.end,operator:"!",prefix:!0,argument:Ae}}function Sh(i,ve){for(let Ae of Eh)if(i.startsWith(Ae,ve))return{operator:Ae,logical:!1};for(let Ae of bh)if(i.startsWith(Ae,ve))return{operator:Ae,logical:!0};return null}function Ro(i,ve){let Ae=Kn(i,ve);if(Ae>=i.length)return!1;let _e=i.charCodeAt(Ae);return _e===125||_e===41}function Th(i){let ve=i.source,Ae=li(ve,i.index);if(!Ae)return null;if(Ro(ve,Ae.end))return i.index=Ae.end,Ae;let _e=Kn(ve,Ae.end),Ne=Sh(ve,_e);if(!Ne)return null;let Re=li(ve,Kn(ve,_e+Ne.operator.length));if(!Re||!Ro(ve,Re.end))return null;return i.index=Re.end,{type:Ne.logical?"LogicalExpression":"BinaryExpression",start:Ae.start,end:Re.end,left:Ae,operator:Ne.operator,right:Re}}function Dt(i){let ve=Th(i);if(ve)return ve;let{node:Ae,end:_e}=Hr(i.source,i.index,i.isTypeScript,i.root.comments);return i.index=_e,Ae}var Ah={"CounterClockwiseContourIntegral;":8755,"ClockwiseContourIntegral;":8754,"DoubleLongLeftRightArrow;":10234,"NotNestedGreaterGreater;":10914,"DiacriticalDoubleAcute;":733,"NotSquareSupersetEqual;":8931,"CloseCurlyDoubleQuote;":8221,"DoubleContourIntegral;":8751,"FilledVerySmallSquare;":9642,"NegativeVeryThinSpace;":8203,"NotPrecedesSlantEqual;":8928,"NotRightTriangleEqual;":8941,"NotSucceedsSlantEqual;":8929,"CapitalDifferentialD;":8517,"DoubleLeftRightArrow;":8660,"DoubleLongRightArrow;":10233,"EmptyVerySmallSquare;":9643,"NestedGreaterGreater;":8811,"NotDoubleVerticalBar;":8742,"NotGreaterSlantEqual;":10878,"NotLeftTriangleEqual;":8940,"NotSquareSubsetEqual;":8930,"OpenCurlyDoubleQuote;":8220,"ReverseUpEquilibrium;":10607,"DoubleLongLeftArrow;":10232,"DownLeftRightVector;":10576,"LeftArrowRightArrow;":8646,"NegativeMediumSpace;":8203,"NotGreaterFullEqual;":8807,"NotRightTriangleBar;":10704,"RightArrowLeftArrow;":8644,"SquareSupersetEqual;":8850,"leftrightsquigarrow;":8621,"DownRightTeeVector;":10591,"DownRightVectorBar;":10583,"LongLeftRightArrow;":10231,"Longleftrightarrow;":10234,"NegativeThickSpace;":8203,"NotLeftTriangleBar;":10703,"PrecedesSlantEqual;":8828,"ReverseEquilibrium;":8651,"RightDoubleBracket;":10215,"RightDownTeeVector;":10589,"RightDownVectorBar;":10581,"RightTriangleEqual;":8885,"SquareIntersection;":8851,"SucceedsSlantEqual;":8829,"blacktriangleright;":9656,"longleftrightarrow;":10231,"DoubleUpDownArrow;":8661,"DoubleVerticalBar;":8741,"DownLeftTeeVector;":10590,"DownLeftVectorBar;":10582,"FilledSmallSquare;":9724,"GreaterSlantEqual;":10878,"LeftDoubleBracket;":10214,"LeftDownTeeVector;":10593,"LeftDownVectorBar;":10585,"LeftTriangleEqual;":8884,"NegativeThinSpace;":8203,"NotGreaterGreater;":8811,"NotLessSlantEqual;":10877,"NotNestedLessLess;":10913,"NotReverseElement;":8716,"NotSquareSuperset;":8848,"NotTildeFullEqual;":8775,"RightAngleBracket;":10217,"RightUpDownVector;":10575,"SquareSubsetEqual;":8849,"VerticalSeparator;":10072,"blacktriangledown;":9662,"blacktriangleleft;":9666,"leftrightharpoons;":8651,"rightleftharpoons;":8652,"twoheadrightarrow;":8608,"DiacriticalAcute;":180,"DiacriticalGrave;":96,"DiacriticalTilde;":732,"DoubleRightArrow;":8658,"DownArrowUpArrow;":8693,"EmptySmallSquare;":9723,"GreaterEqualLess;":8923,"GreaterFullEqual;":8807,"LeftAngleBracket;":10216,"LeftUpDownVector;":10577,"LessEqualGreater;":8922,"NonBreakingSpace;":160,"NotPrecedesEqual;":10927,"NotRightTriangle;":8939,"NotSucceedsEqual;":10928,"NotSucceedsTilde;":8831,"NotSupersetEqual;":8841,"RightTriangleBar;":10704,"RightUpTeeVector;":10588,"RightUpVectorBar;":10580,"UnderParenthesis;":9181,"UpArrowDownArrow;":8645,"circlearrowright;":8635,"downharpoonright;":8642,"ntrianglerighteq;":8941,"rightharpoondown;":8641,"rightrightarrows;":8649,"twoheadleftarrow;":8606,"vartriangleright;":8883,"CloseCurlyQuote;":8217,"ContourIntegral;":8750,"DoubleDownArrow;":8659,"DoubleLeftArrow;":8656,"DownRightVector;":8641,"LeftRightVector;":10574,"LeftTriangleBar;":10703,"LeftUpTeeVector;":10592,"LeftUpVectorBar;":10584,"LowerRightArrow;":8600,"NotGreaterEqual;":8817,"NotGreaterTilde;":8821,"NotHumpDownHump;":8782,"NotLeftTriangle;":8938,"NotSquareSubset;":8847,"OverParenthesis;":9180,"RightDownVector;":8642,"ShortRightArrow;":8594,"UpperRightArrow;":8599,"bigtriangledown;":9661,"circlearrowleft;":8634,"curvearrowright;":8631,"downharpoonleft;":8643,"leftharpoondown;":8637,"leftrightarrows;":8646,"nLeftrightarrow;":8654,"nleftrightarrow;":8622,"ntrianglelefteq;":8940,"rightleftarrows;":8644,"rightsquigarrow;":8605,"rightthreetimes;":8908,"straightepsilon;":1013,"trianglerighteq;":8885,"vartriangleleft;":8882,"DiacriticalDot;":729,"DoubleRightTee;":8872,"DownLeftVector;":8637,"GreaterGreater;":10914,"HorizontalLine;":9472,"InvisibleComma;":8291,"InvisibleTimes;":8290,"LeftDownVector;":8643,"LeftRightArrow;":8596,"Leftrightarrow;":8660,"LessSlantEqual;":10877,"LongRightArrow;":10230,"Longrightarrow;":10233,"LowerLeftArrow;":8601,"NestedLessLess;":8810,"NotGreaterLess;":8825,"NotLessGreater;":8824,"NotSubsetEqual;":8840,"NotVerticalBar;":8740,"OpenCurlyQuote;":8216,"ReverseElement;":8715,"RightTeeVector;":10587,"RightVectorBar;":10579,"ShortDownArrow;":8595,"ShortLeftArrow;":8592,"SquareSuperset;":8848,"TildeFullEqual;":8773,"UpperLeftArrow;":8598,"ZeroWidthSpace;":8203,"curvearrowleft;":8630,"doublebarwedge;":8966,"downdownarrows;":8650,"hookrightarrow;":8618,"leftleftarrows;":8647,"leftrightarrow;":8596,"leftthreetimes;":8907,"longrightarrow;":10230,"looparrowright;":8620,"nshortparallel;":8742,"ntriangleright;":8939,"rightarrowtail;":8611,"rightharpoonup;":8640,"trianglelefteq;":8884,"upharpoonright;":8638,"ApplyFunction;":8289,"DifferentialD;":8518,"DoubleLeftTee;":10980,"DoubleUpArrow;":8657,"LeftTeeVector;":10586,"LeftVectorBar;":10578,"LessFullEqual;":8806,"LongLeftArrow;":10229,"Longleftarrow;":10232,"NotEqualTilde;":8770,"NotTildeEqual;":8772,"NotTildeTilde;":8777,"Poincareplane;":8460,"PrecedesEqual;":10927,"PrecedesTilde;":8830,"RightArrowBar;":8677,"RightTeeArrow;":8614,"RightTriangle;":8883,"RightUpVector;":8638,"SucceedsEqual;":10928,"SucceedsTilde;":8831,"SupersetEqual;":8839,"UpEquilibrium;":10606,"VerticalTilde;":8768,"VeryThinSpace;":8202,"bigtriangleup;":9651,"blacktriangle;":9652,"divideontimes;":8903,"fallingdotseq;":8786,"hookleftarrow;":8617,"leftarrowtail;":8610,"leftharpoonup;":8636,"longleftarrow;":10229,"looparrowleft;":8619,"measuredangle;":8737,"ntriangleleft;":8938,"shortparallel;":8741,"smallsetminus;":8726,"triangleright;":9657,"upharpoonleft;":8639,"varsubsetneqq;":10955,"varsupsetneqq;":10956,"DownArrowBar;":10515,"DownTeeArrow;":8615,"ExponentialE;":8519,"GreaterEqual;":8805,"GreaterTilde;":8819,"HilbertSpace;":8459,"HumpDownHump;":8782,"Intersection;":8898,"LeftArrowBar;":8676,"LeftTeeArrow;":8612,"LeftTriangle;":8882,"LeftUpVector;":8639,"NotCongruent;":8802,"NotHumpEqual;":8783,"NotLessEqual;":8816,"NotLessTilde;":8820,"Proportional;":8733,"RightCeiling;":8969,"RoundImplies;":10608,"ShortUpArrow;":8593,"SquareSubset;":8847,"UnderBracket;":9141,"VerticalLine;":124,"blacklozenge;":10731,"exponentiale;":8519,"risingdotseq;":8787,"triangledown;":9663,"triangleleft;":9667,"varsubsetneq;":8842,"varsupsetneq;":8843,"CircleMinus;":8854,"CircleTimes;":8855,"Equilibrium;":8652,"GreaterLess;":8823,"LeftCeiling;":8968,"LessGreater;":8822,"MediumSpace;":8287,"NotLessLess;":8810,"NotPrecedes;":8832,"NotSucceeds;":8833,"NotSuperset;":8835,"OverBracket;":9140,"RightVector;":8640,"Rrightarrow;":8667,"RuleDelayed;":10740,"SmallCircle;":8728,"SquareUnion;":8852,"SubsetEqual;":8838,"UpDownArrow;":8597,"Updownarrow;":8661,"VerticalBar;":8739,"backepsilon;":1014,"blacksquare;":9642,"circledcirc;":8858,"circleddash;":8861,"curlyeqprec;":8926,"curlyeqsucc;":8927,"diamondsuit;":9830,"eqslantless;":10901,"expectation;":8496,"nRightarrow;":8655,"nrightarrow;":8603,"preccurlyeq;":8828,"precnapprox;":10937,"quaternions;":8461,"straightphi;":981,"succcurlyeq;":8829,"succnapprox;":10938,"thickapprox;":8776,"updownarrow;":8597,"Bernoullis;":8492,"CirclePlus;":8853,"EqualTilde;":8770,"Fouriertrf;":8497,"ImaginaryI;":8520,"Laplacetrf;":8466,"LeftVector;":8636,"Lleftarrow;":8666,"NotElement;":8713,"NotGreater;":8815,"Proportion;":8759,"RightArrow;":8594,"RightFloor;":8971,"Rightarrow;":8658,"ThickSpace;":8287,"TildeEqual;":8771,"TildeTilde;":8776,"UnderBrace;":9183,"UpArrowBar;":10514,"UpTeeArrow;":8613,"circledast;":8859,"complement;":8705,"curlywedge;":8911,"eqslantgtr;":10902,"gtreqqless;":10892,"lessapprox;":10885,"lesseqqgtr;":10891,"lmoustache;":9136,"longmapsto;":10236,"mapstodown;":8615,"mapstoleft;":8612,"nLeftarrow;":8653,"nleftarrow;":8602,"nsubseteqq;":10949,"nsupseteqq;":10950,"precapprox;":10935,"rightarrow;":8594,"rmoustache;":9137,"sqsubseteq;":8849,"sqsupseteq;":8850,"subsetneqq;":10955,"succapprox;":10936,"supsetneqq;":10956,"upuparrows;":8648,"varepsilon;":1013,"varnothing;":8709,"Backslash;":8726,"CenterDot;":183,"CircleDot;":8857,"Congruent;":8801,"Coproduct;":8720,"DoubleDot;":168,"DownArrow;":8595,"DownBreve;":785,"Downarrow;":8659,"HumpEqual;":8783,"LeftArrow;":8592,"LeftFloor;":8970,"Leftarrow;":8656,"LessTilde;":8818,"Mellintrf;":8499,"MinusPlus;":8723,"NotCupCap;":8813,"NotExists;":8708,"NotSubset;":8834,"OverBrace;":9182,"PlusMinus;":177,"Therefore;":8756,"ThinSpace;":8201,"TripleDot;":8411,"UnionPlus;":8846,"backprime;":8245,"backsimeq;":8909,"bigotimes;":10754,"centerdot;":183,"checkmark;":10003,"complexes;":8450,"dotsquare;":8865,"downarrow;":8595,"gtrapprox;":10886,"gtreqless;":8923,"gvertneqq;":8809,"heartsuit;":9829,"leftarrow;":8592,"lesseqgtr;":8922,"lvertneqq;":8808,"ngeqslant;":10878,"nleqslant;":10877,"nparallel;":8742,"nshortmid;":8740,"nsubseteq;":8840,"nsupseteq;":8841,"pitchfork;":8916,"rationals;":8474,"spadesuit;":9824,"subseteqq;":10949,"subsetneq;":8842,"supseteqq;":10950,"supsetneq;":8843,"therefore;":8756,"triangleq;":8796,"varpropto;":8733,"DDotrahd;":10513,"DotEqual;":8784,"Integral;":8747,"LessLess;":10913,"NotEqual;":8800,"NotTilde;":8769,"PartialD;":8706,"Precedes;":8826,"RightTee;":8866,"Succeeds;":8827,"SuchThat;":8715,"Superset;":8835,"Uarrocir;":10569,"UnderBar;":95,"andslope;":10840,"angmsdaa;":10664,"angmsdab;":10665,"angmsdac;":10666,"angmsdad;":10667,"angmsdae;":10668,"angmsdaf;":10669,"angmsdag;":10670,"angmsdah;":10671,"angrtvbd;":10653,"approxeq;":8778,"awconint;":8755,"backcong;":8780,"barwedge;":8965,"bbrktbrk;":9142,"bigoplus;":10753,"bigsqcup;":10758,"biguplus;":10756,"bigwedge;":8896,"boxminus;":8863,"boxtimes;":8864,"bsolhsub;":10184,"capbrcup;":10825,"circledR;":174,"circledS;":9416,"cirfnint;":10768,"clubsuit;":9827,"cupbrcap;":10824,"curlyvee;":8910,"cwconint;":8754,"doteqdot;":8785,"dotminus;":8760,"drbkarow;":10512,"dzigrarr;":10239,"elinters;":9191,"emptyset;":8709,"eqvparsl;":10725,"fpartint;":10765,"geqslant;":10878,"gesdotol;":10884,"gnapprox;":10890,"hksearow;":10533,"hkswarow;":10534,"imagline;":8464,"imagpart;":8465,"infintie;":10717,"integers;":8484,"intercal;":8890,"intlarhk;":10775,"laemptyv;":10676,"ldrushar;":10571,"leqslant;":10877,"lesdotor;":10883,"llcorner;":8990,"lnapprox;":10889,"lrcorner;":8991,"lurdshar;":10570,"mapstoup;":8613,"multimap;":8888,"naturals;":8469,"ncongdot;":10861,"notindot;":8949,"otimesas;":10806,"parallel;":8741,"plusacir;":10787,"pointint;":10773,"precneqq;":10933,"precnsim;":8936,"profalar;":9006,"profline;":8978,"profsurf;":8979,"raemptyv;":10675,"realpart;":8476,"rppolint;":10770,"rtriltri;":10702,"scpolint;":10771,"setminus;":8726,"shortmid;":8739,"smeparsl;":10724,"sqsubset;":8847,"sqsupset;":8848,"subseteq;":8838,"succneqq;":10934,"succnsim;":8937,"supseteq;":8839,"thetasym;":977,"thicksim;":8764,"timesbar;":10801,"triangle;":9653,"triminus;":10810,"trpezium;":9186,"ulcorner;":8988,"urcorner;":8989,"varkappa;":1008,"varsigma;":962,"vartheta;":977,"Because;":8757,"Cayleys;":8493,"Cconint;":8752,"Cedilla;":184,"Diamond;":8900,"DownTee;":8868,"Element;":8712,"Epsilon;":917,"Implies;":8658,"LeftTee;":8867,"NewLine;":10,"NoBreak;":8288,"NotLess;":8814,"Omicron;":927,"OverBar;":8254,"Product;":8719,"UpArrow;":8593,"Uparrow;":8657,"Upsilon;":933,"alefsym;":8501,"angrtvb;":8894,"angzarr;":9084,"asympeq;":8781,"backsim;":8765,"because;":8757,"bemptyv;":10672,"between;":8812,"bigcirc;":9711,"bigodot;":10752,"bigstar;":9733,"bnequiv;":8801,"boxplus;":8862,"ccupssm;":10832,"cemptyv;":10674,"cirscir;":10690,"coloneq;":8788,"congdot;":10861,"cudarrl;":10552,"cudarrr;":10549,"cularrp;":10557,"curarrm;":10556,"dbkarow;":10511,"ddagger;":8225,"ddotseq;":10871,"demptyv;":10673,"diamond;":8900,"digamma;":989,"dotplus;":8724,"dwangle;":10662,"epsilon;":949,"eqcolon;":8789,"equivDD;":10872,"gesdoto;":10882,"gtquest;":10876,"gtrless;":8823,"harrcir;":10568,"intprod;":10812,"isindot;":8949,"larrbfs;":10527,"larrsim;":10611,"lbrksld;":10639,"lbrkslu;":10637,"ldrdhar;":10599,"lesdoto;":10881,"lessdot;":8918,"lessgtr;":8822,"lesssim;":8818,"lotimes;":10804,"lozenge;":9674,"ltquest;":10875,"luruhar;":10598,"maltese;":10016,"minusdu;":10794,"napprox;":8777,"natural;":9838,"nearrow;":8599,"nexists;":8708,"notinva;":8713,"notinvb;":8951,"notinvc;":8950,"notniva;":8716,"notnivb;":8958,"notnivc;":8957,"npolint;":10772,"npreceq;":10927,"nsqsube;":8930,"nsqsupe;":8931,"nsubset;":8834,"nsucceq;":10928,"nsupset;":8835,"nvinfin;":10718,"nvltrie;":8884,"nvrtrie;":8885,"nwarrow;":8598,"olcross;":10683,"omicron;":959,"orderof;":8500,"orslope;":10839,"pertenk;":8241,"planckh;":8462,"pluscir;":10786,"plussim;":10790,"plustwo;":10791,"precsim;":8830,"quatint;":10774,"questeq;":8799,"rarrbfs;":10528,"rarrsim;":10612,"rbrksld;":10638,"rbrkslu;":10640,"rdldhar;":10601,"realine;":8475,"rotimes;":10805,"ruluhar;":10600,"searrow;":8600,"simplus;":10788,"simrarr;":10610,"subedot;":10947,"submult;":10945,"subplus;":10943,"subrarr;":10617,"succsim;":8831,"supdsub;":10968,"supedot;":10948,"suphsol;":10185,"suphsub;":10967,"suplarr;":10619,"supmult;":10946,"supplus;":10944,"swarrow;":8601,"topfork;":10970,"triplus;":10809,"tritime;":10811,"uparrow;":8593,"upsilon;":965,"uwangle;":10663,"vzigzag;":10650,"zigrarr;":8669,"Aacute;":193,"Abreve;":258,"Agrave;":192,"Assign;":8788,"Atilde;":195,"Barwed;":8966,"Bumpeq;":8782,"Cacute;":262,"Ccaron;":268,"Ccedil;":199,"Colone;":10868,"Conint;":8751,"CupCap;":8781,"Dagger;":8225,"Dcaron;":270,"DotDot;":8412,"Dstrok;":272,"Eacute;":201,"Ecaron;":282,"Egrave;":200,"Exists;":8707,"ForAll;":8704,"Gammad;":988,"Gbreve;":286,"Gcedil;":290,"HARDcy;":1066,"Hstrok;":294,"Iacute;":205,"Igrave;":204,"Itilde;":296,"Jsercy;":1032,"Kcedil;":310,"Lacute;":313,"Lambda;":923,"Lcaron;":317,"Lcedil;":315,"Lmidot;":319,"Lstrok;":321,"Nacute;":323,"Ncaron;":327,"Ncedil;":325,"Ntilde;":209,"Oacute;":211,"Odblac;":336,"Ograve;":210,"Oslash;":216,"Otilde;":213,"Otimes;":10807,"Racute;":340,"Rarrtl;":10518,"Rcaron;":344,"Rcedil;":342,"SHCHcy;":1065,"SOFTcy;":1068,"Sacute;":346,"Scaron;":352,"Scedil;":350,"Square;":9633,"Subset;":8912,"Supset;":8913,"Tcaron;":356,"Tcedil;":354,"Tstrok;":358,"Uacute;":218,"Ubreve;":364,"Udblac;":368,"Ugrave;":217,"Utilde;":360,"Vdashl;":10982,"Verbar;":8214,"Vvdash;":8874,"Yacute;":221,"Zacute;":377,"Zcaron;":381,"aacute;":225,"abreve;":259,"agrave;":224,"andand;":10837,"angmsd;":8737,"angsph;":8738,"apacir;":10863,"approx;":8776,"atilde;":227,"barvee;":8893,"barwed;":8965,"becaus;":8757,"bernou;":8492,"bigcap;":8898,"bigcup;":8899,"bigvee;":8897,"bkarow;":10509,"bottom;":8869,"bowtie;":8904,"boxbox;":10697,"bprime;":8245,"brvbar;":166,"bullet;":8226,"bumpeq;":8783,"cacute;":263,"capand;":10820,"capcap;":10827,"capcup;":10823,"capdot;":10816,"ccaron;":269,"ccedil;":231,"circeq;":8791,"cirmid;":10991,"colone;":8788,"commat;":64,"compfn;":8728,"conint;":8750,"coprod;":8720,"copysr;":8471,"cularr;":8630,"cupcap;":10822,"cupcup;":10826,"cupdot;":8845,"curarr;":8631,"curren;":164,"cylcty;":9005,"dagger;":8224,"daleth;":8504,"dcaron;":271,"dfisht;":10623,"divide;":247,"divonx;":8903,"dlcorn;":8990,"dlcrop;":8973,"dollar;":36,"drcorn;":8991,"drcrop;":8972,"dstrok;":273,"eacute;":233,"easter;":10862,"ecaron;":283,"ecolon;":8789,"egrave;":232,"egsdot;":10904,"elsdot;":10903,"emptyv;":8709,"emsp13;":8196,"emsp14;":8197,"eparsl;":10723,"eqcirc;":8790,"equals;":61,"equest;":8799,"female;":9792,"ffilig;":64259,"ffllig;":64260,"forall;":8704,"frac12;":189,"frac13;":8531,"frac14;":188,"frac15;":8533,"frac16;":8537,"frac18;":8539,"frac23;":8532,"frac25;":8534,"frac34;":190,"frac35;":8535,"frac38;":8540,"frac45;":8536,"frac56;":8538,"frac58;":8541,"frac78;":8542,"gacute;":501,"gammad;":989,"gbreve;":287,"gesdot;":10880,"gesles;":10900,"gtlPar;":10645,"gtrarr;":10616,"gtrdot;":8919,"gtrsim;":8819,"hairsp;":8202,"hamilt;":8459,"hardcy;":1098,"hearts;":9829,"hellip;":8230,"hercon;":8889,"homtht;":8763,"horbar;":8213,"hslash;":8463,"hstrok;":295,"hybull;":8259,"hyphen;":8208,"iacute;":237,"igrave;":236,"iiiint;":10764,"iinfin;":10716,"incare;":8453,"inodot;":305,"intcal;":8890,"iquest;":191,"isinsv;":8947,"itilde;":297,"jsercy;":1112,"kappav;":1008,"kcedil;":311,"kgreen;":312,"lAtail;":10523,"lacute;":314,"lagran;":8466,"lambda;":955,"langle;":10216,"larrfs;":10525,"larrhk;":8617,"larrlp;":8619,"larrpl;":10553,"larrtl;":8610,"latail;":10521,"lbrace;":123,"lbrack;":91,"lcaron;":318,"lcedil;":316,"ldquor;":8222,"lesdot;":10879,"lesges;":10899,"lfisht;":10620,"lfloor;":8970,"lharul;":10602,"llhard;":10603,"lmidot;":320,"lmoust;":9136,"loplus;":10797,"lowast;":8727,"lowbar;":95,"lparlt;":10643,"lrhard;":10605,"lsaquo;":8249,"lsquor;":8218,"lstrok;":322,"lthree;":8907,"ltimes;":8905,"ltlarr;":10614,"ltrPar;":10646,"mapsto;":8614,"marker;":9646,"mcomma;":10793,"midast;":42,"midcir;":10992,"middot;":183,"minusb;":8863,"minusd;":8760,"mnplus;":8723,"models;":8871,"mstpos;":8766,"nVDash;":8879,"nVdash;":8878,"nacute;":324,"nbumpe;":8783,"ncaron;":328,"ncedil;":326,"nearhk;":10532,"nequiv;":8802,"nesear;":10536,"nexist;":8708,"nltrie;":8940,"notinE;":8953,"nparsl;":11005,"nprcue;":8928,"nrarrc;":10547,"nrarrw;":8605,"nrtrie;":8941,"nsccue;":8929,"nsimeq;":8772,"ntilde;":241,"numero;":8470,"nvDash;":8877,"nvHarr;":10500,"nvdash;":8876,"nvlArr;":10498,"nvrArr;":10499,"nwarhk;":10531,"nwnear;":10535,"oacute;":243,"odblac;":337,"odsold;":10684,"ograve;":242,"ominus;":8854,"origof;":8886,"oslash;":248,"otilde;":245,"otimes;":8855,"parsim;":10995,"percnt;":37,"period;":46,"permil;":8240,"phmmat;":8499,"planck;":8463,"plankv;":8463,"plusdo;":8724,"plusdu;":10789,"plusmn;":177,"preceq;":10927,"primes;":8473,"prnsim;":8936,"propto;":8733,"prurel;":8880,"puncsp;":8200,"qprime;":8279,"rAtail;":10524,"racute;":341,"rangle;":10217,"rarrap;":10613,"rarrfs;":10526,"rarrhk;":8618,"rarrlp;":8620,"rarrpl;":10565,"rarrtl;":8611,"ratail;":10522,"rbrace;":125,"rbrack;":93,"rcaron;":345,"rcedil;":343,"rdquor;":8221,"rfisht;":10621,"rfloor;":8971,"rharul;":10604,"rmoust;":9137,"roplus;":10798,"rpargt;":10644,"rsaquo;":8250,"rsquor;":8217,"rthree;":8908,"rtimes;":8906,"sacute;":347,"scaron;":353,"scedil;":351,"scnsim;":8937,"searhk;":10533,"seswar;":10537,"sfrown;":8994,"shchcy;":1097,"sigmaf;":962,"sigmav;":962,"simdot;":10858,"smashp;":10803,"softcy;":1100,"solbar;":9023,"spades;":9824,"sqcaps;":8851,"sqcups;":8852,"sqsube;":8849,"sqsupe;":8850,"square;":9633,"squarf;":9642,"ssetmn;":8726,"ssmile;":8995,"sstarf;":8902,"subdot;":10941,"subset;":8834,"subsim;":10951,"subsub;":10965,"subsup;":10963,"succeq;":10928,"supdot;":10942,"supset;":8835,"supsim;":10952,"supsub;":10964,"supsup;":10966,"swarhk;":10534,"swnwar;":10538,"target;":8982,"tcaron;":357,"tcedil;":355,"telrec;":8981,"there4;":8756,"thetav;":977,"thinsp;":8201,"thksim;":8764,"timesb;":8864,"timesd;":10800,"topbot;":9014,"topcir;":10993,"tprime;":8244,"tridot;":9708,"tstrok;":359,"uacute;":250,"ubreve;":365,"udblac;":369,"ufisht;":10622,"ugrave;":249,"ulcorn;":8988,"ulcrop;":8975,"urcorn;":8989,"urcrop;":8974,"utilde;":361,"vangrt;":10652,"varphi;":981,"varrho;":1009,"veebar;":8891,"vellip;":8942,"verbar;":124,"vsubnE;":10955,"vsubne;":8842,"vsupnE;":10956,"vsupne;":8843,"wedbar;":10847,"wedgeq;":8793,"weierp;":8472,"wreath;":8768,"xoplus;":10753,"xotime;":10754,"xsqcup;":10758,"xuplus;":10756,"xwedge;":8896,"yacute;":253,"zacute;":378,"zcaron;":382,"zeetrf;":8488,"AElig;":198,Aacute:193,"Acirc;":194,Agrave:192,"Alpha;":913,"Amacr;":256,"Aogon;":260,"Aring;":197,Atilde:195,"Breve;":728,Ccedil:199,"Ccirc;":264,"Colon;":8759,"Cross;":10799,"Dashv;":10980,"Delta;":916,Eacute:201,"Ecirc;":202,Egrave:200,"Emacr;":274,"Eogon;":280,"Equal;":10869,"Gamma;":915,"Gcirc;":284,"Hacek;":711,"Hcirc;":292,"IJlig;":306,Iacute:205,"Icirc;":206,Igrave:204,"Imacr;":298,"Iogon;":302,"Iukcy;":1030,"Jcirc;":308,"Jukcy;":1028,"Kappa;":922,Ntilde:209,"OElig;":338,Oacute:211,"Ocirc;":212,Ograve:210,"Omacr;":332,"Omega;":937,Oslash:216,Otilde:213,"Prime;":8243,"RBarr;":10512,"Scirc;":348,"Sigma;":931,"THORN;":222,"TRADE;":8482,"TSHcy;":1035,"Theta;":920,"Tilde;":8764,Uacute:218,"Ubrcy;":1038,"Ucirc;":219,Ugrave:217,"Umacr;":362,"Union;":8899,"Uogon;":370,"UpTee;":8869,"Uring;":366,"VDash;":8875,"Vdash;":8873,"Wcirc;":372,"Wedge;":8896,Yacute:221,"Ycirc;":374,aacute:225,"acirc;":226,"acute;":180,"aelig;":230,agrave:224,"aleph;":8501,"alpha;":945,"amacr;":257,"amalg;":10815,"angle;":8736,"angrt;":8735,"angst;":197,"aogon;":261,"aring;":229,"asymp;":8776,atilde:227,"awint;":10769,"bcong;":8780,"bdquo;":8222,"bepsi;":1014,"blank;":9251,"blk12;":9618,"blk14;":9617,"blk34;":9619,"block;":9608,"boxDL;":9559,"boxDR;":9556,"boxDl;":9558,"boxDr;":9555,"boxHD;":9574,"boxHU;":9577,"boxHd;":9572,"boxHu;":9575,"boxUL;":9565,"boxUR;":9562,"boxUl;":9564,"boxUr;":9561,"boxVH;":9580,"boxVL;":9571,"boxVR;":9568,"boxVh;":9579,"boxVl;":9570,"boxVr;":9567,"boxdL;":9557,"boxdR;":9554,"boxdl;":9488,"boxdr;":9484,"boxhD;":9573,"boxhU;":9576,"boxhd;":9516,"boxhu;":9524,"boxuL;":9563,"boxuR;":9560,"boxul;":9496,"boxur;":9492,"boxvH;":9578,"boxvL;":9569,"boxvR;":9566,"boxvh;":9532,"boxvl;":9508,"boxvr;":9500,"breve;":728,brvbar:166,"bsemi;":8271,"bsime;":8909,"bsolb;":10693,"bumpE;":10926,"bumpe;":8783,"caret;":8257,"caron;":711,"ccaps;":10829,ccedil:231,"ccirc;":265,"ccups;":10828,"cedil;":184,"check;":10003,"clubs;":9827,"colon;":58,"comma;":44,"crarr;":8629,"cross;":10007,"csube;":10961,"csupe;":10962,"ctdot;":8943,"cuepr;":8926,"cuesc;":8927,"cupor;":10821,curren:164,"cuvee;":8910,"cuwed;":8911,"cwint;":8753,"dashv;":8867,"dblac;":733,"ddarr;":8650,"delta;":948,"dharl;":8643,"dharr;":8642,"diams;":9830,"disin;":8946,divide:247,"doteq;":8784,"dtdot;":8945,"dtrif;":9662,"duarr;":8693,"duhar;":10607,"eDDot;":10871,eacute:233,"ecirc;":234,"efDot;":8786,egrave:232,"emacr;":275,"empty;":8709,"eogon;":281,"eplus;":10865,"epsiv;":1013,"eqsim;":8770,"equiv;":8801,"erDot;":8787,"erarr;":10609,"esdot;":8784,"exist;":8707,"fflig;":64256,"filig;":64257,"fjlig;":102,"fllig;":64258,"fltns;":9649,"forkv;":10969,frac12:189,frac14:188,frac34:190,"frasl;":8260,"frown;":8994,"gamma;":947,"gcirc;":285,"gescc;":10921,"gimel;":8503,"gneqq;":8809,"gnsim;":8935,"grave;":96,"gsime;":10894,"gsiml;":10896,"gtcir;":10874,"gtdot;":8919,"harrw;":8621,"hcirc;":293,"hoarr;":8703,iacute:237,"icirc;":238,"iexcl;":161,igrave:236,"iiint;":8749,"iiota;":8489,"ijlig;":307,"imacr;":299,"image;":8465,"imath;":305,"imped;":437,"infin;":8734,"iogon;":303,"iprod;":10812,iquest:191,"isinE;":8953,"isins;":8948,"isinv;":8712,"iukcy;":1110,"jcirc;":309,"jmath;":567,"jukcy;":1108,"kappa;":954,"lAarr;":8666,"lBarr;":10510,"langd;":10641,"laquo;":171,"larrb;":8676,"lates;":10925,"lbarr;":10508,"lbbrk;":10098,"lbrke;":10635,"lceil;":8968,"ldquo;":8220,"lescc;":10920,"lhard;":8637,"lharu;":8636,"lhblk;":9604,"llarr;":8647,"lltri;":9722,"lneqq;":8808,"lnsim;":8934,"loang;":10220,"loarr;":8701,"lobrk;":10214,"lopar;":10629,"lrarr;":8646,"lrhar;":8651,"lrtri;":8895,"lsime;":10893,"lsimg;":10895,"lsquo;":8216,"ltcir;":10873,"ltdot;":8918,"ltrie;":8884,"ltrif;":9666,"mDDot;":8762,"mdash;":8212,"micro;":181,middot:183,"minus;":8722,"mumap;":8888,"nabla;":8711,"napid;":8779,"napos;":329,"natur;":9838,"nbump;":8782,"ncong;":8775,"ndash;":8211,"neArr;":8663,"nearr;":8599,"nedot;":8784,"nesim;":8770,"ngeqq;":8807,"ngsim;":8821,"nhArr;":8654,"nharr;":8622,"nhpar;":10994,"nlArr;":8653,"nlarr;":8602,"nleqq;":8806,"nless;":8814,"nlsim;":8820,"nltri;":8938,"notin;":8713,"notni;":8716,"npart;":8706,"nprec;":8832,"nrArr;":8655,"nrarr;":8603,"nrtri;":8939,"nsime;":8772,"nsmid;":8740,"nspar;":8742,"nsubE;":10949,"nsube;":8840,"nsucc;":8833,"nsupE;":10950,"nsupe;":8841,ntilde:241,"numsp;":8199,"nvsim;":8764,"nwArr;":8662,"nwarr;":8598,oacute:243,"ocirc;":244,"odash;":8861,"oelig;":339,"ofcir;":10687,ograve:242,"ohbar;":10677,"olarr;":8634,"olcir;":10686,"oline;":8254,"omacr;":333,"omega;":969,"operp;":10681,"oplus;":8853,"orarr;":8635,"order;":8500,oslash:248,otilde:245,"ovbar;":9021,"parsl;":11005,"phone;":9742,"plusb;":8862,"pluse;":10866,plusmn:177,"pound;":163,"prcue;":8828,"prime;":8242,"prnap;":10937,"prsim;":8830,"quest;":63,"rAarr;":8667,"rBarr;":10511,"radic;":8730,"rangd;":10642,"range;":10661,"raquo;":187,"rarrb;":8677,"rarrc;":10547,"rarrw;":8605,"ratio;":8758,"rbarr;":10509,"rbbrk;":10099,"rbrke;":10636,"rceil;":8969,"rdquo;":8221,"reals;":8477,"rhard;":8641,"rharu;":8640,"rlarr;":8644,"rlhar;":8652,"rnmid;":10990,"roang;":10221,"roarr;":8702,"robrk;":10215,"ropar;":10630,"rrarr;":8649,"rsquo;":8217,"rtrie;":8885,"rtrif;":9656,"sbquo;":8218,"sccue;":8829,"scirc;":349,"scnap;":10938,"scsim;":8831,"sdotb;":8865,"sdote;":10854,"seArr;":8664,"searr;":8600,"setmn;":8726,"sharp;":9839,"sigma;":963,"simeq;":8771,"simgE;":10912,"simlE;":10911,"simne;":8774,"slarr;":8592,"smile;":8995,"smtes;":10924,"sqcap;":8851,"sqcup;":8852,"sqsub;":8847,"sqsup;":8848,"srarr;":8594,"starf;":9733,"strns;":175,"subnE;":10955,"subne;":8842,"supnE;":10956,"supne;":8843,"swArr;":8665,"swarr;":8601,"szlig;":223,"theta;":952,"thkap;":8776,"thorn;":254,"tilde;":732,"times;":215,"trade;":8482,"trisb;":10701,"tshcy;":1115,"twixt;":8812,uacute:250,"ubrcy;":1118,"ucirc;":251,"udarr;":8645,"udhar;":10606,ugrave:249,"uharl;":8639,"uharr;":8638,"uhblk;":9600,"ultri;":9720,"umacr;":363,"uogon;":371,"uplus;":8846,"upsih;":978,"uring;":367,"urtri;":9721,"utdot;":8944,"utrif;":9652,"uuarr;":8648,"vBarv;":10985,"vDash;":8872,"varpi;":982,"vdash;":8866,"veeeq;":8794,"vltri;":8882,"vnsub;":8834,"vnsup;":8835,"vprop;":8733,"vrtri;":8883,"wcirc;":373,"wedge;":8743,"xcirc;":9711,"xdtri;":9661,"xhArr;":10234,"xharr;":10231,"xlArr;":10232,"xlarr;":10229,"xodot;":10752,"xrArr;":10233,"xrarr;":10230,"xutri;":9651,yacute:253,"ycirc;":375,AElig:198,Acirc:194,"Aopf;":120120,Aring:197,"Ascr;":119964,"Auml;":196,"Barv;":10983,"Beta;":914,"Bopf;":120121,"Bscr;":8492,"CHcy;":1063,"COPY;":169,"Cdot;":266,"Copf;":8450,"Cscr;":119966,"DJcy;":1026,"DScy;":1029,"DZcy;":1039,"Darr;":8609,"Dopf;":120123,"Dscr;":119967,Ecirc:202,"Edot;":278,"Eopf;":120124,"Escr;":8496,"Esim;":10867,"Euml;":203,"Fopf;":120125,"Fscr;":8497,"GJcy;":1027,"Gdot;":288,"Gopf;":120126,"Gscr;":119970,"Hopf;":8461,"Hscr;":8459,"IEcy;":1045,"IOcy;":1025,Icirc:206,"Idot;":304,"Iopf;":120128,"Iota;":921,"Iscr;":8464,"Iuml;":207,"Jopf;":120129,"Jscr;":119973,"KHcy;":1061,"KJcy;":1036,"Kopf;":120130,"Kscr;":119974,"LJcy;":1033,"Lang;":10218,"Larr;":8606,"Lopf;":120131,"Lscr;":8466,"Mopf;":120132,"Mscr;":8499,"NJcy;":1034,"Nopf;":8469,"Nscr;":119977,Ocirc:212,"Oopf;":120134,"Oscr;":119978,"Ouml;":214,"Popf;":8473,"Pscr;":119979,"QUOT;":34,"Qopf;":8474,"Qscr;":119980,"Rang;":10219,"Rarr;":8608,"Ropf;":8477,"Rscr;":8475,"SHcy;":1064,"Sopf;":120138,"Sqrt;":8730,"Sscr;":119982,"Star;":8902,THORN:222,"TScy;":1062,"Topf;":120139,"Tscr;":119983,"Uarr;":8607,Ucirc:219,"Uopf;":120140,"Upsi;":978,"Uscr;":119984,"Uuml;":220,"Vbar;":10987,"Vert;":8214,"Vopf;":120141,"Vscr;":119985,"Wopf;":120142,"Wscr;":119986,"Xopf;":120143,"Xscr;":119987,"YAcy;":1071,"YIcy;":1031,"YUcy;":1070,"Yopf;":120144,"Yscr;":119988,"Yuml;":376,"ZHcy;":1046,"Zdot;":379,"Zeta;":918,"Zopf;":8484,"Zscr;":119989,acirc:226,acute:180,aelig:230,"andd;":10844,"andv;":10842,"ange;":10660,"aopf;":120146,"apid;":8779,"apos;":39,aring:229,"ascr;":119990,"auml;":228,"bNot;":10989,"bbrk;":9141,"beta;":946,"beth;":8502,"bnot;":8976,"bopf;":120147,"boxH;":9552,"boxV;":9553,"boxh;":9472,"boxv;":9474,"bscr;":119991,"bsim;":8765,"bsol;":92,"bull;":8226,"bump;":8782,"caps;":8745,"cdot;":267,cedil:184,"cent;":162,"chcy;":1095,"cirE;":10691,"circ;":710,"cire;":8791,"comp;":8705,"cong;":8773,"copf;":120148,"copy;":169,"cscr;":119992,"csub;":10959,"csup;":10960,"cups;":8746,"dArr;":8659,"dHar;":10597,"darr;":8595,"dash;":8208,"diam;":8900,"djcy;":1106,"dopf;":120149,"dscr;":119993,"dscy;":1109,"dsol;":10742,"dtri;":9663,"dzcy;":1119,"eDot;":8785,"ecir;":8790,ecirc:234,"edot;":279,"emsp;":8195,"ensp;":8194,"eopf;":120150,"epar;":8917,"epsi;":949,"escr;":8495,"esim;":8770,"euml;":235,"euro;":8364,"excl;":33,"flat;":9837,"fnof;":402,"fopf;":120151,"fork;":8916,"fscr;":119995,"gdot;":289,"geqq;":8807,"gesl;":8923,"gjcy;":1107,"gnap;":10890,"gneq;":10888,"gopf;":120152,"gscr;":8458,"gsim;":8819,"gtcc;":10919,"gvnE;":8809,"hArr;":8660,"half;":189,"harr;":8596,"hbar;":8463,"hopf;":120153,"hscr;":119997,icirc:238,"iecy;":1077,iexcl:161,"imof;":8887,"iocy;":1105,"iopf;":120154,"iota;":953,"iscr;":119998,"isin;":8712,"iuml;":239,"jopf;":120155,"jscr;":119999,"khcy;":1093,"kjcy;":1116,"kopf;":120156,"kscr;":120000,"lArr;":8656,"lHar;":10594,"lang;":10216,laquo:171,"larr;":8592,"late;":10925,"lcub;":123,"ldca;":10550,"ldsh;":8626,"leqq;":8806,"lesg;":8922,"ljcy;":1113,"lnap;":10889,"lneq;":10887,"lopf;":120157,"lozf;":10731,"lpar;":40,"lscr;":120001,"lsim;":8818,"lsqb;":91,"ltcc;":10918,"ltri;":9667,"lvnE;":8808,"macr;":175,"male;":9794,"malt;":10016,micro:181,"mlcp;":10971,"mldr;":8230,"mopf;":120158,"mscr;":120002,"nGtv;":8811,"nLtv;":8810,"nang;":8736,"napE;":10864,"nbsp;":160,"ncap;":10819,"ncup;":10818,"ngeq;":8817,"nges;":10878,"ngtr;":8815,"nisd;":8954,"njcy;":1114,"nldr;":8229,"nleq;":8816,"nles;":10877,"nmid;":8740,"nopf;":120159,"npar;":8742,"npre;":10927,"nsce;":10928,"nscr;":120003,"nsim;":8769,"nsub;":8836,"nsup;":8837,"ntgl;":8825,"ntlg;":8824,"nvap;":8781,"nvge;":8805,"nvgt;":62,"nvle;":8804,"nvlt;":60,"oast;":8859,"ocir;":8858,ocirc:244,"odiv;":10808,"odot;":8857,"ogon;":731,"oint;":8750,"omid;":10678,"oopf;":120160,"opar;":10679,"ordf;":170,"ordm;":186,"oror;":10838,"oscr;":8500,"osol;":8856,"ouml;":246,"para;":182,"part;":8706,"perp;":8869,"phiv;":981,"plus;":43,"popf;":120161,pound:163,"prap;":10935,"prec;":8826,"prnE;":10933,"prod;":8719,"prop;":8733,"pscr;":120005,"qint;":10764,"qopf;":120162,"qscr;":120006,"quot;":34,"rArr;":8658,"rHar;":10596,"race;":8765,"rang;":10217,raquo:187,"rarr;":8594,"rcub;":125,"rdca;":10551,"rdsh;":8627,"real;":8476,"rect;":9645,"rhov;":1009,"ring;":730,"ropf;":120163,"rpar;":41,"rscr;":120007,"rsqb;":93,"rtri;":9657,"scap;":10936,"scnE;":10934,"sdot;":8901,"sect;":167,"semi;":59,"sext;":10038,"shcy;":1096,"sime;":8771,"simg;":10910,"siml;":10909,"smid;":8739,"smte;":10924,"solb;":10692,"sopf;":120164,"spar;":8741,"squf;":9642,"sscr;":120008,"star;":9734,"subE;":10949,"sube;":8838,"succ;":8827,"sung;":9834,"sup1;":185,"sup2;":178,"sup3;":179,"supE;":10950,"supe;":8839,szlig:223,"tbrk;":9140,"tdot;":8411,thorn:254,times:215,"tint;":8749,"toea;":10536,"topf;":120165,"tosa;":10537,"trie;":8796,"tscr;":120009,"tscy;":1094,"uArr;":8657,"uHar;":10595,"uarr;":8593,ucirc:251,"uopf;":120166,"upsi;":965,"uscr;":120010,"utri;":9653,"uuml;":252,"vArr;":8661,"vBar;":10984,"varr;":8597,"vert;":124,"vopf;":120167,"vscr;":120011,"wopf;":120168,"wscr;":120012,"xcap;":8898,"xcup;":8899,"xmap;":10236,"xnis;":8955,"xopf;":120169,"xscr;":120013,"xvee;":8897,"yacy;":1103,"yicy;":1111,"yopf;":120170,"yscr;":120014,"yucy;":1102,"yuml;":255,"zdot;":380,"zeta;":950,"zhcy;":1078,"zopf;":120171,"zscr;":120015,"zwnj;":8204,"AMP;":38,"Acy;":1040,"Afr;":120068,"And;":10835,Auml:196,"Bcy;":1041,"Bfr;":120069,COPY:169,"Cap;":8914,"Cfr;":8493,"Chi;":935,"Cup;":8915,"Dcy;":1044,"Del;":8711,"Dfr;":120071,"Dot;":168,"ENG;":330,"ETH;":208,"Ecy;":1069,"Efr;":120072,"Eta;":919,Euml:203,"Fcy;":1060,"Ffr;":120073,"Gcy;":1043,"Gfr;":120074,"Hat;":94,"Hfr;":8460,"Icy;":1048,"Ifr;":8465,"Int;":8748,Iuml:207,"Jcy;":1049,"Jfr;":120077,"Kcy;":1050,"Kfr;":120078,"Lcy;":1051,"Lfr;":120079,"Lsh;":8624,"Map;":10501,"Mcy;":1052,"Mfr;":120080,"Ncy;":1053,"Nfr;":120081,"Not;":10988,"Ocy;":1054,"Ofr;":120082,Ouml:214,"Pcy;":1055,"Pfr;":120083,"Phi;":934,"Psi;":936,QUOT:34,"Qfr;":120084,"REG;":174,"Rcy;":1056,"Rfr;":8476,"Rho;":929,"Rsh;":8625,"Scy;":1057,"Sfr;":120086,"Sub;":8912,"Sum;":8721,"Sup;":8913,"Tab;":9,"Tau;":932,"Tcy;":1058,"Tfr;":120087,"Ucy;":1059,"Ufr;":120088,Uuml:220,"Vcy;":1042,"Vee;":8897,"Vfr;":120089,"Wfr;":120090,"Xfr;":120091,"Ycy;":1067,"Yfr;":120092,"Zcy;":1047,"Zfr;":8488,"acE;":8766,"acd;":8767,"acy;":1072,"afr;":120094,"amp;":38,"and;":8743,"ang;":8736,"apE;":10864,"ape;":8778,"ast;":42,auml:228,"bcy;":1073,"bfr;":120095,"bne;":61,"bot;":8869,"cap;":8745,cent:162,"cfr;":120096,"chi;":967,"cir;":9675,copy:169,"cup;":8746,"dcy;":1076,"deg;":176,"dfr;":120097,"die;":168,"div;":247,"dot;":729,"ecy;":1101,"efr;":120098,"egs;":10902,"ell;":8467,"els;":10901,"eng;":331,"eta;":951,"eth;":240,euml:235,"fcy;":1092,"ffr;":120099,"gEl;":10892,"gap;":10886,"gcy;":1075,"gel;":8923,"geq;":8805,"ges;":10878,"gfr;":120100,"ggg;":8921,"glE;":10898,"gla;":10917,"glj;":10916,"gnE;":8809,"gne;":10888,"hfr;":120101,"icy;":1080,"iff;":8660,"ifr;":120102,"int;":8747,iuml:239,"jcy;":1081,"jfr;":120103,"kcy;":1082,"kfr;":120104,"lEg;":10891,"lap;":10885,"lat;":10923,"lcy;":1083,"leg;":8922,"leq;":8804,"les;":10877,"lfr;":120105,"lgE;":10897,"lnE;":8808,"lne;":10887,"loz;":9674,"lrm;":8206,"lsh;":8624,macr:175,"map;":8614,"mcy;":1084,"mfr;":120106,"mho;":8487,"mid;":8739,"nGg;":8921,"nGt;":8811,"nLl;":8920,"nLt;":8810,"nap;":8777,nbsp:160,"ncy;":1085,"nfr;":120107,"ngE;":8807,"nge;":8817,"ngt;":8815,"nis;":8956,"niv;":8715,"nlE;":8806,"nle;":8816,"nlt;":8814,"not;":172,"npr;":8832,"nsc;":8833,"num;":35,"ocy;":1086,"ofr;":120108,"ogt;":10689,"ohm;":937,"olt;":10688,"ord;":10845,ordf:170,ordm:186,"orv;":10843,ouml:246,"par;":8741,para:182,"pcy;":1087,"pfr;":120109,"phi;":966,"piv;":982,"prE;":10931,"pre;":10927,"psi;":968,"qfr;":120110,quot:34,"rcy;":1088,"reg;":174,"rfr;":120111,"rho;":961,"rlm;":8207,"rsh;":8625,"scE;":10932,"sce;":10928,"scy;":1089,sect:167,"sfr;":120112,"shy;":173,"sim;":8764,"smt;":10922,"sol;":47,"squ;":9633,"sub;":8834,"sum;":8721,sup1:185,sup2:178,sup3:179,"sup;":8835,"tau;":964,"tcy;":1090,"tfr;":120113,"top;":8868,"ucy;":1091,"ufr;":120114,"uml;":168,uuml:252,"vcy;":1074,"vee;":8744,"vfr;":120115,"wfr;":120116,"xfr;":120117,"ycy;":1099,"yen;":165,"yfr;":120118,yuml:255,"zcy;":1079,"zfr;":120119,"zwj;":8205,AMP:38,"DD;":8517,ETH:208,"GT;":62,"Gg;":8921,"Gt;":8811,"Im;":8465,"LT;":60,"Ll;":8920,"Lt;":8810,"Mu;":924,"Nu;":925,"Or;":10836,"Pi;":928,"Pr;":10939,REG:174,"Re;":8476,"Sc;":10940,"Xi;":926,"ac;":8766,"af;":8289,amp:38,"ap;":8776,"dd;":8518,deg:176,"ee;":8519,"eg;":10906,"el;":10905,eth:240,"gE;":8807,"ge;":8805,"gg;":8811,"gl;":8823,"gt;":62,"ic;":8291,"ii;":8520,"in;":8712,"it;":8290,"lE;":8806,"le;":8804,"lg;":8822,"ll;":8810,"lt;":60,"mp;":8723,"mu;":956,"ne;":8800,"ni;":8715,not:172,"nu;":957,"oS;":9416,"or;":8744,"pi;":960,"pm;":177,"pr;":8826,reg:174,"rx;":8478,"sc;":8827,shy:173,uml:168,"wp;":8472,"wr;":8768,"xi;":958,yen:165,GT:62,LT:60,gt:62,lt:60},pi=Ah;var kh=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376];function wh(i,ve){if(ve&&!i.endsWith(";"))return`${i}\\b(?!=)`;return i}function Lo(i){let Ae=Object.keys(pi).map((_e)=>wh(_e,i));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${Ae.join("|")})`,"g")}var ui,hi;function Ph(i){if(i){if(!hi)hi=Lo(!0);return hi}if(!ui)ui=Lo(!1);return ui}var Oo=0;function _h(i){if(i===10)return 32;if(i<128)return i;if(i<=159)return kh[i-128];if(i<55296)return i;if(i<=57343)return Oo;if(i<=65535)return i;if(i>=65536&&i<=131071)return i;if(i>=131072&&i<=196607)return i;if(i>=917504&&i<=917631||i>=917760&&i<=917999)return i;return Oo}function fi(i,ve){if(i.indexOf("&")===-1)return i;return i.replace(Ph(ve),(Ae,_e)=>{let Ne;if(_e[0]!=="#")Ne=pi[_e];else if(_e[1]==="x")Ne=Number.parseInt(_e.substring(2),16);else Ne=Number.parseInt(_e.substring(1),10);if(!Ne)return Ae;return String.fromCodePoint(_h(Ne))})}class S extends Error{constructor(i){super(`sveld's template parser doesn't support ${i} yet.`);this.name="TemplateParseNotImplementedError"}}var Nh=/<\/script\s*>/g,Ih=/<\/script\s*>/y,Dh=/[^\n]/g,Rh=new Set(["server","client","worker","test","default"]);function Mo(i,ve,Ae){let _e=i.index,Ne=i.readUntil(Nh);if(i.index>=i.source.length)throw Error("sveld: unclosed <script> tag");let Re=i.source.slice(0,_e).replace(Dh," ")+Ne;i.read(Ih);let Ie=Po(Re,i.isTypeScript,i.root.comments);Ie.start=_e;let Le="default";for(let Me of Ae){if(Rh.has(Me.name))throw Error(`sveld: "${Me.name}" is a reserved <script> attribute name.`);if(Me.name==="module"){if(Me.value!==!0)throw Error("sveld: <script module> does not take a value.");Le="module"}if(Me.name==="context"){let $e=Me.value;if($e===!0||!Array.isArray($e)||$e.length!==1||$e[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if($e[0].data!=="module")throw Error('sveld: only context="module" is valid.');Le="module"}}return{type:"Script",start:ve,end:i.index,context:Le,content:Ie,attributes:Ae}}function Bo(i,ve,Ae){let _e=i.index,Ne=i.source.indexOf("</style",i.index),Re=Ne===-1?i.source.length:Ne;return i.index=Re,i.eat("</style",!0),i.read(/\s*>/y),{type:"StyleSheet",start:ve,end:i.index,attributes:Ae,children:[],comments:[],content:{start:_e,end:Re,styles:i.source.slice(_e,Re),comment:null}}}var Lh=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function di(i){return Lh.has(i)||i.charCodeAt(0)===33&&i.toLowerCase()==="!doctype"}var Oh="^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\\-_\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}]*)?$",Mh=new RegExp(Oh,"u");function $o(i){return Mh.test(i)}var Bh=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,Uo=/["']/y,$h=/(\/>|[\s"'=<>`])/y,mi=/<\/textarea(\s[^>]*)?>/iy,Fh=/^![a-zA-Z]+$/,jh=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Vh=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,Go={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},Fo={...Go,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function qh(i){let ve=i.charCodeAt(0);if(ve<97||ve>122)return!1;for(let Ae=1;Ae<i.length;Ae++){let _e=i.charCodeAt(Ae);if((_e<97||_e>122)&&(_e<48||_e>57))return!1}return!0}function Uh(i){if(qh(i))return!0;if(Fh.test(i))return!0;if(jh.test(i))return!0;return $o(i)}function Gh(i){let ve=i.charCodeAt(0);if(ve>=97&&ve<=122&&!i.includes("."))return!1;return!0}function Wh(i){return`Svelte${i.slice(7).split("-").map((Ae)=>Ae.charAt(0).toUpperCase()+Ae.slice(1)).join("")}`}function Hh(i){for(let ve=i.length-1;ve>=0;ve--){let Ae=i[ve].type;if(Ae==="SvelteHead")return!0;if(Ae==="RegularElement"||Ae==="Component")return!1}return!1}function Kh(i){for(let ve=i.length-1;ve>=0;ve--){let Ae=i[ve];if(Ae.type==="RegularElement"&&Ae.attributes?.some((_e)=>_e.type==="Attribute"&&_e.name==="shadowrootmode"))return!0}return!1}function jo(i){let{source:ve,index:Ae}=i;if(Ae>=ve.length)throw new Ar("Unexpected end of input",ve.length);let _e=Ae;while(_e<ve.length){let Ne=ve.charCodeAt(_e);if(Ne===47||Ne===62||Mr(Ne))break;_e++}return i.index=_e,{name:ve.slice(Ae,_e),start:Ae,end:_e}}function Wo(i){let{source:ve,index:Ae}=i;if(Ae>=ve.length)throw new Ar("Unexpected end of input",ve.length);let _e=Ae;while(_e<ve.length){let Ne=ve.charCodeAt(_e);if(Ne===61||Ne===47||Ne===62||Ne===34||Ne===39||Mr(Ne))break;_e++}return i.index=_e,{name:ve.slice(Ae,_e),start:Ae,end:_e}}function zh(i){let ve=i.index;if(i.eat("//")){let Ae=i.readUntilString(`
15
- `),_e=i.index;i.root.comments.push({type:"Line",value:Ae,start:ve,end:_e});return}if(i.eat("/*")){let Ae=i.readUntilString("*/");i.eat("*/");let _e=i.index;i.root.comments.push({type:"Block",value:Ae,start:ve,end:_e})}}function Xh(i){if(i==="use")return"UseDirective";if(i==="animate")return"AnimateDirective";if(i==="bind")return"BindDirective";if(i==="class")return"ClassDirective";if(i==="style")return"StyleDirective";if(i==="on")return"OnDirective";if(i==="let")return"LetDirective";if(i==="in"||i==="out"||i==="transition")return"TransitionDirective";return!1}function Ho(i,ve,Ae){let _e={start:i.index,end:-1,type:"Text",raw:"",data:""},Ne=[],Re=(Ie)=>{if(Ie>_e.start)_e.raw=i.source.slice(_e.start,Ie),_e.data=fi(_e.raw,!0),_e.end=Ie,Ne.push(_e)};while(i.index<i.source.length){if(ve())return Re(i.index),Ne;if(i.eat("{")){if(i.match("#")||i.match("@"))throw new S("blocks/tags inside attribute value sequences");let Ie=i.index-1;Re(Ie),i.allowWhitespace();let Le=Dt(i);i.allowWhitespace(),i.eat("}",!0),Ne.push({type:"ExpressionTag",start:Ie,end:i.index,expression:Le}),_e={start:i.index,end:-1,type:"Text",raw:"",data:""}}else{let Ie=i.index+1;if(Ae!==void 0){let Le=i.source;while(Ie<Le.length){let Me=Le.charCodeAt(Ie);if(Me===123||Me===Ae)break;Ie++}}i.index=Ie}}throw new S("unterminated attribute value / sequence (loose mode)")}function Jh(i){let ve=i.eat("'")?"'":i.eat('"')?'"':null;if(ve&&i.eat(ve))return[{start:i.index-1,end:i.index-1,type:"Text",raw:"",data:""}];let Ae=Ho(i,()=>{if(ve)return i.match(ve);return!!i.matchRegex($h)},ve===null?void 0:ve.charCodeAt(0));if(Ae.length===0&&!ve)throw Error("sveld: expected attribute value");if(ve)i.index+=1;if(ve||Ae.length>1||Ae[0].type==="Text")return Ae;return Ae[0]}function gi(i,ve,Ae,_e){return{type:"Attribute",start:ve,end:Ae,name:i,value:_e}}function Yh(i){let ve=i.index,Ae=Wo(i);if(!Ae.name)return null;let _e=!0;if(i.eat("=")){i.allowWhitespace();let Ne=i.matchRegex(Bh);if(!Ne)throw Error("sveld: expected attribute value");i.index+=Ne.length;let Re=Ne[0]==='"'||Ne[0]==="'";if(Re)Ne=Ne.slice(1,-1);_e=[{start:i.index-Ne.length-(Re?1:0),end:Re?i.index-1:i.index,type:"Text",raw:Ne,data:fi(Ne,!0)}]}if(i.matchRegex(Uo))throw Error("sveld: expected '='");return gi(Ae.name,ve,i.index,_e)}function Qh(i){while(!0){let Le=i.index;if(zh(i),i.index===Le)break;i.allowWhitespace()}let ve=i.index;if(i.eat("{")){if(i.allowWhitespace(),i.eat("@attach")){i.requireWhitespace();let $e=Dt(i);return i.allowWhitespace(),i.eat("}",!0),{type:"AttachTag",start:ve,end:i.index,expression:$e}}if(i.eat("...")){let $e=Dt(i);return i.allowWhitespace(),i.eat("}",!0),{type:"SpreadAttribute",start:ve,end:i.index,expression:$e}}let Le=i.readIdentifierName();if(Le.name==="")throw Error("sveld: empty attribute shorthand");i.allowWhitespace(),i.eat("}",!0);let Me={type:"ExpressionTag",start:Le.start,end:Le.end,expression:Le};return gi(Le.name,ve,i.index,Me)}let Ae=Wo(i);if(!Ae.name)return null;let _e=i.index;i.allowWhitespace();let Ne=Ae.name.indexOf(":"),Re=Ne!==-1&&Xh(Ae.name.slice(0,Ne)),Ie=!0;if(i.eat("="))if(i.allowWhitespace(),i.source[i.index]==="/"&&i.source[i.index+1]===">"){let Le=i.index;i.index++,Ie=[{start:Le,end:Le+1,type:"Text",raw:"/",data:"/"}],_e=i.index}else Ie=Jh(i),_e=i.index;else if(i.matchRegex(Uo))throw Error("sveld: expected '='");if(Re){let Le=Ae.name.slice(Ne+1).split("|",1)[0];if(Le==="")throw Error("sveld: directive missing a name");if(Re==="StyleDirective")return{start:ve,end:_e,type:Re,name:Le,value:Ie};let Me=Ie===!0?void 0:Array.isArray(Ie)?Ie[0]:Ie,$e=null;if(Me){if((Array.isArray(Ie)?Ie.length>1:!1)||Me.type==="Text")throw Error("sveld: directive value must be a single expression");$e=Me.expression}let Be={start:ve,end:_e,type:Re,name:Le,expression:$e};if((Be.type==="BindDirective"||Be.type==="ClassDirective")&&!Be.expression)Be.expression={start:ve+Ne+1,end:_e,type:"Identifier",name:Be.name};return Be}return gi(Ae.name,ve,_e,Ie)}function Ko(i){let ve=i.index++,Ae=i.current();if(i.eat("!--")){let Ue=i.readUntilString("-->");i.eat("-->",!0),i.append({type:"Comment",start:ve,end:i.index,data:Ue});return}if(i.eat("/")){let{name:Ue}=jo(i);if(i.allowWhitespace(),i.eat(">",!0),di(Ue))throw Error(`sveld: <${Ue}> is a void element and cannot have a closing tag`);while(Ae.name!==Ue){if(Ae.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${Ue}>`);Ae.end=ve,i.pop(),Ae=i.current()}if(Ae.end=i.index,i.pop(),i.lastAutoClosedTag&&i.stack.length<i.lastAutoClosedTag.depth)i.lastAutoClosedTag=void 0;return}let _e=jo(i),Ne=Gh(_e.name)&&Vh.test(_e.name);if(!Uh(_e.name)&&!Ne)throw Error(`sveld: "${_e.name}" is not a valid element or component name`);if(_e.name in Go&&Ae.type!=="Root")throw Error(`sveld: <${_e.name}> must be a top-level element`);let Re;if(_e.name in Fo)Re=Fo[_e.name];else if(_e.name.startsWith("svelte:"))Re=Wh(_e.name);else if(Ne)Re="Component";else if(_e.name==="title"&&Hh(i.stack))Re="TitleElement";else if(_e.name==="slot"&&!Kh(i.stack))Re="SlotElement";else Re="RegularElement";let Ie={type:Re,start:ve,end:-1,name:_e.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(i.allowWhitespace(),Ae.type==="RegularElement"&&ba(Ae.name,_e.name))Ae.end=ve,i.pop(),i.lastAutoClosedTag={tag:Ae.name,reason:_e.name,depth:i.stack.length},Ae=i.current();let Le=i.current(),Me=(_e.name==="script"||_e.name==="style")&&Le.type==="Root",$e=Me?Yh:Qh,Be;while(Be=$e(i))Ie.attributes.push(Be),i.allowWhitespace();if(Ie.type==="SvelteComponent")Ie.expression=qo(Vo(Ie));if(Ie.type==="SvelteElement"){let Ue=Vo(Ie);if(Ue.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(Zh(Ue))Ie.tag=qo(Ue);else{let Ge=Ue.value[0];Ie.tag=Ge.type==="Text"?{type:"Literal",value:Ge.data,raw:`'${Ge.raw}'`,start:Ge.start,end:Ge.end}:Ge.expression}}if(Me){if(i.eat(">",!0),_e.name==="script"){let Ue=Mo(i,ve,Ie.attributes);if(Ue.context==="module"){if(i.root.module)throw Error("sveld: duplicate <script module>");i.root.module=Ue}else{if(i.root.instance)throw Error("sveld: duplicate <script>");i.root.instance=Ue}}else{if(i.root.css)throw Error("sveld: duplicate <style>");i.root.css=Bo(i,ve,Ie.attributes)}return}i.append(Ie);let Ve=i.eat("/")||di(_e.name);if(i.eat(">",!0),Ve)Ie.end=i.index;else if(_e.name==="textarea")Ie.fragment.nodes=Ho(i,()=>(mi.lastIndex=i.index,mi.test(i.source))),i.read(mi),Ie.end=i.index;else i.push(Ie,Ie.fragment)}function Vo(i){let ve=i.attributes,Ae=ve.findIndex((_e)=>_e.type==="Attribute"&&_e.name==="this");if(Ae===-1)throw Error(`sveld: <${i.name}> requires a \`this\` attribute`);return ve.splice(Ae,1)[0]}function qo(i){return Array.isArray(i.value)?i.value[0].expression:i.value.expression}function Zh(i){return i.value!==!0&&!Array.isArray(i.value)||Array.isArray(i.value)&&i.value.length===1&&i.value[0].type==="ExpressionTag"}function zo(i){let ve={start:i.start,end:i.end,attributes:i.attributes};for(let Ae of i.attributes){if(Ae.type!=="Attribute")continue;if(Ae.name==="runes"){let _e=Xo(Ae);if(typeof _e==="boolean")ve.runes=_e}if(Ae.name==="customElement"){let _e=rf(Ae);if(_e!==void 0)ve.customElement=_e}}return ve}function Xo(i){let{value:ve}=i;if(ve===!0)return!0;let Ae=Array.isArray(ve)?ve[0]:ve;if(!Ae)return!0;if(Array.isArray(ve)&&ve.length>1)return null;if(Ae.type==="Text")return Ae.data;if(Ae.expression.type!=="Literal")return null;return Ae.expression.value}var ef=new Set(["String","Boolean","Number","Array","Object"]);function yi(i){let ve=[];for(let Ae of i.properties){if(!Ae||typeof Ae!=="object"||Ae.type!=="Property"||Ae.computed||Ae.key?.type!=="Identifier")continue;let{key:_e,value:Ne}=Ae;ve.push([_e.name,Ne])}return ve}function tf(i){let ve={};if(!i||typeof i!=="object"||i.type!=="ObjectExpression")return ve;for(let[Ae,_e]of yi(i)){if(!_e||typeof _e!=="object"||_e.type!=="Literal")continue;let Ne=_e.value;if(Ae==="attribute"&&typeof Ne==="string")ve.attribute=Ne;else if(Ae==="reflect"&&typeof Ne==="boolean")ve.reflect=Ne;else if(Ae==="type"&&typeof Ne==="string"&&ef.has(Ne))ve.type=Ne}return ve}function rf(i){let{value:ve}=i;if(ve===!0)return;let Ae=Array.isArray(ve)?ve[0]:ve;if(!Ae)return;if(Ae.type==="Text"){let Be=Xo(i);return typeof Be==="string"?{tag:Be}:void 0}let _e=Ae.expression;if(_e.type==="Literal"&&_e.value===null)return;if(_e.type!=="ObjectExpression")return;let Ne=yi(_e),Re={},Ie=Ne.find(([Be])=>Be==="tag")?.[1];if(Ie&&typeof Ie==="object"&&Ie.type==="Literal"&&typeof Ie.value==="string")Re.tag=Ie.value;let Le=Ne.find(([Be])=>Be==="props")?.[1];if(Le&&typeof Le==="object"&&Le.type==="ObjectExpression"){Re.props={};for(let[Be,Ve]of yi(Le))Re.props[Be]=tf(Ve)}let Me=Ne.find(([Be])=>Be==="shadow")?.[1];if(Me&&typeof Me==="object"){let Be=Me;if(Be.type==="Literal"&&(Be.value==="open"||Be.value==="none"))Re.shadow=Be.value;else if(Be.type==="ObjectExpression")Re.shadow=Me}let $e=Ne.find(([Be])=>Be==="extend")?.[1];if($e!==void 0)Re.extend=$e;return Re}var nf=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class xi extends ci{root;stack=[];fragments=[];isTypeScript;lastAutoClosedTag;constructor(i,ve){super(i);this.isTypeScript=nf.test(i);let Ae=Vt();this.root={type:"Root",start:0,end:ve,css:null,js:[],options:null,fragment:Ae,comments:[]},this.stack.push(this.root),this.fragments.push(Ae)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(i,ve){this.stack.push(i),this.fragments.push(ve)}pop(){return this.fragments.pop(),this.stack.pop()}append(i){return this.currentFragment().nodes.push(i),i}}var bi={"{":"}","(":")","[":"]"},sf=new Set(Object.values(bi));function dn(i,ve,Ae=bi){let _e=Ae===bi?sf:new Set(Object.values(Ae)),Ne=[],Re=ve;while(Re<i.source.length){let Ie=i.source[Re++];if(Ie==="'"||Ie==='"'||Ie==="`"){Re=af(i,Re,Ie);continue}if(Object.hasOwn(Ae,Ie))Ne.push(Ie);else if(_e.has(Ie)){let Le=Ne.pop(),Me=Le?Ae[Le]:void 0;if(Ie!==Me)throw Error(`sveld: expected "${Me}"`);if(Ne.length===0)return Re}}throw Error("sveld: unexpected end of input")}function af(i,ve,Ae){let _e=!1,Ne=ve;while(Ne<i.source.length){let Re=i.source[Ne++];if(_e){_e=!1;continue}if(Re===Ae)return Ne;if(Re==="\\")_e=!0;if(Ae==="`"&&Re==="$"&&i.source[Ne]==="{")Ne=dn(i,Ne)}throw Error("sveld: unterminated string constant")}var Yo=/[^\n]/g,of=/\?\s*:/g;function kr(i){let ve=i.index,Ae=i.readIdentifierName();if(Ae.name!==""){let Ue=Jo(i);return{...Ae,typeAnnotation:Ue}}let _e=i.source[i.index];if(_e!=="{"&&_e!=="[")throw Error("sveld: expected a binding pattern");let Ne=dn(i,ve);i.index=Ne;let Re=i.source.slice(ve,Ne),Ie=i.source.slice(0,ve).replace(Yo," "),Le=Ie.indexOf(" ");Ie=Ie.slice(0,Le)+Ie.slice(Le+1);let Me=`${Ie}(${Re} = 1)`,{node:$e}=Hr(Me,ve-1,i.isTypeScript,i.root.comments),Be=$e.left,Ve=Jo(i);if(Ve)Be.typeAnnotation=Ve,Be.end=Ve.end;return Be}function Jo(i){let ve=i.index;if(i.allowWhitespace(),!i.eat(":")){i.index=ve;return}let Ae="_ as ",_e=i.index-Ae.length,Ne=i.source.slice(0,_e).replace(Yo," ")+Ae+i.source.slice(i.index).replace(of,":"),{node:Re}=Hr(Ne,_e,i.isTypeScript,i.root.comments),Ie=Re;if(Ie.type==="AssignmentExpression"){let Le=Ie.right.start;while(Ne[Le]!=="=")Le-=1;({node:Re}=Hr(Ne.slice(0,Le),_e,i.isTypeScript,i.root.comments)),Ie=Re}if(Ie.type==="SequenceExpression"&&Ie.expressions)Ie=Ie.expressions[0];return i.index=Ie.end,{type:"TSTypeAnnotation",start:ve,end:i.index,typeAnnotation:Ie.typeAnnotation}}var Qo=/\s*}/y,cf={"<":">"};function Zo(i){let ve=i.index-2;while(i.source[ve]!=="{")ve-=1;if(i.eat("if")){i.requireWhitespace();let Ae={type:"IfBlock",elseif:!1,start:ve,end:-1,test:Dt(i),consequent:Vt(),alternate:null};i.append(Ae),i.allowWhitespace(),i.eat("}",!0),i.push(Ae,Ae.consequent);return}if(i.eat("each")){i.requireWhitespace();let Ae=Dt(i);if(i.allowWhitespace(),!i.match("as")){let Le=Ae;if(Le.type==="SequenceExpression"&&Le.expressions)Le=Le.expressions[0];if(Le.type==="TSAsExpression"){let Me=Le;Ae=Me.expression;let $e=Me.typeAnnotation.start-2;while($e>=0&&!(i.source[$e]==="a"&&i.source[$e+1]==="s"))$e-=1;i.index=$e}}let _e=null,Ne,Re;if(i.eat("as"))i.requireWhitespace(),_e=kr(i);if(i.allowWhitespace(),i.eat(",")){i.allowWhitespace();let Le=i.readIdentifierName();if(!Le.name)throw Error("sveld: expected an identifier");Ne=Le.name,i.allowWhitespace()}if(i.eat("("))i.allowWhitespace(),Re=Dt(i),i.allowWhitespace(),i.eat(")",!0),i.allowWhitespace();i.eat("}",!0);let Ie={type:"EachBlock",start:ve,end:-1,expression:Ae,body:Vt(),context:_e,index:Ne,key:Re};i.append(Ie),i.push(Ie,Ie.body);return}if(i.eat("await")){i.requireWhitespace();let Ae=Dt(i);i.allowWhitespace();let _e={type:"AwaitBlock",start:ve,end:-1,expression:Ae,value:null,error:null,pending:null,then:null,catch:null};if(i.eat("then")){if(!i.matchRegex(Qo))i.requireWhitespace(),_e.value=kr(i),i.allowWhitespace();_e.then=Vt()}else if(i.eat("catch")){if(!i.matchRegex(Qo))i.requireWhitespace(),_e.error=kr(i),i.allowWhitespace();_e.catch=Vt()}else _e.pending=Vt();i.eat("}",!0),i.append(_e),i.push(_e,_e.then??_e.catch??_e.pending);return}if(i.eat("key")){i.requireWhitespace();let Ae=Dt(i);i.allowWhitespace(),i.eat("}",!0);let _e={type:"KeyBlock",start:ve,end:-1,expression:Ae,fragment:Vt()};i.append(_e),i.push(_e,_e.fragment);return}if(i.eat("snippet")){i.requireWhitespace();let Ae=i.readIdentifierName();if(Ae.name==="")throw Error("sveld: expected a snippet name");i.allowWhitespace();let _e;if(i.isTypeScript&&i.match("<")){let Re=i.index,Ie=dn(i,Re,cf);_e=i.source.slice(Re+1,Ie-1),i.index=Ie}if(i.allowWhitespace(),i.eat("(")){let Re=1;while(i.index<i.source.length&&(!i.match(")")||Re!==1)){if(i.match("("))Re++;if(i.match(")"))Re--;i.index+=1}i.eat(")",!0)}i.allowWhitespace(),i.eat("}",!0);let Ne={type:"SnippetBlock",start:ve,end:-1,expression:Ae,typeParams:_e,parameters:[],body:Vt()};i.append(Ne),i.push(Ne,Ne.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function ec(i){let ve=i.index-1,Ae=i.current();if(Ae.type==="IfBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(i.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(i.allowWhitespace(),i.fragments.pop(),Ae.alternate=Vt(),i.fragments.push(Ae.alternate),i.eat("if")){i.requireWhitespace();let _e=Dt(i);i.allowWhitespace(),i.eat("}",!0);let Ne=ve-1;while(i.source[Ne]!=="{")Ne-=1;let Re={type:"IfBlock",start:Ne,end:-1,elseif:!0,test:_e,consequent:Vt(),alternate:null};i.append(Re),i.stack.push(Re),i.fragments.pop(),i.fragments.push(Re.consequent)}else i.allowWhitespace(),i.eat("}",!0);return}if(Ae.type==="EachBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else}");i.allowWhitespace(),i.eat("}",!0),Ae.fallback=Vt(),i.fragments.pop(),i.fragments.push(Ae.fallback);return}if(Ae.type==="AwaitBlock"){if(i.eat("then")){if(Ae.then)throw Error("sveld: duplicate {:then}");if(!i.eat("}"))i.requireWhitespace(),Ae.value=kr(i),i.allowWhitespace(),i.eat("}",!0);Ae.then=Vt(),i.fragments.pop(),i.fragments.push(Ae.then);return}if(i.eat("catch")){if(Ae.catch)throw Error("sveld: duplicate {:catch}");if(!i.eat("}"))i.requireWhitespace(),Ae.error=kr(i),i.allowWhitespace(),i.eat("}",!0);Ae.catch=Vt(),i.fragments.pop(),i.fragments.push(Ae.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function tc(i){let ve=i.current();switch(ve.type){case"IfBlock":{i.eat("if",!0),i.allowWhitespace(),i.eat("}",!0);while(ve.type==="IfBlock"&&ve.elseif)ve.end=i.index,i.stack.pop(),ve=i.current();ve.end=i.index,i.pop();return}case"EachBlock":i.eat("each",!0);break;case"KeyBlock":i.eat("key",!0);break;case"AwaitBlock":i.eat("await",!0);break;case"SnippetBlock":i.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}i.allowWhitespace(),i.eat("}",!0),ve.end=i.index,i.pop()}var lf=/(?:let|const)\b/y,pf=/(?:var|interface|enum)\b/y,uf=/type\b/y;function rc(i){let ve=i.index;if(i.matchRegex(pf))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!i.matchRegex(lf)&&!i.matchRegex(uf))return null;let Ae=i.root.comments.length,_e=_o(i.source,ve,i.isTypeScript,i.root.comments);if(_e.type!=="VariableDeclaration"){if(_e.type==="ExpressionStatement")return i.root.comments.length=Ae,null;throw Error("sveld: expected a `let`/`const` declaration")}if(_e.kind!=="let"&&_e.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return i.index=_e.end,i.allowWhitespace(),i.eat("}",!0),_e}var hf=/\s*}/y;function nc(i){let ve=i.index;while(i.source[ve]!=="{")ve-=1;if(i.eat("html")){i.requireWhitespace();let Ae=Dt(i);i.allowWhitespace(),i.eat("}",!0);let _e={type:"HtmlTag",start:ve,end:i.index,expression:Ae};i.append(_e);return}if(i.eat("debug")){let Ae;if(i.read(hf))Ae=[];else{let Ne=Dt(i);Ae=Ne.type==="SequenceExpression"?Ne.expressions:[Ne];for(let Re of Ae)if(Re.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");i.allowWhitespace(),i.eat("}",!0)}let _e={type:"DebugTag",start:ve,end:i.index,identifiers:Ae};i.append(_e);return}if(i.eat("const")){i.requireWhitespace();let Ae=kr(i);i.allowWhitespace(),i.eat("=",!0),i.allowWhitespace();let _e=Dt(i),Ne=i.index;i.allowWhitespace(),i.eat("}",!0);let Re={type:"VariableDeclarator",id:Ae,init:_e,start:Ae.start,end:Ne},Ie={type:"ConstTag",start:ve,end:i.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[Re],start:ve+2,end:i.index-1}};i.append(Ie);return}if(i.eat("render")){i.requireWhitespace();let Ae=Dt(i);if(!(Ae.type==="CallExpression"||Ae.type==="ChainExpression"&&Ae.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");i.allowWhitespace(),i.eat("}",!0);let Ne={type:"RenderTag",start:ve,end:i.index,expression:Ae};i.append(Ne);return}throw Error("sveld: expected html/debug/const/render")}function sc(i){let ve=i.index;if(i.index+=1,i.allowWhitespace(),i.eat("#")){Zo(i);return}if(i.eat(":")){ec(i);return}if(i.eat("@")){nc(i);return}if(i.match("/")&&!i.match("/*")&&!i.match("//")){i.eat("/"),tc(i);return}let Ae=rc(i);if(Ae){let Re={type:"DeclarationTag",start:ve,end:i.index,declaration:Ae};i.append(Re);return}let _e=Dt(i);i.allowWhitespace(),i.eat("}",!0);let Ne={type:"ExpressionTag",start:ve,end:i.index,expression:_e};i.append(Ne)}function ic(i){let{index:ve,source:Ae}=i,_e=Ae.indexOf("<",ve),Ne=Ae.indexOf("{",ve),Re;if(_e===-1)Re=Ne===-1?Ae.length:Ne;else Re=Ne===-1?_e:Math.min(_e,Ne);i.index=Re;let Ie=Ae.slice(ve,Re),Le={type:"Text",start:ve,end:i.index,raw:Ie,data:Ie};i.append(Le)}function v(i){let ve=i.trimEnd(),Ae=new xi(ve,i.length);while(Ae.index<Ae.source.length)if(Ae.match("<"))Ko(Ae);else if(Ae.match("{"))sc(Ae);else ic(Ae);let _e=Ae.root.fragment.nodes.findIndex((Ne)=>Ne.type==="SvelteOptions");if(_e!==-1){let[Ne]=Ae.root.fragment.nodes.splice(_e,1);Ae.root.options=zo(Ne)}return Ae.root}class zn{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(i)=>this.replacement=i}}replace(i,ve,Ae,_e){if(i&&ve)if(Ae!=null)i[ve][Ae]=_e;else i[ve]=_e}remove(i,ve,Ae){if(i&&ve)if(Ae!==null&&Ae!==void 0)i[ve].splice(Ae,1);else delete i[ve]}}class Ei extends zn{constructor(i,ve){super();this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(Ae)=>this.replacement=Ae},this.enter=i,this.leave=ve}visit(i,ve,Ae,_e){if(i){if(this.enter){let Re=this.should_skip,Ie=this.should_remove,Le=this.replacement;if(this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,i,ve,Ae,_e),this.replacement)i=this.replacement,this.replace(ve,Ae,_e,i);if(this.should_remove)this.remove(ve,Ae,_e);let Me=this.should_skip,$e=this.should_remove;if(this.should_skip=Re,this.should_remove=Ie,this.replacement=Le,Me)return i;if($e)return null}let Ne;for(Ne in i){let Re=i[Ne];if(Re&&typeof Re==="object"){if(Array.isArray(Re)){let Ie=Re;for(let Le=0;Le<Ie.length;Le+=1){let Me=Ie[Le];if(ac(Me)){if(!this.visit(Me,i,Ne,Le))Le--}}}else if(ac(Re))this.visit(Re,i,Ne,null)}}if(this.leave){let Re=this.replacement,Ie=this.should_remove;if(this.replacement=null,this.should_remove=!1,this.leave.call(this.context,i,ve,Ae,_e),this.replacement)i=this.replacement,this.replace(ve,Ae,_e,i);if(this.should_remove)this.remove(ve,Ae,_e);let Le=this.should_remove;if(this.replacement=Re,this.should_remove=Ie,Le)return null}}return i}}function ac(i){return i!==null&&typeof i==="object"&&"type"in i&&typeof i.type==="string"}function p(i,{enter:ve,leave:Ae}){return new Ei(ve,Ae).visit(i,null)}function Pt(i){return typeof i==="object"&&i!==null}function ne(i){return Pt(i)&&i.type==="VariableDeclaration"&&Array.isArray(i.declarations)}function f(i){return Pt(i)&&i.type==="Literal"}function a(i){return Pt(i)&&i.type==="Identifier"&&typeof i.name==="string"}function ie(i){return Pt(i)&&i.type==="MemberExpression"}function gr(i){return Pt(i)&&i.type==="ObjectExpression"&&Array.isArray(i.properties)}function ff(i){return Pt(i)&&i.type==="CallExpression"}function l(i,ve){if(!ff(i))return!1;return!!i.callee&&Pt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===ve}function d(i){if(Pt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"expression"in i)return d(i.expression);return i}function se(i){if(Pt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"typeAnnotation"in i)return i.typeAnnotation;return}function df(i){return Pt(i)&&i.type==="NewExpression"}function Ci(i,ve){if(!df(i))return!1;return!!i.callee&&Pt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===ve}function Xn(i){if(!Pt(i)||typeof i.type!=="string")return null;if(i.type==="Literal"){let ve=i.value;if(typeof ve==="string")return ve;return ve==null?null:String(ve)}if(i.type==="TemplateLiteral"){let ve=i.quasis;if(ve?.length===1){let Ae=ve[0]?.value?.cooked;return Ae==null?null:Ae}}return null}var x=Symbol("sveld.parsedComponentTypeScriptMetadata");function Kr(i){return i[x]}function oc(i,ve){if(ve.length===0)return;let Ae=new Set(i.props.map((_e)=>_e.name));for(let _e of ve){if(Ae.has(_e.name))continue;Ae.add(_e.name),i.props.push({name:_e.name,kind:"let",constant:!1,type:_e.type,typeSource:"typescript",..._e.description?{description:_e.description}:{},isFunction:_e.type.includes("=>"),isFunctionDeclaration:!1,isRequired:_e.isRequired,reactive:!1})}}var mf=/\w/;function gf(i,ve){let Ae=i.trim();if(!Ae.startsWith("{")||!Ae.endsWith("}"))return;let _e=Ae.slice(1,-1),Ne=[],Re=0,Ie="";for(let Le of _e)if(Le==="{"||Le==="<"||Le==="("||Le==="[")Re++,Ie+=Le;else if(Le==="}"||Le===">"||Le===")"||Le==="]")Re--,Ie+=Le;else if((Le===";"||Le===",")&&Re===0)Ne.push(Ie.trim()),Ie="";else Ie+=Le;if(Ie.trim())Ne.push(Ie.trim());for(let Le of Ne){if(!Le.startsWith(ve))continue;let Me=Le.slice(ve.length);if(Me.length>0&&mf.test(Me[0]))continue;let $e=Me.trimStart();if($e.startsWith("?"))$e=$e.slice(1).trimStart();if($e.startsWith(":"))return $e.slice(1).trim()}return}function j(i,ve,Ae){let _e=Ae;if(_e.computed||_e.object?.type!=="Identifier"||_e.property?.type!=="Identifier")return;let Ne=_e.object.name,Re=_e.property.name;if(!Ne||!Re)return;if(i.wholePropsLocals.has(Ne))return ve.getPropTypeByLocalOrPublic(Re);let Ie=ve.getPropTypeByLocalOrPublic(Ne)??ve.findVariableTypeAndDescription(Ne)?.type;if(!Ie)return;return gf(Ie,Re)}function yf(i){let ve="";for(let Ae=0;Ae<i.length;Ae++){let _e=i[Ae];if(_e==="*"&&i[Ae+1]==="*"){if(ve+=".*",Ae++,i[Ae+1]==="/")Ae++;continue}if(_e==="*"){ve+="[^/]*";continue}if(_e==="?"){ve+="[^/]";continue}ve+=".+^$()[]{}|\\".includes(_e)?`\\${_e}`:_e}return ve}function cc(i,ve){return new RegExp(`^${yf(i)}$`).test(ve)}var J={"prop-unknown-type":"sveld/prop-unknown-type","context-any-type":"sveld/context-any-type","slot-missing-type":"sveld/slot-missing-type","event-no-source":"sveld/event-no-source","example-compile-error":"sveld/example-compile-error","example-syntax-error":"sveld/example-syntax-error","syntax-skipped":"sveld/syntax-skipped","rest-props-unresolved":"sveld/rest-props-unresolved","context-duplicate-key":"sveld/context-duplicate-key","spread-unresolved":"sveld/spread-unresolved","export-unresolved":"sveld/export-unresolved","extend-props-target-missing":"sveld/extend-props-target-missing","extend-props-duplicate":"sveld/extend-props-duplicate","extend-props-override":"sveld/extend-props-override","jsdoc-unknown-tag":"sveld/jsdoc-unknown-tag","typedef-duplicate":"sveld/typedef-duplicate","property-duplicate":"sveld/property-duplicate","generics-conflict":"sveld/generics-conflict","jsdoc-tag-dropped":"sveld/jsdoc-tag-dropped","internal-typedef-referenced":"sveld/internal-typedef-referenced"},xf={"prop-unknown-type":"warning","context-any-type":"warning","slot-missing-type":"warning","event-no-source":"warning","example-compile-error":"error","example-syntax-error":"error","syntax-skipped":"error","rest-props-unresolved":"warning","context-duplicate-key":"warning","spread-unresolved":"warning","export-unresolved":"warning","extend-props-target-missing":"error","extend-props-duplicate":"warning","extend-props-override":"warning","jsdoc-unknown-tag":"warning","typedef-duplicate":"warning","property-duplicate":"warning","generics-conflict":"warning","jsdoc-tag-dropped":"warning","internal-typedef-referenced":"error"};function wr(i){return{...i,code:J[i.kind],severity:xf[i.kind]}}function F(i,ve){if(ve)return i;return i.filter((Ae)=>Ae.kind!=="jsdoc-unknown-tag")}function q(i,ve){if(!ve)return[];return i.filter((Ae)=>!Ae.ignored&&(ve!=="errors"||Ae.severity==="error"))}function bf(i,ve){if(ve.code!==void 0&&ve.code!==i.code)return!1;if(ve.name!==void 0&&ve.name!==i.name)return!1;if(ve.component!==void 0&&!cc(ve.component,i.component))return!1;return!0}function lc(i,ve){if(!ve||ve.length===0)return i;return i.map((Ae)=>Ae.ignored||ve.some((_e)=>bf(Ae,_e))?{...Ae,ignored:!0}:Ae)}var Ef={"prop-unknown-type":"Props without inferred types","context-any-type":"Context values typed as `any`","slot-missing-type":"@slot/@snippet tags missing a {Type} annotation","event-no-source":"@event tags with no dispatch or callback","example-compile-error":"@example blocks that failed to compile","example-syntax-error":"@example blocks that failed to parse","syntax-skipped":"Component syntax sveld skipped","rest-props-unresolved":"$$restProps spread only onto components","context-duplicate-key":"Duplicate setContext keys","spread-unresolved":"Unresolved spreads widened to Record<string, any>","export-unresolved":"Unresolved named export specifiers","extend-props-target-missing":"@extends/@extendProps targets that couldn't be verified","extend-props-duplicate":"Duplicate @extends/@extendProps tags","extend-props-override":"Own props overriding an @extends target's prop","jsdoc-unknown-tag":"Unknown JSDoc tags","typedef-duplicate":"Duplicate @typedef/@callback names","property-duplicate":"Duplicate @property names","generics-conflict":"Duplicate @generics/@template names","jsdoc-tag-dropped":"Passthrough JSDoc tags that couldn't attach","internal-typedef-referenced":"Public types referencing an @internal typedef"},Cf=["prop-unknown-type","context-any-type","slot-missing-type","event-no-source","example-compile-error","example-syntax-error","syntax-skipped","rest-props-unresolved","context-duplicate-key","spread-unresolved","export-unresolved","extend-props-target-missing","extend-props-duplicate","extend-props-override","jsdoc-unknown-tag","typedef-duplicate","property-duplicate","generics-conflict","jsdoc-tag-dropped","internal-typedef-referenced"];function Jn(i){let ve=new Set,Ae=[];for(let _e of i){let Ne=`${_e.component}:${_e.kind}:${_e.name}`;if(ve.has(Ne))continue;ve.add(Ne),Ae.push(_e)}return Ae}function V(i){let ve=i.filter((Ie)=>!Ie.ignored),Ae=i.length-ve.length,_e=Ae>0?` (${Ae} ignored)`:"";if(ve.length===0)return`sveld: all types resolved${_e}.`;let Ne=[],Re=ve.length;Ne.push(`sveld: ${Re} unresolved type${Re===1?"":"s"} found${_e}.`);for(let Ie of Cf){let Le=ve.filter(($e)=>$e.kind===Ie);if(Le.length===0)continue;Ne.push(""),Ne.push(`${Ef[Ie]} (${Le.length}):`);let Me=new Map;for(let $e of Le){let Be=Me.get($e.component)??[];Be.push($e),Me.set($e.component,Be)}for(let[$e,Be]of Me){Ne.push(` ${$e}`);for(let Ve of Be){let Ue=Ve.source?` (${$e}:${Ve.source.start.line}:${Ve.source.start.column})`:"";Ne.push(` - ${Ve.message}${Ue} [${Ve.code}]`)}}}return Ne.join(`
16
- `)}var oe=1;function U(i){return`${JSON.stringify({kind:"diagnostics",schemaVersion:oe,diagnostics:i},null,2)}
17
- `}function n(i,ve,Ae,_e,Ne){i.diagnosticRecords.push(wr({component:i.componentFilePath,kind:ve,name:Ae,message:_e,...Ne?{source:Ne}:{},...vf(i,ve,Ae)?{ignored:!0}:{}}))}function pc(i,ve){return`${i}:${ve}`}function m(i,ve,Ae,_e){if(!_e||_e.length===0)return;let Ne=pc(ve,Ae),Re=i.sveldIgnoreDirectives.get(Ne)??new Set;for(let Ie of _e)Re.add(Ie);i.sveldIgnoreDirectives.set(Ne,Re)}function vf(i,ve,Ae){let _e=i.sveldIgnoreDirectives.get(pc(ve,Ae));if(!_e)return!1;return _e.has("")||_e.has(J[ve])}var vi=/[\r\n]+/g;function Sf(i){if(i.sourceLineStartOffsetsCache)return i.sourceLineStartOffsetsCache;let ve=[0];if(i.source){let Ae=i.source.indexOf(`
18
- `);while(Ae!==-1)ve.push(Ae+1),Ae=i.source.indexOf(`
19
- `,Ae+1)}return i.sourceLineStartOffsetsCache=ve,ve}function uc(i,ve){if(!i.source||ve<0||ve>i.source.length)return;let Ae=Sf(i),_e=0,Ne=Ae.length-1;while(_e<=Ne){let Re=Math.floor((_e+Ne)/2),Ie=Ae[Re],Le=Ae[Re+1]??Number.POSITIVE_INFINITY;if(ve<Ie)Ne=Re-1;else if(ve>=Le)_e=Re+1;else return{line:Re+1,column:ve-Ie}}return}function H(i,ve,Ae){if(ve===void 0||Ae===void 0||Ae<ve)return;let _e=uc(i,ve),Ne=uc(i,Ae);if(!_e||!Ne)return;return{start:_e,end:Ne}}function t(i,ve){if(!ve||typeof ve!=="object")return;let Ae="start"in ve&&typeof ve.start==="number"?ve.start:void 0,_e="end"in ve&&typeof ve.end==="number"?ve.end:void 0;return H(i,Ae,_e)}function sr(i,ve){if(!ve||ve.length===0)return;let Ae=[...ve];while(Ae.length>1){let Me=Ae[Ae.length-1];if(Me.tag!==void 0||!Me.raw.trim().endsWith("*/"))break;Ae.pop()}let _e=Ae[0],Ne=_e.raw.indexOf(`@${_e.tag??""}`),Re=_e.start+Math.max(Ne,0),Ie=Ae[Ae.length-1],Le=Ie.start+Ie.raw.length;return H(i,Re,Le)}function r(i,ve,Ae){return i.source?.slice(ve,Ae)}function Yn(i,ve){if(!ve||typeof ve!=="object")return;let Ae="start"in ve&&typeof ve.start==="number"?ve.start:void 0,_e="end"in ve&&typeof ve.end==="number"?ve.end:void 0;if(Ae===void 0||_e===void 0)return;return r(i,Ae,_e)?.replace(vi," ")}function u(i){return i===void 0||i===""?void 0:i}function L(i,ve,Ae,_e){if(u(Ae)===void 0)return;if(i.trackPropLocalName(Ae),ve.props.has(Ae)){let Ne=ve.props.get(Ae);ve.props.set(Ae,{...Ne,..._e})}else ve.props.set(Ae,_e)}function h(i,ve,Ae,_e=0){let Ne,Re,Ie=!1;if(!Ae||typeof Ae!=="object"||!("type"in Ae))return{value:Ne,type:Re,isFunction:Ie};let Le=fc(i,ve,Ae);if(Ae.type==="ObjectExpression"||Ae.type==="BinaryExpression"||Ae.type==="ArrayExpression"||Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression"){let Me=Ae;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")Ne=r(ve,Me.start,Me.end)?.replace(vi," ");if(Re=Ne,Ie=Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression",Ae.type==="BinaryExpression"){let $e=Ae;if($e.left&&typeof $e.left==="object"&&"type"in $e.left&&$e.left.type==="Literal"&&"value"in $e.left&&typeof $e.left.value==="string")Re="string"}if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression")Re=gc(Ae),Ne=hc(ve,Ae)}else if(Ae.type==="UnaryExpression"){let Me=Ae;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")Ne=r(ve,Me.start,Me.end);if(Me.argument){if(typeof Me.argument==="object"&&"type"in Me.argument&&Me.argument.type==="UnaryExpression")Re=h(i,ve,Me.argument).type;else if(typeof Me.argument==="object"&&"value"in Me.argument)Re=typeof Me.argument.value}}else if(Ae.type==="NewExpression"){let Me=Ae;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")Ne=r(ve,Me.start,Me.end);if(Me.callee&&typeof Me.callee==="object"&&"type"in Me.callee&&Me.callee.type==="Identifier"){let $e=Me.callee.name;if($e==="Date")Re="Date";else if($e==="Map")Re="Map<any, any>";else if($e==="Set")Re="Set<any>";else if($e==="WeakMap")Re="WeakMap<object, any>";else if($e==="WeakSet")Re="WeakSet<object>";else if($e==="Array")Re="any[]";else if($e==="RegExp"||$e==="Regexp")Re="RegExp";else if($e==="Error")Re="Error";else Re=$e}}else if(Ae.type==="CallExpression"){let Me=Ae;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")Ne=r(ve,Me.start,Me.end);let $e=Me.callee,Be=$e&&typeof $e==="object"&&"type"in $e&&$e.type==="Identifier"?$e.name:void 0;if((Be==="$derived"||Be==="$state")&&Me.arguments.length===1&&_e<5)return{...h(i,ve,Me.arguments[0],_e+1),value:Ne,defaultValue:Le};if(Be){let Ve=Af(i,ve,Be);if(Ve)return{value:Ne,type:void 0,isFunction:!1,defaultValue:Le,resolvedType:Ve};if(ve.funcDecls.has(Be)||kf(ve,Be))return{value:Ne,type:void 0,isFunction:!1,defaultValue:Le,pendingCallDefault:{calleeName:Be}};let Ue=ve.valueImportBindingsByLocalName.get(Be);if(Ue)return{value:Ne,type:void 0,isFunction:!1,defaultValue:Le,pendingCallDefault:{calleeName:Be,importSource:Ue.source,importedName:Ue.importedName}}}return{value:Ne,type:void 0,isFunction:!1,defaultValue:Le,pendingCallDefault:{calleeName:Be??Tf(ve,$e)}}}else if(Ae.type==="Identifier"){let Me=Ae;if(_e<5){let $e=dc(ve,Me.name);if($e){let Be=h(i,ve,$e,_e+1),Ve=i.resolveLocalVarJSDoc(Me.name);return{...Be,resolvedType:Ve?.type??Be.resolvedType,resolvedDescription:Ve?.description??Be.resolvedDescription,resolvedParams:Ve?.params??Be.resolvedParams,resolvedReturnType:Ve?.returnType??Be.resolvedReturnType}}if(ve.funcDecls.has(Me.name)){let Be=i.resolveLocalVarJSDoc(Me.name),Ve=ve.funcDecls.get(Me.name);return{value:Ve?hc(ve,Ve):void 0,type:void 0,isFunction:!0,defaultValue:Ve?fc(i,ve,Ve):void 0,resolvedType:Be?.type??Nf(Be,Ve),resolvedDescription:Be?.description,resolvedParams:Be?.params,resolvedReturnType:Be?.returnType}}}if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")Ne=r(ve,Me.start,Me.end)}else if(Ae.type==="MemberExpression"){let Me=Ae;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")Ne=r(ve,Me.start,Me.end);if(i.isNumericConstant(Ae))Re="number"}else if(Ae.type==="TemplateLiteral"){let Me=Ae;if("start"in Me&&"end"in Me&&typeof Me.start==="number"&&typeof Me.end==="number")Ne=r(ve,Me.start,Me.end);Re="string"}else if("raw"in Ae&&typeof Ae.raw==="string"){if(Ne=Ae.raw,"value"in Ae)Re=Ae.value==null?void 0:typeof Ae.value}return{value:Ne,type:Re,isFunction:Ie,defaultValue:Le}}function dc(i,ve){for(let Ae of i.vars)for(let _e of Ae.declarations)if(_e.id&&typeof _e.id==="object"&&"type"in _e.id&&_e.id.type==="Identifier"&&"name"in _e.id&&_e.id.name===ve&&_e.init)return _e.init;return}function mn(i,ve){for(let Ae of i.vars){if(Ae.kind!=="const")continue;for(let _e of Ae.declarations)if(_e.id&&typeof _e.id==="object"&&"type"in _e.id&&_e.id.type==="Identifier"&&"name"in _e.id&&_e.id.name===ve&&_e.init)return _e.init}return}function Tf(i,ve){if(ve&&typeof ve==="object"&&"start"in ve&&"end"in ve&&typeof ve.start==="number"&&typeof ve.end==="number")return r(i,ve.start,ve.end)??"call";return"call"}function Af(i,ve,Ae){let _e=i.resolveLocalVarJSDoc(Ae);if(_e?.returnType)return _e.returnType;let Ne=ve.funcDecls.get(Ae)??mc(ve,Ae);if(!Ne)return;let Re=_f(ve,Ne);if(Re)return Re;let Ie=wf(ve,Ae);if(Ie)return Ie;let Le=yc(Ne);return Le==="any"?void 0:Le}function kf(i,ve){return mc(i,ve)!==void 0}function mc(i,ve){let Ae=dc(i,ve);if(!Ae||typeof Ae!=="object"||!("type"in Ae))return;if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression")return Ae;return}function wf(i,ve){for(let Ae of i.vars)for(let _e of Ae.declarations){let Ne=_e.id;if(!Ne||typeof Ne!=="object"||!("type"in Ne)||Ne.type!=="Identifier"||!("name"in Ne)||Ne.name!==ve)continue;let Re=Ne.typeAnnotation;if(Re?.type!=="TSTypeAnnotation")return;let Ie=Re.typeAnnotation;if(!Ie||typeof Ie.start!=="number"||typeof Ie.end!=="number")return;return Pf(r(i,Ie.start,Ie.end))}return}function Pf(i){if(!i)return;let ve=i.lastIndexOf("=>");if(ve===-1)return;return i.slice(ve+2).trim()||void 0}function _f(i,ve){let Ae=ve.returnType;if(Ae?.type!=="TSTypeAnnotation")return;let _e=Ae.typeAnnotation;if(!_e||typeof _e.start!=="number"||typeof _e.end!=="number")return;return r(i,_e.start,_e.end)}function Nf(i,ve){let Ae=i?.returnType??"any",_e=i?.params;if(_e&&_e.length>0)return`(${_e.map((Re)=>`${Re.name}${Re.optional?"?":""}: ${Re.type}`).join(", ")}) => ${Ae}`;if(i?.returnType)return`() => ${Ae}`;if(ve)return gc(ve);return"(...args: any[]) => any"}function gc(i){return`(${If(i)}) => ${yc(i)}`}function If(i){let ve=i.params;if(!Array.isArray(ve)||ve.length===0)return"...args: any[]";let Ae=[];for(let _e of ve)if(_e&&typeof _e==="object"&&"type"in _e&&_e.type==="Identifier"&&"name"in _e&&typeof _e.name==="string")Ae.push(`${_e.name}: any`);else return"...args: any[]";return Ae.join(", ")}function yc(i){if(i.async||i.generator)return"any";let ve=i.body,Ae;if(ve&&typeof ve==="object"&&"type"in ve&&ve.type==="BlockStatement"){if(Ae=Df(ve),Ae.length===0)return"any"}else Ae=[ve];let _e=null;for(let Ne of Ae){let Re=Rf(Ne);if(!Re)return"any";if(_e===null)_e=Re;else if(_e!==Re)return"any"}return _e??"any"}function Df(i){let ve=[];return p(i,{enter(Ae){if(Ae.type==="FunctionDeclaration"||Ae.type==="FunctionExpression"||Ae.type==="ArrowFunctionExpression"){this.skip();return}if(Ae.type==="ReturnStatement")ve.push(Ae.argument??null)}}),ve}function Rf(i){if(!i||typeof i!=="object"||!("type"in i))return null;switch(i.type){case"Literal":{let ve=i.value;if(typeof ve==="string")return"string";if(typeof ve==="number")return"number";if(typeof ve==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let ve=i.callee;if(ve&&typeof ve==="object"&&"type"in ve&&ve.type==="Identifier"){let Ae=ve.name;if(Ae==="String")return"string";if(Ae==="Number")return"number";if(Ae==="Boolean")return"boolean"}return null}default:return null}}function ae(i){if(l(i,"$bindable"))return{init:i.arguments[0],bindable:!0};return{init:i,bindable:!1}}function Lf(i,ve){let Ae=ve.params;if(!Array.isArray(Ae)||Ae.length===0)return"";let _e=Ae[0],Ne=Ae[Ae.length-1];if(typeof _e.start!=="number"||typeof Ne.end!=="number")return"";return r(i,_e.start,Ne.end)??""}function hc(i,ve){if(ve.generator)return;let Ae=ve.body;if(!Ae||typeof Ae!=="object"||!("type"in Ae))return;let _e=Lf(i,ve),Ne=ve.async?"async ":"",Re=(Le,Me)=>Le&&typeof Le==="object"&&("type"in Le)&&Le.type==="ObjectExpression"?`(${Me})`:Me;if(Ae.type!=="BlockStatement"){let Le=Yn(i,Ae);return Le===void 0?void 0:`${Ne}(${_e}) => ${Re(Ae,Le)}`}let Ie=Ae.body;if(Ie.length===0)return`${Ne}(${_e}) => {}`;if(Ie.length===1){let Le=Ie[0];if(Le&&typeof Le==="object"&&"type"in Le&&Le.type==="ReturnStatement"){let Me=Le.argument;if(Me){let $e=Yn(i,Me);if($e!==void 0)return`${Ne}(${_e}) => ${Re(Me,$e)}`}}}return}function fc(i,ve,Ae){let _e=Yn(ve,Ae);if(!_e||!Ae||typeof Ae!=="object"||!("type"in Ae))return;let Ne="expression";if(Ae.type==="Literal"||Ae.type==="UnaryExpression")Ne="literal";else if(Ae.type==="TemplateLiteral")Ne=Ae.expressions.length===0?"literal":"expression";else if(Ae.type==="ArrayExpression")Ne="array";else if(Ae.type==="ObjectExpression")Ne="object";else if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression"||Ae.type==="FunctionDeclaration")Ne="function";let Re={raw:_e,kind:Ne};if(Ne==="literal"||Ne==="array"||Ne==="object"){let Ie=Si(i,Ae);if(Ie.ok)Re.value=Ie.value}return Re}function Si(i,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return{ok:!1};if(ve.type==="Literal"){let Ae=ve.value;return typeof Ae==="bigint"?{ok:!1}:{ok:!0,value:Ae}}if(ve.type==="UnaryExpression"){let Ae=ve,_e=Ae.argument;if(!_e||typeof _e!=="object"||!("type"in _e)||_e.type!=="Literal")return{ok:!1};let Ne=_e.value;if(typeof Ne==="number"){if(Ae.operator==="-")return{ok:!0,value:-Ne};if(Ae.operator==="+")return{ok:!0,value:Ne}}if(typeof Ne==="boolean"&&Ae.operator==="!")return{ok:!0,value:!Ne};return{ok:!1}}if(ve.type==="TemplateLiteral"){let Ae=ve;if(Ae.expressions.length>0||Ae.quasis.length!==1)return{ok:!1};return{ok:!0,value:Ae.quasis[0].value.cooked??Ae.quasis[0].value.raw}}if(ve.type==="ArrayExpression"){let Ae=ve,_e=[];for(let Ne of Ae.elements){if(!Ne)return{ok:!1};let Re=Si(i,Ne);if(!Re.ok)return{ok:!1};_e.push(Re.value)}return{ok:!0,value:_e}}if(ve.type==="ObjectExpression"){let Ae=ve,_e={};for(let Ne of Ae.properties){if(Ne.type!=="Property"||Ne.computed)return{ok:!1};let Re=i.getPropertyName(Ne.key);if(!Re)return{ok:!1};let Ie=Si(i,Ne.value);if(!Ie.ok)return{ok:!1};_e[Re]=Ie.value}return{ok:!0,value:_e}}return{ok:!1}}function Of(i){let ve=[],Ae=0,_e=0;for(let Ne=0;Ne<i.length;Ne++){let Re=i[Ne];if(Re==="<"||Re==="("||Re==="["||Re==="{")Ae++;else if(Re===">"||Re===")"||Re==="]"||Re==="}")Ae=Math.max(Ae-1,0);else if(Ae===0&&(Re===";"||Re===","))ve.push(i.slice(_e,Ne)),_e=Ne+1}return ve.push(i.slice(_e)),ve}function Mf(i){let ve=0;for(let Ae=0;Ae<i.length;Ae++){let _e=i[Ae];if(_e==="<"||_e==="("||_e==="["||_e==="{")ve++;else if(_e===">"||_e===")"||_e==="]"||_e==="}")ve=Math.max(ve-1,0);else if(ve===0&&_e===":")return Ae}return-1}var Bf=/^\{([\s\S]*)\}$/,$f=/^[A-Za-z_$][\w$]*$/;function Qn(i){let ve=i.trim(),Ae=Bf.exec(ve);if(!Ae)return null;let _e=Ae[1].trim();if(_e==="")return[];let Ne=[];for(let Re of Of(_e)){let Ie=Re.trim();if(!Ie)continue;let Le=Mf(Ie);if(Le===-1)return null;let Me=Ie.slice(0,Le).trim(),$e=Ie.slice(Le+1).trim();if(!$e)return null;let Be=!1;if(Me.endsWith("?"))Be=!0,Me=Me.slice(0,-1).trim();if(!$f.test(Me))return null;Ne.push({name:Me,type:$e,optional:Be})}return Ne}function Ff(i,ve,Ae,_e){if(!a(Ae))return null;let Ne=mn(i,Ae.name);if(gr(Ne))return Ec(i,ve,Ne,_e).properties;let Re=ve.findVariableTypeAndDescription(Ae.name);if(!Re)return null;let Ie=Qn(Re.type);if(!Ie)return null;return Ie.map((Le)=>({name:Le.name,type:Le.type,optional:Le.optional}))}function Ec(i,ve,Ae,_e){let Ne=[],Re=!1;for(let Ie of Ae.properties){if(Ie.type==="SpreadElement"){let Ve=Ff(i,ve,Ie.argument,_e);if(Ve)Ne.push(...Ve);else Re=!0,n(i,"spread-unresolved",_e,`Context "${_e}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,Ie));continue}if(Ie.type!=="Property")continue;let Le=ve.getPropertyName(Ie.key);if(!Le)continue;let Me="any",$e,Be;if(a(Ie.value)){let Ve=Ie.value.name,Ue=ve.findVariableTypeAndDescription(Ve);if(Ue)Me=Ue.type,$e=Ue.description,Be=Ue.internal;else n(i,"context-any-type",Le,`Context "${_e}" property "${Le}" has no type annotation; defaulted to "any".`,t(i,Ie))}else if(Ie.value&&typeof Ie.value==="object"&&"type"in Ie.value&&(Ie.value.type==="ArrowFunctionExpression"||Ie.value.type==="FunctionExpression"))Me=`(${Ie.value.params?.map((Ge)=>{if(a(Ge))return`${Ge.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(f(Ie.value))Me=Ie.value.value==null?"null":typeof Ie.value.value;Ne.push({name:Le,type:Me,description:$e,optional:!1,...Be?{internal:!0}:{}})}return{properties:Ne,hasUnresolvedSpread:Re}}var jf=/[-_.:/\s]+/;function gn(i){return`${i.split(jf).map((_e)=>_e.charAt(0).toUpperCase()+_e.slice(1)).join("")}Context`}function xc(i,ve,Ae,_e){if(!Ae||typeof Ae!=="object"||!("type"in Ae))return null;if(Ae.type==="ObjectExpression"){if(!gr(Ae))return null;let{properties:Ne,hasUnresolvedSpread:Re}=Ec(i,ve,Ae,_e);return{key:_e,typeName:gn(_e),properties:Ne,description:void 0,...Re?{hasUnresolvedSpread:Re}:{}}}else if(a(Ae)){let Ne=Ae.name,Re=ve.findVariableTypeAndDescription(Ne);if(Re)return{key:_e,typeName:gn(_e),properties:[{name:Ne,type:Re.type,description:Re.description,optional:!1}],description:void 0,...Re.internal?{internal:!0}:{}};return n(i,"context-any-type",Ne,`Context "${_e}" variable "${Ne}" has no type annotation; defaulted to "any".`,t(i,Ae)),{key:_e,typeName:gn(_e),properties:[{name:Ne,type:"any",description:void 0,optional:!1}]}}return null}function bc(i){let ve=i.callee;if(!ve||typeof ve!=="object"||!("type"in ve))return null;let Ae=ve.type==="Identifier"&&ve.name==="Symbol",_e=ve.type==="MemberExpression"&&!ve.computed&&ve.object.type==="Identifier"&&ve.object.name==="Symbol"&&ve.property.type==="Identifier"&&ve.property.name==="for";if(!Ae&&!_e)return null;let Ne=i.arguments[0];if(!Ne||typeof Ne!=="object"||!("type"in Ne))return"";if(Ne.type==="Literal"&&typeof Ne.value==="string")return Ne.value;if(Ne.type==="TemplateLiteral"&&Ne.quasis?.length===1)return Ne.quasis[0].value.cooked??"";return""}function Cc(i,ve,Ae=0){if(!ve||typeof ve!=="object"||!("type"in ve))return{kind:"unresolved"};let _e=ve;if(_e.type==="Literal"||_e.type==="TemplateLiteral"){let Ne=Xn(_e);return Ne==null?{kind:"unresolved"}:{kind:"resolved",key:Ne}}if(_e.type==="CallExpression"||_e.type==="NewExpression"){let Ne=bc(_e);return Ne==null?{kind:"unresolved"}:{kind:"resolved",key:Ne}}if(_e.type==="Identifier"){if(Ae>=5)return{kind:"unresolved"};let Ne=mn(i,_e.name);if(Ne&&typeof Ne==="object"&&"type"in Ne){let Ie=Ne;if((Ie.type==="CallExpression"||Ie.type==="NewExpression")&&bc(Ie)==="")return{kind:"resolved",key:_e.name};return Cc(i,Ie,Ae+1)}let Re=i.valueImportBindingsByLocalName.get(_e.name);if(Re)return{kind:"pending",importSource:Re.source,importedName:Re.importedName};return{kind:"unresolved"}}return{kind:"unresolved"}}function ce(i,ve,Ae,_e){if(!Ae||typeof Ae!=="object"||!("type"in Ae)||Ae.type!=="CallExpression")return;let Ne=Ae,Re=Ne.arguments[0];if(!Re)return;let Ie=Cc(i,Re);if(Ie.kind==="unresolved"||Ie.kind==="resolved"&&!Ie.key){let Ve=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Could not resolve setContext key${Ve}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);return}let Le=Ne.arguments[1];if(!Le)return;let Me=t(i,Ae);if(Ie.kind==="pending"){let Ve=xc(i,ve,Le,"");if(Ve)i.pendingContextKeyCandidates.push({importSource:Ie.importSource,importedName:Ie.importedName,properties:Ve.properties,description:Ve.description,source:Me});return}let $e=Ie.key,Be=xc(i,ve,Le,$e);if(!Be)return;if(i.contexts.has($e)){n(i,"context-duplicate-key",$e,`setContext("${$e}", ...) was called more than once; only the first call's shape is used.`,Me);return}i.contexts.set($e,{...Be,source:Me})}function ue(i,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return;if(gr(ve))return Sc(i,ve);if(ve.type==="ArrayExpression")return Tc(i,ve);return}function vc(i,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return"any";if(a(ve))return i.findVariableTypeAndDescription(ve.name)?.type??"any";if(f(ve)){let Ae=ve.value;return Ae===null?"null":typeof Ae}if(gr(ve))return Sc(i,ve);if(ve.type==="ArrayExpression")return Tc(i,ve);return"any"}function Sc(i,ve){let Ae=[];for(let _e of ve.properties){if(_e.type!=="Property"||_e.computed)continue;let Ne=i.getPropertyName(_e.key);if(!Ne)continue;Ae.push({name:Ne,type:vc(i,_e.value)})}return Zn(Ae)}function Tc(i,ve){let Ae=new Set(ve.elements.filter((_e)=>_e!=null).map((_e)=>vc(i,_e)));if(Ae.size===0)return"any[]";if(Ae.size===1)return`${[...Ae][0]}[]`;return`(${[...Ae].join(" | ")})[]`}function X(i){return typeof i==="string"?JSON.stringify(i):String(i)}function g(i,{name:ve,detail:Ae,has_argument:_e,description:Ne,deprecated:Re,tags:Ie,internal:Le,source:Me}){if(ve===void 0)return;let $e=!_e&&!Ae?"null":u(Ae),Be=Ne,Ve=i.events.get(ve);if(Ve?.type==="forwarded")i.events.set(ve,{type:"dispatched",name:ve,detail:$e,description:Be||Ve.description,deprecated:Re??Ve.deprecated,tags:Ie??Ve.tags,...Le||Ve.internal?{internal:!0}:{},source:Me||Ve.source});else if(Ve){let Ue=Ve.tags??Ie;i.events.set(ve,{...Ve,detail:Ve.detail===void 0?$e:Ve.detail,description:Ve.description||Be,deprecated:Ve.deprecated??Re,tags:Ue,...Ve.internal||Le?{internal:!0}:{},source:Me||Ve.source})}else i.events.set(ve,{type:"dispatched",name:ve,detail:$e,description:Be,deprecated:Re,tags:Ie,...Le?{internal:!0}:{},source:Me})}function pe(i,ve){let Ae=ve.arguments[0],_e=Ci(Ae,"CustomEvent");if(!_e&&!Ci(Ae,"Event"))return;let Ne=Ae.arguments[0],Re=f(Ne)?Ne.value:void 0;if(Re==null)return;let Ie=_e?Ae.arguments[1]:void 0,Le=!1,Me;if(gr(Ie)){let $e=Ie.properties.find((Be)=>Be.type==="Property"&&a(Be.key)&&Be.key.name==="detail");if($e?.type==="Property")Le=!0,Me=f($e.value)?$e.value.value:void 0}return g(i,{name:String(Re),detail:Me==null?"":X(Me),has_argument:Le,source:t(i,ve)}),String(Re)}function Zn(i,ve,Ae=!1){if(i.length===0)return"null";let _e=i.map(({name:Ne,type:Re,description:Ie,optional:Le,default:Me})=>{let $e=Le?"?":"",Be=Ie||"";if(Me&&Be)Be=`${Be} @default ${Me}`;else if(Me)Be=`@default ${Me}`;if(Be){if(Ae)return`/** ${Be} */
20
- ${Ne}${$e}: ${Re};`;return`/** ${Be} */ ${Ne}${$e}: ${Re};`}return`${Ne}${$e}: ${Re};`}).join(Ae?`
21
- `:" ");return Ae?`{
22
- ${_e}
23
- }`:`{ ${_e} }`}var Vf=/[A-Za-z_$][\w$]*/g;function qf(i,ve){if(!ve)return!1;let Ae=new Set(ve[0].split(",").map((_e)=>_e.trim()));for(let[_e]of i.matchAll(Vf))if(Ae.has(_e))return!0;return!1}function Q(i,ve){if(ve===void 0)return;return i.runesPropsDeclarationMetadataByDeclaratorStart.get(ve)}function le(i,ve,Ae){return Q(i,ve)?.props.get(Ae)}function fe(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"right"in i&&i.right&&typeof i.right==="object"&&"name"in i.right&&typeof i.right.name==="string")return i.right.name;return}function Ac(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"left"in i&&i.left&&typeof i.left==="object")return Ac(i.left);return}function T(i,ve){let Ae=ve?.start,_e=ve?.end;if(Ae===void 0||_e===void 0)return;return r(i,Ae+1,_e)?.trim()}function de(i,ve){let Ae=ve?.start,_e=ve?.end;if(Ae===void 0||_e===void 0)return;return r(i,Ae,_e)?.trim()}function c(i,ve,Ae,_e,Ne=new Set){if(!ve?.type)return;switch(ve.type){case"TSInterfaceDeclaration":c(i,{type:"TSTypeLiteral",members:ve.body?.body},Ae,_e,Ne);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":c(i,ve.typeAnnotation,Ae,_e,Ne);return;case"TSIntersectionType":case"TSUnionType":for(let Re of ve.types??[])c(i,Re,Ae,_e,Ne);return;case"TSTypeLiteral":for(let Re of ve.members??[]){if(Re?.type!=="TSPropertySignature")continue;c(i,Re.typeAnnotation?.typeAnnotation,Ae,_e,Ne)}return;case"TSTypeReference":{let Re=Ac(ve.typeName);if(Re){if(i.typeImportBindingsByLocalName.has(Re)||i.valueImportBindingsByLocalName.has(Re))Ae.add(Re);let Ie=i.localTypeDeclarationsByName.get(Re);if(Ie&&!Ne.has(Re))_e.add(Re),Ne.add(Re),c(i,Ie.node,Ae,_e,Ne),Ne.delete(Re)}if("typeParameters"in ve&&ve.typeParameters&&typeof ve.typeParameters==="object"){let Ie=ve.typeParameters;for(let Le of Ie.params??[])c(i,Le,Ae,_e,Ne)}return}case"TSArrayType":case"TSRestType":case"TSOptionalType":case"TSIndexedAccessType":case"TSTypeOperator":case"TSExpressionWithTypeArguments":case"TSTupleType":case"TSConditionalType":case"TSInferType":case"TSMappedType":case"TSFunctionType":case"TSConstructorType":case"TSTypeQuery":case"TSImportType":case"TSLiteralType":case"TSTypePredicate":case"TSNamedTupleMember":break;default:break}for(let Re of Object.values(ve)){if(!Re||typeof Re!=="object")continue;if(Array.isArray(Re)){for(let Ie of Re){if(!Ie||typeof Ie!=="object"||!("type"in Ie))continue;c(i,Ie,Ae,_e,Ne)}continue}if("type"in Re)c(i,Re,Ae,_e,Ne)}}function Uf(i,ve){let Ae=new Map;for(let _e of Array.from(ve).sort()){let Ne=i.typeImportBindingsByLocalName.get(_e),Re=Ne?void 0:i.valueImportBindingsByLocalName.get(_e),Ie=Ne??(Re?{importedName:Re.importedName,localName:Re.localName,source:Re.source,specifierType:"named"}:void 0);if(!Ie)continue;let Le=Ae.get(Ie.source)??{default:[],named:[],namespace:[]};if(Ie.specifierType==="default")Le.default.push(Ie.localName);else if(Ie.specifierType==="namespace")Le.namespace.push(Ie.localName);else Le.named.push({imported:Ie.importedName,local:Ie.localName});Ae.set(Ie.source,Le)}return Array.from(Ae.entries()).sort(([_e],[Ne])=>_e.localeCompare(Ne)).map(([_e,Ne])=>{if(Ne.namespace.length>0)return Ne.namespace.map((Me)=>`import type * as ${Me} from "${_e}";`).join(`
24
- `);let Re=Ne.named.map(({imported:Me,local:$e})=>{if(!Me||Me===$e)return $e;return`${Me} as ${$e}`}),Ie=Ne.default[0],Le=Re.length>0?`{ ${Re.join(", ")} }`:"";if(Ie&&Le)return`import type ${Ie}, ${Le} from "${_e}";`;if(Ie)return`import type ${Ie} from "${_e}";`;return`import type ${Le} from "${_e}";`})}function A(i,ve){if(ve)i.additionalTypeDependencyNodes.push(ve)}function Gf(i){if(!i.const)return;let ve=i.id?.name;if(!ve)return;let Ae=[];for(let _e of i.members??[]){let Ne=_e.initializer;if(Ne?.type!=="Literal")return;let Re=Ne.value;if(typeof Re==="string")Ae.push(JSON.stringify(Re));else if(typeof Re==="number")Ae.push(String(Re));else return}if(Ae.length===0)return;return`type ${ve} = ${Ae.join(" | ")};`}function me(i,ve){let Ae=Gf(ve);if(Ae)return Ae;if(ve.start===void 0||ve.end===void 0)return;let _e=r(i,ve.start,ve.end)?.trim();return _e?`declare ${_e}`:void 0}function Y(i,ve){let Ae=!1,_e=[];for(let Re of ve.params??[]){if(Re.type==="RestElement"){let Ve=Re.argument?.name??"rest",Ue=T(i,Re.typeAnnotation);if(Ue)Ae=!0;A(i,Re.typeAnnotation?.typeAnnotation),_e.push(`...${Ve}: ${Ue??"any[]"}`);continue}let Ie=Re.type==="AssignmentPattern",Le=Ie?Re.left:Re,Me=Le?.name??"arg",$e=T(i,Le?.typeAnnotation);if($e)Ae=!0;A(i,Le?.typeAnnotation?.typeAnnotation);let Be=Ie||Re.optional===!0;_e.push(`${Me}${Be?"?":""}: ${$e??"any"}`)}let Ne=T(i,ve.returnType);if(Ne)Ae=!0;return A(i,ve.returnType?.typeAnnotation),{signature:`(${_e.join(", ")}) => ${Ne??"any"}`,hasAnnotations:Ae}}function he(i){let ve=i.pendingCallDefaultCandidates.length>0?i.pendingCallDefaultCandidates.slice():void 0,Ae=i.pendingContextKeyCandidates.length>0?i.pendingContextKeyCandidates.slice():void 0,_e={...ve?{pendingCallDefaultCandidates:ve}:{},...Ae?{pendingContextKeyCandidates:Ae}:{}},Ne=ve!==void 0||Ae!==void 0,Re=new Set,Ie=new Set;for(let Be of i.additionalTypeDependencyNodes)c(i,Be,Re,Ie);let Le=i.typedRunesPropsDeclarations.length===1?i.typedRunesPropsDeclarations[0]:void 0,Me=Le?.canonicalType;if(Le&&Me){for(let Be of Le.referencedImportedTypes)Re.add(Be);for(let Be of Le.referencedLocalTypes)Ie.add(Be)}if(!Me&&Re.size===0&&Ie.size===0)return Ne?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],..._e}:void 0;let $e=Array.from(Ie).map((Be)=>i.localTypeDeclarationsByName.get(Be)).filter((Be)=>Be!==void 0).sort((Be,Ve)=>Be.start-Ve.start).map((Be)=>Be.code);return{...Me?{canonicalPropsType:Me}:{},canonicalPropNames:Le&&Me?Array.from(Le.props.keys()).sort():[],localTypeDeclarations:$e,typeImportStatements:Uf(i,Re),referencesComponentGenerics:Me?qf(Me,i.generics):!1,..._e}}var Wf=/^[A-Za-z_$][\w$]*/,Hf=/[A-Za-z_$][\w$]*/g,kc=/^(?:const|in|out)\s+/;function cr(i){let ve=[],Ae=0,_e=0;for(let Ne=0;Ne<i.length;Ne++){let Re=i[Ne];if(Re==="<"||Re==="("||Re==="["||Re==="{")Ae++;else if(Re===">"||Re===")"||Re==="]"||Re==="}")Ae=Math.max(Ae-1,0);else if(Re===","&&Ae===0)ve.push(i.slice(_e,Ne)),_e=Ne+1}return ve.push(i.slice(_e)),ve}function ge(i){let ve=cr(i).map((_e)=>_e.trim()).filter((_e)=>_e.length>0);if(ve.length===0)return null;return[ve.map((_e)=>{let Ne=_e;while(kc.test(Ne))Ne=Ne.replace(kc,"");return Ne.match(Wf)?.[0]??_e}).join(", "),ve.join(", ")]}function ye(i,ve,Ae){let _e=i.scriptGenericsAttribute?.value;if(!_e)return;for(let[Ne]of _e.matchAll(Hf)){if(i.typeImportBindingsByLocalName.has(Ne))ve.add(Ne);if(Ae.has(Ne))continue;let Re=i.localTypeDeclarationsByName.get(Ne);if(!Re)continue;Ae.add(Ne),c(i,Re.node,ve,Ae)}}var Kf=null;function zf(i,ve,Ae){let _e={value:void 0,replace:!1};if(!Ae||typeof Ae!=="object"||!("type"in Ae))return _e;if(Ae.type==="Identifier")_e.value=Ae.name,_e.replace=!0;else if(Ae.type==="Literal")_e.value=String(Ae.value);else if(Ae.type==="MemberExpression")_e.value=j(i,ve,Ae);else if((Ae.type==="ObjectExpression"||Ae.type==="TemplateLiteral")&&"start"in Ae&&"end"in Ae&&typeof Ae.start==="number"&&typeof Ae.end==="number")_e.value=r(i,Ae.start,Ae.end);return _e}function Xf(i,ve,Ae){if(!a(Ae))return null;let _e=mn(i,Ae.name);if(gr(_e))return Z(i,ve,_e).slot_props;let Ne=ve.findVariableTypeAndDescription(Ae.name);if(!Ne)return null;let Re=Qn(Ne.type);if(!Re)return null;let Ie={};for(let Le of Re)Ie[Le.name]={value:Le.type,replace:!1};return Ie}function Z(i,ve,Ae){let _e={},Ne=!1;for(let Re of Ae.properties){if(Re.type==="SpreadElement"){let Le=Xf(i,ve,Re.argument);if(Le)Object.assign(_e,Le);else Ne=!0,n(i,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,Re));continue}if(Re.type!=="Property"||Re.computed)continue;let Ie=ve.getPropertyName(Re.key);if(!Ie)continue;_e[Ie]=zf(i,ve,Re.value)}return{slot_props:_e,hasUnresolvedSpread:Ne}}function Jf(i,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return null;if(ve.type==="Identifier"){let Re=ve,Ie=i.propLocalToPublicName.get(Re.name);if(!Ie)return null;return{publicName:Ie,trackingName:Re.name}}if(ve.type!=="MemberExpression")return null;let Ae=ve,_e=Ae.object&&typeof Ae.object==="object"&&"type"in Ae.object&&Ae.object.type==="Identifier"?Ae.object.name:void 0;if(!_e||!i.wholePropsLocals.has(_e))return null;let Ne;if(!Ae.computed&&Ae.property&&typeof Ae.property==="object"&&"type"in Ae.property){if(Ae.property.type==="Identifier")Ne=Ae.property.name;else if(Ae.property.type==="Literal"&&Ae.property.value!=null)Ne=String(Ae.property.value)}else if(Ae.computed&&Ae.property&&typeof Ae.property==="object"&&"type"in Ae.property&&Ae.property.type==="Literal"&&"value"in Ae.property&&Ae.property.value!=null)Ne=String(Ae.property.value);if(!Ne)return null;return{publicName:Ne,trackingName:Ne}}function xe(i,ve){let Ae=ve;if(Ae&&typeof Ae==="object"&&"type"in Ae&&Ae.type==="ChainExpression")Ae=Ae.expression;if(!Ae||typeof Ae!=="object"||!("type"in Ae)||Ae.type!=="CallExpression")return null;let _e=Ae;if(!_e.callee||typeof _e.callee!=="object"||!("type"in _e.callee))return null;let Ne=Jf(i,_e.callee);if(!Ne)return null;return{...Ne,arguments:_e.arguments}}function O(i,{slot_name:ve,slot_props:Ae,slot_props_unresolved_spread:_e,slot_fallback:Ne,slot_description:Re,slot_deprecated:Ie,slot_tags:Le,slot_internal:Me,source:$e}){let Be=ve===void 0||ve==="",Ve=Be?Kf:ve??"",Ue=u(Ne),Ge=Ae===void 0||Ae===""?void 0:Ae,Xe=Re?.trim()||void 0;if(i.slots.has(Ve)){let Je=i.slots.get(Ve);if(Je)i.slots.set(Ve,{...Je,default:Je.default??Be,fallback:Ue,slot_props:Je.slot_props===void 0?Ge:Je.slot_props,slot_props_unresolved_spread:Je.slot_props_unresolved_spread||_e,description:Je.description||Xe,deprecated:Je.deprecated??Ie,tags:Je.tags||Le,...Je.internal||Me?{internal:!0}:{},source:$e||Je.source})}else i.slots.set(Ve,{name:Ve,default:Be,fallback:Ue,slot_props:Ge,slot_props_unresolved_spread:_e,description:Xe,deprecated:Ie,tags:Le,...Me?{internal:!0}:{},source:$e})}var Ti=/^\s+/,Pc=/\s/,Yf=/^@[^\s/]+(?=\s|$)/,Qf=/^@(\S+)\s*/;function wc(i){let ve=0;while(ve<i.length){let Ae=i.charCodeAt(ve);if(Ae!==32&&Ae!==9&&Ae!==13&&Ae!==10&&!Pc.test(i[ve]))break;ve++}return ve}function Zf(i,ve){let Ae=i.slice(wc(i)),_e=!1;if(ve)Ae=Ae.slice(3),_e=!0;else if(Ae.startsWith("*")&&!Ae.startsWith("*/"))Ae=Ae.slice(1),_e=!0;let Ne=Ae.slice(0,wc(Ae));Ae=Ae.slice(Ne.length);let Re=Ae.trimEnd(),Ie=Re.endsWith("*/")?Re.slice(0,-2):Ae;return{indent:_e?Ne.slice(1):Ne,separator:Ne,content:Ie}}function ed(i,ve,Ae){let _e=Ae>ve&&i.charCodeAt(Ae-1)===13?Ae-1:Ae;return i.slice(ve,_e)}function td(i){let ve=[],Ae=0;while(!0){let _e=i.indexOf("/**",Ae);if(_e===-1)break;let Ne=i.lastIndexOf(`
25
- `,_e-1)+1;if(i.charCodeAt(_e+3)===42||i.slice(Ne,_e).trim()!==""){Ae=_e+1;continue}let Re=[],Ie=Ne,Le=!1;while(Ie<=i.length){let Me=i.indexOf(`
26
- `,Ie),$e=Me===-1?i.length:Me,Be=ed(i,Ie,$e),{indent:Ve,separator:Ue,content:Ge}=Zf(Be,Re.length===0);if(Re.push({raw:Be,start:Ie,number:Re.length,indent:Ve,separator:Ue,content:Ge}),Be.trimEnd().endsWith("*/")){Le=!0,Ae=$e;break}if(Me===-1)break;Ie=Me+1}if(!Le)break;ve.push({start:_e,lines:Re})}return ve}function rd(i){let ve=i;if(ve.length>0&&ve[0].content==="")ve=ve.slice(1);if(ve.length>0&&ve[ve.length-1].content==="")ve=ve.slice(0,-1);return ve}function nd(i){let ve=[[]],Ae=!1;for(let _e of i){if(Yf.test(_e.content)&&!Ae)ve.push([_e]);else ve[ve.length-1].push(_e);if(sd(_e.content,"```")%2===1)Ae=!Ae}return ve}function sd(i,ve){let Ae=0,_e=i.indexOf(ve);while(_e!==-1)Ae++,_e=i.indexOf(ve,_e+ve.length);return Ae}function _c(i){return i.map((ve)=>ve.indent+ve.content).join(`
27
- `)}function id(i,ve){let Ae=ve;while(Ae<i.length-1&&i[Ae].content.trim()==="")Ae++;if(i[Ae].content[0]!=="{")return null;let _e=0,Ne=[],Re=Ae;for(;Re<i.length;Re++){let Me=i[Re].content,$e=0;for(let Be of Me){if(Be==="{")_e++;else if(Be==="}")_e--;if($e++,_e===0)break}if(Ne.push($e),_e===0)break}if(_e!==0)return null;let Ie=Re;return{type:Ne.map((Me,$e)=>{let Be=Ae+$e,Ve=i[Be].content.slice(0,Me);return i[Be].content=i[Be].content.slice(Me).replace(Ti,""),$e===0?Ve:i[Be].indent+Ve}).join(`
28
- `).slice(1,-1),endIndex:Ie}}function ad(i){let ve=i.content.match(Ti)?.[0]??"",Ae=i.content.slice(ve.length),_e=0,Ne=0;for(let $e of Ae){if(_e===0&&Pc.test($e))break;if($e==="[")_e++;if($e==="]")_e--;Ne++}let Re=_e===0?Ae.slice(0,Ne):"";if(!Re)return null;let Ie=Re,Le=!1,Me;if(Re.startsWith("[")&&Re.endsWith("]")){Le=!0;let Be=Re.slice(1,-1).split("=");if(Ie=Be[0].trim(),Be.length>1)Me=Be.slice(1).join("=").trim();if(!Ie)return null}if(Ie.length>1&&(Ie[0]==='"'||Ie[0]==="'")&&Ie[Ie.length-1]===Ie[0])Ie=Ie.slice(1,-1);return i.content=Ae.slice(Ne).replace(Ti,""),{name:Ie,optional:Le,default:Me}}function od(i){let ve=i[0],Ae=ve.content.match(Qf),_e=Ae?Ae[1]:"",Ne=Ae?ve.content.slice(Ae[0].length):ve.content,Re=Ne.trimEnd(),Ie=i.slice(1).map((Ge)=>Ge.separator+Ge.content),Le=(Re?[Re,...Ie]:Ie).join(`
29
- `);ve.content=Ne,ve.tag=_e;let Me=id(i,0),$e=Me?.type??"",Be=0;if(Me){Be=Me.endIndex;while(Be<i.length-1&&i[Be].content.trim()==="")Be++}let Ve=ad(i[Be]),Ue=_c(i.slice(Me?Me.endIndex:0));return{tag:_e,name:Ve?.name??"",type:$e,optional:Ve?.optional??!1,default:Ve?.default,description:Ue,raw:Le,lines:i}}function cd(i,ve){let Ae=rd(i);Ae.forEach((Re,Ie)=>{Re.number=Ie});let _e=nd(Ae),Ne=_e.slice(1).map(od);return{description:_c(_e[0]),tags:Ne,start:ve,lines:Ae}}function E(i){return td(i).map(({start:ve,lines:Ae})=>cd(Ae,ve))}var ld=/\s*=\s*/;function Nc(i){let ve=i.indexOf("<");if(ve===-1||!i.endsWith(">"))return i;let Ae=i.slice(0,ve),_e=i.slice(ve+1,-1),Ne=cr(_e).map((Re)=>Re.trim().replace(ld," = ")).join(", ");return`${Ae}<${Ne}>`}var K=/^\s*$/,pd=/;$/,ud=/^-\s*/;function yr(i){if(i===void 0)return;let ve=i.replace(ud,"").trim();return ve===""?"":ve}function Br(i){if(!i||i.length===0)return;return i[0].content}var Ic=new Set(["since","example","see"]),hd=new Set(["bindable","default","required"]);function fd(i){let ve=i.trim();return ve===""?!0:ve}function Dc(i,ve){return fd(`${i??""}${ve?` ${ve}`:""}`)}function dd(i){let ve=i.trim().replace(pd,"").trimEnd();if(!ve.startsWith("{")||!ve.endsWith("}"))return!1;let Ae=0,_e=null;for(let Ne=0;Ne<ve.length;Ne++){let Re=ve[Ne];if(_e!==null){if(Re==="\\"){Ne++;continue}if(Re===_e)_e=null;continue}if(Re==='"'||Re==="'"||Re==="`"){_e=Re;continue}if(Re==="{"||Re==="["||Re==="(")Ae++;else if(Re==="}"||Re==="]"||Re===")"){if(Ae--,Ae===0&&Ne<ve.length-1)return!1}}return Ae===0}function Ai(i){let ve=i;if(!ve.startsWith("/*"))ve=`/*${ve}`;if(!ve.endsWith("*/"))ve+="*/";return ve}function md(i){if(i==="*")return"any";return i.trim()}function Rc(i){let ve=E(Ai(i)),{returns:Ae}=M(ve);return Ae?md(Ae.type):void 0}function Lc(i){let ve=E(Ai(i)),{deprecated:Ae,passthrough:_e,internal:Ne}=M(ve),Re=_e.length>0?_e.map((Ie)=>({name:Ie.tag,body:Ie.raw})):void 0;return{deprecated:Ae,tags:Re,internal:Ne}}function M(i){let ve=i[0]?.tags??[],Ae=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]),_e,Ne=[],Re,Ie,Le,Me=!1,$e=[],Be=[],Ve=[];for(let Ue of ve)if(Ue.tag==="type")_e=Ue;else if(Ue.tag==="param")Ne.push(Ue);else if(Ue.tag==="returns"||Ue.tag==="return")Re=Ue;else if(Ue.tag==="deprecated")Le??=Dc(Ue.name,Ue.description);else if(Ue.tag==="ignore"||Ue.tag==="internal")Me=!0;else if(Ue.tag==="sveld-ignore")Ve.push(Ue.name);else if(Ic.has(Ue.tag))Be.push(Ue);else if(Ue.tag==="bindable"){if(Ue.type)continue;let Ge=`${Ue.name}${Ue.description?` ${Ue.description}`:""}`.trim();if(Ge==="readonly"||Ge==="writable")Ie??=Ge}else if(!Ae.has(Ue.tag))$e.push(Ue);return{type:_e,param:Ne,returns:Re,binding:Ie,deprecated:Le,internal:Me,additional:$e,passthrough:Be,ignore:Ve,description:i[0]?.description}}function gd(i){if(!i||i.length===0)return;let ve=i[i.length-1];return ve&&typeof ve==="object"&&"value"in ve?ve:void 0}function yd(i,ve,Ae){if(!ve||ve.length===0||Ae===void 0||!i.source)return;for(let _e=ve.length-1;_e>=0;_e--){let Ne=ve[_e];if(!Ne||typeof Ne!=="object"||!("value"in Ne)||!("end"in Ne))continue;if(typeof Ne.end!=="number")continue;let Re=i.source.slice(Ne.end,Ae);if(K.test(Re))return Ne}return}function y(i,ve,Ae){if(!Ae?.leadingComments)return;let _e=yd(i,Ae.leadingComments,Ae.start);if(!_e)return;return xd(ve,[_e])}function Te(i,ve,Ae){if(!Ae?.leadingComments)return;return y(i,ve,Ae)}function xd(i,ve){if(!ve)return;let Ae=gd(ve);if(!Ae)return;let _e=E(Ai(Ae.value)),{type:Ne,param:Re,returns:Ie,binding:Le,deprecated:Me,internal:$e,additional:Be,passthrough:Ve,ignore:Ue,description:Ge}=M(_e),Xe,Je,Ke,et;if(Ne)Xe=i.aliasType(Ne.type);if(Re.length>0)Je=Re.filter((at)=>!at.name.includes(".")).map((at)=>({name:at.name,type:i.aliasType(at.type),description:yr(at.description),optional:at.optional||!1}));if(Ie)Ke=i.aliasType(Ie.type);let ot=u(Ge?.trim());if(ot||Be.length>0){let at=[];if(ot)at.push(ot);for(let tt of Be){let xt=`@${tt.tag}${tt.name?` ${tt.name}`:""}${tt.description?` ${tt.description}`:""}`;at.push(xt)}et=at.join(`
30
- `)}let it=Ve.length>0?Ve.map((at)=>({name:at.tag,body:at.raw})):void 0;return{type:Xe,params:Je,returnType:Ke,description:et,binding:Le,deprecated:Me,tags:it,sveldIgnore:Ue.length>0?Ue:void 0,internal:$e}}function Ee(i,ve,Ae=i.source){if(!Ae)return;let _e=!1,Ne=!1,Re=!1,Ie=new Set,Le=()=>{if(_e&&Ne&&!Re){Re=!0;let Ue=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${Ue}; their declarations are combined in the order encountered.`)}},Me=(Ue,Ge)=>{if(Ie.has(Ue))n(i,"generics-conflict",Ue,`Duplicate generic name "${Ue}".`,Ge);else Ie.add(Ue)},$e=(Ue,Ge)=>{if(i.generics){let Je=cr(i.generics[0]).map((Ke)=>Ke.trim()).indexOf(Ue.trim());if(Je!==-1){let Ke=cr(i.generics[1]).map((et)=>et.trim());Ke[Je]=Ge,i.generics=[i.generics[0],Ke.join(", ")];return}}ve.accumulateGeneric(Ue,Ge)},Be=(Ue,Ge)=>{if(i.typedefs.has(Ue))n(i,"typedef-duplicate",Ue,`Duplicate typedef/callback name "${Ue}"; the later declaration overwrites the earlier one.`,Ge)},Ve=(Ue,Ge,Xe,Je)=>{let Ke=Ue.findIndex((et)=>et.name===Ge.name);if(Ke===-1)Ue.push(Ge);else{let et=Xe?` of "${Xe}"`:"";n(i,"property-duplicate",Ge.name,`Duplicate property "${Ge.name}"${et}; the later declaration overwrites the earlier one.`,Je),Ue[Ke]=Ge}};for(let{tags:Ue,description:Ge,lines:Xe}of E(Ae)){let Je,Ke,et,ot,it=!1,at,tt,xt=[],Nt=[],Tt=[],De,Oe,Fe,qe,We=[],He=!1,ze=[],Ze,Qe,Ye,lt=[],bt=!1,gt=[],Ut,Lt,_t=!1,vt=!0,Et=[],Bt,Ir=!1,Pn=new Map,da=new Set,Ms=new Set;for(let ct of Ue)if(ct.lines.length>0)da.add(ct.lines[0].number);for(let ct of Xe)if(!ct.tag&&ct.content&&ct.content.trim()!=="}")Pn.set(ct.number,ct.content);let Np=(ct)=>{if(!ct||ct.length===0)return;let Gt=ct[0].number,ut=[],Xt=[],hr=!1;for(let Ct=Gt-1;Ct>=0;Ct--){if(da.has(Ct))break;let Jt=Pn.get(Ct);if(Jt)ut.unshift(Jt),Xt.unshift(Ct),hr=!0;else if(hr){let St=Xe[Ct];if(!(!St||!St.tag&&(!St.content||St.content.trim()==="")))break}}if(ut.length===0)return;for(let Ct of Xt)Ms.add(Ct);return ut.join(`
31
- `).trim()},ma=()=>{if(Je!==void 0){let ct=Ke&&Ke!=="object"&&Ke!=="Object"?Ke:void 0,Gt;if(ct)Gt=ct;else if(Tt.length>0)Gt=Zn(Tt,Je,!0);else Gt=Ke||"";if(tt!==void 0){let ut;for(let Ct of Ue){let Jt=Ct.lines[0]?.number;if(typeof Jt!=="number")continue;if(Jt<=tt)continue;if(Ct.tag==="property"||Ct.tag==="type")continue;ut=Jt;break}let Xt=[],hr=Array.from(Pn.keys()).sort((Ct,Jt)=>Ct-Jt);for(let Ct of hr){if(Ct<=tt)continue;if(ut!==void 0&&Ct>=ut)continue;if(Ms.has(Ct))continue;let St=Pn.get(Ct)?.trim();if(St)Xt.push(St),Ms.add(Ct)}if(Xt.length>0){let Ct=Xt.join(`
32
- `);et=et?`${et}
33
- ${Ct}`:Ct}}g(i,{name:Je,detail:Gt,has_argument:!1,description:et,deprecated:ot,tags:xt.length>0?xt:void 0,internal:it||void 0,source:at}),i.eventDescriptions.set(Je,et),i.jsDocEventNames.add(Je),i.jsDocEventSources.set(Je,at),m(i,"event-no-source",Je,Nt),Tt.length=0,Je=void 0,Ke=void 0,et=void 0,ot=void 0,it=!1,at=void 0,tt=void 0,xt=[],Nt=[]}},ga=()=>{if(De!==void 0){let ct,Gt;if(ze.length>0)ct=Zn(ze,void 0,!0),Gt=`type ${De} = ${ct};`;else if(Oe)ct=Oe,Gt=dd(ct)?`interface ${De} ${ct}`:`type ${De} = ${ct};`;else ct="{}",Gt=`type ${De} = ${ct};`;Be(De,qe),i.typedefs.set(De,{type:ct,name:De,description:u(Fe),ts:Gt,tags:We.length>0?We:void 0,...He?{internal:!0}:{},source:qe}),ze.length=0,De=void 0,Oe=void 0,Fe=void 0,qe=void 0,We=[],He=!1}},ya=()=>{if(Ze!==void 0){let ut=`(${gt.map(({name:hr,type:Ct,optional:Jt})=>`${hr}${Jt?"?":""}: ${Ct}`).join(", ")}) => ${Ut||"void"}`,Xt=`type ${Ze} = ${ut};`;Be(Ze,Ye),i.typedefs.set(Ze,{type:ut,name:Ze,description:u(Qe),ts:Xt,tags:lt.length>0?lt:void 0,...bt?{internal:!0}:{},source:Ye}),gt.length=0,Ut=void 0,Ze=void 0,Qe=void 0,Ye=void 0,lt=[],bt=!1}},Ip=Ue.some((ct)=>ct.tag==="slot"||ct.tag==="snippet"),Dp=Ue.some((ct)=>ct.tag==="extends"||ct.tag==="extendProps"),Rp=Ue.some((ct)=>ct.tag==="slot"||ct.tag==="snippet"||ct.tag==="event"||ct.tag==="typedef"||ct.tag==="callback");for(let{tag:ct,type:Gt,name:ut,description:Xt,optional:hr,default:Ct,raw:Jt,lines:St}of Ue){let $t=ve.aliasType(Gt),nn=Np(St);switch(ct){case"extends":case"extendProps":if(i.extends!==void 0)n(i,"extend-props-duplicate",ut,`A second @extends/@extendProps tag ("${ut}") overwrote the first ("${i.extends.interface}"); only one is used.`,sr(i,St));if(i.extends={interface:ut,import:$t},vt)vt=!1;break;case"restProps":{let At=ut?Xt?`${ut} ${Xt}`:ut:Xt,vr=yr(At)||nn;if(!vr&&vt&&!_t&&Ge)vr=Ge,_t=!0;if(i.rest_props={type:"Element",name:$t,description:vr||void 0},vt)vt=!1;break}case"slot":case"snippet":{let Wt=yr(Br(St));if(!Wt&&vt&&!_t&&Ge)Wt=Ge,_t=!0;if(!Wt&&Et.length===0)Wt=nn;if(vt)vt=!1;let vr=$t;if(!vr)vr="Record<string, never>",n(i,"slot-missing-type",ut||"default",`@${ct}${ut?` "${ut}"`:""} is missing a required {Type} annotation; falling back to "${vr}".`,sr(i,St));O(i,{slot_name:ut,slot_props:vr,slot_description:Wt||void 0,slot_deprecated:Bt,slot_tags:Et.length>0?[...Et]:void 0,slot_internal:Ir||void 0,source:sr(i,St)}),Et.length=0,Bt=void 0,Ir=!1;{let Lp=ut===void 0||ut===""?null:ut;Lt=(Op)=>{let Bs=i.slots.get(Lp);if(Bs)Bs.tags=[...Bs.tags??[],Op]}}break}case"csspart":{let At=yr(Br(St));i.cssParts.push({name:ut,...At?{description:At}:{}});break}case"cssprop":case"cssproperty":{let At=yr(Br(St));i.cssProperties.push({name:ut,...$t?{type:$t}:{},...Ct===void 0?{}:{default:Ct},...At?{description:At}:{}});break}case"event":{if(ma(),Je=ut,Ke=$t,tt=St.length>0?St[0].number:void 0,et=yr(Br(St))||nn,!et&&vt&&!_t&&Ge)et=Ge,_t=!0;if(at=sr(i,St),Et.length>0)xt.push(...Et),Et.length=0;if(Lt=(Wt)=>xt.push(Wt),vt)vt=!1;break}case"type":if(Je!==void 0)Ke=$t;break;case"param":if(Ze!==void 0)gt.push({name:ut,type:$t,optional:hr||!1});break;case"returns":case"return":if(Ze!==void 0)Ut=$t;break;case"property":{let At={name:ut,type:$t,description:yr(Br(St)),optional:hr||!1,default:Ct};if(Je!==void 0)Ve(Tt,At,Je,sr(i,St));else if(De!==void 0)Ve(ze,At,De,sr(i,St));break}case"typedef":{if(ga(),De=Nc(ut),Oe=$t,qe=sr(i,St),Fe=yr(Br(St))||nn,!Fe&&vt&&!_t&&Ge)Fe=Ge,_t=!0;if(Et.length>0)We.push(...Et),Et.length=0;if(He=Ir,Ir=!1,Lt=(Wt)=>We.push(Wt),vt)vt=!1;break}case"callback":{if(ya(),Ze=Nc(ut),Ye=sr(i,St),Qe=yr(Br(St))||nn,!Qe&&vt&&!_t&&Ge)Qe=Ge,_t=!0;if(Et.length>0)lt.push(...Et),Et.length=0;if(bt=Ir,Ir=!1,Lt=(Wt)=>lt.push(Wt),vt)vt=!1;break}case"generics":{let At=$t||ut;for(let Wt of cr(ut))Me(Wt.trim(),sr(i,St));if(_e=!0,Le(),$e(ut,At),vt)vt=!1;break}case"template":{let At=ut;if($t)At=`${ut} extends ${$t}`;if(Ct)At+=` = ${Ct}`;if(Ip&&!Dp){i.deferredSlotBlockGenerics.push({name:ut,constraint:At});break}if(Me(ut,sr(i,St)),Ne=!0,Le(),$e(ut,At),vt)vt=!1;break}case"deprecated":{let At=Dc(ut,Xt);if(Je===void 0)Bt??=At;else ot??=At;break}case"ignore":case"internal":{if(Je===void 0)Ir=!0;else it=!0;break}case"sveld-ignore":if(Je!==void 0)Nt.push(ut);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let At={name:ct,body:Jt};if(!Ic.has(ct)&&!hd.has(ct))n(i,"jsdoc-unknown-tag",ct,`Unknown JSDoc tag "@${ct}"; passed through unchanged. If this is a typo, fix the tag name.`,sr(i,St));if(Lt)Lt(At);else Et.push(At)}break}}if(ma(),ga(),ya(),Rp&&Et.length>0){for(let ct of Et)n(i,"jsdoc-tag-dropped",ct.name,`@${ct.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);Et.length=0}}}import Oc,{sep as Mc}from"node:path";var Pr=/\.svelte$/,Bc=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function e(i){return Mc==="/"?i:i.split(Mc).join("/")}function es(i,ve){return e(Oc.join(ve,Oc.normalize(i)))}function $r(i){return`${JSON.stringify(i,null,2)}
34
- `}var $c="sveld",ts="0.37.0";var Fc={name:$c,version:ts,license:"Apache-2.0",description:"Generate TypeScript definitions and component documentation for your Svelte components.",type:"module",main:"./lib/index.js",types:"./lib/index.d.ts",exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./browser":{types:"./lib/browser.d.ts",import:"./lib/browser.js",default:"./lib/browser.js"},"./schema/component-api.schema.json":"./schema/component-api.schema.json"},scripts:{test:"bun test --parallel","test:fixtures-types":"tsc --project tsconfig.fixtures.json","test:e2e":"bun tests/test-e2e.ts",format:"biome format --write .",lint:"biome lint .","lint:fix":"biome check --write --unsafe .","lint:fix:changed":"biome check --write --unsafe --changed --no-errors-on-unmatched",build:"bun scripts/build.ts",bench:"bun scripts/bench.ts","bench:cache":"bun scripts/bench.ts --cache","bench:ostia":"ostia bench scripts/bench-ostia.ts",fuzz:"bun scripts/fuzz-parser.ts",typecheck:"tsc --noEmit"},devDependencies:{"@biomejs/biome":"2.5.13","@sveltejs/acorn-typescript":"1.0.13","@types/bun":"^1.4.2","@types/jest":"^30.0.0","@typescript/typescript6":"^6.0.2",acorn:"^8.18.0",ajv:"^8.20.0",culls:"^0.2.0","custom-elements-manifest":"^2.1.0","estree-walker":"^3.0.3",ostia:"0.2.4",svelte:"^5.57.0",typescript:"^7.0.2",zimmerframe:"1.1.5"},bin:{sveld:"cli.js"},files:["lib","cli.js","schema"],repository:{type:"git",url:"git+https://github.com/carbon-design-system/sveld.git"},homepage:"https://github.com/carbon-design-system/sveld",bugs:"https://github.com/carbon-design-system/sveld/issues",keywords:["svelte","svelte component","documentation","docgen","typescript","definitions","JSDocs","vite","vite-plugin"],maintainers:["Eric Liu (https://github.com/metonym)"]};var yn="5.57.0";var rs=1,jc=new WeakMap;function _r(i){return i.some((ve)=>ve.internal)?i.filter((ve)=>!ve.internal):i}function Ed(i){return{...i,props:_r(i.props),moduleExports:_r(i.moduleExports),slots:_r(i.slots),events:_r(i.events),typedefs:_r(i.typedefs),...i.contexts?{contexts:_r(i.contexts).map((ve)=>({...ve,properties:_r(ve.properties)}))}:{}}}function s(i,ve={}){let Ae=jc.get(i),_e=Ae?.get(ve.entryExports);if(_e)return _e;let Ne=Array.from(i,([,Le])=>{let{diagnostics:Me,...$e}=Le;return Ed($e)}).sort((Le,Me)=>Le.moduleName.localeCompare(Me.moduleName)),Re={schemaVersion:rs,generator:{name:$c,version:ts,svelteVersion:yn},total:Ne.length,components:Ne},Ie=ve.entryExports?_r(ve.entryExports):void 0;if(Ie&&Ie.length>0)Re.totalExports=Ie.length,Re.exports=Ie;if(!Ae)Ae=new Map,jc.set(i,Ae);return Ae.set(ve.entryExports,Re),Re}import{readFile as Cd}from"node:fs/promises";import vd from"node:path";var Sd=/[:=]/,ns={none:0,patch:1,minor:2,major:3};function Td(i,ve){return ns[ve]>ns[i]?ve:i}function Ad(i){return i.reduce((ve,Ae)=>Td(ve,Ae.bump),"none")}function is(i,ve){return ns[i]>=ns[ve]}function Hc(i,ve){let Ae=[],_e=0,Ne="",Re=null;for(let Ie=0;Ie<i.length;Ie++){let Le=i[Ie];if(Re){if(Ne+=Le,Le==="\\")Ie++,Ne+=i[Ie]??"";else if(Le===Re)Re=null;continue}if(Le==='"'||Le==="'"||Le==="`"){Re=Le,Ne+=Le;continue}if(Le==="<"||Le==="("||Le==="{"||Le==="[")_e++;if(Le===">"||Le===")"||Le==="}"||Le==="]")_e--;if(Le===ve&&_e===0){Ae.push(Ne.trim()),Ne="";continue}Ne+=Le}return Ae.push(Ne.trim()),Ae}function Vc(i){return new Set(Hc(i,"|").filter((ve)=>ve.length>0))}function kd(i){let ve=0,Ae=null;for(let _e=0;_e<i.length;_e++){let Ne=i[_e];if(Ae){if(Ne==="\\")_e++;else if(Ne===Ae)Ae=null;continue}if(Ne==='"'||Ne==="'"||Ne==="`"){Ae=Ne;continue}if(Ne==="<"||Ne==="("||Ne==="{"||Ne==="[")ve++;if(Ne===">"||Ne===")"||Ne==="}"||Ne==="]")ve--;if(ve===0&&Ne==="="&&i[_e+1]===">")return _e}return-1}function qc(i){let ve=kd(i);if(ve===-1)return;let Ae=i.slice(0,ve).trim(),_e=i.slice(ve+2).trim();if(!Ae.startsWith("(")||!Ae.endsWith(")"))return;let Ne=Ae.slice(1,-1).trim();return{params:Ne.length===0?[]:Hc(Ne,","),returnType:_e}}function wd(i){return(i.split(Sd,1)[0]??"").trimEnd().endsWith("?")}function Pd(i,ve){if(i.returnType!==ve.returnType)return"major";if(ve.params.length<i.params.length)return"major";for(let _e=0;_e<i.params.length;_e++)if(i.params[_e]!==ve.params[_e])return"major";if(ve.params.length===i.params.length)return"none";return ve.params.slice(i.params.length).every(wd)?"minor":"major"}function wi(i,ve){if(i===ve)return"none";if(i===void 0||ve===void 0)return"major";let Ae=qc(i),_e=qc(ve);if(Ae&&_e)return Pd(Ae,_e);let Ne=Vc(i),Re=Vc(ve),Ie=[...Re].some((Me)=>!Ne.has(Me)),Le=[...Ne].some((Me)=>!Re.has(Me));if(!Ie&&!Le)return"none";if(Ie&&!Le)return"minor";if(Le&&!Ie)return"major";return"major"}function Uc(i){return i.bindable===!0||i.binding==="writable"}function Gc(i,ve,Ae,_e){let Ne=ve==="prop"?"prop":"export",Re=[],Ie=new Map(Ae.map((Me)=>[Me.name,Me])),Le=new Map(_e.map((Me)=>[Me.name,Me]));for(let[Me,$e]of Le){if(Ie.has(Me))continue;Re.push({component:i,kind:ve,name:Me,bump:$e.isRequired?"major":"minor",message:`${Ne} "${Me}" added${$e.isRequired?" (required)":""}`})}for(let[Me]of Ie){if(Le.has(Me))continue;Re.push({component:i,kind:ve,name:Me,bump:"major",message:`${Ne} "${Me}" removed`})}for(let[Me,$e]of Ie){let Be=Le.get(Me);if(!Be)continue;if($e.isRequired!==Be.isRequired)Re.push({component:i,kind:ve,name:Me,bump:Be.isRequired?"major":"minor",message:`${Ne} "${Me}" became ${Be.isRequired?"required":"optional"}`});let Ve=wi($e.type,Be.type);if(Ve!=="none")Re.push({component:i,kind:ve,name:Me,bump:Ve,message:`${Ne} "${Me}" type changed from \`${$e.type??"unknown"}\` to \`${Be.type??"unknown"}\``});let Ue=Uc($e),Ge=Uc(Be);if(Ue!==Ge)Re.push({component:i,kind:ve,name:Me,bump:Ge?"minor":"major",message:`${Ne} "${Me}" ${Ge?"gained a writable binding":"lost its writable binding"}`});if($e.value!==Be.value&&Ve==="none")Re.push({component:i,kind:ve,name:Me,bump:"patch",message:`${Ne} "${Me}" default changed from \`${$e.value??"none"}\` to \`${Be.value??"none"}\``});let Xe=$e.deprecated!==void 0,Je=Be.deprecated!==void 0;if(Xe!==Je)Re.push({component:i,kind:ve,name:Me,bump:Je?"minor":"patch",message:`${Ne} "${Me}" ${Je?"marked as deprecated":"no longer deprecated"}`});if($e.constant!==Be.constant)Re.push({component:i,kind:ve,name:Me,bump:"minor",message:`${Ne} "${Me}" ${Be.constant?"became constant":"became mutable"}`});if($e.reactive!==Be.reactive)Re.push({component:i,kind:ve,name:Me,bump:"minor",message:`${Ne} "${Me}" ${Be.reactive?"became reactive":"stopped being reactive"}`})}return Re}function _d(i,ve,Ae){let _e=[],Ne=new Map(ve.map((Ie)=>[Ie.name,Ie])),Re=new Map(Ae.map((Ie)=>[Ie.name,Ie]));for(let[Ie]of Re){if(Ne.has(Ie))continue;_e.push({component:i,kind:"event",name:Ie,bump:"minor",message:`event "${Ie}" added`})}for(let[Ie]of Ne){if(Re.has(Ie))continue;_e.push({component:i,kind:"event",name:Ie,bump:"major",message:`event "${Ie}" removed`})}for(let[Ie,Le]of Ne){let Me=Re.get(Ie);if(!Me)continue;if(Le.type!==Me.type){_e.push({component:i,kind:"event",name:Ie,bump:"major",message:`event "${Ie}" changed from ${Le.type} to ${Me.type}`});continue}let $e=Le.type==="dispatched"?Le.detail:void 0,Be=Me.type==="dispatched"?Me.detail:void 0,Ve=wi($e,Be);if(Ve!=="none")_e.push({component:i,kind:"event",name:Ie,bump:Ve,message:`event "${Ie}" detail changed from \`${$e??"unknown"}\` to \`${Be??"unknown"}\``})}return _e}function Wc(i){return i.name??"default"}function Nd(i,ve,Ae){let _e=[],Ne=new Map(ve.map((Ie)=>[Wc(Ie),Ie])),Re=new Map(Ae.map((Ie)=>[Wc(Ie),Ie]));for(let[Ie]of Re){if(Ne.has(Ie))continue;_e.push({component:i,kind:"slot",name:Ie,bump:"minor",message:`slot "${Ie}" added`})}for(let[Ie]of Ne){if(Re.has(Ie))continue;_e.push({component:i,kind:"slot",name:Ie,bump:"major",message:`slot "${Ie}" removed`})}for(let[Ie,Le]of Ne){let Me=Re.get(Ie);if(!Me)continue;let $e=wi(Le.slot_props,Me.slot_props);if($e!=="none")_e.push({component:i,kind:"slot",name:Ie,bump:$e,message:`slot "${Ie}" props changed from \`${Le.slot_props??"none"}\` to \`${Me.slot_props??"none"}\``})}return _e}var Id=new Set(["description","source","componentCommentSource","tags"]);function ss(i){if(Array.isArray(i))return i.map(ss);if(i!==null&&typeof i==="object"){let ve={};for(let[Ae,_e]of Object.entries(i)){if(Id.has(Ae))continue;ve[Ae]=ss(_e)}return ve}return i}var Dd=["generics","rest_props","extends","contexts","typedefs"];function Rd(i,ve,Ae){let _e=[];for(let Ne of Dd){let Re=JSON.stringify(ss(ve[Ne])),Ie=JSON.stringify(ss(Ae[Ne]));if(Re!==Ie)_e.push({component:i,kind:"shape",name:Ne,bump:"major",message:`"${Ne}" changed (breaking)`})}return _e}function Ld(i,ve){let Ae=ve.moduleName;return[...Gc(Ae,"prop",i.props,ve.props),...Gc(Ae,"moduleExport",i.moduleExports,ve.moduleExports),..._d(Ae,i.events,ve.events),...Nd(Ae,i.slots,ve.slots),...Rd(Ae,i,ve)]}function Se(i,ve){let Ae=[],_e=new Map(i.components.map((Re)=>[Re.moduleName,Re])),Ne=new Map(ve.components.map((Re)=>[Re.moduleName,Re]));for(let[Re]of Ne){if(_e.has(Re))continue;Ae.push({component:Re,kind:"component",bump:"minor",message:`component "${Re}" added`})}for(let[Re]of _e){if(Ne.has(Re))continue;Ae.push({component:Re,kind:"component",bump:"major",message:`component "${Re}" removed`})}for(let[Re,Ie]of _e){let Le=Ne.get(Re);if(!Le)continue;Ae.push(...Ld(Ie,Le))}return Ae}async function Od(i){let ve;try{ve=await Cd(vd.resolve(i),"utf-8")}catch(Ae){if(Ae.code==="ENOENT")return null;throw Ae}try{return JSON.parse(ve)}catch{throw Error(`sveld: could not parse "${i}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function W(i){if(typeof i.check==="string")return i.check;return i.jsonOptions?.outFile??"COMPONENT_API.json"}async function B(i,ve,Ae={}){let _e=await Od(ve);if(_e===null)return{snapshotExists:!1,snapshotFile:ve,changes:[],bump:"none"};if(_e.schemaVersion!==rs)return{snapshotExists:!0,snapshotFile:ve,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${_e.schemaVersion} differs from ${rs}; regenerate the snapshot`}],bump:"none"};let Ne=s(i,{entryExports:Ae.entryExports}),Re=Se(_e,Ne);return{snapshotExists:!0,snapshotFile:ve,changes:Re,bump:Ad(Re)}}var Md={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function ee(i){if(!i.snapshotExists)return`sveld --check: no snapshot found at "${i.snapshotFile}". Run \`sveld --json\` and commit the output first.`;if(i.changes.length===0)return`sveld --check: no API changes detected against "${i.snapshotFile}".`;let ve=[],Ae=i.changes.length;ve.push(`sveld --check: ${Ae} API change${Ae===1?"":"s"} detected against "${i.snapshotFile}".`),ve.push(`Suggested semver bump: ${i.bump}.`);let _e=new Map;for(let Ne of i.changes){let Re=_e.get(Ne.component)??[];Re.push(Ne),_e.set(Ne.component,Re)}for(let[Ne,Re]of _e){ve.push(""),ve.push(` ${Ne}`);for(let Ie of Re){let Le=Ie.kind==="schema"?"schema":Md[Ie.bump];ve.push(` [${Le}] ${Ie.message}`)}}return ve.join(`
35
- `)}var be=1;function te(i){let ve={kind:"check-report",schemaVersion:be,...i};return $r(ve)}import{existsSync as $d}from"node:fs";import{join as Fd}from"node:path";import{pathToFileURL as jd}from"node:url";function Bd(i,ve){let Ae=i.length+1,_e=ve.length+1,Ne=Array.from({length:Ae},()=>Array(_e).fill(0));for(let Re=0;Re<Ae;Re++)Ne[Re][0]=Re;for(let Re=0;Re<_e;Re++)Ne[0][Re]=Re;for(let Re=1;Re<Ae;Re++)for(let Ie=1;Ie<_e;Ie++){let Le=i[Re-1]===ve[Ie-1]?0:1;Ne[Re][Ie]=Math.min(Ne[Re-1][Ie]+1,Ne[Re][Ie-1]+1,Ne[Re-1][Ie-1]+Le)}return Ne[Ae-1][_e-1]}function as(i,ve){let Ae,_e=Number.POSITIVE_INFINITY;for(let Ne of ve){let Re=Bd(i,Ne);if(Re<_e)Ae=Ne,_e=Re}if(Ae===void 0||_e>3)return;return Ae}var Vd=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Ce(i){return i}function qd(i=process.cwd()){for(let ve of Vd){let Ae=Fd(i,ve);if($d(Ae))return Ae}return null}async function Pi(i){let ve;try{ve=await import(`${jd(i).href}?t=${Date.now()}`)}catch(_e){let Ne=_e instanceof Error?_e.message:String(_e);throw Error(`sveld: failed to load config file "${i}".
36
- ${Ne}`)}let Ae=ve.default;if(!Pt(Ae)||Array.isArray(Ae))throw Error(`sveld: config file "${i}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Ae}async function D(i=process.cwd()){let ve=qd(i);if(ve===null)return{};return Pi(ve)}function N(...i){let ve={};for(let Ae of i){if(!Ae)continue;for(let[_e,Ne]of Object.entries(Ae)){let Re=ve[_e];ve[_e]=Pt(Re)&&!Array.isArray(Re)&&Pt(Ne)&&!Array.isArray(Ne)?{...Re,...Ne}:Ne}}return ve}var Ud={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function G(i){let{strict:ve,...Ae}=i;if(ve!=="ci"&&ve!=="local")return i;return{...Ud[ve],...Ae}}var Kc=["entry","glob","quiet","documentExports","types","typesOptions","json","jsonOptions","markdown","markdownOptions","customElements","customElementsOptions","llms","llmsOptions","additionalWriters","failFast","watch","config","resolveTypes","cache","checkExamples","reportDiagnostics","strict","check","checkLevel","stdout","format","dryRun","diagnostics"],Gd={typesOptions:["outDir","preamble","format","exports","dryRun","cache","resolvedPathByFilePath"],jsonOptions:["input","outFile","outDir","entryExports","dryRun","source"],markdownOptions:["write","outFile","outDir","entryExports","onAppend","dryRun"],customElementsOptions:["outFile","dryRun"],llmsOptions:["outDir","linkBase","title","summary","entryExports","dryRun"],diagnostics:["ignore"]};function zc(i,ve,Ae){let _e=i===null?ve:`${i}.${ve}`,Ne=as(ve,Ae),Re=Ne===void 0?void 0:i===null?Ne:`${i}.${Ne}`;console.warn(`sveld: unknown option "${_e}".${Re?` Did you mean "${Re}"?`:""}`)}function I(i){for(let ve of Object.keys(i))if(!Kc.includes(ve))zc(null,ve,Kc);for(let[ve,Ae]of Object.entries(Gd)){let _e=i[ve];if(!Pt(_e))continue;for(let Ne of Object.keys(_e))if(!Ae.includes(Ne))zc(ve,Ne,Ae)}}var os=new Map;function w(i,ve){if(!ve?.replace&&os.has(i.name))throw Error(`sveld: a writer named "${i.name}" is already registered. Pass { replace: true } to overwrite it.`);os.set(i.name,i)}function z(i){return os.get(i)}function Pe(){return Array.from(os.values())}import{dirname as yp,isAbsolute as Yy,resolve as Qy}from"node:path";import{existsSync as kl,lstatSync as _l,readdirSync as Vm,readFileSync as qm,realpathSync as Um,statSync as Nl}from"node:fs";import{readFile as Gm}from"node:fs/promises";import{dirname as Il,extname as Wm,isAbsolute as Hm,join as wl,parse as bs,relative as Mi,resolve as Yr}from"node:path";function xn(i){return i}function xr(i){if(i==="")return i;return i.startsWith(".")?i:`./${i}`}import{dirname as Jc,resolve as Yc}from"node:path";var Wd=/^(['"])(.*)\1$/,Qc=/^[./]/,Hd=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function Kd(i,ve){let Ae=i.extends?.import;if(Ae===void 0)return null;let _e=Ae.replace(Wd,"$2");if(!Qc.test(_e))return null;return Yc(Jc(ve),_e)}function Xc(i,ve){let Ae=[];for(let _e of i.matchAll(Hd)){let Ne=_e[2];if(!Qc.test(Ne))continue;Ae.push(Yc(Jc(ve),Ne))}return Ae}function zd(i,ve){let Ae=[],_e=Kd(i,ve);if(_e!==null)Ae.push(_e);for(let Ne of i.typedefs??[])Ae.push(...Xc(Ne.type,ve));for(let Ne of i.props)if(Ne.type)Ae.push(...Xc(Ne.type,ve));return Ae}function bn(i,ve){let Ae=new Map;for(let _e of i.values()){let Ne=ve(_e.filePath);for(let Re of zd(_e,Ne)){let Ie=Ae.get(Re);if(Ie===void 0)Ie=new Set,Ae.set(Re,Ie);Ie.add(Ne)}}return Ae}function cs(i,ve){let Ae=new Set,_e=[];for(let Ne of i)if(!Ae.has(Ne))Ae.add(Ne),_e.push(Ne);while(_e.length>0){let Ne=_e.shift(),Re=ve.get(Ne);if(Re===void 0)continue;for(let Ie of Re)if(!Ae.has(Ie))Ae.add(Ie),_e.push(Ie)}return Ae}var Xd=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,Jd=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),Yd=new Set(["svelte","html"]);function Qd(i){let ve=i.trim();if(ve==="")return null;let Ae=ve.match(Xd);if(Ae){let _e=Ae[1].toLowerCase(),Ne=Ae[2].trim();if(Ne==="")return null;if(Jd.has(_e))return{kind:"compile",code:Ne};if(Yd.has(_e))return{kind:"syntax",code:Ne};return null}if(ve.startsWith("<"))return null;return{kind:"compile",code:ve}}function Zc(i){if(!i.isFunction)return"any";return`(${(i.params??[]).map((Ae)=>`${Ae.name}${Ae.optional?"?":""}: any`).join(", ")}) => any`}function ls(i,ve,Ae,_e,Ne){let Re=(i??[]).filter((Le)=>Le.name==="example"),Ie=[];return Re.forEach((Le,Me)=>{let $e=Qd(Le.body);if($e===null)return;let Be=Re.length>1;Ie.push({id:Be?`${ve}#${Me}`:ve,name:Be?`${Ae} (example ${Me+1})`:Ae,type:_e,code:$e.code,kind:$e.kind,...Ne?{source:Ne}:{}})}),Ie}function el(i){return i.name??"default"}function tl(i){let ve=[];for(let Ae of i.props)ve.push(...ls(Ae.tags,`prop:${Ae.name}`,Ae.name,Zc(Ae),Ae.source));for(let Ae of i.moduleExports)ve.push(...ls(Ae.tags,`export:${Ae.name}`,Ae.name,Zc(Ae),Ae.source));for(let Ae of i.slots)ve.push(...ls(Ae.tags,`slot:${el(Ae)}`,el(Ae),"any",Ae.source));for(let Ae of i.events)ve.push(...ls(Ae.tags,`event:${Ae.name}`,Ae.name,"any",Ae.source));return ve}import{createHash as Zd}from"node:crypto";import{mkdirSync as em,readFileSync as tm,renameSync as rm,writeFileSync as rl}from"node:fs";import{dirname as nm,isAbsolute as sm,join as im,resolve as nl}from"node:path";var _i=2,am=im("node_modules",".cache","sveld","parse-cache.json");function Ni(){return`${ts}+svelte@${yn}`}function il(i,ve){if(typeof ve==="string")return sm(ve)?ve:nl(i,ve);return nl(i,am)}function al(i){return Zd("sha256").update(i).digest("hex")}function sl(){return{formatVersion:_i,toolchainVersion:Ni(),entries:{}}}function om(i){try{let ve=tm(i,"utf-8"),Ae=JSON.parse(ve);if(Ae.formatVersion!==_i||Ae.toolchainVersion!==Ni())return sl();return Ae}catch{return sl()}}class Ii{cacheFilePath;file;next=new Map;blocked=new Set;constructor(i){this.cacheFilePath=i,this.file=om(i)}has(i,ve){if(this.blocked.has(i))return!1;let Ae=this.file.entries[i];return Ae!==void 0&&Ae.hash===ve}get(i,ve){if(this.blocked.has(i))return null;let Ae=this.file.entries[i];if(Ae===void 0||Ae.hash!==ve)return null;if(this.next.set(i,Ae),Ae.typeScriptMetadata!==void 0)Ae.parsed[x]=Ae.typeScriptMetadata;return Ae.parsed}set(i,ve,Ae){this.next.set(i,{hash:ve,parsed:Ae,typeScriptMetadata:Ae[x]})}invalidate(i){this.blocked.add(i)}getGeneratedText(i,ve){let Ae=this.next.get(i);if(Ae?.generatedText===void 0||Ae.generatedText.format!==ve)return;return Ae.generatedText.text}setGeneratedText(i,ve,Ae){let _e=this.next.get(i);if(_e===void 0)return;_e.generatedText={format:ve,text:Ae}}save(){em(nm(this.cacheFilePath),{recursive:!0});let i={formatVersion:_i,toolchainVersion:Ni(),entries:Object.fromEntries(this.next)},ve=JSON.stringify(i),Ae=`${this.cacheFilePath}.${process.pid}.tmp`;try{rl(Ae,ve),rm(Ae,this.cacheFilePath)}catch{try{rl(this.cacheFilePath,ve)}catch{}}}}import{existsSync as ys,lstatSync as ul,readFileSync as xm}from"node:fs";import{dirname as gl,join as bm,relative as Em,resolve as yl}from"node:path";var zr=null,Di=null;function Fr(){if(zr)return Promise.resolve(zr);if(!Di)Di=Promise.all([import("./chunk-74rbv9gf.js"),import("./chunk-6n4d12tf.js")]).then(([i,ve])=>(zr={ComponentParser:i.default,parseSvelte:ve.parse},zr));return Di}function ps(){if(!zr)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return zr}import{existsSync as fs,readFileSync as cm}from"node:fs";import{dirname as Ri,isAbsolute as lm,join as pm,relative as um,resolve as ds}from"node:path";function us(i){if(!Pt(i))return{};let ve={};if(typeof i.svelte==="string")ve.svelte=i.svelte;if(typeof i.name==="string")ve.name=i.name;if(typeof i.description==="string")ve.description=i.description;return ve}function ol(i){if(!Pt(i))return{};let ve={};if(typeof i.extends==="string")ve.extends=i.extends;if(Pt(i.compilerOptions)){let Ae={};if(typeof i.compilerOptions.baseUrl==="string")Ae.baseUrl=i.compilerOptions.baseUrl;if(Pt(i.compilerOptions.paths)){let _e={};for(let[Ne,Re]of Object.entries(i.compilerOptions.paths))if(Array.isArray(Re)&&Re.every((Ie)=>typeof Ie==="string"))_e[Ne]=Re;if(Object.keys(_e).length>0)Ae.paths=_e}if(Object.keys(Ae).length>0)ve.compilerOptions=Ae}return ve}var hs=new Map,cl=new Map,hm=/\/\*[\s\S]*?\*\/|\/\/.*/g,fm=/[.+?^${}()|[\]\\]/g,dm=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class Xr extends Error{specifier;fromFile;searched;constructor(i,ve,Ae){super(`cannot resolve "${i}" from ${ve||"."} (${Ae})`);this.name="UnresolvedModuleError",this.specifier=i,this.fromFile=ve,this.searched=Ae}}function mm(i){if(fs(i))return!0;return dm.some((ve)=>fs(i+ve))}function ll(i){let ve=i.indexOf("*");return ve===-1?i.length:ve}function gm(i){let ve=i,Ae=ds(ve,"/");while(ve!==Ae){for(let _e of["tsconfig.json","jsconfig.json"]){let Ne=pm(ve,_e);if(fs(Ne))return Ne}ve=Ri(ve)}return null}function pl(i){if(hs.has(i))return hs.get(i)??null;try{let ve=cm(i,"utf-8"),Ae;try{Ae=JSON.parse(ve)}catch{let Ne=ve.replace(hm,"");Ae=JSON.parse(Ne)}let _e=ol(Ae);if(_e.extends){let Ne=lm(_e.extends)?_e.extends:ds(Ri(i),_e.extends),Re=Ne.endsWith(".json")?Ne:`${Ne}.json`;if(fs(Re)){let Ie=pl(Re);if(Ie)_e.compilerOptions={...Ie.compilerOptions,..._e.compilerOptions,paths:{...Ie.compilerOptions?.paths,..._e.compilerOptions?.paths}}}}return hs.set(i,_e),_e}catch{return hs.set(i,null),null}}function ym(i){let ve=cl.get(i);if(!ve){let Ae=i.split("*").map((_e)=>_e.replace(fm,"\\$&")).join("(.*)");ve=new RegExp(`^${Ae}$`),cl.set(i,ve)}return ve}function ms(i,ve){if(i.startsWith(".")||i.startsWith("/"))return{resolved:i,unresolved:!1,searched:""};let Ae=gm(ve);if(!Ae)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let _e=pl(Ae);if(!_e?.compilerOptions?.paths)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:Ne=".",paths:Re}=_e.compilerOptions,Ie=Ri(Ae),Le=ds(Ie,Ne),Me=Object.entries(Re).sort(([$e],[Be])=>ll(Be)-ll($e));for(let[$e,Be]of Me){let Ve=i.match(ym($e));if(!Ve)continue;let Ue;for(let Ge of Be){let Xe=Ge;for(let Ke=1;Ke<Ve.length;Ke++)Xe=Xe.replace("*",Ve[Ke]);let Je=ds(Le,Xe);if(Ue===void 0)Ue=Je;if(mm(Je))return{resolved:Je,unresolved:!1,searched:Ae}}return{resolved:Ue??i,unresolved:!1,searched:Ae}}return{resolved:i,unresolved:!0,searched:`tsconfig paths (${Ae})`}}function Li(i,ve){return ms(i,ve).resolved}function gs(i,ve){if(i.startsWith(".")||i.startsWith("/"))return i;let Ae=Li(i,ve);if(Ae===i)return i;let _e=um(ve,Ae);return _e=e(_e),_e.startsWith(".")?_e:`./${_e}`}var hl=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],Cm=/\r?\n/,vm=/^\s*\*+/;function yt(i){return i&&typeof i==="object"?i:void 0}function jr(i){return Array.isArray(i)?i:[]}function lr(i){return a(i)?i.name:void 0}function pr(i,ve){let Ae=Li(i,ve),_e=yl(ve,Ae);if(ys(_e)&&ul(_e).isFile())return _e;for(let Ne of hl){let Re=_e+Ne;if(ys(Re))return Re}if(ys(_e)&&ul(_e).isDirectory())for(let Ne of hl){let Re=bm(_e,`index${Ne}`);if(ys(Re))return Re}return null}function Sm(i,ve){let Ae=i.slice(0,ve).trimEnd();if(!Ae.endsWith("*/"))return;let _e=Ae.length-2,Ne=Ae.lastIndexOf("/**",_e);if(Ne===-1)return;let Re=[];for(let Ie of Ae.slice(Ne+3,_e).split(Cm)){let Le=Ie.replace(vm,"").trim();if(Le.startsWith("@"))break;if(Le)Re.push(Le)}return Re.join(" ")||void 0}function Tm(i,ve){let Ae=i.slice(0,ve).trimEnd();if(!Ae.endsWith("*/"))return;let _e=Ae.length-2,Ne=Ae.lastIndexOf("/**",_e);if(Ne===-1)return;return Ae.slice(Ne,_e+2)}function Jr(i,ve){if(!ve)return;return i.text.slice(ve.start,ve.end)}function Am(i,ve){let Ae=yt(ve?.typeAnnotation);if(Ae?.type!=="TSTypeAnnotation")return;return Jr(i,yt(Ae.typeAnnotation))}function Oi(i,ve){let Ae=yt(ve.returnType);return Ae?.type==="TSTypeAnnotation"?Jr(i,yt(Ae.typeAnnotation)):void 0}function fl(i,ve){let Ae=jr(ve.params).map((Ne)=>Jr(i,Ne)??"").join(", "),_e=Oi(i,ve);return`(${Ae})${_e?` => ${_e}`:""}`}function xl(i){if(i.type==="Literal"){let ve=i.value;if(typeof ve==="string")return"string";if(typeof ve==="number")return"number";if(typeof ve==="boolean")return"boolean"}if(i.type==="TemplateLiteral")return"string";return}function km(i){if(!i)return;let ve=i.lastIndexOf("=>");if(ve===-1)return;return i.slice(ve+2).trim()||void 0}function dl(i){if(i.async||i.generator)return;let ve=yt(i.body);if(!ve)return;let Ae=[];if(ve.type==="BlockStatement"){if(En(ve,Ae),Ae.length===0)return}else Ae.push(ve);let _e;for(let Ne of Ae){if(!Ne)return;let Re=xl(Ne);if(!Re)return;if(_e===void 0)_e=Re;else if(_e!==Re)return}return _e}function En(i,ve){for(let Ae of jr(i.body)){if(Ae.type==="FunctionDeclaration"||Ae.type==="FunctionExpression"||Ae.type==="ArrowFunctionExpression")continue;if(Ae.type==="ReturnStatement"){ve.push(yt(Ae.argument)??null);continue}if(Ae.type==="BlockStatement"){En(Ae,ve);continue}let _e=yt(Ae.consequent);if(_e?.type==="BlockStatement")En(_e,ve);else if(_e?.type==="ReturnStatement")ve.push(yt(_e.argument)??null);let Ne=yt(Ae.alternate);if(Ne?.type==="BlockStatement")En(Ne,ve);else if(Ne?.type==="ReturnStatement")ve.push(yt(Ne.argument)??null);let Re=yt(Ae.body);if(Re?.type==="BlockStatement")En(Re,ve)}}function wm(i){let ve=yt(i.initializer);if(!ve)return;if(ve.type==="Literal"){let Ae=ve.value;return typeof Ae==="string"||typeof Ae==="number"?Ae:void 0}if(ve.type==="UnaryExpression"){let Ae=yt(ve.argument);if(ve.operator==="-"&&Ae?.type==="Literal"){let Ne=Ae.value;if(typeof Ne==="number")return-Ne}}return}function Pm(i){let ve=jr(i.members);if(ve.length===0)return;let Ae=[],_e=0;for(let Ne of ve){if(!yt(Ne.initializer)){Ae.push(String(_e)),_e+=1;continue}let Ie=wm(Ne);if(Ie===void 0)return;Ae.push(typeof Ie==="string"?JSON.stringify(Ie):String(Ie)),_e=typeof Ie==="number"?Ie+1:_e}return Ae.join(" | ")}function ml(i,ve,Ae){let _e=i.filePath,Ne=Sm(i.text,Ae),Re=Tm(i.text,Ae),Ie=Re?Rc(Re):void 0,{deprecated:Le,tags:Me,internal:$e}=Re?Lc(Re):{deprecated:void 0,tags:void 0,internal:!1},Be=$e?{internal:!0}:{};if(ve.type==="VariableDeclaration"){let Ve=ve.kind??"const",Ue=[];for(let Ge of jr(ve.declarations)){let Xe=yt(Ge.id),Je=lr(Xe);if(!Je)continue;let Ke=Am(i,Xe),et,ot,it,at=yt(Ge.init);if(at)if(at.type==="ArrowFunctionExpression"||at.type==="FunctionExpression"){if(!Ke)Ke=fl(i,at);ot=Oi(i,at)??Ie??km(Ke)??dl(at)}else{if(et=Jr(i,at),!Ke)Ke=xl(at);it=Xn(at)??void 0}Ue.push({name:Je,kind:Ve,type:Ke,value:et,returnType:ot,literalValue:it,description:Ne,deprecated:Le,tags:Me,...Be,declFile:_e,isTypeOnly:!1})}return Ue}if(ve.type==="FunctionDeclaration"||ve.type==="TSDeclareFunction"){let Ve=lr(yt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"function",type:fl(i,ve),returnType:Oi(i,ve)??Ie??dl(ve),description:Ne,deprecated:Le,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}if(ve.type==="ClassDeclaration"){let Ve=lr(yt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"class",type:Ve,description:Ne,deprecated:Le,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}if(ve.type==="TSTypeAliasDeclaration"){let Ve=lr(yt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"type",type:Jr(i,yt(ve.typeAnnotation)),description:Ne,deprecated:Le,tags:Me,...Be,declFile:_e,isTypeOnly:!0}]}if(ve.type==="TSInterfaceDeclaration"){let Ve=lr(yt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"interface",type:Jr(i,yt(ve.body)),description:Ne,deprecated:Le,tags:Me,...Be,declFile:_e,isTypeOnly:!0}]}if(ve.type==="TSEnumDeclaration"){let Ve=lr(yt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"enum",type:Pm(ve)??Ve,description:Ne,deprecated:Le,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}return[]}function _m(i){let ve;try{ve=xm(i,"utf-8")}catch{return null}let Ae=`<script lang="ts">
37
- ${ve}
38
- </script>`;try{let _e=ps().parseSvelte(Ae),Ne=jr(_e.instance?.content?.body);return{source:{text:Ae,filePath:i,dir:gl(i)},body:Ne}}catch(_e){let Ne=_e instanceof Error?_e.message:String(_e);return console.warn(`Warning: Failed to parse entry export module ${i}: ${Ne}`),null}}function Nm(i,ve){for(let Ae of i){if(Ae.type!=="ImportDeclaration")continue;let _e=yt(Ae.source)?.value;if(typeof _e!=="string")continue;for(let Ne of jr(Ae.specifiers)){if(Ne.type!=="ImportSpecifier")continue;if(lr(yt(Ne.local))===ve){let Re=lr(yt(Ne.imported))??ve;return{specifier:_e,importedName:Re}}}}return null}function br(i,ve){let Ae=ve.cache.get(i);if(Ae)return Ae;if(ve.computing.has(i))return[];ve.computing.add(i);let _e=_m(i);if(!_e)return ve.computing.delete(i),ve.cache.set(i,[]),[];let{source:Ne,body:Re}=_e,Ie=[],Le=new Map;for(let $e of Re){let Be=$e.type==="ExportNamedDeclaration"?yt($e.declaration):$e;if(!Be)continue;for(let Ve of ml(Ne,Be,Be.start))Le.set(Ve.name,Ve)}let Me=($e)=>{let Be=Le.get($e);if(Be)return Be;let Ve=Nm(Re,$e);if(!Ve||Ve.specifier.endsWith(".svelte"))return null;let Ue=pr(Ve.specifier,Ne.dir);if(!Ue)return null;return br(Ue,ve).findLast((Ge)=>Ge.name===Ve.importedName)??null};for(let $e of Re){if($e.type==="ExportAllDeclaration"){let Xe=yt($e.source)?.value;if(typeof Xe!=="string"||Xe.endsWith(".svelte"))continue;let Je=pr(Xe,Ne.dir);if(!Je)continue;let Ke=$e.exportKind==="type";for(let et of br(Je,ve))Ie.push(Ke?{...et,isTypeOnly:!0}:et);continue}if($e.type!=="ExportNamedDeclaration")continue;let Be=yt($e.declaration);if(Be){Ie.push(...ml(Ne,Be,$e.start));continue}let Ve=yt($e.source)?.value,Ue=typeof Ve==="string"?Ve:void 0;if(Ue?.endsWith(".svelte"))continue;let Ge=$e.exportKind==="type";for(let Xe of jr($e.specifiers)){if(Xe.type!=="ExportSpecifier")continue;let Je=lr(yt(Xe.exported)),Ke=lr(yt(Xe.local));if(!Je||!Ke||Ke==="default"||Je==="default")continue;let et=Ge||Xe.exportKind==="type",ot=null;if(Ue){let it=pr(Ue,Ne.dir);if(it)ot=br(it,ve).findLast((at)=>at.name===Ke)??null}else ot=Me(Ke);if(ot?.declFile.endsWith(".svelte"))continue;if(ot)Ie.push({...ot,name:Je,isTypeOnly:ot.isTypeOnly||et});else Ie.push({name:Je,kind:et?"type":"const",declFile:i,isTypeOnly:et})}}return ve.computing.delete(i),ve.cache.set(i,Ie),Ie}async function Cn(i){await Fr();let ve=yl(i),Ae=gl(ve),_e=br(ve,{cache:new Map,computing:new Set}),Ne=(Le)=>e(`./${Em(Ae,Le)}`),Re=new Map,Ie=new Map;for(let Le of _e){let Me=Ie.get(Le.name);if(Me!==void 0&&Me!==Le.declFile){console.warn(`Warning: "${Le.name}" is exported from both "${Ne(Me)}" and "${Ne(Le.declFile)}"; keeping the first and dropping the rest.`);continue}Ie.set(Le.name,Le.declFile);let{declFile:$e,returnType:Be,literalValue:Ve,...Ue}=Le;Re.set(Le.name,{...Ue,source:Ne($e)})}return Array.from(Re.values()).sort((Le,Me)=>Le.name.localeCompare(Me.name))}import{readFileSync as El}from"node:fs";import{dirname as Cl,join as Im,relative as Dm,resolve as Rm}from"node:path";var bl=new Map;function Lm(i){return Qs(i,{ecmaVersion:"latest",sourceType:"module"})}function Om(i,ve,Ae){let _e=pr(i,ve);if(!_e)return null;let Ne=Cl(_e);if(Ae.has(_e))return{dir:Ne,exports:{}};Ae.add(_e);try{return{dir:Ne,exports:xs(El(_e,"utf-8"),Ne,Ae,_e)}}catch{return{dir:Ne,exports:{}}}finally{Ae.delete(_e)}}function xs(i,ve,Ae=new Set,_e=ve){let Ne=bl.get(i);if(!Ne)Ne=Lm(i),bl.set(i,Ne);let Re={};for(let Ie of Ne.body)if(Ie.type==="ExportDefaultDeclaration"){let Le=Ie.declaration.name;if(Le in Re)Re[Le].default=!0;else Re[Le]={source:xr(""),default:!0}}else if(Ie.type==="ExportAllDeclaration"){if(!Ie.source)continue;let Le=Ie.source.value,Me=pr(Le,ve);if(!Me){let Ve=ms(Le,ve);throw new Xr(Le,_e,Ve.unresolved?Ve.searched:"no matching file or index found")}if(Ae.has(Me))continue;Ae.add(Me);let $e=El(Me,"utf-8"),Be=xs($e,Cl(Me),Ae,Me);Ae.delete(Me);for(let[Ve,Ue]of Object.entries(Be)){let Ge=xr(e(`./${Im(Le,Ue.source)}`));Re[Ve]={...Ue,source:Ge}}}else if(Ie.type==="ExportNamedDeclaration"){let Le=Ie.source?.value,Me=Le!==void 0&&Pr.test(Le);if(Me){let Ve=ms(Le,ve);if(Ve.unresolved)throw new Xr(Le,_e,Ve.searched)}let Be=Le!==void 0&&!Me?Om(Le,ve,Ae):void 0;if(Be===null)console.warn(`sveld: could not resolve re-exported module "${Le}" from barrel "${ve||"."}"; skipping.`);for(let Ve of Ie.specifiers){let Ue=Ve.exported.name,Ge=Ve.local.name,Xe=Ue||Ge;if(Be===null)continue;let Je=Be?.exports[Ge],Ke=Je?xr(e(`./${Dm(ve,Rm(Be.dir,Je.source))}`)):xr(gs(Le??"",ve)),et=Je?Je.default:Ge==="default";if(Xe in Re){if(Re[Xe].mixed=!0,!Re[Xe].source)Re[Xe].source=Ke}else Re[Xe]={source:Ke,default:et}}}else if(Ie.type==="ImportDeclaration"){let Le=Ie.specifiers[0].local.name;if(Le in Re){if(!Re[Le].source)Re[Le].source=xr(gs(Ie.source?.value??"",ve))}else Re[Le]={source:xr(gs(Ie.source?.value??"",ve)),default:Le==="default"}}return Re}import{existsSync as Mm}from"node:fs";import{dirname as Bm}from"node:path";function vl(){return{cache:new Map,computing:new Set}}var $m=/\.[^./\\]+$/;function Fm(i){if(i.endsWith(".d.ts"))return null;let ve=i.replace($m,".d.ts");return Mm(ve)?ve:null}function Sl(i,ve,Ae){let _e=Bm(i);return ve.map((Ne)=>{if(!Ne.importSource||!Ne.importedName)return{candidate:Ne};let Re=pr(Ne.importSource,_e);if(!Re)return{candidate:Ne,failureReason:"module-not-found"};let Ie=br(Re,Ae).find((Me)=>Me.name===Ne.importedName);if(!Ie)return{candidate:Ne,failureReason:"export-not-found"};if(Ie.returnType)return{candidate:Ne,type:Ie.returnType};let Le=Fm(Re);if(Le){let Me=br(Le,Ae).find(($e)=>$e.name===Ne.importedName);if(Me?.returnType)return{candidate:Ne,type:Me.returnType}}return{candidate:Ne,failureReason:"return-type-unresolved"}})}function Tl(i,ve){switch(ve){case"module-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importedName}" is not exported from "${i.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${i.propName}" default calls "${i.calleeName}()" imported from "${i.importSource}", but its return type could not be resolved; falling back to "any".`}}import{dirname as jm}from"node:path";function Al(i,ve,Ae){let _e=jm(i);return ve.map((Ne)=>{let Re=pr(Ne.importSource,_e);if(!Re)return{candidate:Ne};let Ie=br(Re,Ae).find((Le)=>Le.name===Ne.importedName);if(Ie?.kind!=="const"||Ie.literalValue===void 0)return{candidate:Ne};return{candidate:Ne,key:Ie.literalValue}})}function b(i){return{failFast:i?.failFast,resolveTypes:i?.resolveTypes===!0,documentExports:i?.documentExports===!0,cache:i?.cache,checkExamples:i?.checkExamples==="syntax"?"syntax":i?.checkExamples===!0,dryRun:i?.dryRun===!0,diagnostics:i?.diagnostics}}var Km=/-/g,zm=/[^A-Za-z0-9_$]/g,Xm=/^[0-9]/;function Jm(i){let ve=i.replace(zm,""),Ae=Xm.test(ve)?`_${ve}`:ve;if(Ae!==i)console.warn(`Warning: "${i}" is not a valid identifier; using "${Ae}" instead.`);return Ae}function Dl(i,ve=[],Ae=new Set,_e){let Ne,Re;try{if(Re=_e??Um(i),Ae.has(Re))return ve;Ae.add(Re),Ne=Vm(i,{withFileTypes:!0})}catch{return ve}for(let Ie of Ne){if(Ie.name.startsWith("."))continue;let Le=wl(i,Ie.name),Me=Ie.isSymbolicLink(),$e=Me?Nl(Le,{throwIfNoEntry:!1}):Ie;if(!$e)continue;if($e.isDirectory())Dl(Le,ve,Ae,Me?void 0:wl(Re,Ie.name));else if($e.isFile()&&Ie.name.endsWith(".svelte"))ve.push(Le)}return ve}function Ym(i){return Dl(i).map((ve)=>{let Ae=Jm(bs(ve).name.replace(Km,"")),_e=xr(e(`./${Mi(i,ve)}`));return{moduleName:Ae,source:_e}}).sort((ve,Ae)=>ve.source.localeCompare(Ae.source))}function Qm(i){return bs(i).ext!==".svelte"}function Zm(i,ve){let Ae=i.endsWith("/")?i:`${i}/`;return ve.startsWith(Ae)}function Es(i,ve){return{seenPaths:new Set(i.map(([,Ae])=>ve(Ae.source))),seenModuleNamePaths:new Map(i.map(([Ae,_e])=>[Ae,ve(_e.source)])),warnedModuleNames:new Set}}function Bi(i,ve,Ae,_e,Ne){for(let{moduleName:Re,source:Ie}of Ym(i)){let Le=_e(Ie),Me=ve[Re];if(Me&&Qm(Me.source)&&Zm(Me.source,Ie)){Ne.seenPaths.delete(_e(Me.source)),Me.source=Ie,Ne.seenPaths.add(Le),Ne.seenModuleNamePaths.set(Re,Le);continue}if(Ne.seenPaths.has(Le))continue;Ne.seenPaths.add(Le);let $e=Ne.seenModuleNamePaths.get(Re);if($e===void 0)Ne.seenModuleNamePaths.set(Re,Le);else if($e!==Le&&!Ne.warnedModuleNames.has(Re))Ne.warnedModuleNames.add(Re),console.warn(`Warning: multiple components named "${Re}" found (${e(Mi(i,$e))} and ${e(Mi(i,Le))}). Both are included in TypeScript definitions, but only one can be the named export.`);Ae.push([Re,{source:Ie,default:!1}])}}function Cs(i,ve,Ae=!1){let _e=_l(i).isFile(),Ne=_e?Il(i):i,Re=Yr(Ne),Ie=new Map,Le=(Be)=>{let Ve=Ie.get(Be);if(Ve===void 0)Ve=Hm(Be)?Yr(Be):Yr(Re,Be),Ie.set(Be,Ve);return Ve},Me={};if(_e){let Be=qm(i,"utf-8");try{Me=xs(Be,Re,new Set([Yr(i)]))}catch(Ve){if(!Ae)throw Ve;let Ue=Ve instanceof Error?Ve.message:String(Ve);console.warn(`Warning: Failed to parse component exports from ${i}: ${Ue}`)}}let $e=Object.entries(Me);if(ve){let Be=Es($e,Le);if(Bi(Re,Me,$e,Le,Be),!_e)Me=Object.fromEntries($e.map(([Ve,Ue])=>[Ve,{...Ue,default:!0}]))}return{exports:Me,allComponentEntries:$e,rootDir:Re,resolveComponentFilePath:Le}}async function vs(i){let ve=await Promise.all(Array.from(i).map(async(Ae)=>{try{let _e=await Gm(Ae,"utf-8");return{path:Ae,content:_e}}catch(_e){return console.warn(`Warning: Failed to read file ${Ae}:`,_e),{path:Ae,content:null}}}));return new Map(ve.map(({path:Ae,content:_e})=>[Ae,_e]))}function Nr([i,ve],Ae,_e,Ne,Re={}){let Ie=ve.source,{ext:Le,name:Me}=bs(Ie),$e=i;if(Ae.length===1&&i==="default")$e=Me;if(Le===".svelte"){let Be=Ne(Ie),Ve=_e.get(Be);if(Ve===null||Ve===void 0)return null;let Ue=e(Ie),Ge=Re.memo?.get(Be),Xe=Re.hashes?.get(Be),Je=Ge===void 0?Xe===void 0?null:Re.cache?.get(Be,Xe):null,Ke;if(Ge!==void 0)Ke=Ge;else if(Je)Ke=Je;else{let et=new(ps()).ComponentParser;try{Ke=et.parseSvelteComponent(Ve,{moduleName:$e,filePath:Ue})}catch(ot){if(Re.failFast)throw ot;let it=ot instanceof Error?ot.message:String(ot),at=ot instanceof Error?ot.stack:void 0;return Re.onParseError?.({filePath:Ue,moduleName:$e,message:it,stack:at}),null}if(Xe!==void 0)Re.cache?.set(Be,Xe,Ke);Re.memo?.set(Be,Ke)}return{moduleName:$e,filePath:Ue,...Ke}}return null}function $i(i,ve){let Ae=new Set;for(let _e of i)for(let[,Ne]of _e)if(bs(Ne.source).ext===".svelte")Ae.add(ve(Ne.source));return Ae}function Ss(i){if(i.length===0)return;console.error(`sveld: failed to parse ${i.length} component(s):`);for(let{filePath:ve,message:Ae}of i)console.error(` - ${ve}: ${Ae}`)}async function k(i,ve,Ae={}){let _e=Ae.documentExports===!0,{exports:Ne,allComponentEntries:Re,rootDir:Ie,resolveComponentFilePath:Le}=Cs(i,ve,_e),Me=_e&&_l(i).isFile()?await Cn(Yr(i)):[],$e=Object.entries(Ne),Be=$i([$e,Re],Le),Ve=await vs(Be),Ue=new Map,Ge=new Map,Xe=Ae.cache===!1?void 0:new Ii(il(Ie,Ae.cache??!0)),Je=Xe?new Map:void 0,Ke=new Set,et=new Map;if(Xe)for(let We of Be){let He=Ve.get(We);if(He===null||He===void 0)continue;let ze=al(He);if(et.set(We,ze),!Xe.has(We,ze))Ke.add(We)}if(Be.size>0&&(!Xe||Ke.size>0))await Fr();let ot=new Map,it=new Map,at={failFast:Ae.failFast===!0,onParseError:(We)=>ot.set(We.filePath,We),cache:Xe,hashes:et,memo:it};for(let We of $e){let He=Nr(We,$e,Ve,Le,at);if(He)Ue.set(He.moduleName,He)}for(let We of Re){let He=Nr(We,Re,Ve,Le,at);if(He)Ge.set(He.filePath,He),Je?.set(He.filePath,Le(We[1].source))}if(Xe&&Ke.size>0){let We=bn(Ge,Le),He=cs(Ke,We);for(let ze of He){if(Ke.has(ze))continue;Xe.invalidate(ze),it.delete(ze)}for(let ze of $e){let Ze=Le(ze[1].source);if(!He.has(Ze)||Ke.has(Ze))continue;let Qe=Nr(ze,$e,Ve,Le,at);if(Qe)Ue.set(Qe.moduleName,Qe)}for(let ze of Re){let Ze=Le(ze[1].source);if(!He.has(Ze)||Ke.has(Ze))continue;let Qe=Nr(ze,Re,Ve,Le,at);if(Qe)Ge.set(Qe.filePath,Qe),Je?.set(Qe.filePath,Ze)}}let tt=Array.from(ot.values());if(Ss(tt),!Ae.dryRun)Xe?.save();let xt=Ae.resolveTypes?sg(Ue):[],Nt=Ae.checkExamples?ag(Ge):[],Tt=Ae.checkExamples===!0?Pl(Nt,"compile"):[],De=Ae.checkExamples?Pl(Nt,"syntax"):[];if(De.length>0)og(De);if(xt.length>0||Tt.length>0){let{TypeResolver:We}=await import("./chunk-eybp3ae7.js"),He=await We.create(Ie);if(!He.ok){let Ze=[xt.length>0?"resolveTypes":null,Tt.length>0?"checkExamples":null].filter((Qe)=>Qe!==null).join(" and ");throw Error(`sveld: \`${Ze}\` ${He.message}.`)}let ze=He.resolver;try{if(xt.length>0)await ig(xt,ze,Le);if(Tt.length>0)await cg(Tt,ze,Le)}finally{await ze?.dispose()}}let Oe=eg(Ge),Fe=rg(Ge);if(Oe.length>0||Fe.length>0){await Fr();let We=vl();for(let{component:He,candidates:ze}of Oe){let Ze=Sl(Le(He.filePath),ze,We);tg(He,Ze)}for(let{component:He,candidates:ze}of Fe){let Ze=Al(Le(He.filePath),ze,We);ng(He,Ze)}}hg(Ge,Le);let qe=lc(Jn(Array.from(Ge.values()).flatMap((We)=>We.diagnostics??[])),Ae.diagnostics?.ignore);return{exports:Ne,entryExports:Me,components:Ue,allComponentsForTypes:Ge,errors:tt,diagnostics:qe,cache:Xe,resolvedPathByFilePath:Je}}function eg(i){let ve=[];for(let Ae of i.values()){let _e=Kr(Ae)?.pendingCallDefaultCandidates?.filter((Ne)=>Ne.importSource!==void 0);if(!_e||_e.length===0)continue;ve.push({component:Ae,candidates:_e})}return ve}function tg(i,ve){for(let{candidate:Ae,type:_e,failureReason:Ne}of ve){let Ie=(Ae.location==="props"?i.props:i.moduleExports).find((Le)=>Le.name===Ae.propName);if(Ie?.typeSource!=="unknown")continue;if(_e){if(Ie.type=_e,Ie.typeSource="typescript",Ae.location==="props")i.diagnostics=(i.diagnostics??[]).filter((Le)=>!(Le.kind==="prop-unknown-type"&&Le.name===Ae.propName));continue}if(Ae.location==="props"&&Ne){let Le=i.diagnostics?.find((Me)=>Me.kind==="prop-unknown-type"&&Me.name===Ae.propName);if(Le)Le.message=Tl(Ae,Ne)}}}function rg(i){let ve=[];for(let Ae of i.values()){let _e=Kr(Ae)?.pendingContextKeyCandidates;if(!_e||_e.length===0)continue;ve.push({component:Ae,candidates:_e})}return ve}function ng(i,ve){for(let{candidate:Ae,key:_e}of ve){if(!_e){console.warn(`Warning: Could not resolve setContext key in ${i.filePath}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);continue}if(i.contexts?.some((Ne)=>Ne.key===_e))continue;i.contexts=[...i.contexts??[],{key:_e,typeName:gn(_e),description:Ae.description,properties:Ae.properties,source:Ae.source}]}}function sg(i){let ve=[];for(let Ae of i.values()){let _e=Kr(Ae);if(!_e?.canonicalPropsType||Ae.props.length>0)continue;ve.push({component:Ae,metadata:_e})}return ve}async function ig(i,ve,Ae){let _e=await ve.expandAll(i.map(({component:Ne,metadata:Re})=>({moduleName:Ne.moduleName,metadata:Re,filePath:Ae(Ne.filePath)})));for(let{component:Ne}of i){let Re=_e.get(Ae(Ne.filePath));if(Re)oc(Ne,Re)}}function ag(i){let ve=[];for(let Ae of i.values()){let _e=tl(Ae);if(_e.length===0)continue;ve.push({component:Ae,sources:_e})}return ve}function Pl(i,ve){let Ae=[];for(let{component:_e,sources:Ne}of i){let Re=Ne.filter((Ie)=>Ie.kind===ve);if(Re.length===0)continue;Ae.push({component:_e,sources:Re})}return Ae}function og(i){for(let{component:ve,sources:Ae}of i){let _e=ve.diagnostics??[];for(let Ne of Ae)try{v(Ne.code)}catch(Re){if(Re instanceof S)continue;_e.push(wr({component:ve.filePath,kind:"example-syntax-error",name:Ne.name,message:Re instanceof Error?Re.message:String(Re),...Ne.source?{source:Ne.source}:{}}))}ve.diagnostics=_e}}async function cg(i,ve,Ae){let _e=await ve.checkExamples(i.map(({component:Ne,sources:Re})=>({moduleName:Ne.moduleName,filePath:Ae(Ne.filePath),sources:Re})));for(let{component:Ne,sources:Re}of i){let Ie=_e.get(Ae(Ne.filePath));if(!Ie||Ie.length===0)continue;let Le=new Map(Re.map(($e)=>[$e.id,$e.source])),Me=Ne.diagnostics??[];for(let $e of Ie){let Be=Le.get($e.id);Me.push(wr({component:Ne.filePath,kind:"example-compile-error",name:$e.name,message:$e.message,...Be?{source:Be}:{}}))}Ne.diagnostics=Me}}var lg=[".ts",".tsx",".d.ts",".svelte"];function pg(i){let ve=i.trim();if(ve.length<2)return;let Ae=ve[0],_e=ve[ve.length-1];if((Ae==='"'||Ae==="'"||Ae==="`")&&Ae===_e)return ve.slice(1,-1);return}function ug(i,ve){let Ae=Yr(Il(i),ve);if(kl(Ae)&&Nl(Ae).isFile())return Ae;if(Wm(ve)!=="")return;for(let _e of lg){let Ne=`${Ae}${_e}`;if(kl(Ne))return Ne}return}function hg(i,ve){let Ae=new Map(Array.from(i.values()).map((_e)=>[ve(_e.filePath),_e]));for(let _e of i.values()){let Ne=_e.extends;if(!Ne)continue;let Re=pg(Ne.import);if(Re===void 0||!Re.startsWith(".")&&!Re.startsWith("/"))continue;let Ie=ve(_e.filePath),Le=ug(Ie,Re),Me=_e.diagnostics??[];if(Le===void 0){Me.push(wr({component:_e.filePath,kind:"extend-props-target-missing",name:Ne.interface,message:`@extends/@extendProps target "${Re}" was not found on disk.`})),_e.diagnostics=Me;continue}let $e=Ae.get(Le);if(!$e)continue;let Be=`${$e.moduleName}Props`;if(Ne.interface!==Be){Me.push(wr({component:_e.filePath,kind:"extend-props-target-missing",name:Ne.interface,message:`@extends/@extendProps names "${Ne.interface}", but "${Re}" generates "${Be}".`})),_e.diagnostics=Me;continue}for(let Ve of _e.props){let Ue=$e.props.find((Ge)=>Ge.name===Ve.name);if(Ue&&Ue.type!==Ve.type)Me.push(wr({component:_e.filePath,kind:"extend-props-override",name:Ve.name,message:`Own prop "${Ve.name}" (${Ve.type}) overrides "${Be}"'s "${Ve.name}" (${Ue.type}).`}))}_e.diagnostics=Me}}import{existsSync as Rl,readFileSync as fg}from"node:fs";import{join as Ll}from"node:path";function _(i){if(i){let Ae=Ll(process.cwd(),i);if(Rl(Ae))return xn(i);return console.error(`Invalid entry point: ${Ae}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let ve=Ll(process.cwd(),"package.json");if(!Rl(ve))return console.error("Could not locate a package.json file."),console.error(`Specify an entry point with --entry (or the "entry" option) instead.
39
- `),null;try{let Ae=us(JSON.parse(fg(ve,"utf-8")));if(Ae.svelte?.trim())return xn(Ae.svelte);return console.error(`Could not determine an entry point.
40
- `),console.error(`Specify an entry point to your Svelte code in the "svelte" field of your package.json, or pass --entry (or the "entry" option).
41
- `),null}catch(Ae){throw console.error("Error reading package.json:",Ae),Ae}}var Ol=!1;function R(i){Ol=i}function zt(i){if(!Ol)console.error(i)}import{lstatSync as dg}from"node:fs";import{resolve as Ts}from"node:path";async function Ml(i,ve,Ae=!1){let _e=dg(i).isFile(),Ne=_e?Ts(i):null,Re=Cs(i,ve,Ae),{rootDir:Ie,exports:Le,allComponentEntries:Me,resolveComponentFilePath:$e}=Re,Be=Ae&&_e?await Cn(Ts(i)):[],Ve=Object.entries(Le),Ue=Es(Me,$e),Ge=new Map,Xe=new Map;await Fr();let Je=new Map,Ke={onParseError:(tt)=>Je.set(tt.filePath,tt)},et=()=>({exports:Le,entryExports:Be,components:Ge,allComponentsForTypes:Xe,errors:Array.from(Je.values()),diagnostics:Jn(Array.from(Xe.values()).flatMap((tt)=>tt.diagnostics??[]))});{let tt=$i([Ve,Me],$e),xt=await vs(tt);for(let Nt of Ve){let Tt=Nr(Nt,Ve,xt,$e,Ke);if(Tt)Ge.set(Tt.moduleName,Tt)}for(let Nt of Me){let Tt=Nr(Nt,Me,xt,$e,Ke);if(Tt)Xe.set(Tt.filePath,Tt)}Ss(et().errors)}let ot=bn(Xe,$e),it=(tt,xt,Nt,Tt,De)=>{let Oe=new Set;for(let Fe of Nt){let qe=$e(Fe[1].source);if(!Tt.has(qe))continue;let We=Nr(Fe,Nt,De,$e,Ke);if(We)tt.set(xt(We),We),Oe.add(qe);else for(let[He,ze]of tt)if($e(ze.filePath)===qe)tt.delete(He)}return Oe};return{get result(){return et()},update:async(tt)=>{let xt=tt.map((He)=>Ts(He));if(xt.length===0)return{result:et(),reparsed:[]};let Nt=Ne!==null&&xt.includes(Ne),Tt=[];if(Nt){let He=Cs(i,ve,Ae),ze=new Set(Object.keys(Le)),Ze=new Set(Object.keys(He.exports));for(let Qe of ze)if(!Ze.has(Qe))Ge.delete(Qe);for(let Qe of Ze)if(!ze.has(Qe))Tt.push(He.resolveComponentFilePath(He.exports[Qe].source));if(Le=He.exports,Me=He.allComponentEntries,$e=He.resolveComponentFilePath,Ve=Object.entries(Le),Ue=Es(Me,$e),Ae&&_e)Be=await Cn(Ts(i))}if(ve)Bi(Ie,Le,Me,$e,Ue);let De=xt.filter((He)=>Pr.test(He)||ot.has(He));if(De.length===0&&Tt.length===0)return{result:et(),reparsed:[]};let Oe=cs([...De,...Tt],ot);for(let[He,ze]of Je)if(Oe.has($e(ze.filePath)))Je.delete(He);let Fe=await vs(Oe),qe=new Set;for(let He of it(Ge,(ze)=>ze.moduleName,Ve,Oe,Fe))qe.add(He);for(let He of it(Xe,(ze)=>ze.filePath,Me,Oe,Fe))qe.add(He);ot=bn(Xe,$e);let We=et();return Ss(We.errors),{result:We,reparsed:Array.from(qe)}}}}import Ng from"node:path";import{mkdir as mg,readFile as gg,writeFile as yg}from"node:fs/promises";import{parse as xg}from"node:path";class Mt{dryRun;constructor(i){this.dryRun=i?.dryRun===!0}async write(i,ve){if(this.dryRun)return console.log(`would write "${e(i)}"`),!0;try{if(await gg(i,"utf-8")===ve)return!1}catch{}return await mg(xg(i).dir,{recursive:!0}),await yg(i,ve),!0}}var bg=/^=>\s*/;function Eg(i){let ve=i.trim();if(!ve.startsWith("("))return{parameters:[],returnTypeText:ve||"any"};let Ae=0,_e=-1;for(let Le=0;Le<ve.length;Le++)if(ve[Le]==="(")Ae++;else if(ve[Le]===")"){if(Ae--,Ae===0){_e=Le;break}}if(_e===-1)return{parameters:[],returnTypeText:"any"};let Ne=ve.slice(1,_e).trim(),Re=ve.slice(_e+1).trim().replace(bg,"");return{parameters:Ne===""?[]:cr(Ne).map((Le)=>{let Me=Le.trim(),$e=Me.startsWith("..."),Be=$e?Me.slice(3):Me,Ve=Be.indexOf(":"),Ue=(Ve===-1?Be:Be.slice(0,Ve)).trim(),Ge=Ve===-1?void 0:Be.slice(Ve+1).trim(),Xe=Ue.endsWith("?");return{name:Xe?Ue.slice(0,-1):Ue,...Ge?{type:{text:Ge}}:{},...Xe?{optional:!0}:{},...$e?{rest:!0}:{}}}),returnTypeText:Re||"any"}}function Cg(i){if(i.params!==void 0||i.returnType!==void 0)return{parameters:(i.params??[]).map((Ae)=>({name:Ae.name,...Ae.type?{type:{text:Ae.type}}:{},...Ae.optional?{optional:!0}:{}})),returnTypeText:i.returnType??"any"};return i.type?Eg(i.type):{parameters:[],returnTypeText:"any"}}function vg(i){return i.map((ve)=>{if(ve.isFunctionDeclaration){let{parameters:Ae,returnTypeText:_e}=Cg(ve);return{kind:"method",name:ve.name,static:!1,...Ae.length>0?{parameters:Ae}:{},return:{type:{text:_e}},...ve.description?{description:ve.description}:{},...ve.deprecated===void 0?{}:{deprecated:ve.deprecated}}}return{kind:"field",name:ve.name,...ve.type?{type:{text:ve.type}}:{},...ve.value===void 0?{}:{default:ve.value},...ve.description?{description:ve.description}:{},...ve.deprecated===void 0?{}:{deprecated:ve.deprecated},...ve.kind==="const"?{readonly:!0}:{}}})}function Sg(i){let ve=i.customElement?.props,Ae=new Map,_e=[];for(let Ne of i.props){if(Ne.isFunctionDeclaration)continue;let Re=ve?.[Ne.name];if(Re?.attribute===!1)continue;let Ie=Re?.attribute||Ne.name.toLowerCase(),Le=Ae.get(Ie);if(Le!==void 0){console.warn(`sveld: props "${Le}" and "${Ne.name}" of component "${i.moduleName}" both map to the custom-element attribute "${Ie}"; only "${Le}" is included.`);continue}Ae.set(Ie,Ne.name);let $e=Re?.type==="Array"||Re?.type==="Object"?[Ne.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):Ne.description;_e.push({name:Ie,fieldName:Ne.name,...Ne.type?{type:{text:Ne.type}}:{},...Ne.value===void 0?{}:{default:Ne.value},...$e?{description:$e}:{},...Re?.reflect?{reflects:!0}:{}})}return _e}function Tg(i){if(!i||i.length===0)return;return i.map((ve)=>({name:ve.name,...ve.description?{description:ve.description}:{}}))}function Ag(i){if(!i||i.length===0)return;return i.map((ve)=>({name:ve.name,...ve.type?{type:{text:ve.type}}:{},...ve.default===void 0?{}:{default:ve.default},...ve.description?{description:ve.description}:{}}))}function kg(i){return i.filter((ve)=>ve.type==="dispatched").map((ve)=>({name:ve.name,type:{text:`CustomEvent<${ve.detail??"unknown"}>`},...ve.description?{description:ve.description}:{},...ve.deprecated===void 0?{}:{deprecated:ve.deprecated}}))}function wg(i){return i.map((ve)=>({name:ve.default?"":ve.name??"",...ve.description?{description:ve.description}:{},...ve.deprecated===void 0?{}:{deprecated:ve.deprecated}}))}function Pg(i){let ve=Tg(i.cssParts),Ae=Ag(i.cssProperties),_e={kind:"class",name:i.moduleName,...i.componentComment?{description:i.componentComment}:{},members:vg(i.props),attributes:Sg(i),events:kg(i.events),slots:wg(i.slots),...ve?{cssParts:ve}:{},...Ae?{cssProperties:Ae}:{}};if(i.customElementTag)_e.tagName=i.customElementTag,_e.customElement=!0;return _e}function _g(i,ve){let Ae=[{kind:"js",name:i.moduleName,declaration:{name:i.moduleName,module:ve}}];if(i.customElementTag)Ae.push({kind:"custom-element-definition",name:i.customElementTag,declaration:{name:i.moduleName,module:ve}});return Ae}function Bl(i,ve={}){let Ae=s(i),_e=ve.resolveModulePath??((Re)=>Re.filePath);return{schemaVersion:"1.0.0",modules:Ae.components.map((Re)=>{let Ie=_e(Re);return{kind:"javascript-module",path:Ie,declarations:[Pg(Re)],exports:_g(Re,Ie)}})}}function Fi(i,ve){let Ae=Bl(i,{resolveModulePath:(_e)=>es(_e.filePath,ve.inputDir)});return $r(Ae)}async function ji(i,ve){let Ae=Fi(i,ve),_e=Ng.join(process.cwd(),ve.outFile),Re=await new Mt({dryRun:ve.dryRun}).write(_e,Ae);if(!ve.dryRun)zt(`${Re?"created":"unchanged"} "${ve.outFile}".`)}import Vi from"node:path";function $l(i){let ve=new Map;for(let[_e,Ne]of Object.entries(i)){let Re=ve.get(Ne.source)||[];Re.push({id:_e,exportee:Ne}),ve.set(Ne.source,Re)}let Ae=[];for(let[_e,Ne]of ve){let Re=Pr.test(_e),Ie=Ne.some(({id:Ue,exportee:Ge})=>Ue!=="default"&&Ge.default),Le=Ne.some(({exportee:Ue})=>!Ue.default),Me=Re&&Ie&&Le,$e=[],Be=[],Ve=[];for(let{id:Ue,exportee:Ge}of Ne){if(Ue==="default"){Be.push(`export { default } from "${_e}";`);continue}if(Ge.default)if(Ge.mixed)Be.push(`export { default as ${Ue} } from "${_e}";`),Be.push(`export { default } from "${_e}";`);else Ve.push(`default as ${Ue}`);else if(Re&&!Me)Ve.push(`default as ${Ue}`);else $e.push(Ue)}if(Ve.length>0&&$e.length>0)Ae.push(`export { ${[...Ve,...$e].join(", ")} } from "${_e}";`);else{if($e.length>0)Ae.push(`export { ${$e.join(", ")} } from "${_e}";`);if(Ve.length>0)Ae.push(`export { ${Ve.join(", ")} } from "${_e}";`)}Ae.push(...Be)}return Ae.join(`
42
- `)}function Fl(i){return i.replace(Pr,"")}function jl(i){return i.replace(Pr,".svelte.d.ts")}function Ig(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)&&"start"in i&&"end"in i}function vn(i){if(Array.isArray(i))return i.map((ve)=>vn(ve));if(i!==null&&typeof i==="object"){let ve={};for(let[Ae,_e]of Object.entries(i)){if((Ae==="source"||Ae==="componentCommentSource")&&Ig(_e))continue;ve[Ae]=vn(_e)}return ve}return i}function qi(i,ve){return i.map((Ae)=>({...Ae,filePath:es(Ae.filePath,ve)}))}function Dg(i,ve,Ae){if(!ve)return`${i.moduleName}.api.json`;if(!Ae.has(i.moduleName))Ae.add(i.moduleName),console.warn(`Warning: multiple components named "${i.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${Fl(i.filePath)}.api.json`}async function Rg(i,ve){let Ae=s(i),_e=qi(Ae.components,ve.inputDir);if(ve.source===!1)_e=vn(_e);let Ne=new Map;for(let Ie of _e)Ne.set(Ie.moduleName,(Ne.get(Ie.moduleName)??0)+1);let Re=new Set;await Promise.all(_e.map(async(Ie)=>{let Le=(Ne.get(Ie.moduleName)??0)>1,Me=Dg(Ie,Le,Re),$e=Vi.resolve(Vi.join(ve.outDir||"",Me)),Ve=await new Mt({dryRun:ve.dryRun}).write($e,$r(Ie));if(!ve.dryRun)zt(`${Ve?"created":"unchanged"} "${$e}".`)}))}function Ui(i,ve){let Ae=s(i,{entryExports:ve.entryExports}),_e={...Ae,components:qi(Ae.components,ve.inputDir)};if(ve.source===!1)_e=vn(_e);return $r(_e)}function Vl(i,ve){let Ae=s(i,{entryExports:ve.entryExports}),_e=qi(Ae.components,ve.inputDir);if(ve.source===!1)_e=vn(_e);return`${_e.map((Ne)=>JSON.stringify(Ne)).join(`
43
- `)}
44
- `}async function Lg(i,ve){let Ae=Ui(i,ve),_e=Vi.join(process.cwd(),ve.outFile),Re=await new Mt({dryRun:ve.dryRun}).write(_e,Ae);if(!ve.dryRun)zt(`${Re?"created":"unchanged"} "${ve.outFile}".`)}async function Gi(i,ve){if(ve.outDir)await Rg(i,ve);else await Lg(i,ve)}import Ls from"node:path";import{readFileSync as Og}from"node:fs";import{join as Mg}from"node:path";function ql(){try{let{name:i,description:ve}=us(JSON.parse(Og(Mg(process.cwd(),"package.json"),"utf-8")));return{name:i,description:ve}}catch{return{}}}var Bg=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var $g=/[ \t]+$/,Gl=/\s/,Fg=/\s{2}|[^\S ]/;function jg(i){return Bg.test(i.slice(-200))}var Ul=[""];function Wi(i){let ve=Ul[i];if(ve===void 0)ve=" ".repeat(i),Ul[i]=ve;return ve}function Vg(i,ve){let Ae="";for(let _e=i.length-1;_e>=0&&Ae.length<ve;_e--)Ae=i[_e]+Ae;return Ae.length>ve?Ae.slice(-ve):Ae}function qg(i){if(i.length===0)return!1;let ve=i[i.length-1];return ve.charCodeAt(ve.length-1)===10}function Ug(i){while(i.length>0){let ve=i[i.length-1],Ae=ve.length;while(Ae>0){let _e=ve.charCodeAt(Ae-1);if(_e!==32&&_e!==9)break;Ae--}if(Ae===ve.length)return;if(Ae===0){i.pop();continue}i[i.length-1]=ve.slice(0,Ae);return}}function Gg(i){while(i.length>0){let ve=i[i.length-1];if(!Gl.test(ve[ve.length-1]))return;let Ae=ve.trimEnd();if(Ae.length===ve.length)return;if(Ae.length===0){i.pop();continue}i[i.length-1]=Ae;return}}function Wg(i){if(i.includes("{"))return!1;let ve=0,Ae=0;for(let _e=0;_e<i.length;_e++){let Ne=i.charCodeAt(_e);if(ve!==0){if(Ne===ve&&i.charCodeAt(_e-1)!==92)ve=0;continue}if(Ne===34||Ne===39||Ne===96){ve=Ne;continue}if(Ne===59&&++Ae>=2)return!0}return!1}function Hg(i){if(!Fg.test(i))return i.trimEnd();let ve="",Ae=null,_e=!1;for(let Ne=0;Ne<i.length;Ne++){let Re=i[Ne],Ie=i[Ne-1];if(Ae){if(ve+=Re,Ae==="double"&&Re==='"'&&Ie!=="\\"||Ae==="single"&&Re==="'"&&Ie!=="\\"||Ae==="template"&&Re==="`"&&Ie!=="\\")Ae=null;_e=!1;continue}if(Re==='"'||Re==="'"||Re==="`"){Ae=Re==='"'?"double":Re==="'"?"single":"template",ve+=Re,_e=!1;continue}if(Gl.test(Re)){if(!_e&&ve.length>0)ve+=" ",_e=!0;continue}ve+=Re,_e=!1}return ve.trimEnd()}function Kg(i){let ve=new Int32Array(i.length).fill(-1),Ae=[],_e=0;for(let Ne=0;Ne<i.length;Ne++){let Re=i.charCodeAt(Ne);if(_e===4){if(Re===47&&i.charCodeAt(Ne-1)===42)_e=0;continue}if(_e===1){if(Re===34&&i.charCodeAt(Ne-1)!==92)_e=0;continue}if(_e===2){if(Re===39&&i.charCodeAt(Ne-1)!==92)_e=0;continue}if(_e===3){if(Re===96&&i.charCodeAt(Ne-1)!==92)_e=0;continue}if(Re===47){if(i.charCodeAt(Ne+1)===42)_e=4}else if(Re===34)_e=1;else if(Re===39)_e=2;else if(Re===96)_e=3;else if(Re===123)Ae.push(Ne);else if(Re===125&&Ae.length>0)ve[Ae.pop()]=Ne}return ve}function Wl(i,ve,Ae,_e){let Ne=[],Re=0,Ie=ve;for(let Le=ve;Le<Ae;Le++){let Me=i.charCodeAt(Le);if(Re===4){if(Me===47&&i.charCodeAt(Le-1)===42)Re=0;continue}if(Re===1){if(Me===34&&i.charCodeAt(Le-1)!==92)Re=0;continue}if(Re===2){if(Me===39&&i.charCodeAt(Le-1)!==92)Re=0;continue}if(Re===3){if(Me===96&&i.charCodeAt(Le-1)!==92)Re=0;continue}if(Me===47){if(i.charCodeAt(Le+1)===42)Re=4;continue}if(Me===34){Re=1;continue}if(Me===39){Re=2;continue}if(Me===96){Re=3;continue}if(Me===123){let $e=_e[Le];if($e===-1||$e>=Ae)continue;if(Ie<Le)Ne.push(i.slice(Ie,Le));let Be=Le+1,Ve=i.slice(Be,$e);if(Ve.trim()===""){Ne.push("{}"),Le=$e,Ie=$e+1;continue}let Ue=i.charCodeAt(Be)===10;if(!Ue&&!Ve.includes("/*")&&!Wg(Ve)&&!jg(Vg(Ne,200))){let Ge=Wl(i,Be,$e,_e),Xe=Ge.trim();if(!Xe.includes(`
45
- `)){let Je=Xe.endsWith(";")?Xe.slice(0,-1):Xe,Ke=`{ ${Hg(Je)} }`;if(Ke.length<=120){Ne.push(Ke),Le=$e,Ie=$e+1;continue}}if(Ne.push("{"),Ge.charCodeAt(0)!==59)Ne.push(`
46
- `);if(Ge.length>0)Ne.push(Ge);Le=$e-1,Ie=$e;continue}if(Ne.push("{"),!Ue)Ne.push(`
47
- `);Ie=Be;continue}if(Me===125){if(Ie<Le)Ne.push(i.slice(Ie,Le));if(Ug(Ne),!qg(Ne))Ne.push(`
48
- `);Ne.push("}"),Ie=Le+1;continue}if(Me===59){if(Ie<Le)Ne.push(i.slice(Ie,Le));if(Gg(Ne),Ne.push(";"),i.charCodeAt(Le+1)!==10)Ne.push(`
49
- `);Ie=Le+1}}if(Ie<Ae)Ne.push(i.slice(Ie,Ae));return Ne.join("")}function zg(i){return Wl(i,0,i.length,Kg(i))}function Xg(i){if(!i.includes(" "))return i;let ve="",Ae=0;for(let _e=0;_e<i.length;_e++){let Ne=i.charCodeAt(_e);if(Ae!==0){if(ve+=i[_e],Ne===Ae&&i.charCodeAt(_e-1)!==92)Ae=0;continue}if(Ne===34||Ne===39||Ne===96){Ae=Ne,ve+=i[_e];continue}if(Ne===32&&ve.charCodeAt(ve.length-1)===32)continue;ve+=i[_e]}return ve}function Hl(i){let ve=i.charCodeAt(0);return ve===125||ve===93||ve===41||ve===62}function Jg(i){let ve=i.split(`
50
- `),Ae=[],_e=0,Ne=!1,Re=0;for(let Ie=0;Ie<ve.length;Ie++){let Le=ve[Ie].trim();if(Le===""){Ae.push("");continue}if(Ne){if(Ae.push(`${Wi(Re)} ${Le}`),Le.includes("*/"))Ne=!1;continue}if(Le.startsWith("/**")&&!Le.includes("*/")){Ae.push(Wi(_e)+Le),Ne=!0,Re=_e;continue}let Me=Xg(Le),$e=Math.max(0,_e-(Hl(Me)?1:0));if(Ae.push(Wi($e)+Me),Me.startsWith("/**")&&Me.includes("*/"))continue;let Be=0;for(let Ve=0;Ve<Me.length;Ve++){let Ue=Me.charCodeAt(Ve);if(Be!==0){if(Ue===Be&&Me.charCodeAt(Ve-1)!==92)Be=0;continue}if(Ue===34||Ue===39||Ue===96)Be=Ue;else if(Ue===123||Ue===40||Ue===91||Ue===60)_e++;else if(Ue===125||Ue===41||Ue===93)_e=Math.max(0,_e-1);else if(Ue===62&&Me.charCodeAt(Ve-1)!==61)_e=Math.max(0,_e-1)}}return Ae}function Yg(i){let ve=[];for(let Ae=0;Ae<i.length;Ae++){let _e=i[Ae],Ne=_e.charCodeAt(_e.length-1);if(Ne===32||Ne===9)_e=_e.replace($g,"");let Re=ve.length>0?ve[ve.length-1]:void 0,Ie=Re==="";if(_e===""){if(Re===void 0||Ie)continue;let Le=Re.charCodeAt(Re.length-1);if(Le===123||Le===40||Le===91)continue;ve.push(_e);continue}if(Ie&&Hl(_e))ve.pop();ve.push(_e)}while(ve.length>0&&ve[ve.length-1]==="")ve.pop();return ve.join(`
51
- `)}function Kl(i){return`${Yg(Jg(zg(i)))}
52
- `}var Er="any",ir="",Qg="Record<string, any>",Ki="Record<string, never>",Zg=/^[A-Za-z_$][A-Za-z0-9_$]*$/,ey=/CustomEvent/,ty=/^[A-Z]/,ry=/\n/,Yl=/=>/,ny=/(?:^|\n)@default\b/,zi=/\n/g,sy=/\s+/g,Qr=/(^|[^.\w])Snippet(?:\s*<|\b)/,iy=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,ay=/[.*+?^${}()|[\]\\]/g,oy=/^const\s+/;function Xi(i){return i.replace(oy,"")}function cy(i){if(!i)return;return i.replace(zi,`
53
- * `)}function As(i){if(!i)return"";return`/** ${i} */`}function ks(i){if(!i)return"";return`/**
54
- * ${i.replace(zi,`
55
- * `)}
56
- */`}function Ql(i){if(i===void 0)return;return i===!0?"@deprecated":`@deprecated ${i}`}function ly(i){let ve=Ql(i);if(ve===void 0)return;return`* ${ve.replace(zi,`
57
- * `)}
58
- `}function py(i,ve){if(!ve)return[`@${i}`];if(!ve.includes(`
59
- `))return[`@${i} ${ve}`];return[`@${i}`,...ve.split(`
60
- `)]}function Ji(i){let ve=[];for(let{name:Ae,body:_e}of i??[])ve.push(...py(Ae,_e));return ve}function Sn(i,ve,Ae){let _e=Ql(Ae),Ne=Ji(ve),Re=Ne.length>0;if(!i&&!Re&&!_e)return"";if(!Re&&!_e)return i?.includes(`
61
- `)?ks(i):As(i);let Ie=[];if(i)Ie.push(...i.split(`
62
- `));if(Ie.push(...Ne),_e)Ie.push(..._e.split(`
63
- `));return`/**
64
- * ${Ie.join(`
65
- * `)}
66
- */`}function uy(i){let ve=Ji(i);if(ve.length===0)return"";return ve.map((Ae)=>`* ${Ae}
67
- `).join("")}function ws(i){if(i===void 0)return Er;return`${i}
68
- `}function en(i){if(i.typedefs.length===0)return ir;return i.typedefs.map((ve)=>{let Ae=Ji(ve.tags),_e;if(Ae.length===0)_e=ve.description?`${ks(ve.description)}
69
- `:"";else _e=`/**
70
- * ${(ve.description?[...ve.description.split(`
71
- `),...Ae]:Ae).join(`
72
- * `)}
73
- */
74
- `;return`${_e}export ${ve.ts}`}).join(`
75
-
76
- `)}var zl=new Map;function Zl(i,ve){let Ae=zl.get(ve);if(Ae===void 0){let _e=ve.replace(ay,"\\$&");Ae=new RegExp(`\\b${_e}\\b`),zl.set(ve,Ae)}return Ae.test(i)}var Xl,Jl=[];function Yi(i){if(i!==Xl)Xl=i,Jl=cr(i);return Jl}function hy(i){if(i===null)return[];return i[0].split(",").map((ve,Ae)=>({name:ve.trim(),constraint:(Yi(i[1]??"")[Ae]??ve).trim()}))}function fy(i,ve){let Ae=hy(i).filter(({name:_e})=>Zl(ve,_e));if(Ae.length===0)return{declSuffix:ir,refSuffix:ir};return{declSuffix:`<${Ae.map(({constraint:_e})=>Xi(_e)).join(", ")}>`,refSuffix:`<${Ae.map(({name:_e})=>_e).join(", ")}>`}}function ep(i){if(!i.contexts||i.contexts.length===0)return ir;let ve=i.generics===null?[]:i.generics[0].split(",").map((Ae,_e)=>({name:Ae.trim(),constraint:(Yi(i.generics?.[1]??"")[_e]??Ae).trim()}));return i.contexts.map((Ae)=>{let _e=Ae.properties.map((Me)=>{let $e=Me.description?`${As(Me.description)}
77
- `:"",Be=Me.optional?"?":"";return`${$e}${Me.name}${Be}: ${Me.type};`}).join(`
78
- `),Ne=Ae.description?`${ks(Ae.description)}
79
- `:"",Re=ve.filter(({name:Me})=>Ae.properties.some(($e)=>Zl($e.type,Me))).map(({constraint:Me})=>Me),Ie=Re.length>0?`<${Re.map(Xi).join(", ")}>`:"";if(Ae.properties.length===0)return Ae.hasUnresolvedSpread?`${Ne}export type ${Ae.typeName} = Record<string, any>;`:`${Ne}export type ${Ae.typeName} = Record<string, never>;`;let Le=Ae.hasUnresolvedSpread?" & Record<string, any>":"";return`${Ne}export type ${Ae.typeName}${Ie} = {
80
- ${_e}
81
- }${Le};`}).join(`
82
-
83
- `)}function Zr(i){return Zg.test(i)?i:JSON.stringify(i)}function tp(i,ve){if(!i)return;return`* ${ve||i}
84
- `}function Qi(i,ve,Ae){return[tp(cy(i)),ly(ve),uy(Ae)].filter(Boolean).join("")}function Zi(i){return i.length>0?`/**
85
- ${i}*/`:ir}function dy(i){let ve=i.props.filter((Ke)=>!Ke.isFunctionDeclaration&&Ke.kind!=="const"),Ae=new Set([...ve.map((Ke)=>Ke.name),...Array.from(i.canonicalPropNames??[])]),_e=ve.map((Ke)=>{let et=typeof Ke.value==="string"?Ke.value.replace(sy," "):Ke.value,it=ny.test(Ke.description??"")||Ke.value===void 0,at=[Qi(Ke.description,Ke.deprecated,Ke.tags),tp(Ke.constant,"@constant"),it?null:`* @default ${et}
86
- `].filter(Boolean).join(""),tt=Ke.constant&&!Ke.isFunction?Ke.value:Ke.type||Er;return`
87
- ${Zi(at)}
88
- ${Zr(Ke.name)}${Ke.isRequired?"":"?"}: ${tt};`}),Ne=i.canonicalPropsType?_e.filter((Ke,et)=>{let ot=ve[et];return ot?!(i.canonicalPropNames?.has(ot.name)??!1):!0}):_e,Re=(i.slots||[]).filter((Ke)=>!Ke.default&&Ke.name!=null&&!Ae.has(Ke.name)).map((Ke)=>{let et=Ke.name,ot=Zr(et),it=Sn(Ke.description,Ke.tags,Ke.deprecated),at=it?`${it}
89
- `:"",xt=Ke.slot_props&&Ke.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Ke.slot_props}]) => void`:"(this: void) => void";return`
90
- ${at}${ot}?: ${xt};`}),Ie=(i.slots||[]).find((Ke)=>Ke.default||Ke.name===null),Le=Ie&&!Ae.has("children")?(()=>{let Ke=Sn(Ie.description,Ie.tags,Ie.deprecated),et=Ke?`${Ke}
91
- `:"",it=Ie.slot_props&&Ie.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Ie.slot_props}]) => void`:"(this: void) => void";return`
92
- ${et}children?: ${it};`})():"",Me=i.events?Ey({events:i.events},Ae):[],$e=[...Re,Le,...Me].filter(Boolean),Be=[...Ne,...$e].join(`
93
- `),Ve=`${i.moduleName}Props`,Ue=ir,Ge=i.generics?`<${Yi(i.generics[1]).map((Ke)=>Xi(Ke.trim())).join(", ")}>`:"",Xe=i.generics?`<${i.generics[0]}>`:"",Je=i.canonicalPropsType?`
94
- type $Props${Ge} = ${i.canonicalPropsType}${Be.trim()===""?"":` & {${Be}
95
- }`};
96
- `:`
97
- type $Props${Ge} = {
98
- ${Be}
99
- };
100
- `;if(i.rest_props?.type==="Element"){let Ke;if(i.rest_props.name==="svelte:element")if(i.rest_props.thisValue)Ke=`SvelteHTMLElements["${i.rest_props.thisValue}"]`;else Ke="HTMLAttributes<HTMLElement>";else Ke=i.rest_props.name.split("|").map((it)=>`SvelteHTMLElements["${it.trim()}"]`).join(" & ");let et="[key: `data-${string}`]: unknown;",ot=i.rest_props.description?i.rest_props.description.includes(`
101
- `)?`${ks(i.rest_props.description)}
102
- `:`${As(i.rest_props.description)}
103
- `:"";if(i.extends===void 0)Ue=`
104
- ${ot}${Ke?`type $RestProps = ${Ke};
105
- `:""}
106
- ${i.canonicalPropsType?`type $Props${Ge} = (${i.canonicalPropsType}) & {${Be}
107
-
108
- ${et}
109
- };`:`type $Props${Ge} = {
110
- ${Be}
111
-
112
- ${et}
113
- };`}
114
-
115
- export type ${Ve}${Ge} = Omit<$RestProps, keyof $Props${Xe}> & $Props${Xe};
116
- `;else Ue=`
117
- ${ot}${Ke?`type $RestProps = ${Ke};
118
- `:""}
119
- ${i.canonicalPropsType?`type $Props${Ge} = (${i.canonicalPropsType}) & {${Be}
120
-
121
- ${et}
122
- };`:`type $Props${Ge} = {
123
- ${Be}
124
-
125
- ${et}
126
- };`}
127
-
128
- export type ${Ve}${Ge} = Omit<$RestProps, keyof ($Props${Xe} & ${i.extends.interface})> & Omit<${i.extends.interface}, keyof $Props${Xe}> & $Props${Xe};
129
- `}else if(Be.trim()===""&&i.extends===void 0&&!i.canonicalPropsType)Ue=`
130
- export type ${Ve}${Ge} = ${Ki};
131
- `;else if(i.canonicalPropsType)Ue=`
132
- ${Je}
133
- export type ${Ve}${Ge} = ${i.extends===void 0?"":`Omit<${i.extends.interface}, keyof $Props${Xe}> & `}$Props${Xe};
134
- `;else if(i.extends===void 0)Ue=`
135
- export type ${Ve}${Ge} = {
136
- ${Be}
137
- };
138
- `;else Ue=`
139
- type $Props${Ge} = {
140
- ${Be}
141
- };
142
-
143
- export type ${Ve}${Ge} = Omit<${i.extends.interface}, keyof $Props${Xe}> & $Props${Xe};
144
- `;return{props_name:Ve,prop_def:Ue}}function my(i){if(i.slots.length===0)return Ki;let ve=i.slots.map(({name:Ae,slot_props:_e,...Ne})=>{let Re=Ne.default||Ae===null?"default":Zr(Ae??""),Ie=Sn(Ne.description,Ne.tags,Ne.deprecated);return`${Ie?`${Ie}
145
- `:""}${Re}: ${ws(_e)};`}).join(`
146
- `);return i.slots.length===1?`{${ve}}`:`{
147
- ${ve}
148
- }`}var gy=()=>"WindowEventMap",yy=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","contextmenu","wheel","keydown","keyup","keypress","submit","change","input","focus","blur","focusin","focusout","reset","select","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","pointerdown","pointerup","pointermove","pointerover","pointerout","pointerenter","pointerleave","pointercancel","gotpointercapture","lostpointercapture","play","pause","ended","volumechange","timeupdate","loadeddata","loadedmetadata","canplay","canplaythrough","seeking","seeked","playing","waiting","stalled","suspend","abort","error","emptied","ratechange","durationchange","loadstart","progress","loadend","animationstart","animationend","animationiteration","animationcancel","transitionstart","transitionend","transitionrun","transitioncancel","scroll","resize","load","unload","beforeunload","cut","copy","paste","compositionstart","compositionupdate","compositionend"]);function Hi(i=Er){if(ey.test(i))return i;return`CustomEvent<${i}>`}function xy(i){return yy.has(i)}function rp(i){switch(i.type){case"dispatched":return Hi(i.detail);case"forwarded":{let ve=i.element,_e=!(ve&&ty.test(ve))||xy(i.name),Ne=i.detail!==void 0&&i.detail!=="undefined"&&!(i.detail==="null"&&_e),Re=i.detail==="null"&&!_e;if(Ne||Re)return Hi(i.detail);else if(_e)return`${gy()}["${i.name}"]`;else return Hi()}default:return i}}function by(i){if(i.events.length===0)return Qg;let ve=i.events.map((Ae)=>{let _e="",Ne=Sn(Ae.description,Ae.tags,Ae.deprecated);if(Ne)_e=`${Ne}
149
- `;return`${_e}${Zr(Ae.name)}: ${rp(Ae)};
150
- `}).join("");return i.events.length===1?`{${ve}}`:`{
151
- ${ve}}`}function Ey(i,ve){return i.events.map((Ae)=>{let _e=`on${Ae.name}`;if(ve.has(_e))return;let Ne="",Re=Sn(Ae.description,Ae.tags,Ae.deprecated);if(Re)Ne=`${Re}
152
- `;return`
153
- ${Ne}${Zr(_e)}?: (event: ${rp(Ae)}) => void;`}).filter((Ae)=>Ae!==void 0)}function Cy(i){let ve=i.type==="() => any";if(i.type&&Yl.test(i.type)&&!ve)return i.type;else if(i.params&&i.params.length>0){let _e=i.params.map((Re)=>{let Ie=Re.optional?"?":"";return`${Re.name}${Ie}: ${Re.type}`}).join(", "),Ne=i.returnType||Er;return`(${_e}) => ${Ne}`}else if(i.returnType)return`() => ${i.returnType}`;else return i.type||Er}function np(i){return i.props.filter((ve)=>ve.isFunctionDeclaration||ve.kind==="const").map((ve)=>{let Ae=Qi(ve.description,ve.deprecated,ve.tags),_e=Cy(ve);return`
154
- ${Zi(Ae)}
155
- ${Zr(ve.name)}: ${_e};`}).join(`
156
- `)}function vy(i){let ve=`${i.moduleName}Exports`,Ae=np({props:i.props});if(Ae.trim()==="")return{exports_name:ve,exports_ref:ve,exports_def:`export type ${ve} = ${Ki};`};let{declSuffix:_e,refSuffix:Ne}=fy(i.generics,Ae);return{exports_name:ve,exports_ref:`${ve}${Ne}`,exports_def:`export type ${ve}${_e} = {${Ae}
157
- };`}}function Sy(i){let ve=i.props.filter((Ae)=>Ae.bindable===!0||Ae.binding==="writable").map((Ae)=>JSON.stringify(Ae.name));return ve.length===0?ir:ve.join(" | ")}function Ty(i){let ve=i.moduleName==="default"?"$$Component":i.moduleName,Ae=i.bindings===ir?'""':i.bindings;return`declare const ${ve}: Component<
158
- ${i.propsRef},
159
- ${i.exportsRef},
160
- ${Ae}
161
- >;
162
- export default ${ve};`}function Ay(i){let ve=i.moduleName==="default"?"$$Component":i.moduleName,Ae=`${ve}Component`,_e=i.bindings===ir?'""':i.bindings;return`interface ${Ae} {
163
- new ${i.generic}(
164
- options: ComponentConstructorOptions<${i.propsRef}>
165
- ): SvelteComponent<${i.propsRef}> & ${i.exportsRef};
166
- ${i.generic}(
167
- this: void,
168
- internals: ComponentInternals,
169
- props: ${i.propsRef}
170
- ): {
171
- $on?(type: string, callback: (e: any) => void): () => void;
172
- $set?(props: Partial<${i.propsRef}>): void;
173
- } & ${i.exportsRef};
174
- element?: typeof HTMLElement;
175
- z_$$bindings?: ${_e};
176
- }
177
- declare const ${ve}: ${Ae};
178
- export default ${ve};`}function ky(i){if(i.extends===void 0)return"";return`import type { ${i.extends.interface} } from ${i.extends.import};`}function wy(i){if(!i.componentComment)return"";if(!ry.test(i.componentComment))return As(i.componentComment.trim());return`/*${i.componentComment.split(`
179
- `).map((ve)=>`* ${ve}`).join(`
180
- `)}
181
- */`}function Py(i){return i.moduleExports.map((ve)=>{let Ae=Qi(ve.description,ve.deprecated,ve.tags),_e,Ne=ve.type&&Yl.test(ve.type),Re=ve.type==="() => any";if(ve.kind==="const"&&!Ne)_e=`export declare const ${ve.name}: ${ve.type||Er};
182
- `;else if(ve.params&&ve.params.length>0){let Le=ve.params.map(($e)=>{let Be=$e.optional?"?":"";return`${$e.name}${Be}: ${$e.type}`}).join(", "),Me=ve.returnType||Er;_e=`export declare function ${ve.name}(${Le}): ${Me};`}else if(ve.returnType)_e=`export declare function ${ve.name}(): ${ve.returnType};`;else if(Ne&&ve.type&&!Re){let[Ie,Le,...Me]=ve.type.split("=>"),$e=Me.map((Be)=>` => ${Be.trim()}`).join("");_e=`export declare function ${ve.name}${Ie.trimEnd()}: ${Le.trim()}${$e};`}else if(Ne&&ve.type){let[Ie,Le,...Me]=ve.type.split("=>"),$e=Me.map((Be)=>` => ${Be.trim()}`).join("");_e=`export declare function ${ve.name}${Ie.trimEnd()}: ${Le.trim()}${$e};`}else if(ve.kind==="const")_e=`export declare const ${ve.name}: ${ve.type||Er};
183
- `;else _e=`export type ${ve.name} = ${ve.type||Er};`;return`
184
- ${Zi(Ae)}
185
- ${_e}`}).join(`
186
- `)}var _y=120;function Ny(i){let Ae=`export default class ${i.moduleName==="default"?"":i.moduleName}${i.generic} extends SvelteComponentTyped<`,_e=[i.genericProps,i.events,i.slots];if(i.accessors.trim()===""&&_e.every((Ne)=>!Ne.includes(`
187
- `))){let Ne=`${Ae}${_e.join(", ")}> {}`;if(Ne.length<=_y)return Ne}return`${Ae}
188
- ${i.genericProps},
189
- ${i.events},
190
- ${i.slots}
191
- > {
192
- ${i.accessors}
193
- }`}function ea(i,ve){let Ae=Kr(i),{moduleName:_e,typedefs:Ne,generics:Re,props:Ie,moduleExports:Le,slots:Me,events:$e,rest_props:Be,extends:Ve,componentComment:Ue,contexts:Ge,syntaxMode:Xe}=i,Je=ve?.format==="component",Ke=Re!==null,{props_name:et,prop_def:ot}=dy({moduleName:_e,props:Ie,rest_props:Be,extends:Ve,generics:Re,slots:Me,canonicalPropNames:new Set(Ae?.canonicalPropNames??[]),canonicalPropsType:Ae?.canonicalPropsType,events:Je&&Xe==="legacy"?$e:void 0}),it=Re?`<${Re[1]}>`:"",at=Re?`${et}<${Re[0]}>`:et,tt=Py({moduleExports:Le}),xt=en({typedefs:Ne}),Nt=ep({contexts:Ge,generics:Re}),Tt=(Ae?.typeImportStatements??[]).join(`
194
- `),De=(Ae?.localTypeDeclarations??[]).join(`
195
-
196
- `),{exports_ref:Oe,exports_def:Fe}=Je?vy({props:Ie,moduleName:_e,generics:Re}):{exports_ref:ir,exports_def:ir},qe=Je?Sy({props:Ie}):ir,We=!iy.test(Tt)&&(Qr.test(ot)||Qr.test(tt)||Qr.test(xt)||Qr.test(Nt)||Qr.test(De)||Qr.test(Fe)),He=Be?.type==="Element"&&(Be.name!=="svelte:element"||Be.name==="svelte:element"&&Be.thisValue),ze=Be?.type==="Element"&&Be.name==="svelte:element"&&!Be.thisValue,Qe=[Je?Ke?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${We?", Snippet":""} } from "svelte";`:`import type { Component${We?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${We?", type Snippet":""} } from "svelte";`,He?'import type { SvelteHTMLElements } from "svelte/elements";':"",ze?'import type { HTMLAttributes } from "svelte/elements";':"",Tt,ky({extends:Ve})].filter(Boolean).join(`
197
- `),Ye=Je?Ke?Ay({moduleName:_e,generic:it,propsRef:at,exportsRef:Oe,bindings:qe}):Ty({moduleName:_e,propsRef:at,exportsRef:Oe,bindings:qe}):Ny({moduleName:_e,generic:it,genericProps:at,events:by({events:$e}),slots:my({slots:Me}),accessors:np({props:Ie})}),lt=[tt,xt,De,Nt,ot,Fe,[wy({componentComment:Ue}),Ye].filter(Boolean).join(`
198
- `)].map((bt)=>bt.trim()).filter(Boolean).join(`
199
-
200
- `);return Kl([Qe,lt].filter(Boolean).join(`
201
-
202
- `))}var ra=/`/g,sp=/\s+/g,qt="--",ip=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
203
- | :- | :- | :- | :- | :- | :- | :- | :- |
204
- `,Ps=`| Slot name | Default | Props | Fallback | Description |
205
- | :- | :- | :- | :- | :- |
206
- `,_s=`| Event name | Type | Detail | Description |
207
- | :- | :- | :- | :- |
208
- `,na=`| Name | Kind | Type | Description |
209
- | :- | :- | :- | :- |
210
- `,ap=`| Part name | Description |
211
- | :- | :- |
212
- `,op=`| Property name | Type | Default value | Description |
213
- | :- | :- | :- | :- |
214
- `,An=/\|/g,Iy=/</g,Dy=/>/g,tn=/\n/g,Ry=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function ta(i){return i.replace(Ry,(ve,Ae,_e)=>`[${_e===void 0?Ae:_e.trim()}](${Ae})`)}function ar(i){if(i===void 0)return qt;return`<code>${i.replace(An,"&#124;")}</code>`}function Tn(i){return i.replace(Iy,"&lt;").replace(Dy,"&gt;")}function kn(i){if(i===void 0)return qt;return`<code>${i.replace(ra,"\\`").replace(An,"&#124;")}</code>`}function ur(i,ve){if(ve===void 0)return i;let Ae=typeof ve==="string"&&ve.trim().length>0?`: ${Tn(ve).replace(tn," ").replace(An,"&#124;")}`:"";return`<s>${i}</s><br />**Deprecated**${Ae}`}function Ns(i){if(i===void 0||i.trim().length===0)return qt;return Tn(ta(i)).replace(An,"&#124;").replace(tn,"<br />")}function Is(i){if(i===void 0||i==="{}")return qt;return ar(ws(i).replace(tn," "))}function Ds(i){if(i===void 0)return qt;return ar(Tn(i).replace(tn,"<br />"))}function Cr(i,ve){let Ae=[];if(i!==void 0&&i.trim().length>0)Ae.push(Tn(ta(i)));for(let{name:_e,body:Ne}of ve??[]){let Re=Ne?.trim();Ae.push(Re?`@${_e} ${Tn(ta(Re))}`:`@${_e}`)}if(Ae.length===0)return qt;return Ae.join(`
215
- `).replace(An,"&#124;").replace(tn,"<br />")}function Rs(i){if(i===void 0)return qt;return ar(i.replace(tn," "))}var Ly=/[^\w\- ]+/g,Oy=/\s+/g;function My(i,ve){let Ae=i.toLowerCase().replace(ra,"").replace(Ly,"").replace(Oy,"-"),_e=ve.get(Ae)??0;return ve.set(Ae,_e+1),_e===0?Ae:`${Ae}-${_e}`}class rn{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
216
-
217
- `),this}append(i,ve){switch(i){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let Ae=Number(i.slice(-1));if(this.sourceParts.push(`${"#".repeat(Ae)} ${ve}`),this.hasToC&&i==="h2")this.toc.push({indent:0,raw:ve??""});break}case"quote":this.sourceParts.push(`> ${ve}`);break;case"p":this.sourceParts.push(ve??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(ve??"");break}if(i!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let i=this.sourceParts.join(""),ve=new Map;return i.replace("<!-- __TOC__ -->",this.toc.map(({indent:Ae,raw:_e})=>`${" ".repeat(Ae)}- [${_e}](#${My(_e,ve)})`).join(`
218
- `))}}var By=`| Name | Type | Default | Required | Description |
219
- | :- | :- | :- | :- | :- |
220
- `,$y=/[.!?](?:\s|$)/,Fy=/\r?\n[ \t]*\r?\n/,jy=/\s+/g;function cp(i,ve){if(!i)return ve;let Ae=i.trim().split(Fy)[0]?.replace(jy," ").trim();if(!Ae)return ve;let _e=$y.exec(Ae);return _e?Ae.slice(0,_e.index+1):Ae}function sa(i,ve,Ae){if(Ae.length===0)return;i.append("h3",ve),i.append("raw",By);for(let _e of Ae)i.append("raw",`| ${ur(_e.name,_e.deprecated)} | ${ar(_e.type)} | ${kn(_e.value)} | ${_e.isRequired?"Yes":"No"} | ${Cr(_e.description,_e.tags)} |
221
- `);i.append("raw",`
222
- `)}function Vy(i,ve){if(ve.length===0)return;i.append("h3","Events"),i.append("raw",_s);for(let Ae of ve)i.append("raw",`| ${ur(Ae.name,Ae.deprecated)} | ${Ae.type} | ${Ae.type==="dispatched"?Rs(Ae.detail):qt} | ${Cr(Ae.description,Ae.tags)} |
223
- `);i.append("raw",`
224
- `)}function qy(i,ve,Ae){if(Ae.length===0)return;i.append("h3",ve),i.append("raw",Ps);for(let _e of Ae)i.append("raw",`| ${ur(_e.default?qt:_e.name??qt,_e.deprecated)} | ${_e.default?"Yes":"No"} | ${Is(_e.slot_props)} | ${Ds(_e.fallback)} | ${Cr(_e.description,_e.tags)} |
225
- `);i.append("raw",`
226
- `)}function Uy(i,ve){if(ve.typedefs.length===0)return;i.append("h3","Typedefs"),i.append("raw",`\`\`\`ts
227
- ${en({typedefs:ve.typedefs})}
228
- \`\`\`
229
-
230
- `)}function Gy(i,ve){if(i.append("h2",ve.moduleName),ve.generics)i.append("p",`Type parameters: ${ar(`<${ve.generics[1]}>`)}`);if(ve.componentComment?.trim())i.append("p",ve.componentComment.trim());sa(i,"Props",ve.props),sa(i,"Bindings",ve.props.filter((Ae)=>Ae.reactive)),Vy(i,ve.events),qy(i,ve.syntaxMode==="runes"?"Snippets":"Slots",ve.slots),Uy(i,ve),sa(i,"Module exports",ve.moduleExports)}function Wy(i,ve,Ae,_e){let Ne=new rn,Re=_e.linkBase??"";if(Ne.append("h1",ve),Ae)Ne.append("quote",Ae);Ne.append("h2","Components");for(let Ie of i)Ne.append("raw",`- [${Ie.moduleName}](${Re}/${Ie.moduleName}): ${cp(Ie.componentComment,"Component")}
231
- `);if(Ne.append("raw",`
232
- `),_e.entryExports&&_e.entryExports.length>0){Ne.append("h2","Exports");for(let Ie of _e.entryExports)Ne.append("raw",`- \`${Ie.name}\`: ${cp(Ie.description,Ie.kind)}
233
- `);Ne.append("raw",`
234
- `)}return Ne.end()}function Hy(i,ve,Ae){let _e=new rn;if(_e.append("h1",ve),Ae)_e.append("quote",Ae);for(let Ne of i)Gy(_e,Ne);return _e.end()}function Ky(i,ve){let Ae=s(i,{entryExports:ve.entryExports}),_e=ql(),Ne=ve.title??_e.name??"Components",Re=ve.summary??_e.description;return{llmsTxt:Wy(Ae.components,Ne,Re,ve),llmsFullTxt:Hy(Ae.components,Ne,Re)}}async function ia(i,ve){let{llmsTxt:Ae,llmsFullTxt:_e}=Ky(i,ve),Ne=new Mt({dryRun:ve.dryRun}),Re=e(Ls.join(ve.outDir??"","llms.txt")),Ie=e(Ls.join(ve.outDir??"","llms-full.txt")),[Le,Me]=await Promise.all([Ne.write(Ls.join(process.cwd(),Re),Ae),Ne.write(Ls.join(process.cwd(),Ie),_e)]);if(!ve.dryRun)zt(`${Le?"created":"unchanged"} "${Re}".`),zt(`${Me?"created":"unchanged"} "${Ie}".`)}import{join as oa,resolve as dp}from"node:path";function lp(i,ve,Ae){if(i.append("h1","Component Index"),i.append("h2","Components").tableOfContents(),i.append("divider"),Ae&&Ae.length>0)up(i,Ae);let _e=s(ve);for(let Ne of _e.components)fp(i,Ne)}function pp(i,ve,Ae){i.append("h1","Component Index"),i.append("h2","Components");for(let _e of ve)i.append("raw",`- [${_e.moduleName}](./${_e.moduleName}.md)
235
- `);if(i.append("raw",`
236
- `),i.append("divider"),Ae&&Ae.length>0)up(i,Ae)}function up(i,ve){i.append("h2","Exports"),i.append("raw",na);for(let Ae of ve){let _e=(Ae.type??Ae.value)?.replace(sp," ").trim();i.append("raw",`| ${ur(Ae.name,Ae.deprecated)} | ${`<code>${Ae.kind}</code>`} | ${ar(_e)} | ${Ns(Ae.description)} |
237
- `)}i.append("raw",`
238
- `),i.append("divider")}function zy(i){return i.kind==="const"||i.isFunctionDeclaration}function Xy(i,ve){i.append("h3","Module exports"),i.append("raw",na);for(let Ae of ve)i.append("raw",`| ${ur(Ae.name,Ae.deprecated)} | ${`<code>${Ae.kind}</code>`} | ${ar(Ae.type)} | ${Cr(Ae.description,Ae.tags)} |
239
- `);i.append("raw",`
240
- `)}function aa(i,ve,Ae,_e){if(ve.length>0)Ae(),i.append("raw",`
241
- `);else i.append("p",_e??"None.")}function hp(i,ve){fp(i,ve)}function fp(i,ve){if(i.append("h2",`\`${ve.moduleName}\``),ve.generics)i.append("p",`**Type parameters:** ${ar(`<${ve.generics[1]}>`)}`);if(ve.typedefs.length>0)i.append("h3","Types").append("raw",`\`\`\`ts
242
- ${en({typedefs:ve.typedefs})}
243
- \`\`\`
244
-
245
- `);if(i.append("h3","Props"),aa(i,ve.props,()=>{i.append("raw",ip);let Ae=(Ne)=>Ne.reactive?0:Ne.constant?2:1,_e=ve.props.map((Ne,Re)=>({prop:Ne,index:Re})).sort((Ne,Re)=>Ae(Ne.prop)-Ae(Re.prop)||Ne.index-Re.index).map(({prop:Ne})=>Ne);for(let Ne of _e){let Re=zy(Ne)?"accessor":Ne.kind;i.append("raw",`| ${ur(Ne.name,Ne.deprecated)} | ${Ne.isRequired?"Yes":"No"} | ${`<code>${Re}</code>`} | ${Ne.reactive?"Yes":"No"} | ${Ne.binding??"--"} | ${ar(Ne.type)} | ${kn(Ne.value)} | ${Cr(Ne.description,Ne.tags)} |
246
- `)}}),ve.moduleExports.length>0)Xy(i,ve.moduleExports);if(i.append("h3","Slots"),aa(i,ve.slots,()=>{i.append("raw",Ps);for(let Ae of ve.slots)i.append("raw",`| ${ur(Ae.default?qt:Ae.name??qt,Ae.deprecated)} | ${Ae.default?"Yes":"No"} | ${Is(Ae.slot_props)} | ${Ds(Ae.fallback)} | ${Cr(Ae.description,Ae.tags)} |
247
- `)}),i.append("h3","Events"),aa(i,ve.events,()=>{i.append("raw",_s);for(let Ae of ve.events)i.append("raw",`| ${ur(Ae.name,Ae.deprecated)} | ${Ae.type} | ${Ae.type==="dispatched"?Rs(Ae.detail):qt} | ${Cr(Ae.description,Ae.tags)} |
248
- `)}),ve.cssParts&&ve.cssParts.length>0){i.append("h3","CSS Parts"),i.append("raw",ap);for(let Ae of ve.cssParts)i.append("raw",`| ${Ae.name} | ${Ns(Ae.description)} |
249
- `);i.append("raw",`
250
- `)}if(ve.cssProperties&&ve.cssProperties.length>0){i.append("h3","CSS Custom Properties"),i.append("raw",op);for(let Ae of ve.cssProperties)i.append("raw",`| ${Ae.name} | ${ar(Ae.type)} | ${kn(Ae.default)} | ${Ns(Ae.description)} |
251
- `);i.append("raw",`
252
- `)}}class Os extends Mt{onAppend;markdownBase;constructor(i){super();this.onAppend=i.onAppend,this.markdownBase=new rn}get source(){return this.markdownBase.source}get hasToC(){return this.markdownBase.hasToC}get toc(){return this.markdownBase.toc}appendLineBreaks(){return this.markdownBase.appendLineBreaks(),this}append(i,ve){return this.markdownBase.append(i,ve),this.onAppend?.call(this,i,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function ca(i,ve){return new Os({onAppend:(Ae,_e)=>{i.onAppend?.call(null,Ae,_e,ve)}})}async function Jy(i,ve){let Ae=ve.outDir,_e=s(i,{entryExports:ve.entryExports}),Ne=new Mt({dryRun:ve.dryRun}),Re=ca(ve,i);pp(Re,_e.components,ve.entryExports);let Ie=dp(oa(Ae,"README.md")),Le=await Ne.write(Ie,Re.end());if(!ve.dryRun)zt(`${Le?"created":"unchanged"} "${Ie}".`);await Promise.all(_e.components.map(async(Me)=>{let $e=ca(ve,i);hp($e,Me);let Be=dp(oa(Ae,`${Me.moduleName}.md`)),Ve=await Ne.write(Be,$e.end());if(!ve.dryRun)zt(`${Ve?"created":"unchanged"} "${Be}".`)}))}function la(i,ve){let Ae=ca(ve,i);return lp(Ae,i,ve.entryExports),Ae.end()}async function pa(i,ve){if(ve.outDir){if(ve.write!==!1)await Jy(i,ve);return}let Ae=ve?.write!==!1,_e=la(i,ve);if(Ae){let Ne=oa(process.cwd(),ve.outFile),Re=await new Mt({dryRun:ve.dryRun}).write(Ne,_e);if(!ve.dryRun)zt(`${Re?"created":"unchanged"} "${ve.outFile}".`)}return _e}import{join as mp}from"node:path";async function ua(i,ve){let Ae=mp(process.cwd(),ve.outDir,"index.d.ts"),_e=new Mt({dryRun:ve.dryRun}),Ne=ve.preamble+$l(ve.exports),Re=s(i),Ie=ve.format??"class",Le=Re.components.map(async(Me)=>{let $e=jl(mp(ve.outDir,Me.filePath)),Be=ve.resolvedPathByFilePath?.get(Me.filePath),Ve=Be?ve.cache?.getGeneratedText(Be,Ie):void 0;if(Ve===void 0){if(Ve=ea(Me,{format:ve.format}),Be)ve.cache?.setGeneratedText(Be,Ie,Ve)}await _e.write($e,Ve)});if(await Promise.all([...Le,_e.write(Ae,`${Ne}
253
- `)]),!ve.dryRun)zt("created TypeScript definitions.")}w({name:"json",componentSet:"exported",write:Gi});w({name:"markdown",componentSet:"exported",write:pa});w({name:"types",componentSet:"all",write:ua});w({name:"custom-elements",componentSet:"exported",write:ji});w({name:"llms",componentSet:"exported",write:ia});var gp='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',Zy=50;function ex(i){let ve=Promise.resolve();return()=>{ve=ve.then(i,i)}}function ke(i){let ve=i?.watch===!0,Ae,_e,Ne=i??{},Re,Ie=null,Le,Me=new Set,Be=ex(async()=>{if(Ie==null||_e==null||Me.size===0)return;let Ue=Array.from(Me);Me.clear();try{let{result:Ge}=await Ie.update(Ue);await C(Ge,Ne,_e)}catch(Ge){console.error("sveld: failed to regenerate types in watch mode:",Ge)}}),Ve=(Ue)=>{if(!ve||Ie==null||!Bc.test(Ue))return;Me.add(Ue),clearTimeout(Le),Le=setTimeout(Be,Zy)};return{name:"vite-plugin-sveld",apply:ve?void 0:"build",enforce:"post",configResolved(Ue){Re=Ue.root},async buildStart(){if(i?.config){let Ue=Re??process.cwd(),Ge=typeof i.config==="string"?await Pi(Yy(i.config)?i.config:Qy(Ue,i.config)):await D(Ue);Ne=N(Ge,i)}if(I(Ne),R(Ne.quiet===!0),_e=_(Ne.entry),ve&&_e!=null)Ie=await Ml(_e,Ne.glob===!0,Ne.documentExports===!0),await C(Ie.result,Ne,_e)},async generateBundle(){if(ve)return;if(_e==null)this.error(gp);Ae=await k(_e,Ne.glob===!0,b(Ne))},async writeBundle(){if(ve)return;if(_e==null)this.error(gp);await C(Ae,Ne,_e),Ae.cache?.save()},handleHotUpdate(Ue){Ve(Ue.file)},watchChange(Ue){Ve(Ue)}}}function wn(i,ve,Ae){let _e=z(i);if(!_e)throw Error(`sveld: built-in writer "${i}" is not registered.`);return _e.write(ve,Ae)}async function C(i,ve,Ae){let _e=yp(Ae),Ne=ve?.dryRun===!0;if(ve?.types!==!1)await wn("types",i.allComponentsForTypes,{outDir:"types",preamble:"",...ve?.typesOptions,exports:i.exports,inputDir:_e,dryRun:Ne,cache:i.cache,resolvedPathByFilePath:i.resolvedPathByFilePath});if(ve?.json)await wn("json",i.components,{outFile:"COMPONENT_API.json",...ve?.jsonOptions,input:Ae,inputDir:_e,entryExports:i.entryExports,dryRun:Ne});if(ve?.markdown)await wn("markdown",i.components,{outFile:"COMPONENT_INDEX.md",...ve?.markdownOptions,entryExports:i.entryExports,dryRun:Ne});if(ve?.customElements)await wn("custom-elements",i.components,{outFile:"custom-elements.json",...ve?.customElementsOptions,inputDir:_e,dryRun:Ne});if(ve?.llms)await wn("llms",i.components,{...ve?.llmsOptions,entryExports:i.entryExports,dryRun:Ne});let Re=Object.entries(ve?.additionalWriters??{}).map(([Ie,Le])=>{let Me=z(Ie);if(!Me){console.warn(`sveld: no writer registered with name "${Ie}"; skipping.`);return}let $e=Me.componentSet==="all"?i.allComponentsForTypes:i.components,Be={...Le,dryRun:Ne};return tx(Ie,Me,$e,Be)});await Promise.all(Re)}async function tx(i,ve,Ae,_e){try{return await ve.write(Ae,_e)}catch(Ne){let Re=Ne instanceof Error?Ne.message:String(Ne);throw Error(`sveld: writer "${i}" failed: ${Re}`,{cause:Ne})}}async function xp(i,ve,Ae){let _e=yp(Ae);if(ve?.json){let Ne={...ve?.jsonOptions,inputDir:_e,entryExports:i.entryExports},Re=ve.stdout==="ndjson"?Vl(i.components,Ne):Ui(i.components,Ne);process.stdout.write(Re);return}if(ve?.markdown){let Ne=la(i.components,{...ve?.markdownOptions,entryExports:i.entryExports});process.stdout.write(Ne);return}if(ve?.customElements){let Ne=Fi(i.components,{...ve?.customElementsOptions,inputDir:_e});process.stdout.write(Ne)}}import{appendFileSync as ix,existsSync as ax}from"node:fs";import{join as ox}from"node:path";var Ep=/%/g,Cp=/\r/g,vp=/\n/g,rx=/,/g,nx=/:/g,Sp=/\|/g;function bp(i){return i.replace(Ep,"%25").replace(Cp,"%0D").replace(vp,"%0A").replace(rx,"%2C").replace(nx,"%3A")}function sx(i){return i.replace(Ep,"%25").replace(Cp,"%0D").replace(vp,"%0A")}function Tp(i,ve,Ae,_e,Ne,Re){let Ie=i==="error"?"error":"warning",Le=[];if(_e!==void 0)Le.push(`file=${bp(_e)}`);if(Ne!==void 0)Le.push(`line=${Ne}`);if(Re!==void 0)Le.push(`col=${Re}`);return Le.push(`title=${bp(ve)}`),`::${Ie} ${Le.join(",")}::${sx(Ae)}`}function Ap(i){return i.filter((ve)=>!ve.ignored).map((ve)=>Tp(ve.severity,`sveld ${ve.code}`,ve.message,ve.component,ve.source?.start.line,ve.source?.start.column)).join(`
254
- `)}function kp(i){let ve=i.filter((_e)=>!_e.ignored);if(ve.length===0)return"";return["### sveld diagnostics","","| Severity | Code | Location | Message |","| --- | --- | --- | --- |",...ve.map((_e)=>{let Ne=_e.source?`${_e.component}:${_e.source.start.line}`:_e.component;return`| ${_e.severity} | ${_e.code} | ${Ne} | ${_e.message.replace(Sp,"\\|")} |`})].join(`
255
- `)}function wp(i,ve){return i.changes.filter((Ae)=>is(Ae.bump,ve))}function Pp(i,ve){return wp(i,ve).map((Ae)=>Tp("error","sveld breaking change",Ae.message,Ae.component==="*"?void 0:Ae.component)).join(`
256
- `)}function _p(i,ve){let Ae=wp(i,ve);if(Ae.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...Ae.map((Ne)=>`| ${Ne.component} | ${Ne.kind} | ${Ne.message.replace(Sp,"\\|")} |`)].join(`
257
- `)}var ha="src/index.js",Rt={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},cx=`Usage: sveld [options]
258
-
259
- Generate TypeScript definitions and component documentation for a Svelte
260
- library. With no flags, only TypeScript definitions are generated for the
261
- entry resolved from package.json#svelte.
262
-
263
- --entry, --cache, --check, and --types-format accept their value as
264
- --flag=value or as a separate --flag value argument.
265
-
266
- Options:
267
- --entry=<path> Entry point to uncompiled Svelte source (default: package.json "svelte" field)
268
- --glob Analyze all *.svelte files instead of the entry barrel
269
- --types Generate TypeScript definitions (default: true)
270
- --json Generate component documentation in JSON format
271
- --markdown Generate component documentation in Markdown format
272
- --custom-elements Generate a Custom Elements Manifest (custom-elements.json)
273
- --llms Generate an llms.txt / llms-full.txt pair (https://llmstxt.org)
274
- --fail-fast Abort the run when a single component fails to parse
275
- --dry-run Resolve, parse, and print "would write" lines for each output file instead of writing anything (including the parse cache)
276
- --quiet Suppress progress logs (errors, the diagnostics summary, and the --check report are unaffected)
277
- --stdout[=json|ndjson] Print the document from exactly one of --json, --markdown, or --custom-elements to stdout and write nothing to disk (rejects --types and --check); --stdout=ndjson prints one JSON object per component per line and requires --json
278
- --cache[=<path>] Persist parsed output and skip re-parsing unchanged files (on by default, default path: node_modules/.cache/sveld/parse-cache.json; pass --cache=false to disable)
279
- --resolve-types Expand opaque imported $props() types into JSON (alias: --resolveTypes, deprecated)
280
- --check-examples[=syntax] Check @example blocks: TS/JS against the TypeScript program, svelte/html markup against sveld's own parser (alias: --checkExamples, deprecated); --check-examples=syntax runs only the markup path and never loads TypeScript
281
- --report-diagnostics Print unresolved-type diagnostics to stderr
282
- --strict[=errors|ci|local] Exit with code 4 when diagnostics exist (implies --report-diagnostics); --strict=errors only fails on error-severity diagnostics; --strict=ci expands to {strict:true, reportDiagnostics:true, check:true, checkExamples:true}, --strict=local to {reportDiagnostics:true}
283
- --types-format=<format> ".d.ts" output format: "class" (default) or "component" (Svelte 5 Component<...>)
284
- --check[=<path>] Diff the parsed API against a committed snapshot; exit 3 on a breaking change (default path: COMPONENT_API.json)
285
- --check-level=<major|minor|patch> Minimum bump --check fails the run on (default: major)
286
- --format=<text|json|github> Output format for the --check report and the diagnostics summary (default: text); "github" prints GitHub Actions ::error/::warning lines and appends a GITHUB_STEP_SUMMARY table when that env var is set
287
- --help Print this help message and exit
288
- --version Print the installed sveld version and exit
289
-
290
- Exit codes:
291
- 0 success
292
- 1 usage or configuration error
293
- 2 generation failure
294
- 3 breaking API change detected by --check
295
- 4 diagnostics present under --strict
296
- `,fa={resolveTypes:"resolve-types",checkExamples:"check-examples"},lx=["help","version","glob","types","json","markdown","quiet","stdout","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","entry","cache","check","check-level","types-format","format"],px=[...lx,...Object.keys(fa)],ux=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run"]),hx=new Set(["entry","cache","check","types-format"]),fx=new Set(["entry","types-format"]);function dx(i){let ve=as(i,px);return ve===void 0?void 0:fa[ve]??ve}function mx(i,ve){let Ae=i.indexOf("="),_e=Ae===-1?i.slice(2):i.slice(2,Ae),Ne=fa[_e]??_e,Re=Ae===-1?!0:i.slice(Ae+1),Ie=!1;if(Ae===-1&&hx.has(Ne)){if(ve!==void 0&&!ve.startsWith("--"))Re=ve,Ie=!0;else if(fx.has(Ne))return{result:{kind:"usage-error",message:`sveld: --${Ne} requires a value (pass --${Ne}=<value> or --${Ne} <value>).`},consumedNext:!1,flag:Ne}}return{result:gx(Ne,Re,i,_e),consumedNext:Ie,flag:Ne}}function gx(i,ve,Ae,_e){switch(i){case"help":return{kind:"help"};case"version":return{kind:"version"};case"glob":case"types":case"json":case"markdown":case"quiet":return{kind:"option",option:{[i]:ve===!0||ve==="true"}};case"stdout":if(ve===!0||ve==="true")return{kind:"option",option:{stdout:!0}};if(ve==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:ve}};case"custom-elements":return{kind:"option",option:{customElements:ve===!0||ve==="true"}};case"llms":return{kind:"option",option:{llms:ve===!0||ve==="true"}};case"strict":if(ve===!0||ve==="true")return{kind:"option",option:{strict:!0}};if(ve==="false")return{kind:"option",option:{strict:!1}};return{kind:"option",option:{strict:ve}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:ve===!0||ve==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:ve===!0||ve==="true"}};case"check-examples":if(ve===!0||ve==="true")return{kind:"option",option:{checkExamples:!0}};if(ve==="false")return{kind:"option",option:{checkExamples:!1}};return{kind:"option",option:{checkExamples:ve}};case"fail-fast":return{kind:"option",option:{failFast:ve===!0||ve==="true"}};case"dry-run":return{kind:"option",option:{dryRun:ve===!0||ve==="true"}};case"entry":return typeof ve==="string"?{kind:"option",option:{entry:ve}}:{kind:"option",option:{}};case"cache":if(ve==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof ve==="string"?ve:!0}};case"check":if(ve==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof ve==="string"?ve:!0}};case"types-format":return typeof ve==="string"?{kind:"option",option:{typesOptions:{format:ve}}}:{kind:"option",option:{}};case"format":return typeof ve==="string"?{kind:"option",option:{format:ve}}:{kind:"option",option:{}};case"check-level":return typeof ve==="string"?{kind:"option",option:{checkLevel:ve}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:Ae,suggestion:dx(_e)}}}function yx(i){let ve={},Ae=!1;for(let _e=0;_e<i.length;_e++){let Ne=i[_e];if(!Ne.startsWith("--"))return{kind:"unknown",arg:Ne,positionalHint:Ae?!0:void 0};let{result:Re,consumedNext:Ie,flag:Le}=mx(Ne,i[_e+1]);if(Re.kind!=="option")return Re;if(Object.assign(ve,Re.option),Ae=ux.has(Le),Ie)_e++}return{kind:"options",options:ve}}async function re(i){let ve=yx(i.argv.slice(2));if(ve.kind==="help"){console.log(cx);return}if(ve.kind==="version"){console.log(Fc.version);return}if(ve.kind==="usage-error"){console.error(ve.message),i.exitCode=Rt.USAGE_ERROR;return}if(ve.kind==="unknown"){let Xe=`Unknown flag: ${ve.arg}`;if(ve.suggestion)Xe+=` Did you mean --${ve.suggestion}?`;if(ve.positionalHint)Xe+=" (values are passed as --flag=value or --flag value)";console.error(Xe),console.error("Run sveld --help for a list of available flags."),i.exitCode=Rt.USAGE_ERROR;return}let Ae=ve.options,_e=await D(),Ne=G(N(_e,Ae));if(I(Ne),Ne.stdout){if(Ne.stdout!==!0&&Ne.stdout!=="json"&&Ne.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${Ne.stdout}".`),i.exitCode=Rt.USAGE_ERROR;return}if([Ne.json,Ne.markdown,Ne.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),i.exitCode=Rt.USAGE_ERROR;return}if(Ne.stdout==="ndjson"&&!Ne.json){console.error("sveld: --stdout=ndjson is only valid with --json."),i.exitCode=Rt.USAGE_ERROR;return}if(Ne.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),i.exitCode=Rt.USAGE_ERROR;return}if(Ne.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),i.exitCode=Rt.USAGE_ERROR;return}}if(Ne.format!==void 0&&Ne.format!=="text"&&Ne.format!=="json"&&Ne.format!=="github"){console.error(`sveld: --format must be "text", "json", or "github"; got "${Ne.format}".`),i.exitCode=Rt.USAGE_ERROR;return}if(Ne.strict!==void 0&&Ne.strict!==!0&&Ne.strict!==!1&&Ne.strict!=="errors"){console.error(`sveld: --strict must be "errors", "ci", or "local" when given a value; got "${Ne.strict}".`),i.exitCode=Rt.USAGE_ERROR;return}if(Ne.checkLevel!==void 0&&Ne.checkLevel!=="major"&&Ne.checkLevel!=="minor"&&Ne.checkLevel!=="patch"){console.error(`sveld: --check-level must be "major", "minor", or "patch"; got "${Ne.checkLevel}".`),i.exitCode=Rt.USAGE_ERROR;return}if(Ne.checkExamples!==void 0&&Ne.checkExamples!==!0&&Ne.checkExamples!==!1&&Ne.checkExamples!=="syntax"){console.error(`sveld: --check-examples must be "syntax" when given a value; got "${Ne.checkExamples}".`),i.exitCode=Rt.USAGE_ERROR;return}R(Ne.quiet===!0);let Re=_(Ne.entry),Ie;if(Re!==null)Ie=Re;else if(ax(ox(i.cwd(),ha)))console.error(`sveld: could not resolve an entry point; falling back to "${ha}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),Ie=xn(e(ha));else{i.exitCode=Rt.USAGE_ERROR;return}let Le,Me;try{if(Le=await k(Ie,Ne.glob===!0,b(Ne)),Ne.check)Me=await B(Le.components,W(Ne),{entryExports:Le.entryExports});if(Ne.stdout)await xp(Le,Ne,Ie);else if(await C(Le,Ne,Ie),!Ne.dryRun)Le.cache?.save()}catch(Xe){if(Xe instanceof Xr){console.error(`sveld: ${Xe.message}`),i.exitCode=Rt.USAGE_ERROR;return}console.error(Xe instanceof Error?Xe.message:String(Xe)),i.exitCode=Rt.GENERATION_FAILURE;return}let $e=Ne.reportDiagnostics||Ne.strict,Be=F(Le.diagnostics,$e),Ve=[];if($e&&Be.length>0)if(Ne.format==="json")i.stderr.write(U(Be));else if(Ne.format==="github"){let Xe=Ap(Be);if(Xe)console.error(Xe);let Je=kp(Be);if(Je)Ve.push(Je)}else console.error(V(Be));if(Me)if(Ne.format==="json")i.stdout.write(te(Me));else if(Ne.format==="github"){let Xe=Pp(Me,Ne.checkLevel??"major");if(Xe)console.log(Xe);let Je=_p(Me,Ne.checkLevel??"major");if(Je)Ve.push(Je)}else console.log(ee(Me));if(Ne.format==="github"&&Ve.length>0&&i.env.GITHUB_STEP_SUMMARY)ix(i.env.GITHUB_STEP_SUMMARY,`${Ve.join(`
297
-
298
- `)}
299
- `);let Ue;if(Me?.changes.some((Xe)=>Xe.kind==="schema")??!1)Ue=Rt.USAGE_ERROR;else if(Me&&is(Me.bump,Ne.checkLevel??"major"))Ue=Rt.BREAKING_CHANGE;if(q(Be,Ne.strict).length>0)Ue=Ue===void 0?Rt.DIAGNOSTICS:Math.min(Ue,Rt.DIAGNOSTICS);if(Ue!==void 0)i.exitCode=Ue}
300
- export{we,o,P,p,ne,f,a,ie,l,d,se,x,j,J,F,q,V,oe,U,n,m,H,t,r,u,L,h,ae,ce,ue,X,g,pe,Q,le,fe,T,de,c,A,me,Y,he,ge,ye,E,Z,xe,O,K,M,y,Te,Ee,S,v,e,s,Se,W,B,ee,be,te,_,Ce,D,N,G,I,R,b,k,w,z,Pe,ke,C,re};