sveld 0.37.1 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser.d.ts +1 -3
- package/lib/browser.js +126 -126
- package/lib/{chunk-a5qb9706.js → chunk-0mgphvte.js} +1 -1
- package/lib/chunk-fc72j0vd.js +1 -0
- package/lib/chunk-fj7dbych.js +1 -0
- package/lib/chunk-szfpvrdq.js +6 -0
- package/lib/chunk-xt4vdey6.js +301 -0
- package/lib/{chunk-k096ka38.js → chunk-z1dy5a6k.js} +4 -4
- package/lib/cli-entry.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/lib/chunk-2x8axrwh.js +0 -1
- package/lib/chunk-3s74a556.js +0 -1
- package/lib/chunk-q2023ykg.js +0 -300
- package/lib/chunk-sty5s7z0.js +0 -7
package/lib/chunk-q2023ykg.js
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
import{createRequire as eu}from"node:module";var Wp=Object.create;var{getPrototypeOf:Hp,defineProperty:Gs,getOwnPropertyNames:Kp}=Object;var No=Object.prototype.hasOwnProperty;function zp(s){return this[s]}var Xp,Jp,we=(s,ve,Ae)=>{var _e=s!=null&&typeof s==="object";if(_e){var Ne=ve?Xp??=new WeakMap:Jp??=new WeakMap,Le=Ne.get(s);if(Le)return Le}Ae=s!=null?Wp(Hp(s)):{};let Ie=ve||!s||!s.__esModule||!No.call(s,"default")?Gs(Ae,"default",{value:s,enumerable:!0}):Ae;if(s&&typeof s==="object"||typeof s==="function"){for(let Re of Kp(s))if(!No.call(Ie,Re))Gs(Ie,Re,{get:zp.bind(s,Re),enumerable:!0})}if(_e)Ne.set(s,Ie);return Ie};var o=(s,ve)=>()=>(ve||s((ve={exports:{}}).exports,ve),ve.exports);var Yp=(s)=>s;function Qp(s,ve){this[s]=Yp.bind(null,ve)}var Zp=(s,ve)=>{for(var Ae in ve)Gs(s,Ae,{get:ve[Ae],enumerable:!0,configurable:!0,set:Qp.bind(ve,Ae)})};var w=eu(import.meta.url);var tu={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 Io(s,ve){let Ae=tu[s];if(!Ae)return!1;if(!ve)return!0;return(Ae.direct??Ae.descendant??[]).includes(ve)}var ii={};Zp(ii,{Node:()=>fr,Parser:()=>At,Position:()=>Wn,SourceLocation:()=>pr,TokContext:()=>nn,Token:()=>Wr,TokenType:()=>yt,defaultOptions:()=>Or,getLineInfo:()=>Qs,isIdentifierChar:()=>zt,isIdentifierStart:()=>jt,isNewLine:()=>Bn,keywordTypes:()=>jr,lineBreak:()=>Vt,lineBreakG:()=>Fo,nonASCIIwhitespace:()=>Ys,parse:()=>si,parseExpressionAt:()=>Bu,tokContexts:()=>Tt,tokTypes:()=>je,tokenizer:()=>$u,version:()=>xa});var nu=[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],Mo=[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],ru="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Bo="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ws={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"},Hs="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",su={5:Hs,"5module":Hs+" export import",6:Hs+" const class extends export import super"},$o=/^in(stanceof)?$/,iu=new RegExp("["+Bo+"]"),ou=new RegExp("["+Bo+ru+"]");function Ks(s,ve){var Ae=65536;for(var _e=0;_e<ve.length;_e+=2){if(Ae+=ve[_e],Ae>s)return!1;if(Ae+=ve[_e+1],Ae>=s)return!0}return!1}function jt(s,ve){if(s<65)return s===36;if(s<91)return!0;if(s<97)return s===95;if(s<123)return!0;if(s<=65535)return s>=170&&iu.test(String.fromCharCode(s));if(ve===!1)return!1;return Ks(s,Mo)}function zt(s,ve){if(s<48)return s===36;if(s<58)return!0;if(s<65)return!1;if(s<91)return!0;if(s<97)return s===95;if(s<123)return!0;if(s<=65535)return s>=170&&ou.test(String.fromCharCode(s));if(ve===!1)return!1;return Ks(s,Mo)||Ks(s,nu)}var yt=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 en(s,ve){return new yt(s,{beforeExpr:!0,binop:ve})}var tn={beforeExpr:!0},Kt={startsExpr:!0},jr={};function mt(s,ve){if(ve===void 0)ve={};return ve.keyword=s,jr[s]=new yt(s,ve)}var je={num:new yt("num",Kt),regexp:new yt("regexp",Kt),string:new yt("string",Kt),name:new yt("name",Kt),privateId:new yt("privateId",Kt),eof:new yt("eof"),bracketL:new yt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new yt("]"),braceL:new yt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new yt("}"),parenL:new yt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new yt(")"),comma:new yt(",",tn),semi:new yt(";",tn),colon:new yt(":",tn),dot:new yt("."),question:new yt("?",tn),questionDot:new yt("?."),arrow:new yt("=>",tn),template:new yt("template"),invalidTemplate:new yt("invalidTemplate"),ellipsis:new yt("...",tn),backQuote:new yt("`",Kt),dollarBraceL:new yt("${",{beforeExpr:!0,startsExpr:!0}),eq:new yt("=",{beforeExpr:!0,isAssign:!0}),assign:new yt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new yt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new yt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:en("||",1),logicalAND:en("&&",2),bitwiseOR:en("|",3),bitwiseXOR:en("^",4),bitwiseAND:en("&",5),equality:en("==/!=/===/!==",6),relational:en("</>/<=/>=",7),bitShift:en("<</>>/>>>",8),plusMin:new yt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:en("%",10),star:en("*",10),slash:en("/",10),starstar:new yt("**",{beforeExpr:!0}),coalesce:en("??",1),_break:mt("break"),_case:mt("case",tn),_catch:mt("catch"),_continue:mt("continue"),_debugger:mt("debugger"),_default:mt("default",tn),_do:mt("do",{isLoop:!0,beforeExpr:!0}),_else:mt("else",tn),_finally:mt("finally"),_for:mt("for",{isLoop:!0}),_function:mt("function",Kt),_if:mt("if"),_return:mt("return",tn),_switch:mt("switch"),_throw:mt("throw",tn),_try:mt("try"),_var:mt("var"),_const:mt("const"),_while:mt("while",{isLoop:!0}),_with:mt("with"),_new:mt("new",{beforeExpr:!0,startsExpr:!0}),_this:mt("this",Kt),_super:mt("super",Kt),_class:mt("class",Kt),_extends:mt("extends",tn),_export:mt("export"),_import:mt("import",Kt),_null:mt("null",Kt),_true:mt("true",Kt),_false:mt("false",Kt),_in:mt("in",{beforeExpr:!0,binop:7}),_instanceof:mt("instanceof",{beforeExpr:!0,binop:7}),_typeof:mt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:mt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:mt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Vt=/\r\n?|\n|\u2028|\u2029/,Fo=new RegExp(Vt.source,"g");function Bn(s){return s===10||s===13||s===8232||s===8233}function jo(s,ve,Ae){if(Ae===void 0)Ae=s.length;for(var _e=ve;_e<Ae;_e++){var Ne=s.charCodeAt(_e);if(Bn(Ne))return _e<Ae-1&&Ne===13&&s.charCodeAt(_e+1)===10?_e+2:_e+1}return-1}var Ys=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Nt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Vo=Object.prototype,{hasOwnProperty:au,toString:cu}=Vo,Hn=Object.hasOwn||function(s,ve){return au.call(s,ve)},Do=Array.isArray||function(s){return cu.call(s)==="[object Array]"},Lo=Object.create(null);function wn(s){return Lo[s]||(Lo[s]=new RegExp("^(?:"+s.replace(/ /g,"|")+")$"))}function yn(s){if(s<=65535)return String.fromCharCode(s);return s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320)}var lu=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Wn=function(ve,Ae){this.line=ve,this.column=Ae};Wn.prototype.offset=function(ve){return new Wn(this.line,this.column+ve)};var pr=function(ve,Ae,_e){if(this.start=Ae,this.end=_e,ve.sourceFile!==null)this.source=ve.sourceFile};function Qs(s,ve){for(var Ae=1,_e=0;;){var Ne=jo(s,_e,ve);if(Ne<0)return new Wn(Ae,ve-_e);++Ae,_e=Ne}}var Or={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},Ro=!1;function pu(s){var ve={};for(var Ae in Or)ve[Ae]=s&&Hn(s,Ae)?s[Ae]:Or[Ae];if(ve.ecmaVersion==="latest")ve.ecmaVersion=1e8;else if(ve.ecmaVersion==null){if(!Ro&&typeof console==="object"&&console.warn)Ro=!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(!s||s.allowHashBang==null)ve.allowHashBang=ve.ecmaVersion>=14;if(Do(ve.onToken)){var _e=ve.onToken;ve.onToken=function(Ne){return _e.push(Ne)}}if(Do(ve.onComment))ve.onComment=uu(ve,ve.onComment);if(ve.sourceType==="commonjs"&&ve.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return ve}function uu(s,ve){return function(Ae,_e,Ne,Le,Ie,Re){var Me={type:Ae?"Block":"Line",value:_e,start:Ne,end:Le};if(s.locations)Me.loc=new pr(this,Ie,Re);if(s.ranges)Me.range=[Ne,Le];ve.push(Me)}}var Mn=1,$n=2,Zs=4,qo=8,ei=16,Uo=32,Vr=64,Go=128,Fn=256,ur=512,Wo=1024,qr=Mn|$n|Fn;function ti(s,ve){return $n|(s?Zs:0)|(ve?qo:0)}var Mr=0,ni=1,bn=2,Ho=3,Ko=4,zo=5,At=function(ve,Ae,_e){this.options=ve=pu(ve),this.sourceFile=ve.sourceFile,this.keywords=wn(su[ve.ecmaVersion>=6?6:ve.sourceType==="module"?"5module":5]);var Ne="";if(ve.allowReserved!==!0){if(Ne=Ws[ve.ecmaVersion>=6?6:ve.ecmaVersion===5?5:3],ve.sourceType==="module")Ne+=" await"}this.reservedWords=wn(Ne);var Le=(Ne?Ne+" ":"")+Ws.strict;if(this.reservedWordsStrict=wn(Le),this.reservedWordsStrictBind=wn(Le+" "+Ws.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(Vt).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"?$n:Mn),this.regexpState=null,this.privateNameStack=[]},sn={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}};At.prototype.parse=function(){var ve=this,Ae=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return ve.parseTopLevel(Ae)})};sn.inFunction.get=function(){return(this.currentVarScope().flags&$n)>0};sn.inGenerator.get=function(){return(this.currentVarScope().flags&qo)>0};sn.inAsync.get=function(){return(this.currentVarScope().flags&Zs)>0};sn.canAwait.get=function(){for(var s=this.scopeStack.length-1;s>=0;s--){var ve=this.scopeStack[s],Ae=ve.flags;if(Ae&(Fn|ur))return!1;if(Ae&$n)return(Ae&Zs)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};sn.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Mn)return!0;return!1};sn.allowSuper.get=function(){var s=this.currentThisScope(),ve=s.flags;return(ve&Vr)>0||this.options.allowSuperOutsideMethod};sn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Go)>0};sn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};sn.allowNewDotTarget.get=function(){for(var s=this.scopeStack.length-1;s>=0;s--){var ve=this.scopeStack[s],Ae=ve.flags;if(Ae&(Fn|ur)||Ae&$n&&!(Ae&ei))return!0}return!1};sn.allowUsing.get=function(){var s=this.currentScope(),ve=s.flags;if(ve&Wo)return!1;if(!this.inModule&&ve&Mn)return!1;return!0};sn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Fn)>0};At.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};At.parse=function(ve,Ae){return new this(Ae,ve).parse()};At.parseExpressionAt=function(ve,Ae,_e){var Ne=new this(_e,ve,Ae);return Ne.nextToken(),Ne.parseExpression()};At.tokenizer=function(ve,Ae){return new this(Ae,ve)};Object.defineProperties(At.prototype,sn);var Mt=At.prototype,fu=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Mt.strictDirective=function(s){if(this.options.ecmaVersion<5)return!1;for(;;){Nt.lastIndex=s,s+=Nt.exec(this.input)[0].length;var ve=fu.exec(this.input.slice(s));if(!ve)return!1;if((ve[1]||ve[2])==="use strict"){Nt.lastIndex=s+ve[0].length;var Ae=Nt.exec(this.input),_e=Ae.index+Ae[0].length,Ne=this.input.charAt(_e);return Ne===";"||Ne==="}"||Vt.test(Ae[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Ne)||Ne==="!"&&this.input.charAt(_e+1)==="=")}if(s+=ve[0].length,Nt.lastIndex=s,s+=Nt.exec(this.input)[0].length,this.input[s]===";")s++}};Mt.eat=function(s){if(this.type===s)return this.next(),!0;else return!1};Mt.isContextual=function(s){return this.type===je.name&&this.value===s&&!this.containsEsc};Mt.eatContextual=function(s){if(!this.isContextual(s))return!1;return this.next(),!0};Mt.catchStackOverflow=function(s){try{return s()}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}};Mt.expectContextual=function(s){if(!this.eatContextual(s))this.unexpected()};Mt.canInsertSemicolon=function(){return this.type===je.eof||this.type===je.braceR||Vt.test(this.input.slice(this.lastTokEnd,this.start))};Mt.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};Mt.semicolon=function(){if(!this.eat(je.semi)&&!this.insertSemicolon())this.unexpected()};Mt.afterTrailingComma=function(s,ve){if(this.type===s){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!ve)this.next();return!0}};Mt.expect=function(s){this.eat(s)||this.unexpected()};Mt.unexpected=function(s){this.raise(s!=null?s:this.start,"Unexpected token")};var Ur=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Mt.checkPatternErrors=function(s,ve){if(!s)return;if(s.trailingComma>-1)this.raiseRecoverable(s.trailingComma,"Comma is not permitted after the rest element");var Ae=ve?s.parenthesizedAssign:s.parenthesizedBind;if(Ae>-1)this.raiseRecoverable(Ae,ve?"Assigning to rvalue":"Parenthesized pattern")};Mt.checkExpressionErrors=function(s,ve){if(!s)return!1;var{shorthandAssign:Ae,doubleProto:_e}=s;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")};Mt.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")};Mt.isSimpleAssignTarget=function(s){if(s.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(s.expression);return s.type==="Identifier"||s.type==="MemberExpression"};var it=At.prototype;it.parseTopLevel=function(s){var ve=Object.create(null);if(!s.body)s.body=[];while(this.type!==je.eof){var Ae=this.parseStatement(null,!0,ve);s.body.push(Ae)}if(this.inModule)for(var _e=0,Ne=Object.keys(this.undefinedExports);_e<Ne.length;_e+=1){var Le=Ne[_e];this.raiseRecoverable(this.undefinedExports[Le].start,"Export '"+Le+"' is not defined")}return this.adaptDirectivePrologue(s.body),this.next(),s.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(s,"Program")};var ri={kind:"loop"},hu={kind:"switch"};it.isLet=function(s){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Nt.lastIndex=this.pos;var ve=Nt.exec(this.input),Ae=this.pos+ve[0].length,_e=this.fullCharCodeAt(Ae);if(_e===91||_e===92)return!0;if(s)return!1;if(_e===123)return!0;if(jt(_e)){var Ne=Ae;do Ae+=_e<=65535?1:2;while(zt(_e=this.fullCharCodeAt(Ae)));if(_e===92)return!0;var Le=this.input.slice(Ne,Ae);if(!$o.test(Le))return!0}return!1};it.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Nt.lastIndex=this.pos;var s=Nt.exec(this.input),ve=this.pos+s[0].length,Ae;return!Vt.test(this.input.slice(this.pos,ve))&&this.input.slice(ve,ve+8)==="function"&&(ve+8===this.input.length||!(zt(Ae=this.fullCharCodeAt(ve+8))||Ae===92))};it.isUsingKeyword=function(s,ve){if(this.options.ecmaVersion<17||!this.isContextual(s?"await":"using"))return!1;Nt.lastIndex=this.pos;var Ae=Nt.exec(this.input),_e=this.pos+Ae[0].length;if(Vt.test(this.input.slice(this.pos,_e)))return!1;if(s){var Ne=_e+5,Le;if(this.input.slice(_e,Ne)!=="using"||Ne===this.input.length||zt(Le=this.fullCharCodeAt(Ne))||Le===92)return!1;Nt.lastIndex=Ne;var Ie=Nt.exec(this.input);if(_e=Ne+Ie[0].length,Ie&&Vt.test(this.input.slice(Ne,_e)))return!1}var Re=this.fullCharCodeAt(_e);if(!jt(Re)&&Re!==92)return!1;var Me=_e;do _e+=Re<=65535?1:2;while(zt(Re=this.fullCharCodeAt(_e)));if(Re===92)return!0;var $e=this.input.slice(Me,_e);if($o.test($e))return!1;if(ve&&!s&&$e==="of"){Nt.lastIndex=_e;var Be=Nt.exec(this.input);if(_e=_e+Be[0].length,this.input.charCodeAt(_e)!==61||(Re=this.input.charCodeAt(_e+1))===61||Re===62)return!1}return!0};it.isAwaitUsing=function(s){return this.isUsingKeyword(!0,s)};it.isUsing=function(s){return this.isUsingKeyword(!1,s)};it.parseStatement=function(s,ve,Ae){var _e=this.type,Ne=this.startNode(),Le;if(this.isLet(s))_e=je._var,Le="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(s&&(this.strict||s!=="if"&&s!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(Ne,!1,!s);case je._class:if(s)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(Le=Le||this.value,s&&Le!=="var")this.unexpected();return this.parseVarStatement(Ne,Le);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){Nt.lastIndex=this.pos;var Ie=Nt.exec(this.input),Re=this.pos+Ie[0].length,Me=this.input.charCodeAt(Re);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(s)this.unexpected();return this.next(),this.parseFunctionStatement(Ne,!0,!s)}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(s)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,s);else return this.parseExpressionStatement(Ne,Ve)}};it.parseBreakContinueStatement=function(s,ve){var Ae=ve==="break";if(this.next(),this.eat(je.semi)||this.insertSemicolon())s.label=null;else if(this.type!==je.name)this.unexpected();else s.label=this.parseIdent(),this.semicolon();var _e=0;for(;_e<this.labels.length;++_e){var Ne=this.labels[_e];if(s.label==null||Ne.name===s.label.name){if(Ne.kind!=null&&(Ae||Ne.kind==="loop"))break;if(s.label&&Ae)break}}if(_e===this.labels.length)this.raise(s.start,"Unsyntactic "+ve);return this.finishNode(s,Ae?"BreakStatement":"ContinueStatement")};it.parseDebuggerStatement=function(s){return this.next(),this.semicolon(),this.finishNode(s,"DebuggerStatement")};it.parseDoStatement=function(s){if(this.next(),this.labels.push(ri),s.body=this.parseStatement("do"),this.labels.pop(),this.expect(je._while),s.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(je.semi);else this.semicolon();return this.finishNode(s,"DoWhileStatement")};it.parseForStatement=function(s){this.next();var ve=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ri),this.enterScope(0),this.expect(je.parenL),this.type===je.semi){if(ve>-1)this.unexpected(ve);return this.parseFor(s,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(s,_e,ve)}var Le=this.isContextual("let"),Ie=!1,Re=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Re){var Me=this.startNode();if(this.next(),Re==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Me,!0,Re),this.finishNode(Me,"VariableDeclaration"),this.parseForAfterInit(s,Me,ve)}var $e=this.containsEsc,Be=new Ur,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);s.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)s.await=!1}if(Le&&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(s,Ue)}else this.checkExpressionErrors(Be,!0);if(ve>-1)this.unexpected(ve);return this.parseFor(s,Ue)};it.parseForAfterInit=function(s,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)s.await=Ae>-1;return this.parseForIn(s,ve)}if(Ae>-1)this.unexpected(Ae);return this.parseFor(s,ve)};it.parseFunctionStatement=function(s,ve,Ae){return this.next(),this.parseFunction(s,lr|(Ae?0:zs),!1,ve)};it.parseIfStatement=function(s){return this.next(),s.test=this.parseParenExpression(),s.consequent=this.parseStatement("if"),s.alternate=this.eat(je._else)?this.parseStatement("if"):null,this.finishNode(s,"IfStatement")};it.parseReturnStatement=function(s){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(je.semi)||this.insertSemicolon())s.argument=null;else s.argument=this.parseExpression(),this.semicolon();return this.finishNode(s,"ReturnStatement")};it.parseSwitchStatement=function(s){this.next(),s.discriminant=this.parseParenExpression(),s.cases=[],this.expect(je.braceL),this.labels.push(hu),this.enterScope(Wo);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(s.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(s,"SwitchStatement")};it.parseThrowStatement=function(s){if(this.next(),Vt.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return s.argument=this.parseExpression(),this.semicolon(),this.finishNode(s,"ThrowStatement")};var du=[];it.parseCatchClauseParam=function(){var s=this.parseBindingAtom(),ve=s.type==="Identifier";return this.enterScope(ve?Uo:0),this.checkLValPattern(s,ve?Ko:bn),this.expect(je.parenR),s};it.parseTryStatement=function(s){if(this.next(),s.block=this.parseBlock(),s.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(),s.handler=this.finishNode(ve,"CatchClause")}if(s.finalizer=this.eat(je._finally)?this.parseBlock():null,!s.handler&&!s.finalizer)this.raise(s.start,"Missing catch or finally clause");return this.finishNode(s,"TryStatement")};it.parseVarStatement=function(s,ve,Ae){return this.next(),this.parseVar(s,!1,ve,Ae),this.semicolon(),this.finishNode(s,"VariableDeclaration")};it.parseWhileStatement=function(s){return this.next(),s.test=this.parseParenExpression(),this.labels.push(ri),s.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(s,"WhileStatement")};it.parseWithStatement=function(s){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),s.object=this.parseParenExpression(),s.body=this.parseStatement("with"),this.finishNode(s,"WithStatement")};it.parseEmptyStatement=function(s){return this.next(),this.finishNode(s,"EmptyStatement")};it.parseLabeledStatement=function(s,ve,Ae,_e){for(var Ne=0,Le=this.labels;Ne<Le.length;Ne+=1){var Ie=Le[Ne];if(Ie.name===ve)this.raise(Ae.start,"Label '"+ve+"' is already declared")}var Re=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===s.start)$e.statementStart=this.start,$e.kind=Re;else break}return this.labels.push({name:ve,kind:Re,statementStart:this.start}),s.body=this.parseStatement(_e?_e.indexOf("label")===-1?_e+"label":_e:"label"),this.labels.pop(),s.label=Ae,this.finishNode(s,"LabeledStatement")};it.parseExpressionStatement=function(s,ve){return s.expression=ve,this.semicolon(),this.finishNode(s,"ExpressionStatement")};it.parseBlock=function(s,ve,Ae){if(s===void 0)s=!0;if(ve===void 0)ve=this.startNode();if(ve.body=[],this.expect(je.braceL),s)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(),s)this.exitScope();return this.finishNode(ve,"BlockStatement")};it.parseFor=function(s,ve){return s.init=ve,this.expect(je.semi),s.test=this.type===je.semi?null:this.parseExpression(),this.expect(je.semi),s.update=this.type===je.parenR?null:this.parseExpression(),this.expect(je.parenR),s.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(s,"ForStatement")};it.parseForIn=function(s,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 s.left=ve,s.right=Ae?this.parseExpression():this.parseMaybeAssign(),this.expect(je.parenR),s.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(s,Ae?"ForInStatement":"ForOfStatement")};it.parseVar=function(s,ve,Ae,_e){s.declarations=[],s.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(s.declarations.push(this.finishNode(Ne,"VariableDeclarator")),!this.eat(je.comma))break}return s};it.parseVarId=function(s,ve){s.id=ve==="using"||ve==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(s.id,ve==="var"?ni:bn,!1)};var lr=1,zs=2,Xo=4;it.parseFunction=function(s,ve,Ae,_e,Ne){if(this.initFunction(s),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!_e){if(this.type===je.star&&ve&zs)this.unexpected();s.generator=this.eat(je.star)}if(this.options.ecmaVersion>=8)s.async=!!_e;if(ve&lr){if(s.id=ve&Xo&&this.type!==je.name?null:this.parseIdent(),s.id&&!(ve&zs))this.checkLValSimple(s.id,this.strict||s.generator||s.async?this.treatFunctionsAsVar?ni:bn:Ho)}var Le=this.yieldPos,Ie=this.awaitPos,Re=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ti(s.async,s.generator)),!(ve&lr))s.id=this.type===je.name?this.parseIdent():null;return this.parseFunctionParams(s),this.parseFunctionBody(s,Ae,!1,Ne),this.yieldPos=Le,this.awaitPos=Ie,this.awaitIdentPos=Re,this.finishNode(s,ve&lr?"FunctionDeclaration":"FunctionExpression")};it.parseFunctionParams=function(s){this.expect(je.parenL),s.params=this.parseBindingList(je.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};it.parseClass=function(s,ve){this.next();var Ae=this.strict;this.strict=!0,this.parseClassId(s,ve),this.parseClassSuper(s);var _e=this.enterClassBody(),Ne=this.startNode(),Le=!1;Ne.body=[],this.expect(je.braceL);while(this.type!==je.braceR){var Ie=this.parseClassElement(s.superClass!==null);if(Ie){if(Ne.body.push(Ie),Ie.type==="MethodDefinition"&&Ie.kind==="constructor"){if(Le)this.raiseRecoverable(Ie.start,"Duplicate constructor in the same class");Le=!0}else if(Ie.key&&Ie.key.type==="PrivateIdentifier"&&mu(_e,Ie))this.raiseRecoverable(Ie.key.start,"Identifier '#"+Ie.key.name+"' has already been declared")}}return this.strict=Ae,this.next(),s.body=this.finishNode(Ne,"ClassBody"),this.exitClassBody(),this.finishNode(s,ve?"ClassDeclaration":"ClassExpression")};it.parseClassElement=function(s){if(this.eat(je.semi))return null;var ve=this.options.ecmaVersion,Ae=this.startNode(),_e="",Ne=!1,Le=!1,Ie="method",Re=!1;if(this.eatContextual("static")){if(ve>=13&&this.eat(je.braceL))return this.parseClassStaticBlock(Ae),Ae;if(this.isClassElementNameStart()||this.type===je.star)Re=!0;else _e="static"}if(Ae.static=Re,!_e&&ve>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===je.star)&&!this.canInsertSemicolon())Le=!0;else _e="async";if(!_e&&(ve>=9||!Le)&&this.eat(je.star))Ne=!0;if(!_e&&!Le&&!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||Le){var $e=!Ae.static&&Br(Ae,"constructor"),Be=$e&&s;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,Le,Be)}else this.parseClassField(Ae);return Ae};it.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};it.parseClassElementName=function(s){if(this.type===je.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");s.computed=!1,s.key=this.parsePrivateIdent()}else this.parsePropertyName(s)};it.parseClassMethod=function(s,ve,Ae,_e){var Ne=s.key;if(s.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(s.static&&Br(s,"prototype"))this.raise(Ne.start,"Classes may not have a static property named prototype");var Le=s.value=this.parseMethod(ve,Ae,_e);if(s.kind==="get"&&Le.params.length!==0)this.raiseRecoverable(Le.start,"getter should have no params");if(s.kind==="set"&&Le.params.length!==1)this.raiseRecoverable(Le.start,"setter should have exactly one param");if(s.kind==="set"&&Le.params[0].type==="RestElement")this.raiseRecoverable(Le.params[0].start,"Setter cannot use rest params");return this.finishNode(s,"MethodDefinition")};it.parseClassField=function(s){if(Br(s,"constructor"))this.raise(s.key.start,"Classes can't have a field named 'constructor'");else if(s.static&&Br(s,"prototype"))this.raise(s.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(je.eq))this.enterScope(ur|Vr),s.value=this.parseMaybeAssign(),this.exitScope();else s.value=null;return this.semicolon(),this.finishNode(s,"PropertyDefinition")};it.parseClassStaticBlock=function(s){s.body=[];var ve=this.labels;this.labels=[],this.enterScope(Fn|Vr);while(this.type!==je.braceR){var Ae=this.parseStatement(null);s.body.push(Ae)}return this.next(),this.exitScope(),this.labels=ve,this.finishNode(s,"StaticBlock")};it.parseClassId=function(s,ve){if(this.type===je.name){if(s.id=this.parseIdent(),ve)this.checkLValSimple(s.id,bn,!1)}else{if(ve===!0)this.unexpected();s.id=null}};it.parseClassSuper=function(s){s.superClass=this.eat(je._extends)?this.parseExprSubscripts(null,!1):null};it.enterClassBody=function(){var s={declared:Object.create(null),used:[]};return this.privateNameStack.push(s),s.declared};it.exitClassBody=function(){var s=this.privateNameStack.pop(),{declared:ve,used:Ae}=s;if(!this.options.checkPrivateFields)return;var _e=this.privateNameStack.length,Ne=_e===0?null:this.privateNameStack[_e-1];for(var Le=0;Le<Ae.length;++Le){var Ie=Ae[Le];if(!Hn(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 mu(s,ve){var Ae=ve.key.name,_e=s[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 s[Ae]="true",!1;else if(!_e)return s[Ae]=Ne,!1;else return!0}function Br(s,ve){var{computed:Ae,key:_e}=s;return!Ae&&(_e.type==="Identifier"&&_e.name===ve||_e.type==="Literal"&&_e.value===ve)}it.parseExportAllDeclaration=function(s,ve){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))s.exported=this.parseModuleExportName(),this.checkExport(ve,s.exported,this.lastTokStart);else s.exported=null;if(this.expectContextual("from"),this.type!==je.string)this.unexpected();if(s.source=this.parseExprAtom(),this.options.ecmaVersion>=16)s.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(s,"ExportAllDeclaration")};it.parseExport=function(s,ve){if(this.next(),this.eat(je.star))return this.parseExportAllDeclaration(s,ve);if(this.eat(je._default))return this.checkExport(ve,"default",this.lastTokStart),s.declaration=this.parseExportDefaultDeclaration(),this.finishNode(s,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(s.declaration=this.parseExportDeclaration(s),s.declaration.type==="VariableDeclaration")this.checkVariableExport(ve,s.declaration.declarations);else this.checkExport(ve,s.declaration.id,s.declaration.id.start);if(s.specifiers=[],s.source=null,this.options.ecmaVersion>=16)s.attributes=[]}else{if(s.declaration=null,s.specifiers=this.parseExportSpecifiers(ve),this.eatContextual("from")){if(this.type!==je.string)this.unexpected();if(s.source=this.parseExprAtom(),this.options.ecmaVersion>=16)s.attributes=this.parseWithClause()}else{for(var Ae=0,_e=s.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(s.source=null,this.options.ecmaVersion>=16)s.attributes=[]}this.semicolon()}return this.finishNode(s,"ExportNamedDeclaration")};it.parseExportDeclaration=function(s){return this.parseStatement(null)};it.parseExportDefaultDeclaration=function(){var s;if(this.type===je._function||(s=this.isAsyncFunction())){var ve=this.startNode();if(this.next(),s)this.next();return this.parseFunction(ve,lr|Xo,!1,s)}else if(this.type===je._class){var Ae=this.startNode();return this.parseClass(Ae,"nullableID")}else{var _e=this.parseMaybeAssign();return this.semicolon(),_e}};it.checkExport=function(s,ve,Ae){if(!s)return;if(typeof ve!=="string")ve=ve.type==="Identifier"?ve.name:ve.value;if(Hn(s,ve))this.raiseRecoverable(Ae,"Duplicate export '"+ve+"'");s[ve]=!0};it.checkPatternExport=function(s,ve){var Ae=ve.type;if(Ae==="Identifier")this.checkExport(s,ve,ve.start);else if(Ae==="ObjectPattern")for(var _e=0,Ne=ve.properties;_e<Ne.length;_e+=1){var Le=Ne[_e];this.checkPatternExport(s,Le)}else if(Ae==="ArrayPattern")for(var Ie=0,Re=ve.elements;Ie<Re.length;Ie+=1){var Me=Re[Ie];if(Me)this.checkPatternExport(s,Me)}else if(Ae==="Property")this.checkPatternExport(s,ve.value);else if(Ae==="AssignmentPattern")this.checkPatternExport(s,ve.left);else if(Ae==="RestElement")this.checkPatternExport(s,ve.argument)};it.checkVariableExport=function(s,ve){if(!s)return;for(var Ae=0,_e=ve;Ae<_e.length;Ae+=1){var Ne=_e[Ae];this.checkPatternExport(s,Ne.id)}};it.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};it.parseExportSpecifier=function(s){var ve=this.startNode();return ve.local=this.parseModuleExportName(),ve.exported=this.eatContextual("as")?this.parseModuleExportName():ve.local,this.checkExport(s,ve.exported,ve.exported.start),this.finishNode(ve,"ExportSpecifier")};it.parseExportSpecifiers=function(s){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(s))}return ve};it.parseImport=function(s){if(this.next(),this.type===je.string)s.specifiers=du,s.source=this.parseExprAtom();else s.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),s.source=this.type===je.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)s.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(s,"ImportDeclaration")};it.parseImportSpecifier=function(){var s=this.startNode();if(s.imported=this.parseModuleExportName(),this.eatContextual("as"))s.local=this.parseIdent();else this.checkUnreserved(s.imported),s.local=s.imported;return this.checkLValSimple(s.local,bn),this.finishNode(s,"ImportSpecifier")};it.parseImportDefaultSpecifier=function(){var s=this.startNode();return s.local=this.parseIdent(),this.checkLValSimple(s.local,bn),this.finishNode(s,"ImportDefaultSpecifier")};it.parseImportNamespaceSpecifier=function(){var s=this.startNode();return this.next(),this.expectContextual("as"),s.local=this.parseIdent(),this.checkLValSimple(s.local,bn),this.finishNode(s,"ImportNamespaceSpecifier")};it.parseImportSpecifiers=function(){var s=[],ve=!0;if(this.type===je.name){if(s.push(this.parseImportDefaultSpecifier()),!this.eat(je.comma))return s}if(this.type===je.star)return s.push(this.parseImportNamespaceSpecifier()),s;this.expect(je.braceL);while(!this.eat(je.braceR)){if(!ve){if(this.expect(je.comma),this.afterTrailingComma(je.braceR))break}else ve=!1;s.push(this.parseImportSpecifier())}return s};it.parseWithClause=function(){var s=[];if(!this.eat(je._with))return s;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(Hn(ve,Ne))this.raiseRecoverable(_e.key.start,"Duplicate attribute key '"+Ne+"'");ve[Ne]=!0,s.push(_e)}return s};it.parseImportAttribute=function(){var s=this.startNode();if(s.key=this.type===je.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(je.colon),this.type!==je.string)this.unexpected();return s.value=this.parseExprAtom(),this.finishNode(s,"ImportAttribute")};it.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===je.string){var s=this.parseLiteral(this.value);if(lu.test(s.value))this.raise(s.start,"An export name cannot include a lone surrogate.");return s}return this.parseIdent(!0)};it.adaptDirectivePrologue=function(s){for(var ve=0;ve<s.length&&this.isDirectiveCandidate(s[ve]);++ve)s[ve].directive=s[ve].expression.raw.slice(1,-1)};it.isDirectiveCandidate=function(s){return this.options.ecmaVersion>=5&&s.type==="ExpressionStatement"&&s.expression.type==="Literal"&&typeof s.expression.value==="string"&&(this.input[s.start]==='"'||this.input[s.start]==="'")};var on=At.prototype;on.toAssignable=function(s,ve,Ae){if(this.options.ecmaVersion>=6&&s)switch(s.type){case"Identifier":if(this.inAsync&&s.name==="await")this.raise(s.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(s.type="ObjectPattern",Ae)this.checkPatternErrors(Ae,!0);for(var _e=0,Ne=s.properties;_e<Ne.length;_e+=1){var Le=Ne[_e];if(this.toAssignable(Le,ve),Le.type==="RestElement"&&(Le.argument.type==="ArrayPattern"||Le.argument.type==="ObjectPattern"))this.raise(Le.argument.start,"Unexpected token")}break;case"Property":if(s.kind!=="init")this.raise(s.key.start,"Object pattern can't contain getter or setter");this.toAssignable(s.value,ve);break;case"ArrayExpression":if(s.type="ArrayPattern",Ae)this.checkPatternErrors(Ae,!0);this.toAssignableList(s.elements,ve);break;case"SpreadElement":if(s.type="RestElement",this.toAssignable(s.argument,ve),s.argument.type==="AssignmentPattern")this.raise(s.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(s.operator!=="=")this.raise(s.left.end,"Only '=' operator can be used for specifying default value.");s.type="AssignmentPattern",delete s.operator,this.toAssignable(s.left,ve);break;case"ParenthesizedExpression":this.toAssignable(s.expression,ve,Ae);break;case"ChainExpression":this.raiseRecoverable(s.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!ve)break;default:this.raise(s.start,"Assigning to rvalue")}else if(Ae)this.checkPatternErrors(Ae,!0);return s};on.toAssignableList=function(s,ve){var Ae=s.length;for(var _e=0;_e<Ae;_e++){var Ne=s[_e];if(Ne)this.toAssignable(Ne,ve)}if(Ae){var Le=s[Ae-1];if(this.options.ecmaVersion===6&&ve&&Le&&Le.type==="RestElement"&&Le.argument.type!=="Identifier")this.unexpected(Le.argument.start)}return s};on.parseSpread=function(s){var ve=this.startNode();return this.next(),ve.argument=this.parseMaybeAssign(!1,s),this.finishNode(ve,"SpreadElement")};on.parseRestBinding=function(){var s=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==je.name)this.unexpected();return s.argument=this.parseBindingAtom(),this.finishNode(s,"RestElement")};on.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case je.bracketL:var s=this.startNode();return this.next(),s.elements=this.parseBindingList(je.bracketR,!0,!0),this.finishNode(s,"ArrayPattern");case je.braceL:return this.parseObj(!0)}return this.parseIdent()};on.parseBindingList=function(s,ve,Ae,_e){var Ne=[],Le=!0;while(!this.eat(s)){if(Le)Le=!1;else this.expect(je.comma);if(ve&&this.type===je.comma)Ne.push(null);else if(Ae&&this.afterTrailingComma(s))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(s);break}else Ne.push(this.parseAssignableListItem(_e))}return Ne};on.parseAssignableListItem=function(s){var ve=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(ve),ve};on.parseBindingListItem=function(s){return s};on.parseMaybeDefault=function(s,ve,Ae){if(Ae=Ae||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(je.eq))return Ae;var _e=this.startNodeAt(s,ve);return _e.left=Ae,_e.right=this.parseMaybeAssign(),this.finishNode(_e,"AssignmentPattern")};on.checkLValSimple=function(s,ve,Ae){if(ve===void 0)ve=Mr;var _e=ve!==Mr;switch(s.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(s.name))this.raiseRecoverable(s.start,(_e?"Binding ":"Assigning to ")+s.name+" in strict mode");if(_e){if(ve===bn&&s.name==="let")this.raiseRecoverable(s.start,"let is disallowed as a lexically bound name");if(Ae){if(Hn(Ae,s.name))this.raiseRecoverable(s.start,"Argument name clash");Ae[s.name]=!0}if(ve!==zo)this.declareName(s.name,ve,s.start)}break;case"ChainExpression":this.raiseRecoverable(s.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(_e)this.raiseRecoverable(s.start,"Binding member expression");break;case"ParenthesizedExpression":if(_e)this.raiseRecoverable(s.start,"Binding parenthesized expression");return this.checkLValSimple(s.expression,ve,Ae);default:this.raise(s.start,(_e?"Binding":"Assigning to")+" rvalue")}};on.checkLValPattern=function(s,ve,Ae){if(ve===void 0)ve=Mr;switch(s.type){case"ObjectPattern":for(var _e=0,Ne=s.properties;_e<Ne.length;_e+=1){var Le=Ne[_e];this.checkLValInnerPattern(Le,ve,Ae)}break;case"ArrayPattern":for(var Ie=0,Re=s.elements;Ie<Re.length;Ie+=1){var Me=Re[Ie];if(Me)this.checkLValInnerPattern(Me,ve,Ae)}break;default:this.checkLValSimple(s,ve,Ae)}};on.checkLValInnerPattern=function(s,ve,Ae){if(ve===void 0)ve=Mr;switch(s.type){case"Property":this.checkLValInnerPattern(s.value,ve,Ae);break;case"AssignmentPattern":this.checkLValPattern(s.left,ve,Ae);break;case"RestElement":this.checkLValPattern(s.argument,ve,Ae);break;default:this.checkLValPattern(s,ve,Ae)}};var nn=function(ve,Ae,_e,Ne,Le){this.token=ve,this.isExpr=!!Ae,this.preserveSpace=!!_e,this.override=Ne,this.generator=!!Le},Tt={b_stat:new nn("{",!1),b_expr:new nn("{",!0),b_tmpl:new nn("${",!1),p_stat:new nn("(",!1),p_expr:new nn("(",!0),q_tmpl:new nn("`",!0,!0,function(s){return s.tryReadTemplateToken()}),f_stat:new nn("function",!1),f_expr:new nn("function",!0),f_expr_gen:new nn("function",!0,!1,null,!0),f_gen:new nn("function",!1,!1,null,!0)},Kn=At.prototype;Kn.initialContext=function(){return[Tt.b_stat]};Kn.curContext=function(){return this.context[this.context.length-1]};Kn.braceIsBlock=function(s){var ve=this.curContext();if(ve===Tt.f_expr||ve===Tt.f_stat)return!0;if(s===je.colon&&(ve===Tt.b_stat||ve===Tt.b_expr))return!ve.isExpr;if(s===je._return||s===je.name&&this.exprAllowed)return Vt.test(this.input.slice(this.lastTokEnd,this.start));if(s===je._else||s===je.semi||s===je.eof||s===je.parenR||s===je.arrow)return!0;if(s===je.braceL)return ve===Tt.b_stat;if(s===je._var||s===je._const||s===je.name)return!1;return!this.exprAllowed};Kn.inGeneratorContext=function(){for(var s=this.context.length-1;s>=1;s--){var ve=this.context[s];if(ve.token==="function")return ve.generator}return!1};Kn.updateContext=function(s){var ve,Ae=this.type;if(Ae.keyword&&s===je.dot)this.exprAllowed=!1;else if(ve=Ae.updateContext)ve.call(this,s);else this.exprAllowed=Ae.beforeExpr};Kn.overrideContext=function(s){if(this.curContext()!==s)this.context[this.context.length-1]=s};je.parenR.updateContext=je.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var s=this.context.pop();if(s===Tt.b_stat&&this.curContext().token==="function")s=this.context.pop();this.exprAllowed=!s.isExpr};je.braceL.updateContext=function(s){this.context.push(this.braceIsBlock(s)?Tt.b_stat:Tt.b_expr),this.exprAllowed=!0};je.dollarBraceL.updateContext=function(){this.context.push(Tt.b_tmpl),this.exprAllowed=!0};je.parenL.updateContext=function(s){var ve=s===je._if||s===je._for||s===je._with||s===je._while;this.context.push(ve?Tt.p_stat:Tt.p_expr),this.exprAllowed=!0};je.incDec.updateContext=function(){};je._function.updateContext=je._class.updateContext=function(s){if(s.beforeExpr&&s!==je._else&&!(s===je.semi&&this.curContext()!==Tt.p_stat)&&!(s===je._return&&Vt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((s===je.colon||s===je.braceL)&&this.curContext()===Tt.b_stat))this.context.push(Tt.f_expr);else this.context.push(Tt.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()===Tt.q_tmpl)this.context.pop();else this.context.push(Tt.q_tmpl);this.exprAllowed=!1};je.star.updateContext=function(s){if(s===je._function){var ve=this.context.length-1;if(this.context[ve]===Tt.f_expr)this.context[ve]=Tt.f_expr_gen;else this.context[ve]=Tt.f_gen}this.exprAllowed=!0};je.name.updateContext=function(s){var ve=!1;if(this.options.ecmaVersion>=6&&s!==je.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())ve=!0}this.exprAllowed=ve};var pt=At.prototype;pt.checkPropClash=function(s,ve,Ae){if(this.options.ecmaVersion>=9&&s.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(s.computed||s.method||s.shorthand))return;var _e=s.key,Ne;switch(_e.type){case"Identifier":Ne=_e.name;break;case"Literal":Ne=String(_e.value);break;default:return}var Le=s.kind;if(this.options.ecmaVersion>=6){if(Ne==="__proto__"&&Le==="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 Re;if(Le==="init")Re=this.strict&&Ie.init||Ie.get||Ie.set;else Re=Ie.init||Ie[Le];if(Re)this.raiseRecoverable(_e.start,"Redefinition of property")}else Ie=ve[Ne]={init:!1,get:!1,set:!1};Ie[Le]=!0};pt.parseExpression=function(s,ve){var Ae=this;return this.catchStackOverflow(function(){var{start:_e,startLoc:Ne}=Ae,Le=Ae.parseMaybeAssign(s,ve);if(Ae.type===je.comma){var Ie=Ae.startNodeAt(_e,Ne);Ie.expressions=[Le];while(Ae.eat(je.comma))Ie.expressions.push(Ae.parseMaybeAssign(s,ve));return Ae.finishNode(Ie,"SequenceExpression")}return Le})};pt.parseMaybeAssign=function(s,ve,Ae){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(s);else this.exprAllowed=!1;var _e=!1,Ne=-1,Le=-1,Ie=-1;if(ve)Ne=ve.parenthesizedAssign,Le=ve.trailingComma,Ie=ve.doubleProto,ve.parenthesizedAssign=ve.trailingComma=-1;else ve=new Ur,_e=!0;var Re=this.start,Me=this.startLoc;if(this.type===je.parenL||this.type===je.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=s==="await";var $e=this.parseMaybeConditional(s,ve);if(Ae)$e=Ae.call(this,$e,Re,Me);if(this.type.isAssign){var Be=this.startNodeAt(Re,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(s),Ie>-1)ve.doubleProto=Ie;return this.finishNode(Be,"AssignmentExpression")}else if(_e)this.checkExpressionErrors(ve,!0);if(Ne>-1)ve.parenthesizedAssign=Ne;if(Le>-1)ve.trailingComma=Le;return $e};pt.parseMaybeConditional=function(s,ve){var Ae=this.start,_e=this.startLoc,Ne=this.parseExprOps(s,ve);if(this.checkExpressionErrors(ve))return Ne;if(!(Ne.type==="ArrowFunctionExpression"&&Ne.start===Ae)&&this.eat(je.question)){var Le=this.startNodeAt(Ae,_e);return Le.test=Ne,Le.consequent=this.parseMaybeAssign(),this.expect(je.colon),Le.alternate=this.parseMaybeAssign(s),this.finishNode(Le,"ConditionalExpression")}return Ne};pt.parseExprOps=function(s,ve){var Ae=this.start,_e=this.startLoc,Ne=this.parseMaybeUnary(ve,!1,!1,s);if(this.checkExpressionErrors(ve))return Ne;return Ne.start===Ae&&Ne.type==="ArrowFunctionExpression"?Ne:this.parseExprOp(Ne,Ae,_e,-1,s)};pt.parseExprOp=function(s,ve,Ae,_e,Ne){var Le=this.type.binop;if(Le!=null&&(!Ne||this.type!==je._in)){if(Le>_e){var Ie=this.type===je.logicalOR||this.type===je.logicalAND,Re=this.type===je.coalesce;if(Re)Le=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,Le,Ne),Ue=this.buildBinary(ve,Ae,s,Ve,Me,Ie||Re);if(Ie&&this.type===je.coalesce||Re&&(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 s};pt.buildBinary=function(s,ve,Ae,_e,Ne,Le){if(_e.type==="PrivateIdentifier")this.raise(_e.start,"Private identifier can only be left side of binary expression");var Ie=this.startNodeAt(s,ve);return Ie.left=Ae,Ie.operator=Ne,Ie.right=_e,this.finishNode(Ie,Le?"LogicalExpression":"BinaryExpression")};pt.parseMaybeUnary=function(s,ve,Ae,_e){var Ne=this.start,Le=this.startLoc,Ie;if(this.isContextual("await")&&this.canAwait)Ie=this.parseAwait(_e),ve=!0;else if(this.type.prefix){var Re=this.startNode(),Me=this.type===je.incDec;if(Re.operator=this.value,Re.prefix=!0,this.next(),Re.argument=this.parseMaybeUnary(null,!0,Me,_e),this.checkExpressionErrors(s,!0),Me)this.checkLValSimple(Re.argument);else if(this.strict&&Re.operator==="delete"&&Jo(Re.argument))this.raiseRecoverable(Re.start,"Deleting local variable in strict mode");else if(Re.operator==="delete"&&Xs(Re.argument))this.raiseRecoverable(Re.start,"Private fields can not be deleted");else ve=!0;Ie=this.finishNode(Re,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(s,_e),this.checkExpressionErrors(s))return Ie;while(this.type.postfix&&!this.canInsertSemicolon()){var $e=this.startNodeAt(Ne,Le);$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,Le,Ie,this.parseMaybeUnary(null,!1,!1,_e),"**",!1);else return Ie};function Jo(s){return s.type==="Identifier"||s.type==="ParenthesizedExpression"&&Jo(s.expression)}function Xs(s){return s.type==="MemberExpression"&&s.property.type==="PrivateIdentifier"||s.type==="ChainExpression"&&Xs(s.expression)||s.type==="ParenthesizedExpression"&&Xs(s.expression)}pt.parseExprSubscripts=function(s,ve){var Ae=this.start,_e=this.startLoc,Ne=this.parseExprAtom(s,ve);if(Ne.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Ne;var Le=this.parseSubscripts(Ne,Ae,_e,!1,ve);if(s&&Le.type==="MemberExpression"){if(s.parenthesizedAssign>=Le.start)s.parenthesizedAssign=-1;if(s.parenthesizedBind>=Le.start)s.parenthesizedBind=-1;if(s.trailingComma>=Le.start)s.trailingComma=-1}return Le};pt.parseSubscripts=function(s,ve,Ae,_e,Ne){var Le=this.options.ecmaVersion>=8&&s.type==="Identifier"&&s.name==="async"&&this.lastTokEnd===s.end&&!this.canInsertSemicolon()&&s.end-s.start===5&&this.potentialArrowAt===s.start,Ie=!1;while(!0){var Re=this.parseSubscript(s,ve,Ae,_e,Le,Ie,Ne);if(Re.optional)Ie=!0;if(Re===s||Re.type==="ArrowFunctionExpression"){if(Ie){var Me=this.startNodeAt(ve,Ae);Me.expression=Re,Re=this.finishNode(Me,"ChainExpression")}return Re}s=Re}};pt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(je.arrow)};pt.parseSubscriptAsyncArrow=function(s,ve,Ae,_e){return this.parseArrowExpression(this.startNodeAt(s,ve),Ae,!0,_e)};pt.parseSubscript=function(s,ve,Ae,_e,Ne,Le,Ie){var Re=this.options.ecmaVersion>=11,Me=Re&&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=s,$e)Be.property=this.parseExpression(),this.expect(je.bracketR);else if(this.type===je.privateId&&s.type!=="Super")Be.property=this.parsePrivateIdent();else Be.property=this.parseIdent(this.options.allowReserved!=="never");if(Be.computed=!!$e,Re)Be.optional=Me;s=this.finishNode(Be,"MemberExpression")}else if(!_e&&this.eat(je.parenL)){var Ve=new Ur,Ue=this.yieldPos,We=this.awaitPos,Ke=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=We,this.awaitIdentPos=Ke,this.parseSubscriptAsyncArrow(ve,Ae,Je,Ie)}this.checkExpressionErrors(Ve,!0),this.yieldPos=Ue||this.yieldPos,this.awaitPos=We||this.awaitPos,this.awaitIdentPos=Ke||this.awaitIdentPos;var ze=this.startNodeAt(ve,Ae);if(ze.callee=s,ze.arguments=Je,Re)ze.optional=Me;s=this.finishNode(ze,"CallExpression")}else if(this.type===je.backQuote){if(Me||Le)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var nt=this.startNodeAt(ve,Ae);nt.tag=s,nt.quasi=this.parseTemplate({isTagged:!0}),s=this.finishNode(nt,"TaggedTemplateExpression")}return s};pt.parseExprAtom=function(s,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 Le=this.start,Ie=this.startLoc,Re=this.containsEsc,Me=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Re&&Me.name==="async"&&!this.canInsertSemicolon()&&this.eat(je._function))return this.overrideContext(Tt.f_expr),this.parseFunction(this.startNodeAt(Le,Ie),0,!1,!0,ve);if(Ne&&!this.canInsertSemicolon()){if(this.eat(je.arrow))return this.parseArrowExpression(this.startNodeAt(Le,Ie),[Me],!1,ve);if(this.options.ecmaVersion>=8&&Me.name==="async"&&this.type===je.name&&!Re&&(!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(Le,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(s){if(s.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ve))s.parenthesizedAssign=Be;if(s.parenthesizedBind<0)s.parenthesizedBind=Be}return Ve;case je.bracketL:return _e=this.startNode(),this.next(),_e.elements=this.parseExprList(je.bracketR,!0,!0,s),this.finishNode(_e,"ArrayExpression");case je.braceL:return this.overrideContext(Tt.b_expr),this.parseObj(!1,s);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(s){var ve=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===je.parenL&&!s)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(s){if(this.next(),s.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(je.parenR))if(this.expect(je.comma),!this.afterTrailingComma(je.parenR)){if(s.options=this.parseMaybeAssign(),!this.eat(je.parenR)){if(this.expect(je.comma),!this.afterTrailingComma(je.parenR))this.unexpected()}}else s.options=null;else s.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(s,"ImportExpression")};pt.parseImportMeta=function(s){this.next();var ve=this.containsEsc;if(s.property=this.parseIdent(!0),s.property.name!=="meta")this.raiseRecoverable(s.property.start,"The only valid meta property for import is 'import.meta'");if(ve)this.raiseRecoverable(s.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(s.start,"Cannot use 'import.meta' outside a module");return this.finishNode(s,"MetaProperty")};pt.parseLiteral=function(s){var ve=this.startNode();if(ve.value=s,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 s=this.parseExpression();return this.expect(je.parenR),s};pt.shouldParseArrow=function(s){return!this.canInsertSemicolon()};pt.parseParenAndDistinguishExpression=function(s,ve){var Ae=this.start,_e=this.startLoc,Ne,Le=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Ie=this.start,Re=this.startLoc,Me=[],$e=!0,Be=!1,Ve=new Ur,Ue=this.yieldPos,We=this.awaitPos,Ke;this.yieldPos=0,this.awaitPos=0;while(this.type!==je.parenR)if($e?$e=!1:this.expect(je.comma),Le&&this.afterTrailingComma(je.parenR,!0)){Be=!0;break}else if(this.type===je.ellipsis){if(Ke=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,ze=this.lastTokEndLoc;if(this.expect(je.parenR),s&&this.shouldParseArrow(Me)&&this.eat(je.arrow))return this.checkPatternErrors(Ve,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Ue,this.awaitPos=We,this.parseParenArrowList(Ae,_e,Me,ve);if(!Me.length||Be)this.unexpected(this.lastTokStart);if(Ke)this.unexpected(Ke);if(this.checkExpressionErrors(Ve,!0),this.yieldPos=Ue||this.yieldPos,this.awaitPos=We||this.awaitPos,Me.length>1)Ne=this.startNodeAt(Ie,Re),Ne.expressions=Me,this.finishNodeAt(Ne,"SequenceExpression",Je,ze);else Ne=Me[0]}else Ne=this.parseParenExpression();if(this.options.preserveParens){var nt=this.startNodeAt(Ae,_e);return nt.expression=Ne,this.finishNode(nt,"ParenthesizedExpression")}else return Ne};pt.parseParenItem=function(s){return s};pt.parseParenArrowList=function(s,ve,Ae,_e){return this.parseArrowExpression(this.startNodeAt(s,ve),Ae,!1,_e)};var gu=[];pt.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var s=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===je.dot){var ve=this.startNodeAt(s.start,s.loc&&s.loc.start);ve.name="new",s.meta=this.finishNode(ve,"Identifier"),this.next();var Ae=this.containsEsc;if(s.property=this.parseIdent(!0),s.property.name!=="target")this.raiseRecoverable(s.property.start,"The only valid meta property for new is 'new.target'");if(Ae)this.raiseRecoverable(s.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(s.start,"'new.target' can only be used in functions and class static block");return this.finishNode(s,"MetaProperty")}var _e=this.start,Ne=this.startLoc;if(s.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),_e,Ne,!0,!1),s.callee.type==="Super")this.raiseRecoverable(_e,"Invalid use of 'super'");if(this.eat(je.parenL))s.arguments=this.parseExprList(je.parenR,this.options.ecmaVersion>=8,!1);else s.arguments=gu;return this.finishNode(s,"NewExpression")};pt.parseTemplateElement=function(s){var ve=s.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(s){if(s===void 0)s={};var ve=s.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(s){return!s.computed&&s.key.type==="Identifier"&&s.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)&&!Vt.test(this.input.slice(this.lastTokEnd,this.start))};pt.parseObj=function(s,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 Le=this.parseProperty(s,ve);if(!s)this.checkPropClash(Le,Ne,ve);Ae.properties.push(Le)}return this.finishNode(Ae,s?"ObjectPattern":"ObjectExpression")};pt.parseProperty=function(s,ve){var Ae=this.startNode(),_e,Ne,Le,Ie;if(this.options.ecmaVersion>=9&&this.eat(je.ellipsis)){if(s){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,s||ve)Le=this.start,Ie=this.startLoc;if(!s)_e=this.eat(je.star)}var Re=this.containsEsc;if(this.parsePropertyName(Ae),!s&&!Re&&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,s,_e,Ne,Le,Ie,ve,Re),this.finishNode(Ae,"Property")};pt.parseGetterSetter=function(s){var ve=s.key.name;this.parsePropertyName(s),s.value=this.parseMethod(!1),s.kind=ve;var Ae=s.kind==="get"?0:1;if(s.value.params.length!==Ae){var _e=s.value.start;if(s.kind==="get")this.raiseRecoverable(_e,"getter should have no params");else this.raiseRecoverable(_e,"setter should have exactly one param")}else if(s.kind==="set"&&s.value.params[0].type==="RestElement")this.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params")};pt.parsePropertyValue=function(s,ve,Ae,_e,Ne,Le,Ie,Re){if((Ae||_e)&&this.type===je.colon)this.unexpected();if(this.eat(je.colon))s.value=ve?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Ie),s.kind="init";else if(this.options.ecmaVersion>=6&&this.type===je.parenL){if(ve)this.unexpected();s.method=!0,s.value=this.parseMethod(Ae,_e),s.kind="init"}else if(!ve&&!Re&&this.options.ecmaVersion>=5&&!s.computed&&s.key.type==="Identifier"&&(s.key.name==="get"||s.key.name==="set")&&(this.type!==je.comma&&this.type!==je.braceR&&this.type!==je.eq)){if(Ae||_e)this.unexpected();this.parseGetterSetter(s)}else if(this.options.ecmaVersion>=6&&!s.computed&&s.key.type==="Identifier"){if(Ae||_e)this.unexpected();if(this.checkUnreserved(s.key),s.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Ne;if(ve)s.value=this.parseMaybeDefault(Ne,Le,this.copyNode(s.key));else if(this.type===je.eq&&Ie){if(Ie.shorthandAssign<0)Ie.shorthandAssign=this.start;s.value=this.parseMaybeDefault(Ne,Le,this.copyNode(s.key))}else s.value=this.copyNode(s.key);s.kind="init",s.shorthand=!0}else this.unexpected()};pt.parsePropertyName=function(s){if(this.options.ecmaVersion>=6)if(this.eat(je.bracketL))return s.computed=!0,s.key=this.parseMaybeAssign(),this.expect(je.bracketR),s.key;else s.computed=!1;return s.key=this.type===je.num||this.type===je.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};pt.initFunction=function(s){if(s.id=null,this.options.ecmaVersion>=6)s.generator=s.expression=!1;if(this.options.ecmaVersion>=8)s.async=!1};pt.parseMethod=function(s,ve,Ae){var _e=this.startNode(),Ne=this.yieldPos,Le=this.awaitPos,Ie=this.awaitIdentPos;if(this.initFunction(_e),this.options.ecmaVersion>=6)_e.generator=s;if(this.options.ecmaVersion>=8)_e.async=!!ve;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ti(ve,_e.generator)|Vr|(Ae?Go: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=Le,this.awaitIdentPos=Ie,this.finishNode(_e,"FunctionExpression")};pt.parseArrowExpression=function(s,ve,Ae,_e){var Ne=this.yieldPos,Le=this.awaitPos,Ie=this.awaitIdentPos;if(this.enterScope(ti(Ae,!1)|ei),this.initFunction(s),this.options.ecmaVersion>=8)s.async=!!Ae;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,s.params=this.toAssignableList(ve,!0),this.parseFunctionBody(s,!0,!1,_e),this.yieldPos=Ne,this.awaitPos=Le,this.awaitIdentPos=Ie,this.finishNode(s,"ArrowFunctionExpression")};pt.parseFunctionBody=function(s,ve,Ae,_e){var Ne=ve&&this.type!==je.braceL,Le=this.strict,Ie=!1;if(Ne)s.body=this.parseMaybeAssign(_e),s.expression=!0,this.checkParams(s,!1);else{var Re=this.options.ecmaVersion>=7&&!this.isSimpleParamList(s.params);if(!Le||Re){if(Ie=this.strictDirective(this.end),Ie&&Re)this.raiseRecoverable(s.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(s,!Le&&!Ie&&!ve&&!Ae&&this.isSimpleParamList(s.params)),this.strict&&s.id)this.checkLValSimple(s.id,zo);s.body=this.parseBlock(!1,void 0,Ie&&!Le),s.expression=!1,this.adaptDirectivePrologue(s.body.body),this.labels=Me}this.exitScope()};pt.isSimpleParamList=function(s){for(var ve=0,Ae=s;ve<Ae.length;ve+=1){var _e=Ae[ve];if(_e.type!=="Identifier")return!1}return!0};pt.checkParams=function(s,ve){var Ae=Object.create(null);for(var _e=0,Ne=s.params;_e<Ne.length;_e+=1){var Le=Ne[_e];this.checkLValInnerPattern(Le,ni,ve?null:Ae)}};pt.parseExprList=function(s,ve,Ae,_e){var Ne=[],Le=!0;while(!this.eat(s)){if(!Le){if(this.expect(je.comma),ve&&this.afterTrailingComma(s))break}else Le=!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(s){var{start:ve,end:Ae,name:_e}=s;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&qr)&&_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(s){var ve=this.parseIdentNode();if(this.next(!!s),this.finishNode(ve,"Identifier"),!s){if(this.checkUnreserved(ve),ve.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=ve.start}return ve};pt.parseIdentNode=function(){var s=this.startNode();if(this.type===je.name)s.name=this.value;else if(this.type.keyword){if(s.name=this.type.keyword,(s.name==="class"||s.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=je.name}else this.unexpected();return s};pt.parsePrivateIdent=function(){var s=this.startNode();if(this.type===je.privateId)s.name=this.value;else this.unexpected();if(this.next(),this.finishNode(s,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(s.start,"Private field '#"+s.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(s);return s};pt.parseYield=function(s){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(s);return this.finishNode(ve,"YieldExpression")};pt.parseAwait=function(s){if(!this.awaitPos)this.awaitPos=this.start;var ve=this.startNode();return this.next(),ve.argument=this.parseMaybeUnary(null,!0,!1,s),this.finishNode(ve,"AwaitExpression")};var $r=At.prototype;$r.raise=function(s,ve){var Ae=Qs(this.input,s);if(ve+=" ("+Ae.line+":"+Ae.column+")",this.sourceFile)ve+=" in "+this.sourceFile;var _e=SyntaxError(ve);throw _e.pos=s,_e.loc=Ae,_e.raisedAt=this.pos,_e};$r.raiseRecoverable=$r.raise;$r.curPosition=function(){if(this.options.locations)return new Wn(this.curLine,this.pos-this.lineStart)};var Pn=At.prototype,yu=function(ve){this.flags=ve,this.var=[],this.lexical=[],this.functions=[]};Pn.enterScope=function(s){this.scopeStack.push(new yu(s))};Pn.exitScope=function(){this.scopeStack.pop()};Pn.treatFunctionsAsVarInScope=function(s){return s.flags&$n||!this.inModule&&s.flags&Mn};Pn.declareName=function(s,ve,Ae){var _e=!1;if(ve===bn){var Ne=this.currentScope();if(_e=Ne.lexical.indexOf(s)>-1||Ne.functions.indexOf(s)>-1||Ne.var.indexOf(s)>-1,Ne.lexical.push(s),this.inModule&&Ne.flags&Mn)delete this.undefinedExports[s]}else if(ve===Ko){var Le=this.currentScope();Le.lexical.push(s)}else if(ve===Ho){var Ie=this.currentScope();if(this.treatFunctionsAsVar)_e=Ie.lexical.indexOf(s)>-1;else _e=Ie.lexical.indexOf(s)>-1||Ie.var.indexOf(s)>-1;Ie.functions.push(s)}else for(var Re=this.scopeStack.length-1;Re>=0;--Re){var Me=this.scopeStack[Re];if(Me.lexical.indexOf(s)>-1&&!(Me.flags&Uo&&Me.lexical[0]===s)||!this.treatFunctionsAsVarInScope(Me)&&Me.functions.indexOf(s)>-1){_e=!0;break}if(Me.var.push(s),this.inModule&&Me.flags&Mn)delete this.undefinedExports[s];if(Me.flags&qr)break}if(_e)this.raiseRecoverable(Ae,"Identifier '"+s+"' has already been declared")};Pn.checkLocalExport=function(s){if(this.scopeStack[0].lexical.indexOf(s.name)===-1&&this.scopeStack[0].var.indexOf(s.name)===-1)this.undefinedExports[s.name]=s};Pn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Pn.currentVarScope=function(){for(var s=this.scopeStack.length-1;;s--){var ve=this.scopeStack[s];if(ve.flags&(qr|ur|Fn))return ve}};Pn.currentThisScope=function(){for(var s=this.scopeStack.length-1;;s--){var ve=this.scopeStack[s];if(ve.flags&(qr|ur|Fn)&&!(ve.flags&ei))return ve}};var fr=function(ve,Ae,_e){if(this.type="",this.start=Ae,this.end=0,ve.options.locations)this.loc=new pr(ve,_e);if(ve.options.directSourceFile)this.sourceFile=ve.options.directSourceFile;if(ve.options.ranges)this.range=[Ae,0]},hr=At.prototype;hr.startNode=function(){return new fr(this,this.start,this.startLoc)};hr.startNodeAt=function(s,ve){return new fr(this,s,ve)};function Yo(s,ve,Ae,_e){if(s.type=ve,s.end=Ae,this.options.locations)s.loc.end=_e;if(this.options.ranges)s.range[1]=Ae;return s}hr.finishNode=function(s,ve){return Yo.call(this,s,ve,this.lastTokEnd,this.lastTokEndLoc)};hr.finishNodeAt=function(s,ve,Ae,_e){return Yo.call(this,s,ve,Ae,_e)};hr.copyNode=function(s){var ve=new fr(this,s.start,this.startLoc);for(var Ae in s)ve[Ae]=s[Ae];return ve};var xu="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",Qo="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",Zo=Qo+" Extended_Pictographic",ea=Zo,ta=ea+" EBase EComp EMod EPres ExtPict",na=ta,bu=na,Eu={9:Qo,10:Zo,11:ea,12:ta,13:na,14:bu},Cu="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",vu={9:"",10:"",11:"",12:"",13:"",14:Cu},Oo="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",ra="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",sa=ra+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ia=sa+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",oa=ia+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",aa=oa+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Su=aa+" "+xu,Tu={9:ra,10:sa,11:ia,12:oa,13:aa,14:Su},ca={};function Au(s){var ve=ca[s]={binary:wn(Eu[s]+" "+Oo),binaryOfStrings:wn(vu[s]),nonBinary:{General_Category:wn(Oo),Script:wn(Tu[s])}};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(cr=0,Rr=[9,10,11,12,13,14];cr<Rr.length;cr+=1)Js=Rr[cr],Au(Js);var Js,cr,Rr,rt=At.prototype,Fr=function(ve,Ae){this.parent=ve,this.base=Ae||this};Fr.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};Fr.prototype.sibling=function(){return new Fr(this.parent,this.base)};var un=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=ca[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};un.prototype.reset=function(ve,Ae,_e){var Ne=_e.indexOf("v")!==-1,Le=_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=Le&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=Le&&this.parser.options.ecmaVersion>=9};un.prototype.raise=function(ve){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+ve)};un.prototype.at=function(ve,Ae){if(Ae===void 0)Ae=!1;var _e=this.source,Ne=_e.length;if(ve>=Ne)return-1;var Le=_e.charCodeAt(ve);if(!(Ae||this.switchU)||Le<=55295||Le>=57344||ve+1>=Ne)return Le;var Ie=_e.charCodeAt(ve+1);return Ie>=56320&&Ie<=57343?(Le<<10)+Ie-56613888:Le};un.prototype.nextIndex=function(ve,Ae){if(Ae===void 0)Ae=!1;var _e=this.source,Ne=_e.length;if(ve>=Ne)return Ne;var Le=_e.charCodeAt(ve),Ie;if(!(Ae||this.switchU)||Le<=55295||Le>=57344||ve+1>=Ne||(Ie=_e.charCodeAt(ve+1))<56320||Ie>57343)return ve+1;return ve+2};un.prototype.current=function(ve){if(ve===void 0)ve=!1;return this.at(this.pos,ve)};un.prototype.lookahead=function(ve){if(ve===void 0)ve=!1;return this.at(this.nextIndex(this.pos,ve),ve)};un.prototype.advance=function(ve){if(ve===void 0)ve=!1;this.pos=this.nextIndex(this.pos,ve)};un.prototype.eat=function(ve,Ae){if(Ae===void 0)Ae=!1;if(this.current(Ae)===ve)return this.advance(Ae),!0;return!1};un.prototype.eatChars=function(ve,Ae){if(Ae===void 0)Ae=!1;var _e=this.pos;for(var Ne=0,Le=ve;Ne<Le.length;Ne+=1){var Ie=Le[Ne],Re=this.at(_e,Ae);if(Re===-1||Re!==Ie)return!1;_e=this.nextIndex(_e,Ae)}return this.pos=_e,!0};rt.validateRegExpFlags=function(s){var{validFlags:ve,flags:Ae}=s,_e=!1,Ne=!1;for(var Le=0;Le<Ae.length;Le++){var Ie=Ae.charAt(Le);if(ve.indexOf(Ie)===-1)this.raise(s.start,"Invalid regular expression flag");if(Ae.indexOf(Ie,Le+1)>-1)this.raise(s.start,"Duplicate regular expression flag");if(Ie==="u")_e=!0;if(Ie==="v")Ne=!0}if(this.options.ecmaVersion>=15&&_e&&Ne)this.raise(s.start,"Invalid regular expression flag")};function ku(s){for(var ve in s)return!0;return!1}rt.validateRegExpPattern=function(s){if(this.regexp_pattern(s),!s.switchN&&this.options.ecmaVersion>=9&&ku(s.groupNames))s.switchN=!0,this.regexp_pattern(s)};rt.regexp_pattern=function(s){if(s.pos=0,s.lastIntValue=0,s.lastStringValue="",s.lastAssertionIsQuantifiable=!1,s.numCapturingParens=0,s.maxBackReference=0,s.groupNames=Object.create(null),s.backReferenceNames.length=0,s.branchID=null,this.regexp_disjunction(s),s.pos!==s.source.length){if(s.eat(41))s.raise("Unmatched ')'");if(s.eat(93)||s.eat(125))s.raise("Lone quantifier brackets")}if(s.maxBackReference>s.numCapturingParens)s.raise("Invalid escape");for(var ve=0,Ae=s.backReferenceNames;ve<Ae.length;ve+=1){var _e=Ae[ve];if(!s.groupNames[_e])s.raise("Invalid named capture referenced")}};rt.regexp_disjunction=function(s){var ve=this.options.ecmaVersion>=16;if(ve)s.branchID=new Fr(s.branchID,null);this.regexp_alternative(s);while(s.eat(124)){if(ve)s.branchID=s.branchID.sibling();this.regexp_alternative(s)}if(ve)s.branchID=s.branchID.parent;if(this.regexp_eatQuantifier(s,!0))s.raise("Nothing to repeat");if(s.eat(123))s.raise("Lone quantifier brackets")};rt.regexp_alternative=function(s){while(s.pos<s.source.length&&this.regexp_eatTerm(s));};rt.regexp_eatTerm=function(s){if(this.regexp_eatAssertion(s)){if(s.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(s)){if(s.switchU)s.raise("Invalid quantifier")}return!0}if(s.switchU?this.regexp_eatAtom(s):this.regexp_eatExtendedAtom(s))return this.regexp_eatQuantifier(s),!0;return!1};rt.regexp_eatAssertion=function(s){var ve=s.pos;if(s.lastAssertionIsQuantifiable=!1,s.eat(94)||s.eat(36))return!0;if(s.eat(92)){if(s.eat(66)||s.eat(98))return!0;s.pos=ve}if(s.eat(40)&&s.eat(63)){var Ae=!1;if(this.options.ecmaVersion>=9)Ae=s.eat(60);if(s.eat(61)||s.eat(33)){if(this.regexp_disjunction(s),!s.eat(41))s.raise("Unterminated group");return s.lastAssertionIsQuantifiable=!Ae,!0}}return s.pos=ve,!1};rt.regexp_eatQuantifier=function(s,ve){if(ve===void 0)ve=!1;if(this.regexp_eatQuantifierPrefix(s,ve))return s.eat(63),!0;return!1};rt.regexp_eatQuantifierPrefix=function(s,ve){return s.eat(42)||s.eat(43)||s.eat(63)||this.regexp_eatBracedQuantifier(s,ve)};rt.regexp_eatBracedQuantifier=function(s,ve){var Ae=s.pos;if(s.eat(123)){var _e=0,Ne=-1;if(this.regexp_eatDecimalDigits(s)){if(_e=s.lastIntValue,s.eat(44)&&this.regexp_eatDecimalDigits(s))Ne=s.lastIntValue;if(s.eat(125)){if(Ne!==-1&&Ne<_e&&!ve)s.raise("numbers out of order in {} quantifier");return!0}}if(s.switchU&&!ve)s.raise("Incomplete quantifier");s.pos=Ae}return!1};rt.regexp_eatAtom=function(s){return this.regexp_eatPatternCharacters(s)||s.eat(46)||this.regexp_eatReverseSolidusAtomEscape(s)||this.regexp_eatCharacterClass(s)||this.regexp_eatUncapturingGroup(s)||this.regexp_eatCapturingGroup(s)};rt.regexp_eatReverseSolidusAtomEscape=function(s){var ve=s.pos;if(s.eat(92)){if(this.regexp_eatAtomEscape(s))return!0;s.pos=ve}return!1};rt.regexp_eatUncapturingGroup=function(s){var ve=s.pos;if(s.eat(40)){if(s.eat(63)){if(this.options.ecmaVersion>=16){var Ae=this.regexp_eatModifiers(s),_e=s.eat(45);if(Ae||_e){for(var Ne=0;Ne<Ae.length;Ne++){var Le=Ae.charAt(Ne);if(Ae.indexOf(Le,Ne+1)>-1)s.raise("Duplicate regular expression modifiers")}if(_e){var Ie=this.regexp_eatModifiers(s);if(!Ae&&!Ie&&s.current()===58)s.raise("Invalid regular expression modifiers");for(var Re=0;Re<Ie.length;Re++){var Me=Ie.charAt(Re);if(Ie.indexOf(Me,Re+1)>-1||Ae.indexOf(Me)>-1)s.raise("Duplicate regular expression modifiers")}}}}if(s.eat(58)){if(this.regexp_disjunction(s),s.eat(41))return!0;s.raise("Unterminated group")}}s.pos=ve}return!1};rt.regexp_eatCapturingGroup=function(s){if(s.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(s);else if(s.current()===63)s.raise("Invalid group");if(this.regexp_disjunction(s),s.eat(41))return s.numCapturingParens+=1,!0;s.raise("Unterminated group")}return!1};rt.regexp_eatModifiers=function(s){var ve="",Ae=0;while((Ae=s.current())!==-1&&wu(Ae))ve+=yn(Ae),s.advance();return ve};function wu(s){return s===105||s===109||s===115}rt.regexp_eatExtendedAtom=function(s){return s.eat(46)||this.regexp_eatReverseSolidusAtomEscape(s)||this.regexp_eatCharacterClass(s)||this.regexp_eatUncapturingGroup(s)||this.regexp_eatCapturingGroup(s)||this.regexp_eatInvalidBracedQuantifier(s)||this.regexp_eatExtendedPatternCharacter(s)};rt.regexp_eatInvalidBracedQuantifier=function(s){if(this.regexp_eatBracedQuantifier(s,!0))s.raise("Nothing to repeat");return!1};rt.regexp_eatSyntaxCharacter=function(s){var ve=s.current();if(la(ve))return s.lastIntValue=ve,s.advance(),!0;return!1};function la(s){return s===36||s>=40&&s<=43||s===46||s===63||s>=91&&s<=94||s>=123&&s<=125}rt.regexp_eatPatternCharacters=function(s){var ve=s.pos,Ae=0;while((Ae=s.current())!==-1&&!la(Ae))s.advance();return s.pos!==ve};rt.regexp_eatExtendedPatternCharacter=function(s){var ve=s.current();if(ve!==-1&&ve!==36&&!(ve>=40&&ve<=43)&&ve!==46&&ve!==63&&ve!==91&&ve!==94&&ve!==124)return s.advance(),!0;return!1};rt.regexp_groupSpecifier=function(s){if(s.eat(63)){if(!this.regexp_eatGroupName(s))s.raise("Invalid group");var ve=this.options.ecmaVersion>=16,Ae=s.groupNames[s.lastStringValue];if(Ae)if(ve)for(var _e=0,Ne=Ae;_e<Ne.length;_e+=1){var Le=Ne[_e];if(!Le.separatedFrom(s.branchID))s.raise("Duplicate capture group name")}else s.raise("Duplicate capture group name");if(ve)(Ae||(s.groupNames[s.lastStringValue]=[])).push(s.branchID);else s.groupNames[s.lastStringValue]=!0}};rt.regexp_eatGroupName=function(s){if(s.lastStringValue="",s.eat(60)){if(this.regexp_eatRegExpIdentifierName(s)&&s.eat(62))return!0;s.raise("Invalid capture group name")}return!1};rt.regexp_eatRegExpIdentifierName=function(s){if(s.lastStringValue="",this.regexp_eatRegExpIdentifierStart(s)){s.lastStringValue+=yn(s.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(s))s.lastStringValue+=yn(s.lastIntValue);return!0}return!1};rt.regexp_eatRegExpIdentifierStart=function(s){var ve=s.pos,Ae=this.options.ecmaVersion>=11,_e=s.current(Ae);if(s.advance(Ae),_e===92&&this.regexp_eatRegExpUnicodeEscapeSequence(s,Ae))_e=s.lastIntValue;if(Pu(_e))return s.lastIntValue=_e,!0;return s.pos=ve,!1};function Pu(s){return jt(s,!0)||s===36||s===95}rt.regexp_eatRegExpIdentifierPart=function(s){var ve=s.pos,Ae=this.options.ecmaVersion>=11,_e=s.current(Ae);if(s.advance(Ae),_e===92&&this.regexp_eatRegExpUnicodeEscapeSequence(s,Ae))_e=s.lastIntValue;if(_u(_e))return s.lastIntValue=_e,!0;return s.pos=ve,!1};function _u(s){return zt(s,!0)||s===36||s===95||s===8204||s===8205}rt.regexp_eatAtomEscape=function(s){if(this.regexp_eatBackReference(s)||this.regexp_eatCharacterClassEscape(s)||this.regexp_eatCharacterEscape(s)||s.switchN&&this.regexp_eatKGroupName(s))return!0;if(s.switchU){if(s.current()===99)s.raise("Invalid unicode escape");s.raise("Invalid escape")}return!1};rt.regexp_eatBackReference=function(s){var ve=s.pos;if(this.regexp_eatDecimalEscape(s)){var Ae=s.lastIntValue;if(s.switchU){if(Ae>s.maxBackReference)s.maxBackReference=Ae;return!0}if(Ae<=s.numCapturingParens)return!0;s.pos=ve}return!1};rt.regexp_eatKGroupName=function(s){if(s.eat(107)){if(this.regexp_eatGroupName(s))return s.backReferenceNames.push(s.lastStringValue),!0;s.raise("Invalid named reference")}return!1};rt.regexp_eatCharacterEscape=function(s){return this.regexp_eatControlEscape(s)||this.regexp_eatCControlLetter(s)||this.regexp_eatZero(s)||this.regexp_eatHexEscapeSequence(s)||this.regexp_eatRegExpUnicodeEscapeSequence(s,!1)||!s.switchU&&this.regexp_eatLegacyOctalEscapeSequence(s)||this.regexp_eatIdentityEscape(s)};rt.regexp_eatCControlLetter=function(s){var ve=s.pos;if(s.eat(99)){if(this.regexp_eatControlLetter(s))return!0;s.pos=ve}return!1};rt.regexp_eatZero=function(s){if(s.current()===48&&!Gr(s.lookahead()))return s.lastIntValue=0,s.advance(),!0;return!1};rt.regexp_eatControlEscape=function(s){var ve=s.current();if(ve===116)return s.lastIntValue=9,s.advance(),!0;if(ve===110)return s.lastIntValue=10,s.advance(),!0;if(ve===118)return s.lastIntValue=11,s.advance(),!0;if(ve===102)return s.lastIntValue=12,s.advance(),!0;if(ve===114)return s.lastIntValue=13,s.advance(),!0;return!1};rt.regexp_eatControlLetter=function(s){var ve=s.current();if(pa(ve))return s.lastIntValue=ve%32,s.advance(),!0;return!1};function pa(s){return s>=65&&s<=90||s>=97&&s<=122}rt.regexp_eatRegExpUnicodeEscapeSequence=function(s,ve){if(ve===void 0)ve=!1;var Ae=s.pos,_e=ve||s.switchU;if(s.eat(117)){if(this.regexp_eatFixedHexDigits(s,4)){var Ne=s.lastIntValue;if(_e&&Ne>=55296&&Ne<=56319){var Le=s.pos;if(s.eat(92)&&s.eat(117)&&this.regexp_eatFixedHexDigits(s,4)){var Ie=s.lastIntValue;if(Ie>=56320&&Ie<=57343)return s.lastIntValue=(Ne-55296)*1024+(Ie-56320)+65536,!0}s.pos=Le,s.lastIntValue=Ne}return!0}if(_e&&s.eat(123)&&this.regexp_eatHexDigits(s)&&s.eat(125)&&Nu(s.lastIntValue))return!0;if(_e)s.raise("Invalid unicode escape");s.pos=Ae}return!1};function Nu(s){return s>=0&&s<=1114111}rt.regexp_eatIdentityEscape=function(s){if(s.switchU){if(this.regexp_eatSyntaxCharacter(s))return!0;if(s.eat(47))return s.lastIntValue=47,!0;return!1}var ve=s.current();if(ve!==99&&(!s.switchN||ve!==107))return s.lastIntValue=ve,s.advance(),!0;return!1};rt.regexp_eatDecimalEscape=function(s){s.lastIntValue=0;var ve=s.current();if(ve>=49&&ve<=57){do s.lastIntValue=10*s.lastIntValue+(ve-48),s.advance();while((ve=s.current())>=48&&ve<=57);return!0}return!1};var ua=0,xn=1,rn=2;rt.regexp_eatCharacterClassEscape=function(s){var ve=s.current();if(Iu(ve))return s.lastIntValue=-1,s.advance(),xn;var Ae=!1;if(s.switchU&&this.options.ecmaVersion>=9&&((Ae=ve===80)||ve===112)){s.lastIntValue=-1,s.advance();var _e;if(s.eat(123)&&(_e=this.regexp_eatUnicodePropertyValueExpression(s))&&s.eat(125)){if(Ae&&_e===rn)s.raise("Invalid property name");return _e}s.raise("Invalid property name")}return ua};function Iu(s){return s===100||s===68||s===115||s===83||s===119||s===87}rt.regexp_eatUnicodePropertyValueExpression=function(s){var ve=s.pos;if(this.regexp_eatUnicodePropertyName(s)&&s.eat(61)){var Ae=s.lastStringValue;if(this.regexp_eatUnicodePropertyValue(s)){var _e=s.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(s,Ae,_e),xn}}if(s.pos=ve,this.regexp_eatLoneUnicodePropertyNameOrValue(s)){var Ne=s.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(s,Ne)}return ua};rt.regexp_validateUnicodePropertyNameAndValue=function(s,ve,Ae){if(!Hn(s.unicodeProperties.nonBinary,ve))s.raise("Invalid property name");if(!s.unicodeProperties.nonBinary[ve].test(Ae))s.raise("Invalid property value")};rt.regexp_validateUnicodePropertyNameOrValue=function(s,ve){if(s.unicodeProperties.binary.test(ve))return xn;if(s.switchV&&s.unicodeProperties.binaryOfStrings.test(ve))return rn;s.raise("Invalid property name")};rt.regexp_eatUnicodePropertyName=function(s){var ve=0;s.lastStringValue="";while(fa(ve=s.current()))s.lastStringValue+=yn(ve),s.advance();return s.lastStringValue!==""};function fa(s){return pa(s)||s===95}rt.regexp_eatUnicodePropertyValue=function(s){var ve=0;s.lastStringValue="";while(Du(ve=s.current()))s.lastStringValue+=yn(ve),s.advance();return s.lastStringValue!==""};function Du(s){return fa(s)||Gr(s)}rt.regexp_eatLoneUnicodePropertyNameOrValue=function(s){return this.regexp_eatUnicodePropertyValue(s)};rt.regexp_eatCharacterClass=function(s){if(s.eat(91)){var ve=s.eat(94),Ae=this.regexp_classContents(s);if(!s.eat(93))s.raise("Unterminated character class");if(ve&&Ae===rn)s.raise("Negated character class may contain strings");return!0}return!1};rt.regexp_classContents=function(s){if(s.current()===93)return xn;if(s.switchV)return this.regexp_classSetExpression(s);return this.regexp_nonEmptyClassRanges(s),xn};rt.regexp_nonEmptyClassRanges=function(s){while(this.regexp_eatClassAtom(s)){var ve=s.lastIntValue;if(s.eat(45)&&this.regexp_eatClassAtom(s)){var Ae=s.lastIntValue;if(s.switchU&&(ve===-1||Ae===-1))s.raise("Invalid character class");if(ve!==-1&&Ae!==-1&&ve>Ae)s.raise("Range out of order in character class")}}};rt.regexp_eatClassAtom=function(s){var ve=s.pos;if(s.eat(92)){if(this.regexp_eatClassEscape(s))return!0;if(s.switchU){var Ae=s.current();if(Ae===99||ma(Ae))s.raise("Invalid class escape");s.raise("Invalid escape")}s.pos=ve}var _e=s.current();if(_e!==93)return s.lastIntValue=_e,s.advance(),!0;return!1};rt.regexp_eatClassEscape=function(s){var ve=s.pos;if(s.eat(98))return s.lastIntValue=8,!0;if(s.switchU&&s.eat(45))return s.lastIntValue=45,!0;if(!s.switchU&&s.eat(99)){if(this.regexp_eatClassControlLetter(s))return!0;s.pos=ve}return this.regexp_eatCharacterClassEscape(s)||this.regexp_eatCharacterEscape(s)};rt.regexp_classSetExpression=function(s){var ve=xn,Ae;if(this.regexp_eatClassSetRange(s));else if(Ae=this.regexp_eatClassSetOperand(s)){if(Ae===rn)ve=rn;var _e=s.pos;while(s.eatChars([38,38])){if(s.current()!==38&&(Ae=this.regexp_eatClassSetOperand(s))){if(Ae!==rn)ve=xn;continue}s.raise("Invalid character in character class")}if(_e!==s.pos)return ve;while(s.eatChars([45,45])){if(this.regexp_eatClassSetOperand(s))continue;s.raise("Invalid character in character class")}if(_e!==s.pos)return ve}else s.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(s))continue;if(Ae=this.regexp_eatClassSetOperand(s),!Ae)return ve;if(Ae===rn)ve=rn}};rt.regexp_eatClassSetRange=function(s){var ve=s.pos;if(this.regexp_eatClassSetCharacter(s)){var Ae=s.lastIntValue;if(s.eat(45)&&this.regexp_eatClassSetCharacter(s)){var _e=s.lastIntValue;if(Ae!==-1&&_e!==-1&&Ae>_e)s.raise("Range out of order in character class");return!0}s.pos=ve}return!1};rt.regexp_eatClassSetOperand=function(s){if(this.regexp_eatClassSetCharacter(s))return xn;return this.regexp_eatClassStringDisjunction(s)||this.regexp_eatNestedClass(s)};rt.regexp_eatNestedClass=function(s){var ve=s.pos;if(s.eat(91)){var Ae=s.eat(94),_e=this.regexp_classContents(s);if(s.eat(93)){if(Ae&&_e===rn)s.raise("Negated character class may contain strings");return _e}s.pos=ve}if(s.eat(92)){var Ne=this.regexp_eatCharacterClassEscape(s);if(Ne)return Ne;s.pos=ve}return null};rt.regexp_eatClassStringDisjunction=function(s){var ve=s.pos;if(s.eatChars([92,113])){if(s.eat(123)){var Ae=this.regexp_classStringDisjunctionContents(s);if(s.eat(125))return Ae}else s.raise("Invalid escape");s.pos=ve}return null};rt.regexp_classStringDisjunctionContents=function(s){var ve=this.regexp_classString(s);while(s.eat(124))if(this.regexp_classString(s)===rn)ve=rn;return ve};rt.regexp_classString=function(s){var ve=0;while(this.regexp_eatClassSetCharacter(s))ve++;return ve===1?xn:rn};rt.regexp_eatClassSetCharacter=function(s){var ve=s.pos;if(s.eat(92)){if(this.regexp_eatCharacterEscape(s)||this.regexp_eatClassSetReservedPunctuator(s))return!0;if(s.eat(98))return s.lastIntValue=8,!0;return s.pos=ve,!1}var Ae=s.current();if(Ae<0||Ae===s.lookahead()&&Lu(Ae))return!1;if(Ru(Ae))return!1;return s.advance(),s.lastIntValue=Ae,!0};function Lu(s){return s===33||s>=35&&s<=38||s>=42&&s<=44||s===46||s>=58&&s<=64||s===94||s===96||s===126}function Ru(s){return s===40||s===41||s===45||s===47||s>=91&&s<=93||s>=123&&s<=125}rt.regexp_eatClassSetReservedPunctuator=function(s){var ve=s.current();if(Ou(ve))return s.lastIntValue=ve,s.advance(),!0;return!1};function Ou(s){return s===33||s===35||s===37||s===38||s===44||s===45||s>=58&&s<=62||s===64||s===96||s===126}rt.regexp_eatClassControlLetter=function(s){var ve=s.current();if(Gr(ve)||ve===95)return s.lastIntValue=ve%32,s.advance(),!0;return!1};rt.regexp_eatHexEscapeSequence=function(s){var ve=s.pos;if(s.eat(120)){if(this.regexp_eatFixedHexDigits(s,2))return!0;if(s.switchU)s.raise("Invalid escape");s.pos=ve}return!1};rt.regexp_eatDecimalDigits=function(s){var ve=s.pos,Ae=0;s.lastIntValue=0;while(Gr(Ae=s.current()))s.lastIntValue=10*s.lastIntValue+(Ae-48),s.advance();return s.pos!==ve};function Gr(s){return s>=48&&s<=57}rt.regexp_eatHexDigits=function(s){var ve=s.pos,Ae=0;s.lastIntValue=0;while(ha(Ae=s.current()))s.lastIntValue=16*s.lastIntValue+da(Ae),s.advance();return s.pos!==ve};function ha(s){return s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102}function da(s){if(s>=65&&s<=70)return 10+(s-65);if(s>=97&&s<=102)return 10+(s-97);return s-48}rt.regexp_eatLegacyOctalEscapeSequence=function(s){if(this.regexp_eatOctalDigit(s)){var ve=s.lastIntValue;if(this.regexp_eatOctalDigit(s)){var Ae=s.lastIntValue;if(ve<=3&&this.regexp_eatOctalDigit(s))s.lastIntValue=ve*64+Ae*8+s.lastIntValue;else s.lastIntValue=ve*8+Ae}else s.lastIntValue=ve;return!0}return!1};rt.regexp_eatOctalDigit=function(s){var ve=s.current();if(ma(ve))return s.lastIntValue=ve-48,s.advance(),!0;return s.lastIntValue=0,!1};function ma(s){return s>=48&&s<=55}rt.regexp_eatFixedHexDigits=function(s,ve){var Ae=s.pos;s.lastIntValue=0;for(var _e=0;_e<ve;++_e){var Ne=s.current();if(!ha(Ne))return s.pos=Ae,!1;s.lastIntValue=16*s.lastIntValue+da(Ne),s.advance()}return!0};var Wr=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 pr(ve,ve.startLoc,ve.endLoc);if(ve.options.ranges)this.range=[ve.start,ve.end]},ht=At.prototype;ht.next=function(s){if(!s&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new Wr(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 Wr(this)};if(typeof Symbol<"u")ht[Symbol.iterator]=function(){var s=this;return{next:function(){var ve=s.getToken();return{done:ve.type===je.eof,value:ve}}}};ht.nextToken=function(){var s=this.curContext();if(!s||!s.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(s.override)return s.override(this);else this.readToken(this.fullCharCodeAtPos())};ht.readToken=function(s){if(jt(s,this.options.ecmaVersion>=6)||s===92)return this.readWord();return this.getTokenFromCode(s)};ht.fullCharCodeAt=function(s){var ve=this.input.charCodeAt(s);if(ve<=55295||ve>=56320)return ve;var Ae=this.input.charCodeAt(s+1);return Ae<=56319||Ae>=57344?ve:(ve<<10)+Ae-56613888};ht.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};ht.skipBlockComment=function(){var s=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=jo(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,s,this.curPosition())};ht.skipLineComment=function(s){var ve=this.pos,Ae=this.options.onComment&&this.curPosition(),_e=this.input.charCodeAt(this.pos+=s);while(this.pos<this.input.length&&!Bn(_e))_e=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(ve+s,this.pos),ve,this.pos,Ae,this.curPosition())};ht.skipSpace=function(){e:while(this.pos<this.input.length){var s=this.input.charCodeAt(this.pos);switch(s){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(s>8&&s<14||s>=5760&&Ys.test(String.fromCharCode(s)))++this.pos;else break e}}};ht.finishToken=function(s,ve){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Ae=this.type;this.type=s,this.value=ve,this.updateContext(Ae)};ht.readToken_dot=function(){var s=this.input.charCodeAt(this.pos+1);if(s>=48&&s<=57)return this.readNumber(!0);var ve=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&s===46&&ve===46)return this.pos+=3,this.finishToken(je.ellipsis);else return++this.pos,this.finishToken(je.dot)};ht.readToken_slash=function(){var s=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(s===61)return this.finishOp(je.assign,2);return this.finishOp(je.slash,1)};ht.readToken_mult_modulo_exp=function(s){var ve=this.input.charCodeAt(this.pos+1),Ae=1,_e=s===42?je.star:je.modulo;if(this.options.ecmaVersion>=7&&s===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(s){var ve=this.input.charCodeAt(this.pos+1);if(ve===s){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(s===124?je.logicalOR:je.logicalAND,2)}if(ve===61)return this.finishOp(je.assign,2);return this.finishOp(s===124?je.bitwiseOR:je.bitwiseAND,1)};ht.readToken_caret=function(){var s=this.input.charCodeAt(this.pos+1);if(s===61)return this.finishOp(je.assign,2);return this.finishOp(je.bitwiseXOR,1)};ht.readToken_plus_min=function(s){var ve=this.input.charCodeAt(this.pos+1);if(ve===s){if(ve===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Vt.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(s){var ve=this.input.charCodeAt(this.pos+1),Ae=1;if(ve===s){if(Ae=s===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&&s===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(s){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(s===61&&ve===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(je.arrow);return this.finishOp(s===61?je.eq:je.prefix,1)};ht.readToken_question=function(){var s=this.options.ecmaVersion;if(s>=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(s>=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 s=this.options.ecmaVersion,ve=35;if(s>=13){if(++this.pos,ve=this.fullCharCodeAtPos(),jt(ve,!0)||ve===92)return this.finishToken(je.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+yn(ve)+"'")};ht.getTokenFromCode=function(s){switch(s){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(s);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(s);case 124:case 38:return this.readToken_pipe_amp(s);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(s);case 60:case 62:return this.readToken_lt_gt(s);case 61:case 33:return this.readToken_eq_excl(s);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 '"+yn(s)+"'")};ht.finishOp=function(s,ve){var Ae=this.input.slice(this.pos,this.pos+ve);return this.pos+=ve,this.finishToken(s,Ae)};ht.readRegexp=function(){var s,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(Vt.test(_e))this.raise(Ae,"Unterminated regular expression");if(!s){if(_e==="[")ve=!0;else if(_e==="]"&&ve)ve=!1;else if(_e==="/"&&!ve)break;s=_e==="\\"}else s=!1;++this.pos}var Ne=this.input.slice(Ae,this.pos);++this.pos;var Le=this.pos,Ie=this.readWord1();if(this.containsEsc)this.unexpected(Le);var Re=this.regexpState||(this.regexpState=new un(this));Re.reset(Ae,Ne,Ie),this.validateRegExpFlags(Re),this.validateRegExpPattern(Re);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(s,ve,Ae){var _e=this.options.ecmaVersion>=12&&ve===void 0,Ne=Ae&&this.input.charCodeAt(this.pos)===48,Le=this.pos,Ie=0,Re=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(Re===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");Re=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>=s)break;Re=Be,Ie=Ie*s+Ve}if(_e&&Re===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===Le||ve!=null&&this.pos-Le!==ve)return null;return Ie};function Mu(s,ve){if(ve)return parseInt(s,8);return parseFloat(s.replace(/_/g,""))}function ga(s){if(typeof BigInt!=="function")return null;return BigInt(s.replace(/_/g,""))}ht.readRadixNumber=function(s){var ve=this.pos;this.pos+=2;var Ae=this.readInt(s);if(Ae==null)this.raise(this.start+2,"Expected number in radix "+s);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Ae=ga(this.input.slice(ve,this.pos)),++this.pos;else if(jt(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(je.num,Ae)};ht.readNumber=function(s){var ve=this.pos;if(!s&&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&&!s&&this.options.ecmaVersion>=11&&_e===110){var Ne=ga(this.input.slice(ve,this.pos));if(++this.pos,jt(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(jt(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var Le=Mu(this.input.slice(ve,this.pos),Ae);return this.finishToken(je.num,Le)};ht.readCodePoint=function(){var s=this.input.charCodeAt(this.pos),ve;if(s===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(s){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===s)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(Bn(_e))this.raise(this.start,"Unterminated string constant");++this.pos}}return ve+=this.input.slice(Ae,this.pos++),this.finishToken(je.string,ve)};var ya={};ht.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(s){if(s===ya)this.readInvalidTemplateToken();else throw s}this.inTemplateElement=!1};ht.invalidStringToken=function(s,ve){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ya;else this.raise(s,ve)};ht.readTmplToken=function(){var s="",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 s+=this.input.slice(ve,this.pos),this.finishToken(je.template,s)}if(Ae===92)s+=this.input.slice(ve,this.pos),s+=this.readEscapedChar(!0),ve=this.pos;else if(Bn(Ae)){switch(s+=this.input.slice(ve,this.pos),++this.pos,Ae){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:s+=`
|
|
6
|
-
`;break;default:s+=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(s){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 yn(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(s){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||s))this.invalidStringToken(this.pos-1-_e.length,s?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(Ne)}if(Bn(ve)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(ve)}};ht.readHexChar=function(s){var ve=this.pos,Ae=this.readInt(16,s);if(Ae===null)this.invalidStringToken(ve,"Bad character escape sequence");return Ae};ht.readWord1=function(){this.containsEsc=!1;var s="",ve=!0,Ae=this.pos,_e=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var Ne=this.fullCharCodeAtPos();if(zt(Ne,_e))this.pos+=Ne<=65535?1:2;else if(Ne===92){this.containsEsc=!0,s+=this.input.slice(Ae,this.pos);var Le=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?jt:zt)(Ie,_e))this.invalidStringToken(Le,"Invalid Unicode escape");s+=yn(Ie),Ae=this.pos}else break;ve=!1}return s+this.input.slice(Ae,this.pos)};ht.readWord=function(){var s=this.readWord1(),ve=je.name;if(this.keywords.test(s))ve=jr[s];return this.finishToken(ve,s)};var xa="8.18.0";At.acorn={Parser:At,version:xa,defaultOptions:Or,Position:Wn,SourceLocation:pr,getLineInfo:Qs,Node:fr,TokenType:yt,tokTypes:je,keywordTypes:jr,TokContext:nn,tokContexts:Tt,isIdentifierChar:zt,isIdentifierStart:jt,Token:Wr,isNewLine:Bn,lineBreak:Vt,lineBreakG:Fo,nonASCIIwhitespace:Ys};function si(s,ve){return At.parse(s,ve)}function Bu(s,ve,Ae){return At.parseExpressionAt(s,ve,Ae)}function $u(s,ve){return At.tokenizer(s,ve)}var Qt=!0,Fu=new WeakMap;function ju(s){let ve=s.Parser.acorn||s,Ae=Fu.get(ve);if(!Ae){let Re=function(tt){return tt===We.name||tt===We.string||tt===We.num||Je.includes(tt)||nt.includes(tt)},Me=function(tt){return tt===We.name||Je.includes(tt)||nt.includes(tt)},$e=function(tt){return tt===We.name||nt.includes(tt)},Be=function(tt){return tt===ze.abstract||tt===ze.declare||tt===ze.enum||tt===ze.module||tt===ze.namespace||tt===ze.interface||tt===ze.type},Ve=function(tt){return tt===ze.keyof||tt===ze.readonly||tt===ze.unique},Ue=function(tt){return tt===We.invalidTemplate},{tokTypes:We,keywordTypes:Ke}=ve,Je=Object.values(Ke),ze=Ie(),nt=Object.values(ze),ot=Le(),et=Ne(),lt=new RegExp(`^(?:${Object.keys(ze).join("|")})$`);ot.jsxTagStart.updateContext=function(){this.context.push(et.tc_expr),this.context.push(et.tc_oTag),this.exprAllowed=!1},ot.jsxTagEnd.updateContext=function(tt){let xt=this.context.pop();if(xt===et.tc_oTag&&tt===We.slash||xt===et.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===et.tc_expr;else this.exprAllowed=!0},Ae={tokTypes:{...ze,...ot},tokContexts:{...et},keywordsRegExp:lt,tokenIsLiteralPropertyName:Re,tokenIsKeywordOrIdentifier:Me,tokenIsIdentifier:$e,tokenIsTSDeclarationStart:Be,tokenIsTSTypeOperator:Ve,tokenIsTemplate:Ue}}return Ae;function _e(Re,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 Le(){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:Qt}),asserts:_e("asserts",{startsExpr:Qt}),global:_e("global",{startsExpr:Qt}),keyof:_e("keyof",{startsExpr:Qt}),readonly:_e("readonly",{startsExpr:Qt}),unique:_e("unique",{startsExpr:Qt}),abstract:_e("abstract",{startsExpr:Qt}),declare:_e("declare",{startsExpr:Qt}),enum:_e("enum",{startsExpr:Qt}),module:_e("module",{startsExpr:Qt}),namespace:_e("namespace",{startsExpr:Qt}),interface:_e("interface",{startsExpr:Qt}),type:_e("type",{startsExpr:Qt})}}}var Vu=1048576,dr=2097152,Xn=1,zr=2,qu=4,li=8,Uu=16,ka=64,wa=128,Gu=256,Wu=512,Pa=1024,$x=Xn|zr|li|wa,Fx=Xn|0|li|0,jx=Xn|0|qu|0,Vx=Xn|0|Uu|0,qx=0|zr|0|wa,Ux=0|zr|0|0,Hu=Xn|zr|li|Gu,Gx=0|Pa,Wx=0|ka,Hx=Xn|0|0|ka,Kx=Hu|Wu,zx=0|Pa,_a=4,Na=2,Ia=1,Xx=Na|Ia,Jx=Na|_a,Yx=Ia|_a,Ku=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,ba=new RegExp("(?=("+Ku.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),mr=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function zu(s,ve){let Ae="true";if(ve.type==="MethodDefinition"&&(ve.kind==="get"||ve.kind==="set"))Ae=(ve.static?"s":"i")+ve.kind;if(s==="iget"&&Ae==="iset"||s==="iset"&&Ae==="iget"||s==="sget"&&Ae==="sset"||s==="sset"&&Ae==="sget")return[!1,"true"];if(!s)return[!1,Ae];return[!0,s]}function Ea(s,ve){let{computed:Ae,key:_e}=s;return!Ae&&(_e.type==="Identifier"&&_e.name===ve||_e.type==="Literal"&&_e.value===ve)}var st={AbstractMethodHasImplementation:({methodName:s})=>`Method '${s}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:s})=>`Property '${s}' 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:s})=>`Cannot find name '${s}'.`,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:s})=>`'declare' is not allowed in ${s}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:s})=>`Duplicate modifier: '${s}'.`,EmptyHeritageClauseType:({token:s})=>`'${s}' 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:s})=>`'${s[0]}' modifier cannot be used with '${s[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:s})=>`Index signatures cannot have an accessibility modifier ('${s}').`,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:s})=>`'${s}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:s})=>`'${s}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:s})=>`'${s}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:s})=>`'${s[0]}' modifier must precede '${s[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:s})=>`Private elements cannot have an accessibility modifier ('${s}').`,PrivateMethodsHasAccessibility:({modifier:s})=>`Private methods cannot have an accessibility modifier ('${s}').`,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:s})=>`Single type parameter ${s} should have a trailing comma. Example usage: <${s},>.`,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:s})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${s}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},Kr={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 Xu(s,ve,Ae){let{tokTypes:_e}=Ae,{tokTypes:Ne}=ve;return class extends s{takeDecorators(Ie){let Re=this.decoratorStack[this.decoratorStack.length-1];if(Re.length)Ie.decorators=Re,this.resetStartLocationFromNode(Ie,Re[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(Ie){let Re=this.decoratorStack[this.decoratorStack.length-1];while(this.match(Ne.at)){let Me=this.parseDecorator();Re.push(Me)}if(this.match(_e._export)){if(!Ie)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,Kr.UnexpectedLeadingDecorator)}parseDecorator(){let Ie=this.startNode();this.next(),this.decoratorStack.push([]);let Re=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(Re,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 Re=this.startNodeAtNode(Ie);return Re.callee=Ie,Re.arguments=this.parseExprList(_e.parenR,!1),this.finishNode(Re,"CallExpression")}return Ie}}}var Ca={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:"♦"},Ju=/^[\da-fA-F]+$/,Yu=/^\d+$/;function gr(s){if(!s)return s;if(s.type==="JSXIdentifier")return s.name;if(s.type==="JSXNamespacedName")return s.namespace.name+":"+s.name.name;if(s.type==="JSXMemberExpression")return gr(s.object)+"."+gr(s.property)}function Qu(s,ve,Ae,_e){let Ne=s.tokTypes,Le=ve.tokTypes,{isNewLine:Ie,isIdentifierChar:Re}=s,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(Le.jsxTagStart);return this.getTokenFromCode(Ue)}return Be+=this.input.slice(Ve,this.pos),this.finishToken(Le.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?">":"}")+'` 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 We=this.input.charCodeAt(this.pos);if(We===Be)break;if(We===38)Ve+=this.input.slice(Ue,this.pos),Ve+=this.jsx_readEntity(),Ue=this.pos;else if(Ie(We))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,We=this.input[this.pos];if(We!=="&")this.raise(this.pos,"Entity must start with an ampersand");let Ke=++this.pos;while(this.pos<this.input.length&&Ve++<10){if(We=this.input[this.pos++],We===";"){if(Be[0]==="#"){let Je;if(Be[1]==="x"||Be[1]==="X"){if(Be=Be.substr(2),Ju.test(Be))Je=parseInt(Be,16)}else if(Be=Be.substr(1),Yu.test(Be))Je=parseInt(Be,10);if(Je!==void 0&&Je<=1114111)Ue=String.fromCodePoint(Je)}else if(Object.prototype.hasOwnProperty.call(Ca,Be))Ue=Ca[Be];break}Be+=We}if(Ue===void 0)return this.pos=Ke,"&";return Ue}jsx_readWord(){let Be,Ve=this.pos;do Be=this.input.charCodeAt(++this.pos);while(Re(Be)||Be===45);return this.finishToken(Le.jsxName,this.input.slice(Ve,this.pos))}jsx_parseIdentifier(){let Be=this.startNode();if(this.type===Le.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 We=this.startNodeAt(Be,Ve);return We.namespace=Ue,We.name=this.jsx_parseIdentifier(),this.finishNode(We,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===Le.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 We=this.startNodeAt(Be,Ve);We.object=Ue,We.property=this.jsx_parseIdentifier(),Ue=this.finishNode(We,"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 Le.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 We=this.jsx_parseElementName();if(We)Ue.name=We;while(this.type!==Ne.slash&&this.type!==Le.jsxTagEnd)Ue.attributes.push(this.jsx_parseAttribute());return Ue.selfClosing=this.eat(Ne.slash),this.expect(Le.jsxTagEnd),this.finishNode(Ue,We?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(Be,Ve){let Ue=this.startNodeAt(Be,Ve),We=this.jsx_parseElementName();if(We)Ue.name=We;return this.expect(Le.jsxTagEnd),this.finishNode(Ue,We?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(Be,Ve){let Ue=this.startNodeAt(Be,Ve),We=[],Ke=this.jsx_parseOpeningElementAt(Be,Ve),Je=null;if(!Ke.selfClosing){e:for(;;)switch(this.type){case Le.jsxTagStart:if(Be=this.start,Ve=this.startLoc,this.next(),this.eat(Ne.slash)){Je=this.jsx_parseClosingElementAt(Be,Ve);break e}We.push(this.jsx_parseElementAt(Be,Ve));break;case Le.jsxText:We.push(this.parseExprAtom());break;case Ne.braceL:We.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(gr(Je.name)!==gr(Ke.name))this.raise(Je.start,"Expected corresponding JSX closing tag for <"+gr(Ke.name)+">")}let ze=Ke.name?"Element":"Fragment";if(Ue["opening"+ze]=Ke,Ue["closing"+ze]=Je,Ue.children=We,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"+ze)}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 Zu(s,ve,Ae){let{tokTypes:_e}=ve,{tokTypes:Ne}=Ae;return class extends s{parseMaybeImportAttributes(Ie){if(this.type===Ne._with||this.type===_e.assert){this.next();let Re=this.parseImportAttributes();if(Re)Ie.attributes=Re}}parseImportAttributes(){this.expect(Ne.braceL);let Ie=this.parseWithEntries();return this.expect(Ne.braceR),Ie}parseWithEntries(){let Ie=[],Re=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,Re.has(Me.key.name))this.raise(this.pos,"Duplicated key in attributes");if(Re.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 oi=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function Da(){return{_tag:"BufferedParserEvents",segments:[]}}var ef=Da();function va(s){return s.segments.length>0}var tf=class{constructor(s,ve){this.options=s,this.state=ve,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let s={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(s),s.depth===0&&this.hasCallbacks)this.activateCallbacks();return s}commit(s){this.close(s);let ve=this.currentFrame();if(ve){if(s.output)this.appendOutput(this.outputFor(ve),s.output);return}if(this.undoLog.length=s.undoMark,s.output)this.flush(s.output)}rollback(s){this.close(s),this.unwind(s.undoMark),this.restore(s)}rollbackWithEvents(s){return this.close(s),this.unwind(s.undoMark),this.restore(s),s.output??ef}replay(s){if(!va(s))return;let ve=this.currentFrame();if(ve){this.appendOutput(this.outputFor(ve),s);return}this.flush(s)}set(s,ve,Ae){this.willSet(s,ve),s[ve]=Ae}remove(s,ve){this.willSet(s,ve),delete s[ve]}append(s,ve){this.willAppend(s),s.push(ve)}pop(s){return this.willMutateTail(s,1),s.pop()}truncate(s,ve){if(ve<s.length)this.willMutateTail(s,s.length-ve);else this.willAppend(s);s.length=ve}modify(s,ve,Ae){let[_e,Ne]=Ae(s[ve]);return this.set(s,ve,Ne),_e}willAppend(s){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:s,length:s.length})}willMutateTail(s,ve){if(!this.active)return;let Ae=Math.max(0,s.length-ve);this.undoLog.push({_tag:"ArrayTail",target:s,start:Ae,values:s.slice(Ae)})}willSet(s,ve){if(!this.active)return;let Ae=s;this.undoLog.push({_tag:"Property",target:Ae,key:ve,had:Object.prototype.hasOwnProperty.call(Ae,ve),value:Ae[ve]})}captureCallbacks(){let s=!1;for(let ve of oi){let Ae=this.options[ve];if(!Ae)continue;s=!0,this.callbacks[ve]=Ae,this.callbackWrappers[ve]=(..._e)=>{this.emit({name:ve,args:_e})}}return s}activateCallbacks(){for(let s of oi){let ve=this.callbackWrappers[s];if(ve)this.options[s]=ve}}deactivateCallbacks(){for(let s of oi){let ve=this.callbacks[s];if(ve)this.options[s]=ve}}emit(s){let ve=this.currentFrame();if(!ve){this.invoke(s);return}let Ae=this.outputFor(ve).segments,_e=Ae[Ae.length-1];if(Array.isArray(_e))_e.push(s);else Ae.push([s])}appendOutput(s,ve){if(va(ve))s.segments.push(ve)}outputFor(s){return s.output??=Da()}flush(s){let ve=[];for(let Ae=s.segments.length-1;Ae>=0;Ae--)ve.push(s.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(s){this.callbacks[s.name]?.apply(this.options,s.args)}currentFrame(){return this.frames[this.frames.length-1]}close(s){if(this.currentFrame()!==s||s.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(s){if(this.state)this.state.restore(s.checkpoint)}unwind(s){for(let ve=this.undoLog.length-1;ve>=s;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=s}};function zn(s,ve,Ae){if(s.length===ve)return s;if(s.length<ve)throw Error(`A parse branch shortened the ${Ae} below its checkpoint`);return s.length=ve,s}function nf(s){return{lookahead:s.getCurLookaheadState(),context:s.context,contextLength:s.context.length,scopeStack:s.scopeStack,scopeStackLength:s.scopeStack.length,importsStack:s.importsStack,importsStackLength:s.importsStack.length,labels:s.labels,labelsLength:s.labels.length,privateNameStack:s.privateNameStack,privateNameStackLength:s.privateNameStack.length,decoratorStack:s.decoratorStack,decoratorStackLength:s.decoratorStack.length,strict:s.strict,potentialArrowAt:s.potentialArrowAt,potentialArrowInForAwait:s.potentialArrowInForAwait,yieldPos:s.yieldPos,awaitPos:s.awaitPos,awaitIdentPos:s.awaitIdentPos,preValue:s.preValue,preToken:s.preToken,isLookahead:s.isLookahead,isAmbientContext:s.isAmbientContext,inAbstractClass:s.inAbstractClass,inType:s.inType,inDisallowConditionalTypesContext:s.inDisallowConditionalTypesContext,maybeInArrowParameters:s.maybeInArrowParameters,shouldParseArrowReturnType:s.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:s.shouldParseAsyncArrowReturnType,importOrExportOuterKind:s.importOrExportOuterKind}}function rf(s,ve){s.setLookaheadTokenState(ve.lookahead),s.context=zn(ve.context,ve.contextLength,"token context stack"),s.scopeStack=zn(ve.scopeStack,ve.scopeStackLength,"scope stack"),s.importsStack=zn(ve.importsStack,ve.importsStackLength,"import stack"),s.labels=zn(ve.labels,ve.labelsLength,"label stack"),s.privateNameStack=zn(ve.privateNameStack,ve.privateNameStackLength,"private-name stack"),s.decoratorStack=zn(ve.decoratorStack,ve.decoratorStackLength,"decorator stack"),s.strict=ve.strict,s.potentialArrowAt=ve.potentialArrowAt,s.potentialArrowInForAwait=ve.potentialArrowInForAwait,s.yieldPos=ve.yieldPos,s.awaitPos=ve.awaitPos,s.awaitIdentPos=ve.awaitIdentPos,s.regexpState=null,s.preValue=ve.preValue,s.preToken=ve.preToken,s.isLookahead=ve.isLookahead,s.isAmbientContext=ve.isAmbientContext,s.inAbstractClass=ve.inAbstractClass,s.inType=ve.inType,s.inDisallowConditionalTypesContext=ve.inDisallowConditionalTypesContext,s.maybeInArrowParameters=ve.maybeInArrowParameters,s.shouldParseArrowReturnType=ve.shouldParseArrowReturnType,s.shouldParseAsyncArrowReturnType=ve.shouldParseAsyncArrowReturnType,s.importOrExportOuterKind=ve.importOrExportOuterKind}function sf(s){return{capture:()=>nf(s),restore:(ve)=>rf(s,ve)}}function of(s,ve){let{acornTokenTypes:Ae,typeScriptTokenTypes:_e,scope:Ne}=ve,Le=Ne.SCOPE_TOP|Ne.SCOPE_FUNCTION|Ne.SCOPE_CLASS_STATIC_BLOCK;return class extends s{constructor(Re,Me,$e){super(Re,Me,$e);this.parseEffects=new tf(this.options,sf(this))}overrideContext(Re){if(this.curContext()!==Re)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(Re)}takeDecorators(Re){let Me=this.decoratorStack.length-1;if(this.decoratorStack[Me].length>0)this.parseEffects?.willSet(this.decoratorStack,String(Me));return super.takeDecorators(Re)}parseDecorators(Re){let Me=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(Me),super.parseDecorators(Re)}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(Re,Me,$e,Be){for(let Ve=this.labels.length-1;Ve>=0;Ve--){let Ue=this.labels[Ve];if(Ue.statementStart!==Re.start)break;this.parseEffects?.willSet(Ue,"statementStart"),this.parseEffects?.willSet(Ue,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(Re,Me,$e,Be)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let Re=this.privateNameStack[this.privateNameStack.length-2];if(Re)this.parseEffects?.willAppend(Re.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let Re=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(Re.used)}return super.parsePrivateIdent()}parseClassField(Re){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(Re)}updateContext(Re){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&&Re===_e.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(Re)}enterScope(Re){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(Re)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(Re,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,Re)}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,Re);if(Ue.flags&Le)break}return super.declareName(Re,Me,$e)}checkLocalExport(Re){return this.parseEffects?.willSet(this.undefinedExports,Re.name),super.checkLocalExport(Re)}}}var ai=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function Sa(s){if(!s)throw Error("Assert fail")}function af(s){return s==="accessor"}function cf(s){return s==="in"||s==="out"}var Hr=1,Ta=2,lf=4,dt={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 ci(s,ve){return dt.SCOPE_FUNCTION|(s?dt.SCOPE_ASYNC:0)|(ve?dt.SCOPE_GENERATOR:0)}function pf(s){if(s.type!=="MemberExpression")return!1;let{computed:ve,property:Ae}=s;if(ve&&(Ae.type!=="TemplateLiteral"||Ae.expressions.length>0))return!1;return La(s.object)}function uf(s){return s.type==="UnaryExpression"&&(s.operator==="-"||s.operator==="+")&&s.argument.type==="Literal"&&(typeof s.argument.value==="number"||typeof s.argument.value==="bigint")}function La(s){if(s.type==="Identifier")return!0;if(s.type!=="MemberExpression")return!1;if(s.computed)return!1;return La(s.object)}function Aa(s){return s==="private"||s==="public"||s==="protected"}function ff(s){return Boolean(s.startsExpr)}function hf(s){if(s==null)throw Error(`Unexpected ${s} value.`);return s}function df(s){switch(s){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 Ra(s){let{dts:ve=!1}=s||{},Ae=!!s?.jsx;return function(_e){let Ne=_e.acorn||ii,Le=ju(Ne),{tokTypes:Ie,keywordTypes:Re,isIdentifierStart:Me,lineBreak:$e,isNewLine:Be,tokContexts:Ve,isIdentifierChar:Ue}=Ne,{tokTypes:We,tokContexts:Ke,keywordsRegExp:Je,tokenIsLiteralPropertyName:ze,tokenIsTemplate:nt,tokenIsTSDeclarationStart:ot,tokenIsIdentifier:et,tokenIsKeywordOrIdentifier:lt,tokenIsTSTypeOperator:tt}=Le;function xt(De,Oe,Fe=De.length){for(let qe=Oe;qe<Fe;qe++){let Ge=De.charCodeAt(qe);if(Be(Ge))return qe<Fe-1&&Ge===13&&De.charCodeAt(qe+1)===10?qe+2:qe+1}return-1}if(_e=Xu(_e,Le,Ne),s?.jsx)_e=Qu(Ne,Le,_e,typeof s.jsx==="boolean"?{}:s.jsx);_e=Zu(_e,Le,Ne);let kt=of(_e,{acornTokenTypes:Ie,typeScriptTokenTypes:We,scope:dt});class vt extends kt{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:st.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return Le}get acornTypeScript(){return Le}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===Ke.tc_expr)return this.jsx_readToken();if(Oe===Ke.tc_oTag||Oe===Ke.tc_cTag){if(Me(De))return this.jsx_readWord();if(De==62)return++this.pos,this.finishToken(We.jsxTagEnd);if((De===34||De===39)&&Oe==Ke.tc_oTag)return this.jsx_readString(De)}if(De===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,s?.jsx)return this.finishToken(We.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(We.at);return super.getTokenFromCode(De)}isAbstractClass(){return this.ts_isContextual(We.abstract)&&this.lookahead().type===Ie._class}isDeclareClass(){if(!this.ts_isContextual(We.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(Ge){let He=Ge===Oe;if(!He&&!(Ge instanceof SyntaxError))throw this.parseEffects.rollback(Fe),Ge;let Xe={events:this.parseEffects.rollbackWithEvents(Fe),selected:!1};return He?{node:null,error:null,thrown:!1,aborted:!0,failState:Xe}:{node:null,error:Ge,thrown:!0,aborted:!1,failState:Xe}}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(Aa(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,st.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 et(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 Ge=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,!Ge)return;return this.parseArrowExpression(Ge,Ge.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(We.abstract)&&this.lookahead().type===Ie._new}nextTokenStartSince(De){return ai.lastIndex=De,ai.test(this.input)?ai.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,Ge=this.preToken,He=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,De!==void 0)for(let Xe=0;Xe<De;Xe++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(Oe),this.context=Fe,this.preValue=qe,this.preToken=Ge,this.isLookahead=He}}readWord(){let De=this.readWord1(),Oe=Ie.name;if(this.keywords.test(De))Oe=Re[De];else if(new RegExp(Je).test(De))Oe=We[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,Ge=Oe;(qe=xt(this.input,Ge,this.pos))>-1;)++this.curLine,Ge=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 ba.lastIndex=this.end,ba.test(this.input)}addExtra(De,Oe,Fe,qe=!0){if(!De)return;let Ge=De.extra=De.extra||{};if(qe)Ge[Oe]=Fe;else Object.defineProperty(Ge,Oe,{enumerable:qe,value:Fe})}isLiteralPropertyName(){return ze(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(We.readonly);if(this.ts_isContextual(We.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===Le.tokTypes[De]}ts_eatWithState(De,Oe,Fe){let qe=Fe.type;if(De===qe){for(let Ge=0;Ge<Oe;Ge++)this.next();return!0}else return!1}ts_eatContextualWithState(De,Oe,Fe){if(Je.test(De)){if(this.ts_isContextualWithState(Fe,We[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(We[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?dt.BIND_TS_CONST_ENUM:dt.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(Vu),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(We.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(dr),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===We.enum)return this.tsParseEnumDeclaration(De,{declare:!0});if(Oe===We.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===We.interface){let qe=this.tsParseInterfaceDeclaration(De,{declare:!0});if(qe)return qe}if(et(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 Ge=[],He=-1;for(;;){if(this.tsIsListTerminator(De))break;He=-1;let Xe=Oe();if(Xe==null)return;if(Ge.push(Xe),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 Ge}tsParseDelimitedList(De,Oe,Fe){return hf(this.tsParseDelimitedListWorker(De,Oe,!0,Fe))}tsParseBracketedList(De,Oe,Fe,qe,Ge){if(!qe)if(Fe)this.expect(Ie.bracketL);else this.expect(Ie.relational);let He=this.tsParseDelimitedList(De,Oe,Ge);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(et(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,st.UnsupportedSignatureParameterKind({type:De.type}));return De})}tsParseTypePredicateAsserts(){if(this.type!==We.asserts)return!1;let De=this.containsEsc;if(this.next(),!et(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 Ge=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(Ge&&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=Ge&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!He){if(!Ge)return this.tsParseTypeAnnotation(!1,Oe);return Fe.parameterName=this.parseIdent(),Fe.asserts=Ge,Fe.typeAnnotation=null,Oe.typeAnnotation=this.finishNode(Fe,"TSTypePredicate"),this.finishNode(Oe,"TSTypeAnnotation")}let Xe=this.tsParseTypeAnnotation(!1);return Fe.parameterName=He,Fe.typeAnnotation=Xe,Fe.asserts=Ge,Oe.typeAnnotation=this.finishNode(Fe,"TSTypePredicate"),this.finishNode(Oe,"TSTypeAnnotation")})}tsFillSignature(De,Oe){let Fe=De===Ie.arrow,qe="parameters",Ge="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,st.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(),Ge=this.eat(Fe),He=[];do He.push(Oe());while(this.eat(Fe));if(He.length===1&&!Ge)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,st.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,st.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(!lt(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 Ge=this.startNode();Ge.label=this.parseIdent(!0),Ge.optional=this.eat(Ie.question),this.expect(Ie.colon),Ge.elementType=this.tsParseType(),qe=this.finishNode(Ge,"TSNamedTupleMember")}else{qe=this.tsParseType();let Ge=this.eat(Ie.question);if(this.eat(Ie.colon))this.raise(qe.start,st.InvalidTupleMemberLabel);if(Ge){let He=this.startNodeAtNode(qe);He.typeAnnotation=qe,qe=this.finishNode(He,"TSOptionalType")}}if(Fe){let Ge=this.startNodeAt(Oe,De);Ge.typeAnnotation=qe,qe=this.finishNode(Ge,"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,st.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(lt(De)||De===Ie._void||De===Ie._null){let Oe=De===Ie._void?"TSVoidKeyword":De===Ie._null?"TSNullKeyword":df(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(){Sa(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(),et(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:st.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,st.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:Ge=st.InvalidModifierOnTypeMember}){let He={},Xe=(Qe,Ye,ct,ft)=>{if(Ye===ct&&De[ft])this.raise(Qe.column,st.InvalidModifiersOrder({orderedModifiers:[ct,ft]}))},Ze=(Qe,Ye,ct,ft)=>{if(De[ct]&&Ye===ft||De[ft]&&Ye===ct)this.raise(Qe.column,st.IncompatibleModifiers({modifiers:[ct,ft]}))};for(;;){let Qe=this.startLoc,Ye=this.tsParseModifier(Oe.concat(Fe??[]),qe);if(!Ye)break;if(Aa(Ye))if(De.accessibility)this.raise(this.start,st.DuplicateAccessibilityModifier());else Xe(Qe,Ye,Ye,"override"),Xe(Qe,Ye,Ye,"static"),Xe(Qe,Ye,Ye,"readonly"),Xe(Qe,Ye,Ye,"accessor"),He.accessibility=Ye,De.accessibility=Ye;else if(cf(Ye))if(De[Ye])this.raise(this.start,st.DuplicateModifier({modifier:Ye}));else Xe(Qe,Ye,"in","out"),He[Ye]=Ye,De[Ye]=!0;else if(af(Ye))if(De[Ye])this.raise(this.start,st.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,st.DuplicateModifier({modifier:Ye}));else He[Ye]=Ye,De[Ye]=!0;else if(Object.hasOwnProperty.call(De,Ye))this.raise(this.start,st.DuplicateModifier({modifier:Ye}));else Xe(Qe,Ye,"static","readonly"),Xe(Qe,Ye,"static","override"),Xe(Qe,Ye,"override","readonly"),Xe(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,Ge)}return He}tsParseInOutModifiers(De){this.tsParseModifiers({modified:De,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:st.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers(De){this.tsParseModifiers({modified:De,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:st.InvalidModifierOnTypeParameter})}parseMaybeUnary(De,Oe,Fe,qe){if(!s?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary(De,Oe,Fe,qe)}tsParseTypeAssertion(){if(Ae)this.raise(this.start,st.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,st.EmptyTypeArguments);if(De&&this.curContext()!==Ke.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,st.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,st.ReadonlyForMethodSignature);let qe=Fe;if(qe.kind&&this.tsMatchLeftRelational())this.raise(this.start,st.AccesorCannotHaveTypeParameters);this.tsFillSignature(Ie.colon,qe),this.tsParseTypeMemberSemicolon();let Ge="parameters",He="typeAnnotation";if(qe.kind==="get"){if(qe[Ge].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(qe[Ge][0]))this.raise(this.start,st.AccesorCannotDeclareThisParameter)}}else if(qe.kind==="set"){if(qe[Ge].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let Xe=qe[Ge][0];if(this.isThisParam(Xe))this.raise(this.start,st.AccesorCannotDeclareThisParameter);if(Xe.type==="Identifier"&&Xe.optional)this.raise(this.start,st.SetAccesorCannotHaveOptionalParameter);if(Xe.type==="RestElement")this.raise(this.start,st.SetAccesorCannotHaveRestParameter)}if(qe[He])this.raise(qe[He].start,st.SetAccesorCannotHaveReturnType)}else qe.kind="method";return this.finishNode(qe,"TSMethodSignature")}else{let qe=Fe;if(Oe)qe.readonly=!0;let Ge=this.tsTryParseTypeAnnotation();if(Ge)qe.typeAnnotation=Ge;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(et(this.type)){De.id=this.parseIdent(),this.checkLValSimple(De.id,dt.BIND_TS_INTERFACE);let qe=this.currentScope();this.maybeExportDefined(qe,De.id.name)}else De.id=null,this.raise(this.start,st.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(We.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(dr);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(et(De)){if(Oe&&!this.containsEsc||Fe)return!1;if((De===We.type||De===We.interface)&&!this.containsEsc){let He=this.lookahead();if(et(He.type)&&!this.isContextualWithState("from",He)||He.type===Ie.braceL)return!1}}else if(!this.match(Ie._default))return!1;let qe=this.nextTokenStart(),Ge=this.isUnparsedContextual(qe,"from");if(this.input.charCodeAt(qe)===44||et(this.type)&&Ge)return!0;if(this.match(Ie._default)&&Ge){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,dt.BIND_TS_NAMESPACE);if(this.eat(Ie.dot)){let Fe=this.startNode();this.tsParseModuleOrNamespaceDeclaration(Fe,!0),De.body=Fe}else this.enterScope(dr),De.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(De,"TSModuleDeclaration")}checkLValSimple(De,Oe=dt.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,dt.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(We.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)||et(this.type)))return this.tsParseAbstractDeclaration(De);break;case"module":if(this.tsCheckLineTerminator(Fe)){if(this.match(Ie.string))return this.tsParseAmbientExternalModuleDeclaration(De);else if(et(this.type))return this.tsParseModuleOrNamespaceDeclaration(De)}break;case"namespace":if(this.tsCheckLineTerminator(Fe)&&et(this.type))return this.tsParseModuleOrNamespaceDeclaration(De);break;case"type":if(this.tsCheckLineTerminator(Fe)&&et(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,dt.BIND_LEXICAL),super.expect(Ie.eq);let Fe=this.tsParseModuleReference();if(De.importKind==="type"&&Fe.type!=="TSExternalModuleReference")this.raise(Fe.start,st.ImportAliasHasImportType);return De.moduleReference=Fe,super.semicolon(),this.finishNode(De,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:De}=this;if(et(De)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((De===We.type||De===We.interface)&&!this.containsEsc){let qe=this.lookahead();if(et(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||et(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,Ge){if(this.initFunction(De),this.ecmaVersion>=9||this.ecmaVersion>=6&&!qe){if(this.type===Ie.star&&Oe&Ta)this.unexpected();De.generator=this.eat(Ie.star)}if(this.ecmaVersion>=8)De.async=!!qe;if(Oe&Hr)De.id=Oe&lf&&this.type!==Ie.name?null:this.parseIdent();let He=this.yieldPos,Xe=this.awaitPos,Ze=this.awaitIdentPos,Qe=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ci(De.async,De.generator)),!(Oe&Hr))De.id=this.type===Ie.name?this.parseIdent():null;this.parseFunctionParams(De);let Ye=Oe&Hr;if(this.parseFunctionBody(De,Fe,!1,Ge,{isFunctionDeclaration:Ye}),Ye&&this.isAmbientContext&&De.id){if(this.currentScope().flags&dt.SCOPE_TOP)this.declareName(De.id.name,dt.BIND_FLAGS_TS_EXPORT_ONLY,De.id.start)}if(this.yieldPos=He,this.awaitPos=Xe,this.awaitIdentPos=Ze,Oe&Hr&&De.id&&!(Oe&Ta))if(De.body)this.checkLValSimple(De.id,this.strict||De.generator||De.async?this.treatFunctionsAsVar?dt.BIND_VAR:dt.BIND_LEXICAL:dt.BIND_FUNCTION);else this.checkLValSimple(De.id,dt.BIND_NONE);return this.maybeInArrowParameters=Qe,this.finishNode(De,Ye?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(De,Oe=!1,Fe=!1,qe=!1,Ge){if(this.match(Ie.colon))De.returnType=this.tsParseTypeOrTypePredicateAnnotation(Ie.colon);let He=Ge?.isFunctionDeclaration?"TSDeclareFunction":Ge?.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,st.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 Xe=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(Xe)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,Ge=this.type===Ie._import;if(De.callee=this.parseSubscripts(this.parseExprAtom(),Fe,qe,!0,!1),Ge&&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,Ge){if(Ie._in.binop>qe&&!this.hasPrecedingLineBreak()){let He;if(this.isContextual("as"))He="TSAsExpression";if(this.isContextual("satisfies"))He="TSSatisfiesExpression";if(He){let Xe=this.startNodeAt(Oe,Fe);Xe.expression=De;let Ze=this.tsTryNextParseConstantContext();if(Ze)Xe.typeAnnotation=Ze;else Xe.typeAnnotation=this.tsNextThenParseType();return this.finishNode(Xe,He),this.reScan_lt_gt(),this.parseExprOp(Xe,Oe,Fe,qe,Ge)}}return super.parseExprOp(De,Oe,Fe,qe,Ge)}parseImportSpecifiers(){let De=[],Oe=!0;if(Le.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",et(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(et(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,st.TypeImportCannotSpecifyDefaultAndNamed);return De}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let De=this.startNode();return this.next(),De.abstract=!0,this.parseClass(De,!0)}if(this.match(We.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(We.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,We.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 Ge of De.specifiers)if(this.checkUnreserved(Ge.local),this.checkLocalExport(Ge.local),Ge.local.type==="Literal")this.raise(Ge.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,st.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,st.ReservedArrowTypeParam)}parseExprAtom(De,Oe,Fe){if(this.type===We.jsxText)return this.jsx_parseText();else if(this.type===We.jsxTagStart)return this.jsx_parseElement();else if(this.type===We.at)return this.parseDecorators(),this.parseExprAtom();else if(et(this.type)){let qe=this.potentialArrowAt===this.start,Ge=this.start,He=this.startLoc,Xe=this.containsEsc,Ze=this.parseIdent(!1);if(this.ecmaVersion>=8&&!Xe&&Ze.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ie._function))return this.overrideContext(Ve.f_expr),this.parseFunction(this.startNodeAt(Ge,He),0,!1,!0,Oe);if(qe&&!this.canInsertSemicolon()){if(this.eat(Ie.arrow))return this.parseArrowExpression(this.startNodeAt(Ge,He),[Ze],!1,Oe);if(this.ecmaVersion>=8&&Ze.name==="async"&&this.type===Ie.name&&!Xe&&(!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(Ge,He),[Ze],!0,Oe)}}return Ze}else return super.parseExprAtom(De,Oe,Fe)}parseExprAtomDefault(){if(et(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(et(qe))if(this.lookaheadCharCode()===61){let Ge=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(Ie.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(Fe),[Ge],!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(lt(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 Ge=this.finishNode(De,"VariableDeclaration");if(!qe)return Ge;for(let{id:He,init:Xe}of Ge.declarations){if(!Xe)continue;if(Oe!=="const"||!!He.typeAnnotation)this.raise(Xe.start,st.InitializerNotAllowedInAmbientContext);else if(Xe.type!=="Literal"&&(Xe.type!=="TemplateLiteral"||Xe.expressions.length>0)&&!uf(Xe)&&!pf(Xe))this.raise(Xe.start,st.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return Ge}parseStatement(De,Oe,Fe){if(this.match(We.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(We.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(We.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,st.ClassMethodHasReadonly);if(De.declare&&this.match(Ie.parenL))this.raise(De.start,st.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(We.at))return!0;return super.shouldParseExportStatement()}parseConditional(De,Oe,Fe,qe,Ge){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,Ge=this.parseExprOps(De,Oe);if(this.checkExpressionErrors(Oe))return Ge;if(!this.maybeInArrowParameters||!this.match(Ie.question))return this.parseConditional(Ge,Fe,qe,De,Oe);let He=this.tryParse(()=>this.parseConditional(Ge,Fe,qe,De,Oe));if(!He.node){if(He.error)this.setOptionalParametersError(Oe,He.error);return Ge}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(We.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(De));let Oe=this.start,Fe=this.startLoc,qe=this.eatContextual("declare");if(qe&&(this.ts_isContextual(We.declare)||!this.shouldParseExportStatement()))this.raise(this.start,st.ExpectedAmbientAfterExportDeclare);let He=et(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,st.PrivateElementHasAbstract);if(De.accessibility)this.raise(De.start,st.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,st.DeclareClassFieldHasInitializer);if(De.abstract&&this.match(Ie.eq)){let{key:Fe}=De;this.raise(this.start,st.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 Ge=De.kind==="constructor",He=De.key.type==="PrivateIdentifier",Xe=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(He){if(Xe)De.typeParameters=Xe;if(De.accessibility)this.raise(De.start,st.PrivateMethodsHasAccessibility({modifier:De.accessibility}))}else if(Xe&&Ge)this.raise(Xe.start,st.ConstructorHasTypeParameters);let{declare:Ze=!1,kind:Qe}=De;if(Ze&&(Qe==="get"||Qe==="set"))this.raise(De.start,st.DeclareAccessor({kind:Qe}));if(Xe)De.typeParameters=Xe;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&&Ea(De,"prototype"))this.raise(Ye.start,"Classes may not have a static property named prototype");let ct=De.value=this.parseMethod(Oe,Fe,qe,!0,De);if(De.kind==="get"&&ct.params.length!==0)this.raiseRecoverable(ct.start,"getter should have no params");if(De.kind==="set"&&ct.params.length!==1)this.raiseRecoverable(ct.start,"setter should have exactly one param");if(De.kind==="set"&&ct.params[0].type==="RestElement")this.raiseRecoverable(ct.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,Ge=!1,He="method",Xe=!1,Ze=["declare","private","public","protected","accessor","override","abstract","readonly","static"],Qe=this.tsParseModifiers({modified:Oe,allowedModifiers:Ze,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:st.InvalidModifierOnTypeParameterPositions});Xe=Boolean(Qe.static);let Ye=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(Oe,Ze))this.raise(this.start,st.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(Oe),Oe}else{let ct=this.tsTryParseIndexSignature(Oe);if(ct){if(Oe.abstract)this.raise(Oe.start,st.IndexSignatureHasAbstract);if(Oe.accessibility)this.raise(Oe.start,st.IndexSignatureHasAccessibility({modifier:Oe.accessibility}));if(Oe.declare)this.raise(Oe.start,st.IndexSignatureHasDeclare);if(Oe.override)this.raise(Oe.start,st.IndexSignatureHasOverride);return ct}if(!this.inAbstractClass&&Oe.abstract)this.raise(Oe.start,st.NonAbstractClassHasAbstractMethod);if(Oe.override){if(!De)this.raise(Oe.start,st.OverrideNotInSubClass)}if(Oe.static=Xe,Xe){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())Ge=!0;else Fe="async";if(!Fe&&(this.ecmaVersion>=9||!Ge)&&this.eat(Ie.star))qe=!0;if(!Fe&&!Ge&&!qe){let ft=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())He=ft;else Fe=ft}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||Ge){let ft=!Oe.static&&Ea(Oe,"constructor"),gt=ft&&De;if(ft&&He!=="method")this.raise(Oe.key.start,"Constructor can't have get/set modifier");Oe.kind=ft?"constructor":He,this.parseClassMethod(Oe,qe,Ge,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 Ge=this.yieldPos,He=this.awaitPos,Xe=this.awaitIdentPos;this.enterScope(ci(Fe,!1)|dt.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=Ge,this.awaitPos=He,this.awaitIdentPos=Xe,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,Ge=-1,He=-1,Xe=-1;if(Oe)Ge=Oe.parenthesizedAssign,He=Oe.trailingComma,Xe=Oe.doubleProto,Oe.parenthesizedAssign=Oe.trailingComma=-1;else Oe=new mr,qe=!0;let Ze=this.start,Qe=this.startLoc;if(this.type===Ie.parenL||et(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 ct=this.startNodeAt(Ze,Qe);if(ct.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(ct.left=Ye,this.next(),ct.right=this.parseMaybeAssign(De),Xe>-1)Oe.doubleProto=Xe;return this.finishNode(ct,"AssignmentExpression")}else if(qe)this.checkExpressionErrors(Oe,!0);if(Ge>-1)Oe.parenthesizedAssign=Ge;if(He>-1)Oe.trailingComma=He;return Ye}parseMaybeAssign(De,Oe,Fe){let qe,Ge;if(s?.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===Le.tokContexts.tc_oTag&&Ye===Le.tokContexts.tc_expr)this.parseEffects.pop(Ze),this.parseEffects.pop(Ze);else if(Qe===Le.tokContexts.tc_oTag||Qe===Le.tokContexts.tc_expr)this.parseEffects.pop(Ze)}if(!qe?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(De,Oe,Fe);let He,Xe=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(!Xe.error&&!Xe.aborted){if(He)this.reportReservedArrowTypeParam(He);return Xe.node}if(!qe){if(Sa(!0),Ge=this.tryParse(()=>this.parseMaybeAssignOrigin(De,Oe,Fe)),!Ge.error)return Ge.node}if(qe?.thrown)throw this.selectTryParseResult(qe),qe.error;if(Xe.thrown)throw this.selectTryParseResult(Xe),Xe.error;if(Ge?.thrown)throw this.selectTryParseResult(Ge),Ge.error;throw qe?.error||Xe.error||Ge?.error}parseAssignableListItem(De){let Oe=[];while(this.match(We.at))Oe.push(this.parseDecorator());let Fe=this.start,qe=this.startLoc,Ge,He=!1,Xe=!1;if(De!==void 0){let Ye={};if(this.tsParseModifiers({modified:Ye,allowedModifiers:["public","private","protected","override","readonly"]}),Ge=Ye.accessibility,Xe=Ye.override,He=Ye.readonly,De===!1&&(Ge||He||Xe))this.raise(qe.column,st.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(Ge||He||Xe){let Ye=this.startNodeAt(Fe,qe);if(Ge)Ye.accessibility=Ge;if(He)Ye.readonly=He;if(Xe)Ye.override=Xe;if(Qe.type!=="Identifier"&&Qe.type!=="AssignmentPattern")this.raise(Ye.start,st.UnsupportedParameterPropertyKind);return Ye.parameter=Qe,this.finishNode(Ye,"TSParameterProperty")}return Qe}checkLValInnerPattern(De,Oe=dt.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,st.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,Ge)=>qe.type!=="ObjectMethod"&&(Ge===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 mr,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,st.UnexpectedTypeCastInParameter);let Ge=this.toAssignable(De.expression,Oe,Fe,qe);if(qe)return De.expression=Ge,De;return Ge;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 Ge=this.toAssignable(De.expression,Oe,Fe,qe);if(qe)return De.expression=Ge,De;return Ge;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 Ge=this.tsParseTypeOrTypePredicateAnnotation(Ie.colon);if(this.canInsertSemicolon()||!this.match(Ie.arrow))qe();return Ge});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 Ge=this.startNodeAt(De,Oe);return Ge.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(Ge,Fe,!1,qe)}parseParenAndDistinguishExpression(De,Oe){let Fe=this.start,qe=this.startLoc,Ge,He=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let Xe=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let Ze=this.start,Qe=this.startLoc,Ye=[],ct=!0,ft=!1,gt=new mr,$t=this.yieldPos,Ot=this.awaitPos,Gt;this.yieldPos=0,this.awaitPos=0;while(this.type!==Ie.parenR)if(ct?ct=!1:this.expect(Ie.comma),He&&this.afterTrailingComma(Ie.parenR,!0)){ft=!0;break}else if(this.type===Ie.ellipsis){if(Gt=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 Zt=this.lastTokEnd,Lt=this.lastTokEndLoc;if(this.expect(Ie.parenR),this.maybeInArrowParameters=Xe,De&&this.shouldParseArrow(Ye)&&this.eat(Ie.arrow))return this.checkPatternErrors(gt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=$t,this.awaitPos=Ot,this.parseParenArrowList(Fe,qe,Ye,Oe);if(!Ye.length||ft)this.unexpected(this.lastTokStart);if(Gt)this.unexpected(Gt);if(this.checkExpressionErrors(gt,!0),this.yieldPos=$t||this.yieldPos,this.awaitPos=Ot||this.awaitPos,Ye.length>1)Ge=this.startNodeAt(Ze,Qe),Ge.expressions=Ye,this.finishNodeAt(Ge,"SequenceExpression",Zt,Lt);else Ge=Ye[0]}else Ge=this.parseParenExpression();if(this.options.preserveParens){let Xe=this.startNodeAt(Fe,qe);return Xe.expression=Ge,this.finishNode(Xe,"ParenthesizedExpression")}else return Ge}parseTaggedTemplateExpression(De,Oe,Fe,qe){let Ge=this.startNodeAt(Oe,Fe);if(Ge.tag=De,Ge.quasi=this.parseTemplate({isTagged:!0}),qe)this.raise(Oe,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(Ge,"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 Ge=this.startNodeAt(De,Oe);return Ge.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(Ge,Fe,!0,qe)}parseExprList(De,Oe,Fe,qe){let Ge=[],He=!0;while(!this.eat(De)){if(!He){if(this.expect(Ie.comma),Oe&&this.afterTrailingComma(De))break}else He=!1;let Xe;if(Fe&&this.type===Ie.comma)Xe=null;else if(this.type===Ie.ellipsis){if(Xe=this.parseSpread(qe),this.maybeInArrowParameters&&this.match(Ie.colon))Xe.typeAnnotation=this.tsParseTypeAnnotation();if(qe&&this.type===Ie.comma&&qe.trailingComma<0)qe.trailingComma=this.start}else Xe=this.parseMaybeAssign(!1,qe,this.parseParenItem);Ge.push(Xe)}return Ge}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,Ge,He,Xe){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,$t=this.tsTryParseAndCatch(()=>{if(!qe&&this.atPossibleAsyncArrow(De)){let Lt=this.tsTryParseGenericAsyncArrowFunction(Oe,Fe,Xe);if(Lt)return De=Lt,De}let Ot=this.tsParseTypeArgumentsInExpression();if(!Ot)return De;if(Qe&&!this.match(Ie.parenL))return gt=this.curPosition(),De;if(nt(this.type)||this.type===Ie.backQuote){let Lt=this.parseTaggedTemplateExpression(De,Oe,Fe,Ze);return Lt.typeArguments=Ot,Lt}if(!qe&&this.eat(Ie.parenL)){let Lt=new mr,_t=this.startNodeAt(Oe,Fe);if(_t.callee=De,_t.arguments=this.parseExprList(Ie.parenR,this.ecmaVersion>=8,!1,Lt),this.tsCheckForInvalidTypeCasts(_t.arguments),_t.typeArguments=Ot,Ze)_t.optional=Qe;return this.checkExpressionErrors(Lt,!0),De=this.finishNode(_t,"CallExpression"),De}let Gt=this.type;if(this.tsMatchRightRelational()||Gt===Ie.bitShift||Gt!==Ie.parenL&&ff(Gt)&&!this.hasPrecedingLineBreak())return;let Zt=this.startNodeAt(Oe,Fe);return Zt.expression=De,Zt.typeArguments=Ot,this.finishNode(Zt,"TSInstantiationExpression")});if(gt)this.unexpected(gt);if($t){if($t.type==="TSInstantiationExpression"&&(this.match(Ie.dot)||this.match(Ie.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,st.InvalidPropertyAccessAfterInstantiationExpression);return De=$t,De}}let Ye=this.ecmaVersion>=11,ct=Ye&&this.eat(Ie.questionDot);if(qe&&ct)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let ft=this.eat(Ie.bracketL);if(ft||ct&&this.type!==Ie.parenL&&this.type!==Ie.backQuote||this.eat(Ie.dot)){let gt=this.startNodeAt(Oe,Fe);if(gt.object=De,ft)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=!!ft,Ye)gt.optional=ct;De=this.finishNode(gt,"MemberExpression")}else if(!qe&&this.eat(Ie.parenL)){let gt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let $t=new mr,Ot=this.yieldPos,Gt=this.awaitPos,Zt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let Lt=this.parseExprList(Ie.parenR,this.ecmaVersion>=8,!1,$t);if(Ge&&!ct&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors($t,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=Ot,this.awaitPos=Gt,this.awaitIdentPos=Zt,De=this.parseSubscriptAsyncArrow(Oe,Fe,Lt,Xe)}else{this.checkExpressionErrors($t,!0),this.yieldPos=Ot||this.yieldPos,this.awaitPos=Gt||this.awaitPos,this.awaitIdentPos=Zt||this.awaitIdentPos;let _t=this.startNodeAt(Oe,Fe);if(_t.callee=De,_t.arguments=Lt,Ye)_t.optional=ct;De=this.finishNode(_t,"CallExpression")}this.maybeInArrowParameters=gt}else if(this.type===Ie.backQuote){if(ct||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,Ge,He,Xe,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,Ge,He,Xe,Ze)}parseProperty(De,Oe){if(!De){let Fe=[];if(this.match(We.at))while(this.match(We.at))Fe.push(this.parseDecorator());let qe=super.parseProperty(De,Oe);if(qe.type==="SpreadElement"){if(Fe.length)this.raise(qe.start,Kr.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?dt.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(De,Oe?dt.BIND_SIMPLE_CATCH:dt.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 Ge=this.enterClassBody(),He=this.startNode(),Xe=!1;He.body=[];let Ze=[];this.expect(Ie.braceL);while(this.type!==Ie.braceR){if(this.match(We.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(Xe)this.raiseRecoverable(Qe.start,"Duplicate constructor in the same class");if(Xe=!0,Qe.decorators&&Qe.decorators.length>0)this.raise(Qe.start,Kr.DecoratorConstructor)}else if(Qe.key&&Qe.key.type==="PrivateIdentifier"&&Qe.value?.type!=="TSDeclareMethod"){let Ye=Qe.key.name;if(this.parseEffects.modify(Ge,Ye,(ft)=>zu(ft,Qe)))this.raiseRecoverable(Qe.key.start,`Identifier '#${Ye}' has already been declared`)}}}if(this.strict=qe,this.next(),Ze.length)this.raise(this.start,Kr.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,Ge){let He=this.startNode(),Xe=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(ci(Oe,He.generator)|dt.SCOPE_SUPER|(Fe?dt.SCOPE_DIRECT_SUPER:0)),this.expect(Ie.parenL),He.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(He,!1,!0,!1,{isClassMethod:qe}),this.yieldPos=Xe,this.awaitPos=Ze,this.awaitIdentPos=Qe,Ge&&Ge.abstract){if(!!He.body){let{key:ct}=Ge;this.raise(Ge.start,st.AbstractMethodHasImplementation({methodName:ct.type==="Identifier"&&!Ge.computed?ct.name:`[${this.input.slice(ct.start,ct.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(We.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(We.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",Ge=Oe?"local":"exported",He=De[qe],Xe,Ze=!1,Qe=!0,Ye=He.start;if(this.isContextual("as")){let ft=this.parseIdent();if(this.isContextual("as")){let gt=this.parseIdent();if(lt(this.type))Ze=!0,He=ft,Xe=Oe?this.parseIdent():this.parseModuleExportName(),Qe=!1;else Xe=gt,Qe=!1}else if(lt(this.type))Qe=!1,Xe=Oe?this.parseIdent():this.parseModuleExportName();else Ze=!0,He=ft}else if(lt(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?st.TypeModifierIsUsedInTypeImports:st.TypeModifierIsUsedInTypeExports);De[qe]=He,De[Ge]=Xe;let ct=Oe?"importKind":"exportKind";if(De[ct]=Ze?"type":"value",Qe&&this.eatContextual("as"))De[Ge]=Oe?this.parseIdent():this.parseModuleExportName();if(!De[Ge])De[Ge]=this.copyNode(De[qe]);if(Oe)this.checkLValSimple(De[Ge],dt.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==Ke.tc_oTag)this.parseEffects.append(this.context,Ve.b_expr);else if(Fe==Ke.tc_expr)this.parseEffects.append(this.context,Ve.b_tmpl);else super.updateContext(De);this.exprAllowed=!0}else if(Oe===Ie.slash&&De===We.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,Ke.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 Ge=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(Ge)Fe.typeArguments=Ge}Fe.attributes=[];while(this.type!==Ie.slash&&this.type!==We.jsxTagEnd)Fe.attributes.push(this.jsx_parseAttribute());return Fe.selfClosing=this.eat(Ie.slash),this.expect(We.jsxTagEnd),this.finishNode(Fe,qe?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(De){let Oe=De===dr;if(Oe)this.parseEffects.append(this.importsStack,[]);let Fe=Oe?De|dt.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&dr)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&dt.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,Oe)}declareName(De,Oe,Fe){if(Oe&dt.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&dt.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(qe,De),this.parseEffects.append(qe.exportOnlyBindings,De);return}if(Oe===dt.BIND_TS_TYPE||Oe===dt.BIND_TS_INTERFACE){if(Oe===dt.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&dt.BIND_FLAGS_TS_ENUM){if(qe.enums.includes(De))return;super.declareName(De,dt.BIND_LEXICAL,Fe)}else super.declareName(De,Oe,Fe);if(Oe&dt.BIND_FLAGS_TS_ENUM)this.parseEffects.append(qe.enums,De);if(Oe&dt.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(qe.constEnums,De);if(Oe&dt.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 Ge=this.scopeStack[qe];if(Ge.types.indexOf(Oe)>-1||Ge.exportOnlyBindings.indexOf(Oe)>-1)return}super.checkLocalExport(De)}}return vt}}function Oa(s,ve,Ae){let _e=Ae._,Ne=!1,Le=()=>{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 We=Me[Ue];if(We&&typeof We==="object")if(Array.isArray(We)){let Ke=null,Je=We.length;for(let ze=0;ze<Je;ze++){let nt=We[ze];if(nt&&typeof nt==="object"){let ot=Re(nt,$e,Be);if(ot)(Ke??=We.slice())[ze]=ot}}if(Ke)(Ve??={})[Ue]=Ke}else{let Ke=Re(We,$e,Be);if(Ke)(Ve??={})[Ue]=Ke}}if($e.pop(),Ve)return mf(Me,Ve)}function Re(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,We,Ke=(ze=Be)=>We=Ie(Me,$e,ze),Je=(ze,nt=Be)=>{$e.push(Me);let ot=Re(ze,$e,nt)??ze;return $e.pop(),ot};if(_e){let ze;if(Ue=_e(Me,{path:$e,state:Be,next:(nt=Be)=>(Be=nt,ze=Ve?Ve(Me,{path:$e,state:nt,next:Ke,stop:Le,visit:Je}):Ke(nt),ze),stop:Le,visit:Je}),!Ue&&ze)Ue=ze}else Ue=Ve(Me,{path:$e,state:Be,next:Ke,stop:Le,visit:Je});if(!Ue&&We)Ue=We;if(Ue)return Ue}return Re(s,[],ve)??s}function mf(s,ve){let Ae={},_e=Object.getOwnPropertyDescriptors(s);for(let Ne in _e)Object.defineProperty(Ae,Ne,_e[Ne]);for(let Ne in ve)Ae[Ne]=ve[Ne];return Ae}var gf=/\n/,yf=/[ \t]/,xf=/^[,) \t]*$/,Xr="",Ma=[];function Jr(s,ve){Xr=s,Ma=ve}function Yr(s,ve,Ae,_e){let Ne=ve;if(s&&gf.test(Ne)){let Le=Ae;while(Le>0&&Xr[Le-1]!==`
|
|
12
|
-
`)Le-=1;let Ie=Le;while(yf.test(Xr[Ie]))Ie+=1;let Re=Xr.slice(Le,Ie);Ne=bf(Ne,Re)}Ma.push({type:s?"Block":"Line",value:Ne,start:Ae,end:_e})}function bf(s,ve){if(ve==="")return s;return(s.startsWith(ve)?s.slice(ve.length):s).replaceAll(`
|
|
13
|
-
${ve}`,`
|
|
14
|
-
`)}function fi(s,ve,Ae,_e){let Ne=Ef(Ae,_e);if(Ne>=Ae.length)return;ui(s,void 0,Ae,{index:Ne},ve)}function Ef(s,ve){let Ae=0,_e=s.length;while(Ae<_e){let Ne=Ae+_e>>>1;if(s[Ne].start<ve)Ae=Ne+1;else _e=Ne}return Ae}function ui(s,ve,Ae,_e,Ne){while(_e.index<Ae.length&&Ae[_e.index].start<(s.start??0))s.leadingComments??=[],s.leadingComments.push(Ae[_e.index]),_e.index++;if(_e.index>=Ae.length)return;let Le=Ae[_e.index].start,Ie=s.end,Me=Ie===void 0||Ie>Le?Object.keys(s):[];for(let $e=0;$e<Me.length;$e++){let Be=Me[$e];if(Be==="type"||Be==="leadingComments")continue;let Ve=s[Be];if(!Ve||typeof Ve!=="object")continue;if(Array.isArray(Ve)){for(let Ue of Ve)if(Ue&&typeof Ue==="object"&&typeof Ue.type==="string"){if(ui(Ue,s,Ae,_e,Ne),_e.index>=Ae.length)return}}else if(typeof Ve.type==="string"){if(ui(Ve,s,Ae,_e,Ne),_e.index>=Ae.length)return}}if(_e.index<Ae.length){let $e=Ae[_e.index];if(ve===void 0||s.end!==ve.end){let Be=Ne.slice(s.end??0,$e.start);if((ve?.type==="BlockStatement"||ve?.type==="Program")&&pi(ve.body,s)||ve?.type==="ArrayExpression"&&pi(ve.elements,s)||ve?.type==="ObjectExpression"&&pi(ve.properties,s))while(_e.index<Ae.length){if(ve&&Ae[_e.index].start>=(ve.end??Number.POSITIVE_INFINITY))break;_e.index++}else if((s.end??0)<=$e.start&&xf.test(Be))_e.index++}}}function pi(s,ve){return!!s&&s.indexOf(ve)===s.length-1}var Ba=At,Cf=Ba.extend(Ra());function hi(s){return s?Cf:Ba}var vf={onComment:Yr,sourceType:"module",ecmaVersion:16},Sf={onComment:Yr,sourceType:"module",ecmaVersion:16,preserveParens:!0},Tf={onComment:Yr,sourceType:"module",ecmaVersion:16};function $a(s,ve,Ae,_e,Ne){if(Ae.length===Ne)return;fi(s,ve,Ae,_e)}function Fa(s,ve,Ae){let _e=Ae.length;Jr(s,Ae);let Ne=hi(ve).parse(s,vf);if(Ae.length>0)fi(Ne,s,Ae,_e);return Ne}var Af={count:0};function Jn(s,ve,Ae,_e){Af.count+=1;let Ne=_e.length;Jr(s,_e);let Le=hi(Ae).parseExpressionAt(s,ve,Sf);$a(Le,s,_e,ve,Ne);let Ie=_e.length>Ne?_e.at(-1):void 0,Re=Ie&&Ie.end>(Le.end??0)?Ie.end:Le.end??0,Me=Le.end??ve;return{node:kf(s,ve,Me,40)?wf(Le):Le,end:Re}}function kf(s,ve,Ae,_e){for(let Ne=ve;Ne<Ae;Ne++)if(s.charCodeAt(Ne)===_e)return!0;return!1}function ja(s,ve,Ae,_e){let Ne=_e.length,Le=hi(Ae);Jr(s,_e);let Ie=new Le(Tf,s,ve);Ie.nextToken();let Re=Ie.parseStatement(null,!0,Object.create(null));return $a(Re,s,_e,ve,Ne),Re}function wf(s){return Oa(s,null,{ParenthesizedExpression(ve,Ae){return Ae.visit(ve.expression)}})}function jn(s){if(s===32||s<=13&&s>=9)return!0;if(s<160)return!1;return s===160||s===5760||s>=8192&&s<=8202||s===8232||s===8233||s===8239||s===8287||s===12288||s===65279}class di{source;index=0;constructor(s){this.source=s}match(s){if(s.length===1)return this.source.charCodeAt(this.index)===s.charCodeAt(0);return this.source.startsWith(s,this.index)}matchRegex(s){s.lastIndex=this.index;let ve=s.exec(this.source);if(!ve||ve.index!==this.index)return null;return ve[0]}eat(s,ve=!1){if(this.match(s))return this.index+=s.length,!0;if(ve)throw new _n(`Expected token ${JSON.stringify(s)}`,this.index);return!1}read(s){let ve=this.matchRegex(s);if(ve)this.index+=ve.length;return ve}readUntil(s){if(this.index>=this.source.length)throw new _n("Unexpected end of input",this.source.length);let ve=this.index;s.lastIndex=ve;let Ae=s.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(s){if(this.index>=this.source.length)throw new _n("Unexpected end of input",this.source.length);let ve=this.source.indexOf(s,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&&jn(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!jn(this.source.charCodeAt(this.index)))throw new _n("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let s=this.index,ve=s,Ae="",_e=this.source.codePointAt(this.index);if(_e!==void 0&&jt(_e,!0)){ve+=_e<=65535?1:2;while(ve<this.source.length){let Ne=this.source.codePointAt(ve);if(Ne===void 0||!zt(Ne,!0))break;ve+=Ne<=65535?1:2}Ae=this.source.slice(s,ve),this.index=ve}return{type:"Identifier",name:Ae,start:s,end:ve}}}class _n extends Error{position;constructor(s,ve){super(`${s} (at index ${ve})`);this.name="TemplateSyntaxError",this.position=ve}}function qt(){return{type:"Fragment",nodes:[]}}var Pf=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"]),_f=["&&","||","??"],Nf=["===","!==","==","!="];function Va(s,ve){let Ae=s.codePointAt(ve);if(Ae===void 0||!jt(Ae,!0))return ve;let _e=ve+(Ae<=65535?1:2);while(_e<s.length){let Ne=s.codePointAt(_e);if(!zt(Ne,!0))break;_e+=Ne<=65535?1:2}return _e}function If(s,ve){let Ae=ve;while(Ae<s.length){let _e=s.charCodeAt(Ae);if(_e<48||_e>57)break;Ae++}return Ae}function Qr(s,ve){let Ae=ve;while(Ae<s.length&&jn(s.charCodeAt(Ae)))Ae++;return Ae}function qa(s,ve){let Ae=If(s,ve);if(Ae===ve)return null;if(s.charCodeAt(ve)===48&&Ae-ve>1)return null;if(Ae<s.length){let Ne=s.codePointAt(Ae);if(Ne===46||zt(Ne,!0))return null}let _e=s.slice(ve,Ae);return{type:"Literal",start:ve,end:Ae,value:Number(_e),raw:_e}}function Ua(s,ve){let Ae=s.charCodeAt(ve),_e=ve+1;while(_e<s.length){let Ne=s.charCodeAt(_e);if(Ne===Ae){let Le=s.slice(ve,_e+1);return{type:"Literal",start:ve,end:_e+1,value:s.slice(ve+1,_e),raw:Le}}if(Ne===92||Ne===10||Ne===13)return null;_e++}return null}function Df(s,ve){let Ae=s.charCodeAt(ve);if(Ae===34||Ae===39)return Ua(s,ve);let _e=Va(s,ve);if(_e===ve)return qa(s,ve);let Ne=s.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(Pf.has(Ne))return null;let Le={type:"Identifier",start:ve,end:_e,name:Ne},Ie=_e;while(Ie<s.length){let Re=s.charCodeAt(Ie);if(Re===46){let Me=Ie+1,$e=Va(s,Me);if($e===Me)return null;let Be={type:"Identifier",start:Me,end:$e,name:s.slice(Me,$e)};Le={type:"MemberExpression",start:ve,end:$e,object:Le,property:Be,computed:!1,optional:!1},Ie=$e}else if(Re===91){let Me=Ie+1,$e=s.charCodeAt(Me),Be=$e===34||$e===39?Ua(s,Me):qa(s,Me);if(!Be||s.charCodeAt(Be.end)!==93)return null;Le={type:"MemberExpression",start:ve,end:Be.end+1,object:Le,property:Be,computed:!0,optional:!1},Ie=Be.end+1}else break}return Le}function mi(s,ve){if(s.charCodeAt(ve)!==33||s.charCodeAt(ve+1)===61)return Df(s,ve);let Ae=mi(s,Qr(s,ve+1));if(!Ae)return null;return{type:"UnaryExpression",start:ve,end:Ae.end,operator:"!",prefix:!0,argument:Ae}}function Lf(s,ve){for(let Ae of Nf)if(s.startsWith(Ae,ve))return{operator:Ae,logical:!1};for(let Ae of _f)if(s.startsWith(Ae,ve))return{operator:Ae,logical:!0};return null}function Ga(s,ve){let Ae=Qr(s,ve);if(Ae>=s.length)return!1;let _e=s.charCodeAt(Ae);return _e===125||_e===41}function Rf(s){let ve=s.source,Ae=mi(ve,s.index);if(!Ae)return null;if(Ga(ve,Ae.end))return s.index=Ae.end,Ae;let _e=Qr(ve,Ae.end),Ne=Lf(ve,_e);if(!Ne)return null;let Le=mi(ve,Qr(ve,_e+Ne.operator.length));if(!Le||!Ga(ve,Le.end))return null;return s.index=Le.end,{type:Ne.logical?"LogicalExpression":"BinaryExpression",start:Ae.start,end:Le.end,left:Ae,operator:Ne.operator,right:Le}}function It(s){let ve=Rf(s);if(ve)return ve;let{node:Ae,end:_e}=Jn(s.source,s.index,s.isTypeScript,s.root.comments);return s.index=_e,Ae}var Of={"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},gi=Of;var Mf=[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 Bf(s,ve){if(ve&&!s.endsWith(";"))return`${s}\\b(?!=)`;return s}function Wa(s){let Ae=Object.keys(gi).map((_e)=>Bf(_e,s));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${Ae.join("|")})`,"g")}var yi,xi;function $f(s){if(s){if(!xi)xi=Wa(!0);return xi}if(!yi)yi=Wa(!1);return yi}var Ha=0;function Ff(s){if(s===10)return 32;if(s<128)return s;if(s<=159)return Mf[s-128];if(s<55296)return s;if(s<=57343)return Ha;if(s<=65535)return s;if(s>=65536&&s<=131071)return s;if(s>=131072&&s<=196607)return s;if(s>=917504&&s<=917631||s>=917760&&s<=917999)return s;return Ha}function bi(s,ve){if(s.indexOf("&")===-1)return s;return s.replace($f(ve),(Ae,_e)=>{let Ne;if(_e[0]!=="#")Ne=gi[_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(Ff(Ne))})}class T extends Error{constructor(s){super(`sveld's template parser doesn't support ${s} yet.`);this.name="TemplateParseNotImplementedError"}}var jf=/<\/script\s*>/g,Vf=/<\/script\s*>/y,qf=/[^\n]/g,Uf=new Set(["server","client","worker","test","default"]);function Ka(s,ve,Ae){let _e=s.index,Ne=s.readUntil(jf);if(s.index>=s.source.length)throw Error("sveld: unclosed <script> tag");let Le=s.source.slice(0,_e).replace(qf," ")+Ne;s.read(Vf);let Ie=Fa(Le,s.isTypeScript,s.root.comments);Ie.start=_e;let Re="default";for(let Me of Ae){if(Uf.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.");Re="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.');Re="module"}}return{type:"Script",start:ve,end:s.index,context:Re,content:Ie,attributes:Ae}}function za(s,ve,Ae){let _e=s.index,Ne=s.source.indexOf("</style",s.index),Le=Ne===-1?s.source.length:Ne;return s.index=Le,s.eat("</style",!0),s.read(/\s*>/y),{type:"StyleSheet",start:ve,end:s.index,attributes:Ae,children:[],comments:[],content:{start:_e,end:Le,styles:s.source.slice(_e,Le),comment:null}}}var Gf=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Ei(s){return Gf.has(s)||s.charCodeAt(0)===33&&s.toLowerCase()==="!doctype"}var Wf="^[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}]*)?$",Hf=new RegExp(Wf,"u");function Xa(s){return Hf.test(s)}var Kf=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,ec=/["']/y,zf=/(\/>|[\s"'=<>`])/y,Ci=/<\/textarea(\s[^>]*)?>/iy,Xf=/^![a-zA-Z]+$/,Jf=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Yf=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,tc={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},Ja={...tc,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function Qf(s){let ve=s.charCodeAt(0);if(ve<97||ve>122)return!1;for(let Ae=1;Ae<s.length;Ae++){let _e=s.charCodeAt(Ae);if((_e<97||_e>122)&&(_e<48||_e>57))return!1}return!0}function Zf(s){if(Qf(s))return!0;if(Xf.test(s))return!0;if(Jf.test(s))return!0;return Xa(s)}function eh(s){let ve=s.charCodeAt(0);if(ve>=97&&ve<=122&&!s.includes("."))return!1;return!0}function th(s){return`Svelte${s.slice(7).split("-").map((Ae)=>Ae.charAt(0).toUpperCase()+Ae.slice(1)).join("")}`}function nh(s){for(let ve=s.length-1;ve>=0;ve--){let Ae=s[ve].type;if(Ae==="SvelteHead")return!0;if(Ae==="RegularElement"||Ae==="Component")return!1}return!1}function rh(s){for(let ve=s.length-1;ve>=0;ve--){let Ae=s[ve];if(Ae.type==="RegularElement"&&Ae.attributes?.some((_e)=>_e.type==="Attribute"&&_e.name==="shadowrootmode"))return!0}return!1}function Ya(s){let{source:ve,index:Ae}=s;if(Ae>=ve.length)throw new _n("Unexpected end of input",ve.length);let _e=Ae;while(_e<ve.length){let Ne=ve.charCodeAt(_e);if(Ne===47||Ne===62||jn(Ne))break;_e++}return s.index=_e,{name:ve.slice(Ae,_e),start:Ae,end:_e}}function nc(s){let{source:ve,index:Ae}=s;if(Ae>=ve.length)throw new _n("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||jn(Ne))break;_e++}return s.index=_e,{name:ve.slice(Ae,_e),start:Ae,end:_e}}function sh(s){let ve=s.index;if(s.eat("//")){let Ae=s.readUntilString(`
|
|
15
|
-
`),_e=s.index;s.root.comments.push({type:"Line",value:Ae,start:ve,end:_e});return}if(s.eat("/*")){let Ae=s.readUntilString("*/");s.eat("*/");let _e=s.index;s.root.comments.push({type:"Block",value:Ae,start:ve,end:_e})}}function ih(s){if(s==="use")return"UseDirective";if(s==="animate")return"AnimateDirective";if(s==="bind")return"BindDirective";if(s==="class")return"ClassDirective";if(s==="style")return"StyleDirective";if(s==="on")return"OnDirective";if(s==="let")return"LetDirective";if(s==="in"||s==="out"||s==="transition")return"TransitionDirective";return!1}function rc(s,ve,Ae){let _e={start:s.index,end:-1,type:"Text",raw:"",data:""},Ne=[],Le=(Ie)=>{if(Ie>_e.start)_e.raw=s.source.slice(_e.start,Ie),_e.data=bi(_e.raw,!0),_e.end=Ie,Ne.push(_e)};while(s.index<s.source.length){if(ve())return Le(s.index),Ne;if(s.eat("{")){if(s.match("#")||s.match("@"))throw new T("blocks/tags inside attribute value sequences");let Ie=s.index-1;Le(Ie),s.allowWhitespace();let Re=It(s);s.allowWhitespace(),s.eat("}",!0),Ne.push({type:"ExpressionTag",start:Ie,end:s.index,expression:Re}),_e={start:s.index,end:-1,type:"Text",raw:"",data:""}}else{let Ie=s.index+1;if(Ae!==void 0){let Re=s.source;while(Ie<Re.length){let Me=Re.charCodeAt(Ie);if(Me===123||Me===Ae)break;Ie++}}s.index=Ie}}throw new T("unterminated attribute value / sequence (loose mode)")}function oh(s){let ve=s.eat("'")?"'":s.eat('"')?'"':null;if(ve&&s.eat(ve))return[{start:s.index-1,end:s.index-1,type:"Text",raw:"",data:""}];let Ae=rc(s,()=>{if(ve)return s.match(ve);return!!s.matchRegex(zf)},ve===null?void 0:ve.charCodeAt(0));if(Ae.length===0&&!ve)throw Error("sveld: expected attribute value");if(ve)s.index+=1;if(ve||Ae.length>1||Ae[0].type==="Text")return Ae;return Ae[0]}function vi(s,ve,Ae,_e){return{type:"Attribute",start:ve,end:Ae,name:s,value:_e}}function ah(s){let ve=s.index,Ae=nc(s);if(!Ae.name)return null;let _e=!0;if(s.eat("=")){s.allowWhitespace();let Ne=s.matchRegex(Kf);if(!Ne)throw Error("sveld: expected attribute value");s.index+=Ne.length;let Le=Ne[0]==='"'||Ne[0]==="'";if(Le)Ne=Ne.slice(1,-1);_e=[{start:s.index-Ne.length-(Le?1:0),end:Le?s.index-1:s.index,type:"Text",raw:Ne,data:bi(Ne,!0)}]}if(s.matchRegex(ec))throw Error("sveld: expected '='");return vi(Ae.name,ve,s.index,_e)}function ch(s){while(!0){let Re=s.index;if(sh(s),s.index===Re)break;s.allowWhitespace()}let ve=s.index;if(s.eat("{")){if(s.allowWhitespace(),s.eat("@attach")){s.requireWhitespace();let $e=It(s);return s.allowWhitespace(),s.eat("}",!0),{type:"AttachTag",start:ve,end:s.index,expression:$e}}if(s.eat("...")){let $e=It(s);return s.allowWhitespace(),s.eat("}",!0),{type:"SpreadAttribute",start:ve,end:s.index,expression:$e}}let Re=s.readIdentifierName();if(Re.name==="")throw Error("sveld: empty attribute shorthand");s.allowWhitespace(),s.eat("}",!0);let Me={type:"ExpressionTag",start:Re.start,end:Re.end,expression:Re};return vi(Re.name,ve,s.index,Me)}let Ae=nc(s);if(!Ae.name)return null;let _e=s.index;s.allowWhitespace();let Ne=Ae.name.indexOf(":"),Le=Ne!==-1&&ih(Ae.name.slice(0,Ne)),Ie=!0;if(s.eat("="))if(s.allowWhitespace(),s.source[s.index]==="/"&&s.source[s.index+1]===">"){let Re=s.index;s.index++,Ie=[{start:Re,end:Re+1,type:"Text",raw:"/",data:"/"}],_e=s.index}else Ie=oh(s),_e=s.index;else if(s.matchRegex(ec))throw Error("sveld: expected '='");if(Le){let Re=Ae.name.slice(Ne+1).split("|",1)[0];if(Re==="")throw Error("sveld: directive missing a name");if(Le==="StyleDirective")return{start:ve,end:_e,type:Le,name:Re,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:Le,name:Re,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 vi(Ae.name,ve,_e,Ie)}function sc(s){let ve=s.index++,Ae=s.current();if(s.eat("!--")){let Ue=s.readUntilString("-->");s.eat("-->",!0),s.append({type:"Comment",start:ve,end:s.index,data:Ue});return}if(s.eat("/")){let{name:Ue}=Ya(s);if(s.allowWhitespace(),s.eat(">",!0),Ei(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,s.pop(),Ae=s.current()}if(Ae.end=s.index,s.pop(),s.lastAutoClosedTag&&s.stack.length<s.lastAutoClosedTag.depth)s.lastAutoClosedTag=void 0;return}let _e=Ya(s),Ne=eh(_e.name)&&Yf.test(_e.name);if(!Zf(_e.name)&&!Ne)throw Error(`sveld: "${_e.name}" is not a valid element or component name`);if(_e.name in tc&&Ae.type!=="Root")throw Error(`sveld: <${_e.name}> must be a top-level element`);let Le;if(_e.name in Ja)Le=Ja[_e.name];else if(_e.name.startsWith("svelte:"))Le=th(_e.name);else if(Ne)Le="Component";else if(_e.name==="title"&&nh(s.stack))Le="TitleElement";else if(_e.name==="slot"&&!rh(s.stack))Le="SlotElement";else Le="RegularElement";let Ie={type:Le,start:ve,end:-1,name:_e.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(s.allowWhitespace(),Ae.type==="RegularElement"&&Io(Ae.name,_e.name))Ae.end=ve,s.pop(),s.lastAutoClosedTag={tag:Ae.name,reason:_e.name,depth:s.stack.length},Ae=s.current();let Re=s.current(),Me=(_e.name==="script"||_e.name==="style")&&Re.type==="Root",$e=Me?ah:ch,Be;while(Be=$e(s))Ie.attributes.push(Be),s.allowWhitespace();if(Ie.type==="SvelteComponent")Ie.expression=Za(Qa(Ie));if(Ie.type==="SvelteElement"){let Ue=Qa(Ie);if(Ue.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(lh(Ue))Ie.tag=Za(Ue);else{let We=Ue.value[0];Ie.tag=We.type==="Text"?{type:"Literal",value:We.data,raw:`'${We.raw}'`,start:We.start,end:We.end}:We.expression}}if(Me){if(s.eat(">",!0),_e.name==="script"){let Ue=Ka(s,ve,Ie.attributes);if(Ue.context==="module"){if(s.root.module)throw Error("sveld: duplicate <script module>");s.root.module=Ue}else{if(s.root.instance)throw Error("sveld: duplicate <script>");s.root.instance=Ue}}else{if(s.root.css)throw Error("sveld: duplicate <style>");s.root.css=za(s,ve,Ie.attributes)}return}s.append(Ie);let Ve=s.eat("/")||Ei(_e.name);if(s.eat(">",!0),Ve)Ie.end=s.index;else if(_e.name==="textarea")Ie.fragment.nodes=rc(s,()=>(Ci.lastIndex=s.index,Ci.test(s.source))),s.read(Ci),Ie.end=s.index;else s.push(Ie,Ie.fragment)}function Qa(s){let ve=s.attributes,Ae=ve.findIndex((_e)=>_e.type==="Attribute"&&_e.name==="this");if(Ae===-1)throw Error(`sveld: <${s.name}> requires a \`this\` attribute`);return ve.splice(Ae,1)[0]}function Za(s){return Array.isArray(s.value)?s.value[0].expression:s.value.expression}function lh(s){return s.value!==!0&&!Array.isArray(s.value)||Array.isArray(s.value)&&s.value.length===1&&s.value[0].type==="ExpressionTag"}function ic(s){let ve={start:s.start,end:s.end,attributes:s.attributes};for(let Ae of s.attributes){if(Ae.type!=="Attribute")continue;if(Ae.name==="runes"){let _e=oc(Ae);if(typeof _e==="boolean")ve.runes=_e}if(Ae.name==="customElement"){let _e=fh(Ae);if(_e!==void 0)ve.customElement=_e}}return ve}function oc(s){let{value:ve}=s;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 ph=new Set(["String","Boolean","Number","Array","Object"]);function Si(s){let ve=[];for(let Ae of s.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 uh(s){let ve={};if(!s||typeof s!=="object"||s.type!=="ObjectExpression")return ve;for(let[Ae,_e]of Si(s)){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"&&ph.has(Ne))ve.type=Ne}return ve}function fh(s){let{value:ve}=s;if(ve===!0)return;let Ae=Array.isArray(ve)?ve[0]:ve;if(!Ae)return;if(Ae.type==="Text"){let Be=oc(s);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=Si(_e),Le={},Ie=Ne.find(([Be])=>Be==="tag")?.[1];if(Ie&&typeof Ie==="object"&&Ie.type==="Literal"&&typeof Ie.value==="string")Le.tag=Ie.value;let Re=Ne.find(([Be])=>Be==="props")?.[1];if(Re&&typeof Re==="object"&&Re.type==="ObjectExpression"){Le.props={};for(let[Be,Ve]of Si(Re))Le.props[Be]=uh(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"))Le.shadow=Be.value;else if(Be.type==="ObjectExpression")Le.shadow=Me}let $e=Ne.find(([Be])=>Be==="extend")?.[1];if($e!==void 0)Le.extend=$e;return Le}var hh=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class Ti extends di{root;stack=[];fragments=[];isTypeScript;lastAutoClosedTag;constructor(s,ve){super(s);this.isTypeScript=hh.test(s);let Ae=qt();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(s,ve){this.stack.push(s),this.fragments.push(ve)}pop(){return this.fragments.pop(),this.stack.pop()}append(s){return this.currentFragment().nodes.push(s),s}}var Ai={"{":"}","(":")","[":"]"},dh=new Set(Object.values(Ai));function yr(s,ve,Ae=Ai){let _e=Ae===Ai?dh:new Set(Object.values(Ae)),Ne=[],Le=ve;while(Le<s.source.length){let Ie=s.source[Le++];if(Ie==="'"||Ie==='"'||Ie==="`"){Le=mh(s,Le,Ie);continue}if(Object.hasOwn(Ae,Ie))Ne.push(Ie);else if(_e.has(Ie)){let Re=Ne.pop(),Me=Re?Ae[Re]:void 0;if(Ie!==Me)throw Error(`sveld: expected "${Me}"`);if(Ne.length===0)return Le}}throw Error("sveld: unexpected end of input")}function mh(s,ve,Ae){let _e=!1,Ne=ve;while(Ne<s.source.length){let Le=s.source[Ne++];if(_e){_e=!1;continue}if(Le===Ae)return Ne;if(Le==="\\")_e=!0;if(Ae==="`"&&Le==="$"&&s.source[Ne]==="{")Ne=yr(s,Ne)}throw Error("sveld: unterminated string constant")}var cc=/[^\n]/g,gh=/\?\s*:/g;function Nn(s){let ve=s.index,Ae=s.readIdentifierName();if(Ae.name!==""){let Ue=ac(s);return{...Ae,typeAnnotation:Ue}}let _e=s.source[s.index];if(_e!=="{"&&_e!=="[")throw Error("sveld: expected a binding pattern");let Ne=yr(s,ve);s.index=Ne;let Le=s.source.slice(ve,Ne),Ie=s.source.slice(0,ve).replace(cc," "),Re=Ie.indexOf(" ");Ie=Ie.slice(0,Re)+Ie.slice(Re+1);let Me=`${Ie}(${Le} = 1)`,{node:$e}=Jn(Me,ve-1,s.isTypeScript,s.root.comments),Be=$e.left,Ve=ac(s);if(Ve)Be.typeAnnotation=Ve,Be.end=Ve.end;return Be}function ac(s){let ve=s.index;if(s.allowWhitespace(),!s.eat(":")){s.index=ve;return}let Ae="_ as ",_e=s.index-Ae.length,Ne=s.source.slice(0,_e).replace(cc," ")+Ae+s.source.slice(s.index).replace(gh,":"),{node:Le}=Jn(Ne,_e,s.isTypeScript,s.root.comments),Ie=Le;if(Ie.type==="AssignmentExpression"){let Re=Ie.right.start;while(Ne[Re]!=="=")Re-=1;({node:Le}=Jn(Ne.slice(0,Re),_e,s.isTypeScript,s.root.comments)),Ie=Le}if(Ie.type==="SequenceExpression"&&Ie.expressions)Ie=Ie.expressions[0];return s.index=Ie.end,{type:"TSTypeAnnotation",start:ve,end:s.index,typeAnnotation:Ie.typeAnnotation}}var lc=/\s*}/y,yh={"<":">"};function pc(s){let ve=s.index-2;while(s.source[ve]!=="{")ve-=1;if(s.eat("if")){s.requireWhitespace();let Ae={type:"IfBlock",elseif:!1,start:ve,end:-1,test:It(s),consequent:qt(),alternate:null};s.append(Ae),s.allowWhitespace(),s.eat("}",!0),s.push(Ae,Ae.consequent);return}if(s.eat("each")){s.requireWhitespace();let Ae=It(s);if(s.allowWhitespace(),!s.match("as")){let Re=Ae;if(Re.type==="SequenceExpression"&&Re.expressions)Re=Re.expressions[0];if(Re.type==="TSAsExpression"){let Me=Re;Ae=Me.expression;let $e=Me.typeAnnotation.start-2;while($e>=0&&!(s.source[$e]==="a"&&s.source[$e+1]==="s"))$e-=1;s.index=$e}}let _e=null,Ne,Le;if(s.eat("as"))s.requireWhitespace(),_e=Nn(s);if(s.allowWhitespace(),s.eat(",")){s.allowWhitespace();let Re=s.readIdentifierName();if(!Re.name)throw Error("sveld: expected an identifier");Ne=Re.name,s.allowWhitespace()}if(s.eat("("))s.allowWhitespace(),Le=It(s),s.allowWhitespace(),s.eat(")",!0),s.allowWhitespace();s.eat("}",!0);let Ie={type:"EachBlock",start:ve,end:-1,expression:Ae,body:qt(),context:_e,index:Ne,key:Le};s.append(Ie),s.push(Ie,Ie.body);return}if(s.eat("await")){s.requireWhitespace();let Ae=It(s);s.allowWhitespace();let _e={type:"AwaitBlock",start:ve,end:-1,expression:Ae,value:null,error:null,pending:null,then:null,catch:null};if(s.eat("then")){if(!s.matchRegex(lc))s.requireWhitespace(),_e.value=Nn(s),s.allowWhitespace();_e.then=qt()}else if(s.eat("catch")){if(!s.matchRegex(lc))s.requireWhitespace(),_e.error=Nn(s),s.allowWhitespace();_e.catch=qt()}else _e.pending=qt();s.eat("}",!0),s.append(_e),s.push(_e,_e.then??_e.catch??_e.pending);return}if(s.eat("key")){s.requireWhitespace();let Ae=It(s);s.allowWhitespace(),s.eat("}",!0);let _e={type:"KeyBlock",start:ve,end:-1,expression:Ae,fragment:qt()};s.append(_e),s.push(_e,_e.fragment);return}if(s.eat("snippet")){s.requireWhitespace();let Ae=s.readIdentifierName();if(Ae.name==="")throw Error("sveld: expected a snippet name");s.allowWhitespace();let _e;if(s.isTypeScript&&s.match("<")){let Le=s.index,Ie=yr(s,Le,yh);_e=s.source.slice(Le+1,Ie-1),s.index=Ie}if(s.allowWhitespace(),s.eat("(")){let Le=1;while(s.index<s.source.length&&(!s.match(")")||Le!==1)){if(s.match("("))Le++;if(s.match(")"))Le--;s.index+=1}s.eat(")",!0)}s.allowWhitespace(),s.eat("}",!0);let Ne={type:"SnippetBlock",start:ve,end:-1,expression:Ae,typeParams:_e,parameters:[],body:qt()};s.append(Ne),s.push(Ne,Ne.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function uc(s){let ve=s.index-1,Ae=s.current();if(Ae.type==="IfBlock"){if(!s.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(s.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(s.allowWhitespace(),s.fragments.pop(),Ae.alternate=qt(),s.fragments.push(Ae.alternate),s.eat("if")){s.requireWhitespace();let _e=It(s);s.allowWhitespace(),s.eat("}",!0);let Ne=ve-1;while(s.source[Ne]!=="{")Ne-=1;let Le={type:"IfBlock",start:Ne,end:-1,elseif:!0,test:_e,consequent:qt(),alternate:null};s.append(Le),s.stack.push(Le),s.fragments.pop(),s.fragments.push(Le.consequent)}else s.allowWhitespace(),s.eat("}",!0);return}if(Ae.type==="EachBlock"){if(!s.eat("else"))throw Error("sveld: expected {:else}");s.allowWhitespace(),s.eat("}",!0),Ae.fallback=qt(),s.fragments.pop(),s.fragments.push(Ae.fallback);return}if(Ae.type==="AwaitBlock"){if(s.eat("then")){if(Ae.then)throw Error("sveld: duplicate {:then}");if(!s.eat("}"))s.requireWhitespace(),Ae.value=Nn(s),s.allowWhitespace(),s.eat("}",!0);Ae.then=qt(),s.fragments.pop(),s.fragments.push(Ae.then);return}if(s.eat("catch")){if(Ae.catch)throw Error("sveld: duplicate {:catch}");if(!s.eat("}"))s.requireWhitespace(),Ae.error=Nn(s),s.allowWhitespace(),s.eat("}",!0);Ae.catch=qt(),s.fragments.pop(),s.fragments.push(Ae.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function fc(s){let ve=s.current();switch(ve.type){case"IfBlock":{s.eat("if",!0),s.allowWhitespace(),s.eat("}",!0);while(ve.type==="IfBlock"&&ve.elseif)ve.end=s.index,s.stack.pop(),ve=s.current();ve.end=s.index,s.pop();return}case"EachBlock":s.eat("each",!0);break;case"KeyBlock":s.eat("key",!0);break;case"AwaitBlock":s.eat("await",!0);break;case"SnippetBlock":s.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}s.allowWhitespace(),s.eat("}",!0),ve.end=s.index,s.pop()}var xh=/(?:let|const)\b/y,bh=/(?:var|interface|enum)\b/y,Eh=/type\b/y;function hc(s){let ve=s.index;if(s.matchRegex(bh))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!s.matchRegex(xh)&&!s.matchRegex(Eh))return null;let Ae=s.root.comments.length,_e=ja(s.source,ve,s.isTypeScript,s.root.comments);if(_e.type!=="VariableDeclaration"){if(_e.type==="ExpressionStatement")return s.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 s.index=_e.end,s.allowWhitespace(),s.eat("}",!0),_e}var Ch=/\s*}/y;function dc(s){let ve=s.index;while(s.source[ve]!=="{")ve-=1;if(s.eat("html")){s.requireWhitespace();let Ae=It(s);s.allowWhitespace(),s.eat("}",!0);let _e={type:"HtmlTag",start:ve,end:s.index,expression:Ae};s.append(_e);return}if(s.eat("debug")){let Ae;if(s.read(Ch))Ae=[];else{let Ne=It(s);Ae=Ne.type==="SequenceExpression"?Ne.expressions:[Ne];for(let Le of Ae)if(Le.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");s.allowWhitespace(),s.eat("}",!0)}let _e={type:"DebugTag",start:ve,end:s.index,identifiers:Ae};s.append(_e);return}if(s.eat("const")){s.requireWhitespace();let Ae=Nn(s);s.allowWhitespace(),s.eat("=",!0),s.allowWhitespace();let _e=It(s),Ne=s.index;s.allowWhitespace(),s.eat("}",!0);let Le={type:"VariableDeclarator",id:Ae,init:_e,start:Ae.start,end:Ne},Ie={type:"ConstTag",start:ve,end:s.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[Le],start:ve+2,end:s.index-1}};s.append(Ie);return}if(s.eat("render")){s.requireWhitespace();let Ae=It(s);if(!(Ae.type==="CallExpression"||Ae.type==="ChainExpression"&&Ae.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");s.allowWhitespace(),s.eat("}",!0);let Ne={type:"RenderTag",start:ve,end:s.index,expression:Ae};s.append(Ne);return}throw Error("sveld: expected html/debug/const/render")}function mc(s){let ve=s.index;if(s.index+=1,s.allowWhitespace(),s.eat("#")){pc(s);return}if(s.eat(":")){uc(s);return}if(s.eat("@")){dc(s);return}if(s.match("/")&&!s.match("/*")&&!s.match("//")){s.eat("/"),fc(s);return}let Ae=hc(s);if(Ae){let Le={type:"DeclarationTag",start:ve,end:s.index,declaration:Ae};s.append(Le);return}let _e=It(s);s.allowWhitespace(),s.eat("}",!0);let Ne={type:"ExpressionTag",start:ve,end:s.index,expression:_e};s.append(Ne)}function gc(s){let{index:ve,source:Ae}=s,_e=Ae.indexOf("<",ve),Ne=Ae.indexOf("{",ve),Le;if(_e===-1)Le=Ne===-1?Ae.length:Ne;else Le=Ne===-1?_e:Math.min(_e,Ne);s.index=Le;let Ie=Ae.slice(ve,Le),Re={type:"Text",start:ve,end:s.index,raw:Ie,data:Ie};s.append(Re)}function A(s){let ve=s.trimEnd(),Ae=new Ti(ve,s.length);while(Ae.index<Ae.source.length)if(Ae.match("<"))sc(Ae);else if(Ae.match("{"))mc(Ae);else gc(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=ic(Ne)}return Ae.root}function wt(s){return typeof s==="object"&&s!==null}function ne(s){return wt(s)&&s.type==="VariableDeclaration"&&Array.isArray(s.declarations)}function l(s){return wt(s)&&s.type==="Literal"}function a(s){return wt(s)&&s.type==="Identifier"&&typeof s.name==="string"}function se(s){return wt(s)&&s.type==="MemberExpression"}function En(s){return wt(s)&&s.type==="ObjectExpression"&&Array.isArray(s.properties)}function vh(s){return wt(s)&&s.type==="CallExpression"}function p(s,ve){if(!vh(s))return!1;return!!s.callee&&wt(s.callee)&&s.callee.type==="Identifier"&&s.callee.name===ve}function f(s){if(wt(s)&&(s.type==="TSAsExpression"||s.type==="TSSatisfiesExpression")&&"expression"in s)return f(s.expression);return s}function ie(s){if(wt(s)&&(s.type==="TSAsExpression"||s.type==="TSSatisfiesExpression")&&"typeAnnotation"in s)return s.typeAnnotation;return}function Sh(s){return wt(s)&&s.type==="NewExpression"}function ki(s,ve){if(!Sh(s))return!1;return!!s.callee&&wt(s.callee)&&s.callee.type==="Identifier"&&s.callee.name===ve}function Zr(s){if(!wt(s)||typeof s.type!=="string")return null;if(s.type==="Literal"){let ve=s.value;if(typeof ve==="string")return ve;return ve==null?null:String(ve)}if(s.type==="TemplateLiteral"){let ve=s.quasis;if(ve?.length===1){let Ae=ve[0]?.value?.cooked;return Ae==null?null:Ae}}return null}var y=Symbol("sveld.parsedComponentTypeScriptMetadata");function Yn(s){return s[y]}function yc(s,ve){if(ve.length===0)return;let Ae=new Set(s.props.map((_e)=>_e.name));for(let _e of ve){if(Ae.has(_e.name))continue;Ae.add(_e.name),s.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 Th=/\w/;function Ah(s,ve){let Ae=s.trim();if(!Ae.startsWith("{")||!Ae.endsWith("}"))return;let _e=Ae.slice(1,-1),Ne=[],Le=0,Ie="";for(let Re of _e)if(Re==="{"||Re==="<"||Re==="("||Re==="[")Le++,Ie+=Re;else if(Re==="}"||Re===">"||Re===")"||Re==="]")Le--,Ie+=Re;else if((Re===";"||Re===",")&&Le===0)Ne.push(Ie.trim()),Ie="";else Ie+=Re;if(Ie.trim())Ne.push(Ie.trim());for(let Re of Ne){if(!Re.startsWith(ve))continue;let Me=Re.slice(ve.length);if(Me.length>0&&Th.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 B(s,ve,Ae){let _e=Ae;if(_e.computed||_e.object?.type!=="Identifier"||_e.property?.type!=="Identifier")return;let Ne=_e.object.name,Le=_e.property.name;if(!Ne||!Le)return;if(s.wholePropsLocals.has(Ne))return ve.getPropTypeByLocalOrPublic(Le);let Ie=ve.getPropTypeByLocalOrPublic(Ne)??ve.findVariableTypeAndDescription(Ne)?.type;if(!Ie)return;return Ah(Ie,Le)}function kh(s){let ve="";for(let Ae=0;Ae<s.length;Ae++){let _e=s[Ae];if(_e==="*"&&s[Ae+1]==="*"){if(ve+=".*",Ae++,s[Ae+1]==="/")Ae++;continue}if(_e==="*"){ve+="[^/]*";continue}if(_e==="?"){ve+="[^/]";continue}ve+=".+^$()[]{}|\\".includes(_e)?`\\${_e}`:_e}return ve}function xc(s,ve){return new RegExp(`^${kh(s)}$`).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"},wh={"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 In(s){return{...s,code:j[s.kind],severity:wh[s.kind]}}function J(s,ve){if(ve)return s;return s.filter((Ae)=>Ae.kind!=="jsdoc-unknown-tag")}function F(s,ve){if(!ve)return[];return s.filter((Ae)=>!Ae.ignored&&(ve!=="errors"||Ae.severity==="error"))}function Ph(s,ve){if(ve.code!==void 0&&ve.code!==s.code)return!1;if(ve.name!==void 0&&ve.name!==s.name)return!1;if(ve.component!==void 0&&!xc(ve.component,s.component))return!1;return!0}function bc(s,ve){if(!ve||ve.length===0)return s;return s.map((Ae)=>Ae.ignored||ve.some((_e)=>Ph(Ae,_e))?{...Ae,ignored:!0}:Ae)}var _h={"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"},Nh=["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 es(s){let ve=new Set,Ae=[];for(let _e of s){let Ne=`${_e.component}:${_e.kind}:${_e.name}`;if(ve.has(Ne))continue;ve.add(Ne),Ae.push(_e)}return Ae}function q(s){let ve=s.filter((Ie)=>!Ie.ignored),Ae=s.length-ve.length,_e=Ae>0?` (${Ae} ignored)`:"";if(ve.length===0)return`sveld: all types resolved${_e}.`;let Ne=[],Le=ve.length;Ne.push(`sveld: ${Le} unresolved type${Le===1?"":"s"} found${_e}.`);for(let Ie of Nh){let Re=ve.filter(($e)=>$e.kind===Ie);if(Re.length===0)continue;Ne.push(""),Ne.push(`${_h[Ie]} (${Re.length}):`);let Me=new Map;for(let $e of Re){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 V(s){return`${JSON.stringify({kind:"diagnostics",schemaVersion:oe,diagnostics:s},null,2)}
|
|
17
|
-
`}function n(s,ve,Ae,_e,Ne){s.diagnosticRecords.push(In({component:s.componentFilePath,kind:ve,name:Ae,message:_e,...Ne?{source:Ne}:{},...Ih(s,ve,Ae)?{ignored:!0}:{}}))}function Ec(s,ve){return`${s}:${ve}`}function d(s,ve,Ae,_e){if(!_e||_e.length===0)return;let Ne=Ec(ve,Ae),Le=s.sveldIgnoreDirectives.get(Ne)??new Set;for(let Ie of _e)Le.add(Ie);s.sveldIgnoreDirectives.set(Ne,Le)}function Ih(s,ve,Ae){let _e=s.sveldIgnoreDirectives.get(Ec(ve,Ae));if(!_e)return!1;return _e.has("")||_e.has(j[ve])}var wi=/[\r\n]+/g;function Dh(s){if(s.sourceLineStartOffsetsCache)return s.sourceLineStartOffsetsCache;let ve=[0];if(s.source){let Ae=s.source.indexOf(`
|
|
18
|
-
`);while(Ae!==-1)ve.push(Ae+1),Ae=s.source.indexOf(`
|
|
19
|
-
`,Ae+1)}return s.sourceLineStartOffsetsCache=ve,ve}function Cc(s,ve){if(!s.source||ve<0||ve>s.source.length)return;let Ae=Dh(s),_e=s.sourceLineHint;if(_e!==void 0)for(let Ie=_e;Ie<=_e+1&&Ie<Ae.length;Ie++){let Re=Ae[Ie],Me=Ae[Ie+1]??Number.POSITIVE_INFINITY;if(ve>=Re&&ve<Me)return s.sourceLineHint=Ie,{line:Ie+1,column:ve-Re}}let Ne=0,Le=Ae.length-1;while(Ne<=Le){let Ie=Ne+Le>>>1,Re=Ae[Ie],Me=Ae[Ie+1]??Number.POSITIVE_INFINITY;if(ve<Re)Le=Ie-1;else if(ve>=Me)Ne=Ie+1;else return s.sourceLineHint=Ie,{line:Ie+1,column:ve-Re}}return}function U(s,ve,Ae){if(ve===void 0||Ae===void 0||Ae<ve)return;let _e=Cc(s,ve),Ne=Cc(s,Ae);if(!_e||!Ne)return;return{start:_e,end:Ne}}function t(s,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 U(s,Ae,_e)}function an(s,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??""}`),Le=_e.start+Math.max(Ne,0),Ie=Ae[Ae.length-1],Re=Ie.start+Ie.raw.length;return U(s,Le,Re)}function r(s,ve,Ae){return s.source?.slice(ve,Ae)}function ts(s,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(s,Ae,_e)?.replace(wi," ")}function u(s){return s===void 0||s===""?void 0:s}class ns{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:(s)=>this.replacement=s}}replace(s,ve,Ae,_e){if(s&&ve)if(Ae!=null)s[ve][Ae]=_e;else s[ve]=_e}remove(s,ve,Ae){if(s&&ve)if(Ae!==null&&Ae!==void 0)s[ve].splice(Ae,1);else delete s[ve]}}class Pi extends ns{constructor(s,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=s,this.leave=ve}visit(s,ve,Ae,_e){if(s){if(this.enter){let Le=this.should_skip,Ie=this.should_remove,Re=this.replacement;if(this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,s,ve,Ae,_e),this.replacement)s=this.replacement,this.replace(ve,Ae,_e,s);if(this.should_remove)this.remove(ve,Ae,_e);let Me=this.should_skip,$e=this.should_remove;if(this.should_skip=Le,this.should_remove=Ie,this.replacement=Re,Me)return s;if($e)return null}let Ne;for(Ne in s){let Le=s[Ne];if(Le&&typeof Le==="object"){if(Array.isArray(Le)){let Ie=Le;for(let Re=0;Re<Ie.length;Re+=1){let Me=Ie[Re];if(vc(Me)){if(!this.visit(Me,s,Ne,Re))Re--}}}else if(vc(Le))this.visit(Le,s,Ne,null)}}if(this.leave){let Le=this.replacement,Ie=this.should_remove;if(this.replacement=null,this.should_remove=!1,this.leave.call(this.context,s,ve,Ae,_e),this.replacement)s=this.replacement,this.replace(ve,Ae,_e,s);if(this.should_remove)this.remove(ve,Ae,_e);let Re=this.should_remove;if(this.replacement=Le,this.should_remove=Ie,Re)return null}}return s}}function vc(s){return s!==null&&typeof s==="object"&&"type"in s&&typeof s.type==="string"}function C(s,{enter:ve,leave:Ae}){return new Pi(ve,Ae).visit(s,null)}function L(s,ve,Ae,_e){if(u(Ae)===void 0)return;if(s.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 m(s,ve,Ae,_e=0){let Ne,Le,Ie=!1;if(!Ae||typeof Ae!=="object"||!("type"in Ae))return{value:Ne,type:Le,isFunction:Ie};let Re=Tc(s,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(wi," ");if(Le=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")Le="string"}if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression")Le=wc(Ae),Ne=Sc(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")Le=m(s,ve,Me.argument).type;else if(typeof Me.argument==="object"&&"value"in Me.argument)Le=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")Le="Date";else if($e==="Map")Le="Map<any, any>";else if($e==="Set")Le="Set<any>";else if($e==="WeakMap")Le="WeakMap<object, any>";else if($e==="WeakSet")Le="WeakSet<object>";else if($e==="Array")Le="any[]";else if($e==="RegExp"||$e==="Regexp")Le="RegExp";else if($e==="Error")Le="Error";else Le=$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{...m(s,ve,Me.arguments[0],_e+1),value:Ne,defaultValue:Re};if(Be){let Ve=Rh(s,ve,Be);if(Ve)return{value:Ne,type:void 0,isFunction:!1,defaultValue:Re,resolvedType:Ve};if(ve.funcDecls.has(Be)||Oh(ve,Be))return{value:Ne,type:void 0,isFunction:!1,defaultValue:Re,pendingCallDefault:{calleeName:Be}};let Ue=ve.valueImportBindingsByLocalName.get(Be);if(Ue)return{value:Ne,type:void 0,isFunction:!1,defaultValue:Re,pendingCallDefault:{calleeName:Be,importSource:Ue.source,importedName:Ue.importedName}}}return{value:Ne,type:void 0,isFunction:!1,defaultValue:Re,pendingCallDefault:{calleeName:Be??Lh(ve,$e)}}}else if(Ae.type==="Identifier"){let Me=Ae;if(_e<5){let $e=Ac(ve,Me.name);if($e){let Be=m(s,ve,$e,_e+1),Ve=s.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=s.resolveLocalVarJSDoc(Me.name),Ve=ve.funcDecls.get(Me.name);return{value:Ve?Sc(ve,Ve):void 0,type:void 0,isFunction:!0,defaultValue:Ve?Tc(s,ve,Ve):void 0,resolvedType:Be?.type??Fh(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(s.isNumericConstant(Ae))Le="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);Le="string"}else if("raw"in Ae&&typeof Ae.raw==="string"){if(Ne=Ae.raw,"value"in Ae)Le=Ae.value==null?void 0:typeof Ae.value}return{value:Ne,type:Le,isFunction:Ie,defaultValue:Re}}function Ac(s,ve){for(let Ae of s.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 xr(s,ve){for(let Ae of s.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 Lh(s,ve){if(ve&&typeof ve==="object"&&"start"in ve&&"end"in ve&&typeof ve.start==="number"&&typeof ve.end==="number")return r(s,ve.start,ve.end)??"call";return"call"}function Rh(s,ve,Ae){let _e=s.resolveLocalVarJSDoc(Ae);if(_e?.returnType)return _e.returnType;let Ne=ve.funcDecls.get(Ae)??kc(ve,Ae);if(!Ne)return;let Le=$h(ve,Ne);if(Le)return Le;let Ie=Mh(ve,Ae);if(Ie)return Ie;let Re=Pc(Ne);return Re==="any"?void 0:Re}function Oh(s,ve){return kc(s,ve)!==void 0}function kc(s,ve){let Ae=Ac(s,ve);if(!Ae||typeof Ae!=="object"||!("type"in Ae))return;if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression")return Ae;return}function Mh(s,ve){for(let Ae of s.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 Le=Ne.typeAnnotation;if(Le?.type!=="TSTypeAnnotation")return;let Ie=Le.typeAnnotation;if(!Ie||typeof Ie.start!=="number"||typeof Ie.end!=="number")return;return Bh(r(s,Ie.start,Ie.end))}return}function Bh(s){if(!s)return;let ve=s.lastIndexOf("=>");if(ve===-1)return;return s.slice(ve+2).trim()||void 0}function $h(s,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(s,_e.start,_e.end)}function Fh(s,ve){let Ae=s?.returnType??"any",_e=s?.params;if(_e&&_e.length>0)return`(${_e.map((Le)=>`${Le.name}${Le.optional?"?":""}: ${Le.type}`).join(", ")}) => ${Ae}`;if(s?.returnType)return`() => ${Ae}`;if(ve)return wc(ve);return"(...args: any[]) => any"}function wc(s){return`(${jh(s)}) => ${Pc(s)}`}function jh(s){let ve=s.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 Pc(s){if(s.async||s.generator)return"any";let ve=s.body,Ae;if(ve&&typeof ve==="object"&&"type"in ve&&ve.type==="BlockStatement"){if(Ae=Vh(ve),Ae.length===0)return"any"}else Ae=[ve];let _e=null;for(let Ne of Ae){let Le=qh(Ne);if(!Le)return"any";if(_e===null)_e=Le;else if(_e!==Le)return"any"}return _e??"any"}function Vh(s){let ve=[];return C(s,{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 qh(s){if(!s||typeof s!=="object"||!("type"in s))return null;switch(s.type){case"Literal":{let ve=s.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=s.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(s){if(p(s,"$bindable"))return{init:s.arguments[0],bindable:!0};return{init:s,bindable:!1}}function Uh(s,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(s,_e.start,Ne.end)??""}function Sc(s,ve){if(ve.generator)return;let Ae=ve.body;if(!Ae||typeof Ae!=="object"||!("type"in Ae))return;let _e=Uh(s,ve),Ne=ve.async?"async ":"",Le=(Re,Me)=>Re&&typeof Re==="object"&&("type"in Re)&&Re.type==="ObjectExpression"?`(${Me})`:Me;if(Ae.type!=="BlockStatement"){let Re=ts(s,Ae);return Re===void 0?void 0:`${Ne}(${_e}) => ${Le(Ae,Re)}`}let Ie=Ae.body;if(Ie.length===0)return`${Ne}(${_e}) => {}`;if(Ie.length===1){let Re=Ie[0];if(Re&&typeof Re==="object"&&"type"in Re&&Re.type==="ReturnStatement"){let Me=Re.argument;if(Me){let $e=ts(s,Me);if($e!==void 0)return`${Ne}(${_e}) => ${Le(Me,$e)}`}}}return}function Tc(s,ve,Ae){let _e=ts(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 Le={raw:_e,kind:Ne};if(Ne==="literal"||Ne==="array"||Ne==="object"){let Ie=_i(s,Ae);if(Ie.ok)Le.value=Ie.value}return Le}function _i(s,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 Le=_i(s,Ne);if(!Le.ok)return{ok:!1};_e.push(Le.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 Le=s.getPropertyName(Ne.key);if(!Le)return{ok:!1};let Ie=_i(s,Ne.value);if(!Ie.ok)return{ok:!1};_e[Le]=Ie.value}return{ok:!0,value:_e}}return{ok:!1}}function Gh(s){let ve=[],Ae=0,_e=0;for(let Ne=0;Ne<s.length;Ne++){let Le=s[Ne];if(Le==="<"||Le==="("||Le==="["||Le==="{")Ae++;else if(Le===">"||Le===")"||Le==="]"||Le==="}")Ae=Math.max(Ae-1,0);else if(Ae===0&&(Le===";"||Le===","))ve.push(s.slice(_e,Ne)),_e=Ne+1}return ve.push(s.slice(_e)),ve}function Wh(s){let ve=0;for(let Ae=0;Ae<s.length;Ae++){let _e=s[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 Hh=/^\{([\s\S]*)\}$/,Kh=/^[A-Za-z_$][\w$]*$/;function rs(s){let ve=s.trim(),Ae=Hh.exec(ve);if(!Ae)return null;let _e=Ae[1].trim();if(_e==="")return[];let Ne=[];for(let Le of Gh(_e)){let Ie=Le.trim();if(!Ie)continue;let Re=Wh(Ie);if(Re===-1)return null;let Me=Ie.slice(0,Re).trim(),$e=Ie.slice(Re+1).trim();if(!$e)return null;let Be=!1;if(Me.endsWith("?"))Be=!0,Me=Me.slice(0,-1).trim();if(!Kh.test(Me))return null;Ne.push({name:Me,type:$e,optional:Be})}return Ne}function zh(s,ve,Ae,_e){if(!a(Ae))return null;let Ne=xr(s,Ae.name);if(En(Ne))return Ic(s,ve,Ne,_e).properties;let Le=ve.findVariableTypeAndDescription(Ae.name);if(!Le)return null;let Ie=rs(Le.type);if(!Ie)return null;return Ie.map((Re)=>({name:Re.name,type:Re.type,optional:Re.optional}))}function Ic(s,ve,Ae,_e){let Ne=[],Le=!1;for(let Ie of Ae.properties){if(Ie.type==="SpreadElement"){let Ve=zh(s,ve,Ie.argument,_e);if(Ve)Ne.push(...Ve);else Le=!0,n(s,"spread-unresolved",_e,`Context "${_e}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(s,Ie));continue}if(Ie.type!=="Property")continue;let Re=ve.getPropertyName(Ie.key);if(!Re)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(s,"context-any-type",Re,`Context "${_e}" property "${Re}" has no type annotation; defaulted to "any".`,t(s,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((We)=>{if(a(We))return`${We.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(l(Ie.value))Me=Ie.value.value==null?"null":typeof Ie.value.value;Ne.push({name:Re,type:Me,description:$e,optional:!1,...Be?{internal:!0}:{}})}return{properties:Ne,hasUnresolvedSpread:Le}}var Xh=/[-_.:/\s]+/;function br(s){return`${s.split(Xh).map((_e)=>_e.charAt(0).toUpperCase()+_e.slice(1)).join("")}Context`}function _c(s,ve,Ae,_e){if(!Ae||typeof Ae!=="object"||!("type"in Ae))return null;if(Ae.type==="ObjectExpression"){if(!En(Ae))return null;let{properties:Ne,hasUnresolvedSpread:Le}=Ic(s,ve,Ae,_e);return{key:_e,typeName:br(_e),properties:Ne,description:void 0,...Le?{hasUnresolvedSpread:Le}:{}}}else if(a(Ae)){let Ne=Ae.name,Le=ve.findVariableTypeAndDescription(Ne);if(Le)return{key:_e,typeName:br(_e),properties:[{name:Ne,type:Le.type,description:Le.description,optional:!1}],description:void 0,...Le.internal?{internal:!0}:{}};return n(s,"context-any-type",Ne,`Context "${_e}" variable "${Ne}" has no type annotation; defaulted to "any".`,t(s,Ae)),{key:_e,typeName:br(_e),properties:[{name:Ne,type:"any",description:void 0,optional:!1}]}}return null}function Nc(s){let ve=s.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=s.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 Dc(s,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=Zr(_e);return Ne==null?{kind:"unresolved"}:{kind:"resolved",key:Ne}}if(_e.type==="CallExpression"||_e.type==="NewExpression"){let Ne=Nc(_e);return Ne==null?{kind:"unresolved"}:{kind:"resolved",key:Ne}}if(_e.type==="Identifier"){if(Ae>=5)return{kind:"unresolved"};let Ne=xr(s,_e.name);if(Ne&&typeof Ne==="object"&&"type"in Ne){let Ie=Ne;if((Ie.type==="CallExpression"||Ie.type==="NewExpression")&&Nc(Ie)==="")return{kind:"resolved",key:_e.name};return Dc(s,Ie,Ae+1)}let Le=s.valueImportBindingsByLocalName.get(_e.name);if(Le)return{kind:"pending",importSource:Le.source,importedName:Le.importedName};return{kind:"unresolved"}}return{kind:"unresolved"}}function ce(s,ve,Ae,_e){if(!Ae||typeof Ae!=="object"||!("type"in Ae)||Ae.type!=="CallExpression")return;let Ne=Ae,Le=Ne.arguments[0];if(!Le)return;let Ie=Dc(s,Le);if(Ie.kind==="unresolved"||Ie.kind==="resolved"&&!Ie.key){let Ve=s.componentFilePath?` in ${s.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 Re=Ne.arguments[1];if(!Re)return;let Me=t(s,Ae);if(Ie.kind==="pending"){let Ve=_c(s,ve,Re,"");if(Ve)s.pendingContextKeyCandidates.push({importSource:Ie.importSource,importedName:Ie.importedName,properties:Ve.properties,description:Ve.description,source:Me});return}let $e=Ie.key,Be=_c(s,ve,Re,$e);if(!Be)return;if(s.contexts.has($e)){n(s,"context-duplicate-key",$e,`setContext("${$e}", ...) was called more than once; only the first call's shape is used.`,Me);return}s.contexts.set($e,{...Be,source:Me})}function ue(s,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return;if(En(ve))return Rc(s,ve);if(ve.type==="ArrayExpression")return Oc(s,ve);return}function Lc(s,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return"any";if(a(ve))return s.findVariableTypeAndDescription(ve.name)?.type??"any";if(l(ve)){let Ae=ve.value;return Ae===null?"null":typeof Ae}if(En(ve))return Rc(s,ve);if(ve.type==="ArrayExpression")return Oc(s,ve);return"any"}function Rc(s,ve){let Ae=[];for(let _e of ve.properties){if(_e.type!=="Property"||_e.computed)continue;let Ne=s.getPropertyName(_e.key);if(!Ne)continue;Ae.push({name:Ne,type:Lc(s,_e.value)})}return ss(Ae)}function Oc(s,ve){let Ae=new Set(ve.elements.filter((_e)=>_e!=null).map((_e)=>Lc(s,_e)));if(Ae.size===0)return"any[]";if(Ae.size===1)return`${[...Ae][0]}[]`;return`(${[...Ae].join(" | ")})[]`}function z(s){return typeof s==="string"?JSON.stringify(s):String(s)}function h(s,{name:ve,detail:Ae,has_argument:_e,description:Ne,deprecated:Le,tags:Ie,internal:Re,source:Me}){if(ve===void 0)return;let $e=!_e&&!Ae?"null":u(Ae),Be=Ne,Ve=s.events.get(ve);if(Ve?.type==="forwarded")s.events.set(ve,{type:"dispatched",name:ve,detail:$e,description:Be||Ve.description,deprecated:Le??Ve.deprecated,tags:Ie??Ve.tags,...Re||Ve.internal?{internal:!0}:{},source:Me||Ve.source});else if(Ve){let Ue=Ve.tags??Ie;s.events.set(ve,{...Ve,detail:Ve.detail===void 0?$e:Ve.detail,description:Ve.description||Be,deprecated:Ve.deprecated??Le,tags:Ue,...Ve.internal||Re?{internal:!0}:{},source:Me||Ve.source})}else s.events.set(ve,{type:"dispatched",name:ve,detail:$e,description:Be,deprecated:Le,tags:Ie,...Re?{internal:!0}:{},source:Me})}function pe(s,ve){let Ae=ve.arguments[0],_e=ki(Ae,"CustomEvent");if(!_e&&!ki(Ae,"Event"))return;let Ne=Ae.arguments[0],Le=l(Ne)?Ne.value:void 0;if(Le==null)return;let Ie=_e?Ae.arguments[1]:void 0,Re=!1,Me;if(En(Ie)){let $e=Ie.properties.find((Be)=>Be.type==="Property"&&a(Be.key)&&Be.key.name==="detail");if($e?.type==="Property")Re=!0,Me=l($e.value)?$e.value.value:void 0}return h(s,{name:String(Le),detail:Me==null?"":z(Me),has_argument:Re,source:t(s,ve)}),String(Le)}function ss(s,ve,Ae=!1){if(s.length===0)return"null";let _e=s.map(({name:Ne,type:Le,description:Ie,optional:Re,default:Me})=>{let $e=Re?"?":"",Be=Ie||"";if(Me&&Be)Be=`${Be} @default ${Me}`;else if(Me)Be=`@default ${Me}`;if(Be){if(Ae)return`/** ${Be} */
|
|
20
|
-
${Ne}${$e}: ${Le};`;return`/** ${Be} */ ${Ne}${$e}: ${Le};`}return`${Ne}${$e}: ${Le};`}).join(Ae?`
|
|
21
|
-
`:" ");return Ae?`{
|
|
22
|
-
${_e}
|
|
23
|
-
}`:`{ ${_e} }`}var Jh=/[A-Za-z_$][\w$]*/g;function Yh(s,ve){if(!ve)return!1;let Ae=new Set(ve[0].split(",").map((_e)=>_e.trim()));for(let[_e]of s.matchAll(Jh))if(Ae.has(_e))return!0;return!1}function X(s,ve){if(ve===void 0)return;return s.runesPropsDeclarationMetadataByDeclaratorStart.get(ve)}function le(s,ve,Ae){return X(s,ve)?.props.get(Ae)}function fe(s){if(!s||typeof s!=="object"||!("type"in s))return;if(s.type==="Identifier"&&"name"in s&&typeof s.name==="string")return s.name;if(s.type==="TSQualifiedName"&&"right"in s&&s.right&&typeof s.right==="object"&&"name"in s.right&&typeof s.right.name==="string")return s.right.name;return}function Mc(s){if(!s||typeof s!=="object"||!("type"in s))return;if(s.type==="Identifier"&&"name"in s&&typeof s.name==="string")return s.name;if(s.type==="TSQualifiedName"&&"left"in s&&s.left&&typeof s.left==="object")return Mc(s.left);return}function x(s,ve){let Ae=ve?.start,_e=ve?.end;if(Ae===void 0||_e===void 0)return;return r(s,Ae+1,_e)?.trim()}function de(s,ve){let Ae=ve?.start,_e=ve?.end;if(Ae===void 0||_e===void 0)return;return r(s,Ae,_e)?.trim()}function c(s,ve,Ae,_e,Ne=new Set){if(!ve?.type)return;switch(ve.type){case"TSInterfaceDeclaration":c(s,{type:"TSTypeLiteral",members:ve.body?.body},Ae,_e,Ne);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":c(s,ve.typeAnnotation,Ae,_e,Ne);return;case"TSIntersectionType":case"TSUnionType":for(let Le of ve.types??[])c(s,Le,Ae,_e,Ne);return;case"TSTypeLiteral":for(let Le of ve.members??[]){if(Le?.type!=="TSPropertySignature")continue;c(s,Le.typeAnnotation?.typeAnnotation,Ae,_e,Ne)}return;case"TSTypeReference":{let Le=Mc(ve.typeName);if(Le){if(s.typeImportBindingsByLocalName.has(Le)||s.valueImportBindingsByLocalName.has(Le))Ae.add(Le);let Ie=s.localTypeDeclarationsByName.get(Le);if(Ie&&!Ne.has(Le))_e.add(Le),Ne.add(Le),c(s,Ie.node,Ae,_e,Ne),Ne.delete(Le)}if("typeParameters"in ve&&ve.typeParameters&&typeof ve.typeParameters==="object"){let Ie=ve.typeParameters;for(let Re of Ie.params??[])c(s,Re,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 Le of Object.values(ve)){if(!Le||typeof Le!=="object")continue;if(Array.isArray(Le)){for(let Ie of Le){if(!Ie||typeof Ie!=="object"||!("type"in Ie))continue;c(s,Ie,Ae,_e,Ne)}continue}if("type"in Le)c(s,Le,Ae,_e,Ne)}}function Qh(s,ve){let Ae=new Map;for(let _e of Array.from(ve).sort()){let Ne=s.typeImportBindingsByLocalName.get(_e),Le=Ne?void 0:s.valueImportBindingsByLocalName.get(_e),Ie=Ne??(Le?{importedName:Le.importedName,localName:Le.localName,source:Le.source,specifierType:"named"}:void 0);if(!Ie)continue;let Re=Ae.get(Ie.source)??{default:[],named:[],namespace:[]};if(Ie.specifierType==="default")Re.default.push(Ie.localName);else if(Ie.specifierType==="namespace")Re.namespace.push(Ie.localName);else Re.named.push({imported:Ie.importedName,local:Ie.localName});Ae.set(Ie.source,Re)}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 Le=Ne.named.map(({imported:Me,local:$e})=>{if(!Me||Me===$e)return $e;return`${Me} as ${$e}`}),Ie=Ne.default[0],Re=Le.length>0?`{ ${Le.join(", ")} }`:"";if(Ie&&Re)return`import type ${Ie}, ${Re} from "${_e}";`;if(Ie)return`import type ${Ie} from "${_e}";`;return`import type ${Re} from "${_e}";`})}function P(s,ve){if(ve)s.additionalTypeDependencyNodes.push(ve)}function Zh(s){if(!s.const)return;let ve=s.id?.name;if(!ve)return;let Ae=[];for(let _e of s.members??[]){let Ne=_e.initializer;if(Ne?.type!=="Literal")return;let Le=Ne.value;if(typeof Le==="string")Ae.push(JSON.stringify(Le));else if(typeof Le==="number")Ae.push(String(Le));else return}if(Ae.length===0)return;return`type ${ve} = ${Ae.join(" | ")};`}function me(s,ve){let Ae=Zh(ve);if(Ae)return Ae;if(ve.start===void 0||ve.end===void 0)return;let _e=r(s,ve.start,ve.end)?.trim();return _e?`declare ${_e}`:void 0}function Q(s,ve){let Ae=!1,_e=[];for(let Le of ve.params??[]){if(Le.type==="RestElement"){let Ve=Le.argument?.name??"rest",Ue=x(s,Le.typeAnnotation);if(Ue)Ae=!0;P(s,Le.typeAnnotation?.typeAnnotation),_e.push(`...${Ve}: ${Ue??"any[]"}`);continue}let Ie=Le.type==="AssignmentPattern",Re=Ie?Le.left:Le,Me=Re?.name??"arg",$e=x(s,Re?.typeAnnotation);if($e)Ae=!0;P(s,Re?.typeAnnotation?.typeAnnotation);let Be=Ie||Le.optional===!0;_e.push(`${Me}${Be?"?":""}: ${$e??"any"}`)}let Ne=x(s,ve.returnType);if(Ne)Ae=!0;return P(s,ve.returnType?.typeAnnotation),{signature:`(${_e.join(", ")}) => ${Ne??"any"}`,hasAnnotations:Ae}}function he(s){let ve=s.pendingCallDefaultCandidates.length>0?s.pendingCallDefaultCandidates.slice():void 0,Ae=s.pendingContextKeyCandidates.length>0?s.pendingContextKeyCandidates.slice():void 0,_e={...ve?{pendingCallDefaultCandidates:ve}:{},...Ae?{pendingContextKeyCandidates:Ae}:{}},Ne=ve!==void 0||Ae!==void 0,Le=new Set,Ie=new Set;for(let Be of s.additionalTypeDependencyNodes)c(s,Be,Le,Ie);let Re=s.typedRunesPropsDeclarations.length===1?s.typedRunesPropsDeclarations[0]:void 0,Me=Re?.canonicalType;if(Re&&Me){for(let Be of Re.referencedImportedTypes)Le.add(Be);for(let Be of Re.referencedLocalTypes)Ie.add(Be)}if(!Me&&Le.size===0&&Ie.size===0)return Ne?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],..._e}:void 0;let $e=Array.from(Ie).map((Be)=>s.localTypeDeclarationsByName.get(Be)).filter((Be)=>Be!==void 0).sort((Be,Ve)=>Be.start-Ve.start).map((Be)=>Be.code);return{...Me?{canonicalPropsType:Me}:{},canonicalPropNames:Re&&Me?Array.from(Re.props.keys()).sort():[],localTypeDeclarations:$e,typeImportStatements:Qh(s,Le),referencesComponentGenerics:Me?Yh(Me,s.generics):!1,..._e}}var ed=/^[A-Za-z_$][\w$]*/,td=/[A-Za-z_$][\w$]*/g,Bc=/^(?:const|in|out)\s+/;function fn(s){let ve=[],Ae=0,_e=0;for(let Ne=0;Ne<s.length;Ne++){let Le=s[Ne];if(Le==="<"||Le==="("||Le==="["||Le==="{")Ae++;else if(Le===">"||Le===")"||Le==="]"||Le==="}")Ae=Math.max(Ae-1,0);else if(Le===","&&Ae===0)ve.push(s.slice(_e,Ne)),_e=Ne+1}return ve.push(s.slice(_e)),ve}function ge(s){let ve=fn(s).map((_e)=>_e.trim()).filter((_e)=>_e.length>0);if(ve.length===0)return null;return[ve.map((_e)=>{let Ne=_e;while(Bc.test(Ne))Ne=Ne.replace(Bc,"");return Ne.match(ed)?.[0]??_e}).join(", "),ve.join(", ")]}function ye(s,ve,Ae){let _e=s.scriptGenericsAttribute?.value;if(!_e)return;for(let[Ne]of _e.matchAll(td)){if(s.typeImportBindingsByLocalName.has(Ne))ve.add(Ne);if(Ae.has(Ne))continue;let Le=s.localTypeDeclarationsByName.get(Ne);if(!Le)continue;Ae.add(Ne),c(s,Le.node,ve,Ae)}}var nd=null;function rd(s,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=B(s,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(s,Ae.start,Ae.end);return _e}function sd(s,ve,Ae){if(!a(Ae))return null;let _e=xr(s,Ae.name);if(En(_e))return Y(s,ve,_e).slot_props;let Ne=ve.findVariableTypeAndDescription(Ae.name);if(!Ne)return null;let Le=rs(Ne.type);if(!Le)return null;let Ie={};for(let Re of Le)Ie[Re.name]={value:Re.type,replace:!1};return Ie}function Y(s,ve,Ae){let _e={},Ne=!1;for(let Le of Ae.properties){if(Le.type==="SpreadElement"){let Re=sd(s,ve,Le.argument);if(Re)Object.assign(_e,Re);else Ne=!0,n(s,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(s,Le));continue}if(Le.type!=="Property"||Le.computed)continue;let Ie=ve.getPropertyName(Le.key);if(!Ie)continue;_e[Ie]=rd(s,ve,Le.value)}return{slot_props:_e,hasUnresolvedSpread:Ne}}function id(s,ve){if(!ve||typeof ve!=="object"||!("type"in ve))return null;if(ve.type==="Identifier"){let Le=ve,Ie=s.propLocalToPublicName.get(Le.name);if(!Ie)return null;return{publicName:Ie,trackingName:Le.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||!s.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(s,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=id(s,_e.callee);if(!Ne)return null;return{...Ne,arguments:_e.arguments}}function R(s,{slot_name:ve,slot_props:Ae,slot_props_unresolved_spread:_e,slot_fallback:Ne,slot_description:Le,slot_deprecated:Ie,slot_tags:Re,slot_internal:Me,source:$e}){let Be=ve===void 0||ve==="",Ve=Be?nd:ve??"",Ue=u(Ne),We=Ae===void 0||Ae===""?void 0:Ae,Ke=Le?.trim()||void 0;if(s.slots.has(Ve)){let Je=s.slots.get(Ve);if(Je)s.slots.set(Ve,{...Je,default:Je.default??Be,fallback:Ue,slot_props:Je.slot_props===void 0?We:Je.slot_props,slot_props_unresolved_spread:Je.slot_props_unresolved_spread||_e,description:Je.description||Ke,deprecated:Je.deprecated??Ie,tags:Je.tags||Re,...Je.internal||Me?{internal:!0}:{},source:$e||Je.source})}else s.slots.set(Ve,{name:Ve,default:Be,fallback:Ue,slot_props:We,slot_props_unresolved_spread:_e,description:Ke,deprecated:Ie,tags:Re,...Me?{internal:!0}:{},source:$e})}var Ni=/^\s+/,Fc=/\s/,od=/^@[^\s/]+(?=\s|$)/,ad=/^@(\S+)\s*/;function $c(s){let ve=0;while(ve<s.length){let Ae=s.charCodeAt(ve);if(Ae!==32&&Ae!==9&&Ae!==13&&Ae!==10&&!Fc.test(s[ve]))break;ve++}return ve}function cd(s,ve){let Ae=s.slice($c(s)),_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,$c(Ae));Ae=Ae.slice(Ne.length);let Le=Ae.trimEnd(),Ie=Le.endsWith("*/")?Le.slice(0,-2):Ae;return{indent:_e?Ne.slice(1):Ne,separator:Ne,content:Ie}}function ld(s,ve,Ae){let _e=Ae>ve&&s.charCodeAt(Ae-1)===13?Ae-1:Ae;return s.slice(ve,_e)}function pd(s){let ve=[],Ae=0;while(!0){let _e=s.indexOf("/**",Ae);if(_e===-1)break;let Ne=s.lastIndexOf(`
|
|
25
|
-
`,_e-1)+1;if(s.charCodeAt(_e+3)===42||s.slice(Ne,_e).trim()!==""){Ae=_e+1;continue}let Le=[],Ie=Ne,Re=!1,Me=0;while(Ie<=s.length){let $e=s.indexOf(`
|
|
26
|
-
`,Ie),Be=$e===-1?s.length:$e,Ve=ld(s,Ie,Be),{indent:Ue,separator:We,content:Ke}=cd(Ve,Le.length===0);Le.push({raw:Ve,start:Ie,number:Le.length,indent:Ue,separator:We,content:Ke});let Je=Ve.trimEnd();if(Je.endsWith("*/")){Re=!0,Me=Ie+Je.length,Ae=Be;break}if($e===-1)break;Ie=$e+1}if(!Re)break;ve.push({start:_e,end:Me,lines:Le})}return ve}function ud(s){let ve=s;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 fd(s){let ve=[[]],Ae=!1;for(let _e of s){if(od.test(_e.content)&&!Ae)ve.push([_e]);else ve[ve.length-1].push(_e);if(hd(_e.content,"```")%2===1)Ae=!Ae}return ve}function hd(s,ve){let Ae=0,_e=s.indexOf(ve);while(_e!==-1)Ae++,_e=s.indexOf(ve,_e+ve.length);return Ae}function jc(s){return s.map((ve)=>ve.indent+ve.content).join(`
|
|
27
|
-
`)}function dd(s,ve){let Ae=ve;while(Ae<s.length-1&&s[Ae].content.trim()==="")Ae++;if(s[Ae].content[0]!=="{")return null;let _e=0,Ne=[],Le=Ae;for(;Le<s.length;Le++){let Me=s[Le].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=Le;return{type:Ne.map((Me,$e)=>{let Be=Ae+$e,Ve=s[Be].content.slice(0,Me);return s[Be].content=s[Be].content.slice(Me).replace(Ni,""),$e===0?Ve:s[Be].indent+Ve}).join(`
|
|
28
|
-
`).slice(1,-1),endIndex:Ie}}function md(s){let ve=s.content.match(Ni)?.[0]??"",Ae=s.content.slice(ve.length),_e=0,Ne=0;for(let $e of Ae){if(_e===0&&Fc.test($e))break;if($e==="[")_e++;if($e==="]")_e--;Ne++}let Le=_e===0?Ae.slice(0,Ne):"";if(!Le)return null;let Ie=Le,Re=!1,Me;if(Le.startsWith("[")&&Le.endsWith("]")){Re=!0;let Be=Le.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 s.content=Ae.slice(Ne).replace(Ni,""),{name:Ie,optional:Re,default:Me}}function gd(s){let ve=s[0],Ae=ve.content.match(ad),_e=Ae?Ae[1]:"",Ne=Ae?ve.content.slice(Ae[0].length):ve.content,Le=Ne.trimEnd(),Ie=s.slice(1).map((We)=>We.separator+We.content),Re=(Le?[Le,...Ie]:Ie).join(`
|
|
29
|
-
`);ve.content=Ne,ve.tag=_e;let Me=dd(s,0),$e=Me?.type??"",Be=0;if(Me){Be=Me.endIndex;while(Be<s.length-1&&s[Be].content.trim()==="")Be++}let Ve=md(s[Be]),Ue=jc(s.slice(Me?Me.endIndex:0));return{tag:_e,name:Ve?.name??"",type:$e,optional:Ve?.optional??!1,default:Ve?.default,description:Ue,raw:Re,lines:s}}function yd(s,ve,Ae){let _e=ud(s);_e.forEach((Ie,Re)=>{Ie.number=Re});let Ne=fd(_e),Le=Ne.slice(1).map(gd);return{description:jc(Ne[0]),tags:Le,start:ve,end:Ae,lines:_e}}function Er(s){return pd(s).map(({start:ve,end:Ae,lines:_e})=>yd(_e,ve,Ae))}var xd=/\s*=\s*/;function Vc(s){let ve=s.indexOf("<");if(ve===-1||!s.endsWith(">"))return s;let Ae=s.slice(0,ve),_e=s.slice(ve+1,-1),Ne=fn(_e).map((Le)=>Le.trim().replace(xd," = ")).join(", ");return`${Ae}<${Ne}>`}var Z=/^\s*$/,bd=/;$/,Ed=/^-\s*/;function Cn(s){if(s===void 0)return;let ve=s.replace(Ed,"").trim();return ve===""?"":ve}function Vn(s){if(!s||s.length===0)return;return s[0].content}var qc=new Set(["since","example","see"]),Cd=new Set(["bindable","default","required"]);function vd(s){let ve=s.trim();return ve===""?!0:ve}function Uc(s,ve){return vd(`${s??""}${ve?` ${ve}`:""}`)}function Sd(s){let ve=s.trim().replace(bd,"").trimEnd();if(!ve.startsWith("{")||!ve.endsWith("}"))return!1;let Ae=0,_e=null;for(let Ne=0;Ne<ve.length;Ne++){let Le=ve[Ne];if(_e!==null){if(Le==="\\"){Ne++;continue}if(Le===_e)_e=null;continue}if(Le==='"'||Le==="'"||Le==="`"){_e=Le;continue}if(Le==="{"||Le==="["||Le==="(")Ae++;else if(Le==="}"||Le==="]"||Le===")"){if(Ae--,Ae===0&&Ne<ve.length-1)return!1}}return Ae===0}function Ii(s){let ve=s;if(!ve.startsWith("/*"))ve=`/*${ve}`;if(!ve.endsWith("*/"))ve+="*/";return ve}function Td(s){if(s==="*")return"any";return s.trim()}function Gc(s){let ve=Er(Ii(s)),{returns:Ae}=O(ve);return Ae?Td(Ae.type):void 0}function Wc(s){let ve=Er(Ii(s)),{deprecated:Ae,passthrough:_e,internal:Ne}=O(ve),Le=_e.length>0?_e.map((Ie)=>({name:Ie.tag,body:Ie.raw})):void 0;return{deprecated:Ae,tags:Le,internal:Ne}}var Ad=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function K(s,ve){let Ae=s.parsedJsDocByText.get(ve);if(Ae===void 0)Ae=Er(ve),s.parsedJsDocByText.set(ve,Ae);return Ae}function O(s){let ve=s[0]?.tags??[],Ae,_e=[],Ne,Le,Ie,Re=!1,Me=[],$e=[],Be=[];for(let Ve of ve)if(Ve.tag==="type")Ae=Ve;else if(Ve.tag==="param")_e.push(Ve);else if(Ve.tag==="returns"||Ve.tag==="return")Ne=Ve;else if(Ve.tag==="deprecated")Ie??=Uc(Ve.name,Ve.description);else if(Ve.tag==="ignore"||Ve.tag==="internal")Re=!0;else if(Ve.tag==="sveld-ignore")Be.push(Ve.name);else if(qc.has(Ve.tag))$e.push(Ve);else if(Ve.tag==="bindable"){if(Ve.type)continue;let Ue=`${Ve.name}${Ve.description?` ${Ve.description}`:""}`.trim();if(Ue==="readonly"||Ue==="writable")Le??=Ue}else if(!Ad.has(Ve.tag))Me.push(Ve);return{type:Ae,param:_e,returns:Ne,binding:Le,deprecated:Ie,internal:Re,additional:Me,passthrough:$e,ignore:Be,description:s[0]?.description}}function kd(s,ve){if(typeof ve.start!=="number"||typeof ve.end!=="number")return;let Ae=s.jsDocBlocksByStart.get(ve.start);if(Ae===void 0||Ae.end!==ve.end)return;return[Ae]}function wd(s){if(!s||s.length===0)return;let ve=s[s.length-1];return ve&&typeof ve==="object"&&"value"in ve?ve:void 0}function Hc(s,ve,Ae){if(!ve||ve.length===0||Ae===void 0||!s.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"||!("start"in Ne)||typeof Ne.start!=="number")continue;let Le=s.source.slice(Ne.end,Ae);if(Z.test(Le))return Ne}return}function Pd(s){let ve=new Set;for(let Ae of s.funcDecls.values()){let{leadingComments:_e,start:Ne}=Ae,Le=Hc(s,_e,Ne);if(Le)ve.add(Le.start)}return ve}function g(s,ve,Ae){if(!Ae?.leadingComments)return;let _e=Hc(s,Ae.leadingComments,Ae.start);if(!_e)return;return _d(s,ve,[_e])}function Te(s,ve,Ae){if(!Ae?.leadingComments)return;return g(s,ve,Ae)}function _d(s,ve,Ae){if(!Ae)return;let _e=wd(Ae);if(!_e)return;let Ne=kd(s,_e)??K(s,Ii(_e.value)),{type:Le,param:Ie,returns:Re,binding:Me,deprecated:$e,internal:Be,additional:Ve,passthrough:Ue,ignore:We,description:Ke}=O(Ne),Je,ze,nt,ot;if(Le)Je=ve.aliasType(Le.type);if(Ie.length>0)ze=Ie.filter((tt)=>!tt.name.includes(".")).map((tt)=>({name:tt.name,type:ve.aliasType(tt.type),description:Cn(tt.description),optional:tt.optional||!1}));if(Re)nt=ve.aliasType(Re.type);let et=u(Ke?.trim());if(et||Ve.length>0){let tt=[];if(et)tt.push(et);for(let xt of Ve){let kt=`@${xt.tag}${xt.name?` ${xt.name}`:""}${xt.description?` ${xt.description}`:""}`;tt.push(kt)}ot=tt.join(`
|
|
30
|
-
`)}let lt=Ue.length>0?Ue.map((tt)=>({name:tt.tag,body:tt.raw})):void 0;return{type:Je,params:ze,returnType:nt,description:ot,binding:Me,deprecated:$e,tags:lt,sveldIgnore:We.length>0?We:void 0,internal:Be}}function Ee(s,ve,Ae=s.source){if(!Ae)return;let _e=!1,Ne=!1,Le=!1,Ie=new Set,Re=()=>{if(_e&&Ne&&!Le){Le=!0;let Ke=s.componentFilePath?` in ${s.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${Ke}; their declarations are combined in the order encountered.`)}},Me=(Ke,Je)=>{if(Ie.has(Ke))n(s,"generics-conflict",Ke,`Duplicate generic name "${Ke}".`,Je);else Ie.add(Ke)},$e=(Ke,Je)=>{if(s.generics){let nt=fn(s.generics[0]).map((ot)=>ot.trim()).indexOf(Ke.trim());if(nt!==-1){let ot=fn(s.generics[1]).map((et)=>et.trim());ot[nt]=Je,s.generics=[s.generics[0],ot.join(", ")];return}}ve.accumulateGeneric(Ke,Je)},Be=(Ke,Je)=>{if(s.typedefs.has(Ke))n(s,"typedef-duplicate",Ke,`Duplicate typedef/callback name "${Ke}"; the later declaration overwrites the earlier one.`,Je)},Ve=(Ke,Je,ze,nt)=>{let ot=Ke.findIndex((et)=>et.name===Je.name);if(ot===-1)Ke.push(Je);else{let et=ze?` of "${ze}"`:"";n(s,"property-duplicate",Je.name,`Duplicate property "${Je.name}"${et}; the later declaration overwrites the earlier one.`,nt),Ke[ot]=Je}},Ue=Pd(s),We=Er(Ae);for(let Ke of We)s.jsDocBlocksByStart.set(Ke.start,Ke);for(let{tags:Ke,description:Je,lines:ze,start:nt}of We){let ot=Ue.has(nt),et,lt,tt,xt,kt=!1,vt,De,Oe=[],Fe=[],qe=[],Ge,He,Xe,Ze,Qe=[],Ye=!1,ct=[],ft,gt,$t,Ot=[],Gt=!1,Zt=[],Lt,_t,pn=!1,Pt=!0,Rt=[],Vs,On=!1,Lr=new Map,ko=new Set,qs=new Set;for(let at of Ke)if(at.lines.length>0)ko.add(at.lines[0].number);for(let at of ze)if(!at.tag&&at.content&&at.content.trim()!=="}")Lr.set(at.number,at.content);let Fp=(at)=>{if(!at||at.length===0)return;let Wt=at[0].number,ut=[],Jt=[],gn=!1;for(let Et=Wt-1;Et>=0;Et--){if(ko.has(Et))break;let Yt=Lr.get(Et);if(Yt)ut.unshift(Yt),Jt.unshift(Et),gn=!0;else if(gn){let Ct=ze[Et];if(!(!Ct||!Ct.tag&&(!Ct.content||Ct.content.trim()==="")))break}}if(ut.length===0)return;for(let Et of Jt)qs.add(Et);return ut.join(`
|
|
31
|
-
`).trim()},wo=()=>{if(et!==void 0){let at=lt&<!=="object"&<!=="Object"?lt:void 0,Wt;if(at)Wt=at;else if(qe.length>0)Wt=ss(qe,et,!0);else Wt=lt||"";if(De!==void 0){let ut;for(let Et of Ke){let Yt=Et.lines[0]?.number;if(typeof Yt!=="number")continue;if(Yt<=De)continue;if(Et.tag==="property"||Et.tag==="type")continue;ut=Yt;break}let Jt=[],gn=Array.from(Lr.keys()).sort((Et,Yt)=>Et-Yt);for(let Et of gn){if(Et<=De)continue;if(ut!==void 0&&Et>=ut)continue;if(qs.has(Et))continue;let Ct=Lr.get(Et)?.trim();if(Ct)Jt.push(Ct),qs.add(Et)}if(Jt.length>0){let Et=Jt.join(`
|
|
32
|
-
`);tt=tt?`${tt}
|
|
33
|
-
${Et}`:Et}}h(s,{name:et,detail:Wt,has_argument:!1,description:tt,deprecated:xt,tags:Oe.length>0?Oe:void 0,internal:kt||void 0,source:vt}),s.eventDescriptions.set(et,tt),s.jsDocEventNames.add(et),s.jsDocEventSources.set(et,vt),d(s,"event-no-source",et,Fe),qe.length=0,et=void 0,lt=void 0,tt=void 0,xt=void 0,kt=!1,vt=void 0,De=void 0,Oe=[],Fe=[]}},Po=()=>{if(Ge!==void 0){let at,Wt;if(ct.length>0)at=ss(ct,void 0,!0),Wt=`type ${Ge} = ${at};`;else if(He)at=He,Wt=Sd(at)?`interface ${Ge} ${at}`:`type ${Ge} = ${at};`;else at="{}",Wt=`type ${Ge} = ${at};`;Be(Ge,Ze),s.typedefs.set(Ge,{type:at,name:Ge,description:u(Xe),ts:Wt,tags:Qe.length>0?Qe:void 0,...Ye?{internal:!0}:{},source:Ze}),ct.length=0,Ge=void 0,He=void 0,Xe=void 0,Ze=void 0,Qe=[],Ye=!1}},_o=()=>{if(ft!==void 0){let ut=`(${Zt.map(({name:gn,type:Et,optional:Yt})=>`${gn}${Yt?"?":""}: ${Et}`).join(", ")}) => ${Lt||"void"}`,Jt=`type ${ft} = ${ut};`;Be(ft,$t),s.typedefs.set(ft,{type:ut,name:ft,description:u(gt),ts:Jt,tags:Ot.length>0?Ot:void 0,...Gt?{internal:!0}:{},source:$t}),Zt.length=0,Lt=void 0,ft=void 0,gt=void 0,$t=void 0,Ot=[],Gt=!1}},jp=Ke.some((at)=>at.tag==="slot"||at.tag==="snippet"),Vp=Ke.some((at)=>at.tag==="extends"||at.tag==="extendProps"),qp=Ke.some((at)=>at.tag==="slot"||at.tag==="snippet"||at.tag==="event"||at.tag==="typedef"||at.tag==="callback");for(let{tag:at,type:Wt,name:ut,description:Jt,optional:gn,default:Et,raw:Yt,lines:Ct}of Ke){let Ft=ve.aliasType(Wt),ar=Fp(Ct);switch(at){case"extends":case"extendProps":if(s.extends!==void 0)n(s,"extend-props-duplicate",ut,`A second @extends/@extendProps tag ("${ut}") overwrote the first ("${s.extends.interface}"); only one is used.`,an(s,Ct));if(s.extends={interface:ut,import:Ft},Pt)Pt=!1;break;case"restProps":{let St=ut?Jt?`${ut} ${Jt}`:ut:Jt,kn=Cn(St)||ar;if(!kn&&Pt&&!pn&&Je)kn=Je,pn=!0;if(s.rest_props={type:"Element",name:Ft,description:kn||void 0},Pt)Pt=!1;break}case"slot":case"snippet":{let Ht=Cn(Vn(Ct));if(!Ht&&Pt&&!pn&&Je)Ht=Je,pn=!0;if(!Ht&&Rt.length===0)Ht=ar;if(Pt)Pt=!1;let kn=Ft;if(!kn)kn="Record<string, never>",n(s,"slot-missing-type",ut||"default",`@${at}${ut?` "${ut}"`:""} is missing a required {Type} annotation; falling back to "${kn}".`,an(s,Ct));R(s,{slot_name:ut,slot_props:kn,slot_description:Ht||void 0,slot_deprecated:Vs,slot_tags:Rt.length>0?[...Rt]:void 0,slot_internal:On||void 0,source:an(s,Ct)}),Rt.length=0,Vs=void 0,On=!1;{let Up=ut===void 0||ut===""?null:ut;_t=(Gp)=>{let Us=s.slots.get(Up);if(Us)Us.tags=[...Us.tags??[],Gp]}}break}case"csspart":{let St=Cn(Vn(Ct));s.cssParts.push({name:ut,...St?{description:St}:{}});break}case"cssprop":case"cssproperty":{let St=Cn(Vn(Ct));s.cssProperties.push({name:ut,...Ft?{type:Ft}:{},...Et===void 0?{}:{default:Et},...St?{description:St}:{}});break}case"event":{if(wo(),et=ut,lt=Ft,De=Ct.length>0?Ct[0].number:void 0,tt=Cn(Vn(Ct))||ar,!tt&&Pt&&!pn&&Je)tt=Je,pn=!0;if(vt=an(s,Ct),Rt.length>0)Oe.push(...Rt),Rt.length=0;if(_t=(Ht)=>Oe.push(Ht),Pt)Pt=!1;break}case"type":if(et!==void 0)lt=Ft;break;case"param":if(ft!==void 0)Zt.push({name:ut,type:Ft,optional:gn||!1});break;case"returns":case"return":if(ft!==void 0)Lt=Ft;break;case"property":{let St={name:ut,type:Ft,description:Cn(Vn(Ct)),optional:gn||!1,default:Et};if(et!==void 0)Ve(qe,St,et,an(s,Ct));else if(Ge!==void 0)Ve(ct,St,Ge,an(s,Ct));break}case"typedef":{if(Po(),Ge=Vc(ut),He=Ft,Ze=an(s,Ct),Xe=Cn(Vn(Ct))||ar,!Xe&&Pt&&!pn&&Je)Xe=Je,pn=!0;if(Rt.length>0)Qe.push(...Rt),Rt.length=0;if(Ye=On,On=!1,_t=(Ht)=>Qe.push(Ht),Pt)Pt=!1;break}case"callback":{if(_o(),ft=Vc(ut),$t=an(s,Ct),gt=Cn(Vn(Ct))||ar,!gt&&Pt&&!pn&&Je)gt=Je,pn=!0;if(Rt.length>0)Ot.push(...Rt),Rt.length=0;if(Gt=On,On=!1,_t=(Ht)=>Ot.push(Ht),Pt)Pt=!1;break}case"generics":{let St=Ft||ut;for(let Ht of fn(ut))Me(Ht.trim(),an(s,Ct));if(_e=!0,Re(),$e(ut,St),Pt)Pt=!1;break}case"template":{let St=ut;if(Ft)St=`${ut} extends ${Ft}`;if(Et)St+=` = ${Et}`;if(jp&&!Vp){s.deferredSlotBlockGenerics.push({name:ut,constraint:St});break}if(ot)break;if(Me(ut,an(s,Ct)),Ne=!0,Re(),$e(ut,St),Pt)Pt=!1;break}case"deprecated":{let St=Uc(ut,Jt);if(et===void 0)Vs??=St;else xt??=St;break}case"ignore":case"internal":{if(et===void 0)On=!0;else kt=!0;break}case"sveld-ignore":if(et!==void 0)Fe.push(ut);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let St={name:at,body:Yt};if(!qc.has(at)&&!Cd.has(at))n(s,"jsdoc-unknown-tag",at,`Unknown JSDoc tag "@${at}"; passed through unchanged. If this is a typo, fix the tag name.`,an(s,Ct));if(_t)_t(St);else Rt.push(St)}break}}if(wo(),Po(),_o(),qp&&Rt.length>0){for(let at of Rt)n(s,"jsdoc-tag-dropped",at.name,`@${at.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);Rt.length=0}}}import Kc,{sep as Di}from"node:path";var Dn=/\.svelte$/,zc=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function is(s){if(!s.endsWith(".svelte"))return!1;let ve=s.length-7;if(ve===0)return!1;let Ae=s.charCodeAt(ve-1);return Ae!==47&&(Di==="/"||Ae!==92)}function e(s){return Di==="/"?s:s.split(Di).join("/")}function os(s,ve){return e(Kc.join(ve,Kc.normalize(s)))}function qn(s){return`${JSON.stringify(s,null,2)}
|
|
34
|
-
`}var Xc="sveld",as="0.37.1";var Jc={name:Xc,version:as,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 Cr="5.57.0";var cs=1,Yc=new WeakMap;function Ln(s){return s.some((ve)=>ve.internal)?s.filter((ve)=>!ve.internal):s}function Id(s){return{...s,props:Ln(s.props),moduleExports:Ln(s.moduleExports),slots:Ln(s.slots),events:Ln(s.events),typedefs:Ln(s.typedefs),...s.contexts?{contexts:Ln(s.contexts).map((ve)=>({...ve,properties:Ln(ve.properties)}))}:{}}}function i(s,ve={}){let Ae=Yc.get(s),_e=Ae?.get(ve.entryExports);if(_e)return _e;let Ne=Array.from(s,([,Re])=>{let{diagnostics:Me,...$e}=Re;return Id($e)}).sort((Re,Me)=>Re.moduleName.localeCompare(Me.moduleName)),Le={schemaVersion:cs,generator:{name:Xc,version:as,svelteVersion:Cr},total:Ne.length,components:Ne},Ie=ve.entryExports?Ln(ve.entryExports):void 0;if(Ie&&Ie.length>0)Le.totalExports=Ie.length,Le.exports=Ie;if(!Ae)Ae=new Map,Yc.set(s,Ae);return Ae.set(ve.entryExports,Le),Le}import{readFile as Dd}from"node:fs/promises";import Ld from"node:path";var Rd=/[:=]/,ls={none:0,patch:1,minor:2,major:3};function Od(s,ve){return ls[ve]>ls[s]?ve:s}function Md(s){return s.reduce((ve,Ae)=>Od(ve,Ae.bump),"none")}function us(s,ve){return ls[s]>=ls[ve]}function rl(s,ve){let Ae=[],_e=0,Ne="",Le=null;for(let Ie=0;Ie<s.length;Ie++){let Re=s[Ie];if(Le){if(Ne+=Re,Re==="\\")Ie++,Ne+=s[Ie]??"";else if(Re===Le)Le=null;continue}if(Re==='"'||Re==="'"||Re==="`"){Le=Re,Ne+=Re;continue}if(Re==="<"||Re==="("||Re==="{"||Re==="[")_e++;if(Re===">"||Re===")"||Re==="}"||Re==="]")_e--;if(Re===ve&&_e===0){Ae.push(Ne.trim()),Ne="";continue}Ne+=Re}return Ae.push(Ne.trim()),Ae}function Qc(s){return new Set(rl(s,"|").filter((ve)=>ve.length>0))}function Bd(s){let ve=0,Ae=null;for(let _e=0;_e<s.length;_e++){let Ne=s[_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==="="&&s[_e+1]===">")return _e}return-1}function Zc(s){let ve=Bd(s);if(ve===-1)return;let Ae=s.slice(0,ve).trim(),_e=s.slice(ve+2).trim();if(!Ae.startsWith("(")||!Ae.endsWith(")"))return;let Ne=Ae.slice(1,-1).trim();return{params:Ne.length===0?[]:rl(Ne,","),returnType:_e}}function $d(s){return(s.split(Rd,1)[0]??"").trimEnd().endsWith("?")}function Fd(s,ve){if(s.returnType!==ve.returnType)return"major";if(ve.params.length<s.params.length)return"major";for(let _e=0;_e<s.params.length;_e++)if(s.params[_e]!==ve.params[_e])return"major";if(ve.params.length===s.params.length)return"none";return ve.params.slice(s.params.length).every($d)?"minor":"major"}function Ri(s,ve){if(s===ve)return"none";if(s===void 0||ve===void 0)return"major";let Ae=Zc(s),_e=Zc(ve);if(Ae&&_e)return Fd(Ae,_e);let Ne=Qc(s),Le=Qc(ve),Ie=[...Le].some((Me)=>!Ne.has(Me)),Re=[...Ne].some((Me)=>!Le.has(Me));if(!Ie&&!Re)return"none";if(Ie&&!Re)return"minor";if(Re&&!Ie)return"major";return"major"}function el(s){return s.bindable===!0||s.binding==="writable"}function tl(s,ve,Ae,_e){let Ne=ve==="prop"?"prop":"export",Le=[],Ie=new Map(Ae.map((Me)=>[Me.name,Me])),Re=new Map(_e.map((Me)=>[Me.name,Me]));for(let[Me,$e]of Re){if(Ie.has(Me))continue;Le.push({component:s,kind:ve,name:Me,bump:$e.isRequired?"major":"minor",message:`${Ne} "${Me}" added${$e.isRequired?" (required)":""}`})}for(let[Me]of Ie){if(Re.has(Me))continue;Le.push({component:s,kind:ve,name:Me,bump:"major",message:`${Ne} "${Me}" removed`})}for(let[Me,$e]of Ie){let Be=Re.get(Me);if(!Be)continue;if($e.isRequired!==Be.isRequired)Le.push({component:s,kind:ve,name:Me,bump:Be.isRequired?"major":"minor",message:`${Ne} "${Me}" became ${Be.isRequired?"required":"optional"}`});let Ve=Ri($e.type,Be.type);if(Ve!=="none")Le.push({component:s,kind:ve,name:Me,bump:Ve,message:`${Ne} "${Me}" type changed from \`${$e.type??"unknown"}\` to \`${Be.type??"unknown"}\``});let Ue=el($e),We=el(Be);if(Ue!==We)Le.push({component:s,kind:ve,name:Me,bump:We?"minor":"major",message:`${Ne} "${Me}" ${We?"gained a writable binding":"lost its writable binding"}`});if($e.value!==Be.value&&Ve==="none")Le.push({component:s,kind:ve,name:Me,bump:"patch",message:`${Ne} "${Me}" default changed from \`${$e.value??"none"}\` to \`${Be.value??"none"}\``});let Ke=$e.deprecated!==void 0,Je=Be.deprecated!==void 0;if(Ke!==Je)Le.push({component:s,kind:ve,name:Me,bump:Je?"minor":"patch",message:`${Ne} "${Me}" ${Je?"marked as deprecated":"no longer deprecated"}`});if($e.constant!==Be.constant)Le.push({component:s,kind:ve,name:Me,bump:"minor",message:`${Ne} "${Me}" ${Be.constant?"became constant":"became mutable"}`});if($e.reactive!==Be.reactive)Le.push({component:s,kind:ve,name:Me,bump:"minor",message:`${Ne} "${Me}" ${Be.reactive?"became reactive":"stopped being reactive"}`})}return Le}function jd(s,ve,Ae){let _e=[],Ne=new Map(ve.map((Ie)=>[Ie.name,Ie])),Le=new Map(Ae.map((Ie)=>[Ie.name,Ie]));for(let[Ie]of Le){if(Ne.has(Ie))continue;_e.push({component:s,kind:"event",name:Ie,bump:"minor",message:`event "${Ie}" added`})}for(let[Ie]of Ne){if(Le.has(Ie))continue;_e.push({component:s,kind:"event",name:Ie,bump:"major",message:`event "${Ie}" removed`})}for(let[Ie,Re]of Ne){let Me=Le.get(Ie);if(!Me)continue;if(Re.type!==Me.type){_e.push({component:s,kind:"event",name:Ie,bump:"major",message:`event "${Ie}" changed from ${Re.type} to ${Me.type}`});continue}let $e=Re.type==="dispatched"?Re.detail:void 0,Be=Me.type==="dispatched"?Me.detail:void 0,Ve=Ri($e,Be);if(Ve!=="none")_e.push({component:s,kind:"event",name:Ie,bump:Ve,message:`event "${Ie}" detail changed from \`${$e??"unknown"}\` to \`${Be??"unknown"}\``})}return _e}function nl(s){return s.name??"default"}function Vd(s,ve,Ae){let _e=[],Ne=new Map(ve.map((Ie)=>[nl(Ie),Ie])),Le=new Map(Ae.map((Ie)=>[nl(Ie),Ie]));for(let[Ie]of Le){if(Ne.has(Ie))continue;_e.push({component:s,kind:"slot",name:Ie,bump:"minor",message:`slot "${Ie}" added`})}for(let[Ie]of Ne){if(Le.has(Ie))continue;_e.push({component:s,kind:"slot",name:Ie,bump:"major",message:`slot "${Ie}" removed`})}for(let[Ie,Re]of Ne){let Me=Le.get(Ie);if(!Me)continue;let $e=Ri(Re.slot_props,Me.slot_props);if($e!=="none")_e.push({component:s,kind:"slot",name:Ie,bump:$e,message:`slot "${Ie}" props changed from \`${Re.slot_props??"none"}\` to \`${Me.slot_props??"none"}\``})}return _e}var qd=new Set(["description","source","componentCommentSource","tags"]);function ps(s){if(Array.isArray(s))return s.map(ps);if(s!==null&&typeof s==="object"){let ve={};for(let[Ae,_e]of Object.entries(s)){if(qd.has(Ae))continue;ve[Ae]=ps(_e)}return ve}return s}var Ud=["generics","rest_props","extends","contexts","typedefs"];function Gd(s,ve,Ae){let _e=[];for(let Ne of Ud){let Le=JSON.stringify(ps(ve[Ne])),Ie=JSON.stringify(ps(Ae[Ne]));if(Le!==Ie)_e.push({component:s,kind:"shape",name:Ne,bump:"major",message:`"${Ne}" changed (breaking)`})}return _e}function Wd(s,ve){let Ae=ve.moduleName;return[...tl(Ae,"prop",s.props,ve.props),...tl(Ae,"moduleExport",s.moduleExports,ve.moduleExports),...jd(Ae,s.events,ve.events),...Vd(Ae,s.slots,ve.slots),...Gd(Ae,s,ve)]}function Se(s,ve){let Ae=[],_e=new Map(s.components.map((Le)=>[Le.moduleName,Le])),Ne=new Map(ve.components.map((Le)=>[Le.moduleName,Le]));for(let[Le]of Ne){if(_e.has(Le))continue;Ae.push({component:Le,kind:"component",bump:"minor",message:`component "${Le}" added`})}for(let[Le]of _e){if(Ne.has(Le))continue;Ae.push({component:Le,kind:"component",bump:"major",message:`component "${Le}" removed`})}for(let[Le,Ie]of _e){let Re=Ne.get(Le);if(!Re)continue;Ae.push(...Wd(Ie,Re))}return Ae}async function Hd(s){let ve;try{ve=await Dd(Ld.resolve(s),"utf-8")}catch(Ae){if(Ae.code==="ENOENT")return null;throw Ae}try{return JSON.parse(ve)}catch{throw Error(`sveld: could not parse "${s}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function H(s){if(typeof s.check==="string")return s.check;return s.jsonOptions?.outFile??"COMPONENT_API.json"}async function M(s,ve,Ae={}){let _e=await Hd(ve);if(_e===null)return{snapshotExists:!1,snapshotFile:ve,changes:[],bump:"none"};if(_e.schemaVersion!==cs)return{snapshotExists:!0,snapshotFile:ve,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${_e.schemaVersion} differs from ${cs}; regenerate the snapshot`}],bump:"none"};let Ne=i(s,{entryExports:Ae.entryExports}),Le=Se(_e,Ne);return{snapshotExists:!0,snapshotFile:ve,changes:Le,bump:Md(Le)}}var Kd={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function ee(s){if(!s.snapshotExists)return`sveld --check: no snapshot found at "${s.snapshotFile}". Run \`sveld --json\` and commit the output first.`;if(s.changes.length===0)return`sveld --check: no API changes detected against "${s.snapshotFile}".`;let ve=[],Ae=s.changes.length;ve.push(`sveld --check: ${Ae} API change${Ae===1?"":"s"} detected against "${s.snapshotFile}".`),ve.push(`Suggested semver bump: ${s.bump}.`);let _e=new Map;for(let Ne of s.changes){let Le=_e.get(Ne.component)??[];Le.push(Ne),_e.set(Ne.component,Le)}for(let[Ne,Le]of _e){ve.push(""),ve.push(` ${Ne}`);for(let Ie of Le){let Re=Ie.kind==="schema"?"schema":Kd[Ie.bump];ve.push(` [${Re}] ${Ie.message}`)}}return ve.join(`
|
|
35
|
-
`)}var be=1;function te(s){let ve={kind:"check-report",schemaVersion:be,...s};return qn(ve)}import{existsSync as Xd}from"node:fs";import{join as Jd}from"node:path";import{pathToFileURL as Yd}from"node:url";function zd(s,ve){let Ae=s.length+1,_e=ve.length+1,Ne=Array.from({length:Ae},()=>Array(_e).fill(0));for(let Le=0;Le<Ae;Le++)Ne[Le][0]=Le;for(let Le=0;Le<_e;Le++)Ne[0][Le]=Le;for(let Le=1;Le<Ae;Le++)for(let Ie=1;Ie<_e;Ie++){let Re=s[Le-1]===ve[Ie-1]?0:1;Ne[Le][Ie]=Math.min(Ne[Le-1][Ie]+1,Ne[Le][Ie-1]+1,Ne[Le-1][Ie-1]+Re)}return Ne[Ae-1][_e-1]}function fs(s,ve){let Ae,_e=Number.POSITIVE_INFINITY;for(let Ne of ve){let Le=zd(s,Ne);if(Le<_e)Ae=Ne,_e=Le}if(Ae===void 0||_e>3)return;return Ae}var Qd=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function Ce(s){return s}function Zd(s=process.cwd()){for(let ve of Qd){let Ae=Jd(s,ve);if(Xd(Ae))return Ae}return null}async function Oi(s){let ve;try{ve=await import(`${Yd(s).href}?t=${Date.now()}`)}catch(_e){let Ne=_e instanceof Error?_e.message:String(_e);throw Error(`sveld: failed to load config file "${s}".
|
|
36
|
-
${Ne}`)}let Ae=ve.default;if(!wt(Ae)||Array.isArray(Ae))throw Error(`sveld: config file "${s}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Ae}async function _(s=process.cwd()){let ve=Zd(s);if(ve===null)return{};return Oi(ve)}function D(...s){let ve={};for(let Ae of s){if(!Ae)continue;for(let[_e,Ne]of Object.entries(Ae)){let Le=ve[_e];ve[_e]=wt(Le)&&!Array.isArray(Le)&&wt(Ne)&&!Array.isArray(Ne)?{...Le,...Ne}:Ne}}return ve}var em={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function W(s){let{strict:ve,...Ae}=s;if(ve!=="ci"&&ve!=="local")return s;return{...em[ve],...Ae}}var sl=["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"],tm={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 il(s,ve,Ae){let _e=s===null?ve:`${s}.${ve}`,Ne=fs(ve,Ae),Le=Ne===void 0?void 0:s===null?Ne:`${s}.${Ne}`;console.warn(`sveld: unknown option "${_e}".${Le?` Did you mean "${Le}"?`:""}`)}function N(s){for(let ve of Object.keys(s))if(!sl.includes(ve))il(null,ve,sl);for(let[ve,Ae]of Object.entries(tm)){let _e=s[ve];if(!wt(_e))continue;for(let Ne of Object.keys(_e))if(!Ae.includes(Ne))il(ve,Ne,Ae)}}var hs=new Map;function b(s,ve){if(!ve?.replace&&hs.has(s.name))throw Error(`sveld: a writer named "${s.name}" is already registered. Pass { replace: true } to overwrite it.`);hs.set(s.name,s)}function G(s){return hs.get(s)}function Pe(){return Array.from(hs.values())}import{dirname as kp,isAbsolute as dx,resolve as mx}from"node:path";import{existsSync as Ol,lstatSync as $l,readFileSync as rg,realpathSync as sg,statSync as Fl}from"node:fs";import{readFile as ig}from"node:fs/promises";import{basename as og,dirname as jl,extname as ag,isAbsolute as cg,join as Ml,parse as lg,relative as Ki,resolve as tr}from"node:path";function vr(s){return s}function vn(s){if(s==="")return s;return s.startsWith(".")?s:`./${s}`}import{dirname as al,resolve as cl}from"node:path";var nm=/^(['"])(.*)\1$/,ll=/^[./]/,rm=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function sm(s,ve){let Ae=s.extends?.import;if(Ae===void 0)return null;let _e=Ae.replace(nm,"$2");if(!ll.test(_e))return null;return cl(al(ve),_e)}function ol(s,ve){let Ae=[];for(let _e of s.matchAll(rm)){let Ne=_e[2];if(!ll.test(Ne))continue;Ae.push(cl(al(ve),Ne))}return Ae}function im(s,ve){let Ae=[],_e=sm(s,ve);if(_e!==null)Ae.push(_e);for(let Ne of s.typedefs??[])Ae.push(...ol(Ne.type,ve));for(let Ne of s.props)if(Ne.type)Ae.push(...ol(Ne.type,ve));return Ae}function Sr(s,ve){let Ae=new Map;for(let _e of s.values()){let Ne=ve(_e.filePath);for(let Le of im(_e,Ne)){let Ie=Ae.get(Le);if(Ie===void 0)Ie=new Set,Ae.set(Le,Ie);Ie.add(Ne)}}return Ae}function ds(s,ve){let Ae=new Set,_e=[];for(let Ne of s)if(!Ae.has(Ne))Ae.add(Ne),_e.push(Ne);while(_e.length>0){let Ne=_e.shift(),Le=ve.get(Ne);if(Le===void 0)continue;for(let Ie of Le)if(!Ae.has(Ie))Ae.add(Ie),_e.push(Ie)}return Ae}var om=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,am=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),cm=new Set(["svelte","html"]);function lm(s){let ve=s.trim();if(ve==="")return null;let Ae=ve.match(om);if(Ae){let _e=Ae[1].toLowerCase(),Ne=Ae[2].trim();if(Ne==="")return null;if(am.has(_e))return{kind:"compile",code:Ne};if(cm.has(_e))return{kind:"syntax",code:Ne};return null}if(ve.startsWith("<"))return null;return{kind:"compile",code:ve}}function pl(s){if(!s.isFunction)return"any";return`(${(s.params??[]).map((Ae)=>`${Ae.name}${Ae.optional?"?":""}: any`).join(", ")}) => any`}function ms(s,ve,Ae,_e,Ne){let Le=(s??[]).filter((Re)=>Re.name==="example"),Ie=[];return Le.forEach((Re,Me)=>{let $e=lm(Re.body);if($e===null)return;let Be=Le.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 ul(s){return s.name??"default"}function fl(s){let ve=[];for(let Ae of s.props)ve.push(...ms(Ae.tags,`prop:${Ae.name}`,Ae.name,pl(Ae),Ae.source));for(let Ae of s.moduleExports)ve.push(...ms(Ae.tags,`export:${Ae.name}`,Ae.name,pl(Ae),Ae.source));for(let Ae of s.slots)ve.push(...ms(Ae.tags,`slot:${ul(Ae)}`,ul(Ae),"any",Ae.source));for(let Ae of s.events)ve.push(...ms(Ae.tags,`event:${Ae.name}`,Ae.name,"any",Ae.source));return ve}import{existsSync as pm,readdirSync as um}from"node:fs";import{join as fm}from"node:path";var Mi=new Map;function gs(){Mi.clear()}function Bi(s){let ve=Mi.get(s);if(ve!==void 0)return ve;try{let Ae=um(s,{withFileTypes:!0}),_e=new Set;for(let Ne of Ae)_e.add(Ne.name);ve={entries:Ae,names:_e}}catch{ve=null}return Mi.set(s,ve),ve}function hl(s){return s.normalize("NFC").toLowerCase()}function Tr(s,ve){let Ae=Bi(s);if(Ae===null)return!1;if(Ae.names.has(ve))return!0;if(Ae.folded===void 0){Ae.folded=new Map;for(let Ne of Ae.names)Ae.folded.set(hl(Ne),Ne)}let _e=Ae.folded.get(hl(ve));return _e!==void 0&&_e!==ve&&pm(fm(s,ve))}import{createHash as hm}from"node:crypto";import{mkdirSync as dm,readFileSync as mm,renameSync as gm,writeFileSync as dl}from"node:fs";import{dirname as ym,isAbsolute as xm,join as bm,resolve as ml}from"node:path";var $i=2,Em=bm("node_modules",".cache","sveld","parse-cache.json");function Fi(){return`${as}+svelte@${Cr}`}function yl(s,ve){if(typeof ve==="string")return xm(ve)?ve:ml(s,ve);return ml(s,Em)}function xl(s){return hm("sha256").update(s).digest("hex")}function gl(){return{formatVersion:$i,toolchainVersion:Fi(),entries:{}}}function Cm(s){try{let ve=mm(s,"utf-8"),Ae=JSON.parse(ve);if(Ae.formatVersion!==$i||Ae.toolchainVersion!==Fi())return gl();return Ae}catch{return gl()}}class ji{cacheFilePath;file;next=new Map;blocked=new Set;constructor(s){this.cacheFilePath=s,this.file=Cm(s)}has(s,ve){if(this.blocked.has(s))return!1;let Ae=this.file.entries[s];return Ae!==void 0&&Ae.hash===ve}get(s,ve){if(this.blocked.has(s))return null;let Ae=this.file.entries[s];if(Ae===void 0||Ae.hash!==ve)return null;if(this.next.set(s,Ae),Ae.typeScriptMetadata!==void 0)Ae.parsed[y]=Ae.typeScriptMetadata;return Ae.parsed}set(s,ve,Ae){this.next.set(s,{hash:ve,parsed:Ae,typeScriptMetadata:Ae[y]})}invalidate(s){this.blocked.add(s)}getGeneratedText(s,ve){let Ae=this.next.get(s);if(Ae?.generatedText===void 0||Ae.generatedText.format!==ve)return;return Ae.generatedText.text}setGeneratedText(s,ve,Ae){let _e=this.next.get(s);if(_e===void 0)return;_e.generatedText={format:ve,text:Ae}}save(){dm(ym(this.cacheFilePath),{recursive:!0});let s={formatVersion:$i,toolchainVersion:Fi(),entries:Object.fromEntries(this.next)},ve=JSON.stringify(s),Ae=`${this.cacheFilePath}.${process.pid}.tmp`;try{dl(Ae,ve),gm(Ae,this.cacheFilePath)}catch{try{dl(this.cacheFilePath,ve)}catch{}}}}import{lstatSync as Dm,readFileSync as Lm}from"node:fs";import{basename as Rm,dirname as Hi,join as Om,relative as Mm,resolve as kl}from"node:path";var Qn=null,Vi=null;function Un(){if(Qn)return Promise.resolve(Qn);if(!Vi)Vi=Promise.all([import("./chunk-3s74a556.js"),import("./chunk-2x8axrwh.js")]).then(([s,ve])=>(Qn={ComponentParser:s.default,parseSvelte:ve.parse},Qn));return Vi}function ys(){if(!Qn)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return Qn}import{existsSync as Es,readFileSync as vm}from"node:fs";import{dirname as qi,isAbsolute as Sm,join as Tm,relative as Am,resolve as Cs}from"node:path";function xs(s){if(!wt(s))return{};let ve={};if(typeof s.svelte==="string")ve.svelte=s.svelte;if(typeof s.name==="string")ve.name=s.name;if(typeof s.description==="string")ve.description=s.description;return ve}function bl(s){if(!wt(s))return{};let ve={};if(typeof s.extends==="string")ve.extends=s.extends;if(wt(s.compilerOptions)){let Ae={};if(typeof s.compilerOptions.baseUrl==="string")Ae.baseUrl=s.compilerOptions.baseUrl;if(wt(s.compilerOptions.paths)){let _e={};for(let[Ne,Le]of Object.entries(s.compilerOptions.paths))if(Array.isArray(Le)&&Le.every((Ie)=>typeof Ie==="string"))_e[Ne]=Le;if(Object.keys(_e).length>0)Ae.paths=_e}if(Object.keys(Ae).length>0)ve.compilerOptions=Ae}return ve}var bs=new Map,El=new Map,km=/\/\*[\s\S]*?\*\/|\/\/.*/g,wm=/[.+?^${}()|[\]\\]/g,Pm=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class Zn extends Error{specifier;fromFile;searched;constructor(s,ve,Ae){super(`cannot resolve "${s}" from ${ve||"."} (${Ae})`);this.name="UnresolvedModuleError",this.specifier=s,this.fromFile=ve,this.searched=Ae}}function _m(s){if(Es(s))return!0;return Pm.some((ve)=>Es(s+ve))}function Cl(s){let ve=s.indexOf("*");return ve===-1?s.length:ve}function Nm(s){let ve=s,Ae=Cs(ve,"/");while(ve!==Ae){for(let _e of["tsconfig.json","jsconfig.json"]){let Ne=Tm(ve,_e);if(Es(Ne))return Ne}ve=qi(ve)}return null}function vl(s){if(bs.has(s))return bs.get(s)??null;try{let ve=vm(s,"utf-8"),Ae;try{Ae=JSON.parse(ve)}catch{let Ne=ve.replace(km,"");Ae=JSON.parse(Ne)}let _e=bl(Ae);if(_e.extends){let Ne=Sm(_e.extends)?_e.extends:Cs(qi(s),_e.extends),Le=Ne.endsWith(".json")?Ne:`${Ne}.json`;if(Es(Le)){let Ie=vl(Le);if(Ie)_e.compilerOptions={...Ie.compilerOptions,..._e.compilerOptions,paths:{...Ie.compilerOptions?.paths,..._e.compilerOptions?.paths}}}}return bs.set(s,_e),_e}catch{return bs.set(s,null),null}}function Im(s){let ve=El.get(s);if(!ve){let Ae=s.split("*").map((_e)=>_e.replace(wm,"\\$&")).join("(.*)");ve=new RegExp(`^${Ae}$`),El.set(s,ve)}return ve}function vs(s,ve){if(s.startsWith(".")||s.startsWith("/"))return{resolved:s,unresolved:!1,searched:""};let Ae=Nm(ve);if(!Ae)return{resolved:s,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let _e=vl(Ae);if(!_e?.compilerOptions?.paths)return{resolved:s,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:Ne=".",paths:Le}=_e.compilerOptions,Ie=qi(Ae),Re=Cs(Ie,Ne),Me=Object.entries(Le).sort(([$e],[Be])=>Cl(Be)-Cl($e));for(let[$e,Be]of Me){let Ve=s.match(Im($e));if(!Ve)continue;let Ue;for(let We of Be){let Ke=We;for(let ze=1;ze<Ve.length;ze++)Ke=Ke.replace("*",Ve[ze]);let Je=Cs(Re,Ke);if(Ue===void 0)Ue=Je;if(_m(Je))return{resolved:Je,unresolved:!1,searched:Ae}}return{resolved:Ue??s,unresolved:!1,searched:Ae}}return{resolved:s,unresolved:!0,searched:`tsconfig paths (${Ae})`}}function Ui(s,ve){return vs(s,ve).resolved}function Ss(s,ve){if(s.startsWith(".")||s.startsWith("/"))return s;let Ae=Ui(s,ve);if(Ae===s)return s;let _e=Am(ve,Ae);return _e=e(_e),_e.startsWith(".")?_e:`./${_e}`}var Gi=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],Bm=/\r?\n/,$m=/^\s*\*+/;function bt(s){return s&&typeof s==="object"?s:void 0}function Gn(s){return Array.isArray(s)?s:[]}function hn(s){return a(s)?s.name:void 0}function dn(s,ve){let Ae=Ui(s,ve),_e=kl(ve,Ae),Ne=Hi(_e),Le=Rm(_e);if(Tr(Ne,Le)){let Ie=Dm(_e,{throwIfNoEntry:!1});if(Ie?.isFile())return _e;for(let Re of Gi)if(Tr(Ne,Le+Re))return _e+Re;if(Ie?.isDirectory()){for(let Re of Gi)if(Tr(_e,`index${Re}`))return Om(_e,`index${Re}`)}return null}for(let Ie of Gi)if(Tr(Ne,Le+Ie))return _e+Ie;return null}function Fm(s,ve){let Ae=s.slice(0,ve).trimEnd();if(!Ae.endsWith("*/"))return;let _e=Ae.length-2,Ne=Ae.lastIndexOf("/**",_e);if(Ne===-1)return;let Le=[];for(let Ie of Ae.slice(Ne+3,_e).split(Bm)){let Re=Ie.replace($m,"").trim();if(Re.startsWith("@"))break;if(Re)Le.push(Re)}return Le.join(" ")||void 0}function jm(s,ve){let Ae=s.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 er(s,ve){if(!ve)return;return s.text.slice(ve.start,ve.end)}function Vm(s,ve){let Ae=bt(ve?.typeAnnotation);if(Ae?.type!=="TSTypeAnnotation")return;return er(s,bt(Ae.typeAnnotation))}function Wi(s,ve){let Ae=bt(ve.returnType);return Ae?.type==="TSTypeAnnotation"?er(s,bt(Ae.typeAnnotation)):void 0}function Sl(s,ve){let Ae=Gn(ve.params).map((Ne)=>er(s,Ne)??"").join(", "),_e=Wi(s,ve);return`(${Ae})${_e?` => ${_e}`:""}`}function wl(s){if(s.type==="Literal"){let ve=s.value;if(typeof ve==="string")return"string";if(typeof ve==="number")return"number";if(typeof ve==="boolean")return"boolean"}if(s.type==="TemplateLiteral")return"string";return}function qm(s){if(!s)return;let ve=s.lastIndexOf("=>");if(ve===-1)return;return s.slice(ve+2).trim()||void 0}function Tl(s){if(s.async||s.generator)return;let ve=bt(s.body);if(!ve)return;let Ae=[];if(ve.type==="BlockStatement"){if(Ar(ve,Ae),Ae.length===0)return}else Ae.push(ve);let _e;for(let Ne of Ae){if(!Ne)return;let Le=wl(Ne);if(!Le)return;if(_e===void 0)_e=Le;else if(_e!==Le)return}return _e}function Ar(s,ve){for(let Ae of Gn(s.body)){if(Ae.type==="FunctionDeclaration"||Ae.type==="FunctionExpression"||Ae.type==="ArrowFunctionExpression")continue;if(Ae.type==="ReturnStatement"){ve.push(bt(Ae.argument)??null);continue}if(Ae.type==="BlockStatement"){Ar(Ae,ve);continue}let _e=bt(Ae.consequent);if(_e?.type==="BlockStatement")Ar(_e,ve);else if(_e?.type==="ReturnStatement")ve.push(bt(_e.argument)??null);let Ne=bt(Ae.alternate);if(Ne?.type==="BlockStatement")Ar(Ne,ve);else if(Ne?.type==="ReturnStatement")ve.push(bt(Ne.argument)??null);let Le=bt(Ae.body);if(Le?.type==="BlockStatement")Ar(Le,ve)}}function Um(s){let ve=bt(s.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=bt(ve.argument);if(ve.operator==="-"&&Ae?.type==="Literal"){let Ne=Ae.value;if(typeof Ne==="number")return-Ne}}return}function Gm(s){let ve=Gn(s.members);if(ve.length===0)return;let Ae=[],_e=0;for(let Ne of ve){if(!bt(Ne.initializer)){Ae.push(String(_e)),_e+=1;continue}let Ie=Um(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 Al(s,ve,Ae){let _e=s.filePath,Ne=Fm(s.text,Ae),Le=jm(s.text,Ae),Ie=Le?Gc(Le):void 0,{deprecated:Re,tags:Me,internal:$e}=Le?Wc(Le):{deprecated:void 0,tags:void 0,internal:!1},Be=$e?{internal:!0}:{};if(ve.type==="VariableDeclaration"){let Ve=ve.kind??"const",Ue=[];for(let We of Gn(ve.declarations)){let Ke=bt(We.id),Je=hn(Ke);if(!Je)continue;let ze=Vm(s,Ke),nt,ot,et,lt=bt(We.init);if(lt)if(lt.type==="ArrowFunctionExpression"||lt.type==="FunctionExpression"){if(!ze)ze=Sl(s,lt);ot=Wi(s,lt)??Ie??qm(ze)??Tl(lt)}else{if(nt=er(s,lt),!ze)ze=wl(lt);et=Zr(lt)??void 0}Ue.push({name:Je,kind:Ve,type:ze,value:nt,returnType:ot,literalValue:et,description:Ne,deprecated:Re,tags:Me,...Be,declFile:_e,isTypeOnly:!1})}return Ue}if(ve.type==="FunctionDeclaration"||ve.type==="TSDeclareFunction"){let Ve=hn(bt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"function",type:Sl(s,ve),returnType:Wi(s,ve)??Ie??Tl(ve),description:Ne,deprecated:Re,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}if(ve.type==="ClassDeclaration"){let Ve=hn(bt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"class",type:Ve,description:Ne,deprecated:Re,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}if(ve.type==="TSTypeAliasDeclaration"){let Ve=hn(bt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"type",type:er(s,bt(ve.typeAnnotation)),description:Ne,deprecated:Re,tags:Me,...Be,declFile:_e,isTypeOnly:!0}]}if(ve.type==="TSInterfaceDeclaration"){let Ve=hn(bt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"interface",type:er(s,bt(ve.body)),description:Ne,deprecated:Re,tags:Me,...Be,declFile:_e,isTypeOnly:!0}]}if(ve.type==="TSEnumDeclaration"){let Ve=hn(bt(ve.id));if(!Ve)return[];return[{name:Ve,kind:"enum",type:Gm(ve)??Ve,description:Ne,deprecated:Re,tags:Me,...Be,declFile:_e,isTypeOnly:!1}]}return[]}function Wm(s){let ve;try{ve=Lm(s,"utf-8")}catch{return null}let Ae=`<script lang="ts">
|
|
37
|
-
${ve}
|
|
38
|
-
</script>`;try{let _e=ys().parseSvelte(Ae),Ne=Gn(_e.instance?.content?.body);return{source:{text:Ae,filePath:s,dir:Hi(s)},body:Ne}}catch(_e){let Ne=_e instanceof Error?_e.message:String(_e);return console.warn(`Warning: Failed to parse entry export module ${s}: ${Ne}`),null}}function Hm(s,ve){for(let Ae of s){if(Ae.type!=="ImportDeclaration")continue;let _e=bt(Ae.source)?.value;if(typeof _e!=="string")continue;for(let Ne of Gn(Ae.specifiers)){if(Ne.type!=="ImportSpecifier")continue;if(hn(bt(Ne.local))===ve){let Le=hn(bt(Ne.imported))??ve;return{specifier:_e,importedName:Le}}}}return null}function Sn(s,ve){let Ae=ve.cache.get(s);if(Ae)return Ae;if(ve.computing.has(s))return[];ve.computing.add(s);let _e=Wm(s);if(!_e)return ve.computing.delete(s),ve.cache.set(s,[]),[];let{source:Ne,body:Le}=_e,Ie=[],Re=new Map;for(let $e of Le){let Be=$e.type==="ExportNamedDeclaration"?bt($e.declaration):$e;if(!Be)continue;for(let Ve of Al(Ne,Be,Be.start))Re.set(Ve.name,Ve)}let Me=($e)=>{let Be=Re.get($e);if(Be)return Be;let Ve=Hm(Le,$e);if(!Ve||Ve.specifier.endsWith(".svelte"))return null;let Ue=dn(Ve.specifier,Ne.dir);if(!Ue)return null;return Sn(Ue,ve).findLast((We)=>We.name===Ve.importedName)??null};for(let $e of Le){if($e.type==="ExportAllDeclaration"){let Ke=bt($e.source)?.value;if(typeof Ke!=="string"||Ke.endsWith(".svelte"))continue;let Je=dn(Ke,Ne.dir);if(!Je)continue;let ze=$e.exportKind==="type";for(let nt of Sn(Je,ve))Ie.push(ze?{...nt,isTypeOnly:!0}:nt);continue}if($e.type!=="ExportNamedDeclaration")continue;let Be=bt($e.declaration);if(Be){Ie.push(...Al(Ne,Be,$e.start));continue}let Ve=bt($e.source)?.value,Ue=typeof Ve==="string"?Ve:void 0;if(Ue?.endsWith(".svelte"))continue;let We=$e.exportKind==="type";for(let Ke of Gn($e.specifiers)){if(Ke.type!=="ExportSpecifier")continue;let Je=hn(bt(Ke.exported)),ze=hn(bt(Ke.local));if(!Je||!ze||ze==="default"||Je==="default")continue;let nt=We||Ke.exportKind==="type",ot=null;if(Ue){let et=dn(Ue,Ne.dir);if(et)ot=Sn(et,ve).findLast((lt)=>lt.name===ze)??null}else ot=Me(ze);if(ot?.declFile.endsWith(".svelte"))continue;if(ot)Ie.push({...ot,name:Je,isTypeOnly:ot.isTypeOnly||nt});else Ie.push({name:Je,kind:nt?"type":"const",declFile:s,isTypeOnly:nt})}}return ve.computing.delete(s),ve.cache.set(s,Ie),Ie}async function kr(s){await Un();let ve=kl(s),Ae=Hi(ve),_e=Sn(ve,{cache:new Map,computing:new Set}),Ne=(Re)=>e(`./${Mm(Ae,Re)}`),Le=new Map,Ie=new Map;for(let Re of _e){let Me=Ie.get(Re.name);if(Me!==void 0&&Me!==Re.declFile){console.warn(`Warning: "${Re.name}" is exported from both "${Ne(Me)}" and "${Ne(Re.declFile)}"; keeping the first and dropping the rest.`);continue}Ie.set(Re.name,Re.declFile);let{declFile:$e,returnType:Be,literalValue:Ve,...Ue}=Re;Le.set(Re.name,{...Ue,source:Ne($e)})}return Array.from(Le.values()).sort((Re,Me)=>Re.name.localeCompare(Me.name))}import{readFileSync as _l}from"node:fs";import{dirname as Nl,join as Km,relative as zm,resolve as Xm}from"node:path";var Pl=new Map;function Jm(s){return si(s,{ecmaVersion:"latest",sourceType:"module"})}function Ym(s,ve,Ae){let _e=dn(s,ve);if(!_e)return null;let Ne=Nl(_e);if(Ae.has(_e))return{dir:Ne,exports:{}};Ae.add(_e);try{return{dir:Ne,exports:Ts(_l(_e,"utf-8"),Ne,Ae,_e)}}catch{return{dir:Ne,exports:{}}}finally{Ae.delete(_e)}}function Ts(s,ve,Ae=new Set,_e=ve){let Ne=Pl.get(s);if(!Ne)Ne=Jm(s),Pl.set(s,Ne);let Le={};for(let Ie of Ne.body)if(Ie.type==="ExportDefaultDeclaration"){let Re=Ie.declaration.name;if(Re in Le)Le[Re].default=!0;else Le[Re]={source:vn(""),default:!0}}else if(Ie.type==="ExportAllDeclaration"){if(!Ie.source)continue;let Re=Ie.source.value,Me=dn(Re,ve);if(!Me){let Ve=vs(Re,ve);throw new Zn(Re,_e,Ve.unresolved?Ve.searched:"no matching file or index found")}if(Ae.has(Me))continue;Ae.add(Me);let $e=_l(Me,"utf-8"),Be=Ts($e,Nl(Me),Ae,Me);Ae.delete(Me);for(let[Ve,Ue]of Object.entries(Be)){let We=vn(e(`./${Km(Re,Ue.source)}`));Le[Ve]={...Ue,source:We}}}else if(Ie.type==="ExportNamedDeclaration"){let Re=Ie.source?.value,Me=Re!==void 0&&Dn.test(Re);if(Me){let Ve=vs(Re,ve);if(Ve.unresolved)throw new Zn(Re,_e,Ve.searched)}let Be=Re!==void 0&&!Me?Ym(Re,ve,Ae):void 0;if(Be===null)console.warn(`sveld: could not resolve re-exported module "${Re}" from barrel "${ve||"."}"; skipping.`);for(let Ve of Ie.specifiers){let Ue=Ve.exported.name,We=Ve.local.name,Ke=Ue||We;if(Be===null)continue;let Je=Be?.exports[We],ze=Je?vn(e(`./${zm(ve,Xm(Be.dir,Je.source))}`)):vn(Ss(Re??"",ve)),nt=Je?Je.default:We==="default";if(Ke in Le){if(Le[Ke].mixed=!0,!Le[Ke].source)Le[Ke].source=ze}else Le[Ke]={source:ze,default:nt}}}else if(Ie.type==="ImportDeclaration"){let Re=Ie.specifiers[0].local.name;if(Re in Le){if(!Le[Re].source)Le[Re].source=vn(Ss(Ie.source?.value??"",ve))}else Le[Re]={source:vn(Ss(Ie.source?.value??"",ve)),default:Re==="default"}}return Le}import{existsSync as Qm}from"node:fs";import{dirname as Zm}from"node:path";function Il(){return{cache:new Map,computing:new Set}}var eg=/\.[^./\\]+$/;function tg(s){if(s.endsWith(".d.ts"))return null;let ve=s.replace(eg,".d.ts");return Qm(ve)?ve:null}function Dl(s,ve,Ae){let _e=Zm(s);return ve.map((Ne)=>{if(!Ne.importSource||!Ne.importedName)return{candidate:Ne};let Le=dn(Ne.importSource,_e);if(!Le)return{candidate:Ne,failureReason:"module-not-found"};let Ie=Sn(Le,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 Re=tg(Le);if(Re){let Me=Sn(Re,Ae).find(($e)=>$e.name===Ne.importedName);if(Me?.returnType)return{candidate:Ne,type:Me.returnType}}return{candidate:Ne,failureReason:"return-type-unresolved"}})}function Ll(s,ve){switch(ve){case"module-not-found":return`Prop "${s.propName}" default calls "${s.calleeName}()", but "${s.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${s.propName}" default calls "${s.calleeName}()", but "${s.importedName}" is not exported from "${s.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${s.propName}" default calls "${s.calleeName}()" imported from "${s.importSource}", but its return type could not be resolved; falling back to "any".`}}import{dirname as ng}from"node:path";function Rl(s,ve,Ae){let _e=ng(s);return ve.map((Ne)=>{let Le=dn(Ne.importSource,_e);if(!Le)return{candidate:Ne};let Ie=Sn(Le,Ae).find((Re)=>Re.name===Ne.importedName);if(Ie?.kind!=="const"||Ie.literalValue===void 0)return{candidate:Ne};return{candidate:Ne,key:Ie.literalValue}})}function E(s){return{failFast:s?.failFast,resolveTypes:s?.resolveTypes===!0,documentExports:s?.documentExports===!0,cache:s?.cache,checkExamples:s?.checkExamples==="syntax"?"syntax":s?.checkExamples===!0,dryRun:s?.dryRun===!0,diagnostics:s?.diagnostics}}var pg=/-/g,ug=/[^A-Za-z0-9_$]/g,fg=/^[0-9]/;function hg(s){let ve=s.replace(ug,""),Ae=fg.test(ve)?`_${ve}`:ve;if(Ae!==s)console.warn(`Warning: "${s}" is not a valid identifier; using "${Ae}" instead.`);return Ae}function Vl(s,ve=[],Ae=new Set,_e){let Ne;try{Ne=_e??sg(s)}catch{return ve}if(Ae.has(Ne))return ve;Ae.add(Ne);let Le=Bi(s);if(Le===null)return ve;let Ie=Le.entries;for(let Re of Ie){if(Re.name.startsWith("."))continue;let Me=Ml(s,Re.name),$e=Re.isSymbolicLink(),Be=$e?Fl(Me,{throwIfNoEntry:!1}):Re;if(!Be)continue;if(Be.isDirectory())Vl(Me,ve,Ae,$e?void 0:Ml(Ne,Re.name));else if(Be.isFile()&&Re.name.endsWith(".svelte"))ve.push(Me)}return ve}function dg(s){return Vl(s).map((ve)=>{let Ae=hg(og(ve,".svelte").replace(pg,"")),_e=vn(e(`./${Ki(s,ve)}`));return{moduleName:Ae,source:_e}}).sort((ve,Ae)=>ve.source.localeCompare(Ae.source))}function mg(s){return!is(s)}function gg(s,ve){let Ae=s.endsWith("/")?s:`${s}/`;return ve.startsWith(Ae)}function As(s,ve){return{seenPaths:new Set(s.map(([,Ae])=>ve(Ae.source))),seenModuleNamePaths:new Map(s.map(([Ae,_e])=>[Ae,ve(_e.source)])),warnedModuleNames:new Set}}function zi(s,ve,Ae,_e,Ne){for(let{moduleName:Le,source:Ie}of dg(s)){let Re=_e(Ie),Me=ve[Le];if(Me&&mg(Me.source)&&gg(Me.source,Ie)){Ne.seenPaths.delete(_e(Me.source)),Me.source=Ie,Ne.seenPaths.add(Re),Ne.seenModuleNamePaths.set(Le,Re);continue}if(Ne.seenPaths.has(Re))continue;Ne.seenPaths.add(Re);let $e=Ne.seenModuleNamePaths.get(Le);if($e===void 0)Ne.seenModuleNamePaths.set(Le,Re);else if($e!==Re&&!Ne.warnedModuleNames.has(Le))Ne.warnedModuleNames.add(Le),console.warn(`Warning: multiple components named "${Le}" found (${e(Ki(s,$e))} and ${e(Ki(s,Re))}). Both are included in TypeScript definitions, but only one can be the named export.`);Ae.push([Le,{source:Ie,default:!1}])}}function ks(s,ve,Ae=!1){gs();let _e=$l(s).isFile(),Ne=_e?jl(s):s,Le=tr(Ne),Ie=new Map,Re=(Be)=>{let Ve=Ie.get(Be);if(Ve===void 0)Ve=cg(Be)?tr(Be):tr(Le,Be),Ie.set(Be,Ve);return Ve},Me={};if(_e){let Be=rg(s,"utf-8");try{Me=Ts(Be,Le,new Set([tr(s)]))}catch(Ve){if(!Ae)throw Ve;let Ue=Ve instanceof Error?Ve.message:String(Ve);console.warn(`Warning: Failed to parse component exports from ${s}: ${Ue}`)}}let $e=Object.entries(Me);if(ve){let Be=As($e,Re);if(zi(Le,Me,$e,Re,Be),!_e)Me=Object.fromEntries($e.map(([Ve,Ue])=>[Ve,{...Ue,default:!0}]))}return{exports:Me,allComponentEntries:$e,rootDir:Le,resolveComponentFilePath:Re}}async function ws(s){let ve=await Promise.all(Array.from(s).map(async(Ae)=>{try{let _e=await ig(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 Rn([s,ve],Ae,_e,Ne,Le={}){let Ie=ve.source,Re=s;if(Ae.length===1&&s==="default")Re=lg(Ie).name;if(is(Ie)){let Me=Ne(Ie),$e=_e.get(Me);if($e===null||$e===void 0)return null;let Be=e(Ie),Ve=Le.memo?.get(Me),Ue=Le.hashes?.get(Me),We=Ve===void 0?Ue===void 0?null:Le.cache?.get(Me,Ue):null,Ke;if(Ve!==void 0)Ke=Ve;else if(We)Ke=We;else{let Je=new(ys()).ComponentParser;try{Ke=Je.parseSvelteComponent($e,{moduleName:Re,filePath:Be})}catch(ze){if(Le.failFast)throw ze;let nt=ze instanceof Error?ze.message:String(ze),ot=ze instanceof Error?ze.stack:void 0;return Le.onParseError?.({filePath:Be,moduleName:Re,message:nt,stack:ot}),null}if(Ue!==void 0)Le.cache?.set(Me,Ue,Ke);Le.memo?.set(Me,Ke)}return{moduleName:Re,filePath:Be,...Ke}}return null}function Xi(s,ve){let Ae=new Set;for(let _e of s)for(let[,Ne]of _e)if(is(Ne.source))Ae.add(ve(Ne.source));return Ae}function Ps(s){if(s.length===0)return;console.error(`sveld: failed to parse ${s.length} component(s):`);for(let{filePath:ve,message:Ae}of s)console.error(` - ${ve}: ${Ae}`)}async function S(s,ve,Ae={}){let _e=Ae.documentExports===!0,{exports:Ne,allComponentEntries:Le,rootDir:Ie,resolveComponentFilePath:Re}=ks(s,ve,_e),Me=_e&&$l(s).isFile()?await kr(tr(s)):[],$e=Object.entries(Ne),Be=Xi([$e,Le],Re),Ve=await ws(Be),Ue=new Map,We=new Map,Ke=Ae.cache===!1?void 0:new ji(yl(Ie,Ae.cache??!0)),Je=Ke?new Map:void 0,ze=new Set,nt=new Map;if(Ke)for(let Ge of Be){let He=Ve.get(Ge);if(He===null||He===void 0)continue;let Xe=xl(He);if(nt.set(Ge,Xe),!Ke.has(Ge,Xe))ze.add(Ge)}if(Be.size>0&&(!Ke||ze.size>0))await Un();let ot=new Map,et=new Map,lt={failFast:Ae.failFast===!0,onParseError:(Ge)=>ot.set(Ge.filePath,Ge),cache:Ke,hashes:nt,memo:et};for(let Ge of $e){let He=Rn(Ge,$e,Ve,Re,lt);if(He)Ue.set(He.moduleName,He)}for(let Ge of Le){let He=Rn(Ge,Le,Ve,Re,lt);if(He)We.set(He.filePath,He),Je?.set(He.filePath,Re(Ge[1].source))}if(Ke&&ze.size>0){let Ge=Sr(We,Re),He=ds(ze,Ge);for(let Xe of He){if(ze.has(Xe))continue;Ke.invalidate(Xe),et.delete(Xe)}for(let Xe of $e){let Ze=Re(Xe[1].source);if(!He.has(Ze)||ze.has(Ze))continue;let Qe=Rn(Xe,$e,Ve,Re,lt);if(Qe)Ue.set(Qe.moduleName,Qe)}for(let Xe of Le){let Ze=Re(Xe[1].source);if(!He.has(Ze)||ze.has(Ze))continue;let Qe=Rn(Xe,Le,Ve,Re,lt);if(Qe)We.set(Qe.filePath,Qe),Je?.set(Qe.filePath,Ze)}}let tt=Array.from(ot.values());if(Ps(tt),!Ae.dryRun)Ke?.save();let xt=Ae.resolveTypes?Cg(Ue):[],kt=Ae.checkExamples?Sg(We):[],vt=Ae.checkExamples===!0?Bl(kt,"compile"):[],De=Ae.checkExamples?Bl(kt,"syntax"):[];if(De.length>0)Tg(De);if(xt.length>0||vt.length>0){let{TypeResolver:Ge}=await import("./chunk-a5qb9706.js"),He=await Ge.create(Ie);if(!He.ok){let Ze=[xt.length>0?"resolveTypes":null,vt.length>0?"checkExamples":null].filter((Qe)=>Qe!==null).join(" and ");throw Error(`sveld: \`${Ze}\` ${He.message}.`)}let Xe=He.resolver;try{if(xt.length>0)await vg(xt,Xe,Re);if(vt.length>0)await Ag(vt,Xe,Re)}finally{await Xe?.dispose()}}let Oe=yg(We),Fe=bg(We);if(Oe.length>0||Fe.length>0){await Un();let Ge=Il();for(let{component:He,candidates:Xe}of Oe){let Ze=Dl(Re(He.filePath),Xe,Ge);xg(He,Ze)}for(let{component:He,candidates:Xe}of Fe){let Ze=Rl(Re(He.filePath),Xe,Ge);Eg(He,Ze)}}_g(We,Re);let qe=bc(es(Array.from(We.values()).flatMap((Ge)=>Ge.diagnostics??[])),Ae.diagnostics?.ignore);return{exports:Ne,entryExports:Me,components:Ue,allComponentsForTypes:We,errors:tt,diagnostics:qe,cache:Ke,resolvedPathByFilePath:Je}}function yg(s){let ve=[];for(let Ae of s.values()){let _e=Yn(Ae)?.pendingCallDefaultCandidates?.filter((Ne)=>Ne.importSource!==void 0);if(!_e||_e.length===0)continue;ve.push({component:Ae,candidates:_e})}return ve}function xg(s,ve){for(let{candidate:Ae,type:_e,failureReason:Ne}of ve){let Ie=(Ae.location==="props"?s.props:s.moduleExports).find((Re)=>Re.name===Ae.propName);if(Ie?.typeSource!=="unknown")continue;if(_e){if(Ie.type=_e,Ie.typeSource="typescript",Ae.location==="props")s.diagnostics=(s.diagnostics??[]).filter((Re)=>!(Re.kind==="prop-unknown-type"&&Re.name===Ae.propName));continue}if(Ae.location==="props"&&Ne){let Re=s.diagnostics?.find((Me)=>Me.kind==="prop-unknown-type"&&Me.name===Ae.propName);if(Re)Re.message=Ll(Ae,Ne)}}}function bg(s){let ve=[];for(let Ae of s.values()){let _e=Yn(Ae)?.pendingContextKeyCandidates;if(!_e||_e.length===0)continue;ve.push({component:Ae,candidates:_e})}return ve}function Eg(s,ve){for(let{candidate:Ae,key:_e}of ve){if(!_e){console.warn(`Warning: Could not resolve setContext key in ${s.filePath}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);continue}if(s.contexts?.some((Ne)=>Ne.key===_e))continue;s.contexts=[...s.contexts??[],{key:_e,typeName:br(_e),description:Ae.description,properties:Ae.properties,source:Ae.source}]}}function Cg(s){let ve=[];for(let Ae of s.values()){let _e=Yn(Ae);if(!_e?.canonicalPropsType||Ae.props.length>0)continue;ve.push({component:Ae,metadata:_e})}return ve}async function vg(s,ve,Ae){let _e=await ve.expandAll(s.map(({component:Ne,metadata:Le})=>({moduleName:Ne.moduleName,metadata:Le,filePath:Ae(Ne.filePath)})));for(let{component:Ne}of s){let Le=_e.get(Ae(Ne.filePath));if(Le)yc(Ne,Le)}}function Sg(s){let ve=[];for(let Ae of s.values()){let _e=fl(Ae);if(_e.length===0)continue;ve.push({component:Ae,sources:_e})}return ve}function Bl(s,ve){let Ae=[];for(let{component:_e,sources:Ne}of s){let Le=Ne.filter((Ie)=>Ie.kind===ve);if(Le.length===0)continue;Ae.push({component:_e,sources:Le})}return Ae}function Tg(s){for(let{component:ve,sources:Ae}of s){let _e=ve.diagnostics??[];for(let Ne of Ae)try{A(Ne.code)}catch(Le){if(Le instanceof T)continue;_e.push(In({component:ve.filePath,kind:"example-syntax-error",name:Ne.name,message:Le instanceof Error?Le.message:String(Le),...Ne.source?{source:Ne.source}:{}}))}ve.diagnostics=_e}}async function Ag(s,ve,Ae){let _e=await ve.checkExamples(s.map(({component:Ne,sources:Le})=>({moduleName:Ne.moduleName,filePath:Ae(Ne.filePath),sources:Le})));for(let{component:Ne,sources:Le}of s){let Ie=_e.get(Ae(Ne.filePath));if(!Ie||Ie.length===0)continue;let Re=new Map(Le.map(($e)=>[$e.id,$e.source])),Me=Ne.diagnostics??[];for(let $e of Ie){let Be=Re.get($e.id);Me.push(In({component:Ne.filePath,kind:"example-compile-error",name:$e.name,message:$e.message,...Be?{source:Be}:{}}))}Ne.diagnostics=Me}}var kg=[".ts",".tsx",".d.ts",".svelte"];function wg(s){let ve=s.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 Pg(s,ve){let Ae=tr(jl(s),ve);if(Ol(Ae)&&Fl(Ae).isFile())return Ae;if(ag(ve)!=="")return;for(let _e of kg){let Ne=`${Ae}${_e}`;if(Ol(Ne))return Ne}return}function _g(s,ve){let Ae=new Map(Array.from(s.values()).map((_e)=>[ve(_e.filePath),_e]));for(let _e of s.values()){let Ne=_e.extends;if(!Ne)continue;let Le=wg(Ne.import);if(Le===void 0||!Le.startsWith(".")&&!Le.startsWith("/"))continue;let Ie=ve(_e.filePath),Re=Pg(Ie,Le),Me=_e.diagnostics??[];if(Re===void 0){Me.push(In({component:_e.filePath,kind:"extend-props-target-missing",name:Ne.interface,message:`@extends/@extendProps target "${Le}" was not found on disk.`})),_e.diagnostics=Me;continue}let $e=Ae.get(Re);if(!$e)continue;let Be=`${$e.moduleName}Props`;if(Ne.interface!==Be){Me.push(In({component:_e.filePath,kind:"extend-props-target-missing",name:Ne.interface,message:`@extends/@extendProps names "${Ne.interface}", but "${Le}" generates "${Be}".`})),_e.diagnostics=Me;continue}for(let Ve of _e.props){let Ue=$e.props.find((We)=>We.name===Ve.name);if(Ue&&Ue.type!==Ve.type)Me.push(In({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 ql,readFileSync as Ng}from"node:fs";import{join as Ul}from"node:path";function v(s){if(s){let Ae=Ul(process.cwd(),s);if(ql(Ae))return vr(s);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=Ul(process.cwd(),"package.json");if(!ql(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=xs(JSON.parse(Ng(ve,"utf-8")));if(Ae.svelte?.trim())return vr(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 Gl=!1;function I(s){Gl=s}function Xt(s){if(!Gl)console.error(s)}import{lstatSync as Ig}from"node:fs";import{resolve as _s}from"node:path";async function Wl(s,ve,Ae=!1){let _e=Ig(s).isFile(),Ne=_e?_s(s):null,Le=ks(s,ve,Ae),{rootDir:Ie,exports:Re,allComponentEntries:Me,resolveComponentFilePath:$e}=Le,Be=Ae&&_e?await kr(_s(s)):[],Ve=Object.entries(Re),Ue=As(Me,$e),We=new Map,Ke=new Map;await Un();let Je=new Map,ze={onParseError:(tt)=>Je.set(tt.filePath,tt)},nt=()=>({exports:Re,entryExports:Be,components:We,allComponentsForTypes:Ke,errors:Array.from(Je.values()),diagnostics:es(Array.from(Ke.values()).flatMap((tt)=>tt.diagnostics??[]))});{let tt=Xi([Ve,Me],$e),xt=await ws(tt);for(let kt of Ve){let vt=Rn(kt,Ve,xt,$e,ze);if(vt)We.set(vt.moduleName,vt)}for(let kt of Me){let vt=Rn(kt,Me,xt,$e,ze);if(vt)Ke.set(vt.filePath,vt)}Ps(nt().errors)}let ot=Sr(Ke,$e),et=(tt,xt,kt,vt,De)=>{let Oe=new Set;for(let Fe of kt){let qe=$e(Fe[1].source);if(!vt.has(qe))continue;let Ge=Rn(Fe,kt,De,$e,ze);if(Ge)tt.set(xt(Ge),Ge),Oe.add(qe);else for(let[He,Xe]of tt)if($e(Xe.filePath)===qe)tt.delete(He)}return Oe};return{get result(){return nt()},update:async(tt)=>{let xt=tt.map((He)=>_s(He));if(gs(),xt.length===0)return{result:nt(),reparsed:[]};let kt=Ne!==null&&xt.includes(Ne),vt=[];if(kt){let He=ks(s,ve,Ae),Xe=new Set(Object.keys(Re)),Ze=new Set(Object.keys(He.exports));for(let Qe of Xe)if(!Ze.has(Qe))We.delete(Qe);for(let Qe of Ze)if(!Xe.has(Qe))vt.push(He.resolveComponentFilePath(He.exports[Qe].source));if(Re=He.exports,Me=He.allComponentEntries,$e=He.resolveComponentFilePath,Ve=Object.entries(Re),Ue=As(Me,$e),Ae&&_e)Be=await kr(_s(s))}if(ve)zi(Ie,Re,Me,$e,Ue);let De=xt.filter((He)=>Dn.test(He)||ot.has(He));if(De.length===0&&vt.length===0)return{result:nt(),reparsed:[]};let Oe=ds([...De,...vt],ot);for(let[He,Xe]of Je)if(Oe.has($e(Xe.filePath)))Je.delete(He);let Fe=await ws(Oe),qe=new Set;for(let He of et(We,(Xe)=>Xe.moduleName,Ve,Oe,Fe))qe.add(He);for(let He of et(Ke,(Xe)=>Xe.filePath,Me,Oe,Fe))qe.add(He);ot=Sr(Ke,$e);let Ge=nt();return Ps(Ge.errors),{result:Ge,reparsed:Array.from(qe)}}}}import Kg from"node:path";import{mkdir as Dg,readFile as Lg,writeFile as Rg}from"node:fs/promises";import{parse as Og}from"node:path";class Bt{dryRun;ensuredDirs=new Set;constructor(s){this.dryRun=s?.dryRun===!0}async write(s,ve){if(this.dryRun)return console.log(`would write "${e(s)}"`),!0;try{if(await Lg(s,"utf-8")===ve)return!1}catch{}let Ae=Og(s).dir;if(!this.ensuredDirs.has(Ae))await Dg(Ae,{recursive:!0}),this.ensuredDirs.add(Ae);return await Rg(s,ve),!0}}var Mg=/^=>\s*/;function Bg(s){let ve=s.trim();if(!ve.startsWith("("))return{parameters:[],returnTypeText:ve||"any"};let Ae=0,_e=-1;for(let Re=0;Re<ve.length;Re++)if(ve[Re]==="(")Ae++;else if(ve[Re]===")"){if(Ae--,Ae===0){_e=Re;break}}if(_e===-1)return{parameters:[],returnTypeText:"any"};let Ne=ve.slice(1,_e).trim(),Le=ve.slice(_e+1).trim().replace(Mg,"");return{parameters:Ne===""?[]:fn(Ne).map((Re)=>{let Me=Re.trim(),$e=Me.startsWith("..."),Be=$e?Me.slice(3):Me,Ve=Be.indexOf(":"),Ue=(Ve===-1?Be:Be.slice(0,Ve)).trim(),We=Ve===-1?void 0:Be.slice(Ve+1).trim(),Ke=Ue.endsWith("?");return{name:Ke?Ue.slice(0,-1):Ue,...We?{type:{text:We}}:{},...Ke?{optional:!0}:{},...$e?{rest:!0}:{}}}),returnTypeText:Le||"any"}}function $g(s){if(s.params!==void 0||s.returnType!==void 0)return{parameters:(s.params??[]).map((Ae)=>({name:Ae.name,...Ae.type?{type:{text:Ae.type}}:{},...Ae.optional?{optional:!0}:{}})),returnTypeText:s.returnType??"any"};return s.type?Bg(s.type):{parameters:[],returnTypeText:"any"}}function Fg(s){return s.map((ve)=>{if(ve.isFunctionDeclaration){let{parameters:Ae,returnTypeText:_e}=$g(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 jg(s){let ve=s.customElement?.props,Ae=new Map,_e=[];for(let Ne of s.props){if(Ne.isFunctionDeclaration)continue;let Le=ve?.[Ne.name];if(Le?.attribute===!1)continue;let Ie=Le?.attribute||Ne.name.toLowerCase(),Re=Ae.get(Ie);if(Re!==void 0){console.warn(`sveld: props "${Re}" and "${Ne.name}" of component "${s.moduleName}" both map to the custom-element attribute "${Ie}"; only "${Re}" is included.`);continue}Ae.set(Ie,Ne.name);let $e=Le?.type==="Array"||Le?.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}:{},...Le?.reflect?{reflects:!0}:{}})}return _e}function Vg(s){if(!s||s.length===0)return;return s.map((ve)=>({name:ve.name,...ve.description?{description:ve.description}:{}}))}function qg(s){if(!s||s.length===0)return;return s.map((ve)=>({name:ve.name,...ve.type?{type:{text:ve.type}}:{},...ve.default===void 0?{}:{default:ve.default},...ve.description?{description:ve.description}:{}}))}function Ug(s){return s.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 Gg(s){return s.map((ve)=>({name:ve.default?"":ve.name??"",...ve.description?{description:ve.description}:{},...ve.deprecated===void 0?{}:{deprecated:ve.deprecated}}))}function Wg(s){let ve=Vg(s.cssParts),Ae=qg(s.cssProperties),_e={kind:"class",name:s.moduleName,...s.componentComment?{description:s.componentComment}:{},members:Fg(s.props),attributes:jg(s),events:Ug(s.events),slots:Gg(s.slots),...ve?{cssParts:ve}:{},...Ae?{cssProperties:Ae}:{}};if(s.customElementTag)_e.tagName=s.customElementTag,_e.customElement=!0;return _e}function Hg(s,ve){let Ae=[{kind:"js",name:s.moduleName,declaration:{name:s.moduleName,module:ve}}];if(s.customElementTag)Ae.push({kind:"custom-element-definition",name:s.customElementTag,declaration:{name:s.moduleName,module:ve}});return Ae}function Hl(s,ve={}){let Ae=i(s),_e=ve.resolveModulePath??((Le)=>Le.filePath);return{schemaVersion:"1.0.0",modules:Ae.components.map((Le)=>{let Ie=_e(Le);return{kind:"javascript-module",path:Ie,declarations:[Wg(Le)],exports:Hg(Le,Ie)}})}}function Ji(s,ve){let Ae=Hl(s,{resolveModulePath:(_e)=>os(_e.filePath,ve.inputDir)});return qn(Ae)}async function Yi(s,ve){let Ae=Ji(s,ve),_e=Kg.join(process.cwd(),ve.outFile),Le=await new Bt({dryRun:ve.dryRun}).write(_e,Ae);if(!ve.dryRun)Xt(`${Le?"created":"unchanged"} "${ve.outFile}".`)}import Qi from"node:path";function Kl(s){let ve=new Map;for(let[_e,Ne]of Object.entries(s)){let Le=ve.get(Ne.source)||[];Le.push({id:_e,exportee:Ne}),ve.set(Ne.source,Le)}let Ae=[];for(let[_e,Ne]of ve){let Le=Dn.test(_e),Ie=Ne.some(({id:Ue,exportee:We})=>Ue!=="default"&&We.default),Re=Ne.some(({exportee:Ue})=>!Ue.default),Me=Le&&Ie&&Re,$e=[],Be=[],Ve=[];for(let{id:Ue,exportee:We}of Ne){if(Ue==="default"){Be.push(`export { default } from "${_e}";`);continue}if(We.default)if(We.mixed)Be.push(`export { default as ${Ue} } from "${_e}";`),Be.push(`export { default } from "${_e}";`);else Ve.push(`default as ${Ue}`);else if(Le&&!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 zl(s){return s.replace(Dn,"")}function Xl(s){return s.replace(Dn,".svelte.d.ts")}function zg(s){return typeof s==="object"&&s!==null&&!Array.isArray(s)&&"start"in s&&"end"in s}function wr(s){if(Array.isArray(s))return s.map((ve)=>wr(ve));if(s!==null&&typeof s==="object"){let ve={};for(let[Ae,_e]of Object.entries(s)){if((Ae==="source"||Ae==="componentCommentSource")&&zg(_e))continue;ve[Ae]=wr(_e)}return ve}return s}function Zi(s,ve){return s.map((Ae)=>({...Ae,filePath:os(Ae.filePath,ve)}))}function Xg(s,ve,Ae){if(!ve)return`${s.moduleName}.api.json`;if(!Ae.has(s.moduleName))Ae.add(s.moduleName),console.warn(`Warning: multiple components named "${s.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${zl(s.filePath)}.api.json`}async function Jg(s,ve){let Ae=i(s),_e=Zi(Ae.components,ve.inputDir);if(ve.source===!1)_e=wr(_e);let Ne=new Map;for(let Ie of _e)Ne.set(Ie.moduleName,(Ne.get(Ie.moduleName)??0)+1);let Le=new Set;await Promise.all(_e.map(async(Ie)=>{let Re=(Ne.get(Ie.moduleName)??0)>1,Me=Xg(Ie,Re,Le),$e=Qi.resolve(Qi.join(ve.outDir||"",Me)),Ve=await new Bt({dryRun:ve.dryRun}).write($e,qn(Ie));if(!ve.dryRun)Xt(`${Ve?"created":"unchanged"} "${$e}".`)}))}function eo(s,ve){let Ae=i(s,{entryExports:ve.entryExports}),_e={...Ae,components:Zi(Ae.components,ve.inputDir)};if(ve.source===!1)_e=wr(_e);return qn(_e)}function Jl(s,ve){let Ae=i(s,{entryExports:ve.entryExports}),_e=Zi(Ae.components,ve.inputDir);if(ve.source===!1)_e=wr(_e);return`${_e.map((Ne)=>JSON.stringify(Ne)).join(`
|
|
43
|
-
`)}
|
|
44
|
-
`}async function Yg(s,ve){let Ae=eo(s,ve),_e=Qi.join(process.cwd(),ve.outFile),Le=await new Bt({dryRun:ve.dryRun}).write(_e,Ae);if(!ve.dryRun)Xt(`${Le?"created":"unchanged"} "${ve.outFile}".`)}async function to(s,ve){if(ve.outDir)await Jg(s,ve);else await Yg(s,ve)}import Fs from"node:path";import{readFileSync as Qg}from"node:fs";import{join as Zg}from"node:path";function Yl(){try{let{name:s,description:ve}=xs(JSON.parse(Qg(Zg(process.cwd(),"package.json"),"utf-8")));return{name:s,description:ve}}catch{return{}}}var ey=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var ty=/[ \t]+$/,Zl=/\s/,ny=/\s{2}|[^\S ]/;function ry(s){return ey.test(s.slice(-200))}var Ql=[""];function no(s){let ve=Ql[s];if(ve===void 0)ve=" ".repeat(s),Ql[s]=ve;return ve}function sy(s,ve){let Ae="";for(let _e=s.length-1;_e>=0&&Ae.length<ve;_e--)Ae=s[_e]+Ae;return Ae.length>ve?Ae.slice(-ve):Ae}function iy(s){if(s.length===0)return!1;let ve=s[s.length-1];return ve.charCodeAt(ve.length-1)===10}function oy(s){while(s.length>0){let ve=s[s.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){s.pop();continue}s[s.length-1]=ve.slice(0,Ae);return}}function ay(s){while(s.length>0){let ve=s[s.length-1];if(!Zl.test(ve[ve.length-1]))return;let Ae=ve.trimEnd();if(Ae.length===ve.length)return;if(Ae.length===0){s.pop();continue}s[s.length-1]=Ae;return}}function cy(s){if(s.includes("{"))return!1;let ve=0,Ae=0;for(let _e=0;_e<s.length;_e++){let Ne=s.charCodeAt(_e);if(ve!==0){if(Ne===ve&&s.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 ly(s){if(!ny.test(s))return s.trimEnd();let ve="",Ae=null,_e=!1;for(let Ne=0;Ne<s.length;Ne++){let Le=s[Ne],Ie=s[Ne-1];if(Ae){if(ve+=Le,Ae==="double"&&Le==='"'&&Ie!=="\\"||Ae==="single"&&Le==="'"&&Ie!=="\\"||Ae==="template"&&Le==="`"&&Ie!=="\\")Ae=null;_e=!1;continue}if(Le==='"'||Le==="'"||Le==="`"){Ae=Le==='"'?"double":Le==="'"?"single":"template",ve+=Le,_e=!1;continue}if(Zl.test(Le)){if(!_e&&ve.length>0)ve+=" ",_e=!0;continue}ve+=Le,_e=!1}return ve.trimEnd()}function py(s){let ve=new Int32Array(s.length).fill(-1),Ae=[],_e=0;for(let Ne=0;Ne<s.length;Ne++){let Le=s.charCodeAt(Ne);if(_e===4){if(Le===47&&s.charCodeAt(Ne-1)===42)_e=0;continue}if(_e===1){if(Le===34&&s.charCodeAt(Ne-1)!==92)_e=0;continue}if(_e===2){if(Le===39&&s.charCodeAt(Ne-1)!==92)_e=0;continue}if(_e===3){if(Le===96&&s.charCodeAt(Ne-1)!==92)_e=0;continue}if(Le===47){if(s.charCodeAt(Ne+1)===42)_e=4}else if(Le===34)_e=1;else if(Le===39)_e=2;else if(Le===96)_e=3;else if(Le===123)Ae.push(Ne);else if(Le===125&&Ae.length>0)ve[Ae.pop()]=Ne}return ve}function ep(s,ve,Ae,_e){let Ne=[],Le=0,Ie=ve;for(let Re=ve;Re<Ae;Re++){let Me=s.charCodeAt(Re);if(Le===4){if(Me===47&&s.charCodeAt(Re-1)===42)Le=0;continue}if(Le===1){if(Me===34&&s.charCodeAt(Re-1)!==92)Le=0;continue}if(Le===2){if(Me===39&&s.charCodeAt(Re-1)!==92)Le=0;continue}if(Le===3){if(Me===96&&s.charCodeAt(Re-1)!==92)Le=0;continue}if(Me===47){if(s.charCodeAt(Re+1)===42)Le=4;continue}if(Me===34){Le=1;continue}if(Me===39){Le=2;continue}if(Me===96){Le=3;continue}if(Me===123){let $e=_e[Re];if($e===-1||$e>=Ae)continue;if(Ie<Re)Ne.push(s.slice(Ie,Re));let Be=Re+1,Ve=s.slice(Be,$e);if(Ve.trim()===""){Ne.push("{}"),Re=$e,Ie=$e+1;continue}let Ue=s.charCodeAt(Be)===10;if(!Ue&&!Ve.includes("/*")&&!cy(Ve)&&!ry(sy(Ne,200))){let We=ep(s,Be,$e,_e),Ke=We.trim();if(!Ke.includes(`
|
|
45
|
-
`)){let Je=Ke.endsWith(";")?Ke.slice(0,-1):Ke,ze=`{ ${ly(Je)} }`;if(ze.length<=120){Ne.push(ze),Re=$e,Ie=$e+1;continue}}if(Ne.push("{"),We.charCodeAt(0)!==59)Ne.push(`
|
|
46
|
-
`);if(We.length>0)Ne.push(We);Re=$e-1,Ie=$e;continue}if(Ne.push("{"),!Ue)Ne.push(`
|
|
47
|
-
`);Ie=Be;continue}if(Me===125){if(Ie<Re)Ne.push(s.slice(Ie,Re));if(oy(Ne),!iy(Ne))Ne.push(`
|
|
48
|
-
`);Ne.push("}"),Ie=Re+1;continue}if(Me===59){if(Ie<Re)Ne.push(s.slice(Ie,Re));if(ay(Ne),Ne.push(";"),s.charCodeAt(Re+1)!==10)Ne.push(`
|
|
49
|
-
`);Ie=Re+1}}if(Ie<Ae)Ne.push(s.slice(Ie,Ae));return Ne.join("")}function uy(s){return ep(s,0,s.length,py(s))}function fy(s){if(!s.includes(" "))return s;let ve="",Ae=0;for(let _e=0;_e<s.length;_e++){let Ne=s.charCodeAt(_e);if(Ae!==0){if(ve+=s[_e],Ne===Ae&&s.charCodeAt(_e-1)!==92)Ae=0;continue}if(Ne===34||Ne===39||Ne===96){Ae=Ne,ve+=s[_e];continue}if(Ne===32&&ve.charCodeAt(ve.length-1)===32)continue;ve+=s[_e]}return ve}function tp(s){let ve=s.charCodeAt(0);return ve===125||ve===93||ve===41||ve===62}function hy(s){let ve=s.split(`
|
|
50
|
-
`),Ae=[],_e=0,Ne=!1,Le=0;for(let Ie=0;Ie<ve.length;Ie++){let Re=ve[Ie].trim();if(Re===""){Ae.push("");continue}if(Ne){if(Ae.push(`${no(Le)} ${Re}`),Re.includes("*/"))Ne=!1;continue}if(Re.startsWith("/**")&&!Re.includes("*/")){Ae.push(no(_e)+Re),Ne=!0,Le=_e;continue}let Me=fy(Re),$e=Math.max(0,_e-(tp(Me)?1:0));if(Ae.push(no($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 dy(s){let ve=[];for(let Ae=0;Ae<s.length;Ae++){let _e=s[Ae],Ne=_e.charCodeAt(_e.length-1);if(Ne===32||Ne===9)_e=_e.replace(ty,"");let Le=ve.length>0?ve[ve.length-1]:void 0,Ie=Le==="";if(_e===""){if(Le===void 0||Ie)continue;let Re=Le.charCodeAt(Le.length-1);if(Re===123||Re===40||Re===91)continue;ve.push(_e);continue}if(Ie&&tp(_e))ve.pop();ve.push(_e)}while(ve.length>0&&ve[ve.length-1]==="")ve.pop();return ve.join(`
|
|
51
|
-
`)}function np(s){return`${dy(hy(uy(s)))}
|
|
52
|
-
`}var Tn="any",cn="",my="Record<string, any>",so="Record<string, never>",gy=/^[A-Za-z_$][A-Za-z0-9_$]*$/,yy=/CustomEvent/,xy=/^[A-Z]/,by=/\n/,op=/=>/,Ey=/(?:^|\n)@default\b/,io=/\n/g,Cy=/\s+/g,nr=/(^|[^.\w])Snippet(?:\s*<|\b)/,vy=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,Sy=/[.*+?^${}()|[\]\\]/g,Ty=/^const\s+/;function oo(s){return s.replace(Ty,"")}function Ay(s){if(!s)return;return s.replace(io,`
|
|
53
|
-
* `)}function Ns(s){if(!s)return"";return`/** ${s} */`}function Is(s){if(!s)return"";return`/**
|
|
54
|
-
* ${s.replace(io,`
|
|
55
|
-
* `)}
|
|
56
|
-
*/`}function ap(s){if(s===void 0)return;return s===!0?"@deprecated":`@deprecated ${s}`}function ky(s){let ve=ap(s);if(ve===void 0)return;return`* ${ve.replace(io,`
|
|
57
|
-
* `)}
|
|
58
|
-
`}function wy(s,ve){if(!ve)return[`@${s}`];if(!ve.includes(`
|
|
59
|
-
`))return[`@${s} ${ve}`];return[`@${s}`,...ve.split(`
|
|
60
|
-
`)]}function ao(s){let ve=[];for(let{name:Ae,body:_e}of s??[])ve.push(...wy(Ae,_e));return ve}function Pr(s,ve,Ae){let _e=ap(Ae),Ne=ao(ve),Le=Ne.length>0;if(!s&&!Le&&!_e)return"";if(!Le&&!_e)return s?.includes(`
|
|
61
|
-
`)?Is(s):Ns(s);let Ie=[];if(s)Ie.push(...s.split(`
|
|
62
|
-
`));if(Ie.push(...Ne),_e)Ie.push(..._e.split(`
|
|
63
|
-
`));return`/**
|
|
64
|
-
* ${Ie.join(`
|
|
65
|
-
* `)}
|
|
66
|
-
*/`}function Py(s){let ve=ao(s);if(ve.length===0)return"";return ve.map((Ae)=>`* ${Ae}
|
|
67
|
-
`).join("")}function Ds(s){if(s===void 0)return Tn;return`${s}
|
|
68
|
-
`}function sr(s){if(s.typedefs.length===0)return cn;return s.typedefs.map((ve)=>{let Ae=ao(ve.tags),_e;if(Ae.length===0)_e=ve.description?`${Is(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 rp=new Map;function cp(s,ve){let Ae=rp.get(ve);if(Ae===void 0){let _e=ve.replace(Sy,"\\$&");Ae=new RegExp(`\\b${_e}\\b`),rp.set(ve,Ae)}return Ae.test(s)}var sp,ip=[];function co(s){if(s!==sp)sp=s,ip=fn(s);return ip}function _y(s){if(s===null)return[];return s[0].split(",").map((ve,Ae)=>({name:ve.trim(),constraint:(co(s[1]??"")[Ae]??ve).trim()}))}function Ny(s,ve){let Ae=_y(s).filter(({name:_e})=>cp(ve,_e));if(Ae.length===0)return{declSuffix:cn,refSuffix:cn};return{declSuffix:`<${Ae.map(({constraint:_e})=>oo(_e)).join(", ")}>`,refSuffix:`<${Ae.map(({name:_e})=>_e).join(", ")}>`}}function lp(s){if(!s.contexts||s.contexts.length===0)return cn;let ve=s.generics===null?[]:s.generics[0].split(",").map((Ae,_e)=>({name:Ae.trim(),constraint:(co(s.generics?.[1]??"")[_e]??Ae).trim()}));return s.contexts.map((Ae)=>{let _e=Ae.properties.map((Me)=>{let $e=Me.description?`${Ns(Me.description)}
|
|
77
|
-
`:"",Be=Me.optional?"?":"";return`${$e}${Me.name}${Be}: ${Me.type};`}).join(`
|
|
78
|
-
`),Ne=Ae.description?`${Is(Ae.description)}
|
|
79
|
-
`:"",Le=ve.filter(({name:Me})=>Ae.properties.some(($e)=>cp($e.type,Me))).map(({constraint:Me})=>Me),Ie=Le.length>0?`<${Le.map(oo).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 Re=Ae.hasUnresolvedSpread?" & Record<string, any>":"";return`${Ne}export type ${Ae.typeName}${Ie} = {
|
|
80
|
-
${_e}
|
|
81
|
-
}${Re};`}).join(`
|
|
82
|
-
|
|
83
|
-
`)}function rr(s){return gy.test(s)?s:JSON.stringify(s)}function pp(s,ve){if(!s)return;return`* ${ve||s}
|
|
84
|
-
`}function lo(s,ve,Ae){return[pp(Ay(s)),ky(ve),Py(Ae)].filter(Boolean).join("")}function po(s){return s.length>0?`/**
|
|
85
|
-
${s}*/`:cn}function Iy(s){let ve=s.props.filter((ze)=>!ze.isFunctionDeclaration&&ze.kind!=="const"),Ae=new Set([...ve.map((ze)=>ze.name),...Array.from(s.canonicalPropNames??[])]),_e=ve.map((ze)=>{let nt=typeof ze.value==="string"?ze.value.replace(Cy," "):ze.value,et=Ey.test(ze.description??"")||ze.value===void 0,lt=[lo(ze.description,ze.deprecated,ze.tags),pp(ze.constant,"@constant"),et?null:`* @default ${nt}
|
|
86
|
-
`].filter(Boolean).join(""),tt=ze.constant&&!ze.isFunction?ze.value:ze.type||Tn;return`
|
|
87
|
-
${po(lt)}
|
|
88
|
-
${rr(ze.name)}${ze.isRequired?"":"?"}: ${tt};`}),Ne=s.canonicalPropsType?_e.filter((ze,nt)=>{let ot=ve[nt];return ot?!(s.canonicalPropNames?.has(ot.name)??!1):!0}):_e,Le=(s.slots||[]).filter((ze)=>!ze.default&&ze.name!=null&&!Ae.has(ze.name)).map((ze)=>{let nt=ze.name,ot=rr(nt),et=Pr(ze.description,ze.tags,ze.deprecated),lt=et?`${et}
|
|
89
|
-
`:"",xt=ze.slot_props&&ze.slot_props!=="Record<string, never>"?`(this: void, ...args: [${ze.slot_props}]) => void`:"(this: void) => void";return`
|
|
90
|
-
${lt}${ot}?: ${xt};`}),Ie=(s.slots||[]).find((ze)=>ze.default||ze.name===null),Re=Ie&&!Ae.has("children")?(()=>{let ze=Pr(Ie.description,Ie.tags,Ie.deprecated),nt=ze?`${ze}
|
|
91
|
-
`:"",et=Ie.slot_props&&Ie.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Ie.slot_props}]) => void`:"(this: void) => void";return`
|
|
92
|
-
${nt}children?: ${et};`})():"",Me=s.events?By({events:s.events},Ae):[],$e=[...Le,Re,...Me].filter(Boolean),Be=[...Ne,...$e].join(`
|
|
93
|
-
`),Ve=`${s.moduleName}Props`,Ue=cn,We=s.generics?`<${co(s.generics[1]).map((ze)=>oo(ze.trim())).join(", ")}>`:"",Ke=s.generics?`<${s.generics[0]}>`:"",Je=s.canonicalPropsType?`
|
|
94
|
-
type $Props${We} = ${s.canonicalPropsType}${Be.trim()===""?"":` & {${Be}
|
|
95
|
-
}`};
|
|
96
|
-
`:`
|
|
97
|
-
type $Props${We} = {
|
|
98
|
-
${Be}
|
|
99
|
-
};
|
|
100
|
-
`;if(s.rest_props?.type==="Element"){let ze;if(s.rest_props.name==="svelte:element")if(s.rest_props.thisValue)ze=`SvelteHTMLElements["${s.rest_props.thisValue}"]`;else ze="HTMLAttributes<HTMLElement>";else ze=s.rest_props.name.split("|").map((et)=>`SvelteHTMLElements["${et.trim()}"]`).join(" & ");let nt="[key: `data-${string}`]: unknown;",ot=s.rest_props.description?s.rest_props.description.includes(`
|
|
101
|
-
`)?`${Is(s.rest_props.description)}
|
|
102
|
-
`:`${Ns(s.rest_props.description)}
|
|
103
|
-
`:"";if(s.extends===void 0)Ue=`
|
|
104
|
-
${ot}${ze?`type $RestProps = ${ze};
|
|
105
|
-
`:""}
|
|
106
|
-
${s.canonicalPropsType?`type $Props${We} = (${s.canonicalPropsType}) & {${Be}
|
|
107
|
-
|
|
108
|
-
${nt}
|
|
109
|
-
};`:`type $Props${We} = {
|
|
110
|
-
${Be}
|
|
111
|
-
|
|
112
|
-
${nt}
|
|
113
|
-
};`}
|
|
114
|
-
|
|
115
|
-
export type ${Ve}${We} = Omit<$RestProps, keyof $Props${Ke}> & $Props${Ke};
|
|
116
|
-
`;else Ue=`
|
|
117
|
-
${ot}${ze?`type $RestProps = ${ze};
|
|
118
|
-
`:""}
|
|
119
|
-
${s.canonicalPropsType?`type $Props${We} = (${s.canonicalPropsType}) & {${Be}
|
|
120
|
-
|
|
121
|
-
${nt}
|
|
122
|
-
};`:`type $Props${We} = {
|
|
123
|
-
${Be}
|
|
124
|
-
|
|
125
|
-
${nt}
|
|
126
|
-
};`}
|
|
127
|
-
|
|
128
|
-
export type ${Ve}${We} = Omit<$RestProps, keyof ($Props${Ke} & ${s.extends.interface})> & Omit<${s.extends.interface}, keyof $Props${Ke}> & $Props${Ke};
|
|
129
|
-
`}else if(Be.trim()===""&&s.extends===void 0&&!s.canonicalPropsType)Ue=`
|
|
130
|
-
export type ${Ve}${We} = ${so};
|
|
131
|
-
`;else if(s.canonicalPropsType)Ue=`
|
|
132
|
-
${Je}
|
|
133
|
-
export type ${Ve}${We} = ${s.extends===void 0?"":`Omit<${s.extends.interface}, keyof $Props${Ke}> & `}$Props${Ke};
|
|
134
|
-
`;else if(s.extends===void 0)Ue=`
|
|
135
|
-
export type ${Ve}${We} = {
|
|
136
|
-
${Be}
|
|
137
|
-
};
|
|
138
|
-
`;else Ue=`
|
|
139
|
-
type $Props${We} = {
|
|
140
|
-
${Be}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export type ${Ve}${We} = Omit<${s.extends.interface}, keyof $Props${Ke}> & $Props${Ke};
|
|
144
|
-
`;return{props_name:Ve,prop_def:Ue}}function Dy(s){if(s.slots.length===0)return so;let ve=s.slots.map(({name:Ae,slot_props:_e,...Ne})=>{let Le=Ne.default||Ae===null?"default":rr(Ae??""),Ie=Pr(Ne.description,Ne.tags,Ne.deprecated);return`${Ie?`${Ie}
|
|
145
|
-
`:""}${Le}: ${Ds(_e)};`}).join(`
|
|
146
|
-
`);return s.slots.length===1?`{${ve}}`:`{
|
|
147
|
-
${ve}
|
|
148
|
-
}`}var Ly=()=>"WindowEventMap",Ry=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 ro(s=Tn){if(yy.test(s))return s;return`CustomEvent<${s}>`}function Oy(s){return Ry.has(s)}function up(s){switch(s.type){case"dispatched":return ro(s.detail);case"forwarded":{let ve=s.element,_e=!(ve&&xy.test(ve))||Oy(s.name),Ne=s.detail!==void 0&&s.detail!=="undefined"&&!(s.detail==="null"&&_e),Le=s.detail==="null"&&!_e;if(Ne||Le)return ro(s.detail);else if(_e)return`${Ly()}["${s.name}"]`;else return ro()}default:return s}}function My(s){if(s.events.length===0)return my;let ve=s.events.map((Ae)=>{let _e="",Ne=Pr(Ae.description,Ae.tags,Ae.deprecated);if(Ne)_e=`${Ne}
|
|
149
|
-
`;return`${_e}${rr(Ae.name)}: ${up(Ae)};
|
|
150
|
-
`}).join("");return s.events.length===1?`{${ve}}`:`{
|
|
151
|
-
${ve}}`}function By(s,ve){return s.events.map((Ae)=>{let _e=`on${Ae.name}`;if(ve.has(_e))return;let Ne="",Le=Pr(Ae.description,Ae.tags,Ae.deprecated);if(Le)Ne=`${Le}
|
|
152
|
-
`;return`
|
|
153
|
-
${Ne}${rr(_e)}?: (event: ${up(Ae)}) => void;`}).filter((Ae)=>Ae!==void 0)}function $y(s){let ve=s.type==="() => any";if(s.type&&op.test(s.type)&&!ve)return s.type;else if(s.params&&s.params.length>0){let _e=s.params.map((Le)=>{let Ie=Le.optional?"?":"";return`${Le.name}${Ie}: ${Le.type}`}).join(", "),Ne=s.returnType||Tn;return`(${_e}) => ${Ne}`}else if(s.returnType)return`() => ${s.returnType}`;else return s.type||Tn}function fp(s){return s.props.filter((ve)=>ve.isFunctionDeclaration||ve.kind==="const").map((ve)=>{let Ae=lo(ve.description,ve.deprecated,ve.tags),_e=$y(ve);return`
|
|
154
|
-
${po(Ae)}
|
|
155
|
-
${rr(ve.name)}: ${_e};`}).join(`
|
|
156
|
-
`)}function Fy(s){let ve=`${s.moduleName}Exports`,Ae=fp({props:s.props});if(Ae.trim()==="")return{exports_name:ve,exports_ref:ve,exports_def:`export type ${ve} = ${so};`};let{declSuffix:_e,refSuffix:Ne}=Ny(s.generics,Ae);return{exports_name:ve,exports_ref:`${ve}${Ne}`,exports_def:`export type ${ve}${_e} = {${Ae}
|
|
157
|
-
};`}}function jy(s){let ve=s.props.filter((Ae)=>Ae.bindable===!0||Ae.binding==="writable").map((Ae)=>JSON.stringify(Ae.name));return ve.length===0?cn:ve.join(" | ")}function Vy(s){let ve=s.moduleName==="default"?"$$Component":s.moduleName,Ae=s.bindings===cn?'""':s.bindings;return`declare const ${ve}: Component<
|
|
158
|
-
${s.propsRef},
|
|
159
|
-
${s.exportsRef},
|
|
160
|
-
${Ae}
|
|
161
|
-
>;
|
|
162
|
-
export default ${ve};`}function qy(s){let ve=s.moduleName==="default"?"$$Component":s.moduleName,Ae=`${ve}Component`,_e=s.bindings===cn?'""':s.bindings;return`interface ${Ae} {
|
|
163
|
-
new ${s.generic}(
|
|
164
|
-
options: ComponentConstructorOptions<${s.propsRef}>
|
|
165
|
-
): SvelteComponent<${s.propsRef}> & ${s.exportsRef};
|
|
166
|
-
${s.generic}(
|
|
167
|
-
this: void,
|
|
168
|
-
internals: ComponentInternals,
|
|
169
|
-
props: ${s.propsRef}
|
|
170
|
-
): {
|
|
171
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
172
|
-
$set?(props: Partial<${s.propsRef}>): void;
|
|
173
|
-
} & ${s.exportsRef};
|
|
174
|
-
element?: typeof HTMLElement;
|
|
175
|
-
z_$$bindings?: ${_e};
|
|
176
|
-
}
|
|
177
|
-
declare const ${ve}: ${Ae};
|
|
178
|
-
export default ${ve};`}function Uy(s){if(s.extends===void 0)return"";return`import type { ${s.extends.interface} } from ${s.extends.import};`}function Gy(s){if(!s.componentComment)return"";if(!by.test(s.componentComment))return Ns(s.componentComment.trim());return`/*${s.componentComment.split(`
|
|
179
|
-
`).map((ve)=>`* ${ve}`).join(`
|
|
180
|
-
`)}
|
|
181
|
-
*/`}function Wy(s){return s.moduleExports.map((ve)=>{let Ae=lo(ve.description,ve.deprecated,ve.tags),_e,Ne=ve.type&&op.test(ve.type),Le=ve.type==="() => any";if(ve.kind==="const"&&!Ne)_e=`export declare const ${ve.name}: ${ve.type||Tn};
|
|
182
|
-
`;else if(ve.params&&ve.params.length>0){let Re=ve.params.map(($e)=>{let Be=$e.optional?"?":"";return`${$e.name}${Be}: ${$e.type}`}).join(", "),Me=ve.returnType||Tn;_e=`export declare function ${ve.name}(${Re}): ${Me};`}else if(ve.returnType)_e=`export declare function ${ve.name}(): ${ve.returnType};`;else if(Ne&&ve.type&&!Le){let[Ie,Re,...Me]=ve.type.split("=>"),$e=Me.map((Be)=>` => ${Be.trim()}`).join("");_e=`export declare function ${ve.name}${Ie.trimEnd()}: ${Re.trim()}${$e};`}else if(Ne&&ve.type){let[Ie,Re,...Me]=ve.type.split("=>"),$e=Me.map((Be)=>` => ${Be.trim()}`).join("");_e=`export declare function ${ve.name}${Ie.trimEnd()}: ${Re.trim()}${$e};`}else if(ve.kind==="const")_e=`export declare const ${ve.name}: ${ve.type||Tn};
|
|
183
|
-
`;else _e=`export type ${ve.name} = ${ve.type||Tn};`;return`
|
|
184
|
-
${po(Ae)}
|
|
185
|
-
${_e}`}).join(`
|
|
186
|
-
`)}var Hy=120;function Ky(s){let Ae=`export default class ${s.moduleName==="default"?"":s.moduleName}${s.generic} extends SvelteComponentTyped<`,_e=[s.genericProps,s.events,s.slots];if(s.accessors.trim()===""&&_e.every((Ne)=>!Ne.includes(`
|
|
187
|
-
`))){let Ne=`${Ae}${_e.join(", ")}> {}`;if(Ne.length<=Hy)return Ne}return`${Ae}
|
|
188
|
-
${s.genericProps},
|
|
189
|
-
${s.events},
|
|
190
|
-
${s.slots}
|
|
191
|
-
> {
|
|
192
|
-
${s.accessors}
|
|
193
|
-
}`}function uo(s,ve){let Ae=Yn(s),{moduleName:_e,typedefs:Ne,generics:Le,props:Ie,moduleExports:Re,slots:Me,events:$e,rest_props:Be,extends:Ve,componentComment:Ue,contexts:We,syntaxMode:Ke}=s,Je=ve?.format==="component",ze=Le!==null,{props_name:nt,prop_def:ot}=Iy({moduleName:_e,props:Ie,rest_props:Be,extends:Ve,generics:Le,slots:Me,canonicalPropNames:new Set(Ae?.canonicalPropNames??[]),canonicalPropsType:Ae?.canonicalPropsType,events:Je&&Ke==="legacy"?$e:void 0}),et=Le?`<${Le[1]}>`:"",lt=Le?`${nt}<${Le[0]}>`:nt,tt=Wy({moduleExports:Re}),xt=sr({typedefs:Ne}),kt=lp({contexts:We,generics:Le}),vt=(Ae?.typeImportStatements??[]).join(`
|
|
194
|
-
`),De=(Ae?.localTypeDeclarations??[]).join(`
|
|
195
|
-
|
|
196
|
-
`),{exports_ref:Oe,exports_def:Fe}=Je?Fy({props:Ie,moduleName:_e,generics:Le}):{exports_ref:cn,exports_def:cn},qe=Je?jy({props:Ie}):cn,Ge=!vy.test(vt)&&(nr.test(ot)||nr.test(tt)||nr.test(xt)||nr.test(kt)||nr.test(De)||nr.test(Fe)),He=Be?.type==="Element"&&(Be.name!=="svelte:element"||Be.name==="svelte:element"&&Be.thisValue),Xe=Be?.type==="Element"&&Be.name==="svelte:element"&&!Be.thisValue,Qe=[Je?ze?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${Ge?", Snippet":""} } from "svelte";`:`import type { Component${Ge?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${Ge?", type Snippet":""} } from "svelte";`,He?'import type { SvelteHTMLElements } from "svelte/elements";':"",Xe?'import type { HTMLAttributes } from "svelte/elements";':"",vt,Uy({extends:Ve})].filter(Boolean).join(`
|
|
197
|
-
`),Ye=Je?ze?qy({moduleName:_e,generic:et,propsRef:lt,exportsRef:Oe,bindings:qe}):Vy({moduleName:_e,propsRef:lt,exportsRef:Oe,bindings:qe}):Ky({moduleName:_e,generic:et,genericProps:lt,events:My({events:$e}),slots:Dy({slots:Me}),accessors:fp({props:Ie})}),ct=[tt,xt,De,kt,ot,Fe,[Gy({componentComment:Ue}),Ye].filter(Boolean).join(`
|
|
198
|
-
`)].map((ft)=>ft.trim()).filter(Boolean).join(`
|
|
199
|
-
|
|
200
|
-
`);return np([Qe,ct].filter(Boolean).join(`
|
|
201
|
-
|
|
202
|
-
`))}var ho=/`/g,hp=/\s+/g,Ut="--",dp=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
|
|
203
|
-
| :- | :- | :- | :- | :- | :- | :- | :- |
|
|
204
|
-
`,Ls=`| Slot name | Default | Props | Fallback | Description |
|
|
205
|
-
| :- | :- | :- | :- | :- |
|
|
206
|
-
`,Rs=`| Event name | Type | Detail | Description |
|
|
207
|
-
| :- | :- | :- | :- |
|
|
208
|
-
`,mo=`| Name | Kind | Type | Description |
|
|
209
|
-
| :- | :- | :- | :- |
|
|
210
|
-
`,mp=`| Part name | Description |
|
|
211
|
-
| :- | :- |
|
|
212
|
-
`,gp=`| Property name | Type | Default value | Description |
|
|
213
|
-
| :- | :- | :- | :- |
|
|
214
|
-
`,Nr=/\|/g,zy=/</g,Xy=/>/g,ir=/\n/g,Jy=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function fo(s){return s.replace(Jy,(ve,Ae,_e)=>`[${_e===void 0?Ae:_e.trim()}](${Ae})`)}function ln(s){if(s===void 0)return Ut;return`<code>${s.replace(Nr,"|")}</code>`}function _r(s){return s.replace(zy,"<").replace(Xy,">")}function Ir(s){if(s===void 0)return Ut;return`<code>${s.replace(ho,"\\`").replace(Nr,"|")}</code>`}function mn(s,ve){if(ve===void 0)return s;let Ae=typeof ve==="string"&&ve.trim().length>0?`: ${_r(ve).replace(ir," ").replace(Nr,"|")}`:"";return`<s>${s}</s><br />**Deprecated**${Ae}`}function Os(s){if(s===void 0||s.trim().length===0)return Ut;return _r(fo(s)).replace(Nr,"|").replace(ir,"<br />")}function Ms(s){if(s===void 0||s==="{}")return Ut;return ln(Ds(s).replace(ir," "))}function Bs(s){if(s===void 0)return Ut;return ln(_r(s).replace(ir,"<br />"))}function An(s,ve){let Ae=[];if(s!==void 0&&s.trim().length>0)Ae.push(_r(fo(s)));for(let{name:_e,body:Ne}of ve??[]){let Le=Ne?.trim();Ae.push(Le?`@${_e} ${_r(fo(Le))}`:`@${_e}`)}if(Ae.length===0)return Ut;return Ae.join(`
|
|
215
|
-
`).replace(Nr,"|").replace(ir,"<br />")}function $s(s){if(s===void 0)return Ut;return ln(s.replace(ir," "))}var Yy=/[^\w\- ]+/g,Qy=/\s+/g;function Zy(s,ve){let Ae=s.toLowerCase().replace(ho,"").replace(Yy,"").replace(Qy,"-"),_e=ve.get(Ae)??0;return ve.set(Ae,_e+1),_e===0?Ae:`${Ae}-${_e}`}class or{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
|
|
216
|
-
|
|
217
|
-
`),this}append(s,ve){switch(s){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let Ae=Number(s.slice(-1));if(this.sourceParts.push(`${"#".repeat(Ae)} ${ve}`),this.hasToC&&s==="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(s!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let s=this.sourceParts.join(""),ve=new Map;return s.replace("<!-- __TOC__ -->",this.toc.map(({indent:Ae,raw:_e})=>`${" ".repeat(Ae)}- [${_e}](#${Zy(_e,ve)})`).join(`
|
|
218
|
-
`))}}var ex=`| Name | Type | Default | Required | Description |
|
|
219
|
-
| :- | :- | :- | :- | :- |
|
|
220
|
-
`,tx=/[.!?](?:\s|$)/,nx=/\r?\n[ \t]*\r?\n/,rx=/\s+/g;function yp(s,ve){if(!s)return ve;let Ae=s.trim().split(nx)[0]?.replace(rx," ").trim();if(!Ae)return ve;let _e=tx.exec(Ae);return _e?Ae.slice(0,_e.index+1):Ae}function go(s,ve,Ae){if(Ae.length===0)return;s.append("h3",ve),s.append("raw",ex);for(let _e of Ae)s.append("raw",`| ${mn(_e.name,_e.deprecated)} | ${ln(_e.type)} | ${Ir(_e.value)} | ${_e.isRequired?"Yes":"No"} | ${An(_e.description,_e.tags)} |
|
|
221
|
-
`);s.append("raw",`
|
|
222
|
-
`)}function sx(s,ve){if(ve.length===0)return;s.append("h3","Events"),s.append("raw",Rs);for(let Ae of ve)s.append("raw",`| ${mn(Ae.name,Ae.deprecated)} | ${Ae.type} | ${Ae.type==="dispatched"?$s(Ae.detail):Ut} | ${An(Ae.description,Ae.tags)} |
|
|
223
|
-
`);s.append("raw",`
|
|
224
|
-
`)}function ix(s,ve,Ae){if(Ae.length===0)return;s.append("h3",ve),s.append("raw",Ls);for(let _e of Ae)s.append("raw",`| ${mn(_e.default?Ut:_e.name??Ut,_e.deprecated)} | ${_e.default?"Yes":"No"} | ${Ms(_e.slot_props)} | ${Bs(_e.fallback)} | ${An(_e.description,_e.tags)} |
|
|
225
|
-
`);s.append("raw",`
|
|
226
|
-
`)}function ox(s,ve){if(ve.typedefs.length===0)return;s.append("h3","Typedefs"),s.append("raw",`\`\`\`ts
|
|
227
|
-
${sr({typedefs:ve.typedefs})}
|
|
228
|
-
\`\`\`
|
|
229
|
-
|
|
230
|
-
`)}function ax(s,ve){if(s.append("h2",ve.moduleName),ve.generics)s.append("p",`Type parameters: ${ln(`<${ve.generics[1]}>`)}`);if(ve.componentComment?.trim())s.append("p",ve.componentComment.trim());go(s,"Props",ve.props),go(s,"Bindings",ve.props.filter((Ae)=>Ae.reactive)),sx(s,ve.events),ix(s,ve.syntaxMode==="runes"?"Snippets":"Slots",ve.slots),ox(s,ve),go(s,"Module exports",ve.moduleExports)}function cx(s,ve,Ae,_e){let Ne=new or,Le=_e.linkBase??"";if(Ne.append("h1",ve),Ae)Ne.append("quote",Ae);Ne.append("h2","Components");for(let Ie of s)Ne.append("raw",`- [${Ie.moduleName}](${Le}/${Ie.moduleName}): ${yp(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}\`: ${yp(Ie.description,Ie.kind)}
|
|
233
|
-
`);Ne.append("raw",`
|
|
234
|
-
`)}return Ne.end()}function lx(s,ve,Ae){let _e=new or;if(_e.append("h1",ve),Ae)_e.append("quote",Ae);for(let Ne of s)ax(_e,Ne);return _e.end()}function px(s,ve){let Ae=i(s,{entryExports:ve.entryExports}),_e=Yl(),Ne=ve.title??_e.name??"Components",Le=ve.summary??_e.description;return{llmsTxt:cx(Ae.components,Ne,Le,ve),llmsFullTxt:lx(Ae.components,Ne,Le)}}async function yo(s,ve){let{llmsTxt:Ae,llmsFullTxt:_e}=px(s,ve),Ne=new Bt({dryRun:ve.dryRun}),Le=e(Fs.join(ve.outDir??"","llms.txt")),Ie=e(Fs.join(ve.outDir??"","llms-full.txt")),[Re,Me]=await Promise.all([Ne.write(Fs.join(process.cwd(),Le),Ae),Ne.write(Fs.join(process.cwd(),Ie),_e)]);if(!ve.dryRun)Xt(`${Re?"created":"unchanged"} "${Le}".`),Xt(`${Me?"created":"unchanged"} "${Ie}".`)}import{join as bo,resolve as Sp}from"node:path";function xp(s,ve,Ae){if(s.append("h1","Component Index"),s.append("h2","Components").tableOfContents(),s.append("divider"),Ae&&Ae.length>0)Ep(s,Ae);let _e=i(ve);for(let Ne of _e.components)vp(s,Ne)}function bp(s,ve,Ae){s.append("h1","Component Index"),s.append("h2","Components");for(let _e of ve)s.append("raw",`- [${_e.moduleName}](./${_e.moduleName}.md)
|
|
235
|
-
`);if(s.append("raw",`
|
|
236
|
-
`),s.append("divider"),Ae&&Ae.length>0)Ep(s,Ae)}function Ep(s,ve){s.append("h2","Exports"),s.append("raw",mo);for(let Ae of ve){let _e=(Ae.type??Ae.value)?.replace(hp," ").trim();s.append("raw",`| ${mn(Ae.name,Ae.deprecated)} | ${`<code>${Ae.kind}</code>`} | ${ln(_e)} | ${Os(Ae.description)} |
|
|
237
|
-
`)}s.append("raw",`
|
|
238
|
-
`),s.append("divider")}function ux(s){return s.kind==="const"||s.isFunctionDeclaration}function fx(s,ve){s.append("h3","Module exports"),s.append("raw",mo);for(let Ae of ve)s.append("raw",`| ${mn(Ae.name,Ae.deprecated)} | ${`<code>${Ae.kind}</code>`} | ${ln(Ae.type)} | ${An(Ae.description,Ae.tags)} |
|
|
239
|
-
`);s.append("raw",`
|
|
240
|
-
`)}function xo(s,ve,Ae,_e){if(ve.length>0)Ae(),s.append("raw",`
|
|
241
|
-
`);else s.append("p",_e??"None.")}function Cp(s,ve){vp(s,ve)}function vp(s,ve){if(s.append("h2",`\`${ve.moduleName}\``),ve.generics)s.append("p",`**Type parameters:** ${ln(`<${ve.generics[1]}>`)}`);if(ve.typedefs.length>0)s.append("h3","Types").append("raw",`\`\`\`ts
|
|
242
|
-
${sr({typedefs:ve.typedefs})}
|
|
243
|
-
\`\`\`
|
|
244
|
-
|
|
245
|
-
`);if(s.append("h3","Props"),xo(s,ve.props,()=>{s.append("raw",dp);let Ae=(Ne)=>Ne.reactive?0:Ne.constant?2:1,_e=ve.props.map((Ne,Le)=>({prop:Ne,index:Le})).sort((Ne,Le)=>Ae(Ne.prop)-Ae(Le.prop)||Ne.index-Le.index).map(({prop:Ne})=>Ne);for(let Ne of _e){let Le=ux(Ne)?"accessor":Ne.kind;s.append("raw",`| ${mn(Ne.name,Ne.deprecated)} | ${Ne.isRequired?"Yes":"No"} | ${`<code>${Le}</code>`} | ${Ne.reactive?"Yes":"No"} | ${Ne.binding??"--"} | ${ln(Ne.type)} | ${Ir(Ne.value)} | ${An(Ne.description,Ne.tags)} |
|
|
246
|
-
`)}}),ve.moduleExports.length>0)fx(s,ve.moduleExports);if(s.append("h3","Slots"),xo(s,ve.slots,()=>{s.append("raw",Ls);for(let Ae of ve.slots)s.append("raw",`| ${mn(Ae.default?Ut:Ae.name??Ut,Ae.deprecated)} | ${Ae.default?"Yes":"No"} | ${Ms(Ae.slot_props)} | ${Bs(Ae.fallback)} | ${An(Ae.description,Ae.tags)} |
|
|
247
|
-
`)}),s.append("h3","Events"),xo(s,ve.events,()=>{s.append("raw",Rs);for(let Ae of ve.events)s.append("raw",`| ${mn(Ae.name,Ae.deprecated)} | ${Ae.type} | ${Ae.type==="dispatched"?$s(Ae.detail):Ut} | ${An(Ae.description,Ae.tags)} |
|
|
248
|
-
`)}),ve.cssParts&&ve.cssParts.length>0){s.append("h3","CSS Parts"),s.append("raw",mp);for(let Ae of ve.cssParts)s.append("raw",`| ${Ae.name} | ${Os(Ae.description)} |
|
|
249
|
-
`);s.append("raw",`
|
|
250
|
-
`)}if(ve.cssProperties&&ve.cssProperties.length>0){s.append("h3","CSS Custom Properties"),s.append("raw",gp);for(let Ae of ve.cssProperties)s.append("raw",`| ${Ae.name} | ${ln(Ae.type)} | ${Ir(Ae.default)} | ${Os(Ae.description)} |
|
|
251
|
-
`);s.append("raw",`
|
|
252
|
-
`)}}class js extends Bt{onAppend;markdownBase;constructor(s){super();this.onAppend=s.onAppend,this.markdownBase=new or}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(s,ve){return this.markdownBase.append(s,ve),this.onAppend?.call(this,s,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function Eo(s,ve){return new js({onAppend:(Ae,_e)=>{s.onAppend?.call(null,Ae,_e,ve)}})}async function hx(s,ve){let Ae=ve.outDir,_e=i(s,{entryExports:ve.entryExports}),Ne=new Bt({dryRun:ve.dryRun}),Le=Eo(ve,s);bp(Le,_e.components,ve.entryExports);let Ie=Sp(bo(Ae,"README.md")),Re=await Ne.write(Ie,Le.end());if(!ve.dryRun)Xt(`${Re?"created":"unchanged"} "${Ie}".`);await Promise.all(_e.components.map(async(Me)=>{let $e=Eo(ve,s);Cp($e,Me);let Be=Sp(bo(Ae,`${Me.moduleName}.md`)),Ve=await Ne.write(Be,$e.end());if(!ve.dryRun)Xt(`${Ve?"created":"unchanged"} "${Be}".`)}))}function Co(s,ve){let Ae=Eo(ve,s);return xp(Ae,s,ve.entryExports),Ae.end()}async function vo(s,ve){if(ve.outDir){if(ve.write!==!1)await hx(s,ve);return}let Ae=ve?.write!==!1,_e=Co(s,ve);if(Ae){let Ne=bo(process.cwd(),ve.outFile),Le=await new Bt({dryRun:ve.dryRun}).write(Ne,_e);if(!ve.dryRun)Xt(`${Le?"created":"unchanged"} "${ve.outFile}".`)}return _e}import{join as Tp}from"node:path";async function So(s,ve){let Ae=Tp(process.cwd(),ve.outDir,"index.d.ts"),_e=new Bt({dryRun:ve.dryRun}),Ne=ve.preamble+Kl(ve.exports),Le=i(s),Ie=ve.format??"class",Re=Le.components.map(async(Me)=>{let $e=Xl(Tp(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=uo(Me,{format:ve.format}),Be)ve.cache?.setGeneratedText(Be,Ie,Ve)}await _e.write($e,Ve)});if(await Promise.all([...Re,_e.write(Ae,`${Ne}
|
|
253
|
-
`)]),!ve.dryRun)Xt("created TypeScript definitions.")}b({name:"json",componentSet:"exported",write:to});b({name:"markdown",componentSet:"exported",write:vo});b({name:"types",componentSet:"all",write:So});b({name:"custom-elements",componentSet:"exported",write:Yi});b({name:"llms",componentSet:"exported",write:yo});var Ap='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',gx=50;function yx(s){let ve=Promise.resolve();return()=>{ve=ve.then(s,s)}}function ke(s){let ve=s?.watch===!0,Ae,_e,Ne=s??{},Le,Ie=null,Re,Me=new Set,Be=yx(async()=>{if(Ie==null||_e==null||Me.size===0)return;let Ue=Array.from(Me);Me.clear();try{let{result:We}=await Ie.update(Ue);await k(We,Ne,_e)}catch(We){console.error("sveld: failed to regenerate types in watch mode:",We)}}),Ve=(Ue)=>{if(!ve||Ie==null||!zc.test(Ue))return;Me.add(Ue),clearTimeout(Re),Re=setTimeout(Be,gx)};return{name:"vite-plugin-sveld",apply:ve?void 0:"build",enforce:"post",configResolved(Ue){Le=Ue.root},async buildStart(){if(s?.config){let Ue=Le??process.cwd(),We=typeof s.config==="string"?await Oi(dx(s.config)?s.config:mx(Ue,s.config)):await _(Ue);Ne=D(We,s)}if(N(Ne),I(Ne.quiet===!0),_e=v(Ne.entry),ve&&_e!=null)Ie=await Wl(_e,Ne.glob===!0,Ne.documentExports===!0),await k(Ie.result,Ne,_e)},async generateBundle(){if(ve)return;if(_e==null)this.error(Ap);Ae=await S(_e,Ne.glob===!0,E(Ne))},async writeBundle(){if(ve)return;if(_e==null)this.error(Ap);await k(Ae,Ne,_e),Ae.cache?.save()},handleHotUpdate(Ue){Ve(Ue.file)},watchChange(Ue){Ve(Ue)}}}function Dr(s,ve,Ae){let _e=G(s);if(!_e)throw Error(`sveld: built-in writer "${s}" is not registered.`);return _e.write(ve,Ae)}async function k(s,ve,Ae){let _e=kp(Ae),Ne=ve?.dryRun===!0;if(ve?.types!==!1)await Dr("types",s.allComponentsForTypes,{outDir:"types",preamble:"",...ve?.typesOptions,exports:s.exports,inputDir:_e,dryRun:Ne,cache:s.cache,resolvedPathByFilePath:s.resolvedPathByFilePath});if(ve?.json)await Dr("json",s.components,{outFile:"COMPONENT_API.json",...ve?.jsonOptions,input:Ae,inputDir:_e,entryExports:s.entryExports,dryRun:Ne});if(ve?.markdown)await Dr("markdown",s.components,{outFile:"COMPONENT_INDEX.md",...ve?.markdownOptions,entryExports:s.entryExports,dryRun:Ne});if(ve?.customElements)await Dr("custom-elements",s.components,{outFile:"custom-elements.json",...ve?.customElementsOptions,inputDir:_e,dryRun:Ne});if(ve?.llms)await Dr("llms",s.components,{...ve?.llmsOptions,entryExports:s.entryExports,dryRun:Ne});let Le=Object.entries(ve?.additionalWriters??{}).map(([Ie,Re])=>{let Me=G(Ie);if(!Me){console.warn(`sveld: no writer registered with name "${Ie}"; skipping.`);return}let $e=Me.componentSet==="all"?s.allComponentsForTypes:s.components,Be={...Re,dryRun:Ne};return xx(Ie,Me,$e,Be)});await Promise.all(Le)}async function xx(s,ve,Ae,_e){try{return await ve.write(Ae,_e)}catch(Ne){let Le=Ne instanceof Error?Ne.message:String(Ne);throw Error(`sveld: writer "${s}" failed: ${Le}`,{cause:Ne})}}async function wp(s,ve,Ae){let _e=kp(Ae);if(ve?.json){let Ne={...ve?.jsonOptions,inputDir:_e,entryExports:s.entryExports},Le=ve.stdout==="ndjson"?Jl(s.components,Ne):eo(s.components,Ne);process.stdout.write(Le);return}if(ve?.markdown){let Ne=Co(s.components,{...ve?.markdownOptions,entryExports:s.entryExports});process.stdout.write(Ne);return}if(ve?.customElements){let Ne=Ji(s.components,{...ve?.customElementsOptions,inputDir:_e});process.stdout.write(Ne)}}import{appendFileSync as vx,existsSync as Sx}from"node:fs";import{join as Tx}from"node:path";var _p=/%/g,Np=/\r/g,Ip=/\n/g,bx=/,/g,Ex=/:/g,Dp=/\|/g;function Pp(s){return s.replace(_p,"%25").replace(Np,"%0D").replace(Ip,"%0A").replace(bx,"%2C").replace(Ex,"%3A")}function Cx(s){return s.replace(_p,"%25").replace(Np,"%0D").replace(Ip,"%0A")}function Lp(s,ve,Ae,_e,Ne,Le){let Ie=s==="error"?"error":"warning",Re=[];if(_e!==void 0)Re.push(`file=${Pp(_e)}`);if(Ne!==void 0)Re.push(`line=${Ne}`);if(Le!==void 0)Re.push(`col=${Le}`);return Re.push(`title=${Pp(ve)}`),`::${Ie} ${Re.join(",")}::${Cx(Ae)}`}function Rp(s){return s.filter((ve)=>!ve.ignored).map((ve)=>Lp(ve.severity,`sveld ${ve.code}`,ve.message,ve.component,ve.source?.start.line,ve.source?.start.column)).join(`
|
|
254
|
-
`)}function Op(s){let ve=s.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(Dp,"\\|")} |`})].join(`
|
|
255
|
-
`)}function Mp(s,ve){return s.changes.filter((Ae)=>us(Ae.bump,ve))}function Bp(s,ve){return Mp(s,ve).map((Ae)=>Lp("error","sveld breaking change",Ae.message,Ae.component==="*"?void 0:Ae.component)).join(`
|
|
256
|
-
`)}function $p(s,ve){let Ae=Mp(s,ve);if(Ae.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...Ae.map((Ne)=>`| ${Ne.component} | ${Ne.kind} | ${Ne.message.replace(Dp,"\\|")} |`)].join(`
|
|
257
|
-
`)}var To="src/index.js",Dt={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},Ax=`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
|
-
`,Ao={resolveTypes:"resolve-types",checkExamples:"check-examples"},kx=["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"],wx=[...kx,...Object.keys(Ao)],Px=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run"]),_x=new Set(["entry","cache","check","types-format"]),Nx=new Set(["entry","types-format"]);function Ix(s){let ve=fs(s,wx);return ve===void 0?void 0:Ao[ve]??ve}function Dx(s,ve){let Ae=s.indexOf("="),_e=Ae===-1?s.slice(2):s.slice(2,Ae),Ne=Ao[_e]??_e,Le=Ae===-1?!0:s.slice(Ae+1),Ie=!1;if(Ae===-1&&_x.has(Ne)){if(ve!==void 0&&!ve.startsWith("--"))Le=ve,Ie=!0;else if(Nx.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:Lx(Ne,Le,s,_e),consumedNext:Ie,flag:Ne}}function Lx(s,ve,Ae,_e){switch(s){case"help":return{kind:"help"};case"version":return{kind:"version"};case"glob":case"types":case"json":case"markdown":case"quiet":return{kind:"option",option:{[s]: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:Ix(_e)}}}function Rx(s){let ve={},Ae=!1;for(let _e=0;_e<s.length;_e++){let Ne=s[_e];if(!Ne.startsWith("--"))return{kind:"unknown",arg:Ne,positionalHint:Ae?!0:void 0};let{result:Le,consumedNext:Ie,flag:Re}=Dx(Ne,s[_e+1]);if(Le.kind!=="option")return Le;if(Object.assign(ve,Le.option),Ae=Px.has(Re),Ie)_e++}return{kind:"options",options:ve}}async function re(s){let ve=Rx(s.argv.slice(2));if(ve.kind==="help"){console.log(Ax);return}if(ve.kind==="version"){console.log(Jc.version);return}if(ve.kind==="usage-error"){console.error(ve.message),s.exitCode=Dt.USAGE_ERROR;return}if(ve.kind==="unknown"){let Ke=`Unknown flag: ${ve.arg}`;if(ve.suggestion)Ke+=` Did you mean --${ve.suggestion}?`;if(ve.positionalHint)Ke+=" (values are passed as --flag=value or --flag value)";console.error(Ke),console.error("Run sveld --help for a list of available flags."),s.exitCode=Dt.USAGE_ERROR;return}let Ae=ve.options,_e=await _(),Ne=W(D(_e,Ae));if(N(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}".`),s.exitCode=Dt.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."),s.exitCode=Dt.USAGE_ERROR;return}if(Ne.stdout==="ndjson"&&!Ne.json){console.error("sveld: --stdout=ndjson is only valid with --json."),s.exitCode=Dt.USAGE_ERROR;return}if(Ne.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),s.exitCode=Dt.USAGE_ERROR;return}if(Ne.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),s.exitCode=Dt.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}".`),s.exitCode=Dt.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}".`),s.exitCode=Dt.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}".`),s.exitCode=Dt.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}".`),s.exitCode=Dt.USAGE_ERROR;return}I(Ne.quiet===!0);let Le=v(Ne.entry),Ie;if(Le!==null)Ie=Le;else if(Sx(Tx(s.cwd(),To)))console.error(`sveld: could not resolve an entry point; falling back to "${To}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),Ie=vr(e(To));else{s.exitCode=Dt.USAGE_ERROR;return}let Re,Me;try{if(Re=await S(Ie,Ne.glob===!0,E(Ne)),Ne.check)Me=await M(Re.components,H(Ne),{entryExports:Re.entryExports});if(Ne.stdout)await wp(Re,Ne,Ie);else if(await k(Re,Ne,Ie),!Ne.dryRun)Re.cache?.save()}catch(Ke){if(Ke instanceof Zn){console.error(`sveld: ${Ke.message}`),s.exitCode=Dt.USAGE_ERROR;return}console.error(Ke instanceof Error?Ke.message:String(Ke)),s.exitCode=Dt.GENERATION_FAILURE;return}let $e=Ne.reportDiagnostics||Ne.strict,Be=J(Re.diagnostics,$e),Ve=[];if($e&&Be.length>0)if(Ne.format==="json")s.stderr.write(V(Be));else if(Ne.format==="github"){let Ke=Rp(Be);if(Ke)console.error(Ke);let Je=Op(Be);if(Je)Ve.push(Je)}else console.error(q(Be));if(Me)if(Ne.format==="json")s.stdout.write(te(Me));else if(Ne.format==="github"){let Ke=Bp(Me,Ne.checkLevel??"major");if(Ke)console.log(Ke);let Je=$p(Me,Ne.checkLevel??"major");if(Je)Ve.push(Je)}else console.log(ee(Me));if(Ne.format==="github"&&Ve.length>0&&s.env.GITHUB_STEP_SUMMARY)vx(s.env.GITHUB_STEP_SUMMARY,`${Ve.join(`
|
|
297
|
-
|
|
298
|
-
`)}
|
|
299
|
-
`);let Ue;if(Me?.changes.some((Ke)=>Ke.kind==="schema")??!1)Ue=Dt.USAGE_ERROR;else if(Me&&us(Me.bump,Ne.checkLevel??"major"))Ue=Dt.BREAKING_CHANGE;if(F(Be,Ne.strict).length>0)Ue=Ue===void 0?Dt.DIAGNOSTICS:Math.min(Ue,Dt.DIAGNOSTICS);if(Ue!==void 0)s.exitCode=Ue}
|
|
300
|
-
export{we,o,w,ne,l,a,se,p,f,ie,y,B,j,J,F,q,oe,V,n,d,C,U,t,r,u,L,m,ae,ce,ue,z,h,pe,X,le,fe,x,de,c,P,me,Q,he,ge,ye,Y,xe,R,Z,K,O,g,Te,Ee,T,A,e,i,Se,H,M,ee,be,te,v,Ce,_,D,W,N,I,E,S,b,G,Pe,ke,k,re};
|