sveld 0.37.4 → 0.37.5
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/README.md +21 -1
- package/lib/browser.d.ts +9 -0
- package/lib/browser.js +100 -100
- package/lib/{chunk-nxa0q3f3.js → chunk-8s0hjkmq.js} +3 -3
- package/lib/{chunk-yzb9k33r.js → chunk-a2krprqa.js} +1 -1
- package/lib/chunk-bxzbn9eg.js +1 -0
- package/lib/chunk-k2w5f49f.js +331 -0
- package/lib/chunk-x9qsjgpb.js +6 -0
- package/lib/chunk-znjmdeca.js +1 -0
- package/lib/cli-entry.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/lib/chunk-49hdrj4n.js +0 -6
- package/lib/chunk-7e36grhy.js +0 -1
- package/lib/chunk-rftengvg.js +0 -331
- package/lib/chunk-w37f2cq2.js +0 -1
package/lib/chunk-rftengvg.js
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
import{createRequire as rd}from"node:module";var zu=Object.create;var{getPrototypeOf:Xu,defineProperty:xi,getOwnPropertyNames:Ju}=Object;var xa=Object.prototype.hasOwnProperty;function Yu(i){return this[i]}var Qu,Zu,Ae=(i,Ne,Ie)=>{var Re=i!=null&&typeof i==="object";if(Re){var Le=Ne?Qu??=new WeakMap:Zu??=new WeakMap,Me=Le.get(i);if(Me)return Me}Ie=i!=null?zu(Xu(i)):{};let Oe=Ne||!i||!i.__esModule||!xa.call(i,"default")?xi(Ie,"default",{value:i,enumerable:!0}):Ie;if(i&&typeof i==="object"||typeof i==="function"){for(let Be of Ju(i))if(!xa.call(Oe,Be))xi(Oe,Be,{get:Yu.bind(i,Be),enumerable:!0})}if(Re)Le.set(i,Oe);return Oe};var a=(i,Ne)=>()=>(Ne||i((Ne={exports:{}}).exports,Ne),Ne.exports);var ed=(i)=>i;function td(i,Ne){this[i]=ed.bind(null,Ne)}var nd=(i,Ne)=>{for(var Ie in Ne)xi(i,Ie,{get:Ne[Ie],enumerable:!0,configurable:!0,set:td.bind(Ne,Ie)})};var C=rd(import.meta.url);var sd={li:{direct:["li"]},dt:{descendant:["dt","dd"]},dd:{descendant:["dt","dd"]},p:{descendant:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","menu","nav","ol","p","pre","section","table","ul"]},rt:{descendant:["rt","rp"]},rp:{descendant:["rt","rp"]},optgroup:{descendant:["optgroup"]},option:{descendant:["option","optgroup"]},thead:{direct:["tbody","tfoot"]},tbody:{direct:["tbody","tfoot"]},tfoot:{direct:["tbody"]},tr:{direct:["tr","tbody"]},td:{direct:["td","th","tr"]},th:{direct:["td","th","tr"]}};function ba(i,Ne){let Ie=sd[i];if(!Ie)return!1;if(!Ne)return!0;return(Ie.direct??Ie.descendant??[]).includes(Ne)}var Ri={};nd(Ri,{Node:()=>Nr,Parser:()=>Lt,Position:()=>ir,SourceLocation:()=>Ar,TokContext:()=>fn,Token:()=>ps,TokenType:()=>kt,defaultOptions:()=>es,getLineInfo:()=>wi,isIdentifierChar:()=>sn,isIdentifierStart:()=>Qt,isNewLine:()=>Hn,keywordTypes:()=>is,lineBreak:()=>Zt,lineBreakG:()=>Aa,nonASCIIwhitespace:()=>ki,parse:()=>Ii,parseExpressionAt:()=>jd,tokContexts:()=>Rt,tokTypes:()=>Ue,tokenizer:()=>Vd,version:()=>oc});var id=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Ta=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],od="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",ka="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",bi={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"},Ei="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",ad={5:Ei,"5module":Ei+" export import",6:Ei+" const class extends export import super"},wa=/^in(stanceof)?$/,cd=new RegExp("["+ka+"]"),ld=new RegExp("["+ka+od+"]");function Ci(i,Ne){var Ie=65536;for(var Re=0;Re<Ne.length;Re+=2){if(Ie+=Ne[Re],Ie>i)return!1;if(Ie+=Ne[Re+1],Ie>=i)return!0}return!1}function Qt(i,Ne){if(i<65)return i===36;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&cd.test(String.fromCharCode(i));if(Ne===!1)return!1;return Ci(i,Ta)}function sn(i,Ne){if(i<48)return i===36;if(i<58)return!0;if(i<65)return!1;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&ld.test(String.fromCharCode(i));if(Ne===!1)return!1;return Ci(i,Ta)||Ci(i,id)}var kt=function(Ne,Ie){if(Ie===void 0)Ie={};this.label=Ne,this.keyword=Ie.keyword,this.beforeExpr=!!Ie.beforeExpr,this.startsExpr=!!Ie.startsExpr,this.isLoop=!!Ie.isLoop,this.isAssign=!!Ie.isAssign,this.prefix=!!Ie.prefix,this.postfix=!!Ie.postfix,this.binop=Ie.binop||null,this.updateContext=null};function un(i,Ne){return new kt(i,{beforeExpr:!0,binop:Ne})}var dn={beforeExpr:!0},rn={startsExpr:!0},is={};function Tt(i,Ne){if(Ne===void 0)Ne={};return Ne.keyword=i,is[i]=new kt(i,Ne)}var Ue={num:new kt("num",rn),regexp:new kt("regexp",rn),string:new kt("string",rn),name:new kt("name",rn),privateId:new kt("privateId",rn),eof:new kt("eof"),bracketL:new kt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new kt("]"),braceL:new kt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new kt("}"),parenL:new kt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new kt(")"),comma:new kt(",",dn),semi:new kt(";",dn),colon:new kt(":",dn),dot:new kt("."),question:new kt("?",dn),questionDot:new kt("?."),arrow:new kt("=>",dn),template:new kt("template"),invalidTemplate:new kt("invalidTemplate"),ellipsis:new kt("...",dn),backQuote:new kt("`",rn),dollarBraceL:new kt("${",{beforeExpr:!0,startsExpr:!0}),eq:new kt("=",{beforeExpr:!0,isAssign:!0}),assign:new kt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new kt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new kt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:un("||",1),logicalAND:un("&&",2),bitwiseOR:un("|",3),bitwiseXOR:un("^",4),bitwiseAND:un("&",5),equality:un("==/!=/===/!==",6),relational:un("</>/<=/>=",7),bitShift:un("<</>>/>>>",8),plusMin:new kt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:un("%",10),star:un("*",10),slash:un("/",10),starstar:new kt("**",{beforeExpr:!0}),coalesce:un("??",1),_break:Tt("break"),_case:Tt("case",dn),_catch:Tt("catch"),_continue:Tt("continue"),_debugger:Tt("debugger"),_default:Tt("default",dn),_do:Tt("do",{isLoop:!0,beforeExpr:!0}),_else:Tt("else",dn),_finally:Tt("finally"),_for:Tt("for",{isLoop:!0}),_function:Tt("function",rn),_if:Tt("if"),_return:Tt("return",dn),_switch:Tt("switch"),_throw:Tt("throw",dn),_try:Tt("try"),_var:Tt("var"),_const:Tt("const"),_while:Tt("while",{isLoop:!0}),_with:Tt("with"),_new:Tt("new",{beforeExpr:!0,startsExpr:!0}),_this:Tt("this",rn),_super:Tt("super",rn),_class:Tt("class",rn),_extends:Tt("extends",dn),_export:Tt("export"),_import:Tt("import",rn),_null:Tt("null",rn),_true:Tt("true",rn),_false:Tt("false",rn),_in:Tt("in",{beforeExpr:!0,binop:7}),_instanceof:Tt("instanceof",{beforeExpr:!0,binop:7}),_typeof:Tt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Tt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Tt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Zt=/\r\n?|\n|\u2028|\u2029/,Aa=new RegExp(Zt.source,"g");function Hn(i){return i===10||i===13||i===8232||i===8233}function Pa(i,Ne,Ie){if(Ie===void 0)Ie=i.length;for(var Re=Ne;Re<Ie;Re++){var Le=i.charCodeAt(Re);if(Hn(Le))return Re<Ie-1&&Le===13&&i.charCodeAt(Re+1)===10?Re+2:Re+1}return-1}var ki=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Gt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Na=Object.prototype,{hasOwnProperty:pd,toString:ud}=Na,or=Object.hasOwn||function(i,Ne){return pd.call(i,Ne)},Ea=Array.isArray||function(i){return ud.call(i)==="[object Array]"},Ca=Object.create(null);function Bn(i){return Ca[i]||(Ca[i]=new RegExp("^(?:"+i.replace(/ /g,"|")+")$"))}function Pn(i){if(i<=65535)return String.fromCharCode(i);return i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320)}var dd=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ir=function(Ne,Ie){this.line=Ne,this.column=Ie};ir.prototype.offset=function(Ne){return new ir(this.line,this.column+Ne)};var Ar=function(Ne,Ie,Re){if(this.start=Ie,this.end=Re,Ne.sourceFile!==null)this.source=Ne.sourceFile};function wi(i,Ne){for(var Ie=1,Re=0;;){var Le=Pa(i,Re,Ne);if(Le<0)return new ir(Ie,Ne-Re);++Ie,Re=Le}}var es={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},va=!1;function fd(i){var Ne={};for(var Ie in es)Ne[Ie]=i&&or(i,Ie)?i[Ie]:es[Ie];if(Ne.ecmaVersion==="latest")Ne.ecmaVersion=1e8;else if(Ne.ecmaVersion==null){if(!va&&typeof console==="object"&&console.warn)va=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
-
Defaulting to 2020, but this will stop working in the future.`);Ne.ecmaVersion=11}else if(Ne.ecmaVersion>=2015)Ne.ecmaVersion-=2009;if(Ne.allowReserved==null)Ne.allowReserved=Ne.ecmaVersion<5;if(!i||i.allowHashBang==null)Ne.allowHashBang=Ne.ecmaVersion>=14;if(Ea(Ne.onToken)){var Re=Ne.onToken;Ne.onToken=function(Le){return Re.push(Le)}}if(Ea(Ne.onComment))Ne.onComment=hd(Ne,Ne.onComment);if(Ne.sourceType==="commonjs"&&Ne.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return Ne}function hd(i,Ne){return function(Ie,Re,Le,Me,Oe,Be){var Fe={type:Ie?"Block":"Line",value:Re,start:Le,end:Me};if(i.locations)Fe.loc=new Ar(this,Oe,Be);if(i.ranges)Fe.range=[Le,Me];Ne.push(Fe)}}var Un=1,Kn=2,Ai=4,_a=8,Pi=16,Da=32,os=64,Ia=128,zn=256,Pr=512,Ra=1024,as=Un|Kn|zn;function Ni(i,Ne){return Kn|(i?Ai:0)|(Ne?_a:0)}var ts=0,_i=1,_n=2,La=3,Oa=4,Ma=5,Lt=function(Ne,Ie,Re){this.options=Ne=fd(Ne),this.sourceFile=Ne.sourceFile,this.keywords=Bn(ad[Ne.ecmaVersion>=6?6:Ne.sourceType==="module"?"5module":5]);var Le="";if(Ne.allowReserved!==!0){if(Le=bi[Ne.ecmaVersion>=6?6:Ne.ecmaVersion===5?5:3],Ne.sourceType==="module")Le+=" await"}this.reservedWords=Bn(Le);var Me=(Le?Le+" ":"")+bi.strict;if(this.reservedWordsStrict=Bn(Me),this.reservedWordsStrictBind=Bn(Me+" "+bi.strictBind),this.input=String(Ie),this.containsEsc=!1,this.pos=Re||0,this.curLine=1,Ne.startLocation)this.lineStart=this.pos-Ne.startLocation.column,this.curLine=Ne.startLocation.line;else if(Re){if(this.lineStart=this.input.lastIndexOf(`
|
|
3
|
-
`,Re-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(Zt).length}else this.lineStart=0;if(this.type=Ue.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=Ne.sourceType==="module",this.strict=this.inModule||Ne.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&&Ne.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Kn:Un),this.regexpState=null,this.privateNameStack=[]},mn={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}};Lt.prototype.parse=function(){var Ne=this,Ie=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return Ne.parseTopLevel(Ie)})};mn.inFunction.get=function(){return(this.currentVarScope().flags&Kn)>0};mn.inGenerator.get=function(){return(this.currentVarScope().flags&_a)>0};mn.inAsync.get=function(){return(this.currentVarScope().flags&Ai)>0};mn.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var Ne=this.scopeStack[i],Ie=Ne.flags;if(Ie&(zn|Pr))return!1;if(Ie&Kn)return(Ie&Ai)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};mn.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Un)return!0;return!1};mn.allowSuper.get=function(){var i=this.currentThisScope(),Ne=i.flags;return(Ne&os)>0||this.options.allowSuperOutsideMethod};mn.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ia)>0};mn.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};mn.allowNewDotTarget.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var Ne=this.scopeStack[i],Ie=Ne.flags;if(Ie&(zn|Pr)||Ie&Kn&&!(Ie&Pi))return!0}return!1};mn.allowUsing.get=function(){var i=this.currentScope(),Ne=i.flags;if(Ne&Ra)return!1;if(!this.inModule&&Ne&Un)return!1;return!0};mn.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&zn)>0};Lt.extend=function(){var Ne=[],Ie=arguments.length;while(Ie--)Ne[Ie]=arguments[Ie];var Re=this;for(var Le=0;Le<Ne.length;Le++)Re=Ne[Le](Re);return Re};Lt.parse=function(Ne,Ie){return new this(Ie,Ne).parse()};Lt.parseExpressionAt=function(Ne,Ie,Re){var Le=new this(Re,Ne,Ie);return Le.nextToken(),Le.parseExpression()};Lt.tokenizer=function(Ne,Ie){return new this(Ie,Ne)};Object.defineProperties(Lt.prototype,mn);var zt=Lt.prototype,md=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;zt.strictDirective=function(i){if(this.options.ecmaVersion<5)return!1;for(;;){Gt.lastIndex=i,i+=Gt.exec(this.input)[0].length;var Ne=md.exec(this.input.slice(i));if(!Ne)return!1;if((Ne[1]||Ne[2])==="use strict"){Gt.lastIndex=i+Ne[0].length;var Ie=Gt.exec(this.input),Re=Ie.index+Ie[0].length,Le=this.input.charAt(Re);return Le===";"||Le==="}"||Zt.test(Ie[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Le)||Le==="!"&&this.input.charAt(Re+1)==="=")}if(i+=Ne[0].length,Gt.lastIndex=i,i+=Gt.exec(this.input)[0].length,this.input[i]===";")i++}};zt.eat=function(i){if(this.type===i)return this.next(),!0;else return!1};zt.isContextual=function(i){return this.type===Ue.name&&this.value===i&&!this.containsEsc};zt.eatContextual=function(i){if(!this.isContextual(i))return!1;return this.next(),!0};zt.catchStackOverflow=function(i){try{return i()}catch(Ne){if(Ne instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(Ne.message)||/\btoo much recursion\b/i.test(Ne.message)))this.raise(this.start,"Not enough stack space to parse input");else throw Ne}};zt.expectContextual=function(i){if(!this.eatContextual(i))this.unexpected()};zt.canInsertSemicolon=function(){return this.type===Ue.eof||this.type===Ue.braceR||Zt.test(this.input.slice(this.lastTokEnd,this.start))};zt.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};zt.semicolon=function(){if(!this.eat(Ue.semi)&&!this.insertSemicolon())this.unexpected()};zt.afterTrailingComma=function(i,Ne){if(this.type===i){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!Ne)this.next();return!0}};zt.expect=function(i){this.eat(i)||this.unexpected()};zt.unexpected=function(i){this.raise(i!=null?i:this.start,"Unexpected token")};var cs=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};zt.checkPatternErrors=function(i,Ne){if(!i)return;if(i.trailingComma>-1)this.raiseRecoverable(i.trailingComma,"Comma is not permitted after the rest element");var Ie=Ne?i.parenthesizedAssign:i.parenthesizedBind;if(Ie>-1)this.raiseRecoverable(Ie,Ne?"Assigning to rvalue":"Parenthesized pattern")};zt.checkExpressionErrors=function(i,Ne){if(!i)return!1;var{shorthandAssign:Ie,doubleProto:Re}=i;if(!Ne)return Ie>=0||Re>=0;if(Ie>=0)this.raise(Ie,"Shorthand property assignments are valid only in destructuring patterns");if(Re>=0)this.raiseRecoverable(Re,"Redefinition of __proto__ property")};zt.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")};zt.isSimpleAssignTarget=function(i){if(i.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(i.expression);return i.type==="Identifier"||i.type==="MemberExpression"};var dt=Lt.prototype;dt.parseTopLevel=function(i){var Ne=Object.create(null);if(!i.body)i.body=[];while(this.type!==Ue.eof){var Ie=this.parseStatement(null,!0,Ne);i.body.push(Ie)}if(this.inModule)for(var Re=0,Le=Object.keys(this.undefinedExports);Re<Le.length;Re+=1){var Me=Le[Re];this.raiseRecoverable(this.undefinedExports[Me].start,"Export '"+Me+"' is not defined")}return this.adaptDirectivePrologue(i.body),this.next(),i.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(i,"Program")};var Di={kind:"loop"},yd={kind:"switch"};dt.isLet=function(i){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Gt.lastIndex=this.pos;var Ne=Gt.exec(this.input),Ie=this.pos+Ne[0].length,Re=this.fullCharCodeAt(Ie);if(Re===91||Re===92)return!0;if(i)return!1;if(Re===123)return!0;if(Qt(Re)){var Le=Ie;do Ie+=Re<=65535?1:2;while(sn(Re=this.fullCharCodeAt(Ie)));if(Re===92)return!0;var Me=this.input.slice(Le,Ie);if(!wa.test(Me))return!0}return!1};dt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Gt.lastIndex=this.pos;var i=Gt.exec(this.input),Ne=this.pos+i[0].length,Ie;return!Zt.test(this.input.slice(this.pos,Ne))&&this.input.slice(Ne,Ne+8)==="function"&&(Ne+8===this.input.length||!(sn(Ie=this.fullCharCodeAt(Ne+8))||Ie===92))};dt.isUsingKeyword=function(i,Ne){if(this.options.ecmaVersion<17||!this.isContextual(i?"await":"using"))return!1;Gt.lastIndex=this.pos;var Ie=Gt.exec(this.input),Re=this.pos+Ie[0].length;if(Zt.test(this.input.slice(this.pos,Re)))return!1;if(i){var Le=Re+5,Me;if(this.input.slice(Re,Le)!=="using"||Le===this.input.length||sn(Me=this.fullCharCodeAt(Le))||Me===92)return!1;Gt.lastIndex=Le;var Oe=Gt.exec(this.input);if(Re=Le+Oe[0].length,Oe&&Zt.test(this.input.slice(Le,Re)))return!1}var Be=this.fullCharCodeAt(Re);if(!Qt(Be)&&Be!==92)return!1;var Fe=Re;do Re+=Be<=65535?1:2;while(sn(Be=this.fullCharCodeAt(Re)));if(Be===92)return!0;var We=this.input.slice(Fe,Re);if(wa.test(We))return!1;if(Ne&&!i&&We==="of"){Gt.lastIndex=Re;var Ve=Gt.exec(this.input);if(Re=Re+Ve[0].length,this.input.charCodeAt(Re)!==61||(Be=this.input.charCodeAt(Re+1))===61||Be===62)return!1}return!0};dt.isAwaitUsing=function(i){return this.isUsingKeyword(!0,i)};dt.isUsing=function(i){return this.isUsingKeyword(!1,i)};dt.parseStatement=function(i,Ne,Ie){var Re=this.type,Le=this.startNode(),Me;if(this.isLet(i))Re=Ue._var,Me="let";switch(Re){case Ue._break:case Ue._continue:return this.parseBreakContinueStatement(Le,Re.keyword);case Ue._debugger:return this.parseDebuggerStatement(Le);case Ue._do:return this.parseDoStatement(Le);case Ue._for:return this.parseForStatement(Le);case Ue._function:if(i&&(this.strict||i!=="if"&&i!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(Le,!1,!i);case Ue._class:if(i)this.unexpected();return this.parseClass(Le,!0);case Ue._if:return this.parseIfStatement(Le);case Ue._return:return this.parseReturnStatement(Le);case Ue._switch:return this.parseSwitchStatement(Le);case Ue._throw:return this.parseThrowStatement(Le);case Ue._try:return this.parseTryStatement(Le);case Ue._const:case Ue._var:if(Me=Me||this.value,i&&Me!=="var")this.unexpected();return this.parseVarStatement(Le,Me);case Ue._while:return this.parseWhileStatement(Le);case Ue._with:return this.parseWithStatement(Le);case Ue.braceL:return this.parseBlock(!0,Le);case Ue.semi:return this.parseEmptyStatement(Le);case Ue._export:case Ue._import:if(this.options.ecmaVersion>10&&Re===Ue._import){Gt.lastIndex=this.pos;var Oe=Gt.exec(this.input),Be=this.pos+Oe[0].length,Fe=this.input.charCodeAt(Be);if(Fe===40||Fe===46)return this.parseExpressionStatement(Le,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!Ne)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 Re===Ue._import?this.parseImport(Le):this.parseExport(Le,Ie);default:if(this.isAsyncFunction()){if(i)this.unexpected();return this.next(),this.parseFunctionStatement(Le,!0,!i)}var We=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(We){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(i)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(We==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(Le,!1,We),this.semicolon(),this.finishNode(Le,"VariableDeclaration")}var Ve=this.value,Ge=this.parseExpression();if(Re===Ue.name&&Ge.type==="Identifier"&&this.eat(Ue.colon))return this.parseLabeledStatement(Le,Ve,Ge,i);else return this.parseExpressionStatement(Le,Ge)}};dt.parseBreakContinueStatement=function(i,Ne){var Ie=Ne==="break";if(this.next(),this.eat(Ue.semi)||this.insertSemicolon())i.label=null;else if(this.type!==Ue.name)this.unexpected();else i.label=this.parseIdent(),this.semicolon();var Re=0;for(;Re<this.labels.length;++Re){var Le=this.labels[Re];if(i.label==null||Le.name===i.label.name){if(Le.kind!=null&&(Ie||Le.kind==="loop"))break;if(i.label&&Ie)break}}if(Re===this.labels.length)this.raise(i.start,"Unsyntactic "+Ne);return this.finishNode(i,Ie?"BreakStatement":"ContinueStatement")};dt.parseDebuggerStatement=function(i){return this.next(),this.semicolon(),this.finishNode(i,"DebuggerStatement")};dt.parseDoStatement=function(i){if(this.next(),this.labels.push(Di),i.body=this.parseStatement("do"),this.labels.pop(),this.expect(Ue._while),i.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(Ue.semi);else this.semicolon();return this.finishNode(i,"DoWhileStatement")};dt.parseForStatement=function(i){this.next();var Ne=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Di),this.enterScope(0),this.expect(Ue.parenL),this.type===Ue.semi){if(Ne>-1)this.unexpected(Ne);return this.parseFor(i,null)}var Ie=this.isLet();if(this.type===Ue._var||this.type===Ue._const||Ie){var Re=this.startNode(),Le=Ie?"let":this.value;return this.next(),this.parseVar(Re,!0,Le),this.finishNode(Re,"VariableDeclaration"),this.parseForAfterInit(i,Re,Ne)}var Me=this.isContextual("let"),Oe=!1,Be=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Be){var Fe=this.startNode();if(this.next(),Be==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Fe,!0,Be),this.finishNode(Fe,"VariableDeclaration"),this.parseForAfterInit(i,Fe,Ne)}var We=this.containsEsc,Ve=new cs,Ge=this.start,Ke=Ne>-1?this.parseExprSubscripts(Ve,"await"):this.parseExpression(!0,Ve);if(this.type===Ue._in||(Oe=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(Ne>-1){if(this.type===Ue._in)this.unexpected(Ne);i.await=!0}else if(Oe&&this.options.ecmaVersion>=8){if(Ke.start===Ge&&!We&&Ke.type==="Identifier"&&Ke.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)i.await=!1}if(Me&&Oe)this.raise(Ke.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(Ke,!1,Ve),this.checkLValPattern(Ke),this.parseForIn(i,Ke)}else this.checkExpressionErrors(Ve,!0);if(Ne>-1)this.unexpected(Ne);return this.parseFor(i,Ke)};dt.parseForAfterInit=function(i,Ne,Ie){if((this.type===Ue._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Ne.declarations.length===1){if(this.type===Ue._in){if((Ne.kind==="using"||Ne.kind==="await using")&&!Ne.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&Ie>-1)this.unexpected(Ie)}else if(this.options.ecmaVersion>=9)i.await=Ie>-1;return this.parseForIn(i,Ne)}if(Ie>-1)this.unexpected(Ie);return this.parseFor(i,Ne)};dt.parseFunctionStatement=function(i,Ne,Ie){return this.next(),this.parseFunction(i,wr|(Ie?0:vi),!1,Ne)};dt.parseIfStatement=function(i){return this.next(),i.test=this.parseParenExpression(),i.consequent=this.parseStatement("if"),i.alternate=this.eat(Ue._else)?this.parseStatement("if"):null,this.finishNode(i,"IfStatement")};dt.parseReturnStatement=function(i){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(Ue.semi)||this.insertSemicolon())i.argument=null;else i.argument=this.parseExpression(),this.semicolon();return this.finishNode(i,"ReturnStatement")};dt.parseSwitchStatement=function(i){this.next(),i.discriminant=this.parseParenExpression(),i.cases=[],this.expect(Ue.braceL),this.labels.push(yd),this.enterScope(Ra);var Ne;for(var Ie=!1;this.type!==Ue.braceR;)if(this.type===Ue._case||this.type===Ue._default){var Re=this.type===Ue._case;if(Ne)this.finishNode(Ne,"SwitchCase");if(i.cases.push(Ne=this.startNode()),Ne.consequent=[],this.next(),Re)Ne.test=this.parseExpression();else{if(Ie)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");Ie=!0,Ne.test=null}this.expect(Ue.colon)}else{if(!Ne)this.unexpected();Ne.consequent.push(this.parseStatement(null))}if(this.exitScope(),Ne)this.finishNode(Ne,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(i,"SwitchStatement")};dt.parseThrowStatement=function(i){if(this.next(),Zt.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return i.argument=this.parseExpression(),this.semicolon(),this.finishNode(i,"ThrowStatement")};var gd=[];dt.parseCatchClauseParam=function(){var i=this.parseBindingAtom(),Ne=i.type==="Identifier";return this.enterScope(Ne?Da:0),this.checkLValPattern(i,Ne?Oa:_n),this.expect(Ue.parenR),i};dt.parseTryStatement=function(i){if(this.next(),i.block=this.parseBlock(),i.handler=null,this.type===Ue._catch){var Ne=this.startNode();if(this.next(),this.eat(Ue.parenL))Ne.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();Ne.param=null,this.enterScope(0)}Ne.body=this.parseBlock(!1),this.exitScope(),i.handler=this.finishNode(Ne,"CatchClause")}if(i.finalizer=this.eat(Ue._finally)?this.parseBlock():null,!i.handler&&!i.finalizer)this.raise(i.start,"Missing catch or finally clause");return this.finishNode(i,"TryStatement")};dt.parseVarStatement=function(i,Ne,Ie){return this.next(),this.parseVar(i,!1,Ne,Ie),this.semicolon(),this.finishNode(i,"VariableDeclaration")};dt.parseWhileStatement=function(i){return this.next(),i.test=this.parseParenExpression(),this.labels.push(Di),i.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(i,"WhileStatement")};dt.parseWithStatement=function(i){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),i.object=this.parseParenExpression(),i.body=this.parseStatement("with"),this.finishNode(i,"WithStatement")};dt.parseEmptyStatement=function(i){return this.next(),this.finishNode(i,"EmptyStatement")};dt.parseLabeledStatement=function(i,Ne,Ie,Re){for(var Le=0,Me=this.labels;Le<Me.length;Le+=1){var Oe=Me[Le];if(Oe.name===Ne)this.raise(Ie.start,"Label '"+Ne+"' is already declared")}var Be=this.type.isLoop?"loop":this.type===Ue._switch?"switch":null;for(var Fe=this.labels.length-1;Fe>=0;Fe--){var We=this.labels[Fe];if(We.statementStart===i.start)We.statementStart=this.start,We.kind=Be;else break}return this.labels.push({name:Ne,kind:Be,statementStart:this.start}),i.body=this.parseStatement(Re?Re.indexOf("label")===-1?Re+"label":Re:"label"),this.labels.pop(),i.label=Ie,this.finishNode(i,"LabeledStatement")};dt.parseExpressionStatement=function(i,Ne){return i.expression=Ne,this.semicolon(),this.finishNode(i,"ExpressionStatement")};dt.parseBlock=function(i,Ne,Ie){if(i===void 0)i=!0;if(Ne===void 0)Ne=this.startNode();if(Ne.body=[],this.expect(Ue.braceL),i)this.enterScope(0);while(this.type!==Ue.braceR){var Re=this.parseStatement(null);Ne.body.push(Re)}if(Ie)this.strict=!1;if(this.next(),i)this.exitScope();return this.finishNode(Ne,"BlockStatement")};dt.parseFor=function(i,Ne){return i.init=Ne,this.expect(Ue.semi),i.test=this.type===Ue.semi?null:this.parseExpression(),this.expect(Ue.semi),i.update=this.type===Ue.parenR?null:this.parseExpression(),this.expect(Ue.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,"ForStatement")};dt.parseForIn=function(i,Ne){var Ie=this.type===Ue._in;if(this.next(),Ne.type==="VariableDeclaration"&&Ne.declarations[0].init!=null&&(!Ie||this.options.ecmaVersion<8||this.strict||Ne.kind!=="var"||Ne.declarations[0].id.type!=="Identifier"))this.raise(Ne.start,(Ie?"for-in":"for-of")+" loop variable declaration may not have an initializer");return i.left=Ne,i.right=Ie?this.parseExpression():this.parseMaybeAssign(),this.expect(Ue.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,Ie?"ForInStatement":"ForOfStatement")};dt.parseVar=function(i,Ne,Ie,Re){i.declarations=[],i.kind=Ie;for(;;){var Le=this.startNode();if(this.parseVarId(Le,Ie),this.eat(Ue.eq))Le.init=this.parseMaybeAssign(Ne);else if(!Re&&Ie==="const"&&!(this.type===Ue._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!Re&&(Ie==="using"||Ie==="await using")&&this.options.ecmaVersion>=17&&this.type!==Ue._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+Ie+" declaration");else if(!Re&&Le.id.type!=="Identifier"&&!(Ne&&(this.type===Ue._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else Le.init=null;if(i.declarations.push(this.finishNode(Le,"VariableDeclarator")),!this.eat(Ue.comma))break}return i};dt.parseVarId=function(i,Ne){i.id=Ne==="using"||Ne==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(i.id,Ne==="var"?_i:_n,!1)};var wr=1,vi=2,$a=4;dt.parseFunction=function(i,Ne,Ie,Re,Le){if(this.initFunction(i),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Re){if(this.type===Ue.star&&Ne&vi)this.unexpected();i.generator=this.eat(Ue.star)}if(this.options.ecmaVersion>=8)i.async=!!Re;if(Ne&wr){if(i.id=Ne&$a&&this.type!==Ue.name?null:this.parseIdent(),i.id&&!(Ne&vi))this.checkLValSimple(i.id,this.strict||i.generator||i.async?this.treatFunctionsAsVar?_i:_n:La)}var Me=this.yieldPos,Oe=this.awaitPos,Be=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ni(i.async,i.generator)),!(Ne&wr))i.id=this.type===Ue.name?this.parseIdent():null;return this.parseFunctionParams(i),this.parseFunctionBody(i,Ie,!1,Le),this.yieldPos=Me,this.awaitPos=Oe,this.awaitIdentPos=Be,this.finishNode(i,Ne&wr?"FunctionDeclaration":"FunctionExpression")};dt.parseFunctionParams=function(i){this.expect(Ue.parenL),i.params=this.parseBindingList(Ue.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};dt.parseClass=function(i,Ne){this.next();var Ie=this.strict;this.strict=!0,this.parseClassId(i,Ne),this.parseClassSuper(i);var Re=this.enterClassBody(),Le=this.startNode(),Me=!1;Le.body=[],this.expect(Ue.braceL);while(this.type!==Ue.braceR){var Oe=this.parseClassElement(i.superClass!==null);if(Oe){if(Le.body.push(Oe),Oe.type==="MethodDefinition"&&Oe.kind==="constructor"){if(Me)this.raiseRecoverable(Oe.start,"Duplicate constructor in the same class");Me=!0}else if(Oe.key&&Oe.key.type==="PrivateIdentifier"&&xd(Re,Oe))this.raiseRecoverable(Oe.key.start,"Identifier '#"+Oe.key.name+"' has already been declared")}}return this.strict=Ie,this.next(),i.body=this.finishNode(Le,"ClassBody"),this.exitClassBody(),this.finishNode(i,Ne?"ClassDeclaration":"ClassExpression")};dt.parseClassElement=function(i){if(this.eat(Ue.semi))return null;var Ne=this.options.ecmaVersion,Ie=this.startNode(),Re="",Le=!1,Me=!1,Oe="method",Be=!1;if(this.eatContextual("static")){if(Ne>=13&&this.eat(Ue.braceL))return this.parseClassStaticBlock(Ie),Ie;if(this.isClassElementNameStart()||this.type===Ue.star)Be=!0;else Re="static"}if(Ie.static=Be,!Re&&Ne>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Ue.star)&&!this.canInsertSemicolon())Me=!0;else Re="async";if(!Re&&(Ne>=9||!Me)&&this.eat(Ue.star))Le=!0;if(!Re&&!Me&&!Le){var Fe=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Oe=Fe;else Re=Fe}if(Re)Ie.computed=!1,Ie.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Ie.key.name=Re,this.finishNode(Ie.key,"Identifier");else this.parseClassElementName(Ie);if(Ne<13||this.type===Ue.parenL||Oe!=="method"||Le||Me){var We=!Ie.static&&ns(Ie,"constructor"),Ve=We&&i;if(We&&Oe!=="method")this.raise(Ie.key.start,"Constructor can't have get/set modifier");Ie.kind=We?"constructor":Oe,this.parseClassMethod(Ie,Le,Me,Ve)}else this.parseClassField(Ie);return Ie};dt.isClassElementNameStart=function(){return this.type===Ue.name||this.type===Ue.privateId||this.type===Ue.num||this.type===Ue.string||this.type===Ue.bracketL||this.type.keyword};dt.parseClassElementName=function(i){if(this.type===Ue.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");i.computed=!1,i.key=this.parsePrivateIdent()}else this.parsePropertyName(i)};dt.parseClassMethod=function(i,Ne,Ie,Re){var Le=i.key;if(i.kind==="constructor"){if(Ne)this.raise(Le.start,"Constructor can't be a generator");if(Ie)this.raise(Le.start,"Constructor can't be an async method")}else if(i.static&&ns(i,"prototype"))this.raise(Le.start,"Classes may not have a static property named prototype");var Me=i.value=this.parseMethod(Ne,Ie,Re);if(i.kind==="get"&&Me.params.length!==0)this.raiseRecoverable(Me.start,"getter should have no params");if(i.kind==="set"&&Me.params.length!==1)this.raiseRecoverable(Me.start,"setter should have exactly one param");if(i.kind==="set"&&Me.params[0].type==="RestElement")this.raiseRecoverable(Me.params[0].start,"Setter cannot use rest params");return this.finishNode(i,"MethodDefinition")};dt.parseClassField=function(i){if(ns(i,"constructor"))this.raise(i.key.start,"Classes can't have a field named 'constructor'");else if(i.static&&ns(i,"prototype"))this.raise(i.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(Ue.eq))this.enterScope(Pr|os),i.value=this.parseMaybeAssign(),this.exitScope();else i.value=null;return this.semicolon(),this.finishNode(i,"PropertyDefinition")};dt.parseClassStaticBlock=function(i){i.body=[];var Ne=this.labels;this.labels=[],this.enterScope(zn|os);while(this.type!==Ue.braceR){var Ie=this.parseStatement(null);i.body.push(Ie)}return this.next(),this.exitScope(),this.labels=Ne,this.finishNode(i,"StaticBlock")};dt.parseClassId=function(i,Ne){if(this.type===Ue.name){if(i.id=this.parseIdent(),Ne)this.checkLValSimple(i.id,_n,!1)}else{if(Ne===!0)this.unexpected();i.id=null}};dt.parseClassSuper=function(i){i.superClass=this.eat(Ue._extends)?this.parseExprSubscripts(null,!1):null};dt.enterClassBody=function(){var i={declared:Object.create(null),used:[]};return this.privateNameStack.push(i),i.declared};dt.exitClassBody=function(){var i=this.privateNameStack.pop(),{declared:Ne,used:Ie}=i;if(!this.options.checkPrivateFields)return;var Re=this.privateNameStack.length,Le=Re===0?null:this.privateNameStack[Re-1];for(var Me=0;Me<Ie.length;++Me){var Oe=Ie[Me];if(!or(Ne,Oe.name))if(Le)Le.used.push(Oe);else this.raiseRecoverable(Oe.start,"Private field '#"+Oe.name+"' must be declared in an enclosing class")}};function xd(i,Ne){var Ie=Ne.key.name,Re=i[Ie],Le="true";if(Ne.type==="MethodDefinition"&&(Ne.kind==="get"||Ne.kind==="set"))Le=(Ne.static?"s":"i")+Ne.kind;if(Re==="iget"&&Le==="iset"||Re==="iset"&&Le==="iget"||Re==="sget"&&Le==="sset"||Re==="sset"&&Le==="sget")return i[Ie]="true",!1;else if(!Re)return i[Ie]=Le,!1;else return!0}function ns(i,Ne){var{computed:Ie,key:Re}=i;return!Ie&&(Re.type==="Identifier"&&Re.name===Ne||Re.type==="Literal"&&Re.value===Ne)}dt.parseExportAllDeclaration=function(i,Ne){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))i.exported=this.parseModuleExportName(),this.checkExport(Ne,i.exported,this.lastTokStart);else i.exported=null;if(this.expectContextual("from"),this.type!==Ue.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ExportAllDeclaration")};dt.parseExport=function(i,Ne){if(this.next(),this.eat(Ue.star))return this.parseExportAllDeclaration(i,Ne);if(this.eat(Ue._default))return this.checkExport(Ne,"default",this.lastTokStart),i.declaration=this.parseExportDefaultDeclaration(),this.finishNode(i,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(i.declaration=this.parseExportDeclaration(i),i.declaration.type==="VariableDeclaration")this.checkVariableExport(Ne,i.declaration.declarations);else this.checkExport(Ne,i.declaration.id,i.declaration.id.start);if(i.specifiers=[],i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}else{if(i.declaration=null,i.specifiers=this.parseExportSpecifiers(Ne),this.eatContextual("from")){if(this.type!==Ue.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause()}else{for(var Ie=0,Re=i.specifiers;Ie<Re.length;Ie+=1){var Le=Re[Ie];if(this.checkUnreserved(Le.local),this.checkLocalExport(Le.local),Le.local.type==="Literal")this.raise(Le.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}this.semicolon()}return this.finishNode(i,"ExportNamedDeclaration")};dt.parseExportDeclaration=function(i){return this.parseStatement(null)};dt.parseExportDefaultDeclaration=function(){var i;if(this.type===Ue._function||(i=this.isAsyncFunction())){var Ne=this.startNode();if(this.next(),i)this.next();return this.parseFunction(Ne,wr|$a,!1,i)}else if(this.type===Ue._class){var Ie=this.startNode();return this.parseClass(Ie,"nullableID")}else{var Re=this.parseMaybeAssign();return this.semicolon(),Re}};dt.checkExport=function(i,Ne,Ie){if(!i)return;if(typeof Ne!=="string")Ne=Ne.type==="Identifier"?Ne.name:Ne.value;if(or(i,Ne))this.raiseRecoverable(Ie,"Duplicate export '"+Ne+"'");i[Ne]=!0};dt.checkPatternExport=function(i,Ne){var Ie=Ne.type;if(Ie==="Identifier")this.checkExport(i,Ne,Ne.start);else if(Ie==="ObjectPattern")for(var Re=0,Le=Ne.properties;Re<Le.length;Re+=1){var Me=Le[Re];this.checkPatternExport(i,Me)}else if(Ie==="ArrayPattern")for(var Oe=0,Be=Ne.elements;Oe<Be.length;Oe+=1){var Fe=Be[Oe];if(Fe)this.checkPatternExport(i,Fe)}else if(Ie==="Property")this.checkPatternExport(i,Ne.value);else if(Ie==="AssignmentPattern")this.checkPatternExport(i,Ne.left);else if(Ie==="RestElement")this.checkPatternExport(i,Ne.argument)};dt.checkVariableExport=function(i,Ne){if(!i)return;for(var Ie=0,Re=Ne;Ie<Re.length;Ie+=1){var Le=Re[Ie];this.checkPatternExport(i,Le.id)}};dt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};dt.parseExportSpecifier=function(i){var Ne=this.startNode();return Ne.local=this.parseModuleExportName(),Ne.exported=this.eatContextual("as")?this.parseModuleExportName():Ne.local,this.checkExport(i,Ne.exported,Ne.exported.start),this.finishNode(Ne,"ExportSpecifier")};dt.parseExportSpecifiers=function(i){var Ne=[],Ie=!0;this.expect(Ue.braceL);while(!this.eat(Ue.braceR)){if(!Ie){if(this.expect(Ue.comma),this.afterTrailingComma(Ue.braceR))break}else Ie=!1;Ne.push(this.parseExportSpecifier(i))}return Ne};dt.parseImport=function(i){if(this.next(),this.type===Ue.string)i.specifiers=gd,i.source=this.parseExprAtom();else i.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),i.source=this.type===Ue.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ImportDeclaration")};dt.parseImportSpecifier=function(){var i=this.startNode();if(i.imported=this.parseModuleExportName(),this.eatContextual("as"))i.local=this.parseIdent();else this.checkUnreserved(i.imported),i.local=i.imported;return this.checkLValSimple(i.local,_n),this.finishNode(i,"ImportSpecifier")};dt.parseImportDefaultSpecifier=function(){var i=this.startNode();return i.local=this.parseIdent(),this.checkLValSimple(i.local,_n),this.finishNode(i,"ImportDefaultSpecifier")};dt.parseImportNamespaceSpecifier=function(){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,_n),this.finishNode(i,"ImportNamespaceSpecifier")};dt.parseImportSpecifiers=function(){var i=[],Ne=!0;if(this.type===Ue.name){if(i.push(this.parseImportDefaultSpecifier()),!this.eat(Ue.comma))return i}if(this.type===Ue.star)return i.push(this.parseImportNamespaceSpecifier()),i;this.expect(Ue.braceL);while(!this.eat(Ue.braceR)){if(!Ne){if(this.expect(Ue.comma),this.afterTrailingComma(Ue.braceR))break}else Ne=!1;i.push(this.parseImportSpecifier())}return i};dt.parseWithClause=function(){var i=[];if(!this.eat(Ue._with))return i;this.expect(Ue.braceL);var Ne={},Ie=!0;while(!this.eat(Ue.braceR)){if(!Ie){if(this.expect(Ue.comma),this.afterTrailingComma(Ue.braceR))break}else Ie=!1;var Re=this.parseImportAttribute(),Le=Re.key.type==="Identifier"?Re.key.name:Re.key.value;if(or(Ne,Le))this.raiseRecoverable(Re.key.start,"Duplicate attribute key '"+Le+"'");Ne[Le]=!0,i.push(Re)}return i};dt.parseImportAttribute=function(){var i=this.startNode();if(i.key=this.type===Ue.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Ue.colon),this.type!==Ue.string)this.unexpected();return i.value=this.parseExprAtom(),this.finishNode(i,"ImportAttribute")};dt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Ue.string){var i=this.parseLiteral(this.value);if(dd.test(i.value))this.raise(i.start,"An export name cannot include a lone surrogate.");return i}return this.parseIdent(!0)};dt.adaptDirectivePrologue=function(i){for(var Ne=0;Ne<i.length&&this.isDirectiveCandidate(i[Ne]);++Ne)i[Ne].directive=i[Ne].expression.raw.slice(1,-1)};dt.isDirectiveCandidate=function(i){return this.options.ecmaVersion>=5&&i.type==="ExpressionStatement"&&i.expression.type==="Literal"&&typeof i.expression.value==="string"&&(this.input[i.start]==='"'||this.input[i.start]==="'")};var yn=Lt.prototype;yn.toAssignable=function(i,Ne,Ie){if(this.options.ecmaVersion>=6&&i)switch(i.type){case"Identifier":if(this.inAsync&&i.name==="await")this.raise(i.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(i.type="ObjectPattern",Ie)this.checkPatternErrors(Ie,!0);for(var Re=0,Le=i.properties;Re<Le.length;Re+=1){var Me=Le[Re];if(this.toAssignable(Me,Ne),Me.type==="RestElement"&&(Me.argument.type==="ArrayPattern"||Me.argument.type==="ObjectPattern"))this.raise(Me.argument.start,"Unexpected token")}break;case"Property":if(i.kind!=="init")this.raise(i.key.start,"Object pattern can't contain getter or setter");this.toAssignable(i.value,Ne);break;case"ArrayExpression":if(i.type="ArrayPattern",Ie)this.checkPatternErrors(Ie,!0);this.toAssignableList(i.elements,Ne);break;case"SpreadElement":if(i.type="RestElement",this.toAssignable(i.argument,Ne),i.argument.type==="AssignmentPattern")this.raise(i.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(i.operator!=="=")this.raise(i.left.end,"Only '=' operator can be used for specifying default value.");i.type="AssignmentPattern",delete i.operator,this.toAssignable(i.left,Ne);break;case"ParenthesizedExpression":this.toAssignable(i.expression,Ne,Ie);break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!Ne)break;default:this.raise(i.start,"Assigning to rvalue")}else if(Ie)this.checkPatternErrors(Ie,!0);return i};yn.toAssignableList=function(i,Ne){var Ie=i.length;for(var Re=0;Re<Ie;Re++){var Le=i[Re];if(Le)this.toAssignable(Le,Ne)}if(Ie){var Me=i[Ie-1];if(this.options.ecmaVersion===6&&Ne&&Me&&Me.type==="RestElement"&&Me.argument.type!=="Identifier")this.unexpected(Me.argument.start)}return i};yn.parseSpread=function(i){var Ne=this.startNode();return this.next(),Ne.argument=this.parseMaybeAssign(!1,i),this.finishNode(Ne,"SpreadElement")};yn.parseRestBinding=function(){var i=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==Ue.name)this.unexpected();return i.argument=this.parseBindingAtom(),this.finishNode(i,"RestElement")};yn.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Ue.bracketL:var i=this.startNode();return this.next(),i.elements=this.parseBindingList(Ue.bracketR,!0,!0),this.finishNode(i,"ArrayPattern");case Ue.braceL:return this.parseObj(!0)}return this.parseIdent()};yn.parseBindingList=function(i,Ne,Ie,Re){var Le=[],Me=!0;while(!this.eat(i)){if(Me)Me=!1;else this.expect(Ue.comma);if(Ne&&this.type===Ue.comma)Le.push(null);else if(Ie&&this.afterTrailingComma(i))break;else if(this.type===Ue.ellipsis){var Oe=this.parseRestBinding();if(this.parseBindingListItem(Oe),Le.push(Oe),this.type===Ue.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(i);break}else Le.push(this.parseAssignableListItem(Re))}return Le};yn.parseAssignableListItem=function(i){var Ne=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(Ne),Ne};yn.parseBindingListItem=function(i){return i};yn.parseMaybeDefault=function(i,Ne,Ie){if(Ie=Ie||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Ue.eq))return Ie;var Re=this.startNodeAt(i,Ne);return Re.left=Ie,Re.right=this.parseMaybeAssign(),this.finishNode(Re,"AssignmentPattern")};yn.checkLValSimple=function(i,Ne,Ie){if(Ne===void 0)Ne=ts;var Re=Ne!==ts;switch(i.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(i.name))this.raiseRecoverable(i.start,(Re?"Binding ":"Assigning to ")+i.name+" in strict mode");if(Re){if(Ne===_n&&i.name==="let")this.raiseRecoverable(i.start,"let is disallowed as a lexically bound name");if(Ie){if(or(Ie,i.name))this.raiseRecoverable(i.start,"Argument name clash");Ie[i.name]=!0}if(Ne!==Ma)this.declareName(i.name,Ne,i.start)}break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(Re)this.raiseRecoverable(i.start,"Binding member expression");break;case"ParenthesizedExpression":if(Re)this.raiseRecoverable(i.start,"Binding parenthesized expression");return this.checkLValSimple(i.expression,Ne,Ie);default:this.raise(i.start,(Re?"Binding":"Assigning to")+" rvalue")}};yn.checkLValPattern=function(i,Ne,Ie){if(Ne===void 0)Ne=ts;switch(i.type){case"ObjectPattern":for(var Re=0,Le=i.properties;Re<Le.length;Re+=1){var Me=Le[Re];this.checkLValInnerPattern(Me,Ne,Ie)}break;case"ArrayPattern":for(var Oe=0,Be=i.elements;Oe<Be.length;Oe+=1){var Fe=Be[Oe];if(Fe)this.checkLValInnerPattern(Fe,Ne,Ie)}break;default:this.checkLValSimple(i,Ne,Ie)}};yn.checkLValInnerPattern=function(i,Ne,Ie){if(Ne===void 0)Ne=ts;switch(i.type){case"Property":this.checkLValInnerPattern(i.value,Ne,Ie);break;case"AssignmentPattern":this.checkLValPattern(i.left,Ne,Ie);break;case"RestElement":this.checkLValPattern(i.argument,Ne,Ie);break;default:this.checkLValPattern(i,Ne,Ie)}};var fn=function(Ne,Ie,Re,Le,Me){this.token=Ne,this.isExpr=!!Ie,this.preserveSpace=!!Re,this.override=Le,this.generator=!!Me},Rt={b_stat:new fn("{",!1),b_expr:new fn("{",!0),b_tmpl:new fn("${",!1),p_stat:new fn("(",!1),p_expr:new fn("(",!0),q_tmpl:new fn("`",!0,!0,function(i){return i.tryReadTemplateToken()}),f_stat:new fn("function",!1),f_expr:new fn("function",!0),f_expr_gen:new fn("function",!0,!1,null,!0),f_gen:new fn("function",!1,!1,null,!0)},ar=Lt.prototype;ar.initialContext=function(){return[Rt.b_stat]};ar.curContext=function(){return this.context[this.context.length-1]};ar.braceIsBlock=function(i){var Ne=this.curContext();if(Ne===Rt.f_expr||Ne===Rt.f_stat)return!0;if(i===Ue.colon&&(Ne===Rt.b_stat||Ne===Rt.b_expr))return!Ne.isExpr;if(i===Ue._return||i===Ue.name&&this.exprAllowed)return Zt.test(this.input.slice(this.lastTokEnd,this.start));if(i===Ue._else||i===Ue.semi||i===Ue.eof||i===Ue.parenR||i===Ue.arrow)return!0;if(i===Ue.braceL)return Ne===Rt.b_stat;if(i===Ue._var||i===Ue._const||i===Ue.name)return!1;return!this.exprAllowed};ar.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var Ne=this.context[i];if(Ne.token==="function")return Ne.generator}return!1};ar.updateContext=function(i){var Ne,Ie=this.type;if(Ie.keyword&&i===Ue.dot)this.exprAllowed=!1;else if(Ne=Ie.updateContext)Ne.call(this,i);else this.exprAllowed=Ie.beforeExpr};ar.overrideContext=function(i){if(this.curContext()!==i)this.context[this.context.length-1]=i};Ue.parenR.updateContext=Ue.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var i=this.context.pop();if(i===Rt.b_stat&&this.curContext().token==="function")i=this.context.pop();this.exprAllowed=!i.isExpr};Ue.braceL.updateContext=function(i){this.context.push(this.braceIsBlock(i)?Rt.b_stat:Rt.b_expr),this.exprAllowed=!0};Ue.dollarBraceL.updateContext=function(){this.context.push(Rt.b_tmpl),this.exprAllowed=!0};Ue.parenL.updateContext=function(i){var Ne=i===Ue._if||i===Ue._for||i===Ue._with||i===Ue._while;this.context.push(Ne?Rt.p_stat:Rt.p_expr),this.exprAllowed=!0};Ue.incDec.updateContext=function(){};Ue._function.updateContext=Ue._class.updateContext=function(i){if(i.beforeExpr&&i!==Ue._else&&!(i===Ue.semi&&this.curContext()!==Rt.p_stat)&&!(i===Ue._return&&Zt.test(this.input.slice(this.lastTokEnd,this.start)))&&!((i===Ue.colon||i===Ue.braceL)&&this.curContext()===Rt.b_stat))this.context.push(Rt.f_expr);else this.context.push(Rt.f_stat);this.exprAllowed=!1};Ue.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};Ue.backQuote.updateContext=function(){if(this.curContext()===Rt.q_tmpl)this.context.pop();else this.context.push(Rt.q_tmpl);this.exprAllowed=!1};Ue.star.updateContext=function(i){if(i===Ue._function){var Ne=this.context.length-1;if(this.context[Ne]===Rt.f_expr)this.context[Ne]=Rt.f_expr_gen;else this.context[Ne]=Rt.f_gen}this.exprAllowed=!0};Ue.name.updateContext=function(i){var Ne=!1;if(this.options.ecmaVersion>=6&&i!==Ue.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())Ne=!0}this.exprAllowed=Ne};var yt=Lt.prototype;yt.checkPropClash=function(i,Ne,Ie){if(this.options.ecmaVersion>=9&&i.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(i.computed||i.method||i.shorthand))return;var Re=i.key,Le;switch(Re.type){case"Identifier":Le=Re.name;break;case"Literal":Le=String(Re.value);break;default:return}var Me=i.kind;if(this.options.ecmaVersion>=6){if(Le==="__proto__"&&Me==="init"){if(Ne.proto)if(Ie){if(Ie.doubleProto<0)Ie.doubleProto=Re.start}else this.raiseRecoverable(Re.start,"Redefinition of __proto__ property");Ne.proto=!0}return}Le="$"+Le;var Oe=Ne[Le];if(Oe){var Be;if(Me==="init")Be=this.strict&&Oe.init||Oe.get||Oe.set;else Be=Oe.init||Oe[Me];if(Be)this.raiseRecoverable(Re.start,"Redefinition of property")}else Oe=Ne[Le]={init:!1,get:!1,set:!1};Oe[Me]=!0};yt.parseExpression=function(i,Ne){var Ie=this;return this.catchStackOverflow(function(){var{start:Re,startLoc:Le}=Ie,Me=Ie.parseMaybeAssign(i,Ne);if(Ie.type===Ue.comma){var Oe=Ie.startNodeAt(Re,Le);Oe.expressions=[Me];while(Ie.eat(Ue.comma))Oe.expressions.push(Ie.parseMaybeAssign(i,Ne));return Ie.finishNode(Oe,"SequenceExpression")}return Me})};yt.parseMaybeAssign=function(i,Ne,Ie){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(i);else this.exprAllowed=!1;var Re=!1,Le=-1,Me=-1,Oe=-1;if(Ne)Le=Ne.parenthesizedAssign,Me=Ne.trailingComma,Oe=Ne.doubleProto,Ne.parenthesizedAssign=Ne.trailingComma=-1;else Ne=new cs,Re=!0;var Be=this.start,Fe=this.startLoc;if(this.type===Ue.parenL||this.type===Ue.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=i==="await";var We=this.parseMaybeConditional(i,Ne);if(Ie)We=Ie.call(this,We,Be,Fe);if(this.type.isAssign){var Ve=this.startNodeAt(Be,Fe);if(Ve.operator=this.value,this.type===Ue.eq)We=this.toAssignable(We,!1,Ne);if(!Re)Ne.parenthesizedAssign=Ne.trailingComma=Ne.doubleProto=-1;if(Ne.shorthandAssign>=We.start)Ne.shorthandAssign=-1;if(this.type===Ue.eq)this.checkLValPattern(We);else this.checkLValSimple(We);if(Ve.left=We,this.next(),Ve.right=this.parseMaybeAssign(i),Oe>-1)Ne.doubleProto=Oe;return this.finishNode(Ve,"AssignmentExpression")}else if(Re)this.checkExpressionErrors(Ne,!0);if(Le>-1)Ne.parenthesizedAssign=Le;if(Me>-1)Ne.trailingComma=Me;return We};yt.parseMaybeConditional=function(i,Ne){var Ie=this.start,Re=this.startLoc,Le=this.parseExprOps(i,Ne);if(this.checkExpressionErrors(Ne))return Le;if(!(Le.type==="ArrowFunctionExpression"&&Le.start===Ie)&&this.eat(Ue.question)){var Me=this.startNodeAt(Ie,Re);return Me.test=Le,Me.consequent=this.parseMaybeAssign(),this.expect(Ue.colon),Me.alternate=this.parseMaybeAssign(i),this.finishNode(Me,"ConditionalExpression")}return Le};yt.parseExprOps=function(i,Ne){var Ie=this.start,Re=this.startLoc,Le=this.parseMaybeUnary(Ne,!1,!1,i);if(this.checkExpressionErrors(Ne))return Le;return Le.start===Ie&&Le.type==="ArrowFunctionExpression"?Le:this.parseExprOp(Le,Ie,Re,-1,i)};yt.parseExprOp=function(i,Ne,Ie,Re,Le){var Me=this.type.binop;if(Me!=null&&(!Le||this.type!==Ue._in)){if(Me>Re){var Oe=this.type===Ue.logicalOR||this.type===Ue.logicalAND,Be=this.type===Ue.coalesce;if(Be)Me=Ue.logicalAND.binop;var Fe=this.value;this.next();var We=this.start,Ve=this.startLoc,Ge=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Le),We,Ve,Me,Le),Ke=this.buildBinary(Ne,Ie,i,Ge,Fe,Oe||Be);if(Oe&&this.type===Ue.coalesce||Be&&(this.type===Ue.logicalOR||this.type===Ue.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(Ke,Ne,Ie,Re,Le)}}return i};yt.buildBinary=function(i,Ne,Ie,Re,Le,Me){if(Re.type==="PrivateIdentifier")this.raise(Re.start,"Private identifier can only be left side of binary expression");var Oe=this.startNodeAt(i,Ne);return Oe.left=Ie,Oe.operator=Le,Oe.right=Re,this.finishNode(Oe,Me?"LogicalExpression":"BinaryExpression")};yt.parseMaybeUnary=function(i,Ne,Ie,Re){var Le=this.start,Me=this.startLoc,Oe;if(this.isContextual("await")&&this.canAwait)Oe=this.parseAwait(Re),Ne=!0;else if(this.type.prefix){var Be=this.startNode(),Fe=this.type===Ue.incDec;if(Be.operator=this.value,Be.prefix=!0,this.next(),Be.argument=this.parseMaybeUnary(null,!0,Fe,Re),this.checkExpressionErrors(i,!0),Fe)this.checkLValSimple(Be.argument);else if(this.strict&&Be.operator==="delete"&&Ba(Be.argument))this.raiseRecoverable(Be.start,"Deleting local variable in strict mode");else if(Be.operator==="delete"&&Si(Be.argument))this.raiseRecoverable(Be.start,"Private fields can not be deleted");else Ne=!0;Oe=this.finishNode(Be,Fe?"UpdateExpression":"UnaryExpression")}else if(!Ne&&this.type===Ue.privateId){if((Re||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(Oe=this.parsePrivateIdent(),this.type!==Ue._in)this.unexpected()}else{if(Oe=this.parseExprSubscripts(i,Re),this.checkExpressionErrors(i))return Oe;while(this.type.postfix&&!this.canInsertSemicolon()){var We=this.startNodeAt(Le,Me);We.operator=this.value,We.prefix=!1,We.argument=Oe,this.checkLValSimple(Oe),this.next(),Oe=this.finishNode(We,"UpdateExpression")}}if(!Ie&&!(Oe.type==="ArrowFunctionExpression"&&Oe.start===Le)&&this.eat(Ue.starstar))if(Ne)this.unexpected(this.lastTokStart);else return this.buildBinary(Le,Me,Oe,this.parseMaybeUnary(null,!1,!1,Re),"**",!1);else return Oe};function Ba(i){return i.type==="Identifier"||i.type==="ParenthesizedExpression"&&Ba(i.expression)}function Si(i){return i.type==="MemberExpression"&&i.property.type==="PrivateIdentifier"||i.type==="ChainExpression"&&Si(i.expression)||i.type==="ParenthesizedExpression"&&Si(i.expression)}yt.parseExprSubscripts=function(i,Ne){var Ie=this.start,Re=this.startLoc,Le=this.parseExprAtom(i,Ne);if(Le.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Le;var Me=this.parseSubscripts(Le,Ie,Re,!1,Ne);if(i&&Me.type==="MemberExpression"){if(i.parenthesizedAssign>=Me.start)i.parenthesizedAssign=-1;if(i.parenthesizedBind>=Me.start)i.parenthesizedBind=-1;if(i.trailingComma>=Me.start)i.trailingComma=-1}return Me};yt.parseSubscripts=function(i,Ne,Ie,Re,Le){var Me=this.options.ecmaVersion>=8&&i.type==="Identifier"&&i.name==="async"&&this.lastTokEnd===i.end&&!this.canInsertSemicolon()&&i.end-i.start===5&&this.potentialArrowAt===i.start,Oe=!1;while(!0){var Be=this.parseSubscript(i,Ne,Ie,Re,Me,Oe,Le);if(Be.optional)Oe=!0;if(Be===i||Be.type==="ArrowFunctionExpression"){if(Oe){var Fe=this.startNodeAt(Ne,Ie);Fe.expression=Be,Be=this.finishNode(Fe,"ChainExpression")}return Be}i=Be}};yt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Ue.arrow)};yt.parseSubscriptAsyncArrow=function(i,Ne,Ie,Re){return this.parseArrowExpression(this.startNodeAt(i,Ne),Ie,!0,Re)};yt.parseSubscript=function(i,Ne,Ie,Re,Le,Me,Oe){var Be=this.options.ecmaVersion>=11,Fe=Be&&this.eat(Ue.questionDot);if(Re&&Fe)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var We=this.eat(Ue.bracketL);if(We||Fe&&this.type!==Ue.parenL&&this.type!==Ue.backQuote||this.eat(Ue.dot)){var Ve=this.startNodeAt(Ne,Ie);if(Ve.object=i,We)Ve.property=this.parseExpression(),this.expect(Ue.bracketR);else if(this.type===Ue.privateId&&i.type!=="Super")Ve.property=this.parsePrivateIdent();else Ve.property=this.parseIdent(this.options.allowReserved!=="never");if(Ve.computed=!!We,Be)Ve.optional=Fe;i=this.finishNode(Ve,"MemberExpression")}else if(!Re&&this.eat(Ue.parenL)){var Ge=new cs,Ke=this.yieldPos,ze=this.awaitPos,Ye=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Qe=this.parseExprList(Ue.parenR,this.options.ecmaVersion>=8,!1,Ge);if(Le&&!Fe&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Ge,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=Ke,this.awaitPos=ze,this.awaitIdentPos=Ye,this.parseSubscriptAsyncArrow(Ne,Ie,Qe,Oe)}this.checkExpressionErrors(Ge,!0),this.yieldPos=Ke||this.yieldPos,this.awaitPos=ze||this.awaitPos,this.awaitIdentPos=Ye||this.awaitIdentPos;var tt=this.startNodeAt(Ne,Ie);if(tt.callee=i,tt.arguments=Qe,Be)tt.optional=Fe;i=this.finishNode(tt,"CallExpression")}else if(this.type===Ue.backQuote){if(Fe||Me)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var ot=this.startNodeAt(Ne,Ie);ot.tag=i,ot.quasi=this.parseTemplate({isTagged:!0}),i=this.finishNode(ot,"TaggedTemplateExpression")}return i};yt.parseExprAtom=function(i,Ne,Ie){if(this.type===Ue.slash)this.readRegexp();var Re,Le=this.potentialArrowAt===this.start;switch(this.type){case Ue._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(Re=this.startNode(),this.next(),this.type===Ue.parenL&&!this.allowDirectSuper)this.raise(Re.start,"super() call outside constructor of a subclass");if(this.type!==Ue.dot&&this.type!==Ue.bracketL&&this.type!==Ue.parenL)this.unexpected();return this.finishNode(Re,"Super");case Ue._this:return Re=this.startNode(),this.next(),this.finishNode(Re,"ThisExpression");case Ue.name:var Me=this.start,Oe=this.startLoc,Be=this.containsEsc,Fe=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Be&&Fe.name==="async"&&!this.canInsertSemicolon()&&this.eat(Ue._function))return this.overrideContext(Rt.f_expr),this.parseFunction(this.startNodeAt(Me,Oe),0,!1,!0,Ne);if(Le&&!this.canInsertSemicolon()){if(this.eat(Ue.arrow))return this.parseArrowExpression(this.startNodeAt(Me,Oe),[Fe],!1,Ne);if(this.options.ecmaVersion>=8&&Fe.name==="async"&&this.type===Ue.name&&!Be&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Fe=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Ue.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(Me,Oe),[Fe],!0,Ne)}}return Fe;case Ue.regexp:var We=this.value;return Re=this.parseLiteral(We.value),Re.regex={pattern:We.pattern,flags:We.flags},Re;case Ue.num:case Ue.string:return this.parseLiteral(this.value);case Ue._null:case Ue._true:case Ue._false:return Re=this.startNode(),Re.value=this.type===Ue._null?null:this.type===Ue._true,Re.raw=this.type.keyword,this.next(),this.finishNode(Re,"Literal");case Ue.parenL:var Ve=this.start,Ge=this.parseParenAndDistinguishExpression(Le,Ne);if(i){if(i.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ge))i.parenthesizedAssign=Ve;if(i.parenthesizedBind<0)i.parenthesizedBind=Ve}return Ge;case Ue.bracketL:return Re=this.startNode(),this.next(),Re.elements=this.parseExprList(Ue.bracketR,!0,!0,i),this.finishNode(Re,"ArrayExpression");case Ue.braceL:return this.overrideContext(Rt.b_expr),this.parseObj(!1,i);case Ue._function:return Re=this.startNode(),this.next(),this.parseFunction(Re,0);case Ue._class:return this.parseClass(this.startNode(),!1);case Ue._new:return this.parseNew();case Ue.backQuote:return this.parseTemplate();case Ue._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(Ie);else return this.unexpected();default:return this.parseExprAtomDefault()}};yt.parseExprAtomDefault=function(){this.unexpected()};yt.parseExprImport=function(i){var Ne=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===Ue.parenL&&!i)return this.parseDynamicImport(Ne);else if(this.type===Ue.dot){var Ie=this.startNodeAt(Ne.start,Ne.loc&&Ne.loc.start);return Ie.name="import",Ne.meta=this.finishNode(Ie,"Identifier"),this.parseImportMeta(Ne)}else this.unexpected()};yt.parseDynamicImport=function(i){if(this.next(),i.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(Ue.parenR))if(this.expect(Ue.comma),!this.afterTrailingComma(Ue.parenR)){if(i.options=this.parseMaybeAssign(),!this.eat(Ue.parenR)){if(this.expect(Ue.comma),!this.afterTrailingComma(Ue.parenR))this.unexpected()}}else i.options=null;else i.options=null;else if(!this.eat(Ue.parenR)){var Ne=this.start;if(this.eat(Ue.comma)&&this.eat(Ue.parenR))this.raiseRecoverable(Ne,"Trailing comma is not allowed in import()");else this.unexpected(Ne)}return this.finishNode(i,"ImportExpression")};yt.parseImportMeta=function(i){this.next();var Ne=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="meta")this.raiseRecoverable(i.property.start,"The only valid meta property for import is 'import.meta'");if(Ne)this.raiseRecoverable(i.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(i.start,"Cannot use 'import.meta' outside a module");return this.finishNode(i,"MetaProperty")};yt.parseLiteral=function(i){var Ne=this.startNode();if(Ne.value=i,Ne.raw=this.input.slice(this.start,this.end),Ne.raw.charCodeAt(Ne.raw.length-1)===110)Ne.bigint=Ne.value!=null?Ne.value.toString():Ne.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(Ne,"Literal")};yt.parseParenExpression=function(){this.expect(Ue.parenL);var i=this.parseExpression();return this.expect(Ue.parenR),i};yt.shouldParseArrow=function(i){return!this.canInsertSemicolon()};yt.parseParenAndDistinguishExpression=function(i,Ne){var Ie=this.start,Re=this.startLoc,Le,Me=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var Oe=this.start,Be=this.startLoc,Fe=[],We=!0,Ve=!1,Ge=new cs,Ke=this.yieldPos,ze=this.awaitPos,Ye;this.yieldPos=0,this.awaitPos=0;while(this.type!==Ue.parenR)if(We?We=!1:this.expect(Ue.comma),Me&&this.afterTrailingComma(Ue.parenR,!0)){Ve=!0;break}else if(this.type===Ue.ellipsis){if(Ye=this.start,Fe.push(this.parseParenItem(this.parseRestBinding())),this.type===Ue.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Fe.push(this.parseMaybeAssign(!1,Ge,this.parseParenItem));var Qe=this.lastTokEnd,tt=this.lastTokEndLoc;if(this.expect(Ue.parenR),i&&this.shouldParseArrow(Fe)&&this.eat(Ue.arrow))return this.checkPatternErrors(Ge,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Ke,this.awaitPos=ze,this.parseParenArrowList(Ie,Re,Fe,Ne);if(!Fe.length||Ve)this.unexpected(this.lastTokStart);if(Ye)this.unexpected(Ye);if(this.checkExpressionErrors(Ge,!0),this.yieldPos=Ke||this.yieldPos,this.awaitPos=ze||this.awaitPos,Fe.length>1)Le=this.startNodeAt(Oe,Be),Le.expressions=Fe,this.finishNodeAt(Le,"SequenceExpression",Qe,tt);else Le=Fe[0]}else Le=this.parseParenExpression();if(this.options.preserveParens){var ot=this.startNodeAt(Ie,Re);return ot.expression=Le,this.finishNode(ot,"ParenthesizedExpression")}else return Le};yt.parseParenItem=function(i){return i};yt.parseParenArrowList=function(i,Ne,Ie,Re){return this.parseArrowExpression(this.startNodeAt(i,Ne),Ie,!1,Re)};var bd=[];yt.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var i=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Ue.dot){var Ne=this.startNodeAt(i.start,i.loc&&i.loc.start);Ne.name="new",i.meta=this.finishNode(Ne,"Identifier"),this.next();var Ie=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="target")this.raiseRecoverable(i.property.start,"The only valid meta property for new is 'new.target'");if(Ie)this.raiseRecoverable(i.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(i.start,"'new.target' can only be used in functions and class static block");return this.finishNode(i,"MetaProperty")}var Re=this.start,Le=this.startLoc;if(i.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Re,Le,!0,!1),i.callee.type==="Super")this.raiseRecoverable(Re,"Invalid use of 'super'");if(this.eat(Ue.parenL))i.arguments=this.parseExprList(Ue.parenR,this.options.ecmaVersion>=8,!1);else i.arguments=bd;return this.finishNode(i,"NewExpression")};yt.parseTemplateElement=function(i){var Ne=i.isTagged,Ie=this.startNode();if(this.type===Ue.invalidTemplate){if(!Ne)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");Ie.value={raw:this.value.replace(/\r\n?/g,`
|
|
4
|
-
`),cooked:null}}else Ie.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
5
|
-
`),cooked:this.value};return this.next(),Ie.tail=this.type===Ue.backQuote,this.finishNode(Ie,"TemplateElement")};yt.parseTemplate=function(i){if(i===void 0)i={};var Ne=i.isTagged;if(Ne===void 0)Ne=!1;var Ie=this.startNode();this.next(),Ie.expressions=[];var Re=this.parseTemplateElement({isTagged:Ne});Ie.quasis=[Re];while(!Re.tail){if(this.type===Ue.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Ue.dollarBraceL),Ie.expressions.push(this.parseExpression()),this.expect(Ue.braceR),Ie.quasis.push(Re=this.parseTemplateElement({isTagged:Ne}))}return this.next(),this.finishNode(Ie,"TemplateLiteral")};yt.isAsyncProp=function(i){return!i.computed&&i.key.type==="Identifier"&&i.key.name==="async"&&(this.type===Ue.name||this.type===Ue.num||this.type===Ue.string||this.type===Ue.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Ue.star)&&!Zt.test(this.input.slice(this.lastTokEnd,this.start))};yt.parseObj=function(i,Ne){var Ie=this.startNode(),Re=!0,Le={};Ie.properties=[],this.next();while(!this.eat(Ue.braceR)){if(!Re){if(this.expect(Ue.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Ue.braceR))break}else Re=!1;var Me=this.parseProperty(i,Ne);if(!i)this.checkPropClash(Me,Le,Ne);Ie.properties.push(Me)}return this.finishNode(Ie,i?"ObjectPattern":"ObjectExpression")};yt.parseProperty=function(i,Ne){var Ie=this.startNode(),Re,Le,Me,Oe;if(this.options.ecmaVersion>=9&&this.eat(Ue.ellipsis)){if(i){if(Ie.argument=this.parseIdent(!1),this.type===Ue.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(Ie,"RestElement")}if(Ie.argument=this.parseMaybeAssign(!1,Ne),this.type===Ue.comma&&Ne&&Ne.trailingComma<0)Ne.trailingComma=this.start;return this.finishNode(Ie,"SpreadElement")}if(this.options.ecmaVersion>=6){if(Ie.method=!1,Ie.shorthand=!1,i||Ne)Me=this.start,Oe=this.startLoc;if(!i)Re=this.eat(Ue.star)}var Be=this.containsEsc;if(this.parsePropertyName(Ie),!i&&!Be&&this.options.ecmaVersion>=8&&!Re&&this.isAsyncProp(Ie))Le=!0,Re=this.options.ecmaVersion>=9&&this.eat(Ue.star),this.parsePropertyName(Ie);else Le=!1;return this.parsePropertyValue(Ie,i,Re,Le,Me,Oe,Ne,Be),this.finishNode(Ie,"Property")};yt.parseGetterSetter=function(i){var Ne=i.key.name;this.parsePropertyName(i),i.value=this.parseMethod(!1),i.kind=Ne;var Ie=i.kind==="get"?0:1;if(i.value.params.length!==Ie){var Re=i.value.start;if(i.kind==="get")this.raiseRecoverable(Re,"getter should have no params");else this.raiseRecoverable(Re,"setter should have exactly one param")}else if(i.kind==="set"&&i.value.params[0].type==="RestElement")this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params")};yt.parsePropertyValue=function(i,Ne,Ie,Re,Le,Me,Oe,Be){if((Ie||Re)&&this.type===Ue.colon)this.unexpected();if(this.eat(Ue.colon))i.value=Ne?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,Oe),i.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Ue.parenL){if(Ne)this.unexpected();i.method=!0,i.value=this.parseMethod(Ie,Re),i.kind="init"}else if(!Ne&&!Be&&this.options.ecmaVersion>=5&&!i.computed&&i.key.type==="Identifier"&&(i.key.name==="get"||i.key.name==="set")&&(this.type!==Ue.comma&&this.type!==Ue.braceR&&this.type!==Ue.eq)){if(Ie||Re)this.unexpected();this.parseGetterSetter(i)}else if(this.options.ecmaVersion>=6&&!i.computed&&i.key.type==="Identifier"){if(Ie||Re)this.unexpected();if(this.checkUnreserved(i.key),i.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Le;if(Ne)i.value=this.parseMaybeDefault(Le,Me,this.copyNode(i.key));else if(this.type===Ue.eq&&Oe){if(Oe.shorthandAssign<0)Oe.shorthandAssign=this.start;i.value=this.parseMaybeDefault(Le,Me,this.copyNode(i.key))}else i.value=this.copyNode(i.key);i.kind="init",i.shorthand=!0}else this.unexpected()};yt.parsePropertyName=function(i){if(this.options.ecmaVersion>=6)if(this.eat(Ue.bracketL))return i.computed=!0,i.key=this.parseMaybeAssign(),this.expect(Ue.bracketR),i.key;else i.computed=!1;return i.key=this.type===Ue.num||this.type===Ue.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};yt.initFunction=function(i){if(i.id=null,this.options.ecmaVersion>=6)i.generator=i.expression=!1;if(this.options.ecmaVersion>=8)i.async=!1};yt.parseMethod=function(i,Ne,Ie){var Re=this.startNode(),Le=this.yieldPos,Me=this.awaitPos,Oe=this.awaitIdentPos;if(this.initFunction(Re),this.options.ecmaVersion>=6)Re.generator=i;if(this.options.ecmaVersion>=8)Re.async=!!Ne;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ni(Ne,Re.generator)|os|(Ie?Ia:0)),this.expect(Ue.parenL),Re.params=this.parseBindingList(Ue.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Re,!1,!0,!1),this.yieldPos=Le,this.awaitPos=Me,this.awaitIdentPos=Oe,this.finishNode(Re,"FunctionExpression")};yt.parseArrowExpression=function(i,Ne,Ie,Re){var Le=this.yieldPos,Me=this.awaitPos,Oe=this.awaitIdentPos;if(this.enterScope(Ni(Ie,!1)|Pi),this.initFunction(i),this.options.ecmaVersion>=8)i.async=!!Ie;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,i.params=this.toAssignableList(Ne,!0),this.parseFunctionBody(i,!0,!1,Re),this.yieldPos=Le,this.awaitPos=Me,this.awaitIdentPos=Oe,this.finishNode(i,"ArrowFunctionExpression")};yt.parseFunctionBody=function(i,Ne,Ie,Re){var Le=Ne&&this.type!==Ue.braceL,Me=this.strict,Oe=!1;if(Le)i.body=this.parseMaybeAssign(Re),i.expression=!0,this.checkParams(i,!1);else{var Be=this.options.ecmaVersion>=7&&!this.isSimpleParamList(i.params);if(!Me||Be){if(Oe=this.strictDirective(this.end),Oe&&Be)this.raiseRecoverable(i.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Fe=this.labels;if(this.labels=[],Oe)this.strict=!0;if(this.checkParams(i,!Me&&!Oe&&!Ne&&!Ie&&this.isSimpleParamList(i.params)),this.strict&&i.id)this.checkLValSimple(i.id,Ma);i.body=this.parseBlock(!1,void 0,Oe&&!Me),i.expression=!1,this.adaptDirectivePrologue(i.body.body),this.labels=Fe}this.exitScope()};yt.isSimpleParamList=function(i){for(var Ne=0,Ie=i;Ne<Ie.length;Ne+=1){var Re=Ie[Ne];if(Re.type!=="Identifier")return!1}return!0};yt.checkParams=function(i,Ne){var Ie=Object.create(null);for(var Re=0,Le=i.params;Re<Le.length;Re+=1){var Me=Le[Re];this.checkLValInnerPattern(Me,_i,Ne?null:Ie)}};yt.parseExprList=function(i,Ne,Ie,Re){var Le=[],Me=!0;while(!this.eat(i)){if(!Me){if(this.expect(Ue.comma),Ne&&this.afterTrailingComma(i))break}else Me=!1;var Oe=void 0;if(Ie&&this.type===Ue.comma)Oe=null;else if(this.type===Ue.ellipsis){if(Oe=this.parseSpread(Re),Re&&this.type===Ue.comma&&Re.trailingComma<0)Re.trailingComma=this.start}else Oe=this.parseMaybeAssign(!1,Re);Le.push(Oe)}return Le};yt.checkUnreserved=function(i){var{start:Ne,end:Ie,name:Re}=i;if(this.inGenerator&&Re==="yield")this.raiseRecoverable(Ne,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&Re==="await")this.raiseRecoverable(Ne,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&as)&&Re==="arguments")this.raiseRecoverable(Ne,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(Re==="arguments"||Re==="await"))this.raise(Ne,"Cannot use "+Re+" in class static initialization block");if(this.keywords.test(Re))this.raise(Ne,"Unexpected keyword '"+Re+"'");if(this.options.ecmaVersion<6&&this.input.slice(Ne,Ie).indexOf("\\")!==-1)return;var Le=this.strict?this.reservedWordsStrict:this.reservedWords;if(Le.test(Re)){if(!this.inAsync&&Re==="await")this.raiseRecoverable(Ne,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(Ne,"The keyword '"+Re+"' is reserved")}};yt.parseIdent=function(i){var Ne=this.parseIdentNode();if(this.next(!!i),this.finishNode(Ne,"Identifier"),!i){if(this.checkUnreserved(Ne),Ne.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=Ne.start}return Ne};yt.parseIdentNode=function(){var i=this.startNode();if(this.type===Ue.name)i.name=this.value;else if(this.type.keyword){if(i.name=this.type.keyword,(i.name==="class"||i.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=Ue.name}else this.unexpected();return i};yt.parsePrivateIdent=function(){var i=this.startNode();if(this.type===Ue.privateId)i.name=this.value;else this.unexpected();if(this.next(),this.finishNode(i,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(i.start,"Private field '#"+i.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(i);return i};yt.parseYield=function(i){if(!this.yieldPos)this.yieldPos=this.start;var Ne=this.startNode();if(this.next(),this.type===Ue.semi||this.canInsertSemicolon()||this.type!==Ue.star&&!this.type.startsExpr)Ne.delegate=!1,Ne.argument=null;else Ne.delegate=this.eat(Ue.star),Ne.argument=this.parseMaybeAssign(i);return this.finishNode(Ne,"YieldExpression")};yt.parseAwait=function(i){if(!this.awaitPos)this.awaitPos=this.start;var Ne=this.startNode();return this.next(),Ne.argument=this.parseMaybeUnary(null,!0,!1,i),this.finishNode(Ne,"AwaitExpression")};var rs=Lt.prototype;rs.raise=function(i,Ne){var Ie=wi(this.input,i);if(Ne+=" ("+Ie.line+":"+Ie.column+")",this.sourceFile)Ne+=" in "+this.sourceFile;var Re=SyntaxError(Ne);throw Re.pos=i,Re.loc=Ie,Re.raisedAt=this.pos,Re};rs.raiseRecoverable=rs.raise;rs.curPosition=function(){if(this.options.locations)return new ir(this.curLine,this.pos-this.lineStart)};var Fn=Lt.prototype,Ed=function(Ne){this.flags=Ne,this.var=[],this.lexical=[],this.functions=[]};Fn.enterScope=function(i){this.scopeStack.push(new Ed(i))};Fn.exitScope=function(){this.scopeStack.pop()};Fn.treatFunctionsAsVarInScope=function(i){return i.flags&Kn||!this.inModule&&i.flags&Un};Fn.declareName=function(i,Ne,Ie){var Re=!1;if(Ne===_n){var Le=this.currentScope();if(Re=Le.lexical.indexOf(i)>-1||Le.functions.indexOf(i)>-1||Le.var.indexOf(i)>-1,Le.lexical.push(i),this.inModule&&Le.flags&Un)delete this.undefinedExports[i]}else if(Ne===Oa){var Me=this.currentScope();Me.lexical.push(i)}else if(Ne===La){var Oe=this.currentScope();if(this.treatFunctionsAsVar)Re=Oe.lexical.indexOf(i)>-1;else Re=Oe.lexical.indexOf(i)>-1||Oe.var.indexOf(i)>-1;Oe.functions.push(i)}else for(var Be=this.scopeStack.length-1;Be>=0;--Be){var Fe=this.scopeStack[Be];if(Fe.lexical.indexOf(i)>-1&&!(Fe.flags&Da&&Fe.lexical[0]===i)||!this.treatFunctionsAsVarInScope(Fe)&&Fe.functions.indexOf(i)>-1){Re=!0;break}if(Fe.var.push(i),this.inModule&&Fe.flags&Un)delete this.undefinedExports[i];if(Fe.flags&as)break}if(Re)this.raiseRecoverable(Ie,"Identifier '"+i+"' has already been declared")};Fn.checkLocalExport=function(i){if(this.scopeStack[0].lexical.indexOf(i.name)===-1&&this.scopeStack[0].var.indexOf(i.name)===-1)this.undefinedExports[i.name]=i};Fn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Fn.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var Ne=this.scopeStack[i];if(Ne.flags&(as|Pr|zn))return Ne}};Fn.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var Ne=this.scopeStack[i];if(Ne.flags&(as|Pr|zn)&&!(Ne.flags&Pi))return Ne}};var Nr=function(Ne,Ie,Re){if(this.type="",this.start=Ie,this.end=0,Ne.options.locations)this.loc=new Ar(Ne,Re);if(Ne.options.directSourceFile)this.sourceFile=Ne.options.directSourceFile;if(Ne.options.ranges)this.range=[Ie,0]},_r=Lt.prototype;_r.startNode=function(){return new Nr(this,this.start,this.startLoc)};_r.startNodeAt=function(i,Ne){return new Nr(this,i,Ne)};function Fa(i,Ne,Ie,Re){if(i.type=Ne,i.end=Ie,this.options.locations)i.loc.end=Re;if(this.options.ranges)i.range[1]=Ie;return i}_r.finishNode=function(i,Ne){return Fa.call(this,i,Ne,this.lastTokEnd,this.lastTokEndLoc)};_r.finishNodeAt=function(i,Ne,Ie,Re){return Fa.call(this,i,Ne,Ie,Re)};_r.copyNode=function(i){var Ne=new Nr(this,i.start,this.startLoc);for(var Ie in i)Ne[Ie]=i[Ie];return Ne};var Cd="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",ja="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Va=ja+" Extended_Pictographic",Wa=Va,qa=Wa+" EBase EComp EMod EPres ExtPict",Ga=qa,vd=Ga,Sd={9:ja,10:Va,11:Wa,12:qa,13:Ga,14:vd},Td="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",kd={9:"",10:"",11:"",12:"",13:"",14:Td},Sa="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ua="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ha=Ua+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ka=Ha+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",za=Ka+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Xa=za+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",wd=Xa+" "+Cd,Ad={9:Ua,10:Ha,11:Ka,12:za,13:Xa,14:wd},Ja={};function Pd(i){var Ne=Ja[i]={binary:Bn(Sd[i]+" "+Sa),binaryOfStrings:Bn(kd[i]),nonBinary:{General_Category:Bn(Sa),Script:Bn(Ad[i])}};Ne.nonBinary.Script_Extensions=Ne.nonBinary.Script,Ne.nonBinary.gc=Ne.nonBinary.General_Category,Ne.nonBinary.sc=Ne.nonBinary.Script,Ne.nonBinary.scx=Ne.nonBinary.Script_Extensions}for(kr=0,Zr=[9,10,11,12,13,14];kr<Zr.length;kr+=1)Ti=Zr[kr],Pd(Ti);var Ti,kr,Zr,pt=Lt.prototype,ss=function(Ne,Ie){this.parent=Ne,this.base=Ie||this};ss.prototype.separatedFrom=function(Ne){for(var Ie=this;Ie;Ie=Ie.parent)for(var Re=Ne;Re;Re=Re.parent)if(Ie.base===Re.base&&Ie!==Re)return!0;return!1};ss.prototype.sibling=function(){return new ss(this.parent,this.base)};var En=function(Ne){this.parser=Ne,this.validFlags="gim"+(Ne.options.ecmaVersion>=6?"uy":"")+(Ne.options.ecmaVersion>=9?"s":"")+(Ne.options.ecmaVersion>=13?"d":"")+(Ne.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ja[Ne.options.ecmaVersion>=14?14:Ne.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};En.prototype.reset=function(Ne,Ie,Re){var Le=Re.indexOf("v")!==-1,Me=Re.indexOf("u")!==-1;if(this.start=Ne|0,this.source=Ie+"",this.flags=Re,Le&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=Me&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=Me&&this.parser.options.ecmaVersion>=9};En.prototype.raise=function(Ne){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+Ne)};En.prototype.at=function(Ne,Ie){if(Ie===void 0)Ie=!1;var Re=this.source,Le=Re.length;if(Ne>=Le)return-1;var Me=Re.charCodeAt(Ne);if(!(Ie||this.switchU)||Me<=55295||Me>=57344||Ne+1>=Le)return Me;var Oe=Re.charCodeAt(Ne+1);return Oe>=56320&&Oe<=57343?(Me<<10)+Oe-56613888:Me};En.prototype.nextIndex=function(Ne,Ie){if(Ie===void 0)Ie=!1;var Re=this.source,Le=Re.length;if(Ne>=Le)return Le;var Me=Re.charCodeAt(Ne),Oe;if(!(Ie||this.switchU)||Me<=55295||Me>=57344||Ne+1>=Le||(Oe=Re.charCodeAt(Ne+1))<56320||Oe>57343)return Ne+1;return Ne+2};En.prototype.current=function(Ne){if(Ne===void 0)Ne=!1;return this.at(this.pos,Ne)};En.prototype.lookahead=function(Ne){if(Ne===void 0)Ne=!1;return this.at(this.nextIndex(this.pos,Ne),Ne)};En.prototype.advance=function(Ne){if(Ne===void 0)Ne=!1;this.pos=this.nextIndex(this.pos,Ne)};En.prototype.eat=function(Ne,Ie){if(Ie===void 0)Ie=!1;if(this.current(Ie)===Ne)return this.advance(Ie),!0;return!1};En.prototype.eatChars=function(Ne,Ie){if(Ie===void 0)Ie=!1;var Re=this.pos;for(var Le=0,Me=Ne;Le<Me.length;Le+=1){var Oe=Me[Le],Be=this.at(Re,Ie);if(Be===-1||Be!==Oe)return!1;Re=this.nextIndex(Re,Ie)}return this.pos=Re,!0};pt.validateRegExpFlags=function(i){var{validFlags:Ne,flags:Ie}=i,Re=!1,Le=!1;for(var Me=0;Me<Ie.length;Me++){var Oe=Ie.charAt(Me);if(Ne.indexOf(Oe)===-1)this.raise(i.start,"Invalid regular expression flag");if(Ie.indexOf(Oe,Me+1)>-1)this.raise(i.start,"Duplicate regular expression flag");if(Oe==="u")Re=!0;if(Oe==="v")Le=!0}if(this.options.ecmaVersion>=15&&Re&&Le)this.raise(i.start,"Invalid regular expression flag")};function Nd(i){for(var Ne in i)return!0;return!1}pt.validateRegExpPattern=function(i){if(this.regexp_pattern(i),!i.switchN&&this.options.ecmaVersion>=9&&Nd(i.groupNames))i.switchN=!0,this.regexp_pattern(i)};pt.regexp_pattern=function(i){if(i.pos=0,i.lastIntValue=0,i.lastStringValue="",i.lastAssertionIsQuantifiable=!1,i.numCapturingParens=0,i.maxBackReference=0,i.groupNames=Object.create(null),i.backReferenceNames.length=0,i.branchID=null,this.regexp_disjunction(i),i.pos!==i.source.length){if(i.eat(41))i.raise("Unmatched ')'");if(i.eat(93)||i.eat(125))i.raise("Lone quantifier brackets")}if(i.maxBackReference>i.numCapturingParens)i.raise("Invalid escape");for(var Ne=0,Ie=i.backReferenceNames;Ne<Ie.length;Ne+=1){var Re=Ie[Ne];if(!i.groupNames[Re])i.raise("Invalid named capture referenced")}};pt.regexp_disjunction=function(i){var Ne=this.options.ecmaVersion>=16;if(Ne)i.branchID=new ss(i.branchID,null);this.regexp_alternative(i);while(i.eat(124)){if(Ne)i.branchID=i.branchID.sibling();this.regexp_alternative(i)}if(Ne)i.branchID=i.branchID.parent;if(this.regexp_eatQuantifier(i,!0))i.raise("Nothing to repeat");if(i.eat(123))i.raise("Lone quantifier brackets")};pt.regexp_alternative=function(i){while(i.pos<i.source.length&&this.regexp_eatTerm(i));};pt.regexp_eatTerm=function(i){if(this.regexp_eatAssertion(i)){if(i.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(i)){if(i.switchU)i.raise("Invalid quantifier")}return!0}if(i.switchU?this.regexp_eatAtom(i):this.regexp_eatExtendedAtom(i))return this.regexp_eatQuantifier(i),!0;return!1};pt.regexp_eatAssertion=function(i){var Ne=i.pos;if(i.lastAssertionIsQuantifiable=!1,i.eat(94)||i.eat(36))return!0;if(i.eat(92)){if(i.eat(66)||i.eat(98))return!0;i.pos=Ne}if(i.eat(40)&&i.eat(63)){var Ie=!1;if(this.options.ecmaVersion>=9)Ie=i.eat(60);if(i.eat(61)||i.eat(33)){if(this.regexp_disjunction(i),!i.eat(41))i.raise("Unterminated group");return i.lastAssertionIsQuantifiable=!Ie,!0}}return i.pos=Ne,!1};pt.regexp_eatQuantifier=function(i,Ne){if(Ne===void 0)Ne=!1;if(this.regexp_eatQuantifierPrefix(i,Ne))return i.eat(63),!0;return!1};pt.regexp_eatQuantifierPrefix=function(i,Ne){return i.eat(42)||i.eat(43)||i.eat(63)||this.regexp_eatBracedQuantifier(i,Ne)};pt.regexp_eatBracedQuantifier=function(i,Ne){var Ie=i.pos;if(i.eat(123)){var Re=0,Le=-1;if(this.regexp_eatDecimalDigits(i)){if(Re=i.lastIntValue,i.eat(44)&&this.regexp_eatDecimalDigits(i))Le=i.lastIntValue;if(i.eat(125)){if(Le!==-1&&Le<Re&&!Ne)i.raise("numbers out of order in {} quantifier");return!0}}if(i.switchU&&!Ne)i.raise("Incomplete quantifier");i.pos=Ie}return!1};pt.regexp_eatAtom=function(i){return this.regexp_eatPatternCharacters(i)||i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)};pt.regexp_eatReverseSolidusAtomEscape=function(i){var Ne=i.pos;if(i.eat(92)){if(this.regexp_eatAtomEscape(i))return!0;i.pos=Ne}return!1};pt.regexp_eatUncapturingGroup=function(i){var Ne=i.pos;if(i.eat(40)){if(i.eat(63)){if(this.options.ecmaVersion>=16){var Ie=this.regexp_eatModifiers(i),Re=i.eat(45);if(Ie||Re){for(var Le=0;Le<Ie.length;Le++){var Me=Ie.charAt(Le);if(Ie.indexOf(Me,Le+1)>-1)i.raise("Duplicate regular expression modifiers")}if(Re){var Oe=this.regexp_eatModifiers(i);if(!Ie&&!Oe&&i.current()===58)i.raise("Invalid regular expression modifiers");for(var Be=0;Be<Oe.length;Be++){var Fe=Oe.charAt(Be);if(Oe.indexOf(Fe,Be+1)>-1||Ie.indexOf(Fe)>-1)i.raise("Duplicate regular expression modifiers")}}}}if(i.eat(58)){if(this.regexp_disjunction(i),i.eat(41))return!0;i.raise("Unterminated group")}}i.pos=Ne}return!1};pt.regexp_eatCapturingGroup=function(i){if(i.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(i);else if(i.current()===63)i.raise("Invalid group");if(this.regexp_disjunction(i),i.eat(41))return i.numCapturingParens+=1,!0;i.raise("Unterminated group")}return!1};pt.regexp_eatModifiers=function(i){var Ne="",Ie=0;while((Ie=i.current())!==-1&&_d(Ie))Ne+=Pn(Ie),i.advance();return Ne};function _d(i){return i===105||i===109||i===115}pt.regexp_eatExtendedAtom=function(i){return i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)||this.regexp_eatInvalidBracedQuantifier(i)||this.regexp_eatExtendedPatternCharacter(i)};pt.regexp_eatInvalidBracedQuantifier=function(i){if(this.regexp_eatBracedQuantifier(i,!0))i.raise("Nothing to repeat");return!1};pt.regexp_eatSyntaxCharacter=function(i){var Ne=i.current();if(Ya(Ne))return i.lastIntValue=Ne,i.advance(),!0;return!1};function Ya(i){return i===36||i>=40&&i<=43||i===46||i===63||i>=91&&i<=94||i>=123&&i<=125}pt.regexp_eatPatternCharacters=function(i){var Ne=i.pos,Ie=0;while((Ie=i.current())!==-1&&!Ya(Ie))i.advance();return i.pos!==Ne};pt.regexp_eatExtendedPatternCharacter=function(i){var Ne=i.current();if(Ne!==-1&&Ne!==36&&!(Ne>=40&&Ne<=43)&&Ne!==46&&Ne!==63&&Ne!==91&&Ne!==94&&Ne!==124)return i.advance(),!0;return!1};pt.regexp_groupSpecifier=function(i){if(i.eat(63)){if(!this.regexp_eatGroupName(i))i.raise("Invalid group");var Ne=this.options.ecmaVersion>=16,Ie=i.groupNames[i.lastStringValue];if(Ie)if(Ne)for(var Re=0,Le=Ie;Re<Le.length;Re+=1){var Me=Le[Re];if(!Me.separatedFrom(i.branchID))i.raise("Duplicate capture group name")}else i.raise("Duplicate capture group name");if(Ne)(Ie||(i.groupNames[i.lastStringValue]=[])).push(i.branchID);else i.groupNames[i.lastStringValue]=!0}};pt.regexp_eatGroupName=function(i){if(i.lastStringValue="",i.eat(60)){if(this.regexp_eatRegExpIdentifierName(i)&&i.eat(62))return!0;i.raise("Invalid capture group name")}return!1};pt.regexp_eatRegExpIdentifierName=function(i){if(i.lastStringValue="",this.regexp_eatRegExpIdentifierStart(i)){i.lastStringValue+=Pn(i.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(i))i.lastStringValue+=Pn(i.lastIntValue);return!0}return!1};pt.regexp_eatRegExpIdentifierStart=function(i){var Ne=i.pos,Ie=this.options.ecmaVersion>=11,Re=i.current(Ie);if(i.advance(Ie),Re===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Ie))Re=i.lastIntValue;if(Dd(Re))return i.lastIntValue=Re,!0;return i.pos=Ne,!1};function Dd(i){return Qt(i,!0)||i===36||i===95}pt.regexp_eatRegExpIdentifierPart=function(i){var Ne=i.pos,Ie=this.options.ecmaVersion>=11,Re=i.current(Ie);if(i.advance(Ie),Re===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,Ie))Re=i.lastIntValue;if(Id(Re))return i.lastIntValue=Re,!0;return i.pos=Ne,!1};function Id(i){return sn(i,!0)||i===36||i===95||i===8204||i===8205}pt.regexp_eatAtomEscape=function(i){if(this.regexp_eatBackReference(i)||this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)||i.switchN&&this.regexp_eatKGroupName(i))return!0;if(i.switchU){if(i.current()===99)i.raise("Invalid unicode escape");i.raise("Invalid escape")}return!1};pt.regexp_eatBackReference=function(i){var Ne=i.pos;if(this.regexp_eatDecimalEscape(i)){var Ie=i.lastIntValue;if(i.switchU){if(Ie>i.maxBackReference)i.maxBackReference=Ie;return!0}if(Ie<=i.numCapturingParens)return!0;i.pos=Ne}return!1};pt.regexp_eatKGroupName=function(i){if(i.eat(107)){if(this.regexp_eatGroupName(i))return i.backReferenceNames.push(i.lastStringValue),!0;i.raise("Invalid named reference")}return!1};pt.regexp_eatCharacterEscape=function(i){return this.regexp_eatControlEscape(i)||this.regexp_eatCControlLetter(i)||this.regexp_eatZero(i)||this.regexp_eatHexEscapeSequence(i)||this.regexp_eatRegExpUnicodeEscapeSequence(i,!1)||!i.switchU&&this.regexp_eatLegacyOctalEscapeSequence(i)||this.regexp_eatIdentityEscape(i)};pt.regexp_eatCControlLetter=function(i){var Ne=i.pos;if(i.eat(99)){if(this.regexp_eatControlLetter(i))return!0;i.pos=Ne}return!1};pt.regexp_eatZero=function(i){if(i.current()===48&&!ls(i.lookahead()))return i.lastIntValue=0,i.advance(),!0;return!1};pt.regexp_eatControlEscape=function(i){var Ne=i.current();if(Ne===116)return i.lastIntValue=9,i.advance(),!0;if(Ne===110)return i.lastIntValue=10,i.advance(),!0;if(Ne===118)return i.lastIntValue=11,i.advance(),!0;if(Ne===102)return i.lastIntValue=12,i.advance(),!0;if(Ne===114)return i.lastIntValue=13,i.advance(),!0;return!1};pt.regexp_eatControlLetter=function(i){var Ne=i.current();if(Qa(Ne))return i.lastIntValue=Ne%32,i.advance(),!0;return!1};function Qa(i){return i>=65&&i<=90||i>=97&&i<=122}pt.regexp_eatRegExpUnicodeEscapeSequence=function(i,Ne){if(Ne===void 0)Ne=!1;var Ie=i.pos,Re=Ne||i.switchU;if(i.eat(117)){if(this.regexp_eatFixedHexDigits(i,4)){var Le=i.lastIntValue;if(Re&&Le>=55296&&Le<=56319){var Me=i.pos;if(i.eat(92)&&i.eat(117)&&this.regexp_eatFixedHexDigits(i,4)){var Oe=i.lastIntValue;if(Oe>=56320&&Oe<=57343)return i.lastIntValue=(Le-55296)*1024+(Oe-56320)+65536,!0}i.pos=Me,i.lastIntValue=Le}return!0}if(Re&&i.eat(123)&&this.regexp_eatHexDigits(i)&&i.eat(125)&&Rd(i.lastIntValue))return!0;if(Re)i.raise("Invalid unicode escape");i.pos=Ie}return!1};function Rd(i){return i>=0&&i<=1114111}pt.regexp_eatIdentityEscape=function(i){if(i.switchU){if(this.regexp_eatSyntaxCharacter(i))return!0;if(i.eat(47))return i.lastIntValue=47,!0;return!1}var Ne=i.current();if(Ne!==99&&(!i.switchN||Ne!==107))return i.lastIntValue=Ne,i.advance(),!0;return!1};pt.regexp_eatDecimalEscape=function(i){i.lastIntValue=0;var Ne=i.current();if(Ne>=49&&Ne<=57){do i.lastIntValue=10*i.lastIntValue+(Ne-48),i.advance();while((Ne=i.current())>=48&&Ne<=57);return!0}return!1};var Za=0,Nn=1,hn=2;pt.regexp_eatCharacterClassEscape=function(i){var Ne=i.current();if(Ld(Ne))return i.lastIntValue=-1,i.advance(),Nn;var Ie=!1;if(i.switchU&&this.options.ecmaVersion>=9&&((Ie=Ne===80)||Ne===112)){i.lastIntValue=-1,i.advance();var Re;if(i.eat(123)&&(Re=this.regexp_eatUnicodePropertyValueExpression(i))&&i.eat(125)){if(Ie&&Re===hn)i.raise("Invalid property name");return Re}i.raise("Invalid property name")}return Za};function Ld(i){return i===100||i===68||i===115||i===83||i===119||i===87}pt.regexp_eatUnicodePropertyValueExpression=function(i){var Ne=i.pos;if(this.regexp_eatUnicodePropertyName(i)&&i.eat(61)){var Ie=i.lastStringValue;if(this.regexp_eatUnicodePropertyValue(i)){var Re=i.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(i,Ie,Re),Nn}}if(i.pos=Ne,this.regexp_eatLoneUnicodePropertyNameOrValue(i)){var Le=i.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(i,Le)}return Za};pt.regexp_validateUnicodePropertyNameAndValue=function(i,Ne,Ie){if(!or(i.unicodeProperties.nonBinary,Ne))i.raise("Invalid property name");if(!i.unicodeProperties.nonBinary[Ne].test(Ie))i.raise("Invalid property value")};pt.regexp_validateUnicodePropertyNameOrValue=function(i,Ne){if(i.unicodeProperties.binary.test(Ne))return Nn;if(i.switchV&&i.unicodeProperties.binaryOfStrings.test(Ne))return hn;i.raise("Invalid property name")};pt.regexp_eatUnicodePropertyName=function(i){var Ne=0;i.lastStringValue="";while(ec(Ne=i.current()))i.lastStringValue+=Pn(Ne),i.advance();return i.lastStringValue!==""};function ec(i){return Qa(i)||i===95}pt.regexp_eatUnicodePropertyValue=function(i){var Ne=0;i.lastStringValue="";while(Od(Ne=i.current()))i.lastStringValue+=Pn(Ne),i.advance();return i.lastStringValue!==""};function Od(i){return ec(i)||ls(i)}pt.regexp_eatLoneUnicodePropertyNameOrValue=function(i){return this.regexp_eatUnicodePropertyValue(i)};pt.regexp_eatCharacterClass=function(i){if(i.eat(91)){var Ne=i.eat(94),Ie=this.regexp_classContents(i);if(!i.eat(93))i.raise("Unterminated character class");if(Ne&&Ie===hn)i.raise("Negated character class may contain strings");return!0}return!1};pt.regexp_classContents=function(i){if(i.current()===93)return Nn;if(i.switchV)return this.regexp_classSetExpression(i);return this.regexp_nonEmptyClassRanges(i),Nn};pt.regexp_nonEmptyClassRanges=function(i){while(this.regexp_eatClassAtom(i)){var Ne=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassAtom(i)){var Ie=i.lastIntValue;if(i.switchU&&(Ne===-1||Ie===-1))i.raise("Invalid character class");if(Ne!==-1&&Ie!==-1&&Ne>Ie)i.raise("Range out of order in character class")}}};pt.regexp_eatClassAtom=function(i){var Ne=i.pos;if(i.eat(92)){if(this.regexp_eatClassEscape(i))return!0;if(i.switchU){var Ie=i.current();if(Ie===99||rc(Ie))i.raise("Invalid class escape");i.raise("Invalid escape")}i.pos=Ne}var Re=i.current();if(Re!==93)return i.lastIntValue=Re,i.advance(),!0;return!1};pt.regexp_eatClassEscape=function(i){var Ne=i.pos;if(i.eat(98))return i.lastIntValue=8,!0;if(i.switchU&&i.eat(45))return i.lastIntValue=45,!0;if(!i.switchU&&i.eat(99)){if(this.regexp_eatClassControlLetter(i))return!0;i.pos=Ne}return this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)};pt.regexp_classSetExpression=function(i){var Ne=Nn,Ie;if(this.regexp_eatClassSetRange(i));else if(Ie=this.regexp_eatClassSetOperand(i)){if(Ie===hn)Ne=hn;var Re=i.pos;while(i.eatChars([38,38])){if(i.current()!==38&&(Ie=this.regexp_eatClassSetOperand(i))){if(Ie!==hn)Ne=Nn;continue}i.raise("Invalid character in character class")}if(Re!==i.pos)return Ne;while(i.eatChars([45,45])){if(this.regexp_eatClassSetOperand(i))continue;i.raise("Invalid character in character class")}if(Re!==i.pos)return Ne}else i.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(i))continue;if(Ie=this.regexp_eatClassSetOperand(i),!Ie)return Ne;if(Ie===hn)Ne=hn}};pt.regexp_eatClassSetRange=function(i){var Ne=i.pos;if(this.regexp_eatClassSetCharacter(i)){var Ie=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassSetCharacter(i)){var Re=i.lastIntValue;if(Ie!==-1&&Re!==-1&&Ie>Re)i.raise("Range out of order in character class");return!0}i.pos=Ne}return!1};pt.regexp_eatClassSetOperand=function(i){if(this.regexp_eatClassSetCharacter(i))return Nn;return this.regexp_eatClassStringDisjunction(i)||this.regexp_eatNestedClass(i)};pt.regexp_eatNestedClass=function(i){var Ne=i.pos;if(i.eat(91)){var Ie=i.eat(94),Re=this.regexp_classContents(i);if(i.eat(93)){if(Ie&&Re===hn)i.raise("Negated character class may contain strings");return Re}i.pos=Ne}if(i.eat(92)){var Le=this.regexp_eatCharacterClassEscape(i);if(Le)return Le;i.pos=Ne}return null};pt.regexp_eatClassStringDisjunction=function(i){var Ne=i.pos;if(i.eatChars([92,113])){if(i.eat(123)){var Ie=this.regexp_classStringDisjunctionContents(i);if(i.eat(125))return Ie}else i.raise("Invalid escape");i.pos=Ne}return null};pt.regexp_classStringDisjunctionContents=function(i){var Ne=this.regexp_classString(i);while(i.eat(124))if(this.regexp_classString(i)===hn)Ne=hn;return Ne};pt.regexp_classString=function(i){var Ne=0;while(this.regexp_eatClassSetCharacter(i))Ne++;return Ne===1?Nn:hn};pt.regexp_eatClassSetCharacter=function(i){var Ne=i.pos;if(i.eat(92)){if(this.regexp_eatCharacterEscape(i)||this.regexp_eatClassSetReservedPunctuator(i))return!0;if(i.eat(98))return i.lastIntValue=8,!0;return i.pos=Ne,!1}var Ie=i.current();if(Ie<0||Ie===i.lookahead()&&Md(Ie))return!1;if($d(Ie))return!1;return i.advance(),i.lastIntValue=Ie,!0};function Md(i){return i===33||i>=35&&i<=38||i>=42&&i<=44||i===46||i>=58&&i<=64||i===94||i===96||i===126}function $d(i){return i===40||i===41||i===45||i===47||i>=91&&i<=93||i>=123&&i<=125}pt.regexp_eatClassSetReservedPunctuator=function(i){var Ne=i.current();if(Bd(Ne))return i.lastIntValue=Ne,i.advance(),!0;return!1};function Bd(i){return i===33||i===35||i===37||i===38||i===44||i===45||i>=58&&i<=62||i===64||i===96||i===126}pt.regexp_eatClassControlLetter=function(i){var Ne=i.current();if(ls(Ne)||Ne===95)return i.lastIntValue=Ne%32,i.advance(),!0;return!1};pt.regexp_eatHexEscapeSequence=function(i){var Ne=i.pos;if(i.eat(120)){if(this.regexp_eatFixedHexDigits(i,2))return!0;if(i.switchU)i.raise("Invalid escape");i.pos=Ne}return!1};pt.regexp_eatDecimalDigits=function(i){var Ne=i.pos,Ie=0;i.lastIntValue=0;while(ls(Ie=i.current()))i.lastIntValue=10*i.lastIntValue+(Ie-48),i.advance();return i.pos!==Ne};function ls(i){return i>=48&&i<=57}pt.regexp_eatHexDigits=function(i){var Ne=i.pos,Ie=0;i.lastIntValue=0;while(tc(Ie=i.current()))i.lastIntValue=16*i.lastIntValue+nc(Ie),i.advance();return i.pos!==Ne};function tc(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}function nc(i){if(i>=65&&i<=70)return 10+(i-65);if(i>=97&&i<=102)return 10+(i-97);return i-48}pt.regexp_eatLegacyOctalEscapeSequence=function(i){if(this.regexp_eatOctalDigit(i)){var Ne=i.lastIntValue;if(this.regexp_eatOctalDigit(i)){var Ie=i.lastIntValue;if(Ne<=3&&this.regexp_eatOctalDigit(i))i.lastIntValue=Ne*64+Ie*8+i.lastIntValue;else i.lastIntValue=Ne*8+Ie}else i.lastIntValue=Ne;return!0}return!1};pt.regexp_eatOctalDigit=function(i){var Ne=i.current();if(rc(Ne))return i.lastIntValue=Ne-48,i.advance(),!0;return i.lastIntValue=0,!1};function rc(i){return i>=48&&i<=55}pt.regexp_eatFixedHexDigits=function(i,Ne){var Ie=i.pos;i.lastIntValue=0;for(var Re=0;Re<Ne;++Re){var Le=i.current();if(!tc(Le))return i.pos=Ie,!1;i.lastIntValue=16*i.lastIntValue+nc(Le),i.advance()}return!0};var ps=function(Ne){if(this.type=Ne.type,this.value=Ne.value,this.start=Ne.start,this.end=Ne.end,Ne.options.locations)this.loc=new Ar(Ne,Ne.startLoc,Ne.endLoc);if(Ne.options.ranges)this.range=[Ne.start,Ne.end]},vt=Lt.prototype;vt.next=function(i){if(!i&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new ps(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};vt.getToken=function(){return this.next(),new ps(this)};if(typeof Symbol<"u")vt[Symbol.iterator]=function(){var i=this;return{next:function(){var Ne=i.getToken();return{done:Ne.type===Ue.eof,value:Ne}}}};vt.nextToken=function(){var i=this.curContext();if(!i||!i.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(Ue.eof);if(i.override)return i.override(this);else this.readToken(this.fullCharCodeAtPos())};vt.readToken=function(i){if(Qt(i,this.options.ecmaVersion>=6)||i===92)return this.readWord();return this.getTokenFromCode(i)};vt.fullCharCodeAt=function(i){var Ne=this.input.charCodeAt(i);if(Ne<=55295||Ne>=56320)return Ne;var Ie=this.input.charCodeAt(i+1);return Ie<=56319||Ie>=57344?Ne:(Ne<<10)+Ie-56613888};vt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};vt.skipBlockComment=function(){var i=this.options.onComment&&this.curPosition(),Ne=this.pos,Ie=this.input.indexOf("*/",this.pos+=2);if(Ie===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=Ie+2,this.options.locations)for(var Re=void 0,Le=Ne;(Re=Pa(this.input,Le,this.pos))>-1;)++this.curLine,Le=this.lineStart=Re;if(this.options.onComment)this.options.onComment(!0,this.input.slice(Ne+2,Ie),Ne,this.pos,i,this.curPosition())};vt.skipLineComment=function(i){var Ne=this.pos,Ie=this.options.onComment&&this.curPosition(),Re=this.input.charCodeAt(this.pos+=i);while(this.pos<this.input.length&&!Hn(Re))Re=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(Ne+i,this.pos),Ne,this.pos,Ie,this.curPosition())};vt.skipSpace=function(){e:while(this.pos<this.input.length){var i=this.input.charCodeAt(this.pos);switch(i){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(i>8&&i<14||i>=5760&&ki.test(String.fromCharCode(i)))++this.pos;else break e}}};vt.finishToken=function(i,Ne){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var Ie=this.type;this.type=i,this.value=Ne,this.updateContext(Ie)};vt.readToken_dot=function(){var i=this.input.charCodeAt(this.pos+1);if(i>=48&&i<=57)return this.readNumber(!0);var Ne=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&i===46&&Ne===46)return this.pos+=3,this.finishToken(Ue.ellipsis);else return++this.pos,this.finishToken(Ue.dot)};vt.readToken_slash=function(){var i=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(i===61)return this.finishOp(Ue.assign,2);return this.finishOp(Ue.slash,1)};vt.readToken_mult_modulo_exp=function(i){var Ne=this.input.charCodeAt(this.pos+1),Ie=1,Re=i===42?Ue.star:Ue.modulo;if(this.options.ecmaVersion>=7&&i===42&&Ne===42)++Ie,Re=Ue.starstar,Ne=this.input.charCodeAt(this.pos+2);if(Ne===61)return this.finishOp(Ue.assign,Ie+1);return this.finishOp(Re,Ie)};vt.readToken_pipe_amp=function(i){var Ne=this.input.charCodeAt(this.pos+1);if(Ne===i){if(this.options.ecmaVersion>=12){var Ie=this.input.charCodeAt(this.pos+2);if(Ie===61)return this.finishOp(Ue.assign,3)}return this.finishOp(i===124?Ue.logicalOR:Ue.logicalAND,2)}if(Ne===61)return this.finishOp(Ue.assign,2);return this.finishOp(i===124?Ue.bitwiseOR:Ue.bitwiseAND,1)};vt.readToken_caret=function(){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(Ue.assign,2);return this.finishOp(Ue.bitwiseXOR,1)};vt.readToken_plus_min=function(i){var Ne=this.input.charCodeAt(this.pos+1);if(Ne===i){if(Ne===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Zt.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(Ue.incDec,2)}if(Ne===61)return this.finishOp(Ue.assign,2);return this.finishOp(Ue.plusMin,1)};vt.readToken_lt_gt=function(i){var Ne=this.input.charCodeAt(this.pos+1),Ie=1;if(Ne===i){if(Ie=i===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Ie)===61)return this.finishOp(Ue.assign,Ie+1);return this.finishOp(Ue.bitShift,Ie)}if(Ne===33&&i===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(Ne===61)Ie=2;return this.finishOp(Ue.relational,Ie)};vt.readToken_eq_excl=function(i){var Ne=this.input.charCodeAt(this.pos+1);if(Ne===61)return this.finishOp(Ue.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(i===61&&Ne===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(Ue.arrow);return this.finishOp(i===61?Ue.eq:Ue.prefix,1)};vt.readToken_question=function(){var i=this.options.ecmaVersion;if(i>=11){var Ne=this.input.charCodeAt(this.pos+1);if(Ne===46){var Ie=this.input.charCodeAt(this.pos+2);if(Ie<48||Ie>57)return this.finishOp(Ue.questionDot,2)}if(Ne===63){if(i>=12){var Re=this.input.charCodeAt(this.pos+2);if(Re===61)return this.finishOp(Ue.assign,3)}return this.finishOp(Ue.coalesce,2)}}return this.finishOp(Ue.question,1)};vt.readToken_numberSign=function(){var i=this.options.ecmaVersion,Ne=35;if(i>=13){if(++this.pos,Ne=this.fullCharCodeAtPos(),Qt(Ne,!0)||Ne===92)return this.finishToken(Ue.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+Pn(Ne)+"'")};vt.getTokenFromCode=function(i){switch(i){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Ue.parenL);case 41:return++this.pos,this.finishToken(Ue.parenR);case 59:return++this.pos,this.finishToken(Ue.semi);case 44:return++this.pos,this.finishToken(Ue.comma);case 91:return++this.pos,this.finishToken(Ue.bracketL);case 93:return++this.pos,this.finishToken(Ue.bracketR);case 123:return++this.pos,this.finishToken(Ue.braceL);case 125:return++this.pos,this.finishToken(Ue.braceR);case 58:return++this.pos,this.finishToken(Ue.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Ue.backQuote);case 48:var Ne=this.input.charCodeAt(this.pos+1);if(Ne===120||Ne===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(Ne===111||Ne===79)return this.readRadixNumber(8);if(Ne===98||Ne===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(i);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(i);case 124:case 38:return this.readToken_pipe_amp(i);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(i);case 60:case 62:return this.readToken_lt_gt(i);case 61:case 33:return this.readToken_eq_excl(i);case 63:return this.readToken_question();case 126:return this.finishOp(Ue.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Pn(i)+"'")};vt.finishOp=function(i,Ne){var Ie=this.input.slice(this.pos,this.pos+Ne);return this.pos+=Ne,this.finishToken(i,Ie)};vt.readRegexp=function(){var i,Ne,Ie=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(Ie,"Unterminated regular expression");var Re=this.input.charAt(this.pos);if(Zt.test(Re))this.raise(Ie,"Unterminated regular expression");if(!i){if(Re==="[")Ne=!0;else if(Re==="]"&&Ne)Ne=!1;else if(Re==="/"&&!Ne)break;i=Re==="\\"}else i=!1;++this.pos}var Le=this.input.slice(Ie,this.pos);++this.pos;var Me=this.pos,Oe=this.readWord1();if(this.containsEsc)this.unexpected(Me);var Be=this.regexpState||(this.regexpState=new En(this));Be.reset(Ie,Le,Oe),this.validateRegExpFlags(Be),this.validateRegExpPattern(Be);var Fe=null;try{Fe=new RegExp(Le,Oe)}catch(We){}return this.finishToken(Ue.regexp,{pattern:Le,flags:Oe,value:Fe})};vt.readInt=function(i,Ne,Ie){var Re=this.options.ecmaVersion>=12&&Ne===void 0,Le=Ie&&this.input.charCodeAt(this.pos)===48,Me=this.pos,Oe=0,Be=0;for(var Fe=0,We=Ne==null?1/0:Ne;Fe<We;++Fe,++this.pos){var Ve=this.input.charCodeAt(this.pos),Ge=void 0;if(Re&&Ve===95){if(Le)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(Be===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Fe===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");Be=Ve;continue}if(Ve>=97)Ge=Ve-97+10;else if(Ve>=65)Ge=Ve-65+10;else if(Ve>=48&&Ve<=57)Ge=Ve-48;else Ge=1/0;if(Ge>=i)break;Be=Ve,Oe=Oe*i+Ge}if(Re&&Be===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===Me||Ne!=null&&this.pos-Me!==Ne)return null;return Oe};function Fd(i,Ne){if(Ne)return parseInt(i,8);return parseFloat(i.replace(/_/g,""))}function sc(i){if(typeof BigInt!=="function")return null;return BigInt(i.replace(/_/g,""))}vt.readRadixNumber=function(i){var Ne=this.pos;this.pos+=2;var Ie=this.readInt(i);if(Ie==null)this.raise(this.start+2,"Expected number in radix "+i);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)Ie=sc(this.input.slice(Ne,this.pos)),++this.pos;else if(Qt(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Ue.num,Ie)};vt.readNumber=function(i){var Ne=this.pos;if(!i&&this.readInt(10,void 0,!0)===null)this.raise(Ne,"Invalid number");var Ie=this.pos-Ne>=2&&this.input.charCodeAt(Ne)===48;if(Ie&&this.strict)this.raise(Ne,"Invalid number");var Re=this.input.charCodeAt(this.pos);if(!Ie&&!i&&this.options.ecmaVersion>=11&&Re===110){var Le=sc(this.input.slice(Ne,this.pos));if(++this.pos,Qt(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Ue.num,Le)}if(Ie&&/[89]/.test(this.input.slice(Ne,this.pos)))Ie=!1;if(Re===46&&!Ie)++this.pos,this.readInt(10),Re=this.input.charCodeAt(this.pos);if((Re===69||Re===101)&&!Ie){if(Re=this.input.charCodeAt(++this.pos),Re===43||Re===45)++this.pos;if(this.readInt(10)===null)this.raise(Ne,"Invalid number")}if(Qt(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var Me=Fd(this.input.slice(Ne,this.pos),Ie);return this.finishToken(Ue.num,Me)};vt.readCodePoint=function(){var i=this.input.charCodeAt(this.pos),Ne;if(i===123){if(this.options.ecmaVersion<6)this.unexpected();var Ie=++this.pos;if(Ne=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,Ne>1114111)this.invalidStringToken(Ie,"Code point out of bounds")}else Ne=this.readHexChar(4);return Ne};vt.readString=function(i){var Ne="",Ie=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var Re=this.input.charCodeAt(this.pos);if(Re===i)break;if(Re===92)Ne+=this.input.slice(Ie,this.pos),Ne+=this.readEscapedChar(!1),Ie=this.pos;else if(Re===8232||Re===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(Hn(Re))this.raise(this.start,"Unterminated string constant");++this.pos}}return Ne+=this.input.slice(Ie,this.pos++),this.finishToken(Ue.string,Ne)};var ic={};vt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(i){if(i===ic)this.readInvalidTemplateToken();else throw i}this.inTemplateElement=!1};vt.invalidStringToken=function(i,Ne){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ic;else this.raise(i,Ne)};vt.readTmplToken=function(){var i="",Ne=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var Ie=this.input.charCodeAt(this.pos);if(Ie===96||Ie===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Ue.template||this.type===Ue.invalidTemplate))if(Ie===36)return this.pos+=2,this.finishToken(Ue.dollarBraceL);else return++this.pos,this.finishToken(Ue.backQuote);return i+=this.input.slice(Ne,this.pos),this.finishToken(Ue.template,i)}if(Ie===92)i+=this.input.slice(Ne,this.pos),i+=this.readEscapedChar(!0),Ne=this.pos;else if(Hn(Ie)){switch(i+=this.input.slice(Ne,this.pos),++this.pos,Ie){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:i+=`
|
|
6
|
-
`;break;default:i+=String.fromCharCode(Ie);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;Ne=this.pos}else++this.pos}};vt.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(Ue.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")};vt.readEscapedChar=function(i){var Ne=this.input.charCodeAt(++this.pos);switch(++this.pos,Ne){case 110:return`
|
|
9
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Pn(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(i){var Ie=this.pos-1;this.invalidStringToken(Ie,"Invalid escape sequence in template string")}default:if(Ne>=48&&Ne<=55){var Re=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Le=parseInt(Re,8);if(Le>255)Re=Re.slice(0,-1),Le=parseInt(Re,8);if(this.pos+=Re.length-1,Ne=this.input.charCodeAt(this.pos),(Re!=="0"||Ne===56||Ne===57)&&(this.strict||i))this.invalidStringToken(this.pos-1-Re.length,i?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(Le)}if(Hn(Ne)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(Ne)}};vt.readHexChar=function(i){var Ne=this.pos,Ie=this.readInt(16,i);if(Ie===null)this.invalidStringToken(Ne,"Bad character escape sequence");return Ie};vt.readWord1=function(){this.containsEsc=!1;var i="",Ne=!0,Ie=this.pos,Re=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var Le=this.fullCharCodeAtPos();if(sn(Le,Re))this.pos+=Le<=65535?1:2;else if(Le===92){this.containsEsc=!0,i+=this.input.slice(Ie,this.pos);var Me=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var Oe=this.readCodePoint();if(!(Ne?Qt:sn)(Oe,Re))this.invalidStringToken(Me,"Invalid Unicode escape");i+=Pn(Oe),Ie=this.pos}else break;Ne=!1}return i+this.input.slice(Ie,this.pos)};vt.readWord=function(){var i=this.readWord1(),Ne=Ue.name;if(this.keywords.test(i))Ne=is[i];return this.finishToken(Ne,i)};var oc="8.18.0";Lt.acorn={Parser:Lt,version:oc,defaultOptions:es,Position:ir,SourceLocation:Ar,getLineInfo:wi,Node:Nr,TokenType:kt,tokTypes:Ue,keywordTypes:is,TokContext:fn,tokContexts:Rt,isIdentifierChar:sn,isIdentifierStart:Qt,Token:ps,isNewLine:Hn,lineBreak:Zt,lineBreakG:Aa,nonASCIIwhitespace:ki};function Ii(i,Ne){return Lt.parse(i,Ne)}function jd(i,Ne,Ie){return Lt.parseExpressionAt(i,Ne,Ie)}function Vd(i,Ne){return Lt.tokenizer(i,Ne)}var ln=!0,Wd=new WeakMap;function qd(i){let Ne=i.Parser.acorn||i,Ie=Wd.get(Ne);if(!Ie){let Be=function(lt){return lt===ze.name||lt===ze.string||lt===ze.num||Qe.includes(lt)||ot.includes(lt)},Fe=function(lt){return lt===ze.name||Qe.includes(lt)||ot.includes(lt)},We=function(lt){return lt===ze.name||ot.includes(lt)},Ve=function(lt){return lt===tt.abstract||lt===tt.declare||lt===tt.enum||lt===tt.module||lt===tt.namespace||lt===tt.interface||lt===tt.type},Ge=function(lt){return lt===tt.keyof||lt===tt.readonly||lt===tt.unique},Ke=function(lt){return lt===ze.invalidTemplate},{tokTypes:ze,keywordTypes:Ye}=Ne,Qe=Object.values(Ye),tt=Oe(),ot=Object.values(tt),ct=Me(),et=Le(),it=new RegExp(`^(?:${Object.keys(tt).join("|")})$`);ct.jsxTagStart.updateContext=function(){this.context.push(et.tc_expr),this.context.push(et.tc_oTag),this.exprAllowed=!1},ct.jsxTagEnd.updateContext=function(lt){let At=this.context.pop();if(At===et.tc_oTag&<===ze.slash||At===et.tc_cTag)this.context.pop(),this.exprAllowed=this.curContext()===et.tc_expr;else this.exprAllowed=!0},Ie={tokTypes:{...tt,...ct},tokContexts:{...et},keywordsRegExp:it,tokenIsLiteralPropertyName:Be,tokenIsKeywordOrIdentifier:Fe,tokenIsIdentifier:We,tokenIsTSDeclarationStart:Ve,tokenIsTSTypeOperator:Ge,tokenIsTemplate:Ke}}return Ie;function Re(Be,Fe={}){return new Ne.TokenType("name",Fe)}function Le(){return{tc_oTag:new Ne.TokContext("<tag",!1,!1),tc_cTag:new Ne.TokContext("</tag",!1,!1),tc_expr:new Ne.TokContext("<tag>...</tag>",!0,!0)}}function Me(){return{at:new Ne.TokenType("@"),jsxName:new Ne.TokenType("jsxName"),jsxText:new Ne.TokenType("jsxText",{beforeExpr:!0}),jsxTagStart:new Ne.TokenType("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new Ne.TokenType("jsxTagEnd")}}function Oe(){return{assert:Re("assert",{startsExpr:ln}),asserts:Re("asserts",{startsExpr:ln}),global:Re("global",{startsExpr:ln}),keyof:Re("keyof",{startsExpr:ln}),readonly:Re("readonly",{startsExpr:ln}),unique:Re("unique",{startsExpr:ln}),abstract:Re("abstract",{startsExpr:ln}),declare:Re("declare",{startsExpr:ln}),enum:Re("enum",{startsExpr:ln}),module:Re("module",{startsExpr:ln}),namespace:Re("namespace",{startsExpr:ln}),interface:Re("interface",{startsExpr:ln}),type:Re("type",{startsExpr:ln})}}}var Gd=1048576,Dr=2097152,lr=1,fs=2,Ud=4,$i=8,Hd=16,hc=64,mc=128,Kd=256,zd=512,yc=1024,Sb=lr|fs|$i|mc,Tb=lr|0|$i|0,kb=lr|0|Ud|0,wb=lr|0|Hd|0,Ab=0|fs|0|mc,Pb=0|fs|0|0,Xd=lr|fs|$i|Kd,Nb=0|yc,_b=0|hc,Db=lr|0|0|hc,Ib=Xd|zd,Rb=0|yc,gc=4,xc=2,bc=1,Lb=xc|bc,Ob=xc|gc,Mb=bc|gc,Jd=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y,ac=new RegExp("(?=("+Jd.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),Ir=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function Yd(i,Ne){let Ie="true";if(Ne.type==="MethodDefinition"&&(Ne.kind==="get"||Ne.kind==="set"))Ie=(Ne.static?"s":"i")+Ne.kind;if(i==="iget"&&Ie==="iset"||i==="iset"&&Ie==="iget"||i==="sget"&&Ie==="sset"||i==="sset"&&Ie==="sget")return[!1,"true"];if(!i)return[!1,Ie];return[!0,i]}function cc(i,Ne){let{computed:Ie,key:Re}=i;return!Ie&&(Re.type==="Identifier"&&Re.name===Ne||Re.type==="Literal"&&Re.value===Ne)}var ut={AbstractMethodHasImplementation:({methodName:i})=>`Method '${i}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:i})=>`Property '${i}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:({name:i})=>`Cannot find name '${i}'.`,ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:i})=>`'declare' is not allowed in ${i}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:()=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:i})=>`Duplicate modifier: '${i}'.`,EmptyHeritageClauseType:({token:i})=>`'${i}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",IncompatibleModifiers:({modifiers:i})=>`'${i[0]}' modifier cannot be used with '${i[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:i})=>`Index signatures cannot have an accessibility modifier ('${i}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:i})=>`'${i}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:i})=>`'${i}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:i})=>`'${i}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:i})=>`'${i[0]}' modifier must precede '${i[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:i})=>`Private elements cannot have an accessibility modifier ('${i}').`,PrivateMethodsHasAccessibility:({modifier:i})=>`Private methods cannot have an accessibility modifier ('${i}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:i})=>`Single type parameter ${i} should have a trailing comma. Example usage: <${i},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:i})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${i}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},ds={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 Qd(i,Ne,Ie){let{tokTypes:Re}=Ie,{tokTypes:Le}=Ne;return class extends i{takeDecorators(Oe){let Be=this.decoratorStack[this.decoratorStack.length-1];if(Be.length)Oe.decorators=Be,this.resetStartLocationFromNode(Oe,Be[0]),this.decoratorStack[this.decoratorStack.length-1]=[]}parseDecorators(Oe){let Be=this.decoratorStack[this.decoratorStack.length-1];while(this.match(Le.at)){let Fe=this.parseDecorator();Be.push(Fe)}if(this.match(Re._export)){if(!Oe)this.unexpected()}else if(!this.canHaveLeadingDecorator())this.raise(this.start,ds.UnexpectedLeadingDecorator)}parseDecorator(){let Oe=this.startNode();this.next(),this.decoratorStack.push([]);let Be=this.start,Fe=this.startLoc,We;if(this.match(Re.parenL)){let Ve=this.start,Ge=this.startLoc;if(this.next(),We=this.parseExpression(),this.expect(Re.parenR),this.options.preserveParens){let Ke=this.startNodeAt(Ve,Ge);Ke.expression=We,We=this.finishNode(Ke,"ParenthesizedExpression")}}else{We=this.parseIdent(!1);while(this.eat(Re.dot)){let Ve=this.startNodeAt(Be,Fe);Ve.object=We,Ve.property=this.parseIdent(!0),Ve.computed=!1,We=this.finishNode(Ve,"MemberExpression")}}return Oe.expression=this.parseMaybeDecoratorArguments(We),this.decoratorStack.pop(),this.finishNode(Oe,"Decorator")}parseMaybeDecoratorArguments(Oe){if(this.eat(Re.parenL)){let Be=this.startNodeAtNode(Oe);return Be.callee=Oe,Be.arguments=this.parseExprList(Re.parenR,!1),this.finishNode(Be,"CallExpression")}return Oe}}}var lc={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:"♦"},Zd=/^[\da-fA-F]+$/,ef=/^\d+$/;function Rr(i){if(!i)return i;if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return Rr(i.object)+"."+Rr(i.property)}function tf(i,Ne,Ie,Re){let Le=i.tokTypes,Me=Ne.tokTypes,{isNewLine:Oe,isIdentifierChar:Be}=i,Fe=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},Re||{});return class extends Ie{jsx_readToken(){let Ve="",Ge=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated JSX contents");let Ke=this.input.charCodeAt(this.pos);switch(Ke){case 60:case 123:if(this.pos===this.start){if(Ke===60&&this.exprAllowed)return++this.pos,this.finishToken(Me.jsxTagStart);return this.getTokenFromCode(Ke)}return Ve+=this.input.slice(Ge,this.pos),this.finishToken(Me.jsxText,Ve);case 38:Ve+=this.input.slice(Ge,this.pos),Ve+=this.jsx_readEntity(),Ge=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(Ke===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:if(Oe(Ke))Ve+=this.input.slice(Ge,this.pos),Ve+=this.jsx_readNewLine(!0),Ge=this.pos;else++this.pos}}}jsx_readNewLine(Ve){let Ge=this.input.charCodeAt(this.pos),Ke;if(++this.pos,Ge===13&&this.input.charCodeAt(this.pos)===10)++this.pos,Ke=Ve?`
|
|
10
|
-
`:`\r
|
|
11
|
-
`;else Ke=String.fromCharCode(Ge);if(this.options.locations)++this.curLine,this.lineStart=this.pos;return Ke}jsx_readString(Ve){let Ge="",Ke=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");let ze=this.input.charCodeAt(this.pos);if(ze===Ve)break;if(ze===38)Ge+=this.input.slice(Ke,this.pos),Ge+=this.jsx_readEntity(),Ke=this.pos;else if(Oe(ze))Ge+=this.input.slice(Ke,this.pos),Ge+=this.jsx_readNewLine(!1),Ke=this.pos;else++this.pos}return Ge+=this.input.slice(Ke,this.pos++),this.finishToken(Le.string,Ge)}jsx_readEntity(){let Ve="",Ge=0,Ke,ze=this.input[this.pos];if(ze!=="&")this.raise(this.pos,"Entity must start with an ampersand");let Ye=++this.pos;while(this.pos<this.input.length&&Ge++<10){if(ze=this.input[this.pos++],ze===";"){if(Ve[0]==="#"){let Qe;if(Ve[1]==="x"||Ve[1]==="X"){if(Ve=Ve.substr(2),Zd.test(Ve))Qe=parseInt(Ve,16)}else if(Ve=Ve.substr(1),ef.test(Ve))Qe=parseInt(Ve,10);if(Qe!==void 0&&Qe<=1114111)Ke=String.fromCodePoint(Qe)}else if(Object.prototype.hasOwnProperty.call(lc,Ve))Ke=lc[Ve];break}Ve+=ze}if(Ke===void 0)return this.pos=Ye,"&";return Ke}jsx_readWord(){let Ve,Ge=this.pos;do Ve=this.input.charCodeAt(++this.pos);while(Be(Ve)||Ve===45);return this.finishToken(Me.jsxName,this.input.slice(Ge,this.pos))}jsx_parseIdentifier(){let Ve=this.startNode();if(this.type===Me.jsxName)Ve.name=this.value;else if(this.type.keyword)Ve.name=this.type.keyword;else this.unexpected();return this.next(),this.finishNode(Ve,"JSXIdentifier")}jsx_parseNamespacedName(){let Ve=this.start,Ge=this.startLoc,Ke=this.jsx_parseIdentifier();if(!Fe.allowNamespaces||!this.eat(Le.colon))return Ke;var ze=this.startNodeAt(Ve,Ge);return ze.namespace=Ke,ze.name=this.jsx_parseIdentifier(),this.finishNode(ze,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===Me.jsxTagEnd)return"";let Ve=this.start,Ge=this.startLoc,Ke=this.jsx_parseNamespacedName();if(this.type===Le.dot&&Ke.type==="JSXNamespacedName"&&!Fe.allowNamespacedObjects)this.unexpected();while(this.eat(Le.dot)){let ze=this.startNodeAt(Ve,Ge);ze.object=Ke,ze.property=this.jsx_parseIdentifier(),Ke=this.finishNode(ze,"JSXMemberExpression")}return Ke}jsx_parseAttributeValue(){switch(this.type){case Le.braceL:let Ve=this.jsx_parseExpressionContainer();if(Ve.expression.type==="JSXEmptyExpression")this.raise(Ve.start,"JSX attributes must only be assigned a non-empty expression");return Ve;case Me.jsxTagStart:case Le.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let Ve=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(Ve,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let Ve=this.startNode();if(this.next(),this.eat(Le.ellipsis))return Ve.expression=this.parseExpression(),this.expect(Le.braceR),this.finishNode(Ve,"JSXSpreadChild");return Ve.expression=this.type===Le.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(Le.braceR),this.finishNode(Ve,"JSXExpressionContainer")}jsx_parseAttribute(){let Ve=this.startNode();if(this.eat(Le.braceL))return this.expect(Le.ellipsis),Ve.argument=this.parseMaybeAssign(),this.expect(Le.braceR),this.finishNode(Ve,"JSXSpreadAttribute");return Ve.name=this.jsx_parseNamespacedName(),Ve.value=this.eat(Le.eq)?this.jsx_parseAttributeValue():null,this.finishNode(Ve,"JSXAttribute")}jsx_parseOpeningElementAt(Ve,Ge){let Ke=this.startNodeAt(Ve,Ge);Ke.attributes=[];let ze=this.jsx_parseElementName();if(ze)Ke.name=ze;while(this.type!==Le.slash&&this.type!==Me.jsxTagEnd)Ke.attributes.push(this.jsx_parseAttribute());return Ke.selfClosing=this.eat(Le.slash),this.expect(Me.jsxTagEnd),this.finishNode(Ke,ze?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(Ve,Ge){let Ke=this.startNodeAt(Ve,Ge),ze=this.jsx_parseElementName();if(ze)Ke.name=ze;return this.expect(Me.jsxTagEnd),this.finishNode(Ke,ze?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(Ve,Ge){let Ke=this.startNodeAt(Ve,Ge),ze=[],Ye=this.jsx_parseOpeningElementAt(Ve,Ge),Qe=null;if(!Ye.selfClosing){e:for(;;)switch(this.type){case Me.jsxTagStart:if(Ve=this.start,Ge=this.startLoc,this.next(),this.eat(Le.slash)){Qe=this.jsx_parseClosingElementAt(Ve,Ge);break e}ze.push(this.jsx_parseElementAt(Ve,Ge));break;case Me.jsxText:ze.push(this.parseExprAtom());break;case Le.braceL:ze.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}if(Rr(Qe.name)!==Rr(Ye.name))this.raise(Qe.start,"Expected corresponding JSX closing tag for <"+Rr(Ye.name)+">")}let tt=Ye.name?"Element":"Fragment";if(Ke["opening"+tt]=Ye,Ke["closing"+tt]=Qe,Ke.children=ze,this.type===Le.relational&&this.value==="<")this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag");return this.finishNode(Ke,"JSX"+tt)}jsx_parseText(){let Ve=this.parseLiteral(this.value);return Ve.type="JSXText",Ve}jsx_parseElement(){let Ve=this.start,Ge=this.startLoc;return this.next(),this.jsx_parseElementAt(Ve,Ge)}}}function nf(i,Ne,Ie){let{tokTypes:Re}=Ne,{tokTypes:Le}=Ie;return class extends i{parseMaybeImportAttributes(Oe){if(this.type===Le._with||this.type===Re.assert){this.next();let Be=this.parseImportAttributes();if(Be)Oe.attributes=Be}}parseImportAttributes(){this.expect(Le.braceL);let Oe=this.parseWithEntries();return this.expect(Le.braceR),Oe}parseWithEntries(){let Oe=[],Be=new Set;do{if(this.type===Le.braceR)break;let Fe=this.startNode(),We;if(this.type===Le.string)We=this.parseLiteral(this.value);else We=this.parseIdent(!0);if(this.next(),Fe.key=We,Be.has(Fe.key.name))this.raise(this.pos,"Duplicated key in attributes");if(Be.add(Fe.key.name),this.type!==Le.string)this.raise(this.pos,"Only string is supported as an attribute value");Fe.value=this.parseLiteral(this.value),Oe.push(this.finishNode(Fe,"ImportAttribute"))}while(this.eat(Le.comma));return Oe}}}var Li=["onToken","onComment","onInsertedSemicolon","onTrailingComma"];function Ec(){return{_tag:"BufferedParserEvents",segments:[]}}var rf=Ec();function pc(i){return i.segments.length>0}var sf=class{constructor(i,Ne){this.options=i,this.state=Ne,this.callbacks={},this.callbackWrappers={},this.frames=[],this.undoLog=[],this.hasCallbacks=this.captureCallbacks()}get active(){return this.frames.length>0}begin(){let i={_tag:"ParseEffectFrame",depth:this.frames.length,undoMark:this.undoLog.length,checkpoint:this.state?.capture()};if(this.frames.push(i),i.depth===0&&this.hasCallbacks)this.activateCallbacks();return i}commit(i){this.close(i);let Ne=this.currentFrame();if(Ne){if(i.output)this.appendOutput(this.outputFor(Ne),i.output);return}if(this.undoLog.length=i.undoMark,i.output)this.flush(i.output)}rollback(i){this.close(i),this.unwind(i.undoMark),this.restore(i)}rollbackWithEvents(i){return this.close(i),this.unwind(i.undoMark),this.restore(i),i.output??rf}replay(i){if(!pc(i))return;let Ne=this.currentFrame();if(Ne){this.appendOutput(this.outputFor(Ne),i);return}this.flush(i)}set(i,Ne,Ie){this.willSet(i,Ne),i[Ne]=Ie}remove(i,Ne){this.willSet(i,Ne),delete i[Ne]}append(i,Ne){this.willAppend(i),i.push(Ne)}pop(i){return this.willMutateTail(i,1),i.pop()}truncate(i,Ne){if(Ne<i.length)this.willMutateTail(i,i.length-Ne);else this.willAppend(i);i.length=Ne}modify(i,Ne,Ie){let[Re,Le]=Ie(i[Ne]);return this.set(i,Ne,Le),Re}willAppend(i){if(!this.active)return;this.undoLog.push({_tag:"ArrayLength",target:i,length:i.length})}willMutateTail(i,Ne){if(!this.active)return;let Ie=Math.max(0,i.length-Ne);this.undoLog.push({_tag:"ArrayTail",target:i,start:Ie,values:i.slice(Ie)})}willSet(i,Ne){if(!this.active)return;let Ie=i;this.undoLog.push({_tag:"Property",target:Ie,key:Ne,had:Object.prototype.hasOwnProperty.call(Ie,Ne),value:Ie[Ne]})}captureCallbacks(){let i=!1;for(let Ne of Li){let Ie=this.options[Ne];if(!Ie)continue;i=!0,this.callbacks[Ne]=Ie,this.callbackWrappers[Ne]=(...Re)=>{this.emit({name:Ne,args:Re})}}return i}activateCallbacks(){for(let i of Li){let Ne=this.callbackWrappers[i];if(Ne)this.options[i]=Ne}}deactivateCallbacks(){for(let i of Li){let Ne=this.callbacks[i];if(Ne)this.options[i]=Ne}}emit(i){let Ne=this.currentFrame();if(!Ne){this.invoke(i);return}let Ie=this.outputFor(Ne).segments,Re=Ie[Ie.length-1];if(Array.isArray(Re))Re.push(i);else Ie.push([i])}appendOutput(i,Ne){if(pc(Ne))i.segments.push(Ne)}outputFor(i){return i.output??=Ec()}flush(i){let Ne=[];for(let Ie=i.segments.length-1;Ie>=0;Ie--)Ne.push(i.segments[Ie]);while(Ne.length>0){let Ie=Ne.pop();if(Array.isArray(Ie)){for(let Re of Ie)this.invoke(Re);continue}for(let Re=Ie.segments.length-1;Re>=0;Re--)Ne.push(Ie.segments[Re])}}invoke(i){this.callbacks[i.name]?.apply(this.options,i.args)}currentFrame(){return this.frames[this.frames.length-1]}close(i){if(this.currentFrame()!==i||i.depth!==this.frames.length-1)throw Error("Parse effect scopes must be closed in order");if(this.frames.pop(),this.frames.length===0&&this.hasCallbacks)this.deactivateCallbacks()}restore(i){if(this.state)this.state.restore(i.checkpoint)}unwind(i){for(let Ne=this.undoLog.length-1;Ne>=i;Ne--){let Ie=this.undoLog[Ne];switch(Ie._tag){case"ArrayLength":if(Ie.target.length<Ie.length)throw Error("A parse effect shortened an append-only array");Ie.target.length=Ie.length;break;case"ArrayTail":Ie.target.length=Ie.start;for(let Re of Ie.values)Ie.target.push(Re);break;case"Property":if(Ie.had)Ie.target[Ie.key]=Ie.value;else delete Ie.target[Ie.key];break}}this.undoLog.length=i}};function cr(i,Ne,Ie){if(i.length===Ne)return i;if(i.length<Ne)throw Error(`A parse branch shortened the ${Ie} below its checkpoint`);return i.length=Ne,i}function of(i){return{lookahead:i.getCurLookaheadState(),context:i.context,contextLength:i.context.length,scopeStack:i.scopeStack,scopeStackLength:i.scopeStack.length,importsStack:i.importsStack,importsStackLength:i.importsStack.length,labels:i.labels,labelsLength:i.labels.length,privateNameStack:i.privateNameStack,privateNameStackLength:i.privateNameStack.length,decoratorStack:i.decoratorStack,decoratorStackLength:i.decoratorStack.length,strict:i.strict,potentialArrowAt:i.potentialArrowAt,potentialArrowInForAwait:i.potentialArrowInForAwait,yieldPos:i.yieldPos,awaitPos:i.awaitPos,awaitIdentPos:i.awaitIdentPos,preValue:i.preValue,preToken:i.preToken,isLookahead:i.isLookahead,isAmbientContext:i.isAmbientContext,inAbstractClass:i.inAbstractClass,inType:i.inType,inDisallowConditionalTypesContext:i.inDisallowConditionalTypesContext,maybeInArrowParameters:i.maybeInArrowParameters,shouldParseArrowReturnType:i.shouldParseArrowReturnType,shouldParseAsyncArrowReturnType:i.shouldParseAsyncArrowReturnType,importOrExportOuterKind:i.importOrExportOuterKind}}function af(i,Ne){i.setLookaheadTokenState(Ne.lookahead),i.context=cr(Ne.context,Ne.contextLength,"token context stack"),i.scopeStack=cr(Ne.scopeStack,Ne.scopeStackLength,"scope stack"),i.importsStack=cr(Ne.importsStack,Ne.importsStackLength,"import stack"),i.labels=cr(Ne.labels,Ne.labelsLength,"label stack"),i.privateNameStack=cr(Ne.privateNameStack,Ne.privateNameStackLength,"private-name stack"),i.decoratorStack=cr(Ne.decoratorStack,Ne.decoratorStackLength,"decorator stack"),i.strict=Ne.strict,i.potentialArrowAt=Ne.potentialArrowAt,i.potentialArrowInForAwait=Ne.potentialArrowInForAwait,i.yieldPos=Ne.yieldPos,i.awaitPos=Ne.awaitPos,i.awaitIdentPos=Ne.awaitIdentPos,i.regexpState=null,i.preValue=Ne.preValue,i.preToken=Ne.preToken,i.isLookahead=Ne.isLookahead,i.isAmbientContext=Ne.isAmbientContext,i.inAbstractClass=Ne.inAbstractClass,i.inType=Ne.inType,i.inDisallowConditionalTypesContext=Ne.inDisallowConditionalTypesContext,i.maybeInArrowParameters=Ne.maybeInArrowParameters,i.shouldParseArrowReturnType=Ne.shouldParseArrowReturnType,i.shouldParseAsyncArrowReturnType=Ne.shouldParseAsyncArrowReturnType,i.importOrExportOuterKind=Ne.importOrExportOuterKind}function cf(i){return{capture:()=>of(i),restore:(Ne)=>af(i,Ne)}}function lf(i,Ne){let{acornTokenTypes:Ie,typeScriptTokenTypes:Re,scope:Le}=Ne,Me=Le.SCOPE_TOP|Le.SCOPE_FUNCTION|Le.SCOPE_CLASS_STATIC_BLOCK;return class extends i{constructor(Be,Fe,We){super(Be,Fe,We);this.parseEffects=new sf(this.options,cf(this))}overrideContext(Be){if(this.curContext()!==Be)this.parseEffects?.willMutateTail(this.context,1);return super.overrideContext(Be)}takeDecorators(Be){let Fe=this.decoratorStack.length-1;if(this.decoratorStack[Fe].length>0)this.parseEffects?.willSet(this.decoratorStack,String(Fe));return super.takeDecorators(Be)}parseDecorators(Be){let Fe=this.decoratorStack[this.decoratorStack.length-1];return this.parseEffects?.willAppend(Fe),super.parseDecorators(Be)}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(Be,Fe,We,Ve){for(let Ge=this.labels.length-1;Ge>=0;Ge--){let Ke=this.labels[Ge];if(Ke.statementStart!==Be.start)break;this.parseEffects?.willSet(Ke,"statementStart"),this.parseEffects?.willSet(Ke,"kind")}return this.parseEffects?.willAppend(this.labels),super.parseLabeledStatement(Be,Fe,We,Ve)}enterClassBody(){return this.parseEffects?.willAppend(this.privateNameStack),super.enterClassBody()}exitClassBody(){let Be=this.privateNameStack[this.privateNameStack.length-2];if(Be)this.parseEffects?.willAppend(Be.used);return this.parseEffects?.willMutateTail(this.privateNameStack,1),super.exitClassBody()}parsePrivateIdent(){if(this.options.checkPrivateFields&&this.privateNameStack.length>0){let Be=this.privateNameStack[this.privateNameStack.length-1];this.parseEffects?.willAppend(Be.used)}return super.parsePrivateIdent()}parseClassField(Be){return this.parseEffects?.willSet(this.currentThisScope(),"inClassFieldInit"),super.parseClassField(Be)}updateContext(Be){let{type:Fe}=this;if(Fe===Ie.parenR||Fe===Ie.braceR||Fe===Ie.braceL||Fe===Ie.dollarBraceL||Fe===Ie.parenL||Fe===Ie._function||Fe===Ie._class||Fe===Ie.colon||Fe===Ie.backQuote||Fe===Ie.star||Fe===Re.jsxTagStart||Fe===Re.jsxTagEnd||Fe===Ie.slash&&Be===Re.jsxTagStart)this.parseEffects?.willMutateTail(this.context,2);return super.updateContext(Be)}enterScope(Be){return this.parseEffects?.willAppend(this.scopeStack),super.enterScope(Be)}exitScope(){return this.parseEffects?.willMutateTail(this.scopeStack,1),super.exitScope()}declareName(Be,Fe,We){let Ve=this.parseEffects;if(Ve?.active)if(Fe===Le.BIND_LEXICAL){let Ge=this.currentScope();if(Ve.willAppend(Ge.lexical),this.inModule&&Ge.flags&Le.SCOPE_TOP)Ve.willSet(this.undefinedExports,Be)}else if(Fe===Le.BIND_SIMPLE_CATCH)Ve.willAppend(this.currentScope().lexical);else if(Fe===Le.BIND_FUNCTION)Ve.willAppend(this.currentScope().functions);else for(let Ge=this.scopeStack.length-1;Ge>=0;Ge--){let Ke=this.scopeStack[Ge];if(Ve.willAppend(Ke.var),this.inModule&&Ke.flags&Le.SCOPE_TOP)Ve.willSet(this.undefinedExports,Be);if(Ke.flags&Me)break}return super.declareName(Be,Fe,We)}checkLocalExport(Be){return this.parseEffects?.willSet(this.undefinedExports,Be.name),super.checkLocalExport(Be)}}}var Oi=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function uc(i){if(!i)throw Error("Assert fail")}function pf(i){return i==="accessor"}function uf(i){return i==="in"||i==="out"}var us=1,dc=2,df=4,St={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 Mi(i,Ne){return St.SCOPE_FUNCTION|(i?St.SCOPE_ASYNC:0)|(Ne?St.SCOPE_GENERATOR:0)}function ff(i){if(i.type!=="MemberExpression")return!1;let{computed:Ne,property:Ie}=i;if(Ne&&(Ie.type!=="TemplateLiteral"||Ie.expressions.length>0))return!1;return Cc(i.object)}function hf(i){return i.type==="UnaryExpression"&&(i.operator==="-"||i.operator==="+")&&i.argument.type==="Literal"&&(typeof i.argument.value==="number"||typeof i.argument.value==="bigint")}function Cc(i){if(i.type==="Identifier")return!0;if(i.type!=="MemberExpression")return!1;if(i.computed)return!1;return Cc(i.object)}function fc(i){return i==="private"||i==="public"||i==="protected"}function mf(i){return Boolean(i.startsExpr)}function yf(i){if(i==null)throw Error(`Unexpected ${i} value.`);return i}function gf(i){switch(i){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function vc(i){let{dts:Ne=!1}=i||{},Ie=!!i?.jsx;return function(Re){let Le=Re.acorn||Ri,Me=qd(Le),{tokTypes:Oe,keywordTypes:Be,isIdentifierStart:Fe,lineBreak:We,isNewLine:Ve,tokContexts:Ge,isIdentifierChar:Ke}=Le,{tokTypes:ze,tokContexts:Ye,keywordsRegExp:Qe,tokenIsLiteralPropertyName:tt,tokenIsTemplate:ot,tokenIsTSDeclarationStart:ct,tokenIsIdentifier:et,tokenIsKeywordOrIdentifier:it,tokenIsTSTypeOperator:lt}=Me;function At($e,je,qe=$e.length){for(let He=je;He<qe;He++){let Xe=$e.charCodeAt(He);if(Ve(Xe))return He<qe-1&&Xe===13&&$e.charCodeAt(He+1)===10?He+2:He+1}return-1}if(Re=Qd(Re,Me,Le),i?.jsx)Re=tf(Le,Me,Re,typeof i.jsx==="boolean"?{}:i.jsx);Re=nf(Re,Me,Le);let bt=lf(Re,{acornTokenTypes:Oe,typeScriptTokenTypes:ze,scope:St});class Ct extends bt{constructor($e,je,qe){super($e,je,qe);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=(He)=>{this.tsParseModifiers({modified:He,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:ut.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return Me}get acornTypeScript(){return Me}getTokenFromCodeInType($e){if($e===62)return this.finishOp(Oe.relational,1);if($e===60)return this.finishOp(Oe.relational,1);return super.getTokenFromCode($e)}readToken($e){if(!this.inType){let je=this.curContext();if(je===Ye.tc_expr)return this.jsx_readToken();if(je===Ye.tc_oTag||je===Ye.tc_cTag){if(Fe($e))return this.jsx_readWord();if($e==62)return++this.pos,this.finishToken(ze.jsxTagEnd);if(($e===34||$e===39)&&je==Ye.tc_oTag)return this.jsx_readString($e)}if($e===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)if(++this.pos,i?.jsx)return this.finishToken(ze.jsxTagStart);else return this.finishToken(Oe.relational,"<")}return super.readToken($e)}getTokenFromCode($e){if(this.inType)return this.getTokenFromCodeInType($e);if($e===64)return++this.pos,this.finishToken(ze.at);return super.getTokenFromCode($e)}isAbstractClass(){return this.ts_isContextual(ze.abstract)&&this.lookahead().type===Oe._class}isDeclareClass(){if(!this.ts_isContextual(ze.declare))return!1;let $e=this.nextTokenStart();if(this.isUnparsedContextual($e,"class"))return!0;if(!this.isUnparsedContextual($e,"abstract"))return!1;let je=this.nextTokenStartSince($e+8);return this.isUnparsedContextual(je,"class")}finishNode($e,je){if($e.type!==""&&$e.end!==0)return $e;return super.finishNode($e,je)}tryParse($e){let je={},qe=this.beginParseEffectScope(),He;try{He=$e(()=>{throw je})}catch(Xe){let Je=Xe===je;if(!Je&&!(Xe instanceof SyntaxError))throw this.parseEffects.rollback(qe),Xe;let nt={events:this.parseEffects.rollbackWithEvents(qe),selected:!1};return Je?{node:null,error:null,thrown:!1,aborted:!0,failState:nt}:{node:null,error:Xe,thrown:!0,aborted:!1,failState:nt}}return this.parseEffects.commit(qe),{node:He,error:null,thrown:!1,aborted:!1,failState:null}}setOptionalParametersError($e,je){$e.optionalParametersLoc=je?.loc??this.startLoc}reScan_lt_gt(){if(this.type===Oe.relational)this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos())}reScan_lt(){let{type:$e}=this;if($e===Oe.bitShift)return this.pos-=2,this.finishOp(Oe.relational,1),Oe.relational;return $e}resetEndLocation($e,je=this.lastTokEnd,qe=this.lastTokEndLoc){if($e.end=je,$e.loc.end=qe,this.options.ranges)$e.range[1]=je}startNodeAtNode($e){return super.startNodeAt($e.start,$e.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers($e,je){return je.some((qe)=>{if(fc(qe))return $e.accessibility===qe;return!!$e[qe]})}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts($e){$e.forEach((je)=>{if(je?.type==="TSTypeCastExpression")this.raise(je.typeAnnotation.start,ut.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow($e){return $e.type==="Identifier"&&$e.name==="async"&&this.lastTokEnd===$e.end&&!this.canInsertSemicolon()&&$e.end-$e.start===5&&$e.start===this.potentialArrowAt}tsIsIdentifier(){return et(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(Oe.colon)?this.tsParseTypeOrTypePredicateAnnotation(Oe.colon):void 0}tsTryParseGenericAsyncArrowFunction($e,je,qe){if(!this.tsMatchLeftRelational())return;let He=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let Xe=this.tsTryParseAndCatch(()=>{let Je=this.startNodeAt($e,je);return Je.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(Je),Je.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(Oe.arrow),Je});if(this.maybeInArrowParameters=He,!Xe)return;return this.parseArrowExpression(Xe,Xe.params,!0,qe)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()!==Oe.relational)return;return this.tsParseTypeArguments(!0)}tsInNoContext($e){let je=this.context;this.context=[je[0]];try{return $e()}finally{this.context=je}}tsTryParseTypeAnnotation(){return this.match(Oe.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual($e,je){let qe=$e+je.length;if(this.input.slice($e,qe)===je){let He=this.input.charCodeAt(qe);return!(Ke(He)||(He&64512)===55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(ze.abstract)&&this.lookahead().type===Oe._new}nextTokenStartSince($e){return Oi.lastIndex=$e,Oi.test(this.input)?Oi.lastIndex:$e}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($e){this.pos=$e.pos,this.value=$e.value,this.exprAllowed=$e.exprAllowed,this.endLoc=$e.endLoc,this.lastTokEnd=$e.lastTokEnd,this.lastTokStart=$e.lastTokStart,this.lastTokStartLoc=$e.lastTokStartLoc,this.type=$e.type,this.start=$e.start,this.end=$e.end,this.startLoc=$e.startLoc,this.lastTokEndLoc=$e.lastTokEndLoc,this.curLine=$e.curLine,this.lineStart=$e.lineStart,this.containsEsc=$e.containsEsc}setLookaheadState($e){this.setLookaheadTokenState($e),this.context=$e.context&&$e.context.slice()}beginParseEffectScope(){return this.parseEffects.begin()}selectTryParseResult($e){let je=$e.failState;if(!je)return;if(je.selected)throw Error("A parse branch result can only be selected once");je.selected=!0,this.parseEffects.replay(je.events)}tsLookAhead($e){let je=this.beginParseEffectScope();try{return $e()}finally{this.parseEffects.rollback(je)}}lookahead($e){let je=this.getCurLookaheadState(),qe=this.context,He=this.preValue,Xe=this.preToken,Je=this.isLookahead;try{if(this.createLookaheadState(),this.isLookahead=!0,$e!==void 0)for(let nt=0;nt<$e;nt++)this.nextToken();else this.nextToken();return this.getCurLookaheadState()}finally{this.setLookaheadTokenState(je),this.context=qe,this.preValue=He,this.preToken=Xe,this.isLookahead=Je}}readWord(){let $e=this.readWord1(),je=Oe.name;if(this.keywords.test($e))je=Be[$e];else if(new RegExp(Qe).test($e))je=ze[$e];return this.finishToken(je,$e)}skipBlockComment(){let $e;if(!this.isLookahead)$e=this.options.onComment&&this.curPosition();let je=this.pos,qe=this.input.indexOf("*/",this.pos+=2);if(qe===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=qe+2,this.options.locations)for(let He,Xe=je;(He=At(this.input,Xe,this.pos))>-1;)++this.curLine,Xe=this.lineStart=He;if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!0,this.input.slice(je+2,qe),je,this.pos,$e,this.curPosition())}skipLineComment($e){let je=this.pos,qe;if(!this.isLookahead)qe=this.options.onComment&&this.curPosition();let He=this.input.charCodeAt(this.pos+=$e);while(this.pos<this.input.length&&!Ve(He))He=this.input.charCodeAt(++this.pos);if(this.isLookahead)return;if(this.options.onComment)this.options.onComment(!1,this.input.slice(je+$e,this.pos),je,this.pos,qe,this.curPosition())}finishToken($e,je){if(this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();let qe=this.type;if(this.type=$e,this.value=je,!this.isLookahead)this.updateContext(qe)}resetStartLocation($e,je,qe){if($e.start=je,$e.loc.start=qe,this.options.ranges)$e.range[0]=je}isLineTerminator(){return this.eat(Oe.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return ac.lastIndex=this.end,ac.test(this.input)}addExtra($e,je,qe,He=!0){if(!$e)return;let Xe=$e.extra=$e.extra||{};if(He)Xe[je]=qe;else Object.defineProperty(Xe,je,{enumerable:He,value:qe})}isLiteralPropertyName(){return tt(this.type)}hasPrecedingLineBreak(){return We.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier($e,je){return $e.name=je,this.finishNode($e,"Identifier")}resetStartLocationFromNode($e,je){this.resetStartLocation($e,je.start,je.loc.start)}isThisParam($e){return $e.type==="Identifier"&&$e.name==="this"}isLookaheadContextual($e){let je=this.nextTokenStart();return this.isUnparsedContextual(je,$e)}ts_type_isContextual($e,je){return $e===je&&!this.containsEsc}ts_isContextual($e){return this.type===$e&&!this.containsEsc}ts_isContextualWithState($e,je){return $e.type===je&&!$e.containsEsc}isContextualWithState($e,je){return je.type===Oe.name&&je.value===$e&&!je.containsEsc}tsIsStartOfMappedType(){if(this.next(),this.eat(Oe.plusMin))return this.ts_isContextual(ze.readonly);if(this.ts_isContextual(ze.readonly))this.next();if(!this.match(Oe.bracketL))return!1;if(this.next(),!this.tsIsIdentifier())return!1;return this.next(),this.match(Oe._in)}tsInDisallowConditionalTypesContext($e){let je=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return $e()}finally{this.inDisallowConditionalTypesContext=je}}tsTryParseType(){return this.tsEatThenParseType(Oe.colon)}match($e){return this.type===$e}matchJsx($e){return this.type===Me.tokTypes[$e]}ts_eatWithState($e,je,qe){let He=qe.type;if($e===He){for(let Xe=0;Xe<je;Xe++)this.next();return!0}else return!1}ts_eatContextualWithState($e,je,qe){if(Qe.test($e)){if(this.ts_isContextualWithState(qe,ze[$e])){for(let He=0;He<je;He++)this.next();return!0}return!1}else{if(!this.isContextualWithState($e,qe))return!1;for(let He=0;He<je;He++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(Oe._class)||this.isAbstractClass()||this.isDeclareClass()}eatContextual($e){if(Qe.test($e)){if(this.ts_isContextual(ze[$e]))return this.next(),!0;return!1}else return super.eatContextual($e)}tsIsExternalModuleReference(){return this.isContextual("require")&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let $e=this.startNode();if(this.expectContextual("require"),this.expect(Oe.parenL),!this.match(Oe.string))this.unexpected();return $e.expression=this.parseExprAtom(),this.expect(Oe.parenR),this.finishNode($e,"TSExternalModuleReference")}tsParseEntityName($e=!0){let je=this.parseIdent($e);while(this.eat(Oe.dot)){let qe=this.startNodeAtNode(je);qe.left=je,qe.right=this.parseIdent($e),je=this.finishNode(qe,"TSQualifiedName")}return je}tsParseEnumMember(){let $e=this.startNode();if($e.id=this.match(Oe.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(Oe.eq))$e.initializer=this.parseMaybeAssign();return this.finishNode($e,"TSEnumMember")}tsParseEnumDeclaration($e,je={}){if(je.const)$e.const=!0;if(je.declare)$e.declare=!0;this.expectContextual("enum"),$e.id=this.parseIdent();let qe=je.const?St.BIND_TS_CONST_ENUM:St.BIND_TS_ENUM;return this.checkLValSimple($e.id,qe),this.expect(Oe.braceL),$e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(Oe.braceR),this.finishNode($e,"TSEnumDeclaration")}tsParseModuleBlock(){let $e=this.startNode();this.enterScope(Gd),this.expect(Oe.braceL),$e.body=[];while(this.type!==Oe.braceR){let je=this.parseStatement(null,!0);$e.body.push(je)}return this.next(),super.exitScope(),this.finishNode($e,"TSModuleBlock")}tsParseAmbientExternalModuleDeclaration($e){if(this.ts_isContextual(ze.global))$e.global=!0,$e.id=this.parseIdent();else if(this.match(Oe.string))$e.id=this.parseLiteral(this.value);else this.unexpected();if(this.match(Oe.braceL))this.enterScope(Dr),$e.body=this.tsParseModuleBlock(),super.exitScope();else super.semicolon();return this.finishNode($e,"TSModuleDeclaration")}tsTryParseDeclare($e){if(this.isLineTerminator())return;let je=this.type,qe;if(this.isContextual("let"))je=Oe._var,qe="let";return this.tsInAmbientContext(()=>{if(je===Oe._function)return $e.declare=!0,this.parseFunctionStatement($e,!1,!0);if(je===Oe._class)return $e.declare=!0,this.parseClass($e,!0);if(je===ze.enum)return this.tsParseEnumDeclaration($e,{declare:!0});if(je===ze.global)return this.tsParseAmbientExternalModuleDeclaration($e);if(je===Oe._const||je===Oe._var){if(!this.match(Oe._const)||!this.isLookaheadContextual("enum"))return $e.declare=!0,this.parseVarStatement($e,qe||this.value,!0);return this.expect(Oe._const),this.tsParseEnumDeclaration($e,{const:!0,declare:!0})}if(je===ze.interface){let He=this.tsParseInterfaceDeclaration($e,{declare:!0});if(He)return He}if(et(je))return this.tsParseDeclaration($e,this.value,!0)})}tsIsListTerminator($e){switch($e){case"EnumMembers":case"TypeMembers":return this.match(Oe.braceR);case"HeritageClauseElement":return this.match(Oe.braceL);case"TupleElementTypes":return this.match(Oe.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker($e,je,qe,He){let Xe=[],Je=-1;for(;;){if(this.tsIsListTerminator($e))break;Je=-1;let nt=je();if(nt==null)return;if(Xe.push(nt),this.eat(Oe.comma)){Je=this.lastTokStart;continue}if(this.tsIsListTerminator($e))break;if(qe)this.expect(Oe.comma);return}if(He)He.value=Je;return Xe}tsParseDelimitedList($e,je,qe){return yf(this.tsParseDelimitedListWorker($e,je,!0,qe))}tsParseBracketedList($e,je,qe,He,Xe){if(!He)if(qe)this.expect(Oe.bracketL);else this.expect(Oe.relational);let Je=this.tsParseDelimitedList($e,je,Xe);if(qe)this.expect(Oe.bracketR);else this.expect(Oe.relational);return Je}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType($e){return!this.match($e)?void 0:this.tsNextThenParseType()}tsExpectThenParseType($e){return this.tsDoThenParseType(()=>this.expect($e))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType($e){return this.tsInType(()=>($e(),this.tsParseType()))}tsSkipParameterStart(){if(et(this.type)||this.match(Oe._this))return this.next(),!0;if(this.match(Oe.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(Oe.bracketL)){this.next();try{return this.parseBindingList(Oe.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(Oe.parenR)||this.match(Oe.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(Oe.colon)||this.match(Oe.comma)||this.match(Oe.question)||this.match(Oe.eq))return!0;if(this.match(Oe.parenR)){if(this.next(),this.match(Oe.arrow))return!0}}return!1}tsIsStartOfFunctionType(){if(this.tsMatchLeftRelational())return!0;return this.match(Oe.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext($e){let je=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return $e()}finally{this.inDisallowConditionalTypesContext=je}}tsParseBindingListForSignature(){return super.parseBindingList(Oe.parenR,!0,!0).map(($e)=>{if($e.type!=="Identifier"&&$e.type!=="RestElement"&&$e.type!=="ObjectPattern"&&$e.type!=="ArrayPattern")this.raise($e.start,ut.UnsupportedSignatureParameterKind({type:$e.type}));return $e})}tsParseTypePredicateAsserts(){if(this.type!==ze.asserts)return!1;let $e=this.containsEsc;if(this.next(),!et(this.type)&&!this.match(Oe._this))return!1;if($e)this.raise(this.lastTokStart,"Escape sequence in keyword asserts");return!0}tsParseThisTypeNode(){let $e=this.startNode();return this.next(),this.finishNode($e,"TSThisType")}tsParseTypeAnnotation($e=!0,je=this.startNode()){return this.tsInType(()=>{if($e)this.expect(Oe.colon);je.typeAnnotation=this.tsParseType()}),this.finishNode(je,"TSTypeAnnotation")}tsParseThisTypePredicate($e){this.next();let je=this.startNodeAtNode($e);return je.parameterName=$e,je.typeAnnotation=this.tsParseTypeAnnotation(!1),je.asserts=!1,this.finishNode(je,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){let $e=this.tsParseThisTypeNode();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.tsParseThisTypePredicate($e);else return $e}tsParseTypePredicatePrefix(){let $e=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),$e}tsParseTypeOrTypePredicateAnnotation($e){return this.tsInType(()=>{let je=this.startNode();this.expect($e);let qe=this.startNode(),He=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(He){let st=this.tsParseTypeAnnotation(!1);return qe.parameterName=He,qe.typeAnnotation=st,qe.asserts=!1,je.typeAnnotation=this.finishNode(qe,"TSTypePredicate"),this.finishNode(je,"TSTypeAnnotation")}let Xe=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(Xe&&this.match(Oe._this)){let st=this.tsParseThisTypeOrThisTypePredicate();if(st.type==="TSThisType")qe.parameterName=st,qe.asserts=!0,qe.typeAnnotation=null,st=this.finishNode(qe,"TSTypePredicate");else this.resetStartLocationFromNode(st,qe),st.asserts=!0;return je.typeAnnotation=st,this.finishNode(je,"TSTypeAnnotation")}let Je=Xe&&this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!Je){if(!Xe)return this.tsParseTypeAnnotation(!1,je);return qe.parameterName=this.parseIdent(),qe.asserts=Xe,qe.typeAnnotation=null,je.typeAnnotation=this.finishNode(qe,"TSTypePredicate"),this.finishNode(je,"TSTypeAnnotation")}let nt=this.tsParseTypeAnnotation(!1);return qe.parameterName=Je,qe.typeAnnotation=nt,qe.asserts=Xe,je.typeAnnotation=this.finishNode(qe,"TSTypePredicate"),this.finishNode(je,"TSTypeAnnotation")})}tsFillSignature($e,je){let qe=$e===Oe.arrow,He="parameters",Xe="typeAnnotation";if(je.typeParameters=this.tsTryParseTypeParameters(),this.expect(Oe.parenL),je.parameters=this.tsParseBindingListForSignature(),qe)je.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation($e);else if(this.match($e))je.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation($e)}tsTryNextParseConstantContext(){if(this.lookahead().type!==Oe._const)return null;this.next();let $e=this.tsParseTypeReference();if($e.typeParameters||$e.typeArguments)this.raise($e.typeName.start,ut.CannotFindName({name:"const"}));return $e}tsParseFunctionOrConstructorType($e,je){let qe=this.startNode();if($e==="TSConstructorType"){if(qe.abstract=!!je,je)this.next();this.next()}return this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(Oe.arrow,qe)),this.finishNode(qe,$e)}tsParseUnionOrIntersectionType($e,je,qe){let He=this.startNode(),Xe=this.eat(qe),Je=[];do Je.push(je());while(this.eat(qe));if(Je.length===1&&!Xe)return Je[0];return He.types=Je,this.finishNode(He,$e)}tsCheckTypeAnnotationForReadOnly($e){switch($e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise($e.start,ut.UnexpectedReadonly)}}tsParseTypeOperator(){let $e=this.startNode(),je=this.value;if(this.next(),$e.operator=je,$e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),je==="readonly")this.tsCheckTypeAnnotationForReadOnly($e);return this.finishNode($e,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(Oe._extends)){let $e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(Oe.question))return $e}}tsParseInferType(){let $e=this.startNode();this.expectContextual("infer");let je=this.startNode();return je.name=this.tsParseTypeParameterName(),je.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),$e.typeParameter=this.finishNode(je,"TSTypeParameter"),this.finishNode($e,"TSInferType")}tsParseLiteralTypeNode(){let $e=this.startNode();return $e.literal=(()=>{switch(this.type){case Oe.num:case Oe.string:case Oe._true:case Oe._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode($e,"TSLiteralType")}tsParseImportType(){let $e=this.startNode();if(this.expect(Oe._import),this.expect(Oe.parenL),!this.match(Oe.string))this.raise(this.start,ut.UnsupportedImportTypeArgument);if($e.argument=this.parseExprAtom(),this.expect(Oe.parenR),this.eat(Oe.dot))$e.qualifier=this.tsParseEntityName();if(this.tsMatchLeftRelational())$e.typeArguments=this.tsParseTypeArguments();return this.finishNode($e,"TSImportType")}tsParseTypeQuery(){let $e=this.startNode();if(this.expect(Oe._typeof),this.match(Oe._import))$e.exprName=this.tsParseImportType();else $e.exprName=this.tsParseEntityName();if(!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())$e.typeArguments=this.tsParseTypeArguments();return this.finishNode($e,"TSTypeQuery")}tsParseMappedTypeParameter(){let $e=this.startNode();return $e.name=this.tsParseTypeParameterName(),$e.constraint=this.tsExpectThenParseType(Oe._in),this.finishNode($e,"TSTypeParameter")}tsParseMappedType(){let $e=this.startNode();if(this.expect(Oe.braceL),this.match(Oe.plusMin))$e.readonly=this.value,this.next(),this.expectContextual("readonly");else if(this.eatContextual("readonly"))$e.readonly=!0;if(this.expect(Oe.bracketL),$e.typeParameter=this.tsParseMappedTypeParameter(),$e.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(Oe.bracketR),this.match(Oe.plusMin))$e.optional=this.value,this.next(),this.expect(Oe.question);else if(this.eat(Oe.question))$e.optional=!0;return $e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(Oe.braceR),this.finishNode($e,"TSMappedType")}tsParseTypeLiteral(){let $e=this.startNode();return $e.members=this.tsParseObjectTypeMembers(),this.finishNode($e,"TSTypeLiteral")}tsIsTupleElementLabel(){if(!it(this.type))return!1;let $e=this.lookahead();if($e.type===Oe.colon)return!0;if($e.type!==Oe.question)return!1;return this.lookahead(2).type===Oe.colon}tsParseTupleElementType(){let $e=this.startLoc,je=this.start,qe=this.eat(Oe.ellipsis),He;if(this.tsIsTupleElementLabel()){let Xe=this.startNode();Xe.label=this.parseIdent(!0),Xe.optional=this.eat(Oe.question),this.expect(Oe.colon),Xe.elementType=this.tsParseType(),He=this.finishNode(Xe,"TSNamedTupleMember")}else{He=this.tsParseType();let Xe=this.eat(Oe.question);if(this.eat(Oe.colon))this.raise(He.start,ut.InvalidTupleMemberLabel);if(Xe){let Je=this.startNodeAtNode(He);Je.typeAnnotation=He,He=this.finishNode(Je,"TSOptionalType")}}if(qe){let Xe=this.startNodeAt(je,$e);Xe.typeAnnotation=He,He=this.finishNode(Xe,"TSRestType")}return He}tsParseTupleType(){let $e=this.startNode();$e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let je=!1;return $e.elementTypes.forEach((qe)=>{let{type:He}=qe;if(je&&He!=="TSRestType"&&He!=="TSOptionalType"&&!(He==="TSNamedTupleMember"&&qe.optional))this.raise(qe.start,ut.OptionalTypeBeforeRequired);if(je||=He==="TSNamedTupleMember"&&qe.optional||He==="TSOptionalType",He==="TSRestType")qe=qe.typeAnnotation}),this.finishNode($e,"TSTupleType")}tsParseTemplateLiteralType(){let $e=this.startNode();return $e.literal=this.parseTemplate({isTagged:!1}),this.finishNode($e,"TSLiteralType")}tsParseTypeReference(){let $e=this.startNode();if($e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational())$e.typeArguments=this.tsParseTypeArguments();return this.finishNode($e,"TSTypeReference")}tsMatchLeftRelational(){return this.match(Oe.relational)&&this.value==="<"}tsMatchRightRelational(){return this.match(Oe.relational)&&this.value===">"}tsParseParenthesizedType(){let $e=this.startNode();return this.expect(Oe.parenL),$e.typeAnnotation=this.tsParseType(),this.expect(Oe.parenR),this.finishNode($e,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case Oe.string:case Oe.num:case Oe._true:case Oe._false:return this.tsParseLiteralTypeNode();case Oe.plusMin:if(this.value==="-"){let $e=this.startNode();if(this.lookahead().type!==Oe.num)this.unexpected();return $e.literal=this.parseMaybeUnary(),this.finishNode($e,"TSLiteralType")}break;case Oe._this:return this.tsParseThisTypeOrThisTypePredicate();case Oe._typeof:return this.tsParseTypeQuery();case Oe._import:return this.tsParseImportType();case Oe.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case Oe.bracketL:return this.tsParseTupleType();case Oe.parenL:return this.tsParseParenthesizedType();case Oe.backQuote:case Oe.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:$e}=this;if(it($e)||$e===Oe._void||$e===Oe._null){let je=$e===Oe._void?"TSVoidKeyword":$e===Oe._null?"TSNullKeyword":gf(this.value);if(je!==void 0&&this.lookaheadCharCode()!==46){let qe=this.startNode();return this.next(),this.finishNode(qe,je)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let $e=this.tsParseNonArrayType();while(!this.hasPrecedingLineBreak()&&this.eat(Oe.bracketL))if(this.match(Oe.bracketR)){let je=this.startNodeAtNode($e);je.elementType=$e,this.expect(Oe.bracketR),$e=this.finishNode(je,"TSArrayType")}else{let je=this.startNodeAtNode($e);je.objectType=$e,je.indexType=this.tsParseType(),this.expect(Oe.bracketR),$e=this.finishNode(je,"TSIndexedAccessType")}return $e}tsParseTypeOperatorOrHigher(){return lt(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),Oe.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),Oe.bitwiseOR)}tsParseNonConditionalType(){if(this.tsIsStartOfFunctionType())return this.tsParseFunctionOrConstructorType("TSFunctionType");if(this.match(Oe._new))return this.tsParseFunctionOrConstructorType("TSConstructorType");else if(this.isAbstractConstructorSignature())return this.tsParseFunctionOrConstructorType("TSConstructorType",!0);return this.tsParseUnionTypeOrHigher()}tsParseType(){uc(this.inType);let $e=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(Oe._extends))return $e;let je=this.startNodeAtNode($e);return je.checkType=$e,je.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(Oe.question),je.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(Oe.colon),je.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(je,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){if(this.next(),et(this.type))return this.next(),this.match(Oe.colon);return!1}tsInType($e){let je=this.inType;this.inType=!0;try{return $e()}finally{this.inType=je}}tsTryParseIndexSignature($e){if(!(this.match(Oe.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(Oe.bracketL);let je=this.parseIdent();je.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(je),this.expect(Oe.bracketR),$e.parameters=[je];let qe=this.tsTryParseTypeAnnotation();if(qe)$e.typeAnnotation=qe;return this.tsParseTypeMemberSemicolon(),this.finishNode($e,"TSIndexSignature")}tsParseNoneModifiers($e){this.tsParseModifiers({modified:$e,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:ut.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter($e=this.tsParseNoneModifiers.bind(this)){let je=this.startNode();return $e(je),je.name=this.tsParseTypeParameterName(),je.constraint=this.tsEatThenParseType(Oe._extends),je.default=this.tsEatThenParseType(Oe.eq),this.finishNode(je,"TSTypeParameter")}tsParseTypeParameters($e){let je=this.startNode();if(this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart"))this.next();else this.unexpected();let qe={value:-1};if(je.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,$e),!1,!0,qe),je.params.length===0)this.raise(this.start,ut.EmptyTypeParameters);if(qe.value!==-1)this.addExtra(je,"trailingComma",qe.value);return this.finishNode(je,"TSTypeParameterDeclaration")}tsTryParseTypeParameters($e){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters($e)}tsTryParse($e){let je=this.beginParseEffectScope(),qe;try{qe=$e()}catch(He){throw this.parseEffects.rollback(je),He}if(qe!==void 0&&qe!==!1)return this.parseEffects.commit(je),qe;this.parseEffects.rollback(je);return}tsTokenCanFollowModifier(){return(this.match(Oe.bracketL)||this.match(Oe.braceL)||this.match(Oe.star)||this.match(Oe.ellipsis)||this.match(Oe.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier($e,je){let qe=this.value;if($e.indexOf(qe)!==-1&&!this.containsEsc){if(je&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return qe}return}tsParseModifiersByMap({modified:$e,map:je}){for(let qe of Object.keys(je))$e[qe]=je[qe]}tsParseModifiers({modified:$e,allowedModifiers:je,disallowedModifiers:qe,stopOnStartOfClassStaticBlock:He,errorTemplate:Xe=ut.InvalidModifierOnTypeMember}){let Je={},nt=(rt,Ze,at,ht)=>{if(Ze===at&&$e[ht])this.raise(rt.column,ut.InvalidModifiersOrder({orderedModifiers:[at,ht]}))},st=(rt,Ze,at,ht)=>{if($e[at]&&Ze===ht||$e[ht]&&Ze===at)this.raise(rt.column,ut.IncompatibleModifiers({modifiers:[at,ht]}))};for(;;){let rt=this.startLoc,Ze=this.tsParseModifier(je.concat(qe??[]),He);if(!Ze)break;if(fc(Ze))if($e.accessibility)this.raise(this.start,ut.DuplicateAccessibilityModifier());else nt(rt,Ze,Ze,"override"),nt(rt,Ze,Ze,"static"),nt(rt,Ze,Ze,"readonly"),nt(rt,Ze,Ze,"accessor"),Je.accessibility=Ze,$e.accessibility=Ze;else if(uf(Ze))if($e[Ze])this.raise(this.start,ut.DuplicateModifier({modifier:Ze}));else nt(rt,Ze,"in","out"),Je[Ze]=Ze,$e[Ze]=!0;else if(pf(Ze))if($e[Ze])this.raise(this.start,ut.DuplicateModifier({modifier:Ze}));else st(rt,Ze,"accessor","readonly"),st(rt,Ze,"accessor","override"),Je[Ze]=Ze,$e[Ze]=!0;else if(Ze==="const")if($e[Ze])this.raise(this.start,ut.DuplicateModifier({modifier:Ze}));else Je[Ze]=Ze,$e[Ze]=!0;else if(Object.hasOwnProperty.call($e,Ze))this.raise(this.start,ut.DuplicateModifier({modifier:Ze}));else nt(rt,Ze,"static","readonly"),nt(rt,Ze,"static","override"),nt(rt,Ze,"override","readonly"),nt(rt,Ze,"abstract","override"),st(rt,Ze,"declare","override"),st(rt,Ze,"static","abstract"),Je[Ze]=Ze,$e[Ze]=!0;if(qe?.includes(Ze))this.raise(this.start,Xe)}return Je}tsParseInOutModifiers($e){this.tsParseModifiers({modified:$e,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ut.InvalidModifierOnTypeParameter})}tsParseClassTypeParameterModifiers($e){this.tsParseModifiers({modified:$e,allowedModifiers:["const","in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:ut.InvalidModifierOnTypeParameter})}parseMaybeUnary($e,je,qe,He){if(!i?.jsx&&this.tsMatchLeftRelational())return this.tsParseTypeAssertion();else return super.parseMaybeUnary($e,je,qe,He)}tsParseTypeAssertion(){if(Ie)this.raise(this.start,ut.ReservedTypeAssertion);let $e=this.tryParse(()=>{let je=this.startNode(),qe=this.tsTryNextParseConstantContext();return je.typeAnnotation=qe||this.tsNextThenParseType(),this.expect(Oe.relational),je.expression=this.parseMaybeUnary(),this.finishNode(je,"TSTypeAssertion")});if($e.error)return this.tsParseTypeParameters(this.tsParseConstModifier);else return $e.node}tsParseTypeArguments($e=!1){let je=this.startNode();if(je.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(Oe.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),je.params.length===0)this.raise(this.start,ut.EmptyTypeArguments);if($e&&this.curContext()!==Ye.tc_oTag)this.reScan_lt_gt();if(!this.tsMatchRightRelational())this.unexpected();return this.exprAllowed=!1,this.next(),this.finishNode(je,"TSTypeParameterInstantiation")}tsParseHeritageClause($e){let je=this.start,qe=this.tsParseDelimitedList("HeritageClauseElement",()=>{let He=this.startNode();if(He.expression=this.tsParseEntityName(),this.tsMatchLeftRelational())He.typeParameters=this.tsParseTypeArguments();return this.finishNode(He,"TSExpressionWithTypeArguments")});if(!qe.length)this.raise(je,ut.EmptyHeritageClauseType({token:$e}));return qe}tsParseTypeMemberSemicolon(){if(!this.eat(Oe.comma)&&!this.isLineTerminator())this.expect(Oe.semi)}tsTryParseAndCatch($e){let je=this.tryParse((qe)=>$e()||qe());if(je.aborted||!je.node)return;return je.node}tsParseSignatureMember($e,je){return this.tsFillSignature(Oe.colon,je),this.tsParseTypeMemberSemicolon(),this.finishNode(je,$e)}tsParsePropertyOrMethodSignature($e,je){if(this.eat(Oe.question))$e.optional=!0;let qe=$e;if(this.match(Oe.parenL)||this.tsMatchLeftRelational()){if(je)this.raise($e.start,ut.ReadonlyForMethodSignature);let He=qe;if(He.kind&&this.tsMatchLeftRelational())this.raise(this.start,ut.AccesorCannotHaveTypeParameters);this.tsFillSignature(Oe.colon,He),this.tsParseTypeMemberSemicolon();let Xe="parameters",Je="typeAnnotation";if(He.kind==="get"){if(He[Xe].length>0){if(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(He[Xe][0]))this.raise(this.start,ut.AccesorCannotDeclareThisParameter)}}else if(He.kind==="set"){if(He[Xe].length!==1)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{let nt=He[Xe][0];if(this.isThisParam(nt))this.raise(this.start,ut.AccesorCannotDeclareThisParameter);if(nt.type==="Identifier"&&nt.optional)this.raise(this.start,ut.SetAccesorCannotHaveOptionalParameter);if(nt.type==="RestElement")this.raise(this.start,ut.SetAccesorCannotHaveRestParameter)}if(He[Je])this.raise(He[Je].start,ut.SetAccesorCannotHaveReturnType)}else He.kind="method";return this.finishNode(He,"TSMethodSignature")}else{let He=qe;if(je)He.readonly=!0;let Xe=this.tsTryParseTypeAnnotation();if(Xe)He.typeAnnotation=Xe;return this.tsParseTypeMemberSemicolon(),this.finishNode(He,"TSPropertySignature")}}tsParseTypeMember(){let $e=this.startNode();if(this.match(Oe.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",$e);if(this.match(Oe._new)){let qe=this.startNode();if(this.next(),this.match(Oe.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSConstructSignatureDeclaration",$e);else return $e.key=this.createIdentifier(qe,"new"),this.tsParsePropertyOrMethodSignature($e,!1)}this.tsParseModifiers({modified:$e,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});let je=this.tsTryParseIndexSignature($e);if(je)return je;if(this.parsePropertyName($e),!$e.computed&&$e.key.type==="Identifier"&&($e.key.name==="get"||$e.key.name==="set")&&this.tsTokenCanFollowModifier())$e.kind=$e.key.name,this.parsePropertyName($e);return this.tsParsePropertyOrMethodSignature($e,!!$e.readonly)}tsParseList($e,je){let qe=[];while(!this.tsIsListTerminator($e))qe.push(je());return qe}tsParseObjectTypeMembers(){this.expect(Oe.braceL);let $e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(Oe.braceR),$e}tsParseInterfaceDeclaration($e,je={}){if(this.hasFollowingLineBreak())return null;if(this.expectContextual("interface"),je.declare)$e.declare=!0;if(et(this.type)){$e.id=this.parseIdent(),this.checkLValSimple($e.id,St.BIND_TS_INTERFACE);let He=this.currentScope();this.maybeExportDefined(He,$e.id.name)}else $e.id=null,this.raise(this.start,ut.MissingInterfaceName);if($e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(Oe._extends))$e.extends=this.tsParseHeritageClause("extends");let qe=this.startNode();return qe.body=this.tsParseInterfaceBody(),$e.body=this.finishNode(qe,"TSInterfaceBody"),this.finishNode($e,"TSInterfaceDeclaration")}tsParseInterfaceBody(){this.expect(Oe.braceL);let $e=this.inType;this.inType=!0;let je=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.inType=$e,this.expect(Oe.braceR),je}tsParseAbstractDeclaration($e){if(this.match(Oe._class))return $e.abstract=!0,this.parseClass($e,!0);else if(this.ts_isContextual(ze.interface)){if(!this.hasFollowingLineBreak())return $e.abstract=!0,this.tsParseInterfaceDeclaration($e)}else this.unexpected($e.start)}tsIsDeclarationStart(){return ct(this.type)}tsParseExpressionStatement($e,je){switch(je.name){case"declare":{let qe=this.tsTryParseDeclare($e);if(qe)return qe.declare=!0,qe;break}case"global":if(this.match(Oe.braceL)){this.enterScope(Dr);let qe=$e;return qe.global=!0,qe.id=je,qe.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(qe,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration($e,je.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:$e}=this,je=this.isAsyncFunction(),qe=this.isLet();if(et($e)){if(je&&!this.containsEsc||qe)return!1;if(($e===ze.type||$e===ze.interface)&&!this.containsEsc){let Je=this.lookahead();if(et(Je.type)&&!this.isContextualWithState("from",Je)||Je.type===Oe.braceL)return!1}}else if(!this.match(Oe._default))return!1;let He=this.nextTokenStart(),Xe=this.isUnparsedContextual(He,"from");if(this.input.charCodeAt(He)===44||et(this.type)&&Xe)return!0;if(this.match(Oe._default)&&Xe){let Je=this.input.charCodeAt(this.nextTokenStartSince(He+4));return Je===34||Je===39}return!1}tsInAmbientContext($e){let je=this.isAmbientContext;this.isAmbientContext=!0;try{return $e()}finally{this.isAmbientContext=je}}tsCheckLineTerminator($e){if($e){if(this.hasFollowingLineBreak())return!1;return this.next(),!0}return!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration($e,je=!1){if($e.id=this.parseIdent(),!je)this.checkLValSimple($e.id,St.BIND_TS_NAMESPACE);if(this.eat(Oe.dot)){let qe=this.startNode();this.tsParseModuleOrNamespaceDeclaration(qe,!0),$e.body=qe}else this.enterScope(Dr),$e.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode($e,"TSModuleDeclaration")}checkLValSimple($e,je=St.BIND_NONE,qe){while($e.type==="TSNonNullExpression"||$e.type==="TSAsExpression"||$e.type==="TSSatisfiesExpression"||$e.type==="TSTypeAssertion")$e=$e.expression;return super.checkLValSimple($e,je,qe)}isSimpleAssignTarget($e){while($e.type==="TSNonNullExpression"||$e.type==="TSAsExpression"||$e.type==="TSSatisfiesExpression"||$e.type==="TSTypeAssertion")$e=$e.expression;return super.isSimpleAssignTarget($e)}tsParseTypeAliasDeclaration($e){$e.id=this.parseIdent(),this.checkLValSimple($e.id,St.BIND_TS_TYPE);let je=this.currentScope();return this.maybeExportDefined(je,$e.id.name),$e.typeAnnotation=this.tsInType(()=>{if($e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(Oe.eq),this.ts_isContextual(ze.interface)&&this.lookahead().type!==Oe.dot){let qe=this.startNode();return this.next(),this.finishNode(qe,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode($e,"TSTypeAliasDeclaration")}tsParseDeclaration($e,je,qe){switch(je){case"abstract":if(this.tsCheckLineTerminator(qe)&&(this.match(Oe._class)||et(this.type)))return this.tsParseAbstractDeclaration($e);break;case"module":if(this.tsCheckLineTerminator(qe)){if(this.match(Oe.string))return this.tsParseAmbientExternalModuleDeclaration($e);else if(et(this.type))return this.tsParseModuleOrNamespaceDeclaration($e)}break;case"namespace":if(this.tsCheckLineTerminator(qe)&&et(this.type))return this.tsParseModuleOrNamespaceDeclaration($e);break;case"type":if(this.tsCheckLineTerminator(qe)&&et(this.type))return this.tsParseTypeAliasDeclaration($e);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration($e,je){$e.isExport=je||!1,$e.id=this.parseIdent(),this.checkLValSimple($e.id,St.BIND_LEXICAL),super.expect(Oe.eq);let qe=this.tsParseModuleReference();if($e.importKind==="type"&&qe.type!=="TSExternalModuleReference")this.raise(qe.start,ut.ImportAliasHasImportType);return $e.moduleReference=qe,super.semicolon(),this.finishNode($e,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:$e}=this;if(et($e)){if(this.isContextual("async")||this.isContextual("let"))return!1;if(($e===ze.type||$e===ze.interface)&&!this.containsEsc){let He=this.lookahead();if(et(He.type)&&!this.isContextualWithState("from",He)||He.type===Oe.braceL)return!1}}else if(!this.match(Oe._default))return!1;let je=this.nextTokenStart(),qe=this.isUnparsedContextual(je,"from");if(this.input.charCodeAt(je)===44||et(this.type)&&qe)return!0;if(this.match(Oe._default)&&qe){let He=this.input.charCodeAt(this.nextTokenStartSince(je+4));return He===34||He===39}return!1}parseTemplate({isTagged:$e=!1}={}){let je=this.startNode();this.next(),je.expressions=[];let qe=this.parseTemplateElement({isTagged:$e});je.quasis=[qe];while(!qe.tail){if(this.type===Oe.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Oe.dollarBraceL),je.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(Oe.braceR),je.quasis.push(qe=this.parseTemplateElement({isTagged:$e}))}return this.next(),this.finishNode(je,"TemplateLiteral")}parseFunction($e,je,qe,He,Xe){if(this.initFunction($e),this.ecmaVersion>=9||this.ecmaVersion>=6&&!He){if(this.type===Oe.star&&je&dc)this.unexpected();$e.generator=this.eat(Oe.star)}if(this.ecmaVersion>=8)$e.async=!!He;if(je&us)$e.id=je&df&&this.type!==Oe.name?null:this.parseIdent();let Je=this.yieldPos,nt=this.awaitPos,st=this.awaitIdentPos,rt=this.maybeInArrowParameters;if(this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Mi($e.async,$e.generator)),!(je&us))$e.id=this.type===Oe.name?this.parseIdent():null;this.parseFunctionParams($e);let Ze=je&us;if(this.parseFunctionBody($e,qe,!1,Xe,{isFunctionDeclaration:Ze}),Ze&&this.isAmbientContext&&$e.id){if(this.currentScope().flags&St.SCOPE_TOP)this.declareName($e.id.name,St.BIND_FLAGS_TS_EXPORT_ONLY,$e.id.start)}if(this.yieldPos=Je,this.awaitPos=nt,this.awaitIdentPos=st,je&us&&$e.id&&!(je&dc))if($e.body)this.checkLValSimple($e.id,this.strict||$e.generator||$e.async?this.treatFunctionsAsVar?St.BIND_VAR:St.BIND_LEXICAL:St.BIND_FUNCTION);else this.checkLValSimple($e.id,St.BIND_NONE);return this.maybeInArrowParameters=rt,this.finishNode($e,Ze?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody($e,je=!1,qe=!1,He=!1,Xe){if(this.match(Oe.colon))$e.returnType=this.tsParseTypeOrTypePredicateAnnotation(Oe.colon);let Je=Xe?.isFunctionDeclaration?"TSDeclareFunction":Xe?.isClassMethod?"TSDeclareMethod":void 0;if(Je&&!this.match(Oe.braceL)&&this.isLineTerminator())return this.exitScope(),this.finishNode($e,Je);if(Je==="TSDeclareFunction"&&this.isAmbientContext){if(this.raise($e.start,ut.DeclareFunctionHasImplementation),$e.declare)return super.parseFunctionBody($e,je,qe,!1),this.finishNode($e,Je)}return super.parseFunctionBody($e,je,qe,He),$e}parseNew(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");let $e=this.startNode(),je=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(Oe.dot)){$e.meta=je;let nt=this.containsEsc;if($e.property=this.parseIdent(!0),$e.property.name!=="target")this.raiseRecoverable($e.property.start,"The only valid meta property for new is 'new.target'");if(nt)this.raiseRecoverable($e.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable($e.start,"'new.target' can only be used in functions and class static block");return this.finishNode($e,"MetaProperty")}let qe=this.start,He=this.startLoc,Xe=this.type===Oe._import;if($e.callee=this.parseSubscripts(this.parseExprAtom(),qe,He,!0,!1),Xe&&$e.callee.type==="ImportExpression")this.raise(qe,"Cannot use new with import()");let{callee:Je}=$e;if(Je.type==="TSInstantiationExpression"&&!Je.extra?.parenthesized)$e.typeArguments=Je.typeArguments,$e.callee=Je.expression;if(this.eat(Oe.parenL))$e.arguments=this.parseExprList(Oe.parenR,this.ecmaVersion>=8,!1);else $e.arguments=[];return this.finishNode($e,"NewExpression")}parseExprOp($e,je,qe,He,Xe){if(Oe._in.binop>He&&!this.hasPrecedingLineBreak()){let Je;if(this.isContextual("as"))Je="TSAsExpression";if(this.isContextual("satisfies"))Je="TSSatisfiesExpression";if(Je){let nt=this.startNodeAt(je,qe);nt.expression=$e;let st=this.tsTryNextParseConstantContext();if(st)nt.typeAnnotation=st;else nt.typeAnnotation=this.tsNextThenParseType();return this.finishNode(nt,Je),this.reScan_lt_gt(),this.parseExprOp(nt,je,qe,He,Xe)}}return super.parseExprOp($e,je,qe,He,Xe)}parseImportSpecifiers(){let $e=[],je=!0;if(Me.tokenIsIdentifier(this.type)){if($e.push(this.parseImportDefaultSpecifier()),!this.eat(Oe.comma))return $e}if(this.type===Oe.star)return $e.push(this.parseImportNamespaceSpecifier()),$e;this.expect(Oe.braceL);while(!this.eat(Oe.braceR)){if(!je){if(this.expect(Oe.comma),this.afterTrailingComma(Oe.braceR))break}else je=!1;$e.push(this.parseImportSpecifier())}return $e}parseImport($e){let je=this.lookahead();if($e.importKind="value",this.importOrExportOuterKind="value",et(je.type)||this.match(Oe.star)||this.match(Oe.braceL)){let qe=this.lookahead(2);if(qe.type!==Oe.comma&&!this.isContextualWithState("from",qe)&&qe.type!==Oe.eq&&this.ts_eatContextualWithState("type",1,je))this.importOrExportOuterKind="type",$e.importKind="type",je=this.lookahead(),qe=this.lookahead(2);if(et(je.type)&&qe.type===Oe.eq){this.next();let He=this.tsParseImportEqualsDeclaration($e);return this.importOrExportOuterKind="value",He}}if(this.next(),this.type===Oe.string)$e.specifiers=[],$e.source=this.parseExprAtom();else $e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),$e.source=this.type===Oe.string?this.parseExprAtom():this.unexpected();if(this.parseMaybeImportAttributes($e),this.semicolon(),this.finishNode($e,"ImportDeclaration"),this.importOrExportOuterKind="value",$e.importKind==="type"&&$e.specifiers.length>1&&$e.specifiers[0].type==="ImportDefaultSpecifier")this.raise($e.start,ut.TypeImportCannotSpecifyDefaultAndNamed);return $e}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let $e=this.startNode();return this.next(),$e.abstract=!0,this.parseClass($e,!0)}if(this.match(ze.interface)){let $e=this.tsParseInterfaceDeclaration(this.startNode());if($e)return $e}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration($e,je){if(this.ecmaVersion>=11)if(this.eatContextual("as"))$e.exported=this.parseModuleExportName(),this.checkExport(je,$e.exported,this.lastTokStart);else $e.exported=null;if(this.expectContextual("from"),this.type!==Oe.string)this.unexpected();return $e.source=this.parseExprAtom(),this.parseMaybeImportAttributes($e),this.semicolon(),this.finishNode($e,"ExportAllDeclaration")}parseDynamicImport($e){if(this.next(),$e.source=this.parseMaybeAssign(),this.eat(Oe.comma)){let je=this.parseExpression();$e.arguments=[je]}if(!this.eat(Oe.parenR)){let je=this.start;if(this.eat(Oe.comma)&&this.eat(Oe.parenR))this.raiseRecoverable(je,"Trailing comma is not allowed in import()");else this.unexpected(je)}return this.finishNode($e,"ImportExpression")}parseExport($e,je){let qe=this.lookahead();if(this.ts_eatWithState(Oe._import,2,qe)){if(this.ts_isContextual(ze.type)&&this.lookaheadCharCode()!==61)$e.importKind="type",this.importOrExportOuterKind="type",this.next();else $e.importKind="value",this.importOrExportOuterKind="value";let He=this.tsParseImportEqualsDeclaration($e,!0);return this.importOrExportOuterKind=void 0,He}else if(this.ts_eatWithState(Oe.eq,2,qe)){let He=$e;return He.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(He,"TSExportAssignment")}else if(this.ts_eatContextualWithState("as",2,qe)){let He=$e;return this.expectContextual("namespace"),He.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(He,"TSNamespaceExportDeclaration")}else{let He=this.lookahead(2).type;if(this.ts_isContextualWithState(qe,ze.type)&&(He===Oe.braceL||He===Oe.star))this.next(),this.importOrExportOuterKind="type",$e.exportKind="type";else this.importOrExportOuterKind="value",$e.exportKind="value";if(this.next(),this.eat(Oe.star))return this.parseExportAllDeclaration($e,je);if(this.eat(Oe._default))return this.checkExport(je,"default",this.lastTokStart),$e.declaration=this.parseExportDefaultDeclaration(),this.finishNode($e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if($e.declaration=this.parseExportDeclaration($e),$e.declaration.type==="VariableDeclaration")this.checkVariableExport(je,$e.declaration.declarations);else this.checkExport(je,$e.declaration.id,$e.declaration.id.start);$e.specifiers=[],$e.source=null}else{if($e.declaration=null,$e.specifiers=this.parseExportSpecifiers(je),this.eatContextual("from")){if(this.type!==Oe.string)this.unexpected();$e.source=this.parseExprAtom(),this.parseMaybeImportAttributes($e)}else{for(let Xe of $e.specifiers)if(this.checkUnreserved(Xe.local),this.checkLocalExport(Xe.local),Xe.local.type==="Literal")this.raise(Xe.local.start,"A string literal cannot be used as an exported binding without `from`.");$e.source=null}this.semicolon()}return this.finishNode($e,"ExportNamedDeclaration")}}checkExport($e,je,qe){if(!$e)return;if(typeof je!=="string")je=je.type==="Identifier"?je.name:je.value;$e[je]=!0}parseMaybeDefault($e,je,qe){let He=super.parseMaybeDefault($e,je,qe);if(He.type==="AssignmentPattern"&&He.typeAnnotation&&He.right.start<He.typeAnnotation.start)this.raise(He.typeAnnotation.start,ut.TypeAnnotationAfterAssign);return He}typeCastToParameter($e){return $e.expression.typeAnnotation=$e.typeAnnotation,this.resetEndLocation($e.expression,$e.typeAnnotation.end,$e.typeAnnotation.loc?.end),$e.expression}toAssignableList($e,je){if(!$e)$e=[];for(let qe=0;qe<$e.length;qe++){let He=$e[qe];if(He?.type==="TSTypeCastExpression")$e[qe]=this.typeCastToParameter(He)}return super.toAssignableList($e,je)}reportReservedArrowTypeParam($e){if($e.params.length===1&&!$e.extra?.trailingComma&&Ie)this.raise($e.start,ut.ReservedArrowTypeParam)}parseExprAtom($e,je,qe){if(this.type===ze.jsxText)return this.jsx_parseText();else if(this.type===ze.jsxTagStart)return this.jsx_parseElement();else if(this.type===ze.at)return this.parseDecorators(),this.parseExprAtom();else if(et(this.type)){let He=this.potentialArrowAt===this.start,Xe=this.start,Je=this.startLoc,nt=this.containsEsc,st=this.parseIdent(!1);if(this.ecmaVersion>=8&&!nt&&st.name==="async"&&!this.canInsertSemicolon()&&this.eat(Oe._function))return this.overrideContext(Ge.f_expr),this.parseFunction(this.startNodeAt(Xe,Je),0,!1,!0,je);if(He&&!this.canInsertSemicolon()){if(this.eat(Oe.arrow))return this.parseArrowExpression(this.startNodeAt(Xe,Je),[st],!1,je);if(this.ecmaVersion>=8&&st.name==="async"&&this.type===Oe.name&&!nt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(st=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Oe.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(Xe,Je),[st],!0,je)}}return st}else return super.parseExprAtom($e,je,qe)}parseExprAtomDefault(){if(et(this.type)){let $e=this.potentialArrowAt===this.start,je=this.containsEsc,qe=this.parseIdent();if(!je&&qe.name==="async"&&!this.canInsertSemicolon()){let{type:He}=this;if(He===Oe._function)return this.next(),this.parseFunction(this.startNodeAtNode(qe),void 0,!0,!0);else if(et(He))if(this.lookaheadCharCode()===61){let Xe=this.parseIdent(!1);if(this.canInsertSemicolon()||!this.eat(Oe.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAtNode(qe),[Xe],!0)}else return qe}if($e&&this.match(Oe.arrow)&&!this.canInsertSemicolon())return this.next(),this.parseArrowExpression(this.startNodeAtNode(qe),[qe],!1);return qe}else this.unexpected()}parseIdentNode(){let $e=this.startNode();if(it(this.type)&&!((this.type.keyword==="class"||this.type.keyword==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)))$e.name=this.value;else return super.parseIdentNode();return $e}parseVarStatement($e,je,qe=!1){let{isAmbientContext:He}=this;this.next(),super.parseVar($e,!1,je,qe||He),this.semicolon();let Xe=this.finishNode($e,"VariableDeclaration");if(!He)return Xe;for(let{id:Je,init:nt}of Xe.declarations){if(!nt)continue;if(je!=="const"||!!Je.typeAnnotation)this.raise(nt.start,ut.InitializerNotAllowedInAmbientContext);else if(nt.type!=="Literal"&&(nt.type!=="TemplateLiteral"||nt.expressions.length>0)&&!hf(nt)&&!ff(nt))this.raise(nt.start,ut.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference)}return Xe}parseStatement($e,je,qe){if(this.match(ze.at))this.parseDecorators(!0);if(this.match(Oe._const)&&this.isLookaheadContextual("enum")){let He=this.startNode();return this.expect(Oe._const),this.tsParseEnumDeclaration(He,{const:!0})}if(this.ts_isContextual(ze.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(ze.interface)){let He=this.tsParseInterfaceDeclaration(this.startNode());if(He)return He}return super.parseStatement($e,je,qe)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers($e){if(this.eat(Oe.question))$e.optional=!0;if($e.readonly&&this.match(Oe.parenL))this.raise($e.start,ut.ClassMethodHasReadonly);if($e.declare&&this.match(Oe.parenL))this.raise($e.start,ut.ClassMethodHasDeclare)}parseExpressionStatement($e,je){return(je.type==="Identifier"?this.tsParseExpressionStatement($e,je):void 0)||super.parseExpressionStatement($e,je)}shouldParseExportStatement(){if(this.tsIsDeclarationStart())return!0;if(this.match(ze.at))return!0;return super.shouldParseExportStatement()}parseConditional($e,je,qe,He,Xe){if(this.eat(Oe.question)){let Je=this.startNodeAt(je,qe);return Je.test=$e,Je.consequent=this.parseMaybeAssign(),this.expect(Oe.colon),Je.alternate=this.parseMaybeAssign(He),this.finishNode(Je,"ConditionalExpression")}return $e}parseMaybeConditional($e,je){let qe=this.start,He=this.startLoc,Xe=this.parseExprOps($e,je);if(this.checkExpressionErrors(je))return Xe;if(!this.maybeInArrowParameters||!this.match(Oe.question))return this.parseConditional(Xe,qe,He,$e,je);let Je=this.tryParse(()=>this.parseConditional(Xe,qe,He,$e,je));if(!Je.node){if(Je.error)this.setOptionalParametersError(je,Je.error);return Xe}return Je.node}parseParenItem($e){let je=this.start,qe=this.startLoc;if($e=super.parseParenItem($e),this.eat(Oe.question))$e.optional=!0,this.resetEndLocation($e);if(this.match(Oe.colon)){let He=this.startNodeAt(je,qe);return He.expression=$e,He.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(He,"TSTypeCastExpression")}return $e}parseExportDeclaration($e){if(!this.isAmbientContext&&this.ts_isContextual(ze.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration($e));let je=this.start,qe=this.startLoc,He=this.eatContextual("declare");if(He&&(this.ts_isContextual(ze.declare)||!this.shouldParseExportStatement()))this.raise(this.start,ut.ExpectedAmbientAfterExportDeclare);let Je=et(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);if(!Je)return null;if(Je.type==="TSInterfaceDeclaration"||Je.type==="TSTypeAliasDeclaration"||He)$e.exportKind="type";if(He)this.resetStartLocation(Je,je,qe),Je.declare=!0;return Je}parseClassId($e,je){if(!je&&this.isContextual("implements"))return;super.parseClassId($e,je);let qe=this.tsTryParseTypeParameters(this.tsParseClassTypeParameterModifiers.bind(this));if(qe)$e.typeParameters=qe}parseClassPropertyAnnotation($e){if(!$e.optional){if(this.value==="!"&&this.eat(Oe.prefix))$e.definite=!0;else if(this.eat(Oe.question))$e.optional=!0}let je=this.tsTryParseTypeAnnotation();if(je)$e.typeAnnotation=je}parseClassField($e){if($e.key.type==="PrivateIdentifier"){if($e.abstract)this.raise($e.start,ut.PrivateElementHasAbstract);if($e.accessibility)this.raise($e.start,ut.PrivateElementHasAccessibility({modifier:$e.accessibility}));this.parseClassPropertyAnnotation($e)}else{if(this.parseClassPropertyAnnotation($e),this.isAmbientContext&&!($e.readonly&&!$e.typeAnnotation)&&this.match(Oe.eq))this.raise(this.start,ut.DeclareClassFieldHasInitializer);if($e.abstract&&this.match(Oe.eq)){let{key:qe}=$e;this.raise(this.start,ut.AbstractPropertyHasInitializer({propertyName:qe.type==="Identifier"&&!$e.computed?qe.name:`[${this.input.slice(qe.start,qe.end)}]`}))}}return super.parseClassField($e)}parseClassMethod($e,je,qe,He){let Xe=$e.kind==="constructor",Je=$e.key.type==="PrivateIdentifier",nt=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(Je){if(nt)$e.typeParameters=nt;if($e.accessibility)this.raise($e.start,ut.PrivateMethodsHasAccessibility({modifier:$e.accessibility}))}else if(nt&&Xe)this.raise(nt.start,ut.ConstructorHasTypeParameters);let{declare:st=!1,kind:rt}=$e;if(st&&(rt==="get"||rt==="set"))this.raise($e.start,ut.DeclareAccessor({kind:rt}));if(nt)$e.typeParameters=nt;let Ze=$e.key;if($e.kind==="constructor"){if(je)this.raise(Ze.start,"Constructor can't be a generator");if(qe)this.raise(Ze.start,"Constructor can't be an async method")}else if($e.static&&cc($e,"prototype"))this.raise(Ze.start,"Classes may not have a static property named prototype");let at=$e.value=this.parseMethod(je,qe,He,!0,$e);if($e.kind==="get"&&at.params.length!==0)this.raiseRecoverable(at.start,"getter should have no params");if($e.kind==="set"&&at.params.length!==1)this.raiseRecoverable(at.start,"setter should have exactly one param");if($e.kind==="set"&&at.params[0].type==="RestElement")this.raiseRecoverable(at.params[0].start,"Setter cannot use rest params");return this.finishNode($e,"MethodDefinition")}isClassMethod(){return this.match(Oe.relational)}parseClassElement($e){if(this.eat(Oe.semi))return null;let je=this.startNode(),qe="",He=!1,Xe=!1,Je="method",nt=!1,st=["declare","private","public","protected","accessor","override","abstract","readonly","static"],rt=this.tsParseModifiers({modified:je,allowedModifiers:st,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:ut.InvalidModifierOnTypeParameterPositions});nt=Boolean(rt.static);let Ze=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(je,st))this.raise(this.start,ut.StaticBlockCannotHaveModifier);if(this.ecmaVersion>=13)return super.parseClassStaticBlock(je),je}else{let at=this.tsTryParseIndexSignature(je);if(at){if(je.abstract)this.raise(je.start,ut.IndexSignatureHasAbstract);if(je.accessibility)this.raise(je.start,ut.IndexSignatureHasAccessibility({modifier:je.accessibility}));if(je.declare)this.raise(je.start,ut.IndexSignatureHasDeclare);if(je.override)this.raise(je.start,ut.IndexSignatureHasOverride);return at}if(!this.inAbstractClass&&je.abstract)this.raise(je.start,ut.NonAbstractClassHasAbstractMethod);if(je.override){if(!$e)this.raise(je.start,ut.OverrideNotInSubClass)}if(je.static=nt,nt){if(!(this.isClassElementNameStart()||this.type===Oe.star))qe="static"}if(!qe&&this.ecmaVersion>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Oe.star)&&!this.canInsertSemicolon())Xe=!0;else qe="async";if(!qe&&(this.ecmaVersion>=9||!Xe)&&this.eat(Oe.star))He=!0;if(!qe&&!Xe&&!He){let ht=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())Je=ht;else qe=ht}if(qe)je.computed=!1,je.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),je.key.name=qe,this.finishNode(je.key,"Identifier");else this.parseClassElementName(je);if(this.parsePostMemberNameModifiers(je),this.isClassMethod()||this.ecmaVersion<13||this.type===Oe.parenL||Je!=="method"||He||Xe){let ht=!je.static&&cc(je,"constructor"),mt=ht&&$e;if(ht&&Je!=="method")this.raise(je.key.start,"Constructor can't have get/set modifier");je.kind=ht?"constructor":Je,this.parseClassMethod(je,He,Xe,mt)}else this.parseClassField(je);return je}};if(je.declare)this.tsInAmbientContext(Ze);else Ze();return je}isClassElementNameStart(){if(this.tsIsIdentifier())return!0;return super.isClassElementNameStart()}parseClassSuper($e){if(super.parseClassSuper($e),$e.superClass&&(this.tsMatchLeftRelational()||this.match(Oe.bitShift)))$e.superTypeParameters=this.tsParseTypeArgumentsInExpression();if(this.eatContextual("implements"))$e.implements=this.tsParseHeritageClause("implements")}parseFunctionParams($e){let je=this.tsTryParseTypeParameters(this.tsParseConstModifier);if(je)$e.typeParameters=je;super.parseFunctionParams($e)}parseVarId($e,je){if(super.parseVarId($e,je),$e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.value==="!"&&this.eat(Oe.prefix))$e.definite=!0;let qe=this.tsTryParseTypeAnnotation();if(qe)$e.id.typeAnnotation=qe,this.resetEndLocation($e.id)}parseArrowExpression($e,je,qe,He){if(this.match(Oe.colon))$e.returnType=this.tsParseTypeAnnotation();let Xe=this.yieldPos,Je=this.awaitPos,nt=this.awaitIdentPos;this.enterScope(Mi(qe,!1)|St.SCOPE_ARROW),this.initFunction($e);let st=this.maybeInArrowParameters;if(this.ecmaVersion>=8)$e.async=!!qe;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,$e.params=this.toAssignableList(je,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody($e,!0,!1,He),this.yieldPos=Xe,this.awaitPos=Je,this.awaitIdentPos=nt,this.maybeInArrowParameters=st,this.finishNode($e,"ArrowFunctionExpression")}parseYield($e){if(!this.yieldPos)this.yieldPos=this.start;let je=this.startNode();this.next();let qe=this.tsMatchLeftRelational();if(!(!this.match(Oe.semi)&&!this.canInsertSemicolon()&&(this.match(Oe.star)||this.type.startsExpr||qe)))return je.delegate=!1,je.argument=null,this.finishNode(je,"YieldExpression");return je.delegate=this.eat(Oe.star),je.argument=this.parseMaybeAssign($e),this.finishNode(je,"YieldExpression")}parseMaybeAssignOrigin($e,je,qe){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield($e);else this.exprAllowed=!1;let He=!1,Xe=-1,Je=-1,nt=-1;if(je)Xe=je.parenthesizedAssign,Je=je.trailingComma,nt=je.doubleProto,je.parenthesizedAssign=je.trailingComma=-1;else je=new Ir,He=!0;let st=this.start,rt=this.startLoc;if(this.type===Oe.parenL||et(this.type))this.potentialArrowAt=this.start,this.potentialArrowInForAwait=$e==="await";let Ze=this.parseMaybeConditional($e,je);if(qe)Ze=qe.call(this,Ze,st,rt);if(this.type.isAssign){let at=this.startNodeAt(st,rt);if(at.operator=this.value,this.type===Oe.eq)Ze=this.toAssignable(Ze,!0,je,!0);if(!He)je.parenthesizedAssign=je.trailingComma=je.doubleProto=-1;if(je.shorthandAssign>=Ze.start)je.shorthandAssign=-1;if(!this.maybeInArrowParameters)if(this.type===Oe.eq)this.checkLValPattern(Ze);else this.checkLValSimple(Ze);if(at.left=Ze,this.next(),at.right=this.parseMaybeAssign($e),nt>-1)je.doubleProto=nt;return this.finishNode(at,"AssignmentExpression")}else if(He)this.checkExpressionErrors(je,!0);if(Xe>-1)je.parenthesizedAssign=Xe;if(Je>-1)je.trailingComma=Je;return Ze}parseMaybeAssign($e,je,qe){let He,Xe;if(i?.jsx&&(this.matchJsx("jsxTagStart")||this.tsMatchLeftRelational())){if(He=this.tryParse(()=>this.parseMaybeAssignOrigin($e,je,qe)),!He.error)return He.node;let st=this.context,rt=st[st.length-1],Ze=st[st.length-2];if(rt===Me.tokContexts.tc_oTag&&Ze===Me.tokContexts.tc_expr)this.parseEffects.pop(st),this.parseEffects.pop(st);else if(rt===Me.tokContexts.tc_oTag||rt===Me.tokContexts.tc_expr)this.parseEffects.pop(st)}if(!He?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin($e,je,qe);let Je,nt=this.tryParse((st)=>{Je=this.tsParseTypeParameters(this.tsParseConstModifier);let rt=this.parseMaybeAssignOrigin($e,je,qe);if(rt.type!=="ArrowFunctionExpression"||rt.extra?.parenthesized)st();if(Je?.params.length!==0)this.resetStartLocationFromNode(rt,Je);return rt.typeParameters=Je,rt});if(!nt.error&&!nt.aborted){if(Je)this.reportReservedArrowTypeParam(Je);return nt.node}if(!He){if(uc(!0),Xe=this.tryParse(()=>this.parseMaybeAssignOrigin($e,je,qe)),!Xe.error)return Xe.node}if(He?.thrown)throw this.selectTryParseResult(He),He.error;if(nt.thrown)throw this.selectTryParseResult(nt),nt.error;if(Xe?.thrown)throw this.selectTryParseResult(Xe),Xe.error;throw He?.error||nt.error||Xe?.error}parseAssignableListItem($e){let je=[];while(this.match(ze.at))je.push(this.parseDecorator());let qe=this.start,He=this.startLoc,Xe,Je=!1,nt=!1;if($e!==void 0){let Ze={};if(this.tsParseModifiers({modified:Ze,allowedModifiers:["public","private","protected","override","readonly"]}),Xe=Ze.accessibility,nt=Ze.override,Je=Ze.readonly,$e===!1&&(Xe||Je||nt))this.raise(He.column,ut.UnexpectedParameterModifier)}let st=this.parseMaybeDefault(qe,He);this.parseBindingListItem(st);let rt=this.parseMaybeDefault(st.start,st.loc.start,st);if(je.length)rt.decorators=je;if(Xe||Je||nt){let Ze=this.startNodeAt(qe,He);if(Xe)Ze.accessibility=Xe;if(Je)Ze.readonly=Je;if(nt)Ze.override=nt;if(rt.type!=="Identifier"&&rt.type!=="AssignmentPattern")this.raise(Ze.start,ut.UnsupportedParameterPropertyKind);return Ze.parameter=rt,this.finishNode(Ze,"TSParameterProperty")}return rt}checkLValInnerPattern($e,je=St.BIND_NONE,qe){switch($e.type){case"TSParameterProperty":this.checkLValInnerPattern($e.parameter,je,qe);break;default:{super.checkLValInnerPattern($e,je,qe);break}}}parseBindingListItem($e){if(this.eat(Oe.question)){if($e.type!=="Identifier"&&!this.isAmbientContext&&!this.inType)this.raise($e.start,ut.PatternIsOptional);$e.optional=!0}let je=this.tsTryParseTypeAnnotation();if(je)$e.typeAnnotation=je;return this.resetEndLocation($e),$e}isAssignable($e,je){switch($e.type){case"TSTypeCastExpression":return this.isAssignable($e.expression,je);case"TSParameterProperty":return!0;case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let qe=$e.properties.length-1;return $e.properties.every((He,Xe)=>He.type!=="ObjectMethod"&&(Xe===qe||He.type!=="SpreadElement")&&this.isAssignable(He))}case"Property":case"ObjectProperty":return this.isAssignable($e.value);case"SpreadElement":return this.isAssignable($e.argument);case"ArrayExpression":return $e.elements.every((qe)=>qe===null||this.isAssignable(qe));case"AssignmentExpression":return $e.operator==="=";case"ParenthesizedExpression":return this.isAssignable($e.expression);case"MemberExpression":case"OptionalMemberExpression":return!je;default:return!1}}toAssignable($e,je=!1,qe=new Ir,He=!1){switch($e.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression($e,je,qe,He);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":if(je);else this.raise($e.start,ut.UnexpectedTypeCastInParameter);let Xe=this.toAssignable($e.expression,je,qe,He);if(He)return $e.expression=Xe,$e;return Xe;case"MemberExpression":break;case"AssignmentExpression":if(!je&&$e.left.type==="TSTypeCastExpression")$e.left=this.typeCastToParameter($e.left);return super.toAssignable($e,je,qe);case"TSTypeCastExpression":return this.typeCastToParameter($e);default:return super.toAssignable($e,je,qe)}return $e}toAssignableParenthesizedExpression($e,je,qe,He=!1){switch($e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":let Xe=this.toAssignable($e.expression,je,qe,He);if(He)return $e.expression=Xe,$e;return Xe;default:return super.toAssignable($e,je,qe)}}parseBindingAtom(){switch(this.type){case Oe._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow($e){let je;if(this.match(Oe.colon))je=$e.every((qe)=>this.isAssignable(qe,!0));else je=!this.canInsertSemicolon();if(je){if(this.match(Oe.colon)){let qe=this.tryParse((He)=>{let Xe=this.tsParseTypeOrTypePredicateAnnotation(Oe.colon);if(this.canInsertSemicolon()||!this.match(Oe.arrow))He();return Xe});if(qe.aborted)return this.shouldParseArrowReturnType=void 0,!1;if(!qe.thrown)this.shouldParseArrowReturnType=qe.node}if(!this.match(Oe.arrow))return this.shouldParseArrowReturnType=void 0,!1;return!0}return this.shouldParseArrowReturnType=void 0,je}parseParenArrowList($e,je,qe,He){let Xe=this.startNodeAt($e,je);return Xe.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(Xe,qe,!1,He)}parseParenAndDistinguishExpression($e,je){let qe=this.start,He=this.startLoc,Xe,Je=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let nt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let st=this.start,rt=this.startLoc,Ze=[],at=!0,ht=!1,mt=new Ir,gt=this.yieldPos,Et=this.awaitPos,Mt;this.yieldPos=0,this.awaitPos=0;while(this.type!==Oe.parenR)if(at?at=!1:this.expect(Oe.comma),Je&&this.afterTrailingComma(Oe.parenR,!0)){ht=!0;break}else if(this.type===Oe.ellipsis){if(Mt=this.start,Ze.push(this.parseParenItem(this.parseRestBinding())),this.type===Oe.comma)this.raise(this.start,"Comma is not permitted after the rest element");break}else Ze.push(this.parseMaybeAssign(!1,mt,this.parseParenItem));let Vt=this.lastTokEnd,Ht=this.lastTokEndLoc;if(this.expect(Oe.parenR),this.maybeInArrowParameters=nt,$e&&this.shouldParseArrow(Ze)&&this.eat(Oe.arrow))return this.checkPatternErrors(mt,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=gt,this.awaitPos=Et,this.parseParenArrowList(qe,He,Ze,je);if(!Ze.length||ht)this.unexpected(this.lastTokStart);if(Mt)this.unexpected(Mt);if(this.checkExpressionErrors(mt,!0),this.yieldPos=gt||this.yieldPos,this.awaitPos=Et||this.awaitPos,Ze.length>1)Xe=this.startNodeAt(st,rt),Xe.expressions=Ze,this.finishNodeAt(Xe,"SequenceExpression",Vt,Ht);else Xe=Ze[0]}else Xe=this.parseParenExpression();if(this.options.preserveParens){let nt=this.startNodeAt(qe,He);return nt.expression=Xe,this.finishNode(nt,"ParenthesizedExpression")}else return Xe}parseTaggedTemplateExpression($e,je,qe,He){let Xe=this.startNodeAt(je,qe);if(Xe.tag=$e,Xe.quasi=this.parseTemplate({isTagged:!0}),He)this.raise(je,"Tagged Template Literals are not allowed in optionalChain.");return this.finishNode(Xe,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(this.match(Oe.colon)){let $e=this.tryParse((je)=>{let qe=this.tsParseTypeOrTypePredicateAnnotation(Oe.colon);if(this.canInsertSemicolon()||!this.match(Oe.arrow))je();return qe});if($e.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!$e.thrown)return this.shouldParseAsyncArrowReturnType=$e.node,!this.canInsertSemicolon()&&this.eat(Oe.arrow)}else return!this.canInsertSemicolon()&&this.eat(Oe.arrow)}parseSubscriptAsyncArrow($e,je,qe,He){let Xe=this.startNodeAt($e,je);return Xe.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(Xe,qe,!0,He)}parseExprList($e,je,qe,He){let Xe=[],Je=!0;while(!this.eat($e)){if(!Je){if(this.expect(Oe.comma),je&&this.afterTrailingComma($e))break}else Je=!1;let nt;if(qe&&this.type===Oe.comma)nt=null;else if(this.type===Oe.ellipsis){if(nt=this.parseSpread(He),this.maybeInArrowParameters&&this.match(Oe.colon))nt.typeAnnotation=this.tsParseTypeAnnotation();if(He&&this.type===Oe.comma&&He.trailingComma<0)He.trailingComma=this.start}else nt=this.parseMaybeAssign(!1,He,this.parseParenItem);Xe.push(nt)}return Xe}parseMaybeDecoratorArguments($e){let je=this.tsMatchLeftRelational()||this.match(Oe.bitShift)?this.tsParseTypeArgumentsInExpression():void 0;if(this.eat(Oe.parenL)){let qe=this.startNodeAtNode($e);if(qe.callee=$e,qe.arguments=this.parseExprList(Oe.parenR,!1),je)qe.typeArguments=je;return this.finishNode(qe,"CallExpression")}if(je){let qe=this.startNodeAtNode($e);return qe.expression=$e,qe.typeArguments=je,this.finishNode(qe,"TSInstantiationExpression")}return $e}parseSubscript($e,je,qe,He,Xe,Je,nt){let st=Je;if(!this.hasPrecedingLineBreak()&&this.value==="!"&&this.match(Oe.prefix)){this.exprAllowed=!1,this.next();let mt=this.startNodeAt(je,qe);return mt.expression=$e,$e=this.finishNode(mt,"TSNonNullExpression"),$e}let rt=!1;if(this.match(Oe.questionDot)&&this.lookaheadCharCode()===60){if(He)return $e;$e.optional=!0,st=rt=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(Oe.bitShift)){let mt,gt=this.tsTryParseAndCatch(()=>{if(!He&&this.atPossibleAsyncArrow($e)){let Ht=this.tsTryParseGenericAsyncArrowFunction(je,qe,nt);if(Ht)return $e=Ht,$e}let Et=this.tsParseTypeArgumentsInExpression();if(!Et)return $e;if(rt&&!this.match(Oe.parenL))return mt=this.curPosition(),$e;if(ot(this.type)||this.type===Oe.backQuote){let Ht=this.parseTaggedTemplateExpression($e,je,qe,st);return Ht.typeArguments=Et,Ht}if(!He&&this.eat(Oe.parenL)){let Ht=new Ir,Wt=this.startNodeAt(je,qe);if(Wt.callee=$e,Wt.arguments=this.parseExprList(Oe.parenR,this.ecmaVersion>=8,!1,Ht),this.tsCheckForInvalidTypeCasts(Wt.arguments),Wt.typeArguments=Et,st)Wt.optional=rt;return this.checkExpressionErrors(Ht,!0),$e=this.finishNode(Wt,"CallExpression"),$e}let Mt=this.type;if(this.tsMatchRightRelational()||Mt===Oe.bitShift||Mt!==Oe.parenL&&mf(Mt)&&!this.hasPrecedingLineBreak())return;let Vt=this.startNodeAt(je,qe);return Vt.expression=$e,Vt.typeArguments=Et,this.finishNode(Vt,"TSInstantiationExpression")});if(mt)this.unexpected(mt);if(gt){if(gt.type==="TSInstantiationExpression"&&(this.match(Oe.dot)||this.match(Oe.questionDot)&&this.lookaheadCharCode()!==40))this.raise(this.start,ut.InvalidPropertyAccessAfterInstantiationExpression);return $e=gt,$e}}let Ze=this.ecmaVersion>=11,at=Ze&&this.eat(Oe.questionDot);if(He&&at)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let ht=this.eat(Oe.bracketL);if(ht||at&&this.type!==Oe.parenL&&this.type!==Oe.backQuote||this.eat(Oe.dot)){let mt=this.startNodeAt(je,qe);if(mt.object=$e,ht)mt.property=this.parseExpression(),this.expect(Oe.bracketR);else if(this.type===Oe.privateId&&$e.type!=="Super")mt.property=this.parsePrivateIdent();else mt.property=this.parseIdent(this.options.allowReserved!=="never");if(mt.computed=!!ht,Ze)mt.optional=at;$e=this.finishNode(mt,"MemberExpression")}else if(!He&&this.eat(Oe.parenL)){let mt=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let gt=new Ir,Et=this.yieldPos,Mt=this.awaitPos,Vt=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let Ht=this.parseExprList(Oe.parenR,this.ecmaVersion>=8,!1,gt);if(Xe&&!at&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(gt,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");this.yieldPos=Et,this.awaitPos=Mt,this.awaitIdentPos=Vt,$e=this.parseSubscriptAsyncArrow(je,qe,Ht,nt)}else{this.checkExpressionErrors(gt,!0),this.yieldPos=Et||this.yieldPos,this.awaitPos=Mt||this.awaitPos,this.awaitIdentPos=Vt||this.awaitIdentPos;let Wt=this.startNodeAt(je,qe);if(Wt.callee=$e,Wt.arguments=Ht,Ze)Wt.optional=at;$e=this.finishNode(Wt,"CallExpression")}this.maybeInArrowParameters=mt}else if(this.type===Oe.backQuote){if(at||st)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let mt=this.startNodeAt(je,qe);mt.tag=$e,mt.quasi=this.parseTemplate({isTagged:!0}),$e=this.finishNode(mt,"TaggedTemplateExpression")}return $e}parseGetterSetter($e){$e.kind=$e.key.name,this.parsePropertyName($e);let je=this.tsTryParseTypeParameters(this.tsParseConstModifier);if($e.value=this.parseMethod(!1),je)$e.value.typeParameters=je;let qe=$e.kind==="get"?0:1,He=$e.value.params[0];if(qe=He&&this.isThisParam(He)?qe+1:qe,$e.value.params.length!==qe){let Je=$e.value.start;if($e.kind==="get")this.raiseRecoverable(Je,"getter should have no params");else this.raiseRecoverable(Je,"setter should have exactly one param")}else if($e.kind==="set"&&$e.value.params[0].type==="RestElement")this.raiseRecoverable($e.value.params[0].start,"Setter cannot use rest params")}parsePropertyValue($e,je,qe,He,Xe,Je,nt,st){if(this.tsMatchLeftRelational()){if(je)this.unexpected();$e.kind="init",$e.method=!0;let rt=this.tsTryParseTypeParameters(this.tsParseConstModifier);if($e.value=this.parseMethod(qe,He),rt)$e.value.typeParameters=rt;return}return super.parsePropertyValue($e,je,qe,He,Xe,Je,nt,st)}parseProperty($e,je){if(!$e){let qe=[];if(this.match(ze.at))while(this.match(ze.at))qe.push(this.parseDecorator());let He=super.parseProperty($e,je);if(He.type==="SpreadElement"){if(qe.length)this.raise(He.start,ds.SpreadElementDecorator)}if(qe.length)He.decorators=qe,qe=[];return He}return super.parseProperty($e,je)}parseCatchClauseParam(){let $e=this.parseBindingAtom(),je=$e.type==="Identifier";this.enterScope(je?St.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern($e,je?St.BIND_SIMPLE_CATCH:St.BIND_LEXICAL);let qe=this.tsTryParseTypeAnnotation();if(qe)$e.typeAnnotation=qe,this.resetEndLocation($e);return this.expect(Oe.parenR),$e}parseClass($e,je){let qe=this.inAbstractClass;this.inAbstractClass=!!$e.abstract;try{this.next(),this.takeDecorators($e);let He=this.strict;this.strict=!0,this.parseClassId($e,je),this.parseClassSuper($e);let Xe=this.enterClassBody(),Je=this.startNode(),nt=!1;Je.body=[];let st=[];this.expect(Oe.braceL);while(this.type!==Oe.braceR){if(this.match(ze.at)){st.push(this.parseDecorator());continue}let rt=this.parseClassElement($e.superClass!==null);if(st.length)rt.decorators=st,this.resetStartLocationFromNode(rt,st[0]),st=[];if(rt){if(Je.body.push(rt),rt.type==="MethodDefinition"&&rt.kind==="constructor"&&rt.value.type==="FunctionExpression"){if(nt)this.raiseRecoverable(rt.start,"Duplicate constructor in the same class");if(nt=!0,rt.decorators&&rt.decorators.length>0)this.raise(rt.start,ds.DecoratorConstructor)}else if(rt.key&&rt.key.type==="PrivateIdentifier"&&rt.value?.type!=="TSDeclareMethod"){let Ze=rt.key.name;if(this.parseEffects.modify(Xe,Ze,(ht)=>Yd(ht,rt)))this.raiseRecoverable(rt.key.start,`Identifier '#${Ze}' has already been declared`)}}}if(this.strict=He,this.next(),st.length)this.raise(this.start,ds.TrailingDecorator);return $e.body=this.finishNode(Je,"ClassBody"),this.exitClassBody(),this.finishNode($e,je?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=qe}}parseClassFunctionParams(){let $e=this.tsTryParseTypeParameters(),je=this.parseBindingList(Oe.parenR,!1,this.ecmaVersion>=8,!0);if($e)je.typeParameters=$e;return je}parseMethod($e,je,qe,He,Xe){let Je=this.startNode(),nt=this.yieldPos,st=this.awaitPos,rt=this.awaitIdentPos;if(this.initFunction(Je),this.ecmaVersion>=6)Je.generator=$e;if(this.ecmaVersion>=8)Je.async=!!je;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Mi(je,Je.generator)|St.SCOPE_SUPER|(qe?St.SCOPE_DIRECT_SUPER:0)),this.expect(Oe.parenL),Je.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Je,!1,!0,!1,{isClassMethod:He}),this.yieldPos=nt,this.awaitPos=st,this.awaitIdentPos=rt,Xe&&Xe.abstract){if(!!Je.body){let{key:at}=Xe;this.raise(Xe.start,ut.AbstractMethodHasImplementation({methodName:at.type==="Identifier"&&!Xe.computed?at.name:`[${this.input.slice(at.start,at.end)}]`}))}}return this.finishNode(Je,"FunctionExpression")}static parse($e,je){if(je.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else je.locations=!0;let qe=new this(je,$e);if(Ne)qe.isAmbientContext=!0;return qe.parse()}static parseExpressionAt($e,je,qe){if(qe.locations===!1)throw Error("You have to enable options.locations while using acorn-typescript");else qe.locations=!0;let He=new this(qe,$e,je);if(Ne)He.isAmbientContext=!0;return He.nextToken(),He.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(ze.type)){let je=this.startNode();return je.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(je,!0,this.importOrExportOuterKind==="type"),this.finishNode(je,"ImportSpecifier")}else{let je=super.parseImportSpecifier();return je.importKind="value",je}}parseExportSpecifier($e){let je=this.ts_isContextual(ze.type);if(!this.match(Oe.string)&&je){let He=this.startNode();return He.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(He,!1,this.importOrExportOuterKind==="type"),this.finishNode(He,"ExportSpecifier"),this.checkExport($e,He.exported,He.exported.start),He}else{let He=super.parseExportSpecifier($e);return He.exportKind="value",He}}parseTypeOnlyImportExportSpecifier($e,je,qe){let He=je?"imported":"local",Xe=je?"local":"exported",Je=$e[He],nt,st=!1,rt=!0,Ze=Je.start;if(this.isContextual("as")){let ht=this.parseIdent();if(this.isContextual("as")){let mt=this.parseIdent();if(it(this.type))st=!0,Je=ht,nt=je?this.parseIdent():this.parseModuleExportName(),rt=!1;else nt=mt,rt=!1}else if(it(this.type))rt=!1,nt=je?this.parseIdent():this.parseModuleExportName();else st=!0,Je=ht}else if(it(this.type))if(st=!0,je){if(Je=super.parseIdent(!0),!this.isContextual("as"))this.checkUnreserved(Je)}else Je=this.parseModuleExportName();if(st&&qe)this.raise(Ze,je?ut.TypeModifierIsUsedInTypeImports:ut.TypeModifierIsUsedInTypeExports);$e[He]=Je,$e[Xe]=nt;let at=je?"importKind":"exportKind";if($e[at]=st?"type":"value",rt&&this.eatContextual("as"))$e[Xe]=je?this.parseIdent():this.parseModuleExportName();if(!$e[Xe])$e[Xe]=this.copyNode($e[He]);if(je)this.checkLValSimple($e[Xe],St.BIND_LEXICAL)}raiseCommonCheck($e,je,qe){switch(je){case"Comma is not permitted after the rest element":if(this.isAmbientContext&&this.match(Oe.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise($e,je)}return qe?super.raiseRecoverable($e,je):super.raise($e,je)}raiseRecoverable($e,je){return this.raiseCommonCheck($e,je,!0)}raise($e,je){return this.raiseCommonCheck($e,je,!0)}updateContext($e){let{type:je}=this;if(je==Oe.braceL){var qe=this.curContext();if(qe==Ye.tc_oTag)this.parseEffects.append(this.context,Ge.b_expr);else if(qe==Ye.tc_expr)this.parseEffects.append(this.context,Ge.b_tmpl);else super.updateContext($e);this.exprAllowed=!0}else if(je===Oe.slash&&$e===ze.jsxTagStart)this.parseEffects.truncate(this.context,this.context.length-2),this.parseEffects.append(this.context,Ye.tc_cTag),this.exprAllowed=!1;else return super.updateContext($e)}jsx_parseOpeningElementAt($e,je){let qe=this.startNodeAt($e,je),He=this.jsx_parseElementName();if(He)qe.name=He;if(this.match(Oe.relational)||this.match(Oe.bitShift)){let Xe=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());if(Xe)qe.typeArguments=Xe}qe.attributes=[];while(this.type!==Oe.slash&&this.type!==ze.jsxTagEnd)qe.attributes.push(this.jsx_parseAttribute());return qe.selfClosing=this.eat(Oe.slash),this.expect(ze.jsxTagEnd),this.finishNode(qe,He?"JSXOpeningElement":"JSXOpeningFragment")}enterScope($e){let je=$e===Dr;if(je)this.parseEffects.append(this.importsStack,[]);let qe=je?$e|St.SCOPE_CLASS_STATIC_BLOCK:$e;super.enterScope(qe);let He=super.currentScope();He.types=[],He.enums=[],He.constEnums=[],He.classes=[],He.exportOnlyBindings=[]}exitScope(){if(super.currentScope().flags&Dr)this.parseEffects.pop(this.importsStack);super.exitScope()}hasImport($e,je){let qe=this.importsStack.length;if(this.importsStack[qe-1].indexOf($e)>-1)return!0;if(!je&&qe>1){for(let He=0;He<qe-1;He++)if(this.importsStack[He].indexOf($e)>-1)return!0}return!1}maybeExportDefined($e,je){if(this.inModule&&$e.flags&St.SCOPE_TOP)this.parseEffects.remove(this.undefinedExports,je)}declareName($e,je,qe){if(je&St.BIND_FLAGS_TS_IMPORT){if(this.hasImport($e,!0))this.raise(qe,`Identifier '${$e}' has already been declared.`);this.parseEffects.append(this.importsStack[this.importsStack.length-1],$e);return}let He=this.currentScope();if(je&St.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(He,$e),this.parseEffects.append(He.exportOnlyBindings,$e);return}if(je===St.BIND_TS_TYPE||je===St.BIND_TS_INTERFACE){if(je===St.BIND_TS_TYPE&&He.types.includes($e))this.raise(qe,`type '${$e}' has already been declared.`);this.parseEffects.append(He.types,$e)}else if(je&St.BIND_FLAGS_TS_ENUM){if(He.enums.includes($e))return;super.declareName($e,St.BIND_LEXICAL,qe)}else super.declareName($e,je,qe);if(je&St.BIND_FLAGS_TS_ENUM)this.parseEffects.append(He.enums,$e);if(je&St.BIND_FLAGS_TS_CONST_ENUM)this.parseEffects.append(He.constEnums,$e);if(je&St.BIND_FLAGS_CLASS)this.parseEffects.append(He.classes,$e)}checkLocalExport($e){let{name:je}=$e;if(this.hasImport(je))return;let qe=this.scopeStack.length;for(let He=qe-1;He>=0;He--){let Xe=this.scopeStack[He];if(Xe.types.indexOf(je)>-1||Xe.exportOnlyBindings.indexOf(je)>-1)return}super.checkLocalExport($e)}}return Ct}}var xf=/\n/,bf=/[ \t]/,Ef=/^[,) \t]*$/,hs="",Sc=[];function ms(i,Ne){hs=i,Sc=Ne}function ys(i,Ne,Ie,Re){let Le=Ne;if(i&&xf.test(Le)){let Me=Ie;while(Me>0&&hs[Me-1]!==`
|
|
12
|
-
`)Me-=1;let Oe=Me;while(bf.test(hs[Oe]))Oe+=1;let Be=hs.slice(Me,Oe);Le=Cf(Le,Be)}Sc.push({type:i?"Block":"Line",value:Le,start:Ie,end:Re})}function Cf(i,Ne){if(Ne==="")return i;return(i.startsWith(Ne)?i.slice(Ne.length):i).replaceAll(`
|
|
13
|
-
${Ne}`,`
|
|
14
|
-
`)}function ji(i,Ne,Ie,Re){let Le=vf(Ie,Re);if(Le>=Ie.length)return;Fi(i,void 0,Ie,{index:Le},Ne)}function vf(i,Ne){let Ie=0,Re=i.length;while(Ie<Re){let Le=Ie+Re>>>1;if(i[Le].start<Ne)Ie=Le+1;else Re=Le}return Ie}function Fi(i,Ne,Ie,Re,Le){while(Re.index<Ie.length&&Ie[Re.index].start<(i.start??0))i.leadingComments??=[],i.leadingComments.push(Ie[Re.index]),Re.index++;if(Re.index>=Ie.length)return;let Me=Ie[Re.index].start,Oe=i.end,Fe=Oe===void 0||Oe>Me?Object.keys(i):[];for(let We=0;We<Fe.length;We++){let Ve=Fe[We];if(Ve==="type"||Ve==="leadingComments")continue;let Ge=i[Ve];if(!Ge||typeof Ge!=="object")continue;if(Array.isArray(Ge)){for(let Ke of Ge)if(Ke&&typeof Ke==="object"&&typeof Ke.type==="string"){if(Fi(Ke,i,Ie,Re,Le),Re.index>=Ie.length)return}}else if(typeof Ge.type==="string"){if(Fi(Ge,i,Ie,Re,Le),Re.index>=Ie.length)return}}if(Re.index<Ie.length){let We=Ie[Re.index];if(Ne===void 0||i.end!==Ne.end){let Ve=Le.slice(i.end??0,We.start);if((Ne?.type==="BlockStatement"||Ne?.type==="Program")&&Bi(Ne.body,i)||Ne?.type==="ArrayExpression"&&Bi(Ne.elements,i)||Ne?.type==="ObjectExpression"&&Bi(Ne.properties,i))while(Re.index<Ie.length){if(Ne&&Ie[Re.index].start>=(Ne.end??Number.POSITIVE_INFINITY))break;Re.index++}else if((i.end??0)<=We.start&&Ef.test(Ve))Re.index++}}}function Bi(i,Ne){return!!i&&i.indexOf(Ne)===i.length-1}var gs={sawParenthesized:!1},wc=(i)=>class extends i{parseParenAndDistinguishExpression(Ne,Ie){let Re=super.parseParenAndDistinguishExpression(Ne,Ie);if(Re.type==="ParenthesizedExpression")gs.sawParenthesized=!0;return Re}parseDecorator(){return gs.sawParenthesized=!0,super.parseDecorator()}},Sf=Lt.extend(wc),Tf=Lt.extend(vc(),wc);function Gi(i){return i?Tf:Sf}var kf={onComment:ys,sourceType:"module",ecmaVersion:16},Ac={onComment:ys,sourceType:"module",ecmaVersion:16,preserveParens:!0},wf={onComment:ys,sourceType:"module",ecmaVersion:16},Tc={...Ac,startLocation:null},Vi=/\r\n?|\n|\u2028|\u2029/g;function Af(i,Ne){if(Ne?.breakEnds)return Ne.breakEnds;let Ie=[];Vi.lastIndex=0;while(Vi.test(i))Ie.push(Vi.lastIndex);if(Ne)Ne.breakEnds=Ie;return Ie}function Pf(i,Ne,Ie){let Re=i.lastIndexOf(`
|
|
15
|
-
`,Ne-1)+1,Le=Af(i,Ie),Me=0,Oe=Le.length;while(Me<Oe){let Be=Me+Oe>>>1;if(Le[Be]<=Re)Me=Be+1;else Oe=Be}return{line:Me+1,column:Ne-Re}}function Pc(i,Ne,Ie,Re,Le){if(Ie.length===Le)return;ji(i,Ne,Ie,Re)}function pr(i,Ne,Ie){let Re=Ie.length;ms(i,Ie);let Le=Gi(Ne).parse(i,kf);if(Ie.length>0)ji(Le,i,Ie,Re);return Le}var Nf={count:0};function ur(i,Ne,Ie,Re,Le){Nf.count+=1;let Me=Re.length;ms(i,Re),gs.sawParenthesized=!1;let Oe=Ac;if(Ie)Tc.startLocation=Pf(i,Ne,Le),Oe=Tc;let Be=Gi(Ie).parseExpressionAt(i,Ne,Oe);Pc(Be,i,Re,Ne,Me);let Fe=Re.length>Me?Re.at(-1):void 0,We=Fe&&Fe.end>(Be.end??0)?Fe.end:Be.end??0;return{node:gs.sawParenthesized?_f(Be):Be,end:We}}function Nc(i,Ne,Ie,Re){let Le=Re.length,Me=Gi(Ie);ms(i,Re);let Oe=new Me(wf,i,Ne);Oe.nextToken();let Be=Oe.parseStatement(null,!0,Object.create(null));return Pc(Be,i,Re,Ne,Le),Be}function kc(i){return i!==null&&typeof i==="object"&&typeof i.type==="string"}function Wi(i){let Ne=i;while(Ne.type==="ParenthesizedExpression"&&Ne.expression)Ne=Ne.expression;return Ne}function _f(i){let Ne=Wi(i);return qi(Ne),Ne}function qi(i){for(let Ne in i){let Ie=i[Ne];if(!Ie||typeof Ie!=="object")continue;if(Array.isArray(Ie))for(let Re=0;Re<Ie.length;Re++){let Le=Ie[Re];if(!kc(Le))continue;let Me=Wi(Le);if(Me!==Le)Ie[Re]=Me;qi(Me)}else if(kc(Ie)){let Re=Wi(Ie);if(Re!==Ie)i[Ne]=Re;qi(Re)}}}function Xn(i){if(i===32||i<=13&&i>=9)return!0;if(i<160)return!1;return i===160||i===5760||i>=8192&&i<=8202||i===8232||i===8233||i===8239||i===8287||i===12288||i===65279}class Ui{source;index=0;constructor(i){this.source=i}match(i){if(i.length===1)return this.source.charCodeAt(this.index)===i.charCodeAt(0);return this.source.startsWith(i,this.index)}matchRegex(i){i.lastIndex=this.index;let Ne=i.exec(this.source);if(!Ne||Ne.index!==this.index)return null;return Ne[0]}eat(i,Ne=!1){if(this.match(i))return this.index+=i.length,!0;if(Ne)throw new jn(`Expected token ${JSON.stringify(i)}`,this.index);return!1}read(i){let Ne=this.matchRegex(i);if(Ne)this.index+=Ne.length;return Ne}readUntil(i){if(this.index>=this.source.length)throw new jn("Unexpected end of input",this.source.length);let Ne=this.index;i.lastIndex=Ne;let Ie=i.exec(this.source);if(Ie)return this.index=Ie.index,this.source.slice(Ne,this.index);return this.index=this.source.length,this.source.slice(Ne)}readUntilString(i){if(this.index>=this.source.length)throw new jn("Unexpected end of input",this.source.length);let Ne=this.source.indexOf(i,this.index),Ie=Ne===-1?this.source.length:Ne,Re=this.source.slice(this.index,Ie);return this.index=Ie,Re}allowWhitespace(){while(this.index<this.source.length&&Xn(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!Xn(this.source.charCodeAt(this.index)))throw new jn("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let i=this.index,Ne=i,Ie="",Re=this.source.codePointAt(this.index);if(Re!==void 0&&Qt(Re,!0)){Ne+=Re<=65535?1:2;while(Ne<this.source.length){let Le=this.source.codePointAt(Ne);if(Le===void 0||!sn(Le,!0))break;Ne+=Le<=65535?1:2}Ie=this.source.slice(i,Ne),this.index=Ne}return{type:"Identifier",name:Ie,start:i,end:Ne}}}class jn extends Error{position;constructor(i,Ne){super(`${i} (at index ${Ne})`);this.name="TemplateSyntaxError",this.position=Ne}}function en(){return{type:"Fragment",nodes:[]}}var Df=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"]),If=["&&","||","??"],Rf=["===","!==","==","!="];function _c(i,Ne){let Ie=i.codePointAt(Ne);if(Ie===void 0||!Qt(Ie,!0))return Ne;let Re=Ne+(Ie<=65535?1:2);while(Re<i.length){let Le=i.codePointAt(Re);if(!sn(Le,!0))break;Re+=Le<=65535?1:2}return Re}function Lf(i,Ne){let Ie=Ne;while(Ie<i.length){let Re=i.charCodeAt(Ie);if(Re<48||Re>57)break;Ie++}return Ie}function xs(i,Ne){let Ie=Ne;while(Ie<i.length&&Xn(i.charCodeAt(Ie)))Ie++;return Ie}function Dc(i,Ne){let Ie=Lf(i,Ne);if(Ie===Ne)return null;if(i.charCodeAt(Ne)===48&&Ie-Ne>1)return null;if(Ie<i.length){let Le=i.codePointAt(Ie);if(Le===46||sn(Le,!0))return null}let Re=i.slice(Ne,Ie);return{type:"Literal",start:Ne,end:Ie,value:Number(Re),raw:Re}}function Ic(i,Ne){let Ie=i.charCodeAt(Ne),Re=Ne+1;while(Re<i.length){let Le=i.charCodeAt(Re);if(Le===Ie){let Me=i.slice(Ne,Re+1);return{type:"Literal",start:Ne,end:Re+1,value:i.slice(Ne+1,Re),raw:Me}}if(Le===92||Le===10||Le===13)return null;Re++}return null}function Of(i,Ne){let Ie=i.charCodeAt(Ne);if(Ie===34||Ie===39)return Ic(i,Ne);let Re=_c(i,Ne);if(Re===Ne)return Dc(i,Ne);let Le=i.slice(Ne,Re);if(Le==="true"||Le==="false")return{type:"Literal",start:Ne,end:Re,value:Le==="true",raw:Le};if(Le==="null")return{type:"Literal",start:Ne,end:Re,value:null,raw:Le};if(Df.has(Le))return null;let Me={type:"Identifier",start:Ne,end:Re,name:Le},Oe=Re;while(Oe<i.length){let Be=i.charCodeAt(Oe);if(Be===46){let Fe=Oe+1,We=_c(i,Fe);if(We===Fe)return null;let Ve={type:"Identifier",start:Fe,end:We,name:i.slice(Fe,We)};Me={type:"MemberExpression",start:Ne,end:We,object:Me,property:Ve,computed:!1,optional:!1},Oe=We}else if(Be===91){let Fe=Oe+1,We=i.charCodeAt(Fe),Ve=We===34||We===39?Ic(i,Fe):Dc(i,Fe);if(!Ve||i.charCodeAt(Ve.end)!==93)return null;Me={type:"MemberExpression",start:Ne,end:Ve.end+1,object:Me,property:Ve,computed:!0,optional:!1},Oe=Ve.end+1}else break}return Me}function Hi(i,Ne){if(i.charCodeAt(Ne)!==33||i.charCodeAt(Ne+1)===61)return Of(i,Ne);let Ie=Hi(i,xs(i,Ne+1));if(!Ie)return null;return{type:"UnaryExpression",start:Ne,end:Ie.end,operator:"!",prefix:!0,argument:Ie}}function Mf(i,Ne){for(let Ie of Rf)if(i.startsWith(Ie,Ne))return{operator:Ie,logical:!1};for(let Ie of If)if(i.startsWith(Ie,Ne))return{operator:Ie,logical:!0};return null}function Rc(i,Ne){let Ie=xs(i,Ne);if(Ie>=i.length)return!1;let Re=i.charCodeAt(Ie);return Re===125||Re===41}function $f(i){let Ne=i.source,Ie=Hi(Ne,i.index);if(!Ie)return null;if(Rc(Ne,Ie.end))return i.index=Ie.end,Ie;let Re=xs(Ne,Ie.end),Le=Mf(Ne,Re);if(!Le)return null;let Me=Hi(Ne,xs(Ne,Re+Le.operator.length));if(!Me||!Rc(Ne,Me.end))return null;return i.index=Me.end,{type:Le.logical?"LogicalExpression":"BinaryExpression",start:Ie.start,end:Me.end,left:Ie,operator:Le.operator,right:Me}}function Ut(i){let Ne=$f(i);if(Ne)return Ne;let{node:Ie,end:Re}=ur(i.source,i.index,i.isTypeScript,i.root.comments,i.lineTable);return i.index=Re,Ie}var Bf={"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},Ki=Bf;var Ff=[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 jf(i,Ne){if(Ne&&!i.endsWith(";"))return`${i}\\b(?!=)`;return i}function Lc(i){let Ie=Object.keys(Ki).map((Re)=>jf(Re,i));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${Ie.join("|")})`,"g")}var zi,Xi;function Vf(i){if(i){if(!Xi)Xi=Lc(!0);return Xi}if(!zi)zi=Lc(!1);return zi}var Oc=0;function Wf(i){if(i===10)return 32;if(i<128)return i;if(i<=159)return Ff[i-128];if(i<55296)return i;if(i<=57343)return Oc;if(i<=65535)return i;if(i>=65536&&i<=131071)return i;if(i>=131072&&i<=196607)return i;if(i>=917504&&i<=917631||i>=917760&&i<=917999)return i;return Oc}function Ji(i,Ne){if(i.indexOf("&")===-1)return i;return i.replace(Vf(Ne),(Ie,Re)=>{let Le;if(Re[0]!=="#")Le=Ki[Re];else if(Re[1]==="x")Le=Number.parseInt(Re.substring(2),16);else Le=Number.parseInt(Re.substring(1),10);if(!Le)return Ie;return String.fromCodePoint(Wf(Le))})}class T extends Error{constructor(i){super(`sveld's template parser doesn't support ${i} yet.`);this.name="TemplateParseNotImplementedError"}}var qf=/<\/script\s*>/g,Gf=/<\/script\s*>/y,Uf=/[^\n]/g,Hf=new Set(["server","client","worker","test","default"]);function Mc(i,Ne,Ie){let Re=i.index,Le=i.readUntil(qf);if(i.index>=i.source.length)throw Error("sveld: unclosed <script> tag");let Me=i.source.slice(0,Re).replace(Uf," ")+Le;i.read(Gf);let Oe=pr(Me,i.isTypeScript,i.root.comments);Oe.start=Re;let Be="default";for(let Fe of Ie){if(Hf.has(Fe.name))throw Error(`sveld: "${Fe.name}" is a reserved <script> attribute name.`);if(Fe.name==="module"){if(Fe.value!==!0)throw Error("sveld: <script module> does not take a value.");Be="module"}if(Fe.name==="context"){let We=Fe.value;if(We===!0||!Array.isArray(We)||We.length!==1||We[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(We[0].data!=="module")throw Error('sveld: only context="module" is valid.');Be="module"}}return{type:"Script",start:Ne,end:i.index,context:Be,content:Oe,attributes:Ie}}function $c(i,Ne,Ie){let Re=i.index,Le=i.source.indexOf("</style",i.index),Me=Le===-1?i.source.length:Le;return i.index=Me,i.eat("</style",!0),i.read(/\s*>/y),{type:"StyleSheet",start:Ne,end:i.index,attributes:Ie,children:[],comments:[],content:{start:Re,end:Me,styles:i.source.slice(Re,Me),comment:null}}}var Kf=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Yi(i){return Kf.has(i)||i.charCodeAt(0)===33&&i.toLowerCase()==="!doctype"}var zf="^[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}]*)?$",Xf=new RegExp(zf,"u");function Bc(i){return Xf.test(i)}var Jf=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,qc=/["']/y,Yf=/(\/>|[\s"'=<>`])/y,Qi=/<\/textarea(\s[^>]*)?>/iy,Qf=/^![a-zA-Z]+$/,Zf=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,eh=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,Gc={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},Fc={...Gc,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function th(i){let Ne=i.charCodeAt(0);if(Ne<97||Ne>122)return!1;for(let Ie=1;Ie<i.length;Ie++){let Re=i.charCodeAt(Ie);if((Re<97||Re>122)&&(Re<48||Re>57))return!1}return!0}function nh(i){if(th(i))return!0;if(Qf.test(i))return!0;if(Zf.test(i))return!0;return Bc(i)}function rh(i){let Ne=i.charCodeAt(0);if(Ne>=97&&Ne<=122&&!i.includes("."))return!1;return!0}function sh(i){return`Svelte${i.slice(7).split("-").map((Ie)=>Ie.charAt(0).toUpperCase()+Ie.slice(1)).join("")}`}function ih(i){for(let Ne=i.length-1;Ne>=0;Ne--){let Ie=i[Ne].type;if(Ie==="SvelteHead")return!0;if(Ie==="RegularElement"||Ie==="Component")return!1}return!1}function oh(i){for(let Ne=i.length-1;Ne>=0;Ne--){let Ie=i[Ne];if(Ie.type==="RegularElement"&&Ie.attributes?.some((Re)=>Re.type==="Attribute"&&Re.name==="shadowrootmode"))return!0}return!1}function jc(i){let{source:Ne,index:Ie}=i;if(Ie>=Ne.length)throw new jn("Unexpected end of input",Ne.length);let Re=Ie;while(Re<Ne.length){let Le=Ne.charCodeAt(Re);if(Le===47||Le===62||Xn(Le))break;Re++}return i.index=Re,{name:Ne.slice(Ie,Re),start:Ie,end:Re}}function Uc(i){let{source:Ne,index:Ie}=i;if(Ie>=Ne.length)throw new jn("Unexpected end of input",Ne.length);let Re=Ie;while(Re<Ne.length){let Le=Ne.charCodeAt(Re);if(Le===61||Le===47||Le===62||Le===34||Le===39||Xn(Le))break;Re++}return i.index=Re,{name:Ne.slice(Ie,Re),start:Ie,end:Re}}function ah(i){let Ne=i.index;if(i.eat("//")){let Ie=i.readUntilString(`
|
|
16
|
-
`),Re=i.index;i.root.comments.push({type:"Line",value:Ie,start:Ne,end:Re});return}if(i.eat("/*")){let Ie=i.readUntilString("*/");i.eat("*/");let Re=i.index;i.root.comments.push({type:"Block",value:Ie,start:Ne,end:Re})}}function ch(i){if(i==="use")return"UseDirective";if(i==="animate")return"AnimateDirective";if(i==="bind")return"BindDirective";if(i==="class")return"ClassDirective";if(i==="style")return"StyleDirective";if(i==="on")return"OnDirective";if(i==="let")return"LetDirective";if(i==="in"||i==="out"||i==="transition")return"TransitionDirective";return!1}function Hc(i,Ne,Ie){let Re={start:i.index,end:-1,type:"Text",raw:"",data:""},Le=[],Me=(Oe)=>{if(Oe>Re.start)Re.raw=i.source.slice(Re.start,Oe),Re.data=Ji(Re.raw,!0),Re.end=Oe,Le.push(Re)};while(i.index<i.source.length){if(Ne())return Me(i.index),Le;if(i.eat("{")){if(i.match("#")||i.match("@"))throw new T("blocks/tags inside attribute value sequences");let Oe=i.index-1;Me(Oe),i.allowWhitespace();let Be=Ut(i);i.allowWhitespace(),i.eat("}",!0),Le.push({type:"ExpressionTag",start:Oe,end:i.index,expression:Be}),Re={start:i.index,end:-1,type:"Text",raw:"",data:""}}else{let Oe=i.index+1;if(Ie!==void 0){let Be=i.source;while(Oe<Be.length){let Fe=Be.charCodeAt(Oe);if(Fe===123||Fe===Ie)break;Oe++}}i.index=Oe}}throw new T("unterminated attribute value / sequence (loose mode)")}function lh(i){let Ne=i.eat("'")?"'":i.eat('"')?'"':null;if(Ne&&i.eat(Ne))return[{start:i.index-1,end:i.index-1,type:"Text",raw:"",data:""}];let Ie=Hc(i,()=>{if(Ne)return i.match(Ne);return!!i.matchRegex(Yf)},Ne===null?void 0:Ne.charCodeAt(0));if(Ie.length===0&&!Ne)throw Error("sveld: expected attribute value");if(Ne)i.index+=1;if(Ne||Ie.length>1||Ie[0].type==="Text")return Ie;return Ie[0]}function Zi(i,Ne,Ie,Re){return{type:"Attribute",start:Ne,end:Ie,name:i,value:Re}}function ph(i){let Ne=i.index,Ie=Uc(i);if(!Ie.name)return null;let Re=!0;if(i.eat("=")){i.allowWhitespace();let Le=i.matchRegex(Jf);if(!Le)throw Error("sveld: expected attribute value");i.index+=Le.length;let Me=Le[0]==='"'||Le[0]==="'";if(Me)Le=Le.slice(1,-1);Re=[{start:i.index-Le.length-(Me?1:0),end:Me?i.index-1:i.index,type:"Text",raw:Le,data:Ji(Le,!0)}]}if(i.matchRegex(qc))throw Error("sveld: expected '='");return Zi(Ie.name,Ne,i.index,Re)}function uh(i){while(!0){let Be=i.index;if(ah(i),i.index===Be)break;i.allowWhitespace()}let Ne=i.index;if(i.eat("{")){if(i.allowWhitespace(),i.eat("@attach")){i.requireWhitespace();let We=Ut(i);return i.allowWhitespace(),i.eat("}",!0),{type:"AttachTag",start:Ne,end:i.index,expression:We}}if(i.eat("...")){let We=Ut(i);return i.allowWhitespace(),i.eat("}",!0),{type:"SpreadAttribute",start:Ne,end:i.index,expression:We}}let Be=i.readIdentifierName();if(Be.name==="")throw Error("sveld: empty attribute shorthand");i.allowWhitespace(),i.eat("}",!0);let Fe={type:"ExpressionTag",start:Be.start,end:Be.end,expression:Be};return Zi(Be.name,Ne,i.index,Fe)}let Ie=Uc(i);if(!Ie.name)return null;let Re=i.index;i.allowWhitespace();let Le=Ie.name.indexOf(":"),Me=Le!==-1&&ch(Ie.name.slice(0,Le)),Oe=!0;if(i.eat("="))if(i.allowWhitespace(),i.source[i.index]==="/"&&i.source[i.index+1]===">"){let Be=i.index;i.index++,Oe=[{start:Be,end:Be+1,type:"Text",raw:"/",data:"/"}],Re=i.index}else Oe=lh(i),Re=i.index;else if(i.matchRegex(qc))throw Error("sveld: expected '='");if(Me){let Be=Ie.name.slice(Le+1).split("|",1)[0];if(Be==="")throw Error("sveld: directive missing a name");if(Me==="StyleDirective")return{start:Ne,end:Re,type:Me,name:Be,value:Oe};let Fe=Oe===!0?void 0:Array.isArray(Oe)?Oe[0]:Oe,We=null;if(Fe){if((Array.isArray(Oe)?Oe.length>1:!1)||Fe.type==="Text")throw Error("sveld: directive value must be a single expression");We=Fe.expression}let Ve={start:Ne,end:Re,type:Me,name:Be,expression:We};if((Ve.type==="BindDirective"||Ve.type==="ClassDirective")&&!Ve.expression)Ve.expression={start:Ne+Le+1,end:Re,type:"Identifier",name:Ve.name};return Ve}return Zi(Ie.name,Ne,Re,Oe)}function Kc(i){let Ne=i.index++,Ie=i.current();if(i.eat("!--")){let Ke=i.readUntilString("-->");i.eat("-->",!0),i.append({type:"Comment",start:Ne,end:i.index,data:Ke});return}if(i.eat("/")){let{name:Ke}=jc(i);if(i.allowWhitespace(),i.eat(">",!0),Yi(Ke))throw Error(`sveld: <${Ke}> is a void element and cannot have a closing tag`);while(Ie.name!==Ke){if(Ie.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${Ke}>`);Ie.end=Ne,i.pop(),Ie=i.current()}if(Ie.end=i.index,i.pop(),i.lastAutoClosedTag&&i.stack.length<i.lastAutoClosedTag.depth)i.lastAutoClosedTag=void 0;return}let Re=jc(i),Le=rh(Re.name)&&eh.test(Re.name);if(!nh(Re.name)&&!Le)throw Error(`sveld: "${Re.name}" is not a valid element or component name`);if(Re.name in Gc&&Ie.type!=="Root")throw Error(`sveld: <${Re.name}> must be a top-level element`);let Me;if(Re.name in Fc)Me=Fc[Re.name];else if(Re.name.startsWith("svelte:"))Me=sh(Re.name);else if(Le)Me="Component";else if(Re.name==="title"&&ih(i.stack))Me="TitleElement";else if(Re.name==="slot"&&!oh(i.stack))Me="SlotElement";else Me="RegularElement";let Oe={type:Me,start:Ne,end:-1,name:Re.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(i.allowWhitespace(),Ie.type==="RegularElement"&&ba(Ie.name,Re.name))Ie.end=Ne,i.pop(),i.lastAutoClosedTag={tag:Ie.name,reason:Re.name,depth:i.stack.length},Ie=i.current();let Be=i.current(),Fe=(Re.name==="script"||Re.name==="style")&&Be.type==="Root",We=Fe?ph:uh,Ve;while(Ve=We(i))Oe.attributes.push(Ve),i.allowWhitespace();if(Oe.type==="SvelteComponent")Oe.expression=Wc(Vc(Oe));if(Oe.type==="SvelteElement"){let Ke=Vc(Oe);if(Ke.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(dh(Ke))Oe.tag=Wc(Ke);else{let ze=Ke.value[0];Oe.tag=ze.type==="Text"?{type:"Literal",value:ze.data,raw:`'${ze.raw}'`,start:ze.start,end:ze.end}:ze.expression}}if(Fe){if(i.eat(">",!0),Re.name==="script"){let Ke=Mc(i,Ne,Oe.attributes);if(Ke.context==="module"){if(i.root.module)throw Error("sveld: duplicate <script module>");i.root.module=Ke}else{if(i.root.instance)throw Error("sveld: duplicate <script>");i.root.instance=Ke}}else{if(i.root.css)throw Error("sveld: duplicate <style>");i.root.css=$c(i,Ne,Oe.attributes)}return}i.append(Oe);let Ge=i.eat("/")||Yi(Re.name);if(i.eat(">",!0),Ge)Oe.end=i.index;else if(Re.name==="textarea")Oe.fragment.nodes=Hc(i,()=>(Qi.lastIndex=i.index,Qi.test(i.source))),i.read(Qi),Oe.end=i.index;else i.push(Oe,Oe.fragment)}function Vc(i){let Ne=i.attributes,Ie=Ne.findIndex((Re)=>Re.type==="Attribute"&&Re.name==="this");if(Ie===-1)throw Error(`sveld: <${i.name}> requires a \`this\` attribute`);return Ne.splice(Ie,1)[0]}function Wc(i){return Array.isArray(i.value)?i.value[0].expression:i.value.expression}function dh(i){return i.value!==!0&&!Array.isArray(i.value)||Array.isArray(i.value)&&i.value.length===1&&i.value[0].type==="ExpressionTag"}function zc(i){let Ne={start:i.start,end:i.end,attributes:i.attributes};for(let Ie of i.attributes){if(Ie.type!=="Attribute")continue;if(Ie.name==="runes"){let Re=Xc(Ie);if(typeof Re==="boolean")Ne.runes=Re}if(Ie.name==="customElement"){let Re=mh(Ie);if(Re!==void 0)Ne.customElement=Re}}return Ne}function Xc(i){let{value:Ne}=i;if(Ne===!0)return!0;let Ie=Array.isArray(Ne)?Ne[0]:Ne;if(!Ie)return!0;if(Array.isArray(Ne)&&Ne.length>1)return null;if(Ie.type==="Text")return Ie.data;if(Ie.expression.type!=="Literal")return null;return Ie.expression.value}var fh=new Set(["String","Boolean","Number","Array","Object"]);function eo(i){let Ne=[];for(let Ie of i.properties){if(!Ie||typeof Ie!=="object"||Ie.type!=="Property"||Ie.computed||Ie.key?.type!=="Identifier")continue;let{key:Re,value:Le}=Ie;Ne.push([Re.name,Le])}return Ne}function hh(i){let Ne={};if(!i||typeof i!=="object"||i.type!=="ObjectExpression")return Ne;for(let[Ie,Re]of eo(i)){if(!Re||typeof Re!=="object"||Re.type!=="Literal")continue;let Le=Re.value;if(Ie==="attribute"&&typeof Le==="string")Ne.attribute=Le;else if(Ie==="reflect"&&typeof Le==="boolean")Ne.reflect=Le;else if(Ie==="type"&&typeof Le==="string"&&fh.has(Le))Ne.type=Le}return Ne}function mh(i){let{value:Ne}=i;if(Ne===!0)return;let Ie=Array.isArray(Ne)?Ne[0]:Ne;if(!Ie)return;if(Ie.type==="Text"){let Ve=Xc(i);return typeof Ve==="string"?{tag:Ve}:void 0}let Re=Ie.expression;if(Re.type==="Literal"&&Re.value===null)return;if(Re.type!=="ObjectExpression")return;let Le=eo(Re),Me={},Oe=Le.find(([Ve])=>Ve==="tag")?.[1];if(Oe&&typeof Oe==="object"&&Oe.type==="Literal"&&typeof Oe.value==="string")Me.tag=Oe.value;let Be=Le.find(([Ve])=>Ve==="props")?.[1];if(Be&&typeof Be==="object"&&Be.type==="ObjectExpression"){Me.props={};for(let[Ve,Ge]of eo(Be))Me.props[Ve]=hh(Ge)}let Fe=Le.find(([Ve])=>Ve==="shadow")?.[1];if(Fe&&typeof Fe==="object"){let Ve=Fe;if(Ve.type==="Literal"&&(Ve.value==="open"||Ve.value==="none"))Me.shadow=Ve.value;else if(Ve.type==="ObjectExpression")Me.shadow=Fe}let We=Le.find(([Ve])=>Ve==="extend")?.[1];if(We!==void 0)Me.extend=We;return Me}var yh=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class to extends Ui{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(i,Ne){super(i);this.isTypeScript=yh.test(i);let Ie=en();this.root={type:"Root",start:0,end:Ne,css:null,js:[],options:null,fragment:Ie,comments:[]},this.stack.push(this.root),this.fragments.push(Ie)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(i,Ne){this.stack.push(i),this.fragments.push(Ne)}pop(){return this.fragments.pop(),this.stack.pop()}append(i){return this.currentFragment().nodes.push(i),i}}var no={"{":"}","(":")","[":"]"},gh=new Set(Object.values(no));function Lr(i,Ne,Ie=no){let Re=Ie===no?gh:new Set(Object.values(Ie)),Le=[],Me=Ne;while(Me<i.source.length){let Oe=i.source[Me++];if(Oe==="'"||Oe==='"'||Oe==="`"){Me=xh(i,Me,Oe);continue}if(Object.hasOwn(Ie,Oe))Le.push(Oe);else if(Re.has(Oe)){let Be=Le.pop(),Fe=Be?Ie[Be]:void 0;if(Oe!==Fe)throw Error(`sveld: expected "${Fe}"`);if(Le.length===0)return Me}}throw Error("sveld: unexpected end of input")}function xh(i,Ne,Ie){let Re=!1,Le=Ne;while(Le<i.source.length){let Me=i.source[Le++];if(Re){Re=!1;continue}if(Me===Ie)return Le;if(Me==="\\")Re=!0;if(Ie==="`"&&Me==="$"&&i.source[Le]==="{")Le=Lr(i,Le)}throw Error("sveld: unterminated string constant")}var Yc=/[^\n]/g,bh=/\?\s*:/g;function Vn(i){let Ne=i.index,Ie=i.readIdentifierName();if(Ie.name!==""){let Ke=Jc(i);return{...Ie,typeAnnotation:Ke}}let Re=i.source[i.index];if(Re!=="{"&&Re!=="[")throw Error("sveld: expected a binding pattern");let Le=Lr(i,Ne);i.index=Le;let Me=i.source.slice(Ne,Le),Oe=i.source.slice(0,Ne).replace(Yc," "),Be=Oe.indexOf(" ");Oe=Oe.slice(0,Be)+Oe.slice(Be+1);let Fe=`${Oe}(${Me} = 1)`,{node:We}=ur(Fe,Ne-1,i.isTypeScript,i.root.comments),Ve=We.left,Ge=Jc(i);if(Ge)Ve.typeAnnotation=Ge,Ve.end=Ge.end;return Ve}function Jc(i){let Ne=i.index;if(i.allowWhitespace(),!i.eat(":")){i.index=Ne;return}let Ie="_ as ",Re=i.index-Ie.length,Le=i.source.slice(0,Re).replace(Yc," ")+Ie+i.source.slice(i.index).replace(bh,":"),{node:Me}=ur(Le,Re,i.isTypeScript,i.root.comments),Oe=Me;if(Oe.type==="AssignmentExpression"){let Be=Oe.right.start;while(Le[Be]!=="=")Be-=1;({node:Me}=ur(Le.slice(0,Be),Re,i.isTypeScript,i.root.comments)),Oe=Me}if(Oe.type==="SequenceExpression"&&Oe.expressions)Oe=Oe.expressions[0];return i.index=Oe.end,{type:"TSTypeAnnotation",start:Ne,end:i.index,typeAnnotation:Oe.typeAnnotation}}var Qc=/\s*}/y,Eh={"<":">"};function Zc(i){let Ne=i.index-2;while(i.source[Ne]!=="{")Ne-=1;if(i.eat("if")){i.requireWhitespace();let Ie={type:"IfBlock",elseif:!1,start:Ne,end:-1,test:Ut(i),consequent:en(),alternate:null};i.append(Ie),i.allowWhitespace(),i.eat("}",!0),i.push(Ie,Ie.consequent);return}if(i.eat("each")){i.requireWhitespace();let Ie=Ut(i);if(i.allowWhitespace(),!i.match("as")){let Be=Ie;if(Be.type==="SequenceExpression"&&Be.expressions)Be=Be.expressions[0];if(Be.type==="TSAsExpression"){let Fe=Be;Ie=Fe.expression;let We=Fe.typeAnnotation.start-2;while(We>=0&&!(i.source[We]==="a"&&i.source[We+1]==="s"))We-=1;i.index=We}}let Re=null,Le,Me;if(i.eat("as"))i.requireWhitespace(),Re=Vn(i);if(i.allowWhitespace(),i.eat(",")){i.allowWhitespace();let Be=i.readIdentifierName();if(!Be.name)throw Error("sveld: expected an identifier");Le=Be.name,i.allowWhitespace()}if(i.eat("("))i.allowWhitespace(),Me=Ut(i),i.allowWhitespace(),i.eat(")",!0),i.allowWhitespace();i.eat("}",!0);let Oe={type:"EachBlock",start:Ne,end:-1,expression:Ie,body:en(),context:Re,index:Le,key:Me};i.append(Oe),i.push(Oe,Oe.body);return}if(i.eat("await")){i.requireWhitespace();let Ie=Ut(i);i.allowWhitespace();let Re={type:"AwaitBlock",start:Ne,end:-1,expression:Ie,value:null,error:null,pending:null,then:null,catch:null};if(i.eat("then")){if(!i.matchRegex(Qc))i.requireWhitespace(),Re.value=Vn(i),i.allowWhitespace();Re.then=en()}else if(i.eat("catch")){if(!i.matchRegex(Qc))i.requireWhitespace(),Re.error=Vn(i),i.allowWhitespace();Re.catch=en()}else Re.pending=en();i.eat("}",!0),i.append(Re),i.push(Re,Re.then??Re.catch??Re.pending);return}if(i.eat("key")){i.requireWhitespace();let Ie=Ut(i);i.allowWhitespace(),i.eat("}",!0);let Re={type:"KeyBlock",start:Ne,end:-1,expression:Ie,fragment:en()};i.append(Re),i.push(Re,Re.fragment);return}if(i.eat("snippet")){i.requireWhitespace();let Ie=i.readIdentifierName();if(Ie.name==="")throw Error("sveld: expected a snippet name");i.allowWhitespace();let Re;if(i.isTypeScript&&i.match("<")){let Me=i.index,Oe=Lr(i,Me,Eh);Re=i.source.slice(Me+1,Oe-1),i.index=Oe}if(i.allowWhitespace(),i.eat("(")){let Me=1;while(i.index<i.source.length&&(!i.match(")")||Me!==1)){if(i.match("("))Me++;if(i.match(")"))Me--;i.index+=1}i.eat(")",!0)}i.allowWhitespace(),i.eat("}",!0);let Le={type:"SnippetBlock",start:Ne,end:-1,expression:Ie,typeParams:Re,parameters:[],body:en()};i.append(Le),i.push(Le,Le.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function el(i){let Ne=i.index-1,Ie=i.current();if(Ie.type==="IfBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(i.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(i.allowWhitespace(),i.fragments.pop(),Ie.alternate=en(),i.fragments.push(Ie.alternate),i.eat("if")){i.requireWhitespace();let Re=Ut(i);i.allowWhitespace(),i.eat("}",!0);let Le=Ne-1;while(i.source[Le]!=="{")Le-=1;let Me={type:"IfBlock",start:Le,end:-1,elseif:!0,test:Re,consequent:en(),alternate:null};i.append(Me),i.stack.push(Me),i.fragments.pop(),i.fragments.push(Me.consequent)}else i.allowWhitespace(),i.eat("}",!0);return}if(Ie.type==="EachBlock"){if(!i.eat("else"))throw Error("sveld: expected {:else}");i.allowWhitespace(),i.eat("}",!0),Ie.fallback=en(),i.fragments.pop(),i.fragments.push(Ie.fallback);return}if(Ie.type==="AwaitBlock"){if(i.eat("then")){if(Ie.then)throw Error("sveld: duplicate {:then}");if(!i.eat("}"))i.requireWhitespace(),Ie.value=Vn(i),i.allowWhitespace(),i.eat("}",!0);Ie.then=en(),i.fragments.pop(),i.fragments.push(Ie.then);return}if(i.eat("catch")){if(Ie.catch)throw Error("sveld: duplicate {:catch}");if(!i.eat("}"))i.requireWhitespace(),Ie.error=Vn(i),i.allowWhitespace(),i.eat("}",!0);Ie.catch=en(),i.fragments.pop(),i.fragments.push(Ie.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function tl(i){let Ne=i.current();switch(Ne.type){case"IfBlock":{i.eat("if",!0),i.allowWhitespace(),i.eat("}",!0);while(Ne.type==="IfBlock"&&Ne.elseif)Ne.end=i.index,i.stack.pop(),Ne=i.current();Ne.end=i.index,i.pop();return}case"EachBlock":i.eat("each",!0);break;case"KeyBlock":i.eat("key",!0);break;case"AwaitBlock":i.eat("await",!0);break;case"SnippetBlock":i.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}i.allowWhitespace(),i.eat("}",!0),Ne.end=i.index,i.pop()}var Ch=/(?:let|const)\b/y,vh=/(?:var|interface|enum)\b/y,Sh=/type\b/y;function nl(i){let Ne=i.index;if(i.matchRegex(vh))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!i.matchRegex(Ch)&&!i.matchRegex(Sh))return null;let Ie=i.root.comments.length,Re=Nc(i.source,Ne,i.isTypeScript,i.root.comments);if(Re.type!=="VariableDeclaration"){if(Re.type==="ExpressionStatement")return i.root.comments.length=Ie,null;throw Error("sveld: expected a `let`/`const` declaration")}if(Re.kind!=="let"&&Re.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return i.index=Re.end,i.allowWhitespace(),i.eat("}",!0),Re}var Th=/\s*}/y;function rl(i){let Ne=i.index;while(i.source[Ne]!=="{")Ne-=1;if(i.eat("html")){i.requireWhitespace();let Ie=Ut(i);i.allowWhitespace(),i.eat("}",!0);let Re={type:"HtmlTag",start:Ne,end:i.index,expression:Ie};i.append(Re);return}if(i.eat("debug")){let Ie;if(i.read(Th))Ie=[];else{let Le=Ut(i);Ie=Le.type==="SequenceExpression"?Le.expressions:[Le];for(let Me of Ie)if(Me.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");i.allowWhitespace(),i.eat("}",!0)}let Re={type:"DebugTag",start:Ne,end:i.index,identifiers:Ie};i.append(Re);return}if(i.eat("const")){i.requireWhitespace();let Ie=Vn(i);i.allowWhitespace(),i.eat("=",!0),i.allowWhitespace();let Re=Ut(i),Le=i.index;i.allowWhitespace(),i.eat("}",!0);let Me={type:"VariableDeclarator",id:Ie,init:Re,start:Ie.start,end:Le},Oe={type:"ConstTag",start:Ne,end:i.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[Me],start:Ne+2,end:i.index-1}};i.append(Oe);return}if(i.eat("render")){i.requireWhitespace();let Ie=Ut(i);if(!(Ie.type==="CallExpression"||Ie.type==="ChainExpression"&&Ie.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");i.allowWhitespace(),i.eat("}",!0);let Le={type:"RenderTag",start:Ne,end:i.index,expression:Ie};i.append(Le);return}throw Error("sveld: expected html/debug/const/render")}function sl(i){let Ne=i.index;if(i.index+=1,i.allowWhitespace(),i.eat("#")){Zc(i);return}if(i.eat(":")){el(i);return}if(i.eat("@")){rl(i);return}if(i.match("/")&&!i.match("/*")&&!i.match("//")){i.eat("/"),tl(i);return}let Ie=nl(i);if(Ie){let Me={type:"DeclarationTag",start:Ne,end:i.index,declaration:Ie};i.append(Me);return}let Re=Ut(i);i.allowWhitespace(),i.eat("}",!0);let Le={type:"ExpressionTag",start:Ne,end:i.index,expression:Re};i.append(Le)}function il(i){let{index:Ne,source:Ie}=i,Re=Ie.indexOf("<",Ne),Le=Ie.indexOf("{",Ne),Me;if(Re===-1)Me=Le===-1?Ie.length:Le;else Me=Le===-1?Re:Math.min(Re,Le);i.index=Me;let Oe=Ie.slice(Ne,Me),Be={type:"Text",start:Ne,end:i.index,raw:Oe,data:Oe};i.append(Be)}function A(i){let Ne=i.trimEnd(),Ie=new to(Ne,i.length);while(Ie.index<Ie.source.length)if(Ie.match("<"))Kc(Ie);else if(Ie.match("{"))sl(Ie);else il(Ie);let Re=Ie.root.fragment.nodes.findIndex((Le)=>Le.type==="SvelteOptions");if(Re!==-1){let[Le]=Ie.root.fragment.nodes.splice(Re,1);Ie.root.options=zc(Le)}return Ie.root}function Ot(i){return typeof i==="object"&&i!==null}function oe(i){return Ot(i)&&i.type==="VariableDeclaration"&&Array.isArray(i.declarations)}function f(i){return Ot(i)&&i.type==="Literal"}function s(i){return Ot(i)&&i.type==="Identifier"&&typeof i.name==="string"}function ae(i){return Ot(i)&&i.type==="MemberExpression"}function Dn(i){return Ot(i)&&i.type==="ObjectExpression"&&Array.isArray(i.properties)}function kh(i){return Ot(i)&&i.type==="CallExpression"}function p(i,Ne){if(!kh(i))return!1;return!!i.callee&&Ot(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===Ne}function d(i){if(Ot(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"expression"in i)return d(i.expression);return i}function ce(i){if(Ot(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"typeAnnotation"in i)return i.typeAnnotation;return}function wh(i){return Ot(i)&&i.type==="NewExpression"}function ro(i,Ne){if(!wh(i))return!1;return!!i.callee&&Ot(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===Ne}function Jn(i){if(!Ot(i)||typeof i.type!=="string")return null;if(i.type==="Literal"){let Ne=i.value;if(typeof Ne==="string")return Ne;return Ne==null?null:String(Ne)}if(i.type==="TemplateLiteral"){let Ne=i.quasis;if(Ne?.length===1){let Ie=Ne[0]?.value?.cooked;return Ie==null?null:Ie}}return null}var g=Symbol("sveld.parsedComponentTypeScriptMetadata");function Cn(i){return i[g]}function ol(i,Ne){if(Ne.length===0)return;let Ie=new Set(i.props.map((Re)=>Re.name));for(let Re of Ne){if(Ie.has(Re.name))continue;Ie.add(Re.name),i.props.push({name:Re.name,kind:"let",constant:!1,type:Re.type,typeSource:"typescript",...Re.description?{description:Re.description}:{},isFunction:Re.type.includes("=>"),isFunctionDeclaration:!1,isRequired:Re.isRequired,reactive:!1})}}var Ah=/\w/;function Ph(i,Ne){let Ie=i.trim();if(!Ie.startsWith("{")||!Ie.endsWith("}"))return;let Re=Ie.slice(1,-1),Le=[],Me=0,Oe="";for(let Be of Re)if(Be==="{"||Be==="<"||Be==="("||Be==="[")Me++,Oe+=Be;else if(Be==="}"||Be===">"||Be===")"||Be==="]")Me--,Oe+=Be;else if((Be===";"||Be===",")&&Me===0)Le.push(Oe.trim()),Oe="";else Oe+=Be;if(Oe.trim())Le.push(Oe.trim());for(let Be of Le){if(!Be.startsWith(Ne))continue;let Fe=Be.slice(Ne.length);if(Fe.length>0&&Ah.test(Fe[0]))continue;let We=Fe.trimStart();if(We.startsWith("?"))We=We.slice(1).trimStart();if(We.startsWith(":"))return We.slice(1).trim()}return}function B(i,Ne,Ie){let Re=Ie;if(Re.computed||Re.object?.type!=="Identifier"||Re.property?.type!=="Identifier")return;let Le=Re.object.name,Me=Re.property.name;if(!Le||!Me)return;if(i.wholePropsLocals.has(Le))return Ne.getPropTypeByLocalOrPublic(Me);let Oe=Ne.getPropTypeByLocalOrPublic(Le)??Ne.findVariableTypeAndDescription(Le)?.type;if(!Oe)return;return Ph(Oe,Me)}function Nh(i){let Ne="";for(let Ie=0;Ie<i.length;Ie++){let Re=i[Ie];if(Re==="*"&&i[Ie+1]==="*"){if(Ne+=".*",Ie++,i[Ie+1]==="/")Ie++;continue}if(Re==="*"){Ne+="[^/]*";continue}if(Re==="?"){Ne+="[^/]";continue}Ne+=".+^$()[]{}|\\".includes(Re)?`\\${Re}`:Re}return Ne}function al(i,Ne){return new RegExp(`^${Nh(i)}$`).test(Ne)}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","module-export-conflict":"sveld/module-export-conflict","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","event-description-ambiguous":"sveld/event-description-ambiguous","jsdoc-tag-dropped":"sveld/jsdoc-tag-dropped","internal-typedef-referenced":"sveld/internal-typedef-referenced","types-inline-unresolved":"sveld/types-inline-unresolved"},_h={"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","module-export-conflict":"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","event-description-ambiguous":"warning","jsdoc-tag-dropped":"warning","internal-typedef-referenced":"error","types-inline-unresolved":"warning"};function xn(i){return{...i,code:j[i.kind],severity:_h[i.kind]}}function F(i,Ne){if(Ne)return i;return i.filter((Ie)=>Ie.kind!=="jsdoc-unknown-tag")}function J(i,Ne){if(!Ne)return[];return i.filter((Ie)=>!Ie.ignored&&(Ne!=="errors"||Ie.severity==="error"))}function Dh(i,Ne){if(Ne.code!==void 0&&Ne.code!==i.code)return!1;if(Ne.name!==void 0&&Ne.name!==i.name)return!1;if(Ne.component!==void 0&&!al(Ne.component,i.component))return!1;return!0}function cl(i,Ne){if(!Ne||Ne.length===0)return i;return i.map((Ie)=>Ie.ignored||Ne.some((Re)=>Dh(Ie,Re))?{...Ie,ignored:!0}:Ie)}var Ih={"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","module-export-conflict":"Module-script exports colliding with generated names","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","event-description-ambiguous":"Text after an @event read as the next tag's description","jsdoc-tag-dropped":"Passthrough JSDoc tags that couldn't attach","internal-typedef-referenced":"Public types referencing an @internal typedef","types-inline-unresolved":"typesOptions.inline could not safely copy an imported type"},Rh=["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","module-export-conflict","extend-props-target-missing","extend-props-duplicate","extend-props-override","jsdoc-unknown-tag","typedef-duplicate","property-duplicate","generics-conflict","event-description-ambiguous","jsdoc-tag-dropped","internal-typedef-referenced","types-inline-unresolved"];function bs(i){let Ne=new Set,Ie=[];for(let Re of i){let Le=`${Re.component}:${Re.kind}:${Re.name}`;if(Ne.has(Le))continue;Ne.add(Le),Ie.push(Re)}return Ie}function q(i){let Ne=i.filter((Oe)=>!Oe.ignored),Ie=i.length-Ne.length,Re=Ie>0?` (${Ie} ignored)`:"";if(Ne.length===0)return`sveld: all types resolved${Re}.`;let Le=[],Me=Ne.length;Le.push(`sveld: ${Me} unresolved type${Me===1?"":"s"} found${Re}.`);for(let Oe of Rh){let Be=Ne.filter((We)=>We.kind===Oe);if(Be.length===0)continue;Le.push(""),Le.push(`${Ih[Oe]} (${Be.length}):`);let Fe=new Map;for(let We of Be){let Ve=Fe.get(We.component)??[];Ve.push(We),Fe.set(We.component,Ve)}for(let[We,Ve]of Fe){Le.push(` ${We}`);for(let Ge of Ve){let Ke=Ge.source?` (${We}:${Ge.source.start.line}:${Ge.source.start.column})`:"";Le.push(` - ${Ge.message}${Ke} [${Ge.code}]`)}}}return Le.join(`
|
|
17
|
-
`)}var ue=1;function V(i){return`${JSON.stringify({kind:"diagnostics",schemaVersion:ue,diagnostics:i},null,2)}
|
|
18
|
-
`}function r(i,Ne,Ie,Re,Le){i.diagnosticRecords.push(xn({component:i.componentFilePath,kind:Ne,name:Ie,message:Re,...Le?{source:Le}:{},...Lh(i,Ne,Ie)?{ignored:!0}:{}}))}function ll(i,Ne){return`${i}:${Ne}`}function m(i,Ne,Ie,Re){if(!Re||Re.length===0)return;let Le=ll(Ne,Ie),Me=i.sveldIgnoreDirectives.get(Le)??new Set;for(let Oe of Re)Me.add(Oe);i.sveldIgnoreDirectives.set(Le,Me)}function Lh(i,Ne,Ie){let Re=i.sveldIgnoreDirectives.get(ll(Ne,Ie));if(!Re)return!1;return Re.has("")||Re.has(j[Ne])}var so=/[\r\n]+/g;function Oh(i){if(i.sourceLineStartOffsetsCache)return i.sourceLineStartOffsetsCache;let Ne=[0];if(i.source){let Ie=i.source.indexOf(`
|
|
19
|
-
`);while(Ie!==-1)Ne.push(Ie+1),Ie=i.source.indexOf(`
|
|
20
|
-
`,Ie+1)}return i.sourceLineStartOffsetsCache=Ne,Ne}function pl(i,Ne){if(!i.source||Ne<0||Ne>i.source.length)return;let Ie=Oh(i),Re=i.sourceLineHint;if(Re!==void 0)for(let Oe=Re;Oe<=Re+1&&Oe<Ie.length;Oe++){let Be=Ie[Oe],Fe=Ie[Oe+1]??Number.POSITIVE_INFINITY;if(Ne>=Be&&Ne<Fe)return i.sourceLineHint=Oe,{line:Oe+1,column:Ne-Be}}let Le=0,Me=Ie.length-1;while(Le<=Me){let Oe=Le+Me>>>1,Be=Ie[Oe],Fe=Ie[Oe+1]??Number.POSITIVE_INFINITY;if(Ne<Be)Me=Oe-1;else if(Ne>=Fe)Le=Oe+1;else return i.sourceLineHint=Oe,{line:Oe+1,column:Ne-Be}}return}function U(i,Ne,Ie){if(Ne===void 0||Ie===void 0||Ie<Ne)return;let Re=pl(i,Ne),Le=pl(i,Ie);if(!Re||!Le)return;return{start:Re,end:Le}}function t(i,Ne){if(!Ne||typeof Ne!=="object")return;let Ie="start"in Ne&&typeof Ne.start==="number"?Ne.start:void 0,Re="end"in Ne&&typeof Ne.end==="number"?Ne.end:void 0;return U(i,Ie,Re)}function pn(i,Ne){if(!Ne||Ne.length===0)return;let Ie=[...Ne];while(Ie.length>1){let Fe=Ie[Ie.length-1];if(Fe.tag!==void 0||!Fe.raw.trim().endsWith("*/"))break;Ie.pop()}let Re=Ie[0],Le=Re.raw.indexOf(`@${Re.tag??""}`),Me=Re.start+Math.max(Le,0),Oe=Ie[Ie.length-1],Be=Oe.start+Oe.raw.length;return U(i,Me,Be)}function n(i,Ne,Ie){return i.source?.slice(Ne,Ie)}function Es(i,Ne){if(!Ne||typeof Ne!=="object")return;let Ie="start"in Ne&&typeof Ne.start==="number"?Ne.start:void 0,Re="end"in Ne&&typeof Ne.end==="number"?Ne.end:void 0;if(Ie===void 0||Re===void 0)return;return n(i,Ie,Re)?.replace(so," ")}function u(i){return i===void 0||i===""?void 0:i}function R(i,Ne,Ie,Re){if(u(Ie)===void 0)return;if(i.trackPropLocalName(Ie),Ne.props.has(Ie)){let Le=Ne.props.get(Ie);Ne.props.set(Ie,{...Le,...Re})}else Ne.props.set(Ie,Re)}function h(i,Ne,Ie,Re=0){let Le,Me,Oe=!1;if(!Ie||typeof Ie!=="object"||!("type"in Ie))return{value:Le,type:Me,isFunction:Oe};let Be=dl(i,Ne,Ie);if(Ie.type==="ObjectExpression"||Ie.type==="BinaryExpression"||Ie.type==="ArrayExpression"||Ie.type==="ArrowFunctionExpression"||Ie.type==="FunctionExpression"){let Fe=Ie;if("start"in Fe&&"end"in Fe&&typeof Fe.start==="number"&&typeof Fe.end==="number")Le=n(Ne,Fe.start,Fe.end)?.replace(so," ");if(Me=Le,Oe=Ie.type==="ArrowFunctionExpression"||Ie.type==="FunctionExpression",Ie.type==="BinaryExpression"){let We=Ie;if(We.left&&typeof We.left==="object"&&"type"in We.left&&We.left.type==="Literal"&&"value"in We.left&&typeof We.left.value==="string")Me="string"}if(Ie.type==="ArrowFunctionExpression"||Ie.type==="FunctionExpression")Me=ml(Ie),Le=ul(Ne,Ie)}else if(Ie.type==="UnaryExpression"){let Fe=Ie;if("start"in Fe&&"end"in Fe&&typeof Fe.start==="number"&&typeof Fe.end==="number")Le=n(Ne,Fe.start,Fe.end);if(Fe.argument){if(typeof Fe.argument==="object"&&"type"in Fe.argument&&Fe.argument.type==="UnaryExpression")Me=h(i,Ne,Fe.argument).type;else if(typeof Fe.argument==="object"&&"value"in Fe.argument)Me=typeof Fe.argument.value}}else if(Ie.type==="NewExpression"){let Fe=Ie;if("start"in Fe&&"end"in Fe&&typeof Fe.start==="number"&&typeof Fe.end==="number")Le=n(Ne,Fe.start,Fe.end);if(Fe.callee&&typeof Fe.callee==="object"&&"type"in Fe.callee&&Fe.callee.type==="Identifier"){let We=Fe.callee.name;if(We==="Date")Me="Date";else if(We==="Map")Me="Map<any, any>";else if(We==="Set")Me="Set<any>";else if(We==="WeakMap")Me="WeakMap<object, any>";else if(We==="WeakSet")Me="WeakSet<object>";else if(We==="Array")Me="any[]";else if(We==="RegExp"||We==="Regexp")Me="RegExp";else if(We==="Error")Me="Error";else Me=We}}else if(Ie.type==="CallExpression"){let Fe=Ie;if("start"in Fe&&"end"in Fe&&typeof Fe.start==="number"&&typeof Fe.end==="number")Le=n(Ne,Fe.start,Fe.end);let We=Fe.callee,Ve=We&&typeof We==="object"&&"type"in We&&We.type==="Identifier"?We.name:void 0;if((Ve==="$derived"||Ve==="$state")&&Fe.arguments.length===1&&Re<5)return{...h(i,Ne,Fe.arguments[0],Re+1),value:Le,defaultValue:Be};if(Ve){let Ge=$h(i,Ne,Ve);if(Ge)return{value:Le,type:void 0,isFunction:!1,defaultValue:Be,resolvedType:Ge};if(Ne.funcDecls.has(Ve)||Bh(Ne,Ve))return{value:Le,type:void 0,isFunction:!1,defaultValue:Be,pendingCallDefault:{calleeName:Ve}};let Ke=Ne.valueImportBindingsByLocalName.get(Ve);if(Ke)return{value:Le,type:void 0,isFunction:!1,defaultValue:Be,pendingCallDefault:{calleeName:Ve,importSource:Ke.source,importedName:Ke.importedName}}}return{value:Le,type:void 0,isFunction:!1,defaultValue:Be,pendingCallDefault:{calleeName:Ve??Mh(Ne,We)}}}else if(Ie.type==="Identifier"){let Fe=Ie;if(Re<5){let We=fl(Ne,Fe.name);if(We){let Ve=h(i,Ne,We,Re+1),Ge=i.resolveLocalVarJSDoc(Fe.name);return{...Ve,resolvedType:Ge?.type??Ve.resolvedType,resolvedDescription:Ge?.description??Ve.resolvedDescription,resolvedParams:Ge?.params??Ve.resolvedParams,resolvedReturnType:Ge?.returnType??Ve.resolvedReturnType}}if(Ne.funcDecls.has(Fe.name)){let Ve=i.resolveLocalVarJSDoc(Fe.name),Ge=Ne.funcDecls.get(Fe.name);return{value:Ge?ul(Ne,Ge):void 0,type:void 0,isFunction:!0,defaultValue:Ge?dl(i,Ne,Ge):void 0,resolvedType:Ve?.type??Wh(Ve,Ge),resolvedDescription:Ve?.description,resolvedParams:Ve?.params,resolvedReturnType:Ve?.returnType}}}if("start"in Fe&&"end"in Fe&&typeof Fe.start==="number"&&typeof Fe.end==="number")Le=n(Ne,Fe.start,Fe.end)}else if(Ie.type==="MemberExpression"){let Fe=Ie;if("start"in Fe&&"end"in Fe&&typeof Fe.start==="number"&&typeof Fe.end==="number")Le=n(Ne,Fe.start,Fe.end);if(i.isNumericConstant(Ie))Me="number"}else if(Ie.type==="TemplateLiteral"){let Fe=Ie;if("start"in Fe&&"end"in Fe&&typeof Fe.start==="number"&&typeof Fe.end==="number")Le=n(Ne,Fe.start,Fe.end);Me="string"}else if("raw"in Ie&&typeof Ie.raw==="string"){if(Le=Ie.raw,"value"in Ie)Me=Ie.value==null?void 0:typeof Ie.value}return{value:Le,type:Me,isFunction:Oe,defaultValue:Be}}function fl(i,Ne){for(let Ie of i.vars)for(let Re of Ie.declarations)if(Re.id&&typeof Re.id==="object"&&"type"in Re.id&&Re.id.type==="Identifier"&&"name"in Re.id&&Re.id.name===Ne&&Re.init)return Re.init;return}function Or(i,Ne){for(let Ie of i.vars){if(Ie.kind!=="const")continue;for(let Re of Ie.declarations)if(Re.id&&typeof Re.id==="object"&&"type"in Re.id&&Re.id.type==="Identifier"&&"name"in Re.id&&Re.id.name===Ne&&Re.init)return Re.init}return}function Mh(i,Ne){if(Ne&&typeof Ne==="object"&&"start"in Ne&&"end"in Ne&&typeof Ne.start==="number"&&typeof Ne.end==="number")return n(i,Ne.start,Ne.end)??"call";return"call"}function $h(i,Ne,Ie){let Re=i.resolveLocalVarJSDoc(Ie);if(Re?.returnType)return Re.returnType;let Le=Ne.funcDecls.get(Ie)??hl(Ne,Ie);if(!Le)return;let Me=Vh(Ne,Le);if(Me)return Me;let Oe=Fh(Ne,Ie);if(Oe)return Oe;let Be=yl(Le);return Be==="any"?void 0:Be}function Bh(i,Ne){return hl(i,Ne)!==void 0}function hl(i,Ne){let Ie=fl(i,Ne);if(!Ie||typeof Ie!=="object"||!("type"in Ie))return;if(Ie.type==="ArrowFunctionExpression"||Ie.type==="FunctionExpression")return Ie;return}function Fh(i,Ne){for(let Ie of i.vars)for(let Re of Ie.declarations){let Le=Re.id;if(!Le||typeof Le!=="object"||!("type"in Le)||Le.type!=="Identifier"||!("name"in Le)||Le.name!==Ne)continue;let Me=Le.typeAnnotation;if(Me?.type!=="TSTypeAnnotation")return;let Oe=Me.typeAnnotation;if(!Oe||typeof Oe.start!=="number"||typeof Oe.end!=="number")return;return jh(n(i,Oe.start,Oe.end))}return}function jh(i){if(!i)return;let Ne=i.lastIndexOf("=>");if(Ne===-1)return;return i.slice(Ne+2).trim()||void 0}function Vh(i,Ne){let Ie=Ne.returnType;if(Ie?.type!=="TSTypeAnnotation")return;let Re=Ie.typeAnnotation;if(!Re||typeof Re.start!=="number"||typeof Re.end!=="number")return;return n(i,Re.start,Re.end)}function Wh(i,Ne){let Ie=i?.returnType??"any",Re=i?.params;if(Re&&Re.length>0)return`(${Re.map((Me)=>`${Me.name}${Me.optional?"?":""}: ${Me.type}`).join(", ")}) => ${Ie}`;if(i?.returnType)return`() => ${Ie}`;if(Ne)return ml(Ne);return"(...args: any[]) => any"}function ml(i){return`(${qh(i)}) => ${yl(i)}`}function qh(i){let Ne=i.params;if(!Array.isArray(Ne)||Ne.length===0)return"...args: any[]";let Ie=[];for(let Re of Ne)if(Re&&typeof Re==="object"&&"type"in Re&&Re.type==="Identifier"&&"name"in Re&&typeof Re.name==="string")Ie.push(`${Re.name}: any`);else return"...args: any[]";return Ie.join(", ")}function yl(i){if(i.async||i.generator)return"any";let Ne=i.body,Ie;if(Ne&&typeof Ne==="object"&&"type"in Ne&&Ne.type==="BlockStatement"){if(Ie=Gh(Ne),Ie.length===0)return"any"}else Ie=[Ne];let Re=null;for(let Le of Ie){let Me=Uh(Le);if(!Me)return"any";if(Re===null)Re=Me;else if(Re!==Me)return"any"}return Re??"any"}function Gh(i){let Ne=[];return io(i,Ne),Ne}function io(i,Ne){if(!i||typeof i!=="object")return;let Ie=i;if(typeof Ie.type!=="string")return;if(Ie.type==="FunctionDeclaration"||Ie.type==="FunctionExpression"||Ie.type==="ArrowFunctionExpression")return;if(Ie.type==="ReturnStatement")Ne.push(Ie.argument??null);for(let Re in Ie){if(Re==="leadingComments")continue;let Le=Ie[Re];if(!Le||typeof Le!=="object")continue;if(Array.isArray(Le))for(let Me=0;Me<Le.length;Me++)io(Le[Me],Ne);else io(Le,Ne)}}function Uh(i){if(!i||typeof i!=="object"||!("type"in i))return null;switch(i.type){case"Literal":{let Ne=i.value;if(typeof Ne==="string")return"string";if(typeof Ne==="number")return"number";if(typeof Ne==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let Ne=i.callee;if(Ne&&typeof Ne==="object"&&"type"in Ne&&Ne.type==="Identifier"){let Ie=Ne.name;if(Ie==="String")return"string";if(Ie==="Number")return"number";if(Ie==="Boolean")return"boolean"}return null}default:return null}}function pe(i){if(p(i,"$bindable"))return{init:i.arguments[0],bindable:!0};return{init:i,bindable:!1}}function Hh(i,Ne){let Ie=Ne.params;if(!Array.isArray(Ie)||Ie.length===0)return"";let Re=Ie[0],Le=Ie[Ie.length-1];if(typeof Re.start!=="number"||typeof Le.end!=="number")return"";return n(i,Re.start,Le.end)??""}function ul(i,Ne){if(Ne.generator)return;let Ie=Ne.body;if(!Ie||typeof Ie!=="object"||!("type"in Ie))return;let Re=Hh(i,Ne),Le=Ne.async?"async ":"",Me=(Be,Fe)=>Be&&typeof Be==="object"&&("type"in Be)&&Be.type==="ObjectExpression"?`(${Fe})`:Fe;if(Ie.type!=="BlockStatement"){let Be=Es(i,Ie);return Be===void 0?void 0:`${Le}(${Re}) => ${Me(Ie,Be)}`}let Oe=Ie.body;if(Oe.length===0)return`${Le}(${Re}) => {}`;if(Oe.length===1){let Be=Oe[0];if(Be&&typeof Be==="object"&&"type"in Be&&Be.type==="ReturnStatement"){let Fe=Be.argument;if(Fe){let We=Es(i,Fe);if(We!==void 0)return`${Le}(${Re}) => ${Me(Fe,We)}`}}}return}function dl(i,Ne,Ie){let Re=Es(Ne,Ie);if(!Re||!Ie||typeof Ie!=="object"||!("type"in Ie))return;let Le="expression";if(Ie.type==="Literal"||Ie.type==="UnaryExpression")Le="literal";else if(Ie.type==="TemplateLiteral")Le=Ie.expressions.length===0?"literal":"expression";else if(Ie.type==="ArrayExpression")Le="array";else if(Ie.type==="ObjectExpression")Le="object";else if(Ie.type==="ArrowFunctionExpression"||Ie.type==="FunctionExpression"||Ie.type==="FunctionDeclaration")Le="function";let Me={raw:Re,kind:Le};if(Le==="literal"||Le==="array"||Le==="object"){let Oe=oo(i,Ie);if(Oe.ok)Me.value=Oe.value}return Me}function oo(i,Ne){if(!Ne||typeof Ne!=="object"||!("type"in Ne))return{ok:!1};if(Ne.type==="Literal"){let Ie=Ne.value;return typeof Ie==="bigint"?{ok:!1}:{ok:!0,value:Ie}}if(Ne.type==="UnaryExpression"){let Ie=Ne,Re=Ie.argument;if(!Re||typeof Re!=="object"||!("type"in Re)||Re.type!=="Literal")return{ok:!1};let Le=Re.value;if(typeof Le==="number"){if(Ie.operator==="-")return{ok:!0,value:-Le};if(Ie.operator==="+")return{ok:!0,value:Le}}if(typeof Le==="boolean"&&Ie.operator==="!")return{ok:!0,value:!Le};return{ok:!1}}if(Ne.type==="TemplateLiteral"){let Ie=Ne;if(Ie.expressions.length>0||Ie.quasis.length!==1)return{ok:!1};return{ok:!0,value:Ie.quasis[0].value.cooked??Ie.quasis[0].value.raw}}if(Ne.type==="ArrayExpression"){let Ie=Ne,Re=[];for(let Le of Ie.elements){if(!Le)return{ok:!1};let Me=oo(i,Le);if(!Me.ok)return{ok:!1};Re.push(Me.value)}return{ok:!0,value:Re}}if(Ne.type==="ObjectExpression"){let Ie=Ne,Re={};for(let Le of Ie.properties){if(Le.type!=="Property"||Le.computed)return{ok:!1};let Me=i.getPropertyName(Le.key);if(!Me)return{ok:!1};let Oe=oo(i,Le.value);if(!Oe.ok)return{ok:!1};Re[Me]=Oe.value}return{ok:!0,value:Re}}return{ok:!1}}function Kh(i){let Ne=[],Ie=0,Re=0;for(let Le=0;Le<i.length;Le++){let Me=i[Le];if(Me==="<"||Me==="("||Me==="["||Me==="{")Ie++;else if(Me===">"||Me===")"||Me==="]"||Me==="}")Ie=Math.max(Ie-1,0);else if(Ie===0&&(Me===";"||Me===","))Ne.push(i.slice(Re,Le)),Re=Le+1}return Ne.push(i.slice(Re)),Ne}function zh(i){let Ne=0;for(let Ie=0;Ie<i.length;Ie++){let Re=i[Ie];if(Re==="<"||Re==="("||Re==="["||Re==="{")Ne++;else if(Re===">"||Re===")"||Re==="]"||Re==="}")Ne=Math.max(Ne-1,0);else if(Ne===0&&Re===":")return Ie}return-1}var Xh=/^\{([\s\S]*)\}$/,Jh=/^[A-Za-z_$][\w$]*$/;function Cs(i){let Ne=i.trim(),Ie=Xh.exec(Ne);if(!Ie)return null;let Re=Ie[1].trim();if(Re==="")return[];let Le=[];for(let Me of Kh(Re)){let Oe=Me.trim();if(!Oe)continue;let Be=zh(Oe);if(Be===-1)return null;let Fe=Oe.slice(0,Be).trim(),We=Oe.slice(Be+1).trim();if(!We)return null;let Ve=!1;if(Fe.endsWith("?"))Ve=!0,Fe=Fe.slice(0,-1).trim();if(!Jh.test(Fe))return null;Le.push({name:Fe,type:We,optional:Ve})}return Le}function Yh(i,Ne,Ie,Re){if(!s(Ie))return null;let Le=Or(i,Ie.name);if(Dn(Le))return bl(i,Ne,Le,Re).properties;let Me=Ne.findVariableTypeAndDescription(Ie.name);if(!Me)return null;let Oe=Cs(Me.type);if(!Oe)return null;return Oe.map((Be)=>({name:Be.name,type:Be.type,optional:Be.optional}))}function bl(i,Ne,Ie,Re){let Le=[],Me=!1;for(let Oe of Ie.properties){if(Oe.type==="SpreadElement"){let Ge=Yh(i,Ne,Oe.argument,Re);if(Ge)Le.push(...Ge);else Me=!0,r(i,"spread-unresolved",Re,`Context "${Re}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,Oe));continue}if(Oe.type!=="Property")continue;let Be=Ne.getPropertyName(Oe.key);if(!Be)continue;let Fe="any",We,Ve;if(s(Oe.value)){let Ge=Oe.value.name,Ke=Ne.findVariableTypeAndDescription(Ge);if(Ke)Fe=Ke.type,We=Ke.description,Ve=Ke.internal;else r(i,"context-any-type",Be,`Context "${Re}" property "${Be}" has no type annotation; defaulted to "any".`,t(i,Oe))}else if(Oe.value&&typeof Oe.value==="object"&&"type"in Oe.value&&(Oe.value.type==="ArrowFunctionExpression"||Oe.value.type==="FunctionExpression"))Fe=`(${Oe.value.params?.map((ze)=>{if(s(ze))return`${ze.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(f(Oe.value))Fe=Oe.value.value==null?"null":typeof Oe.value.value;Le.push({name:Be,type:Fe,description:We,optional:!1,...Ve?{internal:!0}:{}})}return{properties:Le,hasUnresolvedSpread:Me}}var Qh=/[-_.:/\s]+/;function Mr(i){return`${i.split(Qh).map((Re)=>Re.charAt(0).toUpperCase()+Re.slice(1)).join("")}Context`}function gl(i,Ne,Ie,Re){if(!Ie||typeof Ie!=="object"||!("type"in Ie))return null;if(Ie.type==="ObjectExpression"){if(!Dn(Ie))return null;let{properties:Le,hasUnresolvedSpread:Me}=bl(i,Ne,Ie,Re);return{key:Re,typeName:Mr(Re),properties:Le,description:void 0,...Me?{hasUnresolvedSpread:Me}:{}}}else if(s(Ie)){let Le=Ie.name,Me=Ne.findVariableTypeAndDescription(Le);if(Me)return{key:Re,typeName:Mr(Re),properties:[{name:Le,type:Me.type,description:Me.description,optional:!1}],description:void 0,...Me.internal?{internal:!0}:{}};return r(i,"context-any-type",Le,`Context "${Re}" variable "${Le}" has no type annotation; defaulted to "any".`,t(i,Ie)),{key:Re,typeName:Mr(Re),properties:[{name:Le,type:"any",description:void 0,optional:!1}]}}return null}function xl(i){let Ne=i.callee;if(!Ne||typeof Ne!=="object"||!("type"in Ne))return null;let Ie=Ne.type==="Identifier"&&Ne.name==="Symbol",Re=Ne.type==="MemberExpression"&&!Ne.computed&&Ne.object.type==="Identifier"&&Ne.object.name==="Symbol"&&Ne.property.type==="Identifier"&&Ne.property.name==="for";if(!Ie&&!Re)return null;let Le=i.arguments[0];if(!Le||typeof Le!=="object"||!("type"in Le))return"";if(Le.type==="Literal"&&typeof Le.value==="string")return Le.value;if(Le.type==="TemplateLiteral"&&Le.quasis?.length===1)return Le.quasis[0].value.cooked??"";return""}function El(i,Ne,Ie=0){if(!Ne||typeof Ne!=="object"||!("type"in Ne))return{kind:"unresolved"};let Re=Ne;if(Re.type==="Literal"||Re.type==="TemplateLiteral"){let Le=Jn(Re);return Le==null?{kind:"unresolved"}:{kind:"resolved",key:Le}}if(Re.type==="CallExpression"||Re.type==="NewExpression"){let Le=xl(Re);return Le==null?{kind:"unresolved"}:{kind:"resolved",key:Le}}if(Re.type==="Identifier"){if(Ie>=5)return{kind:"unresolved"};let Le=Or(i,Re.name);if(Le&&typeof Le==="object"&&"type"in Le){let Oe=Le;if((Oe.type==="CallExpression"||Oe.type==="NewExpression")&&xl(Oe)==="")return{kind:"resolved",key:Re.name};return El(i,Oe,Ie+1)}let Me=i.valueImportBindingsByLocalName.get(Re.name);if(Me)return{kind:"pending",importSource:Me.source,importedName:Me.importedName};return{kind:"unresolved"}}return{kind:"unresolved"}}function le(i,Ne,Ie,Re){if(!Ie||typeof Ie!=="object"||!("type"in Ie)||Ie.type!=="CallExpression")return;let Le=Ie,Me=Le.arguments[0];if(!Me)return;let Oe=El(i,Me);if(Oe.kind==="unresolved"||Oe.kind==="resolved"&&!Oe.key){let Ge=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Could not resolve setContext key${Ge}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);return}let Be=Le.arguments[1];if(!Be)return;let Fe=t(i,Ie);if(Oe.kind==="pending"){let Ge=gl(i,Ne,Be,"");if(Ge)i.pendingContextKeyCandidates.push({importSource:Oe.importSource,importedName:Oe.importedName,properties:Ge.properties,description:Ge.description,source:Fe});return}let We=Oe.key,Ve=gl(i,Ne,Be,We);if(!Ve)return;if(i.contexts.has(We)){r(i,"context-duplicate-key",We,`setContext("${We}", ...) was called more than once; only the first call's shape is used.`,Fe);return}i.contexts.set(We,{...Ve,source:Fe})}var Zh=/\n/g;function fe(i,Ne){if(!Ne||typeof Ne!=="object"||!("type"in Ne))return;if(Dn(Ne))return vl(i,Ne);if(Ne.type==="ArrayExpression")return Sl(i,Ne);return}function Cl(i,Ne){if(!Ne||typeof Ne!=="object"||!("type"in Ne))return"any";if(s(Ne))return i.findVariableTypeAndDescription(Ne.name)?.type??"any";if(f(Ne)){let Ie=Ne.value;return Ie===null?"null":typeof Ie}if(Dn(Ne))return vl(i,Ne);if(Ne.type==="ArrayExpression")return Sl(i,Ne);return"any"}function vl(i,Ne){let Ie=[];for(let Re of Ne.properties){if(Re.type!=="Property"||Re.computed)continue;let Le=i.getPropertyName(Re.key);if(!Le)continue;Ie.push({name:Le,type:Cl(i,Re.value)})}return vs(Ie)}function Sl(i,Ne){let Ie=new Set(Ne.elements.filter((Re)=>Re!=null).map((Re)=>Cl(i,Re)));if(Ie.size===0)return"any[]";if(Ie.size===1)return`${[...Ie][0]}[]`;return`(${[...Ie].join(" | ")})[]`}function X(i){return typeof i==="string"?JSON.stringify(i):String(i)}function y(i,{name:Ne,detail:Ie,has_argument:Re,description:Le,deprecated:Me,tags:Oe,internal:Be,source:Fe}){if(Ne===void 0)return;let We=!Re&&!Ie?"null":u(Ie),Ve=Le,Ge=i.events.get(Ne);if(Ge?.type==="forwarded")i.events.set(Ne,{type:"dispatched",name:Ne,detail:We,description:Ve||Ge.description,deprecated:Me??Ge.deprecated,tags:Oe??Ge.tags,...Be||Ge.internal?{internal:!0}:{},source:Fe||Ge.source});else if(Ge){let Ke=Ge.tags??Oe;i.events.set(Ne,{...Ge,detail:Ge.detail===void 0?We:Ge.detail,description:Ge.description||Ve,deprecated:Ge.deprecated??Me,tags:Ke,...Ge.internal||Be?{internal:!0}:{},source:Fe||Ge.source})}else i.events.set(Ne,{type:"dispatched",name:Ne,detail:We,description:Ve,deprecated:Me,tags:Oe,...Be?{internal:!0}:{},source:Fe})}function de(i,Ne){let Ie=Ne.arguments[0],Re=ro(Ie,"CustomEvent");if(!Re&&!ro(Ie,"Event"))return;let Le=Ie.arguments[0],Me=f(Le)?Le.value:void 0;if(Me==null)return;let Oe=Re?Ie.arguments[1]:void 0,Be=!1,Fe;if(Dn(Oe)){let We=Oe.properties.find((Ve)=>Ve.type==="Property"&&s(Ve.key)&&Ve.key.name==="detail");if(We?.type==="Property")Be=!0,Fe=f(We.value)?We.value.value:void 0}return y(i,{name:String(Me),detail:Fe==null?"":X(Fe),has_argument:Be,source:t(i,Ne)}),String(Me)}function vs(i,Ne,Ie=!1){if(i.length===0)return"null";let Re=i.map(({name:Le,type:Me,description:Oe,optional:Be,default:Fe})=>{let We=Be?"?":"",Ve=Oe||"";if(Fe&&Ve)Ve=`${Ve} @default ${Fe}`;else if(Fe)Ve=`@default ${Fe}`;if(Ve){if(Ie)return`${Ve.includes(`
|
|
21
|
-
`)?`/**
|
|
22
|
-
* ${Ve.split(`
|
|
23
|
-
`).join(`
|
|
24
|
-
* `)}
|
|
25
|
-
*/`:`/** ${Ve} */`}
|
|
26
|
-
${Le}${We}: ${Me};`;return`/** ${Ve.replace(Zh," ")} */ ${Le}${We}: ${Me};`}return`${Le}${We}: ${Me};`}).join(Ie?`
|
|
27
|
-
`:" ");return Ie?`{
|
|
28
|
-
${Re}
|
|
29
|
-
}`:`{ ${Re} }`}var em=/[A-Za-z_$][\w$]*/g;function tm(i,Ne){if(!Ne)return!1;let Ie=new Set(Ne[0].split(",").map((Re)=>Re.trim()));for(let[Re]of i.matchAll(em))if(Ie.has(Re))return!0;return!1}function Q(i,Ne){if(Ne===void 0)return;return i.runesPropsDeclarationMetadataByDeclaratorStart.get(Ne)}function me(i,Ne,Ie){return Q(i,Ne)?.props.get(Ie)}function he(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"right"in i&&i.right&&typeof i.right==="object"&&"name"in i.right&&typeof i.right.name==="string")return i.right.name;return}function Tl(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"left"in i&&i.left&&typeof i.left==="object")return Tl(i.left);return}function x(i,Ne){let Ie=Ne?.start,Re=Ne?.end;if(Ie===void 0||Re===void 0)return;return n(i,Ie+1,Re)?.trim()}function ye(i,Ne){let Ie=Ne?.start,Re=Ne?.end;if(Ie===void 0||Re===void 0)return;return n(i,Ie,Re)?.trim()}function c(i,Ne,Ie,Re,Le=new Set){if(!Ne?.type)return;switch(Ne.type){case"TSInterfaceDeclaration":c(i,{type:"TSTypeLiteral",members:Ne.body?.body},Ie,Re,Le);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":c(i,Ne.typeAnnotation,Ie,Re,Le);return;case"TSIntersectionType":case"TSUnionType":for(let Me of Ne.types??[])c(i,Me,Ie,Re,Le);return;case"TSTypeLiteral":for(let Me of Ne.members??[]){if(Me?.type!=="TSPropertySignature")continue;c(i,Me.typeAnnotation?.typeAnnotation,Ie,Re,Le)}return;case"TSTypeReference":{let Me=Tl(Ne.typeName);if(Me){if(i.typeImportBindingsByLocalName.has(Me)||i.valueImportBindingsByLocalName.has(Me))Ie.add(Me);let Oe=i.localTypeDeclarationsByName.get(Me);if(Oe&&!Le.has(Me))Re.add(Me),Le.add(Me),c(i,Oe.node,Ie,Re,Le),Le.delete(Me)}if("typeParameters"in Ne&&Ne.typeParameters&&typeof Ne.typeParameters==="object"){let Oe=Ne.typeParameters;for(let Be of Oe.params??[])c(i,Be,Ie,Re,Le)}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 Me in Ne){let Oe=Ne[Me];if(!Oe||typeof Oe!=="object")continue;if(Array.isArray(Oe)){for(let Be of Oe){if(!Be||typeof Be!=="object"||!("type"in Be))continue;c(i,Be,Ie,Re,Le)}continue}if("type"in Oe)c(i,Oe,Ie,Re,Le)}}function nm(i,Ne){let Ie=new Map;for(let Re of Array.from(Ne).sort()){let Le=i.typeImportBindingsByLocalName.get(Re),Me=Le?void 0:i.valueImportBindingsByLocalName.get(Re),Oe=Le??(Me?{importedName:Me.importedName,localName:Me.localName,source:Me.source,specifierType:"named"}:void 0);if(!Oe)continue;let Be=Ie.get(Oe.source)??{default:[],named:[],namespace:[]};if(Oe.specifierType==="default")Be.default.push(Oe.localName);else if(Oe.specifierType==="namespace")Be.namespace.push(Oe.localName);else Be.named.push({imported:Oe.importedName,local:Oe.localName});Ie.set(Oe.source,Be)}return Array.from(Ie.entries()).sort(([Re],[Le])=>Re.localeCompare(Le)).map(([Re,Le])=>{if(Le.namespace.length>0)return Le.namespace.map((Fe)=>`import type * as ${Fe} from "${Re}";`).join(`
|
|
30
|
-
`);let Me=Le.named.map(({imported:Fe,local:We})=>{if(!Fe||Fe===We)return We;return`${Fe} as ${We}`}),Oe=Le.default[0],Be=Me.length>0?`{ ${Me.join(", ")} }`:"";if(Oe&&Be)return`import type ${Oe}, ${Be} from "${Re}";`;if(Oe)return`import type ${Oe} from "${Re}";`;return`import type ${Be} from "${Re}";`})}function P(i,Ne){if(Ne)i.additionalTypeDependencyNodes.push(Ne)}function rm(i){if(!i.const)return;let Ne=i.id?.name;if(!Ne)return;let Ie=[];for(let Re of i.members??[]){let Le=Re.initializer;if(Le?.type!=="Literal")return;let Me=Le.value;if(typeof Me==="string")Ie.push(JSON.stringify(Me));else if(typeof Me==="number")Ie.push(String(Me));else return}if(Ie.length===0)return;return`type ${Ne} = ${Ie.join(" | ")};`}function ge(i,Ne){let Ie=rm(Ne);if(Ie)return Ie;if(Ne.start===void 0||Ne.end===void 0)return;let Re=n(i,Ne.start,Ne.end)?.trim();return Re?`declare ${Re}`:void 0}function Y(i,Ne){let Ie=!1,Re=[];for(let Me of Ne.params??[]){if(Me.type==="RestElement"){let Ge=Me.argument?.name??"rest",Ke=x(i,Me.typeAnnotation);if(Ke)Ie=!0;P(i,Me.typeAnnotation?.typeAnnotation),Re.push(`...${Ge}: ${Ke??"any[]"}`);continue}let Oe=Me.type==="AssignmentPattern",Be=Oe?Me.left:Me,Fe=Be?.name??"arg",We=x(i,Be?.typeAnnotation);if(We)Ie=!0;P(i,Be?.typeAnnotation?.typeAnnotation);let Ve=Oe||Me.optional===!0;Re.push(`${Fe}${Ve?"?":""}: ${We??"any"}`)}let Le=x(i,Ne.returnType);if(Le)Ie=!0;return P(i,Ne.returnType?.typeAnnotation),{signature:`(${Re.join(", ")}) => ${Le??"any"}`,hasAnnotations:Ie}}function xe(i){let Ne=i.pendingCallDefaultCandidates.length>0?i.pendingCallDefaultCandidates.slice():void 0,Ie=i.pendingContextKeyCandidates.length>0?i.pendingContextKeyCandidates.slice():void 0,Re={...Ne?{pendingCallDefaultCandidates:Ne}:{},...Ie?{pendingContextKeyCandidates:Ie}:{}},Le=Ne!==void 0||Ie!==void 0,Me=new Set,Oe=new Set;for(let Ve of i.additionalTypeDependencyNodes)c(i,Ve,Me,Oe);let Be=i.typedRunesPropsDeclarations.length===1?i.typedRunesPropsDeclarations[0]:void 0,Fe=Be?.canonicalType;if(Be&&Fe){for(let Ve of Be.referencedImportedTypes)Me.add(Ve);for(let Ve of Be.referencedLocalTypes)Oe.add(Ve)}if(!Fe&&Me.size===0&&Oe.size===0)return Le?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...Re}:void 0;let We=Array.from(Oe).map((Ve)=>i.localTypeDeclarationsByName.get(Ve)).filter((Ve)=>Ve!==void 0).sort((Ve,Ge)=>Ve.start-Ge.start).map((Ve)=>Ve.code);return{...Fe?{canonicalPropsType:Fe}:{},canonicalPropNames:Be&&Fe?Array.from(Be.props.keys()).sort():[],localTypeDeclarations:We,typeImportStatements:nm(i,Me),referencesComponentGenerics:Fe?tm(Fe,i.generics):!1,...Re}}var sm=/^[A-Za-z_$][\w$]*/,im=/[A-Za-z_$][\w$]*/g,kl=/^(?:const|in|out)\s+/;function vn(i){let Ne=[],Ie=0,Re=0;for(let Le=0;Le<i.length;Le++){let Me=i[Le];if(Me==="<"||Me==="("||Me==="["||Me==="{")Ie++;else if(Me===">"||Me===")"||Me==="]"||Me==="}")Ie=Math.max(Ie-1,0);else if(Me===","&&Ie===0)Ne.push(i.slice(Re,Le)),Re=Le+1}return Ne.push(i.slice(Re)),Ne}function Te(i){let Ne=vn(i).map((Re)=>Re.trim()).filter((Re)=>Re.length>0);if(Ne.length===0)return null;return[Ne.map((Re)=>{let Le=Re;while(kl.test(Le))Le=Le.replace(kl,"");return Le.match(sm)?.[0]??Re}).join(", "),Ne.join(", ")]}function Ee(i,Ne,Ie){let Re=i.scriptGenericsAttribute?.value;if(!Re)return;for(let[Le]of Re.matchAll(im)){if(i.typeImportBindingsByLocalName.has(Le))Ne.add(Le);if(Ie.has(Le))continue;let Me=i.localTypeDeclarationsByName.get(Le);if(!Me)continue;Ie.add(Le),c(i,Me.node,Ne,Ie)}}var om=null;function am(i,Ne,Ie){let Re={value:void 0,replace:!1};if(!Ie||typeof Ie!=="object"||!("type"in Ie))return Re;if(Ie.type==="Identifier")Re.value=Ie.name,Re.replace=!0;else if(Ie.type==="Literal")Re.value=String(Ie.value);else if(Ie.type==="MemberExpression")Re.value=B(i,Ne,Ie);else if((Ie.type==="ObjectExpression"||Ie.type==="TemplateLiteral")&&"start"in Ie&&"end"in Ie&&typeof Ie.start==="number"&&typeof Ie.end==="number")Re.value=n(i,Ie.start,Ie.end);return Re}function cm(i,Ne,Ie){if(!s(Ie))return null;let Re=Or(i,Ie.name);if(Dn(Re))return Z(i,Ne,Re).slot_props;let Le=Ne.findVariableTypeAndDescription(Ie.name);if(!Le)return null;let Me=Cs(Le.type);if(!Me)return null;let Oe={};for(let Be of Me)Oe[Be.name]={value:Be.type,replace:!1};return Oe}function Z(i,Ne,Ie){let Re={},Le=!1;for(let Me of Ie.properties){if(Me.type==="SpreadElement"){let Be=cm(i,Ne,Me.argument);if(Be)Object.assign(Re,Be);else Le=!0,r(i,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,t(i,Me));continue}if(Me.type!=="Property"||Me.computed)continue;let Oe=Ne.getPropertyName(Me.key);if(!Oe)continue;Re[Oe]=am(i,Ne,Me.value)}return{slot_props:Re,hasUnresolvedSpread:Le}}function lm(i,Ne){if(!Ne||typeof Ne!=="object"||!("type"in Ne))return null;if(Ne.type==="Identifier"){let Me=Ne,Oe=i.propLocalToPublicName.get(Me.name);if(!Oe)return null;return{publicName:Oe,trackingName:Me.name}}if(Ne.type!=="MemberExpression")return null;let Ie=Ne,Re=Ie.object&&typeof Ie.object==="object"&&"type"in Ie.object&&Ie.object.type==="Identifier"?Ie.object.name:void 0;if(!Re||!i.wholePropsLocals.has(Re))return null;let Le;if(!Ie.computed&&Ie.property&&typeof Ie.property==="object"&&"type"in Ie.property){if(Ie.property.type==="Identifier")Le=Ie.property.name;else if(Ie.property.type==="Literal"&&Ie.property.value!=null)Le=String(Ie.property.value)}else if(Ie.computed&&Ie.property&&typeof Ie.property==="object"&&"type"in Ie.property&&Ie.property.type==="Literal"&&"value"in Ie.property&&Ie.property.value!=null)Le=String(Ie.property.value);if(!Le)return null;return{publicName:Le,trackingName:Le}}function be(i,Ne){let Ie=Ne;if(Ie&&typeof Ie==="object"&&"type"in Ie&&Ie.type==="ChainExpression")Ie=Ie.expression;if(!Ie||typeof Ie!=="object"||!("type"in Ie)||Ie.type!=="CallExpression")return null;let Re=Ie;if(!Re.callee||typeof Re.callee!=="object"||!("type"in Re.callee))return null;let Le=lm(i,Re.callee);if(!Le)return null;return{...Le,arguments:Re.arguments}}function L(i,{slot_name:Ne,slot_props:Ie,slot_props_unresolved_spread:Re,slot_fallback:Le,slot_description:Me,slot_deprecated:Oe,slot_tags:Be,slot_internal:Fe,source:We}){let Ve=Ne===void 0||Ne==="",Ge=Ve?om:Ne??"",Ke=u(Le),ze=Ie===void 0||Ie===""?void 0:Ie,Ye=Me?.trim()||void 0;if(i.slots.has(Ge)){let Qe=i.slots.get(Ge);if(Qe)i.slots.set(Ge,{...Qe,default:Qe.default??Ve,fallback:Ke,slot_props:Qe.slot_props===void 0?ze:Qe.slot_props,slot_props_unresolved_spread:Qe.slot_props_unresolved_spread||Re,description:Qe.description||Ye,deprecated:Qe.deprecated??Oe,tags:Qe.tags||Be,...Qe.internal||Fe?{internal:!0}:{},source:We||Qe.source})}else i.slots.set(Ge,{name:Ge,default:Ve,fallback:Ke,slot_props:ze,slot_props_unresolved_spread:Re,description:Ye,deprecated:Oe,tags:Be,...Fe?{internal:!0}:{},source:We})}function W(i,Ne){let Ie=Ne.source?.value;if(typeof Ie!=="string"||Ne.importKind==="type")return;for(let Re of Ne.specifiers??[]){if(Re.type!=="ImportSpecifier"||Re.importKind==="type")continue;let Le=Re.local?.name;if(!Le)continue;let Me=Re.imported?.name??(typeof Re.imported?.value==="string"?Re.imported.value:Le);i.valueImportBindingsByLocalName.set(Le,{localName:Le,importedName:Me,source:Ie})}}function Ss(i){let Ne=i,Ie=Ne.type==="Program"?Ne.body:Ne.content?.body??Ne.body;return Array.isArray(Ie)?Ie:void 0}function Se(i){let Ne=new Map,Ie=i?Ss(i):void 0;if(!Ie)return Ne;for(let Re of Ie){let Le=Re;if(Le.type!=="ImportDeclaration"||Le.importKind==="type")continue;let Me=Le.source?.value;if(typeof Me!=="string")continue;for(let Oe of Le.specifiers??[]){let Be=Oe.local?.name;if(!Be||Oe.importKind==="type")continue;let Fe;if(Oe.type==="ImportDefaultSpecifier")Fe="default";else if(Oe.type==="ImportNamespaceSpecifier")Fe="*";else Fe=Oe.imported?.name??String(Oe.imported?.value??Be);Ne.set(Be,{from:Me,imported:Fe})}}return Ne}function K(i,Ne){if(!Ne)return;let Ie=Ss(Ne);if(!Ie)return;for(let Re of Ie){let Le=Re;if(Le.type==="ImportDeclaration"){W(i,Le);continue}let Me=Le.type==="ExportNamedDeclaration"&&Le.declaration?Le.declaration:Le;if(Me.type==="FunctionDeclaration"){let Oe=Me;if(Oe.id?.name)i.funcDecls.set(Oe.id.name,Oe)}}}var ao=/^\s+/,Al=/\s/,pm=/^@[^\s/]+(?=\s|$)/,um=/^@(\S+)\s*/;function wl(i){let Ne=0;while(Ne<i.length){let Ie=i.charCodeAt(Ne);if(Ie!==32&&Ie!==9&&Ie!==13&&Ie!==10&&!Al.test(i[Ne]))break;Ne++}return Ne}function dm(i,Ne){let Ie=i.slice(wl(i)),Re=!1;if(Ne)Ie=Ie.slice(3),Re=!0;else if(Ie.startsWith("*")&&!Ie.startsWith("*/"))Ie=Ie.slice(1),Re=!0;let Le=Ie.slice(0,wl(Ie));Ie=Ie.slice(Le.length);let Me=Ie.trimEnd(),Oe=Me.endsWith("*/")?Me.slice(0,-2):Ie;return{indent:Re?Le.slice(1):Le,separator:Le,content:Oe}}function fm(i,Ne,Ie){let Re=Ie>Ne&&i.charCodeAt(Ie-1)===13?Ie-1:Ie;return i.slice(Ne,Re)}function hm(i){let Ne=[],Ie=0;while(!0){let Re=i.indexOf("/**",Ie);if(Re===-1)break;let Le=i.lastIndexOf(`
|
|
31
|
-
`,Re-1)+1;if(i.charCodeAt(Re+3)===42||i.slice(Le,Re).trim()!==""){Ie=Re+1;continue}let Me=[],Oe=Le,Be=!1,Fe=0;while(Oe<=i.length){let We=i.indexOf(`
|
|
32
|
-
`,Oe),Ve=We===-1?i.length:We,Ge=fm(i,Oe,Ve),{indent:Ke,separator:ze,content:Ye}=dm(Ge,Me.length===0);Me.push({raw:Ge,start:Oe,number:Me.length,indent:Ke,separator:ze,content:Ye});let Qe=Ge.trimEnd();if(Qe.endsWith("*/")){Be=!0,Fe=Oe+Qe.length,Ie=Ve;break}if(We===-1)break;Oe=We+1}if(!Be)break;Ne.push({start:Re,end:Fe,lines:Me})}return Ne}function mm(i){let Ne=i;if(Ne.length>0&&Ne[0].content==="")Ne=Ne.slice(1);if(Ne.length>0&&Ne[Ne.length-1].content==="")Ne=Ne.slice(0,-1);return Ne}function ym(i){let Ne=[[]],Ie=!1;for(let Re of i){if(pm.test(Re.content)&&!Ie)Ne.push([Re]);else Ne[Ne.length-1].push(Re);if(gm(Re.content,"```")%2===1)Ie=!Ie}return Ne}function gm(i,Ne){let Ie=0,Re=i.indexOf(Ne);while(Re!==-1)Ie++,Re=i.indexOf(Ne,Re+Ne.length);return Ie}function Pl(i){return i.map((Ne)=>Ne.indent+Ne.content).join(`
|
|
33
|
-
`)}function xm(i,Ne){let Ie=Ne;while(Ie<i.length-1&&i[Ie].content.trim()==="")Ie++;if(i[Ie].content[0]!=="{")return null;let Re=0,Le=[],Me=Ie;for(;Me<i.length;Me++){let Fe=i[Me].content,We=0;for(let Ve of Fe){if(Ve==="{")Re++;else if(Ve==="}")Re--;if(We++,Re===0)break}if(Le.push(We),Re===0)break}if(Re!==0)return null;let Oe=Me;return{type:Le.map((Fe,We)=>{let Ve=Ie+We,Ge=i[Ve].content.slice(0,Fe);return i[Ve].content=i[Ve].content.slice(Fe).replace(ao,""),We===0?Ge:i[Ve].indent+Ge}).join(`
|
|
34
|
-
`).slice(1,-1),endIndex:Oe}}function bm(i){let Ne=i.content.match(ao)?.[0]??"",Ie=i.content.slice(Ne.length),Re=0,Le=0;for(let We of Ie){if(Re===0&&Al.test(We))break;if(We==="[")Re++;if(We==="]")Re--;Le++}let Me=Re===0?Ie.slice(0,Le):"";if(!Me)return null;let Oe=Me,Be=!1,Fe;if(Me.startsWith("[")&&Me.endsWith("]")){Be=!0;let Ve=Me.slice(1,-1).split("=");if(Oe=Ve[0].trim(),Ve.length>1)Fe=Ve.slice(1).join("=").trim();if(!Oe)return null}if(Oe.length>1&&(Oe[0]==='"'||Oe[0]==="'")&&Oe[Oe.length-1]===Oe[0])Oe=Oe.slice(1,-1);return i.content=Ie.slice(Le).replace(ao,""),{name:Oe,optional:Be,default:Fe}}function Em(i){let Ne=i[0],Ie=Ne.content.match(um),Re=Ie?Ie[1]:"",Le=Ie?Ne.content.slice(Ie[0].length):Ne.content,Me=Le.trimEnd(),Oe=i.slice(1).map((ze)=>ze.separator+ze.content),Be=(Me?[Me,...Oe]:Oe).join(`
|
|
35
|
-
`);Ne.content=Le,Ne.tag=Re;let Fe=xm(i,0),We=Fe?.type??"",Ve=0;if(Fe){Ve=Fe.endIndex;while(Ve<i.length-1&&i[Ve].content.trim()==="")Ve++}let Ge=bm(i[Ve]),Ke=Pl(i.slice(Fe?Fe.endIndex:0));return{tag:Re,name:Ge?.name??"",type:We,optional:Ge?.optional??!1,default:Ge?.default,description:Ke,raw:Be,lines:i}}function Cm(i,Ne,Ie){let Re=mm(i);Re.forEach((Oe,Be)=>{Oe.number=Be});let Le=ym(Re),Me=Le.slice(1).map(Em);return{description:Pl(Le[0]),tags:Me,start:Ne,end:Ie,lines:Re}}function $r(i){return hm(i).map(({start:Ne,end:Ie,lines:Re})=>Cm(Re,Ne,Ie))}var vm=/\s*=\s*/;function Nl(i){let Ne=i.indexOf("<");if(Ne===-1||!i.endsWith(">"))return i;let Ie=i.slice(0,Ne),Re=i.slice(Ne+1,-1),Le=vn(Re).map((Me)=>Me.trim().replace(vm," = ")).join(", ");return`${Ie}<${Le}>`}var ee=/^\s*$/,Sm=/;$/,Tm=/^-\s*/;function km(i){return i.split(`
|
|
36
|
-
`).map((Ne)=>Ne.trim()).join(`
|
|
37
|
-
`)}function dr(i){if(i===void 0)return;let Ne=i.replace(Tm,"").trim();return Ne===""?"":Ne}var _l=new Set(["restProps","slot","snippet","event","typedef","callback"]),co=new Set(["property","type"]);function Ts(i){if(!i||i.length===0)return;return i[0].content}var Dl=new Set(["since","example","see"]),wm=new Set(["bindable","default","required"]);function Am(i){let Ne=i.trim();return Ne===""?!0:Ne}function Il(i,Ne){return Am(`${i??""}${Ne?` ${Ne}`:""}`)}function Pm(i){let Ne=i.trim().replace(Sm,"").trimEnd();if(!Ne.startsWith("{")||!Ne.endsWith("}"))return!1;let Ie=0,Re=null;for(let Le=0;Le<Ne.length;Le++){let Me=Ne[Le];if(Re!==null){if(Me==="\\"){Le++;continue}if(Me===Re)Re=null;continue}if(Me==='"'||Me==="'"||Me==="`"){Re=Me;continue}if(Me==="{"||Me==="["||Me==="(")Ie++;else if(Me==="}"||Me==="]"||Me===")"){if(Ie--,Ie===0&&Le<Ne.length-1)return!1}}return Ie===0}function lo(i){let Ne=i;if(!Ne.startsWith("/*"))Ne=`/*${Ne}`;if(!Ne.endsWith("*/"))Ne+="*/";return Ne}function Nm(i){if(i==="*")return"any";return i.trim()}function Rl(i){let Ne=$r(lo(i)),{returns:Ie}=O(Ne);return Ie?Nm(Ie.type):void 0}function Ll(i){let Ne=$r(lo(i)),{deprecated:Ie,passthrough:Re,internal:Le}=O(Ne),Me=Re.length>0?Re.map((Oe)=>({name:Oe.tag,body:Oe.raw})):void 0;return{deprecated:Ie,tags:Me,internal:Le}}var _m=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function te(i,Ne){let Ie=i.parsedJsDocByText.get(Ne);if(Ie===void 0)Ie=$r(Ne),i.parsedJsDocByText.set(Ne,Ie);return Ie}function O(i){let Ne=i[0]?.tags??[],Ie,Re=[],Le,Me,Oe,Be=!1,Fe=[],We=[],Ve=[];for(let Ge of Ne)if(Ge.tag==="type")Ie=Ge;else if(Ge.tag==="param")Re.push(Ge);else if(Ge.tag==="returns"||Ge.tag==="return")Le=Ge;else if(Ge.tag==="deprecated")Oe??=Il(Ge.name,Ge.description);else if(Ge.tag==="ignore"||Ge.tag==="internal")Be=!0;else if(Ge.tag==="sveld-ignore")Ve.push(Ge.name);else if(Dl.has(Ge.tag))We.push(Ge);else if(Ge.tag==="bindable"){if(Ge.type)continue;let Ke=`${Ge.name}${Ge.description?` ${Ge.description}`:""}`.trim();if(Ke==="readonly"||Ke==="writable")Me??=Ke}else if(!_m.has(Ge.tag))Fe.push(Ge);return{type:Ie,param:Re,returns:Le,binding:Me,deprecated:Oe,internal:Be,additional:Fe,passthrough:We,ignore:Ve,description:i[0]?.description}}function Dm(i,Ne){if(typeof Ne.start!=="number"||typeof Ne.end!=="number")return;let Ie=i.jsDocBlocksByStart.get(Ne.start);if(Ie===void 0||Ie.end!==Ne.end)return;return[Ie]}function Im(i){if(!i||i.length===0)return;let Ne=i[i.length-1];return Ne&&typeof Ne==="object"&&"value"in Ne?Ne:void 0}function Ol(i,Ne,Ie){if(!Ne||Ne.length===0||Ie===void 0||!i.source)return;for(let Re=Ne.length-1;Re>=0;Re--){let Le=Ne[Re];if(!Le||typeof Le!=="object"||!("value"in Le)||!("end"in Le))continue;if(typeof Le.end!=="number"||!("start"in Le)||typeof Le.start!=="number")continue;let Me=i.source.slice(Le.end,Ie);if(ee.test(Me))return Le}return}function Rm(i){let Ne=new Set,Ie=(Le)=>{let{leadingComments:Me,start:Oe}=Le,Be=Ol(i,Me,Oe);if(Be)Ne.add(Be.start)};for(let Le of i.funcDecls.values())Ie(Le);let Re=[{root:i.parsed?.module,isModule:!0},{root:i.parsed?.instance,isModule:!1}];for(let{root:Le,isModule:Me}of Re)for(let Oe of(Le&&Ss(Le))??[]){let Be=Oe,Fe=Be.type==="ExportNamedDeclaration",We=Fe?Be.declaration:Be;if(We?.type==="FunctionDeclaration"){if(Fe)Ie(Be)}else if(We?.type==="VariableDeclaration"&&(Me||!Fe)&&We.declarations?.length===1&&Lm.has(We.declarations[0].init?.type??""))Ie(Be)}return Ne}var Lm=new Set(["ArrowFunctionExpression","FunctionExpression"]);function l(i,Ne,Ie){if(!Ie?.leadingComments)return;let Re=Ol(i,Ie.leadingComments,Ie.start);if(!Re)return;return Om(i,Ne,[Re])}function ke(i,Ne,Ie){if(!Ie?.leadingComments)return;return l(i,Ne,Ie)}function Ml(i,Ne,Ie){let Re=i;if(Ne)Re=`${i} extends ${Ne}`;if(Ie)Re+=` = ${Ie}`;return Re}function Om(i,Ne,Ie){if(!Ie)return;let Re=Im(Ie);if(!Re)return;let Le=Dm(i,Re)??te(i,lo(Re.value)),{type:Me,param:Oe,returns:Be,binding:Fe,deprecated:We,internal:Ve,additional:Ge,passthrough:Ke,ignore:ze,description:Ye}=O(Le),Qe,tt,ot,ct;if(Me)Qe=Ne.aliasType(Me.type);if(Oe.length>0)tt=Oe.filter((bt)=>!bt.name.includes(".")).map((bt)=>({name:bt.name,type:Ne.aliasType(bt.type),description:dr(km(bt.description)),optional:bt.optional||!1}));if(Be)ot=Ne.aliasType(Be.type);let et,it=Ge;if(typeof Re.start==="number"&&i.functionDocCommentStarts.has(Re.start)){let bt=Ge.filter((Ct)=>Ct.tag==="template"&&Ct.name);if(bt.length>0)et=bt.map((Ct)=>Ml(Ct.name,Ne.aliasType(Ct.type),Ct.default)).join(", "),it=Ge.filter((Ct)=>Ct.tag!=="template")}let lt=u(Ye?.trim());if(lt||it.length>0){let bt=[];if(lt)bt.push(lt);for(let Ct of it){let $e=`@${Ct.tag}${Ct.name?` ${Ct.name}`:""}${Ct.description?` ${Ct.description}`:""}`;bt.push($e)}ct=bt.join(`
|
|
38
|
-
`)}let At=Ke.length>0?Ke.map((bt)=>({name:bt.tag,body:bt.raw})):void 0;return{type:Qe,params:tt,returnType:ot,description:ct,binding:Fe,deprecated:We,tags:At,sveldIgnore:ze.length>0?ze:void 0,internal:Ve,typeParameters:et}}function we(i,Ne,Ie=i.source){if(!Ie)return;let Re=!1,Le=!1,Me=!1,Oe=new Set,Be=()=>{if(Re&&Le&&!Me){Me=!0;let Ye=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${Ye}; their declarations are combined in the order encountered.`)}},Fe=(Ye,Qe)=>{if(Oe.has(Ye))r(i,"generics-conflict",Ye,`Duplicate generic name "${Ye}".`,Qe);else Oe.add(Ye)},We=(Ye,Qe)=>{if(i.generics){let ot=vn(i.generics[0]).map((ct)=>ct.trim()).indexOf(Ye.trim());if(ot!==-1){let ct=vn(i.generics[1]).map((et)=>et.trim());ct[ot]=Qe,i.generics=[i.generics[0],ct.join(", ")];return}}Ne.accumulateGeneric(Ye,Qe)},Ve=(Ye,Qe)=>{if(i.typedefs.has(Ye))r(i,"typedef-duplicate",Ye,`Duplicate typedef/callback name "${Ye}"; the later declaration overwrites the earlier one.`,Qe)},Ge=(Ye,Qe,tt,ot)=>{let ct=Ye.findIndex((et)=>et.name===Qe.name);if(ct===-1)Ye.push(Qe);else{let et=tt?` of "${tt}"`:"";r(i,"property-duplicate",Qe.name,`Duplicate property "${Qe.name}"${et}; the later declaration overwrites the earlier one.`,ot),Ye[ct]=Qe}},Ke=Ie.includes("@template")?Rm(i):new Set;i.functionDocCommentStarts=Ke;let ze=$r(Ie);for(let Ye of ze)i.jsDocBlocksByStart.set(Ye.start,Ye);for(let{tags:Ye,description:Qe,lines:tt,start:ot}of ze){let ct=Ke.has(ot),et,it,lt,At,bt=!1,Ct,$e,je=[],qe=[],He=[],Xe,Je,nt,st,rt=[],Ze=!1,at=[],ht,mt,gt,Et=[],Mt=!1,Vt=[],Ht,Wt,bn=!1,$t=!0,Kt=[],hi,Gn=!1,Sr=new Map,ha=new Set,Tr=new Set;for(let ft of Ye)if(ft.lines.length>0)ha.add(ft.lines[0].number);let mi=new Set,yi=!1;for(let ft of tt){if(!ft.tag&&ft.content&&ft.content.trim()!=="}")Sr.set(ft.number,ft.content);if(ft.tag!==void 0)yi=!0;else if(yi&&ft.indent&&ft.content.trim())mi.add(ft.number);else yi=!1}let Vu=(ft)=>{if(!ft||ft.length===0)return;let _t=ft[0].number,qt=[],xt=[],Jt=!1;for(let Pt=_t-1;Pt>=0;Pt--){if(ha.has(Pt)||mi.has(Pt))break;let Bt=Sr.get(Pt);if(Bt)qt.unshift(Bt),xt.unshift(Pt),Jt=!0;else if(Jt){let Yt=tt[Pt];if(!(!Yt||!Yt.tag&&(!Yt.content||Yt.content.trim()==="")))break}}if(qt.length===0)return;for(let Pt of xt)Tr.add(Pt);return qt.join(`
|
|
39
|
-
`).trim()},nr=(ft,_t)=>{let qt=dr(Ts(ft)),xt=_t!==void 0&&_l.has(_t.tag)&&!dr(Ts(_t.lines)),Jt=et!==void 0&&(_t===void 0||!co.has(_t.tag)),Pt=[];for(let Bt=1;Bt<ft.length;Bt++){let Yt=ft[Bt];if((xt||Jt)&&!mi.has(Yt.number))continue;let Dt=Sr.get(Yt.number)?.trim();if(!Dt||Tr.has(Yt.number))continue;Pt.push(Dt),Tr.add(Yt.number)}if(Pt.length===0)return qt;return[qt,...Pt].filter(Boolean).join(`
|
|
40
|
-
`)},Wu=(ft,_t,qt,xt)=>{if(et===void 0||lt)return;if(xt?.tag!=="event"&&!co.has(xt?.tag??""))return;if(dr(Ts(qt)))return;let Jt=_t?`@${ft} "${_t}"`:`@${ft}`;r(i,"event-description-ambiguous",et,`Text after @event "${et}" was used as the description of ${Jt}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,pn(i,qt))},ma=()=>{if(et!==void 0){let ft=it&&it!=="object"&&it!=="Object"?it:void 0,_t;if(ft)_t=ft;else if(He.length>0)_t=vs(He,et,!0);else _t=it||"";if($e!==void 0){let qt;for(let Pt of Ye){let Bt=Pt.lines[0]?.number;if(typeof Bt!=="number")continue;if(Bt<=$e)continue;if(co.has(Pt.tag))continue;qt=Bt;break}let xt=[],Jt=Array.from(Sr.keys()).sort((Pt,Bt)=>Pt-Bt);for(let Pt of Jt){if(Pt<=$e)continue;if(qt!==void 0&&Pt>=qt)continue;if(Tr.has(Pt))continue;let Yt=Sr.get(Pt)?.trim();if(Yt)xt.push(Yt),Tr.add(Pt)}if(xt.length>0){let Pt=xt.join(`
|
|
41
|
-
`);lt=lt?`${lt}
|
|
42
|
-
${Pt}`:Pt}}y(i,{name:et,detail:_t,has_argument:!1,description:lt,deprecated:At,tags:je.length>0?je:void 0,internal:bt||void 0,source:Ct}),i.eventDescriptions.set(et,lt),i.jsDocEventNames.add(et),i.jsDocEventSources.set(et,Ct),m(i,"event-no-source",et,qe),He.length=0,et=void 0,it=void 0,lt=void 0,At=void 0,bt=!1,Ct=void 0,$e=void 0,je=[],qe=[]}},ya=()=>{if(Xe!==void 0){let ft,_t;if(at.length>0)ft=vs(at,void 0,!0),_t=`type ${Xe} = ${ft};`;else if(Je)ft=Je,_t=Pm(ft)?`interface ${Xe} ${ft}`:`type ${Xe} = ${ft};`;else ft="{}",_t=`type ${Xe} = ${ft};`;Ve(Xe,st),i.typedefs.set(Xe,{type:ft,name:Xe,description:u(nt),ts:_t,tags:rt.length>0?rt:void 0,...Ze?{internal:!0}:{},source:st}),at.length=0,Xe=void 0,Je=void 0,nt=void 0,st=void 0,rt=[],Ze=!1}},ga=()=>{if(ht!==void 0){let qt=`(${Vt.map(({name:Jt,type:Pt,optional:Bt})=>`${Jt}${Bt?"?":""}: ${Pt}`).join(", ")}) => ${Ht||"void"}`,xt=`type ${ht} = ${qt};`;Ve(ht,gt),i.typedefs.set(ht,{type:qt,name:ht,description:u(mt),ts:xt,tags:Et.length>0?Et:void 0,...Mt?{internal:!0}:{},source:gt}),Vt.length=0,Ht=void 0,ht=void 0,mt=void 0,gt=void 0,Et=[],Mt=!1}},qu=Ye.some((ft)=>ft.tag==="slot"||ft.tag==="snippet"),Gu=Ye.some((ft)=>ft.tag==="extends"||ft.tag==="extendProps"),Uu=Ye.some((ft)=>ft.tag==="slot"||ft.tag==="snippet"||ft.tag==="event"||ft.tag==="typedef"||ft.tag==="callback");for(let ft=0;ft<Ye.length;ft++){let{tag:_t,type:qt,name:xt,description:Jt,optional:Pt,default:Bt,raw:Yt,lines:Dt}=Ye[ft],rr=Ye[ft+1],cn=Ne.aliasType(qt),sr=_l.has(_t)?Vu(Dt):void 0;if(sr)Wu(_t,xt,Dt,Ye[ft-1]);switch(_t){case"extends":case"extendProps":if(i.extends!==void 0)r(i,"extend-props-duplicate",xt,`A second @extends/@extendProps tag ("${xt}") overwrote the first ("${i.extends.interface}"); only one is used.`,pn(i,Dt));if(i.extends={interface:xt,import:cn},$t)$t=!1;break;case"restProps":{let It=xt?Jt?`${xt} ${Jt}`:xt:Jt,$n=dr(It)||sr;if(!$n&&$t&&!bn&&Qe)$n=Qe,bn=!0;if(i.rest_props={type:"Element",name:cn,description:$n||void 0},$t)$t=!1;break}case"slot":case"snippet":{let nn=nr(Dt,rr);if(!nn&&$t&&!bn&&Qe)nn=Qe,bn=!0;if(!nn&&Kt.length===0)nn=sr;if($t)$t=!1;let $n=cn;if(!$n)$n="Record<string, never>",r(i,"slot-missing-type",xt||"default",`@${_t}${xt?` "${xt}"`:""} is missing a required {Type} annotation; falling back to "${$n}".`,pn(i,Dt));L(i,{slot_name:xt,slot_props:$n,slot_description:nn||void 0,slot_deprecated:hi,slot_tags:Kt.length>0?[...Kt]:void 0,slot_internal:Gn||void 0,source:pn(i,Dt)}),Kt.length=0,hi=void 0,Gn=!1;{let Hu=xt===void 0||xt===""?null:xt;Wt=(Ku)=>{let gi=i.slots.get(Hu);if(gi)gi.tags=[...gi.tags??[],Ku]}}break}case"csspart":{let It=nr(Dt,rr);i.cssParts.push({name:xt,...It?{description:It}:{}});break}case"cssprop":case"cssproperty":{let It=nr(Dt,rr);i.cssProperties.push({name:xt,...cn?{type:cn}:{},...Bt===void 0?{}:{default:Bt},...It?{description:It}:{}});break}case"event":{if(ma(),et=xt,it=cn,$e=Dt.length>0?Dt[0].number:void 0,lt=dr(Ts(Dt))||sr,!lt&&$t&&!bn&&Qe)lt=Qe,bn=!0;if(Ct=pn(i,Dt),Kt.length>0)je.push(...Kt),Kt.length=0;if(Wt=(nn)=>je.push(nn),$t)$t=!1;break}case"type":if(et!==void 0)it=cn;break;case"param":if(ht!==void 0)Vt.push({name:xt,type:cn,optional:Pt||!1});break;case"returns":case"return":if(ht!==void 0)Ht=cn;break;case"property":{let It={name:xt,type:cn,description:nr(Dt,rr),optional:Pt||!1,default:Bt};if(et!==void 0)Ge(He,It,et,pn(i,Dt));else if(Xe!==void 0)Ge(at,It,Xe,pn(i,Dt));break}case"typedef":{if(ya(),Xe=Nl(xt),Je=cn,st=pn(i,Dt),nt=nr(Dt,rr)||sr,!nt&&$t&&!bn&&Qe)nt=Qe,bn=!0;if(Kt.length>0)rt.push(...Kt),Kt.length=0;if(Ze=Gn,Gn=!1,Wt=(nn)=>rt.push(nn),$t)$t=!1;break}case"callback":{if(ga(),ht=Nl(xt),gt=pn(i,Dt),mt=nr(Dt,rr)||sr,!mt&&$t&&!bn&&Qe)mt=Qe,bn=!0;if(Kt.length>0)Et.push(...Kt),Kt.length=0;if(Mt=Gn,Gn=!1,Wt=(nn)=>Et.push(nn),$t)$t=!1;break}case"generics":{let It=cn||xt;for(let nn of vn(xt))Fe(nn.trim(),pn(i,Dt));if(Re=!0,Be(),We(xt,It),$t)$t=!1;break}case"template":{let It=Ml(xt,cn,Bt);if(qu&&!Gu){i.deferredSlotBlockGenerics.push({name:xt,constraint:It});break}if(ct)break;if(Fe(xt,pn(i,Dt)),Le=!0,Be(),We(xt,It),$t)$t=!1;break}case"deprecated":{let It=Il(xt,Jt);if(et===void 0)hi??=It;else At??=It;break}case"ignore":case"internal":{if(et===void 0)Gn=!0;else bt=!0;break}case"sveld-ignore":if(et!==void 0)qe.push(xt);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let It={name:_t,body:Yt};if(!Dl.has(_t)&&!wm.has(_t))r(i,"jsdoc-unknown-tag",_t,`Unknown JSDoc tag "@${_t}"; passed through unchanged. If this is a typo, fix the tag name.`,pn(i,Dt));if(Wt)Wt(It);else Kt.push(It)}break}}if(ma(),ya(),ga(),Uu&&Kt.length>0){for(let ft of Kt)r(i,"jsdoc-tag-dropped",ft.name,`@${ft.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);Kt.length=0}}}function re(i){return i==="TSTypeAnnotation"||i==="TSTypeAliasDeclaration"||i==="TSInterfaceDeclaration"||i==="TSTypeParameterDeclaration"||i==="TSTypeParameterInstantiation"}function v(i,Ne,Ie,Re){po(i,null,null,Ne,Ie,Re?.skipTypeOnlySubtrees===!0)}function po(i,Ne,Ie,Re,Le,Me){Re(i,Ne,Ie);let Oe=i.type;if((Oe==="Identifier"||Oe==="Literal"||Oe==="Text")&&i.typeAnnotation===void 0){if(Le)Le(i);return}if(Me&&Oe.charCodeAt(0)===84&&re(Oe)){if(Le)Le(i);return}for(let Be in i){if(Be==="leadingComments")continue;let Fe=i[Be];if(!Fe||typeof Fe!=="object")continue;if(Array.isArray(Fe))for(let We=0;We<Fe.length;We++){let Ve=Fe[We];if(Ve&&typeof Ve==="object"&&typeof Ve.type==="string")po(Ve,i,Be,Re,Le,Me)}else if(typeof Fe.type==="string")po(Fe,i,Be,Re,Le,Me)}if(Le)Le(i)}import $l,{sep as uo}from"node:path";var Sn=/\.svelte$/,Bl=/\.(?:svelte|[mc]?ts|[mc]?js)$/;function ks(i){if(!i.endsWith(".svelte"))return!1;let Ne=i.length-7;if(Ne===0)return!1;let Ie=i.charCodeAt(Ne-1);return Ie!==47&&(uo==="/"||Ie!==92)}function e(i){return uo==="/"?i:i.split(uo).join("/")}function ws(i,Ne){return e($l.join(Ne,$l.normalize(i)))}function Yn(i){return`${JSON.stringify(i,null,2)}
|
|
43
|
-
`}var Fl="sveld",As="0.37.4";var jl={name:Fl,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 check --error-on-warnings .","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.14","@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",ostia:"0.2.5",svelte:"^5.57.0",typescript:"^7.0.2"},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 Br="5.57.0";var Ps=1,Vl=new WeakMap;function Wn(i){return i.some((Ne)=>Ne.internal)?i.filter((Ne)=>!Ne.internal):i}function $m(i){return{...i,props:Wn(i.props),moduleExports:Wn(i.moduleExports),slots:Wn(i.slots),events:Wn(i.events),typedefs:Wn(i.typedefs),...i.contexts?{contexts:Wn(i.contexts).map((Ne)=>({...Ne,properties:Wn(Ne.properties)}))}:{}}}function o(i,Ne={}){let Ie=Vl.get(i),Re=Ie?.get(Ne.entryExports);if(Re)return Re;let Le=Array.from(i,([,Be])=>{let{diagnostics:Fe,...We}=Be;return $m(We)}).sort((Be,Fe)=>Be.moduleName.localeCompare(Fe.moduleName)),Me={schemaVersion:Ps,generator:{name:Fl,version:As,svelteVersion:Br},total:Le.length,components:Le},Oe=Ne.entryExports?Wn(Ne.entryExports):void 0;if(Oe&&Oe.length>0)Me.totalExports=Oe.length,Me.exports=Oe;if(!Ie)Ie=new Map,Vl.set(i,Ie);return Ie.set(Ne.entryExports,Me),Me}import{readFile as Bm}from"node:fs/promises";import Fm from"node:path";var jm=/[:=]/,Ns={none:0,patch:1,minor:2,major:3};function Vm(i,Ne){return Ns[Ne]>Ns[i]?Ne:i}function Wm(i){return i.reduce((Ne,Ie)=>Vm(Ne,Ie.bump),"none")}function Ds(i,Ne){return Ns[i]>=Ns[Ne]}function Kl(i,Ne){let Ie=[],Re=0,Le="",Me=null;for(let Oe=0;Oe<i.length;Oe++){let Be=i[Oe];if(Me){if(Le+=Be,Be==="\\")Oe++,Le+=i[Oe]??"";else if(Be===Me)Me=null;continue}if(Be==='"'||Be==="'"||Be==="`"){Me=Be,Le+=Be;continue}if(Be==="<"||Be==="("||Be==="{"||Be==="[")Re++;if(Be===">"||Be===")"||Be==="}"||Be==="]")Re--;if(Be===Ne&&Re===0){Ie.push(Le.trim()),Le="";continue}Le+=Be}return Ie.push(Le.trim()),Ie}function Wl(i){return new Set(Kl(i,"|").filter((Ne)=>Ne.length>0))}function qm(i){let Ne=0,Ie=null;for(let Re=0;Re<i.length;Re++){let Le=i[Re];if(Ie){if(Le==="\\")Re++;else if(Le===Ie)Ie=null;continue}if(Le==='"'||Le==="'"||Le==="`"){Ie=Le;continue}if(Le==="<"||Le==="("||Le==="{"||Le==="[")Ne++;if(Le===">"||Le===")"||Le==="}"||Le==="]")Ne--;if(Ne===0&&Le==="="&&i[Re+1]===">")return Re}return-1}function ql(i){let Ne=qm(i);if(Ne===-1)return;let Ie=i.slice(0,Ne).trim(),Re=i.slice(Ne+2).trim();if(!Ie.startsWith("(")||!Ie.endsWith(")"))return;let Le=Ie.slice(1,-1).trim();return{params:Le.length===0?[]:Kl(Le,","),returnType:Re}}function Gm(i){return(i.split(jm,1)[0]??"").trimEnd().endsWith("?")}function Um(i,Ne){if(i.returnType!==Ne.returnType)return"major";if(Ne.params.length<i.params.length)return"major";for(let Re=0;Re<i.params.length;Re++)if(i.params[Re]!==Ne.params[Re])return"major";if(Ne.params.length===i.params.length)return"none";return Ne.params.slice(i.params.length).every(Gm)?"minor":"major"}function ho(i,Ne){if(i===Ne)return"none";if(i===void 0||Ne===void 0)return"major";let Ie=ql(i),Re=ql(Ne);if(Ie&&Re)return Um(Ie,Re);let Le=Wl(i),Me=Wl(Ne),Oe=[...Me].some((Fe)=>!Le.has(Fe)),Be=[...Le].some((Fe)=>!Me.has(Fe));if(!Oe&&!Be)return"none";if(Oe&&!Be)return"minor";if(Be&&!Oe)return"major";return"major"}function Gl(i){return i.bindable===!0||i.binding==="writable"}function Ul(i,Ne,Ie,Re){let Le=Ne==="prop"?"prop":"export",Me=[],Oe=new Map(Ie.map((Fe)=>[Fe.name,Fe])),Be=new Map(Re.map((Fe)=>[Fe.name,Fe]));for(let[Fe,We]of Be){if(Oe.has(Fe))continue;Me.push({component:i,kind:Ne,name:Fe,bump:We.isRequired?"major":"minor",message:`${Le} "${Fe}" added${We.isRequired?" (required)":""}`})}for(let[Fe]of Oe){if(Be.has(Fe))continue;Me.push({component:i,kind:Ne,name:Fe,bump:"major",message:`${Le} "${Fe}" removed`})}for(let[Fe,We]of Oe){let Ve=Be.get(Fe);if(!Ve)continue;if(We.isRequired!==Ve.isRequired)Me.push({component:i,kind:Ne,name:Fe,bump:Ve.isRequired?"major":"minor",message:`${Le} "${Fe}" became ${Ve.isRequired?"required":"optional"}`});let Ge=ho(We.type,Ve.type);if(Ge!=="none")Me.push({component:i,kind:Ne,name:Fe,bump:Ge,message:`${Le} "${Fe}" type changed from \`${We.type??"unknown"}\` to \`${Ve.type??"unknown"}\``});let Ke=Gl(We),ze=Gl(Ve);if(Ke!==ze)Me.push({component:i,kind:Ne,name:Fe,bump:ze?"minor":"major",message:`${Le} "${Fe}" ${ze?"gained a writable binding":"lost its writable binding"}`});if(We.value!==Ve.value&&Ge==="none")Me.push({component:i,kind:Ne,name:Fe,bump:"patch",message:`${Le} "${Fe}" default changed from \`${We.value??"none"}\` to \`${Ve.value??"none"}\``});let Ye=We.deprecated!==void 0,Qe=Ve.deprecated!==void 0;if(Ye!==Qe)Me.push({component:i,kind:Ne,name:Fe,bump:Qe?"minor":"patch",message:`${Le} "${Fe}" ${Qe?"marked as deprecated":"no longer deprecated"}`});if(We.constant!==Ve.constant)Me.push({component:i,kind:Ne,name:Fe,bump:"minor",message:`${Le} "${Fe}" ${Ve.constant?"became constant":"became mutable"}`});if(We.reactive!==Ve.reactive)Me.push({component:i,kind:Ne,name:Fe,bump:"minor",message:`${Le} "${Fe}" ${Ve.reactive?"became reactive":"stopped being reactive"}`})}return Me}function Hm(i,Ne,Ie){let Re=[],Le=new Map(Ne.map((Oe)=>[Oe.name,Oe])),Me=new Map(Ie.map((Oe)=>[Oe.name,Oe]));for(let[Oe]of Me){if(Le.has(Oe))continue;Re.push({component:i,kind:"event",name:Oe,bump:"minor",message:`event "${Oe}" added`})}for(let[Oe]of Le){if(Me.has(Oe))continue;Re.push({component:i,kind:"event",name:Oe,bump:"major",message:`event "${Oe}" removed`})}for(let[Oe,Be]of Le){let Fe=Me.get(Oe);if(!Fe)continue;if(Be.type!==Fe.type){Re.push({component:i,kind:"event",name:Oe,bump:"major",message:`event "${Oe}" changed from ${Be.type} to ${Fe.type}`});continue}let We=Be.type==="dispatched"?Be.detail:void 0,Ve=Fe.type==="dispatched"?Fe.detail:void 0,Ge=ho(We,Ve);if(Ge!=="none")Re.push({component:i,kind:"event",name:Oe,bump:Ge,message:`event "${Oe}" detail changed from \`${We??"unknown"}\` to \`${Ve??"unknown"}\``})}return Re}function Hl(i){return i.name??"default"}function Km(i,Ne,Ie){let Re=[],Le=new Map(Ne.map((Oe)=>[Hl(Oe),Oe])),Me=new Map(Ie.map((Oe)=>[Hl(Oe),Oe]));for(let[Oe]of Me){if(Le.has(Oe))continue;Re.push({component:i,kind:"slot",name:Oe,bump:"minor",message:`slot "${Oe}" added`})}for(let[Oe]of Le){if(Me.has(Oe))continue;Re.push({component:i,kind:"slot",name:Oe,bump:"major",message:`slot "${Oe}" removed`})}for(let[Oe,Be]of Le){let Fe=Me.get(Oe);if(!Fe)continue;let We=ho(Be.slot_props,Fe.slot_props);if(We!=="none")Re.push({component:i,kind:"slot",name:Oe,bump:We,message:`slot "${Oe}" props changed from \`${Be.slot_props??"none"}\` to \`${Fe.slot_props??"none"}\``})}return Re}var zm=new Set(["description","source","componentCommentSource","tags"]);function _s(i){if(Array.isArray(i))return i.map(_s);if(i!==null&&typeof i==="object"){let Ne={};for(let[Ie,Re]of Object.entries(i)){if(zm.has(Ie))continue;Ne[Ie]=_s(Re)}return Ne}return i}var Xm=["generics","rest_props","extends","contexts","typedefs"];function Jm(i,Ne,Ie){let Re=[];for(let Le of Xm){let Me=JSON.stringify(_s(Ne[Le])),Oe=JSON.stringify(_s(Ie[Le]));if(Me!==Oe)Re.push({component:i,kind:"shape",name:Le,bump:"major",message:`"${Le}" changed (breaking)`})}return Re}function Ym(i,Ne){let Ie=Ne.moduleName;return[...Ul(Ie,"prop",i.props,Ne.props),...Ul(Ie,"moduleExport",i.moduleExports,Ne.moduleExports),...Hm(Ie,i.events,Ne.events),...Km(Ie,i.slots,Ne.slots),...Jm(Ie,i,Ne)]}function Ce(i,Ne){let Ie=[],Re=new Map(i.components.map((Me)=>[Me.moduleName,Me])),Le=new Map(Ne.components.map((Me)=>[Me.moduleName,Me]));for(let[Me]of Le){if(Re.has(Me))continue;Ie.push({component:Me,kind:"component",bump:"minor",message:`component "${Me}" added`})}for(let[Me]of Re){if(Le.has(Me))continue;Ie.push({component:Me,kind:"component",bump:"major",message:`component "${Me}" removed`})}for(let[Me,Oe]of Re){let Be=Le.get(Me);if(!Be)continue;Ie.push(...Ym(Oe,Be))}return Ie}async function Qm(i){let Ne;try{Ne=await Bm(Fm.resolve(i),"utf-8")}catch(Ie){if(Ie.code==="ENOENT")return null;throw Ie}try{return JSON.parse(Ne)}catch{throw Error(`sveld: could not parse "${i}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function H(i){if(typeof i.check==="string")return i.check;return i.jsonOptions?.outFile??"COMPONENT_API.json"}async function M(i,Ne,Ie={}){let Re=await Qm(Ne);if(Re===null)return{snapshotExists:!1,snapshotFile:Ne,changes:[],bump:"none"};if(Re.schemaVersion!==Ps)return{snapshotExists:!0,snapshotFile:Ne,changes:[{component:"*",kind:"schema",bump:"none",message:`snapshot schemaVersion ${Re.schemaVersion} differs from ${Ps}; regenerate the snapshot`}],bump:"none"};let Le=o(i,{entryExports:Ie.entryExports}),Me=Ce(Re,Le);return{snapshotExists:!0,snapshotFile:Ne,changes:Me,bump:Wm(Me)}}var Zm={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function ne(i){if(!i.snapshotExists)return`sveld --check: no snapshot found at "${i.snapshotFile}". Run \`sveld --json\` and commit the output first.`;if(i.changes.length===0)return`sveld --check: no API changes detected against "${i.snapshotFile}".`;let Ne=[],Ie=i.changes.length;Ne.push(`sveld --check: ${Ie} API change${Ie===1?"":"s"} detected against "${i.snapshotFile}".`),Ne.push(`Suggested semver bump: ${i.bump}.`);let Re=new Map;for(let Le of i.changes){let Me=Re.get(Le.component)??[];Me.push(Le),Re.set(Le.component,Me)}for(let[Le,Me]of Re){Ne.push(""),Ne.push(` ${Le}`);for(let Oe of Me){let Be=Oe.kind==="schema"?"schema":Zm[Oe.bump];Ne.push(` [${Be}] ${Oe.message}`)}}return Ne.join(`
|
|
44
|
-
`)}var Pe=1;function se(i){let Ne={kind:"check-report",schemaVersion:Pe,...i};return Yn(Ne)}import{existsSync as ty}from"node:fs";import{join as ny}from"node:path";import{pathToFileURL as ry}from"node:url";function ey(i,Ne){let Ie=i.length+1,Re=Ne.length+1,Le=Array.from({length:Ie},()=>Array(Re).fill(0));for(let Me=0;Me<Ie;Me++)Le[Me][0]=Me;for(let Me=0;Me<Re;Me++)Le[0][Me]=Me;for(let Me=1;Me<Ie;Me++)for(let Oe=1;Oe<Re;Oe++){let Be=i[Me-1]===Ne[Oe-1]?0:1;Le[Me][Oe]=Math.min(Le[Me-1][Oe]+1,Le[Me][Oe-1]+1,Le[Me-1][Oe-1]+Be)}return Le[Ie-1][Re-1]}function Is(i,Ne){let Ie,Re=Number.POSITIVE_INFINITY;for(let Le of Ne){let Me=ey(i,Le);if(Me<Re)Ie=Le,Re=Me}if(Ie===void 0||Re>3)return;return Ie}var sy=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function De(i){return i}function iy(i=process.cwd()){for(let Ne of sy){let Ie=ny(i,Ne);if(ty(Ie))return Ie}return null}async function mo(i){let Ne;try{Ne=await import(`${ry(i).href}?t=${Date.now()}`)}catch(Re){let Le=Re instanceof Error?Re.message:String(Re);throw Error(`sveld: failed to load config file "${i}".
|
|
45
|
-
${Le}`)}let Ie=Ne.default;if(!Ot(Ie)||Array.isArray(Ie))throw Error(`sveld: config file "${i}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return Ie}async function _(i=process.cwd()){let Ne=iy(i);if(Ne===null)return{};return mo(Ne)}function E(...i){let Ne={};for(let Ie of i){if(!Ie)continue;for(let[Re,Le]of Object.entries(Ie)){let Me=Ne[Re];Ne[Re]=Ot(Me)&&!Array.isArray(Me)&&Ot(Le)&&!Array.isArray(Le)?{...Me,...Le}:Le}}return Ne}var oy={ci:{strict:!0,reportDiagnostics:!0,check:!0,checkExamples:!0},local:{reportDiagnostics:!0}};function G(i){let{strict:Ne,...Ie}=i;if(Ne!=="ci"&&Ne!=="local")return i;return{...oy[Ne],...Ie}}var zl=["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"],ay={typesOptions:["outDir","preamble","format","exportTypes","typeNames","comments","propsDeclaration","transform","indexTypes","inline","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 Xl(i,Ne,Ie){let Re=i===null?Ne:`${i}.${Ne}`,Le=Is(Ne,Ie),Me=Le===void 0?void 0:i===null?Le:`${i}.${Le}`;console.warn(`sveld: unknown option "${Re}".${Me?` Did you mean "${Me}"?`:""}`)}function N(i){for(let Ne of Object.keys(i))if(!zl.includes(Ne))Xl(null,Ne,zl);for(let[Ne,Ie]of Object.entries(ay)){let Re=i[Ne];if(!Ot(Re))continue;for(let Le of Object.keys(Re))if(!Ie.includes(Le))Xl(Ne,Le,Ie)}}var Rs=new Map;function k(i,Ne){if(!Ne?.replace&&Rs.has(i.name))throw Error(`sveld: a writer named "${i.name}" is already registered. Pass { replace: true } to overwrite it.`);Rs.set(i.name,i)}function z(i){return Rs.get(i)}function _e(){return Array.from(Rs.values())}import{dirname as Pu,isAbsolute as Y0,resolve as Q0}from"node:path";import{existsSync as Yp,lstatSync as eu,readFileSync as Ax,realpathSync as Px,statSync as tu}from"node:fs";import{readFile as Nx}from"node:fs/promises";import{basename as _x,dirname as nu,extname as Dx,isAbsolute as Ix,join as Qp,parse as Rx,relative as Go,resolve as Er}from"node:path";function Fr(i){return i}function In(i){if(i==="")return i;return i.startsWith(".")?i:`./${i}`}import{dirname as Yl,resolve as Ql}from"node:path";var cy=/^(['"])(.*)\1$/,Zl=/^[./]/,ly=/import\(\s*(['"])((?:(?!\1).)+)\1\s*\)/g;function py(i,Ne){let Ie=i.extends?.import;if(Ie===void 0)return null;let Re=Ie.replace(cy,"$2");if(!Zl.test(Re))return null;return Ql(Yl(Ne),Re)}function Jl(i,Ne){let Ie=[];for(let Re of i.matchAll(ly)){let Le=Re[2];if(!Zl.test(Le))continue;Ie.push(Ql(Yl(Ne),Le))}return Ie}function uy(i,Ne){let Ie=[],Re=py(i,Ne);if(Re!==null)Ie.push(Re);for(let Le of i.typedefs??[])Ie.push(...Jl(Le.type,Ne));for(let Le of i.props)if(Le.type)Ie.push(...Jl(Le.type,Ne));return Ie}function jr(i,Ne){let Ie=new Map;for(let Re of i.values()){let Le=Ne(Re.filePath);for(let Me of uy(Re,Le)){let Oe=Ie.get(Me);if(Oe===void 0)Oe=new Set,Ie.set(Me,Oe);Oe.add(Le)}}return Ie}function Ls(i,Ne){let Ie=new Set,Re=[];for(let Le of i)if(!Ie.has(Le))Ie.add(Le),Re.push(Le);while(Re.length>0){let Le=Re.shift(),Me=Ne.get(Le);if(Me===void 0)continue;for(let Oe of Me)if(!Ie.has(Oe))Ie.add(Oe),Re.push(Oe)}return Ie}var dy=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,fy=new Set(["","js","jsx","ts","tsx","javascript","typescript"]),hy=new Set(["svelte","html"]);function my(i){let Ne=i.trim();if(Ne==="")return null;let Ie=Ne.match(dy);if(Ie){let Re=Ie[1].toLowerCase(),Le=Ie[2].trim();if(Le==="")return null;if(fy.has(Re))return{kind:"compile",code:Le};if(hy.has(Re))return{kind:"syntax",code:Le};return null}if(Ne.startsWith("<"))return null;return{kind:"compile",code:Ne}}function ep(i){if(!i.isFunction)return"any";return`(${(i.params??[]).map((Ie)=>`${Ie.name}${Ie.optional?"?":""}: any`).join(", ")}) => any`}function Os(i,Ne,Ie,Re,Le){let Me=(i??[]).filter((Be)=>Be.name==="example"),Oe=[];return Me.forEach((Be,Fe)=>{let We=my(Be.body);if(We===null)return;let Ve=Me.length>1;Oe.push({id:Ve?`${Ne}#${Fe}`:Ne,name:Ve?`${Ie} (example ${Fe+1})`:Ie,type:Re,code:We.code,kind:We.kind,...Le?{source:Le}:{}})}),Oe}function tp(i){return i.name??"default"}function np(i){let Ne=[];for(let Ie of i.props)Ne.push(...Os(Ie.tags,`prop:${Ie.name}`,Ie.name,ep(Ie),Ie.source));for(let Ie of i.moduleExports)Ne.push(...Os(Ie.tags,`export:${Ie.name}`,Ie.name,ep(Ie),Ie.source));for(let Ie of i.slots)Ne.push(...Os(Ie.tags,`slot:${tp(Ie)}`,tp(Ie),"any",Ie.source));for(let Ie of i.events)Ne.push(...Os(Ie.tags,`event:${Ie.name}`,Ie.name,"any",Ie.source));return Ne}import{existsSync as yy,readdirSync as gy}from"node:fs";import{join as xy}from"node:path";var yo=new Map;function Ms(){yo.clear()}function $s(i){let Ne=yo.get(i);if(Ne!==void 0)return Ne;try{let Ie=gy(i,{withFileTypes:!0}),Re=new Set;for(let Le of Ie)Re.add(Le.name);Ne={entries:Ie,names:Re}}catch{Ne=null}return yo.set(i,Ne),Ne}function Bs(i,Ne){let Ie=$s(i);if(Ie===null)return;if(Ie.byName===void 0){Ie.byName=new Map;for(let Re of Ie.entries)Ie.byName.set(Re.name,Re)}return Ie.byName.get(Ne)}function rp(i){return i.normalize("NFC").toLowerCase()}function Tn(i,Ne){let Ie=$s(i);if(Ie===null)return!1;if(Ie.names.has(Ne))return!0;if(Ie.folded===void 0){Ie.folded=new Map;for(let Le of Ie.names)Ie.folded.set(rp(Le),Le)}let Re=Ie.folded.get(rp(Ne));return Re!==void 0&&Re!==Ne&&yy(xy(i,Ne))}import{lstatSync as Ng,readFileSync as _g}from"node:fs";import{basename as Dg,dirname as Do,join as Dp,resolve as Ig}from"node:path";import{existsSync as Vs,readFileSync as by}from"node:fs";import{dirname as go,isAbsolute as Ey,join as Cy,relative as vy,resolve as Ws}from"node:path";function Fs(i){if(!Ot(i))return{};let Ne={};if(typeof i.svelte==="string")Ne.svelte=i.svelte;if(typeof i.name==="string")Ne.name=i.name;if(typeof i.description==="string")Ne.description=i.description;return Ne}function sp(i){if(!Ot(i))return{};let Ne={};if(typeof i.extends==="string")Ne.extends=i.extends;if(Ot(i.compilerOptions)){let Ie={};if(typeof i.compilerOptions.baseUrl==="string")Ie.baseUrl=i.compilerOptions.baseUrl;if(Ot(i.compilerOptions.paths)){let Re={};for(let[Le,Me]of Object.entries(i.compilerOptions.paths))if(Array.isArray(Me)&&Me.every((Oe)=>typeof Oe==="string"))Re[Le]=Me;if(Object.keys(Re).length>0)Ie.paths=Re}if(Object.keys(Ie).length>0)Ne.compilerOptions=Ie}return Ne}var js=new Map,ip=new Map,Sy=/\/\*[\s\S]*?\*\/|\/\/.*/g,Ty=/[.+?^${}()|[\]\\]/g,ky=[".svelte",".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".d.ts"];class fr extends Error{specifier;fromFile;searched;constructor(i,Ne,Ie){super(`cannot resolve "${i}" from ${Ne||"."} (${Ie})`);this.name="UnresolvedModuleError",this.specifier=i,this.fromFile=Ne,this.searched=Ie}}function wy(i){if(Vs(i))return!0;return ky.some((Ne)=>Vs(i+Ne))}function op(i){let Ne=i.indexOf("*");return Ne===-1?i.length:Ne}function Ay(i){let Ne=i,Ie=Ws(Ne,"/");while(Ne!==Ie){for(let Re of["tsconfig.json","jsconfig.json"]){let Le=Cy(Ne,Re);if(Vs(Le))return Le}Ne=go(Ne)}return null}function ap(i){if(js.has(i))return js.get(i)??null;try{let Ne=by(i,"utf-8"),Ie;try{Ie=JSON.parse(Ne)}catch{let Le=Ne.replace(Sy,"");Ie=JSON.parse(Le)}let Re=sp(Ie);if(Re.extends){let Le=Ey(Re.extends)?Re.extends:Ws(go(i),Re.extends),Me=Le.endsWith(".json")?Le:`${Le}.json`;if(Vs(Me)){let Oe=ap(Me);if(Oe)Re.compilerOptions={...Oe.compilerOptions,...Re.compilerOptions,paths:{...Oe.compilerOptions?.paths,...Re.compilerOptions?.paths}}}}return js.set(i,Re),Re}catch{return js.set(i,null),null}}function Py(i){let Ne=ip.get(i);if(!Ne){let Ie=i.split("*").map((Re)=>Re.replace(Ty,"\\$&")).join("(.*)");Ne=new RegExp(`^${Ie}$`),ip.set(i,Ne)}return Ne}function hr(i,Ne){if(i.startsWith(".")||i.startsWith("/"))return{resolved:i,unresolved:!1,searched:""};let Ie=Ay(Ne);if(!Ie)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let Re=ap(Ie);if(!Re?.compilerOptions?.paths)return{resolved:i,unresolved:!0,searched:"no tsconfig/jsconfig paths found"};let{baseUrl:Le=".",paths:Me}=Re.compilerOptions,Oe=go(Ie),Be=Ws(Oe,Le),Fe=Object.entries(Me).sort(([We],[Ve])=>op(Ve)-op(We));for(let[We,Ve]of Fe){let Ge=i.match(Py(We));if(!Ge)continue;let Ke;for(let ze of Ve){let Ye=ze;for(let tt=1;tt<Ge.length;tt++)Ye=Ye.replace("*",Ge[tt]);let Qe=Ws(Be,Ye);if(Ke===void 0)Ke=Qe;if(wy(Qe))return{resolved:Qe,unresolved:!1,searched:Ie}}return{resolved:Ke??i,unresolved:!1,searched:Ie}}return{resolved:i,unresolved:!0,searched:`tsconfig paths (${Ie})`}}function xo(i,Ne){return hr(i,Ne).resolved}function qs(i,Ne){if(i.startsWith(".")||i.startsWith("/"))return i;let Ie=xo(i,Ne);if(Ie===i)return i;let Re=vy(Ne,Ie);return Re=e(Re),Re.startsWith(".")?Re:`./${Re}`}var Ny=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var pp=/\s/,_y=/\s{2}|[^\S ]/,Dy=/["'`{}/]/g,Iy=/["'`{};/]/g;function Ry(i){return Ny.test(i.slice(-200))}var cp=[""];function Ly(i){let Ne=cp[i];if(Ne===void 0)Ne=" ".repeat(i),cp[i]=Ne;return Ne}function Oy(i,Ne){let Ie="";for(let Re=i.length-1;Re>=0&&Ie.length<Ne;Re--)Ie=i[Re]+Ie;return Ie.length>Ne?Ie.slice(-Ne):Ie}function My(i){if(i.length===0)return!1;let Ne=i[i.length-1];return Ne.charCodeAt(Ne.length-1)===10}function $y(i){while(i.length>0){let Ne=i[i.length-1],Ie=Ne.length;while(Ie>0){let Re=Ne.charCodeAt(Ie-1);if(Re!==32&&Re!==9)break;Ie--}if(Ie===Ne.length)return;if(Ie===0){i.pop();continue}i[i.length-1]=Ne.slice(0,Ie);return}}function By(i){while(i.length>0){let Ne=i[i.length-1];if(!pp.test(Ne[Ne.length-1]))return;let Ie=Ne.trimEnd();if(Ie.length===Ne.length)return;if(Ie.length===0){i.pop();continue}i[i.length-1]=Ie;return}}function Fy(i){if(i.includes("{"))return!1;let Ne=0,Ie=0;for(let Re=0;Re<i.length;Re++){let Le=i.charCodeAt(Re);if(Ne!==0){if(Le===Ne&&i.charCodeAt(Re-1)!==92)Ne=0;continue}if(Le===34||Le===39||Le===96){Ne=Le;continue}if(Le===59&&++Ie>=2)return!0}return!1}function jy(i){if(!_y.test(i))return i.trimEnd();let Ne="",Ie=null,Re=!1;for(let Le=0;Le<i.length;Le++){let Me=i[Le],Oe=i[Le-1];if(Ie){if(Ne+=Me,Ie==="double"&&Me==='"'&&Oe!=="\\"||Ie==="single"&&Me==="'"&&Oe!=="\\"||Ie==="template"&&Me==="`"&&Oe!=="\\")Ie=null;Re=!1;continue}if(Me==='"'||Me==="'"||Me==="`"){Ie=Me==='"'?"double":Me==="'"?"single":"template",Ne+=Me,Re=!1;continue}if(pp.test(Me)){if(!Re&&Ne.length>0)Ne+=" ",Re=!0;continue}Ne+=Me,Re=!1}return Ne.trimEnd()}function up(i,Ne){let Ie=i[Ne],Re=i.indexOf(Ie,Ne+1);while(Re!==-1&&i.charCodeAt(Re-1)===92)Re=i.indexOf(Ie,Re+1);return Re}function dp(i,Ne){let Ie=i.indexOf("*/",Ne+1);return Ie===-1?-1:Ie+1}function Vy(i){let Ne=new Map,Ie=[],Re=Dy,Le=0;while(Le<i.length){if(Re.lastIndex=Le,!Re.test(i))break;Le=Re.lastIndex-1;let Me=i.charCodeAt(Le);if(Me===47){if(i.charCodeAt(Le+1)===42){let Oe=dp(i,Le);if(Oe===-1)break;Le=Oe}}else if(Me===34||Me===39||Me===96){let Oe=up(i,Le);if(Oe===-1)break;Le=Oe}else if(Me===123)Ie.push(Le);else if(Me===125&&Ie.length>0)Ne.set(Ie.pop(),Le);Le++}return Ne}function Wy(i,Ne,Ie){for(let Re=Ne;Re<Ie;Re++)if(!bo(i.charCodeAt(Re)))return!1;return!0}function bo(i){if(i<=32)return i===32||i>=9&&i<=13;if(i<160)return!1;return i===160||i===5760||i>=8192&&i<=8202||i===8232||i===8233||i===8239||i===8287||i===12288||i===65279}function fp(i,Ne,Ie,Re){let Le=[],Me=Iy,Oe=Ne,Be=Ne;while(Be<Ie){if(Me.lastIndex=Be,!Me.test(i))break;if(Be=Me.lastIndex-1,Be>=Ie)break;let Fe=i.charCodeAt(Be);if(Fe===47){if(i.charCodeAt(Be+1)===42){let We=dp(i,Be);if(We===-1)break;Be=We}Be++;continue}if(Fe===34||Fe===39||Fe===96){let We=up(i,Be);if(We===-1)break;Be=We+1;continue}if(Fe===123){let We=Re.get(Be);if(We===void 0||We>=Ie){Be++;continue}if(Oe<Be)Le.push(i.slice(Oe,Be));let Ve=Be+1;if(Wy(i,Ve,We)){Le.push("{}"),Be=We+1,Oe=Be;continue}let Ge=i.slice(Ve,We),Ke=i.charCodeAt(Ve)===10;if(!Ke&&!Ge.includes("/*")&&!Fy(Ge)&&!Ry(Oy(Le,200))){let ze=fp(i,Ve,We,Re),Ye=ze.trim();if(!Ye.includes(`
|
|
46
|
-
`)){let Qe=Ye.endsWith(";")?Ye.slice(0,-1):Ye,tt=`{ ${jy(Qe)} }`;if(tt.length<=120){Le.push(tt),Be=We+1,Oe=Be;continue}}if(Le.push("{"),ze.charCodeAt(0)!==59)Le.push(`
|
|
47
|
-
`);if(ze.length>0)Le.push(ze);Be=We,Oe=We;continue}if(Le.push("{"),!Ke)Le.push(`
|
|
48
|
-
`);Be=Ve,Oe=Ve;continue}if(Fe===125){if(Oe<Be)Le.push(i.slice(Oe,Be));if($y(Le),!My(Le))Le.push(`
|
|
49
|
-
`);Le.push("}"),Be++,Oe=Be;continue}if(Oe<Be)Le.push(i.slice(Oe,Be));if(By(Le),Le.push(";"),i.charCodeAt(Be+1)!==10)Le.push(`
|
|
50
|
-
`);Be++,Oe=Be}if(Oe<Ie)Le.push(i.slice(Oe,Ie));return Le.join("")}function qy(i){return fp(i,0,i.length,Vy(i))}function Gy(i){if(!i.includes(" "))return i;let Ne="",Ie=0;for(let Re=0;Re<i.length;Re++){let Le=i.charCodeAt(Re);if(Ie!==0){if(Ne+=i[Re],Le===Ie&&i.charCodeAt(Re-1)!==92)Ie=0;continue}if(Le===34||Le===39||Le===96){Ie=Le,Ne+=i[Re];continue}if(Le===32&&Ne.charCodeAt(Ne.length-1)===32)continue;Ne+=i[Re]}return Ne}function Uy(i){return i===125||i===93||i===41||i===62}function Hy(i,Ne,Ie){return Ie-Ne>=3&&i.charCodeAt(Ne)===47&&i.charCodeAt(Ne+1)===42&&i.charCodeAt(Ne+2)===42}function lp(i,Ne,Ie){let Re=i.indexOf("*/",Ne);return Re!==-1&&Re+2<=Ie}function Ky(i){let Ne=[],Ie=[],Re=i.length,Le=0,Me=!1,Oe=0,Be=0;while(Be<=Re){let Ve=i.indexOf(`
|
|
51
|
-
`,Be);if(Ve===-1)Ve=Re;let Ge=Ve+1,Ke=Be,ze=Ve;while(Ke<ze&&bo(i.charCodeAt(Ke)))Ke++;while(ze>Ke&&bo(i.charCodeAt(ze-1)))ze--;if(Ke===ze){let et=Ie.length>0?Ie[Ie.length-1]:void 0;if(et!==void 0&&et!==""){let it=et.charCodeAt(et.length-1);if(it!==123&&it!==40&&it!==91)Ne.push(0),Ie.push("")}Be=Ge;continue}if(Me){if(Ne.push(Oe),Ie.push(` ${i.slice(Ke,ze)}`),lp(i,Ke,ze))Me=!1;Be=Ge;continue}let Ye=Hy(i,Ke,ze),Qe=Ye&&lp(i,Ke,ze);if(Ye&&!Qe){Ne.push(Le),Ie.push(i.slice(Ke,ze)),Me=!0,Oe=Le,Be=Ge;continue}let tt=Uy(i.charCodeAt(Ke)),ot=Math.max(0,Le-(tt?1:0));if(tt&&ot===0&&Ie.length>0&&Ie[Ie.length-1]==="")Ne.pop(),Ie.pop();if(Ne.push(ot),Ie.push(Gy(i.slice(Ke,ze))),Be=Ge,Qe)continue;let ct=0;for(let et=Ke;et<ze;et++){let it=i.charCodeAt(et);if(ct!==0){if(it===ct&&i.charCodeAt(et-1)!==92)ct=0;continue}if(it===34||it===39||it===96)ct=it;else if(it===123||it===40||it===91||it===60)Le++;else if(it===125||it===41||it===93)Le=Math.max(0,Le-1);else if(it===62&&i.charCodeAt(et-1)!==61)Le=Math.max(0,Le-1)}}let Fe=Ie.length;while(Fe>0&&Ie[Fe-1]==="")Fe--;let We=[];for(let Ve=0;Ve<Fe;Ve++){if(Ve>0)We.push(`
|
|
52
|
-
`);let Ge=Ne[Ve];if(Ge>0)We.push(Ly(Ge));We.push(Ie[Ve])}return We.join("")}function hp(i){return`${Ky(qy(i))}
|
|
53
|
-
`}var Rn="any",on="",zy="Record<string, any>",Co="Record<string, never>",vo=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Xy=/CustomEvent/,Jy=/^[A-Z]/,Yy=/\n/,bp=/=>/,Qy=/(?:^|\n)@default\b/,So=/\n/g,Zy=/\s+/g,mr=/(^|[^.\w])Snippet(?:\s*<|\b)/,eg=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,tg=/[.*+?^${}()|[\]\\]/g,ng=/^const\s+/,rg=/\{name\}/g;function To(i){return i.replace(ng,"")}function sg(i){if(!i)return;return i.replace(So,`
|
|
54
|
-
* `)}function Gs(i){if(!i)return"";return`/** ${i} */`}function Us(i){if(!i)return"";return`/**
|
|
55
|
-
* ${i.replace(So,`
|
|
56
|
-
* `)}
|
|
57
|
-
*/`}function Ep(i){if(i===void 0)return;return i===!0?"@deprecated":`@deprecated ${i}`}function ig(i){let Ne=Ep(i);if(Ne===void 0)return;return`* ${Ne.replace(So,`
|
|
58
|
-
* `)}
|
|
59
|
-
`}function og(i,Ne){if(!Ne)return[`@${i}`];if(!Ne.includes(`
|
|
60
|
-
`))return[`@${i} ${Ne}`];return[`@${i}`,...Ne.split(`
|
|
61
|
-
`)]}function ko(i){let Ne=[];for(let{name:Ie,body:Re}of i??[])Ne.push(...og(Ie,Re));return Ne}function Vr(i,Ne,Ie){let Re=Ep(Ie),Le=ko(Ne),Me=Le.length>0;if(!i&&!Me&&!Re)return"";if(!Me&&!Re)return i?.includes(`
|
|
62
|
-
`)?Us(i):Gs(i);let Oe=[];if(i)Oe.push(...i.split(`
|
|
63
|
-
`));if(Oe.push(...Le),Re)Oe.push(...Re.split(`
|
|
64
|
-
`));return`/**
|
|
65
|
-
* ${Oe.join(`
|
|
66
|
-
* `)}
|
|
67
|
-
*/`}function ag(i){let Ne=ko(i);if(Ne.length===0)return"";return Ne.map((Ie)=>`* ${Ie}
|
|
68
|
-
`).join("")}function Hs(i){if(i===void 0)return Rn;return`${i}
|
|
69
|
-
`}function gr(i,Ne={export:!0},Ie="all"){if(i.typedefs.length===0)return on;let Re=Ne.export?"export ":"";return i.typedefs.map((Le)=>{let Me=on;if(Ie!=="none"){let Oe=Ie==="all"?ko(Le.tags):[];if(Oe.length===0)Me=Le.description?`${Us(Le.description)}
|
|
70
|
-
`:"";else Me=`/**
|
|
71
|
-
* ${(Le.description?[...Le.description.split(`
|
|
72
|
-
`),...Oe]:Oe).join(`
|
|
73
|
-
* `)}
|
|
74
|
-
*/
|
|
75
|
-
`}return`${Me}${Re}${Le.ts}`}).join(`
|
|
76
|
-
|
|
77
|
-
`)}var mp=new Map;function Cp(i,Ne){let Ie=mp.get(Ne);if(Ie===void 0){let Re=Ne.replace(tg,"\\$&");Ie=new RegExp(`\\b${Re}\\b`),mp.set(Ne,Ie)}return Ie.test(i)}var yp,gp=[];function wo(i){if(i!==yp)yp=i,gp=vn(i);return gp}function cg(i){if(i===null)return[];return i[0].split(",").map((Ne,Ie)=>({name:Ne.trim(),constraint:(wo(i[1]??"")[Ie]??Ne).trim()}))}function lg(i,Ne){let Ie=cg(i).filter(({name:Re})=>Cp(Ne,Re));if(Ie.length===0)return{declSuffix:on,refSuffix:on};return{declSuffix:`<${Ie.map(({constraint:Re})=>To(Re)).join(", ")}>`,refSuffix:`<${Ie.map(({name:Re})=>Re).join(", ")}>`}}function vp(i,Ne={export:!0},Ie="all"){if(!i.contexts||i.contexts.length===0)return on;let Re=Ne.export?"export ":"",Le=i.generics===null?[]:i.generics[0].split(",").map((Me,Oe)=>({name:Me.trim(),constraint:(wo(i.generics?.[1]??"")[Oe]??Me).trim()}));return i.contexts.map((Me)=>{let Oe=Me.properties.map((Ge)=>{let Ke=Ie!=="none"&&Ge.description?`${Gs(Ge.description)}
|
|
78
|
-
`:"",ze=Ge.optional?"?":"";return`${Ke}${Ge.name}${ze}: ${Ge.type};`}).join(`
|
|
79
|
-
`),Be=Ie!=="none"&&Me.description?`${Us(Me.description)}
|
|
80
|
-
`:"",Fe=Le.filter(({name:Ge})=>Me.properties.some((Ke)=>Cp(Ke.type,Ge))).map(({constraint:Ge})=>Ge),We=Fe.length>0?`<${Fe.map(To).join(", ")}>`:"";if(Me.properties.length===0)return Me.hasUnresolvedSpread?`${Be}${Re}type ${Me.typeName} = Record<string, any>;`:`${Be}${Re}type ${Me.typeName} = Record<string, never>;`;let Ve=Me.hasUnresolvedSpread?" & Record<string, any>":"";return`${Be}${Re}type ${Me.typeName}${We} = {
|
|
81
|
-
${Oe}
|
|
82
|
-
}${Ve};`}).join(`
|
|
83
|
-
|
|
84
|
-
`)}function yr(i){return vo.test(i)?i:JSON.stringify(i)}function Sp(i,Ne){if(!i)return;return`* ${Ne||i}
|
|
85
|
-
`}function Ks(i,Ne,Ie,Re="all"){if(Re==="none")return on;return[Sp(sg(i)),ig(Ne),Re==="all"?ag(Ie):void 0].filter(Boolean).join("")}function Wr(i){return i.length>0?`/**
|
|
86
|
-
${i}*/`:on}function pg(i,Ne={export:!0},Ie="all"){let Re=Ne.export?"export ":"",Le=i.props.filter((et)=>!et.isFunctionDeclaration&&et.kind!=="const"),Me=new Set([...Le.map((et)=>et.name),...Array.from(i.canonicalPropNames??[])]),Oe=Le.map((et)=>{let it=typeof et.value==="string"?et.value.replace(Zy," "):et.value,At=Qy.test(et.description??"")||et.value===void 0,bt=[Ks(et.description,et.deprecated,et.tags,Ie),Ie==="all"?Sp(et.constant,"@constant"):null,Ie==="all"&&!At?`* @default ${it}
|
|
87
|
-
`:null].filter(Boolean).join(""),Ct=et.constant&&!et.isFunction?et.value:et.type||Rn;return`
|
|
88
|
-
${Wr(bt)}
|
|
89
|
-
${yr(et.name)}${et.isRequired?"":"?"}: ${Ct};`}),Be=i.canonicalPropsType?Oe.filter((et,it)=>{let lt=Le[it];return lt?!(i.canonicalPropNames?.has(lt.name)??!1):!0}):Oe,Fe=(i.slots||[]).filter((et)=>!et.default&&et.name!=null&&!Me.has(et.name)).map((et)=>{let it=et.name,lt=yr(it),At=Vr(et.description,et.tags,et.deprecated),bt=At?`${At}
|
|
90
|
-
`:"",$e=et.slot_props&&et.slot_props!=="Record<string, never>"?`(this: void, ...args: [${et.slot_props}]) => void`:"(this: void) => void";return`
|
|
91
|
-
${bt}${lt}?: ${$e};`}),We=(i.slots||[]).find((et)=>et.default||et.name===null),Ve=We&&!Me.has("children")?(()=>{let et=Vr(We.description,We.tags,We.deprecated),it=et?`${et}
|
|
92
|
-
`:"",At=We.slot_props&&We.slot_props!=="Record<string, never>"?`(this: void, ...args: [${We.slot_props}]) => void`:"(this: void) => void";return`
|
|
93
|
-
${it}children?: ${At};`})():"",Ge=i.events?yg({events:i.events},Me):[],Ke=[...Fe,Ve,...Ge].filter(Boolean),ze=[...Be,...Ke].join(`
|
|
94
|
-
`),Ye=Ln(i.moduleName,Ne.typeNames),Qe=on,tt=i.generics?`<${wo(i.generics[1]).map((et)=>To(et.trim())).join(", ")}>`:"",ot=i.generics?`<${i.generics[0]}>`:"",ct=i.canonicalPropsType?`
|
|
95
|
-
type $Props${tt} = ${i.canonicalPropsType}${ze.trim()===""?"":` & {${ze}
|
|
96
|
-
}`};
|
|
97
|
-
`:`
|
|
98
|
-
type $Props${tt} = {
|
|
99
|
-
${ze}
|
|
100
|
-
};
|
|
101
|
-
`;if(i.rest_props?.type==="Element"){let et;if(i.rest_props.name==="svelte:element")if(i.rest_props.thisValue)et=`SvelteHTMLElements["${i.rest_props.thisValue}"]`;else et="HTMLAttributes<HTMLElement>";else et=i.rest_props.name.split("|").map((At)=>`SvelteHTMLElements["${At.trim()}"]`).join(" & ");let it="[key: `data-${string}`]: unknown;",lt=i.rest_props.description?i.rest_props.description.includes(`
|
|
102
|
-
`)?`${Us(i.rest_props.description)}
|
|
103
|
-
`:`${Gs(i.rest_props.description)}
|
|
104
|
-
`:"";if(i.extends===void 0)Qe=`
|
|
105
|
-
${lt}${et?`type $RestProps = ${et};
|
|
106
|
-
`:""}
|
|
107
|
-
${i.canonicalPropsType?`type $Props${tt} = (${i.canonicalPropsType}) & {${ze}
|
|
108
|
-
|
|
109
|
-
${it}
|
|
110
|
-
};`:`type $Props${tt} = {
|
|
111
|
-
${ze}
|
|
112
|
-
|
|
113
|
-
${it}
|
|
114
|
-
};`}
|
|
115
|
-
|
|
116
|
-
${Re}type ${Ye}${tt} = Omit<$RestProps, keyof $Props${ot}> & $Props${ot};
|
|
117
|
-
`;else Qe=`
|
|
118
|
-
${lt}${et?`type $RestProps = ${et};
|
|
119
|
-
`:""}
|
|
120
|
-
${i.canonicalPropsType?`type $Props${tt} = (${i.canonicalPropsType}) & {${ze}
|
|
121
|
-
|
|
122
|
-
${it}
|
|
123
|
-
};`:`type $Props${tt} = {
|
|
124
|
-
${ze}
|
|
125
|
-
|
|
126
|
-
${it}
|
|
127
|
-
};`}
|
|
128
|
-
|
|
129
|
-
${Re}type ${Ye}${tt} = Omit<$RestProps, keyof ($Props${ot} & ${i.extends.interface})> & Omit<${i.extends.interface}, keyof $Props${ot}> & $Props${ot};
|
|
130
|
-
`}else if(ze.trim()===""&&i.extends===void 0&&!i.canonicalPropsType)Qe=`
|
|
131
|
-
${Re}type ${Ye}${tt} = ${Co};
|
|
132
|
-
`;else if(i.canonicalPropsType)Qe=`
|
|
133
|
-
${ct}
|
|
134
|
-
${Re}type ${Ye}${tt} = ${i.extends===void 0?"":`Omit<${i.extends.interface}, keyof $Props${ot}> & `}$Props${ot};
|
|
135
|
-
`;else if(i.extends===void 0)Qe=Ne.propsDeclaration==="interface"&&ze.trim()!==""?`
|
|
136
|
-
${Re}interface ${Ye}${tt} {
|
|
137
|
-
${ze}
|
|
138
|
-
}
|
|
139
|
-
`:`
|
|
140
|
-
${Re}type ${Ye}${tt} = {
|
|
141
|
-
${ze}
|
|
142
|
-
};
|
|
143
|
-
`;else Qe=`
|
|
144
|
-
type $Props${tt} = {
|
|
145
|
-
${ze}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
${Re}type ${Ye}${tt} = Omit<${i.extends.interface}, keyof $Props${ot}> & $Props${ot};
|
|
149
|
-
`;return{props_name:Ye,prop_def:Qe}}function ug(i){if(i.slots.length===0)return Co;let Ne=i.slots.map(({name:Ie,slot_props:Re,...Le})=>{let Me=Le.default||Ie===null?"default":yr(Ie??""),Oe=Vr(Le.description,Le.tags,Le.deprecated);return`${Oe?`${Oe}
|
|
150
|
-
`:""}${Me}: ${Hs(Re)};`}).join(`
|
|
151
|
-
`);return i.slots.length===1?`{${Ne}}`:`{
|
|
152
|
-
${Ne}
|
|
153
|
-
}`}var dg=()=>"WindowEventMap",fg=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 Eo(i=Rn){if(Xy.test(i))return i;return`CustomEvent<${i}>`}function hg(i){return fg.has(i)}function Tp(i){switch(i.type){case"dispatched":return Eo(i.detail);case"forwarded":{let Ne=i.element,Re=!(Ne&&Jy.test(Ne))||hg(i.name),Le=i.detail!==void 0&&i.detail!=="undefined"&&!(i.detail==="null"&&Re),Me=i.detail==="null"&&!Re;if(Le||Me)return Eo(i.detail);else if(Re)return`${dg()}["${i.name}"]`;else return Eo()}default:return i}}function mg(i){if(i.events.length===0)return zy;let Ne=i.events.map((Ie)=>{let Re="",Le=Vr(Ie.description,Ie.tags,Ie.deprecated);if(Le)Re=`${Le}
|
|
154
|
-
`;return`${Re}${yr(Ie.name)}: ${Tp(Ie)};
|
|
155
|
-
`}).join("");return i.events.length===1?`{${Ne}}`:`{
|
|
156
|
-
${Ne}}`}function yg(i,Ne){return i.events.map((Ie)=>{let Re=`on${Ie.name}`;if(Ne.has(Re))return;let Le="",Me=Vr(Ie.description,Ie.tags,Ie.deprecated);if(Me)Le=`${Me}
|
|
157
|
-
`;return`
|
|
158
|
-
${Le}${yr(Re)}?: (event: ${Tp(Ie)}) => void;`}).filter((Ie)=>Ie!==void 0)}function gg(i){let Ne=i.type==="() => any";if(i.type&&bp.test(i.type)&&!Ne)return i.type;else if(i.params&&i.params.length>0){let Re=i.params.map((Me)=>{let Oe=Me.optional?"?":"";return`${Me.name}${Oe}: ${Me.type}`}).join(", "),Le=i.returnType||Rn;return`(${Re}) => ${Le}`}else if(i.returnType)return`() => ${i.returnType}`;else return i.type||Rn}function kp(i,Ne="all"){return i.props.filter((Ie)=>Ie.isFunctionDeclaration||Ie.kind==="const").map((Ie)=>{let Re=Ks(Ie.description,Ie.deprecated,Ie.tags,Ne),Le=gg(Ie);return`
|
|
159
|
-
${Wr(Re)}
|
|
160
|
-
${yr(Ie.name)}: ${Le};`}).join(`
|
|
161
|
-
`)}function xg(i,Ne={export:!0},Ie="all"){let Re=Ne.export?"export ":"",Le=Qn(i.moduleName,Ne.typeNames),Me=kp({props:i.props},Ie);if(Me.trim()==="")return{exports_name:Le,exports_ref:Le,exports_def:`${Re}type ${Le} = ${Co};`};let{declSuffix:Oe,refSuffix:Be}=lg(i.generics,Me);return{exports_name:Le,exports_ref:`${Le}${Be}`,exports_def:`${Re}type ${Le}${Oe} = {${Me}
|
|
162
|
-
};`}}function bg(i){let Ne=i.props.filter((Ie)=>Ie.bindable===!0||Ie.binding==="writable").map((Ie)=>JSON.stringify(Ie.name));return Ne.length===0?on:Ne.join(" | ")}function Eg(i){let Ne=i.moduleName==="default"?"$$Component":i.moduleName,Ie=i.bindings===on?'""':i.bindings;return`declare const ${Ne}: Component<
|
|
163
|
-
${i.propsRef},
|
|
164
|
-
${i.exportsRef},
|
|
165
|
-
${Ie}
|
|
166
|
-
>;
|
|
167
|
-
export default ${Ne};`}function Cg(i){let Ne=i.moduleName==="default"?"$$Component":i.moduleName,Ie=`${Ne}Component`,Re=i.bindings===on?'""':i.bindings;return`interface ${Ie} {
|
|
168
|
-
new ${i.generic}(
|
|
169
|
-
options: ComponentConstructorOptions<${i.propsRef}>
|
|
170
|
-
): SvelteComponent<${i.propsRef}> & ${i.exportsRef};
|
|
171
|
-
${i.generic}(
|
|
172
|
-
this: void,
|
|
173
|
-
internals: ComponentInternals,
|
|
174
|
-
props: ${i.propsRef}
|
|
175
|
-
): {
|
|
176
|
-
$on?(type: string, callback: (e: any) => void): () => void;
|
|
177
|
-
$set?(props: Partial<${i.propsRef}>): void;
|
|
178
|
-
} & ${i.exportsRef};
|
|
179
|
-
element?: typeof HTMLElement;
|
|
180
|
-
z_$$bindings?: ${Re};
|
|
181
|
-
}
|
|
182
|
-
declare const ${Ne}: ${Ie};
|
|
183
|
-
export default ${Ne};`}function vg(i){if(i.extends===void 0)return"";return`import type { ${i.extends.interface} } from ${i.extends.import};`}function Sg(i,Ne="all"){if(Ne==="none"||!i.componentComment)return"";if(!Yy.test(i.componentComment))return Gs(i.componentComment.trim());return`/*${i.componentComment.split(`
|
|
184
|
-
`).map((Ie)=>`* ${Ie}`).join(`
|
|
185
|
-
`)}
|
|
186
|
-
*/`}function xp(i){return vo.test(i)?i:JSON.stringify(i)}function Tg(i,Ne){let Ie=[],Re=new Map;for(let Le of i.moduleExports){if(Le.kind!=="re-export"||!Le.reExport)continue;let{from:Me,imported:Oe}=Le.reExport,Be=Ks(Le.description,Le.deprecated,Le.tags,Ne),Fe=xp(Le.name);if(Oe==="*"){let Ge=Le.name==="*"?"*":`* as ${Fe}`;Ie.push(`${Wr(Be)}
|
|
187
|
-
export ${Ge} from ${JSON.stringify(Me)};`);continue}let We=`${Me}\x00${Be}`,Ve=Re.get(We);if(!Ve)Ve={comments:Be,from:Me,specifiers:[]},Re.set(We,Ve),Ie.push(We);Ve.specifiers.push(Oe===Le.name?Fe:`${xp(Oe)} as ${Fe}`)}return Ie.map((Le)=>{let Me=Re.get(Le);if(!Me)return Le;return`${Wr(Me.comments)}
|
|
188
|
-
export { ${Me.specifiers.join(", ")} } from ${JSON.stringify(Me.from)};`}).join(`
|
|
189
|
-
|
|
190
|
-
`)}function kg(i,Ne="all"){let Ie=Tg(i,Ne),Re=i.moduleExports.filter((Le)=>Le.kind!=="re-export").map((Le)=>{let Me=Ks(Le.description,Le.deprecated,Le.tags,Ne),Oe,Be=Le.type&&bp.test(Le.type),Fe=Le.type==="() => any",We=Le.typeParameters?`<${Le.typeParameters}>`:"";if(Le.kind==="const"&&!Be)Oe=`export declare const ${Le.name}: ${Le.type||Rn};
|
|
191
|
-
`;else if(Le.params&&Le.params.length>0){let Ge=Le.params.map((ze)=>{let Ye=ze.optional?"?":"";return`${ze.name}${Ye}: ${ze.type}`}).join(", "),Ke=Le.returnType||Rn;Oe=`export declare function ${Le.name}${We}(${Ge}): ${Ke};`}else if(Le.returnType)Oe=`export declare function ${Le.name}${We}(): ${Le.returnType};`;else if(Be&&Le.type&&!Fe){let[Ve,Ge,...Ke]=Le.type.split("=>"),ze=Ke.map((Ye)=>` => ${Ye.trim()}`).join("");Oe=`export declare function ${Le.name}${Ve.trimEnd()}: ${Ge.trim()}${ze};`}else if(Be&&Le.type){let[Ve,Ge,...Ke]=Le.type.split("=>"),ze=Ke.map((Ye)=>` => ${Ye.trim()}`).join("");Oe=`export declare function ${Le.name}${Ve.trimEnd()}: ${Ge.trim()}${ze};`}else if(Le.kind==="const")Oe=`export declare const ${Le.name}: ${Le.type||Rn};
|
|
192
|
-
`;else Oe=`export type ${Le.name} = ${Le.type||Rn};`;return`
|
|
193
|
-
${Wr(Me)}
|
|
194
|
-
${Oe}`}).join(`
|
|
195
|
-
`);return[Ie,Re].filter(Boolean).join(`
|
|
196
|
-
|
|
197
|
-
`)}var wg=120;function Ag(i){let Ie=`export default class ${i.moduleName==="default"?"":i.moduleName}${i.generic} extends SvelteComponentTyped<`,Re=[i.genericProps,i.events,i.slots];if(i.accessors.trim()===""&&Re.every((Le)=>!Le.includes(`
|
|
198
|
-
`))){let Le=`${Ie}${Re.join(", ")}> {}`;if(Le.length<=wg)return Le}return`${Ie}
|
|
199
|
-
${i.genericProps},
|
|
200
|
-
${i.events},
|
|
201
|
-
${i.slots}
|
|
202
|
-
> {
|
|
203
|
-
${i.accessors}
|
|
204
|
-
}`}function wp(i,Ne,Ie){let Re=Ie.replace(rg,Ne);if(!Ie.includes("{name}")||!vo.test(Re))throw Error(`sveld: typesOptions.typeNames.${i} must contain "{name}" and produce a valid identifier; got "${Ie}".`);return Re}function Ln(i,Ne){return wp("props",i,Ne?.props??"{name}Props")}function Qn(i,Ne){return wp("exports",i,Ne?.exports??"{name}Exports")}function zs(i,Ne,Ie){if(i===void 0||i===!0)return{...Ne};if(i===!1)return{props:!1,exports:!1,typedefs:!1,contexts:!1};return{props:i.props??Ie,exports:i.exports??Ie,typedefs:i.typedefs??Ie,contexts:i.contexts??Ie}}var Ao={props:!0,exports:!0,typedefs:!0,contexts:!0};function Po(i){let Ne=zs(i?.exportTypes,Ao,!0);if(i?.forceExportProps===!0)Ne.props=!0;return Ne}function No(i){return{format:i.format,exportTypes:i.exportTypes,forceExportProps:i.forceExportProps,typeNames:i.typeNames,comments:i.comments,propsDeclaration:i.propsDeclaration,inline:i.inline}}var Pg={format:"class",exportTypes:!0,forceExportProps:!1,typeNames:null,comments:"all",propsDeclaration:"type",inline:!1};function Ap(i){let Ne=No(i??{}),Ie={};for(let[Re,Le]of Object.entries(Ne))Ie[Re]=Le??Pg[Re];return JSON.stringify(Ie)}function _o(i,Ne){let Ie=Cn(i),{moduleName:Re,typedefs:Le,generics:Me,props:Oe,moduleExports:Be,slots:Fe,events:We,rest_props:Ve,extends:Ge,componentComment:Ke,contexts:ze,syntaxMode:Ye}=i,Qe=Ne?.format==="component",tt=Me!==null,ot=Po(Ne),ct=Ne?.comments??"all",{props_name:et,prop_def:it}=pg({moduleName:Re,props:Oe,rest_props:Ve,extends:Ge,generics:Me,slots:Fe,canonicalPropNames:new Set(Ie?.canonicalPropNames??[]),canonicalPropsType:Ie?.canonicalPropsType,events:Qe&&Ye==="legacy"?We:void 0},{export:ot.props,typeNames:Ne?.typeNames,propsDeclaration:Ne?.propsDeclaration},ct),lt=Me?`<${Me[1]}>`:"",At=Me?`${et}<${Me[0]}>`:et,bt=kg({moduleExports:Be},ct),Ct=gr({typedefs:Le},{export:ot.typedefs},ct),$e=vp({contexts:ze,generics:Me},{export:ot.contexts},ct),je=new Set(Ne?.inlined?.droppedImportStatements??[]),qe=(Ie?.typeImportStatements??[]).filter((Et)=>!je.has(Et)).join(`
|
|
205
|
-
`),He=[...Ne?.inlined?.declarations??[],...Ie?.localTypeDeclarations??[]].join(`
|
|
206
|
-
|
|
207
|
-
`),{exports_ref:Xe,exports_def:Je}=Qe?xg({props:Oe,moduleName:Re,generics:Me},{export:ot.exports,typeNames:Ne?.typeNames},ct):{exports_ref:on,exports_def:on},nt=Qe?bg({props:Oe}):on,st=!eg.test(qe)&&(mr.test(it)||mr.test(bt)||mr.test(Ct)||mr.test($e)||mr.test(He)||mr.test(Je)),rt=Ve?.type==="Element"&&(Ve.name!=="svelte:element"||Ve.name==="svelte:element"&&Ve.thisValue),Ze=Ve?.type==="Element"&&Ve.name==="svelte:element"&&!Ve.thisValue,ht=[Qe?tt?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${st?", Snippet":""} } from "svelte";`:`import type { Component${st?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${st?", type Snippet":""} } from "svelte";`,rt?'import type { SvelteHTMLElements } from "svelte/elements";':"",Ze?'import type { HTMLAttributes } from "svelte/elements";':"",qe,vg({extends:Ge})].filter(Boolean).join(`
|
|
208
|
-
`),mt=Qe?tt?Cg({moduleName:Re,generic:lt,propsRef:At,exportsRef:Xe,bindings:nt}):Eg({moduleName:Re,propsRef:At,exportsRef:Xe,bindings:nt}):Ag({moduleName:Re,generic:lt,genericProps:At,events:mg({events:We}),slots:ug({slots:Fe}),accessors:kp({props:Oe},ct)}),gt=[bt,Ct,He,$e,it,Je,[Sg({componentComment:Ke},ct),mt].filter(Boolean).join(`
|
|
209
|
-
`)].map((Et)=>Et.trim()).filter(Boolean).join(`
|
|
210
|
-
|
|
211
|
-
`);return hp([ht,gt].filter(Boolean).join(`
|
|
212
|
-
|
|
213
|
-
`))}var Rg=[".ts",".d.ts",".mts",".cts"],Lg=["index.ts","index.d.ts"],Og=10,Mg=/^\s*(?:export\s+)?(?:declare\s+)?(?:type|interface)\s+([A-Za-z_$][\w$]*)/,$g=new Set(["svelte","svelte/elements"]);function Io(i){return $g.has(i)}function Gr(i,Ne){let Ie=Do(Ne),Re;if(i.startsWith(".")||i.startsWith("/"))Re=Ig(Ie,i);else{let Oe=hr(i,Ie);if(Oe.unresolved)return{kind:"bare"};Re=Oe.resolved}let Le=Do(Re),Me=Dg(Re);if(Tn(Le,Me)){let Oe=Bs(Le,Me);if(Oe?Oe.isFile():Ng(Re,{throwIfNoEntry:!1})?.isFile())return Re.endsWith(".svelte")?{kind:"svelte"}:{kind:"resolved",path:Re}}if(Tn(Le,`${Me}.svelte`))return{kind:"svelte"};for(let Oe of Rg)if(Tn(Le,`${Me}${Oe}`))return{kind:"resolved",path:`${Re}${Oe}`};for(let Oe of Lg)if(Tn(Re,Oe))return{kind:"resolved",path:Dp(Re,Oe)};return{kind:"missing"}}function wt(i){return Ot(i)&&typeof i.type==="string"?i:void 0}function Zn(i){if(!Array.isArray(i))return[];let Ne=[];for(let Ie of i){let Re=wt(Ie);if(Re)Ne.push(Re)}return Ne}function jt(i){if(!i)return;if(s(i))return i.name;return Jn(i)??void 0}function Ur(i){return Jn(i)??void 0}function Ro(i,Ne){let Ie=i.files.get(Ne);if(Ie!==void 0)return Ie;let Re;try{let Le=_g(Ne,"utf-8"),Me=pr(Le,!0,[]);Re={source:Le,program:Me}}catch{Re=null}return i.files.set(Ne,Re),Re}function Bg(i){let Ne=i;while(Ne?.type==="TSQualifiedName")Ne=wt(Ne.left);return Ne?jt(Ne):void 0}function Fg(i){let Ne=new Set,Ie=[],Re=(Le)=>{if(Le.type!=="TSTypeReference")return;let Me=Bg(wt(Le.typeName));if(Me&&!Ne.has(Me))Ne.add(Me),Ie.push(Me)};for(let Le in i){if(Le==="id"||Le==="typeParameters")continue;let Me=i[Le];if(Array.isArray(Me))for(let Oe of Me){let Be=wt(Oe);if(Be)v(Be,Re)}else{let Oe=wt(Me);if(Oe)v(Oe,Re)}}return Ie}function jg(i){let Ne=new Set,Ie=wt(i.typeParameters);for(let Re of Zn(Ie?.params)){let Le=jt(wt(Re.name));if(Le)Ne.add(Le)}return Ne}function Lo(i,Ne){for(let Ie of i.body){let Re=Ie.type==="ExportNamedDeclaration"?wt(Ie.declaration)??Ie:Ie;switch(Re.type){case"TSTypeAliasDeclaration":if(jt(wt(Re.id))===Ne)return{kind:"type",node:Re};break;case"TSInterfaceDeclaration":if(jt(wt(Re.id))===Ne)return{kind:"interface",node:Re};break;case"TSEnumDeclaration":if(jt(wt(Re.id))===Ne)return{kind:"unsupported",reason:"enum"};break;case"ClassDeclaration":if(jt(wt(Re.id))===Ne)return{kind:"unsupported",reason:"class"};break;case"FunctionDeclaration":if(jt(wt(Re.id))===Ne)return{kind:"unsupported",reason:"function"};break;case"TSModuleDeclaration":if(jt(wt(Re.id))===Ne)return{kind:"unsupported",reason:"namespace"};break;case"VariableDeclaration":for(let Le of Zn(Re.declarations))if(jt(wt(Le.id))===Ne)return{kind:"unsupported",reason:"const"};break;default:break}}return}function Vg(i,Ne){for(let Ie of i.body){if(Ie.type!=="ImportDeclaration")continue;let Re=Ur(wt(Ie.source));if(Re===void 0)continue;for(let Le of Zn(Ie.specifiers)){let Me=wt(Le.local),Oe=jt(Me);if(Oe!==Ne)continue;if(Le.type==="ImportNamespaceSpecifier")return{kind:"namespace"};let Be=typeof Me?.start==="number"?Me.start:void 0;if(Le.type==="ImportDefaultSpecifier")return{kind:"named",source:Re,importedName:"default",localNameStart:Be};if(Le.type==="ImportSpecifier")return{kind:"named",source:Re,importedName:jt(wt(Le.imported))??Oe,localNameStart:Be}}}return}function Oo(i,Ne){return`${i}\x00${Ne}`}function Wg(i,Ne){let Ie=new Set,Re=[];for(let Le of i){let Me;try{Me=pr(Le,!0,[])}catch{continue}for(let Oe of Me.body){if(Oe.type!=="ImportDeclaration")continue;let Be=Ur(wt(Oe.source));if(Be===void 0||Io(Be))continue;if(Gr(Be,Ne).kind!=="bare")continue;for(let Fe of Zn(Oe.specifiers)){if(Fe.type==="ImportNamespaceSpecifier")continue;let We=Fe.type==="ImportDefaultSpecifier"?"default":jt(wt(Fe.imported))??void 0;if(!We)continue;let Ve=Oo(Be,We);if(Ie.has(Ve))continue;Ie.add(Ve),Re.push({source:Be,importedName:We})}}}return Re}function Mo(i,Ne){return e(Dp(Do(i),`__sveld_inline_all_${Ne}.ts`))}function Ip(i,Ne,Ie){let Re=Wg(Ie,i);if(Re.length===0)return null;let Le=Re.map(({source:Fe,importedName:We},Ve)=>`import type { ${We} as __sveld_bare_${Ve} } from ${JSON.stringify(Fe)};`),Me=new Map,Oe=`${Le.join(`
|
|
214
|
-
`)}
|
|
215
|
-
`;return Re.forEach(({source:Fe,importedName:We},Ve)=>{Oe+=`type __sveld_ref_${Ve} = `,Me.set(Oo(Fe,We),Oe.length),Oe+=`__sveld_bare_${Ve};
|
|
216
|
-
`}),{virtualFile:Mo(i,Ne),content:Oe,positions:Me}}function Js(i,Ne){let Ie=new Map;for(let Re of i.values()){let Le=Cn(Re)?.typeImportStatements??[];if(Le.length===0)continue;let Me=Ip(Ne(Re.filePath),Re.moduleName,Le);if(Me)Ie.set(Me.virtualFile,Me.content)}return Ie}function Pp(i){switch(i.type){case"TSTypeAliasDeclaration":return{kind:"type"};case"TSInterfaceDeclaration":return{kind:"interface"};case"TSEnumDeclaration":return{reason:"enum"};case"ClassDeclaration":return{reason:"class"};case"FunctionDeclaration":return{reason:"function"};case"TSModuleDeclaration":return{reason:"namespace"};default:return{reason:i.type}}}function Xs(i,Ne,Ie,Re,Le){let Me=`${Ne}#${Ie}`;if(Le>Og||Re.has(Me))return{kind:"not-found"};Re.add(Me);let Oe=Ro(i,Ne);if(!Oe)return{kind:"not-found"};i.dependencies.add(Ne);for(let Be of Oe.program.body){if(Be.type==="ExportNamedDeclaration"){let Fe=wt(Be.declaration);if(!Fe)continue;if(Fe.type==="VariableDeclaration"){for(let Ve of Zn(Fe.declarations))if(jt(wt(Ve.id))===Ie)return{kind:"unsupported",reason:"const"};continue}if(jt(wt(Fe.id))!==Ie)continue;let We=Pp(Fe);return"reason"in We?{kind:"unsupported",reason:We.reason}:{kind:"found",node:Fe,filePath:Ne,source:Oe.source}}if(Be.type==="ExportDefaultDeclaration"&&Ie==="default"){let Fe=wt(Be.declaration);if(!Fe)return{kind:"not-found"};let We=Pp(Fe);return"reason"in We?{kind:"unsupported",reason:We.reason}:{kind:"found",node:Fe,filePath:Ne,source:Oe.source}}}for(let Be of Oe.program.body){if(Be.type!=="ExportNamedDeclaration"||Be.declaration)continue;for(let Fe of Zn(Be.specifiers)){if(jt(wt(Fe.exported))!==Ie)continue;let We=jt(wt(Fe.local));if(!We)return{kind:"not-found"};if(!Be.source){let Ke=Lo(Oe.program,We);if(!Ke)return{kind:"not-found"};if(Ke.kind==="unsupported")return Ke;return{kind:"found",node:Ke.node,filePath:Ne,source:Oe.source}}let Ve=Ur(wt(Be.source));if(Ve===void 0)return{kind:"not-found"};let Ge=Gr(Ve,Ne);if(Ge.kind!=="resolved")return{kind:"not-found"};return Xs(i,Ge.path,We,Re,Le+1)}}for(let Be of Oe.program.body){if(Be.type!=="ExportAllDeclaration"||wt(Be.exported))continue;let Fe=Ur(wt(Be.source));if(Fe===void 0)continue;let We=Gr(Fe,Ne);if(We.kind!=="resolved")continue;let Ve=Xs(i,We.path,Ie,Re,Le+1);if(Ve.kind!=="not-found")return Ve}return{kind:"not-found"}}function Np(i,Ne,Ie){if(Ie===Ne)return{ok:!0};let Re=`alias#${Ie}`;if(i.textByKey.has(Re))return{ok:!0};let Le=i.nameOwner.get(Ie);if(Le!==void 0&&Le!==Re)return{ok:!1,reason:`"${Ie}" was already inlined from a different source`};if(i.reservedNames.has(Ie))return{ok:!1,reason:`"${Ie}" collides with an existing declaration in the component`};return i.nameOwner.set(Ie,Re),i.tx.keys.push(Re),i.textByKey.set(Re,`type ${Ie} = ${Ne};`),i.order.push(Re),{ok:!0}}async function Rp(i,Ne,Ie){let Re=await i.bareSession.resolveAt(Ne,Ie);if(Re.kind==="default-lib")return{status:"left-alone"};if(Re.kind==="unresolved")return{status:"unresolved"};let Le=Ro(i,Re.filePath);if(!Le)return{status:"unlocatable",filePath:Re.filePath,declaredName:Re.declaredName};let Me=Lo(Le.program,Re.declaredName);if(!Me)return{status:"unlocatable",filePath:Re.filePath,declaredName:Re.declaredName};if(Me.kind==="unsupported")return{status:"unsupported",reason:Me.reason};return{status:"found",node:Me.node,filePath:Re.filePath,source:Le.source}}async function qr(i,Ne,Ie,Re,Le){let Me=jt(wt(Ne.id)),{start:Oe,end:Be}=Ne;if(!Me||typeof Oe!=="number"||typeof Be!=="number")return{ok:!1,reason:"has no name or source position"};let Fe=`${Ie}#${Me}`;if(i.pending.has(Fe)||i.textByKey.has(Fe))return Np(i,Me,Le);let We=i.nameOwner.get(Me);if(We!==void 0&&We!==Fe)return{ok:!1,reason:`"${Me}" was already inlined from a different source`};if(i.reservedNames.has(Me))return{ok:!1,reason:`"${Me}" collides with an existing declaration in the component`};i.pending.add(Fe),i.nameOwner.set(Me,Fe),i.tx.keys.push(Fe),i.dependencies.add(Ie);let Ve=jg(Ne),Ge=Ro(i,Ie);for(let Ke of Fg(Ne)){if(Ve.has(Ke)||Ke===Me)continue;if(!Ge)continue;let ze=Lo(Ge.program,Ke);if(ze){if(ze.kind==="unsupported")return i.pending.delete(Fe),{ok:!1,reason:`references "${Ke}", a ${ze.reason} that cannot be inlined`};let ct=await qr(i,ze.node,Ie,Re,Ke);if(!ct.ok)return i.pending.delete(Fe),ct;continue}let Ye=Vg(Ge.program,Ke);if(!Ye||Ye.kind==="namespace")continue;let Qe=Gr(Ye.source,Ie);if(Qe.kind==="resolved"){let ct=Xs(i,Qe.path,Ye.importedName,new Set,0);if(ct.kind==="not-found")return i.pending.delete(Fe),{ok:!1,reason:`references "${Ke}", which is not exported from "${Ye.source}"`};if(ct.kind==="unsupported")return i.pending.delete(Fe),{ok:!1,reason:`references "${Ke}", a ${ct.reason} that cannot be inlined`};let et=await qr(i,ct.node,ct.filePath,ct.source,Ke);if(!et.ok)return i.pending.delete(Fe),et;continue}if(Qe.kind!=="bare"||Io(Ye.source)||!i.bareSession||Ye.localNameStart===void 0)continue;let tt=await Rp(i,Ie,Ye.localNameStart);if(tt.status==="left-alone")continue;if(tt.status!=="found"){i.pending.delete(Fe);let ct=tt.status==="unresolved"?`which could not be resolved from "${Ye.source}"`:tt.status==="unlocatable"?`which resolves to "${tt.declaredName}" in "${tt.filePath}", where sveld could not locate that declaration`:`a ${tt.reason} that cannot be inlined`;return{ok:!1,reason:`references "${Ke}", ${ct}`}}let ot=await qr(i,tt.node,tt.filePath,tt.source,Ke);if(!ot.ok)return i.pending.delete(Fe),ot}return i.pending.delete(Fe),i.textByKey.set(Fe,Re.slice(Oe,Be).trim()),i.order.push(Fe),Np(i,Me,Le)}async function qg(i,Ne,Ie,Re){let Le=Xs(i,Ne,Ie,new Set,0);if(Le.kind==="not-found")return{ok:!1,reason:`"${Ie}" is not exported from "${Ne}"`};if(Le.kind==="unsupported")return{ok:!1,reason:`"${Ie}" is a ${Le.reason}, which cannot be inlined`};return qr(i,Le.node,Le.filePath,Le.source,Re)}async function Gg(i,Ne,Ie,Re){let Le=i.barePlan?.positions.get(Oo(Ne,Ie));if(!i.bareSession||!i.barePlan||Le===void 0)return{ok:!1,reason:`"${Ie}" is a package import that sveld could not verify`};let Me=await Rp(i,i.barePlan.virtualFile,Le);switch(Me.status){case"left-alone":return{ok:!1,reason:`"${Ie}" resolves to a built-in TypeScript type, which cannot be inlined`};case"unresolved":return{ok:!1,reason:`"${Ie}" could not be resolved from "${Ne}"`};case"unlocatable":return{ok:!1,reason:`"${Ie}" resolves to "${Me.declaredName}" in "${Me.filePath}", where sveld could not locate that declaration`};case"unsupported":return{ok:!1,reason:`"${Ie}" is a ${Me.reason}, which cannot be inlined`};case"found":return qr(i,Me.node,Me.filePath,Me.source,Re);default:return Me}}function _p(i){i.order.length=i.tx.orderStart;let Ne=new Set(i.tx.keys);for(let Ie of Ne)i.textByKey.delete(Ie);for(let[Ie,Re]of i.nameOwner)if(Ne.has(Re))i.nameOwner.delete(Ie)}async function Ug(i,Ne,Ie){let Re;try{Re=pr(Ne,!0,[])}catch{return{status:"kept"}}let Le=Re.body.filter((Ve)=>Ve.type==="ImportDeclaration");if(Le.length===0)return{status:"kept"};let Me=Le.flatMap((Ve)=>Zn(Ve.specifiers).map((Ge)=>({decl:Ve,spec:Ge})));if(Me.some(({spec:Ve})=>Ve.type==="ImportNamespaceSpecifier"))return{status:"kept"};let Oe=Ur(wt(Le[0]?.source));if(Oe===void 0)return{status:"kept"};let Be=Gr(Oe,Ie);if(Be.kind==="svelte")return{status:"kept"};let Fe=[];for(let{spec:Ve}of Me){let Ge=jt(wt(Ve.local));if(!Ge)continue;let Ke=Ve.type==="ImportDefaultSpecifier"?"default":jt(wt(Ve.imported))??Ge;Fe.push({importedName:Ke,localName:Ge})}if(Be.kind==="missing")return{status:"refused",failures:Fe.map(({localName:Ve})=>({name:Ve,reason:`"${Oe}" was not found on disk`}))};if(Be.kind==="bare"){if(Io(Oe)||!i.bareSession)return{status:"kept"};i.tx={orderStart:i.order.length,keys:[]};let Ve=[];for(let{importedName:Ge,localName:Ke}of Fe){let ze=await Gg(i,Oe,Ge,Ke);if(!ze.ok)Ve.push({name:Ke,reason:ze.reason})}if(Ve.length>0)return _p(i),{status:"refused",failures:Ve};return{status:"inlined"}}i.tx={orderStart:i.order.length,keys:[]};let We=[];for(let{importedName:Ve,localName:Ge}of Fe){let Ke=await qg(i,Be.path,Ve,Ge);if(!Ke.ok)We.push({name:Ge,reason:Ke.reason})}if(We.length>0)return _p(i),{status:"refused",failures:We};return{status:"inlined"}}function Hg(i,Ne){let Ie=new Set;for(let Le of i.typedefs)Ie.add(Le.name);for(let Le of i.contexts??[])Ie.add(Le.typeName);let Re=Cn(i);for(let Le of Re?.localTypeDeclarations??[]){let Me=Mg.exec(Le);if(Me)Ie.add(Me[1])}return Ie.add(Ln(i.moduleName,Ne)),Ie.add(Qn(i.moduleName,Ne)),Ie}async function Ys(i,Ne,Ie,Re){let Le=new Map;return await Promise.all(Array.from(i.values()).map(async(Me)=>{let Be=Cn(Me)?.typeImportStatements??[];if(Be.length===0)return;let Fe=Ne(Me.filePath),We=Re?Ip(Fe,Me.moduleName,Be):null,Ve={files:new Map,reservedNames:Hg(Me,Ie),nameOwner:new Map,textByKey:new Map,order:[],pending:new Set,dependencies:new Set,tx:{orderStart:0,keys:[]},bareSession:Re,barePlan:We},Ge=[],Ke=(Me.diagnostics??[]).filter((ze)=>ze.kind!=="types-inline-unresolved");for(let ze of Be){let Ye=await Ug(Ve,ze,Fe);if(Ye.status==="inlined")Ge.push(ze);else if(Ye.status==="refused")for(let Qe of Ye.failures)Ke.push(xn({component:Me.filePath,kind:"types-inline-unresolved",name:Qe.name,message:`Cannot inline "${Qe.name}": ${Qe.reason}.`}))}if(Me.diagnostics=Ke,Ge.length===0&&Ve.order.length===0)return;Le.set(Me.filePath,{droppedImportStatements:Ge,declarations:Ve.order.map((ze)=>Ve.textByKey.get(ze)??""),dependencies:Array.from(Ve.dependencies)})})),Le}import{hash as Kg}from"node:crypto";import{mkdirSync as zg,readFileSync as Xg,renameSync as Jg,writeFileSync as Lp}from"node:fs";import{dirname as Yg,isAbsolute as Qg,join as Zg,resolve as Op}from"node:path";var $o=3,ex=Zg("node_modules",".cache","sveld","parse-cache.json");function Bo(){return`${As}+svelte@${Br}`}function $p(i,Ne){if(typeof Ne==="string")return Qg(Ne)?Ne:Op(i,Ne);return Op(i,ex)}function Bp(i){return Kg("sha256",i,"hex")}function Mp(){return{formatVersion:$o,toolchainVersion:Bo(),entries:{}}}function tx(i){try{let Ne=Xg(i,"utf-8"),Ie=JSON.parse(Ne);if(Ie.formatVersion!==$o||Ie.toolchainVersion!==Bo())return Mp();return Ie}catch{return Mp()}}class Fo{cacheFilePath;file;next=new Map;blocked=new Set;constructor(i){this.cacheFilePath=i,this.file=tx(i)}has(i,Ne){if(this.blocked.has(i))return!1;let Ie=this.file.entries[i];return Ie!==void 0&&Ie.hash===Ne}get(i,Ne){if(this.blocked.has(i))return null;let Ie=this.file.entries[i];if(Ie===void 0||Ie.hash!==Ne)return null;if(this.next.set(i,Ie),Ie.typeScriptMetadata!==void 0)Ie.parsed[g]=Ie.typeScriptMetadata;return Ie.parsed}set(i,Ne,Ie){this.next.set(i,{hash:Ne,parsed:Ie,typeScriptMetadata:Ie[g]})}invalidate(i){this.blocked.add(i)}getGeneratedText(i,Ne){let Ie=this.next.get(i);if(Ie?.generatedText===void 0||Ie.generatedText.key!==Ne)return;return Ie.generatedText.text}setGeneratedText(i,Ne,Ie){let Re=this.next.get(i);if(Re===void 0)return;Re.generatedText={key:Ne,text:Ie}}save(){zg(Yg(this.cacheFilePath),{recursive:!0});let i={formatVersion:$o,toolchainVersion:Bo(),entries:Object.fromEntries(this.next)},Ne=JSON.stringify(i),Ie=`${this.cacheFilePath}.${process.pid}.tmp`;try{Lp(Ie,Ne),Jg(Ie,this.cacheFilePath)}catch{try{Lp(this.cacheFilePath,Ne)}catch{}}}}import{lstatSync as nx,readFileSync as rx}from"node:fs";import{basename as sx,dirname as qo,join as ix,relative as ox,resolve as Wp}from"node:path";var xr=null,jo=null;function er(){if(xr)return Promise.resolve(xr);if(!jo)jo=Promise.all([import("./chunk-7e36grhy.js"),import("./chunk-w37f2cq2.js")]).then(([i,Ne])=>(xr={ComponentParser:i.default,parseSvelte:Ne.parse},xr));return jo}function Qs(){if(!xr)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return xr}var Vo=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],ax=/\r?\n/,cx=/^\s*\*+/;function Nt(i){return i&&typeof i==="object"?i:void 0}function tr(i){return Array.isArray(i)?i:[]}function kn(i){return s(i)?i.name:void 0}function wn(i,Ne){let Ie=xo(i,Ne),Re=Wp(Ne,Ie),Le=qo(Re),Me=sx(Re);if(Tn(Le,Me)){let Be=Bs(Le,Me)??nx(Re,{throwIfNoEntry:!1});if(Be?.isFile())return Re;for(let Fe of Vo)if(Tn(Le,Me+Fe))return Re+Fe;if(Be?.isDirectory()){for(let Fe of Vo)if(Tn(Re,`index${Fe}`))return ix(Re,`index${Fe}`)}return null}for(let Oe of Vo)if(Tn(Le,Me+Oe))return Re+Oe;return null}function lx(i,Ne){let Ie=i.slice(0,Ne).trimEnd();if(!Ie.endsWith("*/"))return;let Re=Ie.length-2,Le=Ie.lastIndexOf("/**",Re);if(Le===-1)return;let Me=[];for(let Oe of Ie.slice(Le+3,Re).split(ax)){let Be=Oe.replace(cx,"").trim();if(Be.startsWith("@"))break;if(Be)Me.push(Be)}return Me.join(" ")||void 0}function px(i,Ne){let Ie=i.slice(0,Ne).trimEnd();if(!Ie.endsWith("*/"))return;let Re=Ie.length-2,Le=Ie.lastIndexOf("/**",Re);if(Le===-1)return;return Ie.slice(Le,Re+2)}function br(i,Ne){if(!Ne)return;return i.text.slice(Ne.start,Ne.end)}function ux(i,Ne){let Ie=Nt(Ne?.typeAnnotation);if(Ie?.type!=="TSTypeAnnotation")return;return br(i,Nt(Ie.typeAnnotation))}function Wo(i,Ne){let Ie=Nt(Ne.returnType);return Ie?.type==="TSTypeAnnotation"?br(i,Nt(Ie.typeAnnotation)):void 0}function Fp(i,Ne){let Ie=tr(Ne.params).map((Le)=>br(i,Le)??"").join(", "),Re=Wo(i,Ne);return`(${Ie})${Re?` => ${Re}`:""}`}function qp(i){if(i.type==="Literal"){let Ne=i.value;if(typeof Ne==="string")return"string";if(typeof Ne==="number")return"number";if(typeof Ne==="boolean")return"boolean"}if(i.type==="TemplateLiteral")return"string";return}function dx(i){if(!i)return;let Ne=i.lastIndexOf("=>");if(Ne===-1)return;return i.slice(Ne+2).trim()||void 0}function jp(i){if(i.async||i.generator)return;let Ne=Nt(i.body);if(!Ne)return;let Ie=[];if(Ne.type==="BlockStatement"){if(Hr(Ne,Ie),Ie.length===0)return}else Ie.push(Ne);let Re;for(let Le of Ie){if(!Le)return;let Me=qp(Le);if(!Me)return;if(Re===void 0)Re=Me;else if(Re!==Me)return}return Re}function Hr(i,Ne){for(let Ie of tr(i.body)){if(Ie.type==="FunctionDeclaration"||Ie.type==="FunctionExpression"||Ie.type==="ArrowFunctionExpression")continue;if(Ie.type==="ReturnStatement"){Ne.push(Nt(Ie.argument)??null);continue}if(Ie.type==="BlockStatement"){Hr(Ie,Ne);continue}let Re=Nt(Ie.consequent);if(Re?.type==="BlockStatement")Hr(Re,Ne);else if(Re?.type==="ReturnStatement")Ne.push(Nt(Re.argument)??null);let Le=Nt(Ie.alternate);if(Le?.type==="BlockStatement")Hr(Le,Ne);else if(Le?.type==="ReturnStatement")Ne.push(Nt(Le.argument)??null);let Me=Nt(Ie.body);if(Me?.type==="BlockStatement")Hr(Me,Ne)}}function fx(i){let Ne=Nt(i.initializer);if(!Ne)return;if(Ne.type==="Literal"){let Ie=Ne.value;return typeof Ie==="string"||typeof Ie==="number"?Ie:void 0}if(Ne.type==="UnaryExpression"){let Ie=Nt(Ne.argument);if(Ne.operator==="-"&&Ie?.type==="Literal"){let Le=Ie.value;if(typeof Le==="number")return-Le}}return}function hx(i){let Ne=tr(i.members);if(Ne.length===0)return;let Ie=[],Re=0;for(let Le of Ne){if(!Nt(Le.initializer)){Ie.push(String(Re)),Re+=1;continue}let Oe=fx(Le);if(Oe===void 0)return;Ie.push(typeof Oe==="string"?JSON.stringify(Oe):String(Oe)),Re=typeof Oe==="number"?Oe+1:Re}return Ie.join(" | ")}function Vp(i,Ne,Ie){let Re=i.filePath,Le=lx(i.text,Ie),Me=px(i.text,Ie),Oe=Me?Rl(Me):void 0,{deprecated:Be,tags:Fe,internal:We}=Me?Ll(Me):{deprecated:void 0,tags:void 0,internal:!1},Ve=We?{internal:!0}:{};if(Ne.type==="VariableDeclaration"){let Ge=Ne.kind??"const",Ke=[];for(let ze of tr(Ne.declarations)){let Ye=Nt(ze.id),Qe=kn(Ye);if(!Qe)continue;let tt=ux(i,Ye),ot,ct,et,it=Nt(ze.init);if(it)if(it.type==="ArrowFunctionExpression"||it.type==="FunctionExpression"){if(!tt)tt=Fp(i,it);ct=Wo(i,it)??Oe??dx(tt)??jp(it)}else{if(ot=br(i,it),!tt)tt=qp(it);et=Jn(it)??void 0}Ke.push({name:Qe,kind:Ge,type:tt,value:ot,returnType:ct,literalValue:et,description:Le,deprecated:Be,tags:Fe,...Ve,declFile:Re,isTypeOnly:!1})}return Ke}if(Ne.type==="FunctionDeclaration"||Ne.type==="TSDeclareFunction"){let Ge=kn(Nt(Ne.id));if(!Ge)return[];return[{name:Ge,kind:"function",type:Fp(i,Ne),returnType:Wo(i,Ne)??Oe??jp(Ne),description:Le,deprecated:Be,tags:Fe,...Ve,declFile:Re,isTypeOnly:!1}]}if(Ne.type==="ClassDeclaration"){let Ge=kn(Nt(Ne.id));if(!Ge)return[];return[{name:Ge,kind:"class",type:Ge,description:Le,deprecated:Be,tags:Fe,...Ve,declFile:Re,isTypeOnly:!1}]}if(Ne.type==="TSTypeAliasDeclaration"){let Ge=kn(Nt(Ne.id));if(!Ge)return[];return[{name:Ge,kind:"type",type:br(i,Nt(Ne.typeAnnotation)),description:Le,deprecated:Be,tags:Fe,...Ve,declFile:Re,isTypeOnly:!0}]}if(Ne.type==="TSInterfaceDeclaration"){let Ge=kn(Nt(Ne.id));if(!Ge)return[];return[{name:Ge,kind:"interface",type:br(i,Nt(Ne.body)),description:Le,deprecated:Be,tags:Fe,...Ve,declFile:Re,isTypeOnly:!0}]}if(Ne.type==="TSEnumDeclaration"){let Ge=kn(Nt(Ne.id));if(!Ge)return[];return[{name:Ge,kind:"enum",type:hx(Ne)??Ge,description:Le,deprecated:Be,tags:Fe,...Ve,declFile:Re,isTypeOnly:!1}]}return[]}function mx(i){let Ne;try{Ne=rx(i,"utf-8")}catch{return null}let Ie=`<script lang="ts">
|
|
217
|
-
${Ne}
|
|
218
|
-
</script>`;try{let Re=Qs().parseSvelte(Ie),Le=tr(Re.instance?.content?.body);return{source:{text:Ie,filePath:i,dir:qo(i)},body:Le}}catch(Re){let Le=Re instanceof Error?Re.message:String(Re);return console.warn(`Warning: Failed to parse entry export module ${i}: ${Le}`),null}}function yx(i,Ne){for(let Ie of i){if(Ie.type!=="ImportDeclaration")continue;let Re=Nt(Ie.source)?.value;if(typeof Re!=="string")continue;for(let Le of tr(Ie.specifiers)){if(Le.type!=="ImportSpecifier")continue;if(kn(Nt(Le.local))===Ne){let Me=kn(Nt(Le.imported))??Ne;return{specifier:Re,importedName:Me}}}}return null}function On(i,Ne){let Ie=Ne.cache.get(i);if(Ie)return Ie;if(Ne.computing.has(i))return[];Ne.computing.add(i);let Re=mx(i);if(!Re)return Ne.computing.delete(i),Ne.cache.set(i,[]),[];let{source:Le,body:Me}=Re,Oe=[],Be=new Map;for(let We of Me){let Ve=We.type==="ExportNamedDeclaration"?Nt(We.declaration):We;if(!Ve)continue;for(let Ge of Vp(Le,Ve,Ve.start))Be.set(Ge.name,Ge)}let Fe=(We)=>{let Ve=Be.get(We);if(Ve)return Ve;let Ge=yx(Me,We);if(!Ge||Ge.specifier.endsWith(".svelte"))return null;let Ke=wn(Ge.specifier,Le.dir);if(!Ke)return null;return On(Ke,Ne).findLast((ze)=>ze.name===Ge.importedName)??null};for(let We of Me){if(We.type==="ExportAllDeclaration"){let Ye=Nt(We.source)?.value;if(typeof Ye!=="string"||Ye.endsWith(".svelte"))continue;let Qe=wn(Ye,Le.dir);if(!Qe)continue;let tt=We.exportKind==="type";for(let ot of On(Qe,Ne))Oe.push(tt?{...ot,isTypeOnly:!0}:ot);continue}if(We.type!=="ExportNamedDeclaration")continue;let Ve=Nt(We.declaration);if(Ve){Oe.push(...Vp(Le,Ve,We.start));continue}let Ge=Nt(We.source)?.value,Ke=typeof Ge==="string"?Ge:void 0;if(Ke?.endsWith(".svelte"))continue;let ze=We.exportKind==="type";for(let Ye of tr(We.specifiers)){if(Ye.type!=="ExportSpecifier")continue;let Qe=kn(Nt(Ye.exported)),tt=kn(Nt(Ye.local));if(!Qe||!tt||tt==="default"||Qe==="default")continue;let ot=ze||Ye.exportKind==="type",ct=null;if(Ke){let et=wn(Ke,Le.dir);if(et)ct=On(et,Ne).findLast((it)=>it.name===tt)??null}else ct=Fe(tt);if(ct?.declFile.endsWith(".svelte"))continue;if(ct)Oe.push({...ct,name:Qe,isTypeOnly:ct.isTypeOnly||ot});else Oe.push({name:Qe,kind:ot?"type":"const",declFile:i,isTypeOnly:ot})}}return Ne.computing.delete(i),Ne.cache.set(i,Oe),Oe}async function Kr(i){await er();let Ne=Wp(i),Ie=qo(Ne),Re=On(Ne,{cache:new Map,computing:new Set}),Le=(Be)=>e(`./${ox(Ie,Be)}`),Me=new Map,Oe=new Map;for(let Be of Re){let Fe=Oe.get(Be.name);if(Fe!==void 0&&Fe!==Be.declFile){console.warn(`Warning: "${Be.name}" is exported from both "${Le(Fe)}" and "${Le(Be.declFile)}"; keeping the first and dropping the rest.`);continue}Oe.set(Be.name,Be.declFile);let{declFile:We,returnType:Ve,literalValue:Ge,...Ke}=Be;Me.set(Be.name,{...Ke,source:Le(We)})}return Array.from(Me.values()).sort((Be,Fe)=>Be.name.localeCompare(Fe.name))}import{readFileSync as Up}from"node:fs";import{dirname as Hp,join as gx,relative as xx,resolve as bx}from"node:path";var Gp=new Map;function Ex(i){return Ii(i,{ecmaVersion:"latest",sourceType:"module"})}function Cx(i,Ne,Ie){let Re=wn(i,Ne);if(!Re)return null;let Le=Hp(Re);if(Ie.has(Re))return{dir:Le,exports:{}};Ie.add(Re);try{return{dir:Le,exports:Zs(Up(Re,"utf-8"),Le,Ie,Re)}}catch{return{dir:Le,exports:{}}}finally{Ie.delete(Re)}}function Zs(i,Ne,Ie=new Set,Re=Ne){let Le=Gp.get(i);if(!Le)Le=Ex(i),Gp.set(i,Le);let Me={};for(let Oe of Le.body)if(Oe.type==="ExportDefaultDeclaration"){let Be=Oe.declaration.name;if(Be in Me)Me[Be].default=!0;else Me[Be]={source:In(""),default:!0}}else if(Oe.type==="ExportAllDeclaration"){if(!Oe.source)continue;let Be=Oe.source.value,Fe=wn(Be,Ne);if(!Fe){let Ge=hr(Be,Ne);throw new fr(Be,Re,Ge.unresolved?Ge.searched:"no matching file or index found")}if(Ie.has(Fe))continue;Ie.add(Fe);let We=Up(Fe,"utf-8"),Ve=Zs(We,Hp(Fe),Ie,Fe);Ie.delete(Fe);for(let[Ge,Ke]of Object.entries(Ve)){let ze=In(e(`./${gx(Be,Ke.source)}`));Me[Ge]={...Ke,source:ze}}}else if(Oe.type==="ExportNamedDeclaration"){let Be=Oe.source?.value,Fe=Be!==void 0&&Sn.test(Be);if(Fe){let Ge=hr(Be,Ne);if(Ge.unresolved)throw new fr(Be,Re,Ge.searched)}let Ve=Be!==void 0&&!Fe?Cx(Be,Ne,Ie):void 0;if(Ve===null)console.warn(`sveld: could not resolve re-exported module "${Be}" from barrel "${Ne||"."}"; skipping.`);for(let Ge of Oe.specifiers){let Ke=Ge.exported.name,ze=Ge.local.name,Ye=Ke||ze;if(Ve===null)continue;let Qe=Ve?.exports[ze],tt=Qe?In(e(`./${xx(Ne,bx(Ve.dir,Qe.source))}`)):In(qs(Be??"",Ne)),ot=Qe?Qe.default:ze==="default";if(Ye in Me){if(Me[Ye].mixed=!0,!Me[Ye].source)Me[Ye].source=tt}else Me[Ye]={source:tt,default:ot}}}else if(Oe.type==="ImportDeclaration"){let Be=Oe.specifiers[0].local.name;if(Be in Me){if(!Me[Be].source)Me[Be].source=In(qs(Oe.source?.value??"",Ne))}else Me[Be]={source:In(qs(Oe.source?.value??"",Ne)),default:Be==="default"}}return Me}import{existsSync as vx}from"node:fs";import{dirname as Sx}from"node:path";function Kp(){return{cache:new Map,computing:new Set}}var Tx=/\.[^./\\]+$/;function kx(i){if(i.endsWith(".d.ts"))return null;let Ne=i.replace(Tx,".d.ts");return vx(Ne)?Ne:null}function zp(i,Ne,Ie){let Re=Sx(i);return Ne.map((Le)=>{if(!Le.importSource||!Le.importedName)return{candidate:Le};let Me=wn(Le.importSource,Re);if(!Me)return{candidate:Le,failureReason:"module-not-found"};let Oe=On(Me,Ie).find((Fe)=>Fe.name===Le.importedName);if(!Oe)return{candidate:Le,failureReason:"export-not-found"};if(Oe.returnType)return{candidate:Le,type:Oe.returnType};let Be=kx(Me);if(Be){let Fe=On(Be,Ie).find((We)=>We.name===Le.importedName);if(Fe?.returnType)return{candidate:Le,type:Fe.returnType}}return{candidate:Le,failureReason:"return-type-unresolved"}})}function Xp(i,Ne){switch(Ne){case"module-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importedName}" is not exported from "${i.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${i.propName}" default calls "${i.calleeName}()" imported from "${i.importSource}", but its return type could not be resolved; falling back to "any".`}}import{dirname as wx}from"node:path";function Jp(i,Ne,Ie){let Re=wx(i);return Ne.map((Le)=>{let Me=wn(Le.importSource,Re);if(!Me)return{candidate:Le};let Oe=On(Me,Ie).find((Be)=>Be.name===Le.importedName);if(Oe?.kind!=="const"||Oe.literalValue===void 0)return{candidate:Le};return{candidate:Le,key:Oe.literalValue}})}function b(i){return{failFast:i?.failFast,resolveTypes:i?.resolveTypes===!0,documentExports:i?.documentExports===!0,cache:i?.cache,checkExamples:i?.checkExamples==="syntax"?"syntax":i?.checkExamples===!0,dryRun:i?.dryRun===!0,diagnostics:i?.diagnostics,typesTypeNames:i?.typesOptions?.typeNames,typesInline:i?.typesOptions?.inline}}var Lx=/-/g,Ox=/[^A-Za-z0-9_$]/g,Mx=/^[0-9]/;function $x(i){let Ne=i.replace(Ox,""),Ie=Mx.test(Ne)?`_${Ne}`:Ne;if(Ie!==i)console.warn(`Warning: "${i}" is not a valid identifier; using "${Ie}" instead.`);return Ie}function ru(i,Ne=[],Ie=new Set,Re){let Le;try{Le=Re??Px(i)}catch{return Ne}if(Ie.has(Le))return Ne;Ie.add(Le);let Me=$s(i);if(Me===null)return Ne;let Oe=Me.entries;for(let Be of Oe){if(Be.name.startsWith("."))continue;let Fe=Qp(i,Be.name),We=Be.isSymbolicLink(),Ve=We?tu(Fe,{throwIfNoEntry:!1}):Be;if(!Ve)continue;if(Ve.isDirectory())ru(Fe,Ne,Ie,We?void 0:Qp(Le,Be.name));else if(Ve.isFile()&&Be.name.endsWith(".svelte"))Ne.push(Fe)}return Ne}function Bx(i){return ru(i).map((Ne)=>{let Ie=$x(_x(Ne,".svelte").replace(Lx,"")),Re=In(e(`./${Go(i,Ne)}`));return{moduleName:Ie,source:Re}}).sort((Ne,Ie)=>Ne.source.localeCompare(Ie.source))}function Fx(i){return!ks(i)}function jx(i,Ne){let Ie=i.endsWith("/")?i:`${i}/`;return Ne.startsWith(Ie)}function ei(i,Ne){return{seenPaths:new Set(i.map(([,Ie])=>Ne(Ie.source))),seenModuleNamePaths:new Map(i.map(([Ie,Re])=>[Ie,Ne(Re.source)])),warnedModuleNames:new Set}}function Uo(i,Ne,Ie,Re,Le){for(let{moduleName:Me,source:Oe}of Bx(i)){let Be=Re(Oe),Fe=Ne[Me];if(Fe&&Fx(Fe.source)&&jx(Fe.source,Oe)){Le.seenPaths.delete(Re(Fe.source)),Fe.source=Oe,Le.seenPaths.add(Be),Le.seenModuleNamePaths.set(Me,Be);continue}if(Le.seenPaths.has(Be))continue;Le.seenPaths.add(Be);let We=Le.seenModuleNamePaths.get(Me);if(We===void 0)Le.seenModuleNamePaths.set(Me,Be);else if(We!==Be&&!Le.warnedModuleNames.has(Me))Le.warnedModuleNames.add(Me),console.warn(`Warning: multiple components named "${Me}" found (${e(Go(i,We))} and ${e(Go(i,Be))}). Both are included in TypeScript definitions, but only one can be the named export.`);Ie.push([Me,{source:Oe,default:!1}])}}function ti(i,Ne,Ie=!1){Ms();let Re=eu(i).isFile(),Le=Re?nu(i):i,Me=Er(Le),Oe=new Map,Be=(Ve)=>{let Ge=Oe.get(Ve);if(Ge===void 0)Ge=Ix(Ve)?Er(Ve):Er(Me,Ve),Oe.set(Ve,Ge);return Ge},Fe={};if(Re){let Ve=Ax(i,"utf-8");try{Fe=Zs(Ve,Me,new Set([Er(i)]))}catch(Ge){if(!Ie)throw Ge;let Ke=Ge instanceof Error?Ge.message:String(Ge);console.warn(`Warning: Failed to parse component exports from ${i}: ${Ke}`)}}let We=Object.entries(Fe);if(Ne){let Ve=ei(We,Be);if(Uo(Me,Fe,We,Be,Ve),!Re)Fe=Object.fromEntries(We.map(([Ge,Ke])=>[Ge,{...Ke,default:!0}]))}return{exports:Fe,allComponentEntries:We,rootDir:Me,resolveComponentFilePath:Be}}async function ni(i){let Ne=await Promise.all(Array.from(i).map(async(Ie)=>{try{let Re=await Nx(Ie,"utf-8");return{path:Ie,content:Re}}catch(Re){return console.warn(`Warning: Failed to read file ${Ie}:`,Re),{path:Ie,content:null}}}));return new Map(Ne.map(({path:Ie,content:Re})=>[Ie,Re]))}function qn([i,Ne],Ie,Re,Le,Me={}){let Oe=Ne.source,Be=i;if(Ie.length===1&&i==="default")Be=Rx(Oe).name;if(ks(Oe)){let Fe=Le(Oe),We=Re.get(Fe);if(We===null||We===void 0)return null;let Ve=e(Oe),Ge=Me.memo?.get(Fe),Ke=Me.hashes?.get(Fe),ze=Ge===void 0?Ke===void 0?null:Me.cache?.get(Fe,Ke):null,Ye;if(Ge!==void 0)Ye=Ge;else if(ze)Ye=ze;else{let Qe=new(Qs()).ComponentParser;try{Ye=Qe.parseSvelteComponent(We,{moduleName:Be,filePath:Ve})}catch(tt){if(Me.failFast)throw tt;let ot=tt instanceof Error?tt.message:String(tt),ct=tt instanceof Error?tt.stack:void 0;return Me.onParseError?.({filePath:Ve,moduleName:Be,message:ot,stack:ct}),null}if(Ke!==void 0)Me.cache?.set(Fe,Ke,Ye);Me.memo?.set(Fe,Ye)}return{moduleName:Be,filePath:Ve,...Ye}}return null}function Ho(i,Ne){let Ie=new Set;for(let Re of i)for(let[,Le]of Re)if(ks(Le.source))Ie.add(Ne(Le.source));return Ie}function ri(i){if(i.length===0)return;console.error(`sveld: failed to parse ${i.length} component(s):`);for(let{filePath:Ne,message:Ie}of i)console.error(` - ${Ne}: ${Ie}`)}async function S(i,Ne,Ie={}){let Re=Ie.documentExports===!0,{exports:Le,allComponentEntries:Me,rootDir:Oe,resolveComponentFilePath:Be}=ti(i,Ne,Re),Fe=Re&&eu(i).isFile()?await Kr(Er(i)):[],We=Object.entries(Le),Ve=Ho([We,Me],Be),Ge=await ni(Ve),Ke=new Map,ze=new Map,Ye=Ie.cache===!1?void 0:new Fo($p(Oe,Ie.cache??!0)),Qe=Ye?new Map:void 0,tt=new Set,ot=new Map;if(Ye)for(let rt of Ve){let Ze=Ge.get(rt);if(Ze===null||Ze===void 0)continue;let at=Bp(Ze);if(ot.set(rt,at),!Ye.has(rt,at))tt.add(rt)}if(Ve.size>0&&(!Ye||tt.size>0))await er();let ct=new Map,et=new Map,it={failFast:Ie.failFast===!0,onParseError:(rt)=>ct.set(rt.filePath,rt),cache:Ye,hashes:ot,memo:et};for(let rt of We){let Ze=qn(rt,We,Ge,Be,it);if(Ze)Ke.set(Ze.moduleName,Ze)}for(let rt of Me){let Ze=qn(rt,Me,Ge,Be,it);if(Ze)ze.set(Ze.filePath,Ze),Qe?.set(Ze.filePath,Be(rt[1].source))}if(Ye&&tt.size>0){let rt=jr(ze,Be),Ze=Ls(tt,rt);for(let at of Ze){if(tt.has(at))continue;Ye.invalidate(at),et.delete(at)}for(let at of We){let ht=Be(at[1].source);if(!Ze.has(ht)||tt.has(ht))continue;let mt=qn(at,We,Ge,Be,it);if(mt)Ke.set(mt.moduleName,mt)}for(let at of Me){let ht=Be(at[1].source);if(!Ze.has(ht)||tt.has(ht))continue;let mt=qn(at,Me,Ge,Be,it);if(mt)ze.set(mt.filePath,mt),Qe?.set(mt.filePath,ht)}}let lt=Array.from(ct.values());if(ri(lt),!Ie.dryRun)Ye?.save();let At=Ie.resolveTypes?Ux(Ke):[],bt=Ie.checkExamples?Kx(ze):[],Ct=Ie.checkExamples===!0?Zp(bt,"compile"):[],$e=Ie.checkExamples?Zp(bt,"syntax"):[];if($e.length>0)zx($e);let je=Ie.typesInline==="all"?Js(ze,Be):new Map,qe,He;if(At.length>0||Ct.length>0||je.size>0){let{TypeResolver:rt}=await import("./chunk-yzb9k33r.js"),Ze=await rt.create(Oe);if(!Ze.ok){let ht=[At.length>0?"resolveTypes":null,Ct.length>0?"checkExamples":null,je.size>0?'typesOptions.inline: "all"':null].filter((mt)=>mt!==null).join(" and ");throw Error(`sveld: \`${ht}\` ${Ze.message}.`)}let at=Ze.resolver;try{if(At.length>0)await Hx(At,at,Be);if(Ct.length>0)await Xx(Ct,at,Be);if(je.size>0)qe=await at.openBareTypeSession(je),He=at;else await at.dispose()}catch(ht){throw await at.dispose(),ht}}let Xe=Vx(ze),Je=qx(ze);if(Xe.length>0||Je.length>0){await er();let rt=Kp();for(let{component:Ze,candidates:at}of Xe){let ht=zp(Be(Ze.filePath),at,rt);Wx(Ze,ht)}for(let{component:Ze,candidates:at}of Je){let ht=Jp(Be(Ze.filePath),at,rt);Gx(Ze,ht)}}e0(ze,Be,Ie.typesTypeNames),Zx(ze,Ie.typesTypeNames);let nt;try{nt=Ie.typesInline==="local"||Ie.typesInline==="all"?await Ys(ze,Be,Ie.typesTypeNames,qe):void 0}finally{if(qe)await qe.dispose();if(He)await He.dispose()}let st=cl(bs(Array.from(ze.values()).flatMap((rt)=>rt.diagnostics??[])),Ie.diagnostics?.ignore);return{exports:Le,entryExports:Fe,components:Ke,allComponentsForTypes:ze,errors:lt,diagnostics:st,cache:Ye,resolvedPathByFilePath:Qe,inlinedTypesByFilePath:nt}}function Vx(i){let Ne=[];for(let Ie of i.values()){let Re=Cn(Ie)?.pendingCallDefaultCandidates?.filter((Le)=>Le.importSource!==void 0);if(!Re||Re.length===0)continue;Ne.push({component:Ie,candidates:Re})}return Ne}function Wx(i,Ne){for(let{candidate:Ie,type:Re,failureReason:Le}of Ne){let Oe=(Ie.location==="props"?i.props:i.moduleExports).find((Be)=>Be.name===Ie.propName);if(Oe?.typeSource!=="unknown")continue;if(Re){if(Oe.type=Re,Oe.typeSource="typescript",Ie.location==="props")i.diagnostics=(i.diagnostics??[]).filter((Be)=>!(Be.kind==="prop-unknown-type"&&Be.name===Ie.propName));continue}if(Ie.location==="props"&&Le){let Be=i.diagnostics?.find((Fe)=>Fe.kind==="prop-unknown-type"&&Fe.name===Ie.propName);if(Be)Be.message=Xp(Ie,Le)}}}function qx(i){let Ne=[];for(let Ie of i.values()){let Re=Cn(Ie)?.pendingContextKeyCandidates;if(!Re||Re.length===0)continue;Ne.push({component:Ie,candidates:Re})}return Ne}function Gx(i,Ne){for(let{candidate:Ie,key:Re}of Ne){if(!Re){console.warn(`Warning: Could not resolve setContext key in ${i.filePath}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);continue}if(i.contexts?.some((Le)=>Le.key===Re))continue;i.contexts=[...i.contexts??[],{key:Re,typeName:Mr(Re),description:Ie.description,properties:Ie.properties,source:Ie.source}]}}function Ux(i){let Ne=[];for(let Ie of i.values()){let Re=Cn(Ie);if(!Re?.canonicalPropsType||Ie.props.length>0)continue;Ne.push({component:Ie,metadata:Re})}return Ne}async function Hx(i,Ne,Ie){let Re=await Ne.expandAll(i.map(({component:Le,metadata:Me})=>({moduleName:Le.moduleName,metadata:Me,filePath:Ie(Le.filePath)})));for(let{component:Le}of i){let Me=Re.get(Ie(Le.filePath));if(Me)ol(Le,Me)}}function Kx(i){let Ne=[];for(let Ie of i.values()){let Re=np(Ie);if(Re.length===0)continue;Ne.push({component:Ie,sources:Re})}return Ne}function Zp(i,Ne){let Ie=[];for(let{component:Re,sources:Le}of i){let Me=Le.filter((Oe)=>Oe.kind===Ne);if(Me.length===0)continue;Ie.push({component:Re,sources:Me})}return Ie}function zx(i){for(let{component:Ne,sources:Ie}of i){let Re=Ne.diagnostics??[];for(let Le of Ie)try{A(Le.code)}catch(Me){if(Me instanceof T)continue;Re.push(xn({component:Ne.filePath,kind:"example-syntax-error",name:Le.name,message:Me instanceof Error?Me.message:String(Me),...Le.source?{source:Le.source}:{}}))}Ne.diagnostics=Re}}async function Xx(i,Ne,Ie){let Re=await Ne.checkExamples(i.map(({component:Le,sources:Me})=>({moduleName:Le.moduleName,filePath:Ie(Le.filePath),sources:Me})));for(let{component:Le,sources:Me}of i){let Oe=Re.get(Ie(Le.filePath));if(!Oe||Oe.length===0)continue;let Be=new Map(Me.map((We)=>[We.id,We.source])),Fe=Le.diagnostics??[];for(let We of Oe){let Ve=Be.get(We.id);Fe.push(xn({component:Le.filePath,kind:"example-compile-error",name:We.name,message:We.message,...Ve?{source:Ve}:{}}))}Le.diagnostics=Fe}}var Jx=[".ts",".tsx",".d.ts",".svelte"];function Yx(i){let Ne=i.trim();if(Ne.length<2)return;let Ie=Ne[0],Re=Ne[Ne.length-1];if((Ie==='"'||Ie==="'"||Ie==="`")&&Ie===Re)return Ne.slice(1,-1);return}function Qx(i,Ne){let Ie=Er(nu(i),Ne);if(Yp(Ie)&&tu(Ie).isFile())return Ie;if(Dx(Ne)!=="")return;for(let Re of Jx){let Le=`${Ie}${Re}`;if(Yp(Le))return Le}return}function Zx(i,Ne){for(let Ie of i.values()){let Re=Ie.moduleExports.filter((Oe)=>Oe.kind==="re-export");if(Re.length===0)continue;let Le=new Set([Ln(Ie.moduleName,Ne),Qn(Ie.moduleName,Ne)]),Me=Ie.diagnostics??[];for(let Oe of Re){if(!Le.has(Oe.name))continue;Me.push(xn({component:Ie.filePath,kind:"module-export-conflict",name:Oe.name,message:`Re-export "${Oe.name}" has the same name as the generated "${Oe.name}" type; the .d.ts won't type-check if "${Oe.reExport?.from}" exports a type by that name.`,source:Oe.source}))}Ie.diagnostics=Me}}function e0(i,Ne,Ie){let Re=new Map(Array.from(i.values()).map((Le)=>[Ne(Le.filePath),Le]));for(let Le of i.values()){let Me=Le.extends;if(!Me)continue;let Oe=Yx(Me.import);if(Oe===void 0||!Oe.startsWith(".")&&!Oe.startsWith("/"))continue;let Be=Ne(Le.filePath),Fe=Qx(Be,Oe),We=Le.diagnostics??[];if(Fe===void 0){We.push(xn({component:Le.filePath,kind:"extend-props-target-missing",name:Me.interface,message:`@extends/@extendProps target "${Oe}" was not found on disk.`})),Le.diagnostics=We;continue}let Ve=Re.get(Fe);if(!Ve)continue;let Ge=Ln(Ve.moduleName,Ie);if(Me.interface!==Ge){We.push(xn({component:Le.filePath,kind:"extend-props-target-missing",name:Me.interface,message:`@extends/@extendProps names "${Me.interface}", but "${Oe}" generates "${Ge}".`})),Le.diagnostics=We;continue}for(let Ke of Le.props){let ze=Ve.props.find((Ye)=>Ye.name===Ke.name);if(ze&&ze.type!==Ke.type)We.push(xn({component:Le.filePath,kind:"extend-props-override",name:Ke.name,message:`Own prop "${Ke.name}" (${Ke.type}) overrides "${Ge}"'s "${Ke.name}" (${ze.type}).`}))}Le.diagnostics=We}}import{existsSync as su,readFileSync as t0}from"node:fs";import{join as iu}from"node:path";function D(i){if(i){let Ie=iu(process.cwd(),i);if(su(Ie))return Fr(i);return console.error(`Invalid entry point: ${Ie}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let Ne=iu(process.cwd(),"package.json");if(!su(Ne))return console.error("Could not locate a package.json file."),console.error(`Specify an entry point with --entry (or the "entry" option) instead.
|
|
219
|
-
`),null;try{let Ie=Fs(JSON.parse(t0(Ne,"utf-8")));if(Ie.svelte?.trim())return Fr(Ie.svelte);return console.error(`Could not determine an entry point.
|
|
220
|
-
`),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).
|
|
221
|
-
`),null}catch(Ie){throw console.error("Error reading package.json:",Ie),Ie}}var Ko=!1;function I(i){Ko=i}function an(i){if(!Ko)console.error(i)}function ou(i){if(!Ko)console.error(i)}import{lstatSync as n0}from"node:fs";import{resolve as si}from"node:path";async function au(i,Ne,Ie=!1,Re,Le){let Me=n0(i).isFile(),Oe=Me?si(i):null,Be=ti(i,Ne,Ie),{rootDir:Fe,exports:We,allComponentEntries:Ve,resolveComponentFilePath:Ge}=Be,Ke;if(Re==="all"){let{TypeResolver:qe}=await import("./chunk-yzb9k33r.js"),He=await qe.create(Fe);if(!He.ok)throw Error(`sveld: \`typesOptions.inline: "all"\` ${He.message}.`);Ke=He.resolver}let ze=Ie&&Me?await Kr(si(i)):[],Ye=Object.entries(We),Qe=ei(Ve,Ge),tt=new Map,ot=new Map;await er();let ct=new Map,et={onParseError:(qe)=>ct.set(qe.filePath,qe)},it=new Map,lt=new Map,At=async(qe)=>{if(Re!=="local"&&Re!=="all")return;for(let Je of qe.values()){it.delete(Je.filePath);for(let nt of lt.values())nt.delete(Je.filePath)}let He=new Map;if(Re==="all"&&Ke)Ke.forgetOverlayFiles(Array.from(qe.values(),(Je)=>Mo(Ge(Je.filePath),Je.moduleName))),He=Js(qe,Ge);let Xe;try{if(Ke&&He.size>0)Xe=await Ke.openBareTypeSession(He);let Je=await Ys(qe,Ge,Le,Xe);for(let[nt,st]of Je){it.set(nt,st);for(let rt of st.dependencies){let Ze=lt.get(rt);if(!Ze)Ze=new Set,lt.set(rt,Ze);Ze.add(nt)}}}finally{if(Xe)await Xe.dispose()}},bt=()=>({exports:We,entryExports:ze,components:tt,allComponentsForTypes:ot,errors:Array.from(ct.values()),diagnostics:bs(Array.from(ot.values()).flatMap((qe)=>qe.diagnostics??[])),inlinedTypesByFilePath:Re==="local"||Re==="all"?it:void 0});{let qe=Ho([Ye,Ve],Ge),He=await ni(qe);for(let Xe of Ye){let Je=qn(Xe,Ye,He,Ge,et);if(Je)tt.set(Je.moduleName,Je)}for(let Xe of Ve){let Je=qn(Xe,Ve,He,Ge,et);if(Je)ot.set(Je.filePath,Je)}await At(ot),ri(Array.from(ct.values()))}let Ct=jr(ot,Ge),$e=(qe,He,Xe,Je,nt)=>{let st=new Set;for(let rt of Xe){let Ze=Ge(rt[1].source);if(!Je.has(Ze))continue;let at=qn(rt,Xe,nt,Ge,et);if(at)qe.set(He(at),at),st.add(Ze);else for(let[ht,mt]of qe)if(Ge(mt.filePath)===Ze)qe.delete(ht)}return st};return{get result(){return Promise.resolve(bt())},update:async(qe)=>{let He=qe.map((gt)=>si(gt));if(Ms(),He.length===0)return{result:bt(),reparsed:[]};let Xe=new Set;for(let gt of He){let Et=lt.get(gt);if(Et)for(let Mt of Et)Xe.add(Mt)}let Je=Oe!==null&&He.includes(Oe),nt=[];if(Je){let gt=ti(i,Ne,Ie),Et=new Set(Object.keys(We)),Mt=new Set(Object.keys(gt.exports));for(let Vt of Et)if(!Mt.has(Vt))tt.delete(Vt);for(let Vt of Mt)if(!Et.has(Vt))nt.push(gt.resolveComponentFilePath(gt.exports[Vt].source));if(We=gt.exports,Ve=gt.allComponentEntries,Ge=gt.resolveComponentFilePath,Ye=Object.entries(We),Qe=ei(Ve,Ge),Ie&&Me)ze=await Kr(si(i))}if(Ne)Uo(Fe,We,Ve,Ge,Qe);let st=He.filter((gt)=>Sn.test(gt)||Ct.has(gt));if(st.length===0&&nt.length===0){if(Xe.size>0){let gt=new Map;for(let[Et,Mt]of ot)if(Xe.has(Mt.filePath))gt.set(Et,Mt);await At(gt)}return{result:bt(),reparsed:[]}}let rt=Ls([...st,...nt],Ct);for(let[gt,Et]of ct)if(rt.has(Ge(Et.filePath)))ct.delete(gt);let Ze=await ni(rt),at=new Set;for(let gt of $e(tt,(Et)=>Et.moduleName,Ye,rt,Ze))at.add(gt);for(let gt of $e(ot,(Et)=>Et.filePath,Ve,rt,Ze))at.add(gt);Ct=jr(ot,Ge);let ht=new Map;for(let[gt,Et]of ot)if(at.has(Ge(Et.filePath))||Xe.has(Et.filePath))ht.set(gt,Et);await At(ht);for(let gt of it.keys())if(!ot.has(gt))it.delete(gt);let mt=bt();return ri(mt.errors),{result:mt,reparsed:Array.from(at)}}}}import x0 from"node:path";import{mkdir as r0,readFile as s0,writeFile as i0}from"node:fs/promises";import{parse as o0}from"node:path";class Xt{dryRun;ensuredDirs=new Set;constructor(i){this.dryRun=i?.dryRun===!0}async write(i,Ne){if(this.dryRun)return console.log(`would write "${e(i)}"`),!0;try{if(await s0(i,"utf-8")===Ne)return!1}catch{}let Ie=o0(i).dir;if(!this.ensuredDirs.has(Ie))await r0(Ie,{recursive:!0}),this.ensuredDirs.add(Ie);return await i0(i,Ne),!0}}var a0=/^=>\s*/;function c0(i){let Ne=i.trim();if(!Ne.startsWith("("))return{parameters:[],returnTypeText:Ne||"any"};let Ie=0,Re=-1;for(let Be=0;Be<Ne.length;Be++)if(Ne[Be]==="(")Ie++;else if(Ne[Be]===")"){if(Ie--,Ie===0){Re=Be;break}}if(Re===-1)return{parameters:[],returnTypeText:"any"};let Le=Ne.slice(1,Re).trim(),Me=Ne.slice(Re+1).trim().replace(a0,"");return{parameters:Le===""?[]:vn(Le).map((Be)=>{let Fe=Be.trim(),We=Fe.startsWith("..."),Ve=We?Fe.slice(3):Fe,Ge=Ve.indexOf(":"),Ke=(Ge===-1?Ve:Ve.slice(0,Ge)).trim(),ze=Ge===-1?void 0:Ve.slice(Ge+1).trim(),Ye=Ke.endsWith("?"),Qe={name:Ye?Ke.slice(0,-1):Ke};if(ze)Qe.type={text:ze};if(Ye)Qe.optional=!0;if(We)Qe.rest=!0;return Qe}),returnTypeText:Me||"any"}}function l0(i){if(i.params!==void 0||i.returnType!==void 0)return{parameters:(i.params??[]).map((Ie)=>{let Re={name:Ie.name};if(Ie.type)Re.type={text:Ie.type};if(Ie.optional)Re.optional=!0;return Re}),returnTypeText:i.returnType??"any"};return i.type?c0(i.type):{parameters:[],returnTypeText:"any"}}function p0(i){return i.map((Ne)=>{if(Ne.isFunctionDeclaration){let{parameters:Re,returnTypeText:Le}=l0(Ne),Me={kind:"method",name:Ne.name,static:!1};if(Re.length>0)Me.parameters=Re;if(Me.return={type:{text:Le}},Ne.description)Me.description=Ne.description;if(Ne.deprecated!==void 0)Me.deprecated=Ne.deprecated;return Me}let Ie={kind:"field",name:Ne.name};if(Ne.type)Ie.type={text:Ne.type};if(Ne.value!==void 0)Ie.default=Ne.value;if(Ne.description)Ie.description=Ne.description;if(Ne.deprecated!==void 0)Ie.deprecated=Ne.deprecated;if(Ne.kind==="const")Ie.readonly=!0;return Ie})}function u0(i){let Ne=i.customElement?.props,Ie=new Map,Re=[];for(let Le of i.props){if(Le.isFunctionDeclaration)continue;let Me=Ne?.[Le.name];if(Me?.attribute===!1)continue;let Oe=Me?.attribute||Le.name.toLowerCase(),Be=Ie.get(Oe);if(Be!==void 0){console.warn(`sveld: props "${Be}" and "${Le.name}" of component "${i.moduleName}" both map to the custom-element attribute "${Oe}"; only "${Be}" is included.`);continue}Ie.set(Oe,Le.name);let We=Me?.type==="Array"||Me?.type==="Object"?[Le.description,"Serialized to/from JSON for the attribute."].filter(Boolean).join(" "):Le.description,Ve={name:Oe,fieldName:Le.name};if(Le.type)Ve.type={text:Le.type};if(Le.value!==void 0)Ve.default=Le.value;if(We)Ve.description=We;if(Me?.reflect)Ve.reflects=!0;Re.push(Ve)}return Re}function d0(i){if(!i||i.length===0)return;return i.map((Ne)=>{let Ie={name:Ne.name};if(Ne.description)Ie.description=Ne.description;return Ie})}function f0(i){if(!i||i.length===0)return;return i.map((Ne)=>{let Ie={name:Ne.name};if(Ne.type)Ie.type={text:Ne.type};if(Ne.default!==void 0)Ie.default=Ne.default;if(Ne.description)Ie.description=Ne.description;return Ie})}function h0(i){return i.filter((Ne)=>Ne.type==="dispatched").map((Ne)=>{let Ie={name:Ne.name,type:{text:`CustomEvent<${Ne.detail??"unknown"}>`}};if(Ne.description)Ie.description=Ne.description;if(Ne.deprecated!==void 0)Ie.deprecated=Ne.deprecated;return Ie})}function m0(i){return i.map((Ne)=>{let Ie={name:Ne.default?"":Ne.name??""};if(Ne.description)Ie.description=Ne.description;if(Ne.deprecated!==void 0)Ie.deprecated=Ne.deprecated;return Ie})}function y0(i){let Ne=d0(i.cssParts),Ie=f0(i.cssProperties),Re=p0(i.props),Le=u0(i),Me=h0(i.events),Oe=m0(i.slots),Be=i.moduleName,Fe=i.componentComment?{kind:"class",name:Be,description:i.componentComment,members:Re,attributes:Le,events:Me,slots:Oe}:{kind:"class",name:Be,members:Re,attributes:Le,events:Me,slots:Oe};if(Ne)Fe.cssParts=Ne;if(Ie)Fe.cssProperties=Ie;if(i.customElementTag)Fe.tagName=i.customElementTag,Fe.customElement=!0;return Fe}function g0(i,Ne){let Ie=[{kind:"js",name:i.moduleName,declaration:{name:i.moduleName,module:Ne}}];if(i.customElementTag)Ie.push({kind:"custom-element-definition",name:i.customElementTag,declaration:{name:i.moduleName,module:Ne}});return Ie}function cu(i,Ne={}){let Ie=o(i),Re=Ne.resolveModulePath??((Me)=>Me.filePath);return{schemaVersion:"1.0.0",modules:Ie.components.map((Me)=>{let Oe=Re(Me);return{kind:"javascript-module",path:Oe,declarations:[y0(Me)],exports:g0(Me,Oe)}})}}function zo(i,Ne){let Ie=cu(i,{resolveModulePath:(Re)=>ws(Re.filePath,Ne.inputDir)});return Yn(Ie)}async function Xo(i,Ne){let Ie=zo(i,Ne),Re=x0.join(process.cwd(),Ne.outFile),Me=await new Xt({dryRun:Ne.dryRun}).write(Re,Ie);if(!Ne.dryRun)an(`${Me?"created":"unchanged"} "${Ne.outFile}".`)}import Yo from"node:path";function lu(i){let Ne=new Map;for(let[Re,Le]of Object.entries(i)){let Me=Ne.get(Le.source)||[];Me.push({id:Re,exportee:Le}),Ne.set(Le.source,Me)}let Ie=[];for(let[Re,Le]of Ne){let Me=Sn.test(Re),Oe=Le.some(({id:Ke,exportee:ze})=>Ke!=="default"&&ze.default),Be=Le.some(({exportee:Ke})=>!Ke.default),Fe=Me&&Oe&&Be,We=[],Ve=[],Ge=[];for(let{id:Ke,exportee:ze}of Le){if(Ke==="default"){Ve.push(`export { default } from "${Re}";`);continue}if(ze.default)if(ze.mixed)Ve.push(`export { default as ${Ke} } from "${Re}";`),Ve.push(`export { default } from "${Re}";`);else Ge.push(`default as ${Ke}`);else if(Me&&!Fe)Ge.push(`default as ${Ke}`);else We.push(Ke)}if(Ge.length>0&&We.length>0)Ie.push(`export { ${[...Ge,...We].join(", ")} } from "${Re}";`);else{if(We.length>0)Ie.push(`export { ${We.join(", ")} } from "${Re}";`);if(Ge.length>0)Ie.push(`export { ${Ge.join(", ")} } from "${Re}";`)}Ie.push(...Ve)}return Ie.join(`
|
|
222
|
-
`)}function pu(i){return i.filter((Ne)=>Ne.names.length>0).map((Ne)=>`export type { ${Ne.names.join(", ")} } from "${Ne.source}";`).join(`
|
|
223
|
-
`)}function uu(i){return i.replace(Sn,"")}function Jo(i){return i.replace(Sn,".svelte.d.ts")}function b0(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)&&"start"in i&&"end"in i}function zr(i){if(Array.isArray(i))return i.map((Ne)=>zr(Ne));if(i!==null&&typeof i==="object"){let Ne={};for(let[Ie,Re]of Object.entries(i)){if((Ie==="source"||Ie==="componentCommentSource")&&b0(Re))continue;Ne[Ie]=zr(Re)}return Ne}return i}function Qo(i,Ne){return i.map((Ie)=>({...Ie,filePath:ws(Ie.filePath,Ne)}))}function E0(i,Ne,Ie){if(!Ne)return`${i.moduleName}.api.json`;if(!Ie.has(i.moduleName))Ie.add(i.moduleName),console.warn(`Warning: multiple components named "${i.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${uu(i.filePath)}.api.json`}async function C0(i,Ne){let Ie=o(i),Re=Qo(Ie.components,Ne.inputDir);if(Ne.source===!1)Re=zr(Re);let Le=new Map;for(let Oe of Re)Le.set(Oe.moduleName,(Le.get(Oe.moduleName)??0)+1);let Me=new Set;await Promise.all(Re.map(async(Oe)=>{let Be=(Le.get(Oe.moduleName)??0)>1,Fe=E0(Oe,Be,Me),We=Yo.resolve(Yo.join(Ne.outDir||"",Fe)),Ge=await new Xt({dryRun:Ne.dryRun}).write(We,Yn(Oe));if(!Ne.dryRun)an(`${Ge?"created":"unchanged"} "${We}".`)}))}function Zo(i,Ne){let Ie=o(i,{entryExports:Ne.entryExports}),Re={...Ie,components:Qo(Ie.components,Ne.inputDir)};if(Ne.source===!1)Re=zr(Re);return Yn(Re)}function du(i,Ne){let Ie=o(i,{entryExports:Ne.entryExports}),Re=Qo(Ie.components,Ne.inputDir);if(Ne.source===!1)Re=zr(Re);return`${Re.map((Le)=>JSON.stringify(Le)).join(`
|
|
224
|
-
`)}
|
|
225
|
-
`}async function v0(i,Ne){let Ie=Zo(i,Ne),Re=Yo.join(process.cwd(),Ne.outFile),Me=await new Xt({dryRun:Ne.dryRun}).write(Re,Ie);if(!Ne.dryRun)an(`${Me?"created":"unchanged"} "${Ne.outFile}".`)}async function ea(i,Ne){if(Ne.outDir)await C0(i,Ne);else await v0(i,Ne)}import di from"node:path";import{readFileSync as S0}from"node:fs";import{join as T0}from"node:path";function fu(){try{let{name:i,description:Ne}=Fs(JSON.parse(S0(T0(process.cwd(),"package.json"),"utf-8")));return{name:i,description:Ne}}catch{return{}}}var na=/`/g,hu=/\s+/g,tn="--",mu=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
|
|
226
|
-
| :- | :- | :- | :- | :- | :- | :- | :- |
|
|
227
|
-
`,ii=`| Slot name | Default | Props | Fallback | Description |
|
|
228
|
-
| :- | :- | :- | :- | :- |
|
|
229
|
-
`,oi=`| Event name | Type | Detail | Description |
|
|
230
|
-
| :- | :- | :- | :- |
|
|
231
|
-
`,ra=`| Name | Kind | Type | Description |
|
|
232
|
-
| :- | :- | :- | :- |
|
|
233
|
-
`,yu=`| Part name | Description |
|
|
234
|
-
| :- | :- |
|
|
235
|
-
`,gu=`| Property name | Type | Default value | Description |
|
|
236
|
-
| :- | :- | :- | :- |
|
|
237
|
-
`,Jr=/\|/g,k0=/</g,w0=/>/g,Cr=/\n/g,A0=/^[A-Za-z_$][\w$]*$/,P0=/\{@link\s+([^{}\s|]+)(?:\|([^{}]+))?\}/g;function ta(i){return i.replace(P0,(Ne,Ie,Re)=>`[${Re===void 0?Ie:Re.trim()}](${Ie})`)}function gn(i){if(i===void 0)return tn;return`<code>${i.replace(Jr,"|")}</code>`}function ai(i){if(!i.reExport)return gn(i.type);let{from:Ne,imported:Ie}=i.reExport,Re=Ie==="*"?"":A0.test(Ie)?`.${Ie}`:`[${JSON.stringify(Ie)}]`;return gn(`typeof import(${JSON.stringify(Ne)})${Re}`)}function Xr(i){return i.replace(k0,"<").replace(w0,">")}function Yr(i){if(i===void 0)return tn;return`<code>${i.replace(na,"\\`").replace(Jr,"|")}</code>`}function An(i,Ne){if(Ne===void 0)return i;let Ie=typeof Ne==="string"&&Ne.trim().length>0?`: ${Xr(Ne).replace(Cr," ").replace(Jr,"|")}`:"";return`<s>${i}</s><br />**Deprecated**${Ie}`}function ci(i){if(i===void 0||i.trim().length===0)return tn;return Xr(ta(i)).replace(Jr,"|").replace(Cr,"<br />")}function li(i){if(i===void 0||i==="{}")return tn;return gn(Hs(i).replace(Cr," "))}function pi(i){if(i===void 0)return tn;return gn(Xr(i).replace(Cr,"<br />"))}function Mn(i,Ne){let Ie=[];if(i!==void 0&&i.trim().length>0)Ie.push(Xr(ta(i)));for(let{name:Re,body:Le}of Ne??[]){let Me=Le?.trim();Ie.push(Me?`@${Re} ${Xr(ta(Me))}`:`@${Re}`)}if(Ie.length===0)return tn;return Ie.join(`
|
|
238
|
-
`).replace(Jr,"|").replace(Cr,"<br />")}function ui(i){if(i===void 0)return tn;return gn(i.replace(Cr," "))}var N0=/[^\w\- ]+/g,_0=/\s+/g;function D0(i,Ne){let Ie=i.toLowerCase().replace(na,"").replace(N0,"").replace(_0,"-"),Re=Ne.get(Ie)??0;return Ne.set(Ie,Re+1),Re===0?Ie:`${Ie}-${Re}`}class vr{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
|
|
239
|
-
|
|
240
|
-
`),this}append(i,Ne){switch(i){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let Ie=Number(i.slice(-1));if(this.sourceParts.push(`${"#".repeat(Ie)} ${Ne}`),this.hasToC&&i==="h2")this.toc.push({indent:0,raw:Ne??""});break}case"quote":this.sourceParts.push(`> ${Ne}`);break;case"p":this.sourceParts.push(Ne??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(Ne??"");break}if(i!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){let i=this.sourceParts.join("");if(!this.hasToC)return i;let Ne="<!-- __TOC__ -->",Ie=i.indexOf(Ne);if(Ie===-1)return i;let Re=new Map,Le=this.toc.map(({indent:Me,raw:Oe})=>`${" ".repeat(Me)}- [${Oe}](#${D0(Oe,Re)})`).join(`
|
|
241
|
-
`);return i.slice(0,Ie)+Le+i.slice(Ie+Ne.length)}}var I0=`| Name | Type | Default | Required | Description |
|
|
242
|
-
| :- | :- | :- | :- | :- |
|
|
243
|
-
`,R0=/[.!?](?:\s|$)/,L0=/\r?\n[ \t]*\r?\n/,O0=/\s+/g;function xu(i,Ne){if(!i)return Ne;let Ie=i.trim().split(L0)[0]?.replace(O0," ").trim();if(!Ie)return Ne;let Re=R0.exec(Ie);return Re?Ie.slice(0,Re.index+1):Ie}function sa(i,Ne,Ie){if(Ie.length===0)return;i.append("h3",Ne),i.append("raw",I0);for(let Re of Ie)i.append("raw",`| ${An(Re.name,Re.deprecated)} | ${ai(Re)} | ${Yr(Re.value)} | ${Re.isRequired?"Yes":"No"} | ${Mn(Re.description,Re.tags)} |
|
|
244
|
-
`);i.append("raw",`
|
|
245
|
-
`)}function M0(i,Ne){if(Ne.length===0)return;i.append("h3","Events"),i.append("raw",oi);for(let Ie of Ne)i.append("raw",`| ${An(Ie.name,Ie.deprecated)} | ${Ie.type} | ${Ie.type==="dispatched"?ui(Ie.detail):tn} | ${Mn(Ie.description,Ie.tags)} |
|
|
246
|
-
`);i.append("raw",`
|
|
247
|
-
`)}function $0(i,Ne,Ie){if(Ie.length===0)return;i.append("h3",Ne),i.append("raw",ii);for(let Re of Ie)i.append("raw",`| ${An(Re.default?tn:Re.name??tn,Re.deprecated)} | ${Re.default?"Yes":"No"} | ${li(Re.slot_props)} | ${pi(Re.fallback)} | ${Mn(Re.description,Re.tags)} |
|
|
248
|
-
`);i.append("raw",`
|
|
249
|
-
`)}function B0(i,Ne){if(Ne.typedefs.length===0)return;i.append("h3","Typedefs"),i.append("raw",`\`\`\`ts
|
|
250
|
-
${gr({typedefs:Ne.typedefs})}
|
|
251
|
-
\`\`\`
|
|
252
|
-
|
|
253
|
-
`)}function F0(i,Ne){if(i.append("h2",Ne.moduleName),Ne.generics)i.append("p",`Type parameters: ${gn(`<${Ne.generics[1]}>`)}`);if(Ne.componentComment?.trim())i.append("p",Ne.componentComment.trim());sa(i,"Props",Ne.props),sa(i,"Bindings",Ne.props.filter((Ie)=>Ie.reactive)),M0(i,Ne.events),$0(i,Ne.syntaxMode==="runes"?"Snippets":"Slots",Ne.slots),B0(i,Ne),sa(i,"Module exports",Ne.moduleExports)}function j0(i,Ne,Ie,Re){let Le=new vr,Me=Re.linkBase??"";if(Le.append("h1",Ne),Ie)Le.append("quote",Ie);Le.append("h2","Components");for(let Oe of i)Le.append("raw",`- [${Oe.moduleName}](${Me}/${Oe.moduleName}): ${xu(Oe.componentComment,"Component")}
|
|
254
|
-
`);if(Le.append("raw",`
|
|
255
|
-
`),Re.entryExports&&Re.entryExports.length>0){Le.append("h2","Exports");for(let Oe of Re.entryExports)Le.append("raw",`- \`${Oe.name}\`: ${xu(Oe.description,Oe.kind)}
|
|
256
|
-
`);Le.append("raw",`
|
|
257
|
-
`)}return Le.end()}function V0(i,Ne,Ie){let Re=new vr;if(Re.append("h1",Ne),Ie)Re.append("quote",Ie);for(let Le of i)F0(Re,Le);return Re.end()}function W0(i,Ne){let Ie=o(i,{entryExports:Ne.entryExports}),Re=fu(),Le=Ne.title??Re.name??"Components",Me=Ne.summary??Re.description;return{llmsTxt:j0(Ie.components,Le,Me,Ne),llmsFullTxt:V0(Ie.components,Le,Me)}}async function ia(i,Ne){let{llmsTxt:Ie,llmsFullTxt:Re}=W0(i,Ne),Le=new Xt({dryRun:Ne.dryRun}),Me=e(di.join(Ne.outDir??"","llms.txt")),Oe=e(di.join(Ne.outDir??"","llms-full.txt")),[Be,Fe]=await Promise.all([Le.write(di.join(process.cwd(),Me),Ie),Le.write(di.join(process.cwd(),Oe),Re)]);if(!Ne.dryRun)an(`${Be?"created":"unchanged"} "${Me}".`),an(`${Fe?"created":"unchanged"} "${Oe}".`)}import{join as aa,resolve as Tu}from"node:path";function bu(i,Ne,Ie){if(i.append("h1","Component Index"),i.append("h2","Components").tableOfContents(),i.append("divider"),Ie&&Ie.length>0)Cu(i,Ie);let Re=o(Ne);for(let Le of Re.components)Su(i,Le)}function Eu(i,Ne,Ie){i.append("h1","Component Index"),i.append("h2","Components");for(let Re of Ne)i.append("raw",`- [${Re.moduleName}](./${Re.moduleName}.md)
|
|
258
|
-
`);if(i.append("raw",`
|
|
259
|
-
`),i.append("divider"),Ie&&Ie.length>0)Cu(i,Ie)}function Cu(i,Ne){i.append("h2","Exports"),i.append("raw",ra);for(let Ie of Ne){let Re=(Ie.type??Ie.value)?.replace(hu," ").trim();i.append("raw",`| ${An(Ie.name,Ie.deprecated)} | ${`<code>${Ie.kind}</code>`} | ${gn(Re)} | ${ci(Ie.description)} |
|
|
260
|
-
`)}i.append("raw",`
|
|
261
|
-
`),i.append("divider")}function q0(i){return i.kind==="const"||i.isFunctionDeclaration}function G0(i,Ne){i.append("h3","Module exports"),i.append("raw",ra);for(let Ie of Ne)i.append("raw",`| ${An(Ie.name,Ie.deprecated)} | ${`<code>${Ie.kind}</code>`} | ${ai(Ie)} | ${Mn(Ie.description,Ie.tags)} |
|
|
262
|
-
`);i.append("raw",`
|
|
263
|
-
`)}function oa(i,Ne,Ie,Re){if(Ne.length>0)Ie(),i.append("raw",`
|
|
264
|
-
`);else i.append("p",Re??"None.")}function vu(i,Ne){Su(i,Ne)}function Su(i,Ne){if(i.append("h2",`\`${Ne.moduleName}\``),Ne.generics)i.append("p",`**Type parameters:** ${gn(`<${Ne.generics[1]}>`)}`);if(Ne.typedefs.length>0)i.append("h3","Types").append("raw",`\`\`\`ts
|
|
265
|
-
${gr({typedefs:Ne.typedefs})}
|
|
266
|
-
\`\`\`
|
|
267
|
-
|
|
268
|
-
`);if(i.append("h3","Props"),oa(i,Ne.props,()=>{i.append("raw",mu);let Ie=(Le)=>Le.reactive?0:Le.constant?2:1,Re=Ne.props.map((Le,Me)=>({prop:Le,index:Me})).sort((Le,Me)=>Ie(Le.prop)-Ie(Me.prop)||Le.index-Me.index).map(({prop:Le})=>Le);for(let Le of Re){let Me=q0(Le)?"accessor":Le.kind;i.append("raw",`| ${An(Le.name,Le.deprecated)} | ${Le.isRequired?"Yes":"No"} | ${`<code>${Me}</code>`} | ${Le.reactive?"Yes":"No"} | ${Le.binding??"--"} | ${gn(Le.type)} | ${Yr(Le.value)} | ${Mn(Le.description,Le.tags)} |
|
|
269
|
-
`)}}),Ne.moduleExports.length>0)G0(i,Ne.moduleExports);if(i.append("h3","Slots"),oa(i,Ne.slots,()=>{i.append("raw",ii);for(let Ie of Ne.slots)i.append("raw",`| ${An(Ie.default?tn:Ie.name??tn,Ie.deprecated)} | ${Ie.default?"Yes":"No"} | ${li(Ie.slot_props)} | ${pi(Ie.fallback)} | ${Mn(Ie.description,Ie.tags)} |
|
|
270
|
-
`)}),i.append("h3","Events"),oa(i,Ne.events,()=>{i.append("raw",oi);for(let Ie of Ne.events)i.append("raw",`| ${An(Ie.name,Ie.deprecated)} | ${Ie.type} | ${Ie.type==="dispatched"?ui(Ie.detail):tn} | ${Mn(Ie.description,Ie.tags)} |
|
|
271
|
-
`)}),Ne.cssParts&&Ne.cssParts.length>0){i.append("h3","CSS Parts"),i.append("raw",yu);for(let Ie of Ne.cssParts)i.append("raw",`| ${Ie.name} | ${ci(Ie.description)} |
|
|
272
|
-
`);i.append("raw",`
|
|
273
|
-
`)}if(Ne.cssProperties&&Ne.cssProperties.length>0){i.append("h3","CSS Custom Properties"),i.append("raw",gu);for(let Ie of Ne.cssProperties)i.append("raw",`| ${Ie.name} | ${gn(Ie.type)} | ${Yr(Ie.default)} | ${ci(Ie.description)} |
|
|
274
|
-
`);i.append("raw",`
|
|
275
|
-
`)}}class fi extends Xt{onAppend;markdownBase;constructor(i){super();this.onAppend=i.onAppend,this.markdownBase=new vr}get source(){return this.markdownBase.source}get hasToC(){return this.markdownBase.hasToC}get toc(){return this.markdownBase.toc}appendLineBreaks(){return this.markdownBase.appendLineBreaks(),this}append(i,Ne){return this.markdownBase.append(i,Ne),this.onAppend?.call(this,i,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function ca(i,Ne){return new fi({onAppend:(Ie,Re)=>{i.onAppend?.call(null,Ie,Re,Ne)}})}async function U0(i,Ne){let Ie=Ne.outDir,Re=o(i,{entryExports:Ne.entryExports}),Le=new Xt({dryRun:Ne.dryRun}),Me=ca(Ne,i);Eu(Me,Re.components,Ne.entryExports);let Oe=Tu(aa(Ie,"README.md")),Be=await Le.write(Oe,Me.end());if(!Ne.dryRun)an(`${Be?"created":"unchanged"} "${Oe}".`);await Promise.all(Re.components.map(async(Fe)=>{let We=ca(Ne,i);vu(We,Fe);let Ve=Tu(aa(Ie,`${Fe.moduleName}.md`)),Ge=await Le.write(Ve,We.end());if(!Ne.dryRun)an(`${Ge?"created":"unchanged"} "${Ve}".`)}))}function la(i,Ne){let Ie=ca(Ne,i);return bu(Ie,i,Ne.entryExports),Ie.end()}async function pa(i,Ne){if(Ne.outDir){if(Ne.write!==!1)await U0(i,Ne);return}let Ie=Ne?.write!==!1,Re=la(i,Ne);if(Ie){let Le=aa(process.cwd(),Ne.outFile),Me=await new Xt({dryRun:Ne.dryRun}).write(Le,Re);if(!Ne.dryRun)an(`${Me?"created":"unchanged"} "${Ne.outFile}".`)}return Re}import{join as ku}from"node:path";function H0(i){let Ne=new Set;for(let Ie of i)if(Ie.extends)Ne.add(Ie.extends.interface);return Ne}function K0(i){return zs(i,Ao,!0).props}var z0={props:!0,exports:!0,typedefs:!1,contexts:!1};function X0(i){if(!i)return;return zs(i,z0,!1)}function J0(i,Ne,Ie){let Re=X0(Ne.indexTypes);if(!Re)return[];let Le=Po(Ne),Me=Ne.format==="component",Oe=new Map,Be=new Set,Fe=[];for(let[,We]of Object.entries(Ne.exports)){if(!We.default||!Sn.test(We.source))continue;let Ve=e(We.source);if(Be.has(Ve))continue;Be.add(Ve);let Ge=i.components.find((tt)=>tt.filePath===Ve);if(!Ge)continue;let Ke=Ln(Ge.moduleName,Ne.typeNames),ze=Ie.has(Ke),Ye=[];if(Re.props&&(Le.props||ze))Ye.push(Ke);if(Re.exports&&Me&&Le.exports)Ye.push(Qn(Ge.moduleName,Ne.typeNames));if(Re.typedefs&&Le.typedefs)for(let tt of Ge.typedefs)Ye.push(tt.name);if(Re.contexts&&Le.contexts)for(let tt of Ge.contexts??[])Ye.push(tt.typeName);let Qe=[];for(let tt of Ye){let ot=Oe.get(tt);if(ot!==void 0){ou(`sveld: index.d.ts skips duplicate type export "${tt}" from "${We.source}" (already exported from "${ot}").`);continue}Oe.set(tt,We.source),Qe.push(tt)}if(Qe.length>0)Fe.push({source:We.source,names:Qe})}return Fe}async function wu(i,Ne,Ie){if(!i)return Ne;try{let Re=await i(Ne,Ie);if(typeof Re!=="string")throw TypeError(`must return a string, got ${typeof Re}`);return Re}catch(Re){let Le=Re instanceof Error?Re.message:String(Re);throw Error(`sveld: typesOptions.transform failed for "${Ie.filePath}": ${Le}`,{cause:Re})}}async function ua(i,Ne){let Ie=ku(process.cwd(),Ne.outDir,"index.d.ts"),Re=new Xt({dryRun:Ne.dryRun}),Le=o(i),Me=H0(Le.components),Oe=pu(J0(Le,Ne,Me)),Be=Ne.preamble+[lu(Ne.exports),Oe].filter((Ge)=>Ge!=="").join(`
|
|
276
|
-
|
|
277
|
-
`),Fe=No(Ne),We=Le.components.map(async(Ge)=>{let Ke=Jo(ku(Ne.outDir,Ge.filePath)),ze=e(Jo(Ge.filePath)),Ye=Ne.resolvedPathByFilePath?.get(Ge.filePath),Qe=Ne.inlinedTypesByFilePath?.get(Ge.filePath),tt=Me.has(Ln(Ge.moduleName,Ne.typeNames))&&!K0(Fe.exportTypes)?{...Fe,forceExportProps:!0}:Fe,ot=Qe?{...tt,inlined:Qe}:tt,ct=(Qe?.declarations.length??0)>0,et=Ap(ot),it=!ct&&Ye?Ne.cache?.getGeneratedText(Ye,et):void 0;if(it===void 0){if(it=_o(Ge,ot),!ct&&Ye)Ne.cache?.setGeneratedText(Ye,et,it)}let lt=await wu(Ne.transform,it,{kind:"component",component:Ge,filePath:ze});await Re.write(Ke,lt)}),Ve=(async()=>{let Ge=await wu(Ne.transform,Be,{kind:"index",filePath:"index.d.ts"});await Re.write(Ie,`${Ge}
|
|
278
|
-
`)})();if(await Promise.all([...We,Ve]),!Ne.dryRun)an("created TypeScript definitions.")}k({name:"json",componentSet:"exported",write:ea});k({name:"markdown",componentSet:"exported",write:pa});k({name:"types",componentSet:"all",write:ua});k({name:"custom-elements",componentSet:"exported",write:Xo});k({name:"llms",componentSet:"exported",write:ia});var Au='sveld: could not resolve a Svelte entry point. Set package.json#svelte, or pass the "entry" option.',Z0=50;function eb(i){let Ne=Promise.resolve();return()=>{Ne=Ne.then(i,i)}}function ve(i){let Ne=i?.watch===!0,Ie,Re,Le=i??{},Me,Oe=null,Be,Fe=new Set,Ve=eb(async()=>{if(Oe==null||Re==null||Fe.size===0)return;let Ke=Array.from(Fe);Fe.clear();try{let{result:ze}=await Oe.update(Ke);await w(ze,Le,Re)}catch(ze){console.error("sveld: failed to regenerate types in watch mode:",ze)}}),Ge=(Ke)=>{if(!Ne||Oe==null||!Bl.test(Ke))return;Fe.add(Ke),clearTimeout(Be),Be=setTimeout(Ve,Z0)};return{name:"vite-plugin-sveld",apply:Ne?void 0:"build",enforce:"post",configResolved(Ke){Me=Ke.root},async buildStart(){if(i?.config){let Ke=Me??process.cwd(),ze=typeof i.config==="string"?await mo(Y0(i.config)?i.config:Q0(Ke,i.config)):await _(Ke);Le=E(ze,i)}if(N(Le),I(Le.quiet===!0),Re=D(Le.entry),Ne&&Re!=null)try{Oe=await au(Re,Le.glob===!0,Le.documentExports===!0,Le.typesOptions?.inline,Le.typesOptions?.typeNames),await w(await Oe.result,Le,Re)}catch(Ke){console.error("sveld: failed to generate initial types in watch mode:",Ke)}},async generateBundle(){if(Ne)return;if(Re==null)this.error(Au);Ie=await S(Re,Le.glob===!0,b(Le))},async writeBundle(){if(Ne)return;if(Re==null)this.error(Au);await w(Ie,Le,Re),Ie.cache?.save()},handleHotUpdate(Ke){Ge(Ke.file)},watchChange(Ke){Ge(Ke)}}}function Qr(i,Ne,Ie){let Re=z(i);if(!Re)throw Error(`sveld: built-in writer "${i}" is not registered.`);return Re.write(Ne,Ie)}async function w(i,Ne,Ie){let Re=Pu(Ie),Le=Ne?.dryRun===!0;if(Ne?.types!==!1)await Qr("types",i.allComponentsForTypes,{outDir:"types",preamble:"",...Ne?.typesOptions,exports:i.exports,inputDir:Re,dryRun:Le,cache:i.cache,resolvedPathByFilePath:i.resolvedPathByFilePath,inlinedTypesByFilePath:i.inlinedTypesByFilePath});if(Ne?.json)await Qr("json",i.components,{outFile:"COMPONENT_API.json",...Ne?.jsonOptions,input:Ie,inputDir:Re,entryExports:i.entryExports,dryRun:Le});if(Ne?.markdown)await Qr("markdown",i.components,{outFile:"COMPONENT_INDEX.md",...Ne?.markdownOptions,entryExports:i.entryExports,dryRun:Le});if(Ne?.customElements)await Qr("custom-elements",i.components,{outFile:"custom-elements.json",...Ne?.customElementsOptions,inputDir:Re,dryRun:Le});if(Ne?.llms)await Qr("llms",i.components,{...Ne?.llmsOptions,entryExports:i.entryExports,dryRun:Le});let Me=Object.entries(Ne?.additionalWriters??{}).map(([Oe,Be])=>{let Fe=z(Oe);if(!Fe){console.warn(`sveld: no writer registered with name "${Oe}"; skipping.`);return}let We=Fe.componentSet==="all"?i.allComponentsForTypes:i.components,Ve={...Be,dryRun:Le};return tb(Oe,Fe,We,Ve)});await Promise.all(Me)}async function tb(i,Ne,Ie,Re){try{return await Ne.write(Ie,Re)}catch(Le){let Me=Le instanceof Error?Le.message:String(Le);throw Error(`sveld: writer "${i}" failed: ${Me}`,{cause:Le})}}async function Nu(i,Ne,Ie){let Re=Pu(Ie);if(Ne?.json){let Le={...Ne?.jsonOptions,inputDir:Re,entryExports:i.entryExports},Me=Ne.stdout==="ndjson"?du(i.components,Le):Zo(i.components,Le);process.stdout.write(Me);return}if(Ne?.markdown){let Le=la(i.components,{...Ne?.markdownOptions,entryExports:i.entryExports});process.stdout.write(Le);return}if(Ne?.customElements){let Le=zo(i.components,{...Ne?.customElementsOptions,inputDir:Re});process.stdout.write(Le)}}import{appendFileSync as ib,existsSync as ob}from"node:fs";import{join as ab}from"node:path";var Du=/%/g,Iu=/\r/g,Ru=/\n/g,nb=/,/g,rb=/:/g,Lu=/\|/g;function _u(i){return i.replace(Du,"%25").replace(Iu,"%0D").replace(Ru,"%0A").replace(nb,"%2C").replace(rb,"%3A")}function sb(i){return i.replace(Du,"%25").replace(Iu,"%0D").replace(Ru,"%0A")}function Ou(i,Ne,Ie,Re,Le,Me){let Oe=i==="error"?"error":"warning",Be=[];if(Re!==void 0)Be.push(`file=${_u(Re)}`);if(Le!==void 0)Be.push(`line=${Le}`);if(Me!==void 0)Be.push(`col=${Me}`);return Be.push(`title=${_u(Ne)}`),`::${Oe} ${Be.join(",")}::${sb(Ie)}`}function Mu(i){return i.filter((Ne)=>!Ne.ignored).map((Ne)=>Ou(Ne.severity,`sveld ${Ne.code}`,Ne.message,Ne.component,Ne.source?.start.line,Ne.source?.start.column)).join(`
|
|
279
|
-
`)}function $u(i){let Ne=i.filter((Re)=>!Re.ignored);if(Ne.length===0)return"";return["### sveld diagnostics","","| Severity | Code | Location | Message |","| --- | --- | --- | --- |",...Ne.map((Re)=>{let Le=Re.source?`${Re.component}:${Re.source.start.line}`:Re.component;return`| ${Re.severity} | ${Re.code} | ${Le} | ${Re.message.replace(Lu,"\\|")} |`})].join(`
|
|
280
|
-
`)}function Bu(i,Ne){return i.changes.filter((Ie)=>Ds(Ie.bump,Ne))}function Fu(i,Ne){return Bu(i,Ne).map((Ie)=>Ou("error","sveld breaking change",Ie.message,Ie.component==="*"?void 0:Ie.component)).join(`
|
|
281
|
-
`)}function ju(i,Ne){let Ie=Bu(i,Ne);if(Ie.length===0)return"";return["### sveld breaking changes","","| Component | Kind | Message |","| --- | --- | --- |",...Ie.map((Le)=>`| ${Le.component} | ${Le.kind} | ${Le.message.replace(Lu,"\\|")} |`)].join(`
|
|
282
|
-
`)}var da="src/index.js",Ft={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},cb=`Usage: sveld [options]
|
|
283
|
-
|
|
284
|
-
Generate TypeScript definitions and component documentation for a Svelte
|
|
285
|
-
library. With no flags, only TypeScript definitions are generated for the
|
|
286
|
-
entry resolved from package.json#svelte.
|
|
287
|
-
|
|
288
|
-
--entry, --cache, --check, --types-format, --types-export,
|
|
289
|
-
--types-comments, --types-inline, and --types-props-declaration accept
|
|
290
|
-
their value as --flag=value or as a separate --flag value argument.
|
|
291
|
-
|
|
292
|
-
Options:
|
|
293
|
-
--entry=<path> Entry point to uncompiled Svelte source (default: package.json "svelte" field)
|
|
294
|
-
--glob Analyze all *.svelte files instead of the entry barrel
|
|
295
|
-
--types Generate TypeScript definitions (default: true)
|
|
296
|
-
--json Generate component documentation in JSON format
|
|
297
|
-
--markdown Generate component documentation in Markdown format
|
|
298
|
-
--custom-elements Generate a Custom Elements Manifest (custom-elements.json)
|
|
299
|
-
--llms Generate an llms.txt / llms-full.txt pair (https://llmstxt.org)
|
|
300
|
-
--fail-fast Abort the run when a single component fails to parse
|
|
301
|
-
--dry-run Resolve, parse, and print "would write" lines for each output file instead of writing anything (including the parse cache)
|
|
302
|
-
--quiet Suppress progress logs (errors, the diagnostics summary, and the --check report are unaffected)
|
|
303
|
-
--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
|
|
304
|
-
--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)
|
|
305
|
-
--resolve-types Expand opaque imported $props() types into JSON (alias: --resolveTypes, deprecated)
|
|
306
|
-
--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
|
|
307
|
-
--report-diagnostics Print unresolved-type diagnostics to stderr
|
|
308
|
-
--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}
|
|
309
|
-
--types-format=<format> ".d.ts" output format: "class" (default) or "component" (Svelte 5 Component<...>)
|
|
310
|
-
--types-export=<all|none> Sets typesOptions.exportTypes; "all" exports every generated type (default), "none" keeps them all local
|
|
311
|
-
--types-comments=<all|descriptions|none> Sets typesOptions.comments; how much JSDoc lands in the generated .d.ts (default: all)
|
|
312
|
-
--types-inline=<local|all> Sets typesOptions.inline; copies imported types into the .d.ts instead of importing them (default: false; pass --types-inline=false to reset)
|
|
313
|
-
--types-index-types Sets typesOptions.indexTypes; also re-exports generated types from index.d.ts (pass --types-index-types=false to disable)
|
|
314
|
-
--types-props-declaration=<type|interface> Sets typesOptions.propsDeclaration; emits the props type as a type alias (default) or an interface
|
|
315
|
-
--check[=<path>] Diff the parsed API against a committed snapshot; exit 3 on a breaking change (default path: COMPONENT_API.json)
|
|
316
|
-
--check-level=<major|minor|patch> Minimum bump --check fails the run on (default: major)
|
|
317
|
-
--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
|
|
318
|
-
--help Print this help message and exit
|
|
319
|
-
--version Print the installed sveld version and exit
|
|
320
|
-
|
|
321
|
-
Exit codes:
|
|
322
|
-
0 success
|
|
323
|
-
1 usage or configuration error
|
|
324
|
-
2 generation failure
|
|
325
|
-
3 breaking API change detected by --check
|
|
326
|
-
4 diagnostics present under --strict
|
|
327
|
-
`,fa={resolveTypes:"resolve-types",checkExamples:"check-examples"},lb=["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","types-export","types-comments","types-inline","types-index-types","types-props-declaration","format"],pb=[...lb,...Object.keys(fa)],ub=new Set(["glob","types","json","markdown","quiet","custom-elements","llms","strict","report-diagnostics","resolve-types","check-examples","fail-fast","dry-run","types-index-types"]),db=new Set(["entry","cache","check","types-format","types-export","types-comments","types-inline","types-props-declaration"]),fb=new Set(["entry","types-format","types-export","types-comments","types-inline","types-props-declaration"]);function hb(i){let Ne=Is(i,pb);return Ne===void 0?void 0:fa[Ne]??Ne}function mb(i,Ne){let Ie=i.indexOf("="),Re=Ie===-1?i.slice(2):i.slice(2,Ie),Le=fa[Re]??Re,Me=Ie===-1?!0:i.slice(Ie+1),Oe=!1;if(Ie===-1&&db.has(Le)){if(Ne!==void 0&&!Ne.startsWith("--"))Me=Ne,Oe=!0;else if(fb.has(Le))return{result:{kind:"usage-error",message:`sveld: --${Le} requires a value (pass --${Le}=<value> or --${Le} <value>).`},consumedNext:!1,flag:Le}}return{result:yb(Le,Me,i,Re),consumedNext:Oe,flag:Le}}function yb(i,Ne,Ie,Re){switch(i){case"help":return{kind:"help"};case"version":return{kind:"version"};case"glob":case"types":case"json":case"markdown":case"quiet":return{kind:"option",option:{[i]:Ne===!0||Ne==="true"}};case"stdout":if(Ne===!0||Ne==="true")return{kind:"option",option:{stdout:!0}};if(Ne==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:Ne}};case"custom-elements":return{kind:"option",option:{customElements:Ne===!0||Ne==="true"}};case"llms":return{kind:"option",option:{llms:Ne===!0||Ne==="true"}};case"strict":if(Ne===!0||Ne==="true")return{kind:"option",option:{strict:!0}};if(Ne==="false")return{kind:"option",option:{strict:!1}};return{kind:"option",option:{strict:Ne}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:Ne===!0||Ne==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:Ne===!0||Ne==="true"}};case"check-examples":if(Ne===!0||Ne==="true")return{kind:"option",option:{checkExamples:!0}};if(Ne==="false")return{kind:"option",option:{checkExamples:!1}};return{kind:"option",option:{checkExamples:Ne}};case"fail-fast":return{kind:"option",option:{failFast:Ne===!0||Ne==="true"}};case"dry-run":return{kind:"option",option:{dryRun:Ne===!0||Ne==="true"}};case"entry":return typeof Ne==="string"?{kind:"option",option:{entry:Ne}}:{kind:"option",option:{}};case"cache":if(Ne==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof Ne==="string"?Ne:!0}};case"check":if(Ne==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof Ne==="string"?Ne:!0}};case"types-format":return typeof Ne==="string"?{kind:"option",option:{typesOptions:{format:Ne}}}:{kind:"option",option:{}};case"types-export":return typeof Ne==="string"?{kind:"option",option:{typesOptions:{exportTypes:Ne}}}:{kind:"option",option:{}};case"types-comments":return typeof Ne==="string"?{kind:"option",option:{typesOptions:{comments:Ne}}}:{kind:"option",option:{}};case"types-inline":if(Ne==="false")return{kind:"option",option:{typesOptions:{inline:!1}}};return typeof Ne==="string"?{kind:"option",option:{typesOptions:{inline:Ne}}}:{kind:"option",option:{}};case"types-index-types":return{kind:"option",option:{typesOptions:{indexTypes:Ne===!0||Ne==="true"}}};case"types-props-declaration":return typeof Ne==="string"?{kind:"option",option:{typesOptions:{propsDeclaration:Ne}}}:{kind:"option",option:{}};case"format":return typeof Ne==="string"?{kind:"option",option:{format:Ne}}:{kind:"option",option:{}};case"check-level":return typeof Ne==="string"?{kind:"option",option:{checkLevel:Ne}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:Ie,suggestion:hb(Re)}}}function gb(i){let Ne={},Ie=!1;for(let Re=0;Re<i.length;Re++){let Le=i[Re];if(!Le.startsWith("--"))return{kind:"unknown",arg:Le,positionalHint:Ie?!0:void 0};let{result:Me,consumedNext:Oe,flag:Be}=mb(Le,i[Re+1]);if(Me.kind!=="option")return Me;if(Ne=E(Ne,Me.option),Ie=ub.has(Be),Oe)Re++}return{kind:"options",options:Ne}}var xb=[{flagName:"types-format",key:"format",values:["class","component"]},{flagName:"types-comments",key:"comments",values:["all","descriptions","none"]},{flagName:"types-inline",key:"inline",values:["local","all"]},{flagName:"types-props-declaration",key:"propsDeclaration",values:["type","interface"]}];function bb(i){let Ne=i.map((Ie)=>`"${Ie}"`);return Ne.length<=2?Ne.join(" or "):`${Ne.slice(0,-1).join(", ")}, or ${Ne.at(-1)}`}async function ie(i){let Ne=gb(i.argv.slice(2));if(Ne.kind==="help"){console.log(cb);return}if(Ne.kind==="version"){console.log(jl.version);return}if(Ne.kind==="usage-error"){console.error(Ne.message),i.exitCode=Ft.USAGE_ERROR;return}if(Ne.kind==="unknown"){let Qe=`Unknown flag: ${Ne.arg}`;if(Ne.suggestion)Qe+=` Did you mean --${Ne.suggestion}?`;if(Ne.positionalHint)Qe+=" (values are passed as --flag=value or --flag value)";console.error(Qe),console.error("Run sveld --help for a list of available flags."),i.exitCode=Ft.USAGE_ERROR;return}let Ie=Ne.options,Re=await _(),Le=G(E(Re,Ie));if(N(Le),Le.stdout){if(Le.stdout!==!0&&Le.stdout!=="json"&&Le.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${Le.stdout}".`),i.exitCode=Ft.USAGE_ERROR;return}if([Le.json,Le.markdown,Le.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),i.exitCode=Ft.USAGE_ERROR;return}if(Le.stdout==="ndjson"&&!Le.json){console.error("sveld: --stdout=ndjson is only valid with --json."),i.exitCode=Ft.USAGE_ERROR;return}if(Le.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),i.exitCode=Ft.USAGE_ERROR;return}if(Le.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),i.exitCode=Ft.USAGE_ERROR;return}}if(Le.format!==void 0&&Le.format!=="text"&&Le.format!=="json"&&Le.format!=="github"){console.error(`sveld: --format must be "text", "json", or "github"; got "${Le.format}".`),i.exitCode=Ft.USAGE_ERROR;return}if(Le.strict!==void 0&&Le.strict!==!0&&Le.strict!==!1&&Le.strict!=="errors"){console.error(`sveld: --strict must be "errors", "ci", or "local" when given a value; got "${Le.strict}".`),i.exitCode=Ft.USAGE_ERROR;return}if(Le.checkLevel!==void 0&&Le.checkLevel!=="major"&&Le.checkLevel!=="minor"&&Le.checkLevel!=="patch"){console.error(`sveld: --check-level must be "major", "minor", or "patch"; got "${Le.checkLevel}".`),i.exitCode=Ft.USAGE_ERROR;return}if(Le.checkExamples!==void 0&&Le.checkExamples!==!0&&Le.checkExamples!==!1&&Le.checkExamples!=="syntax"){console.error(`sveld: --check-examples must be "syntax" when given a value; got "${Le.checkExamples}".`),i.exitCode=Ft.USAGE_ERROR;return}let Me=Le.typesOptions?.exportTypes;if(typeof Me==="string"){if(Me!=="all"&&Me!=="none"){console.error(`sveld: --types-export must be "all" or "none"; got "${Me}".`),i.exitCode=Ft.USAGE_ERROR;return}Le.typesOptions={...Le.typesOptions,exportTypes:Me==="all"}}for(let{flagName:Qe,key:tt,values:ot}of xb){let ct=Le.typesOptions?.[tt];if(ct===void 0||ct===!1)continue;if(!ot.includes(ct)){console.error(`sveld: --${Qe} must be ${bb(ot)}; got "${ct}".`),i.exitCode=Ft.USAGE_ERROR;return}}I(Le.quiet===!0);let Oe=D(Le.entry),Be;if(Oe!==null)Be=Oe;else if(ob(ab(i.cwd(),da)))console.error(`sveld: could not resolve an entry point; falling back to "${da}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),Be=Fr(e(da));else{i.exitCode=Ft.USAGE_ERROR;return}let Fe,We;try{if(Fe=await S(Be,Le.glob===!0,b(Le)),Le.check)We=await M(Fe.components,H(Le),{entryExports:Fe.entryExports});if(Le.stdout)await Nu(Fe,Le,Be);else if(await w(Fe,Le,Be),!Le.dryRun)Fe.cache?.save()}catch(Qe){if(Qe instanceof fr){console.error(`sveld: ${Qe.message}`),i.exitCode=Ft.USAGE_ERROR;return}console.error(Qe instanceof Error?Qe.message:String(Qe)),i.exitCode=Ft.GENERATION_FAILURE;return}let Ve=Le.reportDiagnostics||Le.strict,Ge=F(Fe.diagnostics,Ve),Ke=[];if(Ve&&Ge.length>0)if(Le.format==="json")i.stderr.write(V(Ge));else if(Le.format==="github"){let Qe=Mu(Ge);if(Qe)console.error(Qe);let tt=$u(Ge);if(tt)Ke.push(tt)}else console.error(q(Ge));if(We)if(Le.format==="json")i.stdout.write(se(We));else if(Le.format==="github"){let Qe=Fu(We,Le.checkLevel??"major");if(Qe)console.log(Qe);let tt=ju(We,Le.checkLevel??"major");if(tt)Ke.push(tt)}else console.log(ne(We));if(Le.format==="github"&&Ke.length>0&&i.env.GITHUB_STEP_SUMMARY)ib(i.env.GITHUB_STEP_SUMMARY,`${Ke.join(`
|
|
328
|
-
|
|
329
|
-
`)}
|
|
330
|
-
`);let ze;if(We?.changes.some((Qe)=>Qe.kind==="schema")??!1)ze=Ft.USAGE_ERROR;else if(We&&Ds(We.bump,Le.checkLevel??"major"))ze=Ft.BREAKING_CHANGE;if(J(Ge,Le.strict).length>0)ze=ze===void 0?Ft.DIAGNOSTICS:Math.min(ze,Ft.DIAGNOSTICS);if(ze!==void 0)i.exitCode=ze}
|
|
331
|
-
export{Ae,a,C,oe,f,s,ae,p,d,ce,g,B,j,F,J,q,ue,V,r,m,U,t,n,u,R,h,pe,le,fe,X,y,de,Q,me,he,x,ye,c,P,ge,Y,xe,Te,Ee,Z,be,L,W,Se,K,ee,te,O,l,ke,we,re,v,T,A,e,o,Ce,H,M,ne,Pe,se,D,De,_,E,G,N,I,b,S,k,z,_e,ve,w,ie};
|