shadcn-svelte 1.2.1 → 1.2.3
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/dist/index.mjs +83 -83
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t,r as n,t as r}from"./transform-strip-types-CusS3slj.mjs";import{S as i,f as a,g as o,i as s,n as c,o as l,r as u,s as d,t as f,x as p,y as m}from"./libraries-CCQwMxcx.mjs";import{i as h,n as g,r as _,t as v}from"./transform-icons-BU4ryD5X.mjs";import{a as y,i as b,n as x,r as S,t as C}from"./constants-Cd6CLVj2.mjs";import{c as w,f as ee,i as te,
|
|
3
|
-
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(
|
|
4
|
-
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!
|
|
2
|
+
import{i as e,n as t,r as n,t as r}from"./transform-strip-types-CusS3slj.mjs";import{S as i,f as a,g as o,i as s,n as c,o as l,r as u,s as d,t as f,x as p,y as m}from"./libraries-CCQwMxcx.mjs";import{i as h,n as g,r as _,t as v}from"./transform-icons-BU4ryD5X.mjs";import{a as y,i as b,n as x,r as S,t as C}from"./constants-Cd6CLVj2.mjs";import{c as w,f as ee,i as te,l as ne,n as re,p as ie,t as ae,u as oe,v as se}from"./preset-OLkSDPn4.mjs";import{a as ce,d as le,f as ue,g as de,h as fe,l as pe,m as me,p as he,u as ge}from"./schema-q9HuPqcG.mjs";import{t as _e}from"./src-Bryu0SVv.mjs";import"./magic-string.es-I1ELJdqB.mjs";import{t as ve}from"./transform-imports-DCifnAhQ.mjs";import{t as ye}from"./transform-menu-BVkdVu8j.mjs";import{t as be}from"./transformers-rC9mXwMn.mjs";import xe,{createRequire as Se}from"node:module";import T,{stdin as Ce,stdout as we}from"node:process";import{Command as Te,Option as Ee}from"commander";import E,{dirname as De,isAbsolute as Oe,join as ke,resolve as Ae}from"node:path";import D,{existsSync as O,lstatSync as je,promises as k,readdirSync as Me}from"node:fs";import Ne from"fs";import{fileURLToPath as Pe,pathToFileURL as Fe}from"node:url";import{spawn as Ie}from"child_process";import{delimiter as Le,dirname as Re,normalize as ze,resolve as Be}from"path";import{cwd as Ve}from"process";import{PassThrough as He}from"stream";import Ue from"readline";import We,{constants as Ge}from"node:fs/promises";import{promisify as Ke,stripVTControlCharacters as qe,styleText as A}from"node:util";import*as Je from"node:readline";import Ye from"node:readline";import{ReadStream as Xe}from"node:tty";import{fetch as Ze}from"node-fetch-native";import{createProxy as Qe}from"node-fetch-native/proxy";import j,{parse as $e}from"postcss";import{twMerge as et}from"tailwind-merge";import*as tt from"svelte/compiler";import nt,{execFile as rt}from"node:child_process";import it from"node:os";import{Buffer as at}from"node:buffer";var M=e(t(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}))(),1);const ot=e=>typeof e==`object`&&!!e,st=(e,t)=>Object.assign(Error(`[${e}]: ${t}`),{code:e}),ct=`ERR_INVALID_PACKAGE_CONFIG`,lt=`ERR_INVALID_PACKAGE_TARGET`,ut=/^\d+$/,dt=/^(\.{1,2}|node_modules)$/i,ft=/\/|\\/;var pt=(e=>(e.Export=`exports`,e.Import=`imports`,e))(pt||{});const mt=(e,t,n,r,i)=>{if(t==null)return[];if(typeof t==`string`){let[n,...r]=t.split(ft);if(n===`..`||r.some(e=>dt.test(e)))throw st(lt,`Invalid "${e}" target "${t}" defined in the package config`);return[i?t.replace(/\*/g,i):t]}if(Array.isArray(t))return t.flatMap(t=>mt(e,t,n,r,i));if(ot(t)){for(let a of Object.keys(t)){if(ut.test(a))throw st(ct,`Cannot contain numeric property keys`);if(a===`default`||r.includes(a))return mt(e,t[a],n,r,i)}return[]}throw st(lt,`Invalid "${e}" target "${t}"`)},ht=(e,t)=>{let n=e.indexOf(`*`),r=t.indexOf(`*`);return n===r?t.length>e.length:r>n};function gt(e,t){if(!t.includes(`*`)&&e.hasOwnProperty(t))return[t];let n,r;for(let i of Object.keys(e))if(i.includes(`*`)){let[e,a,o]=i.split(`*`);if(o===void 0&&t.startsWith(e)&&t.endsWith(a)){let o=t.slice(e.length,-a.length||void 0);o&&(!n||ht(n,i))&&(n=i,r=o)}}return[n,r]}const _t=e=>Object.keys(e).reduce((e,t)=>{let n=t===``||t[0]!==`.`;if(e===void 0||e===n)return n;throw st(ct,`"exports" cannot contain some keys starting with "." and some not`)},void 0),vt=/^\w+:/,yt=(e,t,n)=>{if(!e)throw Error(`"exports" is required`);t=t===``?`.`:`./${t}`,(typeof e==`string`||Array.isArray(e)||ot(e)&&_t(e))&&(e={".":e});let[r,i]=gt(e,t),a=mt(pt.Export,e[r],t,n,i);if(a.length===0)throw st(`ERR_PACKAGE_PATH_NOT_EXPORTED`,t===`.`?`No "exports" main defined`:`Package subpath '${t}' is not defined by "exports"`);for(let e of a)if(!e.startsWith(`./`)&&!vt.test(e))throw st(lt,`Invalid "exports" target "${e}" defined in the package config`);return a};var bt=Object.defineProperty,N=(e,t)=>bt(e,`name`,{value:t,configurable:!0});function xt(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}N(xt,`slash`);const St=N(e=>{let t=D[e];return(n,...r)=>{let i=`${e}:${r.join(`:`)}`,a=n?.get(i);return a===void 0&&(a=Reflect.apply(t,D,r),n?.set(i,a)),a}},`cacheFs`),Ct=St(`existsSync`),wt=St(`readFileSync`),Tt=St(`statSync`),Et=N((e,t,n)=>{for(;;){let r=E.posix.join(e,t);if(Ct(n,r))return r;let i=E.dirname(e);if(i===e)return;e=i}},`findUp`),Dt=/^\.{1,2}(\/.*)?$/,Ot=N(e=>{let t=xt(e);return Dt.test(t)?t:`./${t}`},`normalizeRelativePath`);function kt(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}N(f,`scanHexDigits`);function p(e){r=e,i=``,a=0,o=16,d=0}N(p,`setPosition`);function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&Mt(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&Mt(e.charCodeAt(r)))for(r++;r<e.length&&Mt(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&Mt(e.charCodeAt(r))){for(r++;r<e.length&&Mt(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}N(m,`scanNumber`);function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
|
3
|
+
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(jt(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}N(h,`scanString`);function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(At(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(At(t));return o=15}if(jt(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
4
|
+
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!jt(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,jt(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!Mt(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}N(g,`scanNext`);function _(e){if(At(e)||jt(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}N(_,`isUnknownContentCharacter`);function v(){let e;do e=g();while(e>=12&&e<=15);return e}return N(v,`scanNextNonTrivia`),{setPosition:p,getPosition:N(()=>r,`getPosition`),scan:t?v:g,getToken:N(()=>o,`getToken`),getTokenValue:N(()=>i,`getTokenValue`),getTokenOffset:N(()=>a,`getTokenOffset`),getTokenLength:N(()=>r-a,`getTokenLength`),getTokenStartLine:N(()=>c,`getTokenStartLine`),getTokenStartCharacter:N(()=>a-u,`getTokenStartCharacter`),getTokenError:N(()=>d,`getTokenError`)}}N(kt,`createScanner`);function At(e){return e===32||e===9}N(At,`isWhiteSpace`);function jt(e){return e===10||e===13}N(jt,`isLineBreak`);function Mt(e){return e>=48&&e<=57}N(Mt,`isDigit`);var Nt;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(Nt||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t)),Array(200).fill(0).map((e,t)=>`
|
|
5
5
|
`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r
|
|
6
6
|
`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`
|
|
7
7
|
`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(200).fill(0).map((e,t)=>`\r
|
|
8
|
-
`+` `.repeat(t));var Mt;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Mt||={});function Nt(e,t=[],n=Mt.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return N(o,`onValue`),Pt(e,{onObjectBegin:N(()=>{let e={};o(e),a.push(i),i=e,r=null},`onObjectBegin`),onObjectProperty:N(e=>{r=e},`onObjectProperty`),onObjectEnd:N(()=>{i=a.pop()},`onObjectEnd`),onArrayBegin:N(()=>{let e=[];o(e),a.push(i),i=e,r=null},`onArrayBegin`),onArrayEnd:N(()=>{i=a.pop()},`onArrayEnd`),onLiteralValue:o,onError:N((e,n,r)=>{t.push({error:e,offset:n,length:r})},`onError`)},n),i[0]}N(Nt,`parse$1`);function Pt(e,t,n=Mt.DEFAULT){let r=Dt(e,!1),i=[];function a(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}N(a,`toNoArgVisit`);function o(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}N(o,`toNoArgVisitWithPath`);function s(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}N(s,`toOneArgVisit`);function c(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}N(c,`toOneArgVisitWithPath`);let l=o(t.onObjectBegin),u=c(t.onObjectProperty),d=a(t.onObjectEnd),f=o(t.onArrayBegin),p=a(t.onArrayEnd),m=c(t.onLiteralValue),h=s(t.onSeparator),g=a(t.onComment),_=s(t.onError),v=n&&n.disallowComments,y=n&&n.allowTrailingComma;function b(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:v||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(e){case 12:case 13:v?x(10):g();break;case 16:x(1);break;case 15:case 14:break;default:return e}}}N(b,`scanNext`);function x(e,t=[],n=[]){if(_(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){b();break}else if(n.indexOf(e)!==-1)break;e=b()}}}N(x,`handleError`);function S(e){let t=r.getTokenValue();return e?m(t):(u(t),i.push(t)),b(),!0}N(S,`parseString`);function C(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(x(2),t=0),m(t);break;case 7:m(null);break;case 8:m(!0);break;case 9:m(!1);break;default:return!1}return b(),!0}N(C,`parseLiteral`);function w(){return r.getToken()===10?(S(!1),r.getToken()===6?(h(`:`),b(),ne()||x(4,[],[2,5])):x(5,[],[2,5]),i.pop(),!0):(x(3,[],[2,5]),!1)}N(w,`parseProperty`);function ee(){l(),b();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||x(4,[],[]),h(`,`),b(),r.getToken()===2&&y)break}else e&&x(6,[],[]);w()||x(4,[],[2,5]),e=!0}return d(),r.getToken()===2?b():x(7,[2],[]),!0}N(ee,`parseObject`);function te(){f(),b();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||x(4,[],[]),h(`,`),b(),r.getToken()===4&&y)break}else t&&x(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,ne()||x(4,[],[4,5]),t=!0}return p(),e||i.pop(),r.getToken()===4?b():x(8,[4],[]),!0}N(te,`parseArray`);function ne(){switch(r.getToken()){case 3:return te();case 1:return ee();case 10:return S(!0);default:return C()}}return N(ne,`parseValue`),b(),r.getToken()===17?n.allowEmptyContent?!0:(x(4,[],[]),!1):ne()?(r.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}N(Pt,`visit`);var Ft;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(Ft||={});var It;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(It||={});const Lt=Nt;var Rt;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(Rt||={});const zt=N((e,t)=>Lt(St(t,e,`utf8`)),`readJsonc`),Bt=Symbol(`implicitBaseUrl`),Vt="${configDir}",Ht=N(()=>{let{findPnpApi:e}=ye;return e&&e(process.cwd())},`getPnpApi`),Ut=N((e,t,n,r)=>{let i=`resolveFromPackageJsonPath:${e}:${t}:${n}`;if(r!=null&&r.has(i))return r.get(i);let a=zt(e,r);if(!a)return;let o=t||`tsconfig.json`;if(!n&&a.exports)try{let[e]=_t(a.exports,t,[`require`,`types`]);o=e}catch{return!1}else !t&&a.tsconfig&&(o=a.tsconfig);return o=E.join(e,`..`,o),r?.set(i,o),o},`resolveFromPackageJsonPath`),Wt=`package.json`,Gt=`tsconfig.json`,Kt=N((e,t,n)=>{let r=e;if(e===`..`&&(r=E.join(r,Gt)),e[0]===`.`&&(r=E.resolve(t,r)),E.isAbsolute(r)){if(xt(n,r)){if(Ct(n,r).isFile())return r}else if(!r.endsWith(`.json`)){let e=`${r}.json`;if(xt(n,e))return e}return}let[i,...a]=e.split(`/`),o=i[0]===`@`?`${i}/${a.shift()}`:i,s=a.join(`/`),c=Ht();if(c){let{resolveRequest:r}=c;try{if(o===e){let e=r(E.join(o,Wt),t);if(e){let t=Ut(e,s,!1,n);if(t&&xt(n,t))return t}}else{let n;try{n=r(e,t,{extensions:[`.json`]})}catch{n=r(E.join(e,Gt),t)}if(n)return n}}catch{}}let l=wt(E.resolve(t),E.join(`node_modules`,o),n);if(!l||!Ct(n,l).isDirectory())return;let u=E.join(l,Wt);if(xt(n,u)){let e=Ut(u,s,!1,n);if(e===!1)return;if(e&&xt(n,e)&&Ct(n,e).isFile())return e}let d=E.join(l,s),f=d.endsWith(`.json`);if(!f){let e=`${d}.json`;if(xt(n,e))return e}if(xt(n,d)){if(Ct(n,d).isDirectory()){let e=E.join(d,Wt);if(xt(n,e)){let t=Ut(e,``,!0,n);if(t&&xt(n,t))return t}let t=E.join(d,Gt);if(xt(n,t))return t}else if(f)return d}},`resolveExtendsPath`),qt=N((e,t)=>Et(E.relative(e,t)),`pathRelative`),Jt=[`files`,`include`,`exclude`],Yt=N((e,t,n,r)=>{let i=Kt(e,t,r);if(!i)throw Error(`File '${e}' not found.`);if(n.has(i))throw Error(`Circularity detected while resolving configuration: ${i}`);n.add(i);let a=E.dirname(i),o=Zt(i,r,n);delete o.references;let{compilerOptions:s}=o;if(s){let{baseUrl:e}=s;e&&!e.startsWith(Vt)&&(s.baseUrl=yt(E.relative(t,E.join(a,e)))||`./`);let{outDir:n}=s;n&&(n.startsWith(Vt)||(n=E.relative(t,E.join(a,n))),s.outDir=yt(n)||`./`)}for(let e of Jt){let n=o[e];n&&(o[e]=n.map(e=>e.startsWith(Vt)?e:yt(E.relative(t,E.join(a,e)))))}return o},`resolveExtends`),Xt=[`outDir`,`declarationDir`],Zt=N((e,t,n=new Set)=>{let r;try{r=zt(e,t)||{}}catch{throw Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof r!=`object`)throw SyntaxError(`Failed to parse tsconfig at: ${e}`);let i=E.dirname(e);if(r.compilerOptions){let{compilerOptions:e}=r;e.paths&&!e.baseUrl&&(e[Bt]=i)}if(r.extends){let e=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;for(let a of e.reverse()){let e=Yt(a,i,new Set(n),t),o={...e,...r,compilerOptions:{...e.compilerOptions,...r.compilerOptions}};e.watchOptions&&(o.watchOptions={...e.watchOptions,...r.watchOptions}),r=o}}if(r.compilerOptions){let{compilerOptions:e}=r;for(let t of[`baseUrl`,`rootDir`]){let n=e[t];n&&!n.startsWith(Vt)&&(e[t]=qt(i,E.resolve(i,n)))}for(let t of Xt){let n=e[t];n&&(Array.isArray(r.exclude)||(r.exclude=[]),r.exclude.includes(n)||r.exclude.push(n),n.startsWith(Vt)||(n=Et(n)),e[t]=n)}}else r.compilerOptions={};if(r.include?(r.include=r.include.map(yt),r.files&&delete r.files):r.files&&=r.files.map(e=>e.startsWith(Vt)?e:Et(e)),r.watchOptions){let{watchOptions:e}=r;e.excludeDirectories&&=e.excludeDirectories.map(e=>yt(E.resolve(i,e)))}return r},`_parseTsconfig`),Qt=N((e,t)=>{if(e.startsWith(Vt))return yt(E.join(t,e.slice(12)))},`interpolateConfigDir`),$t=[`outDir`,`declarationDir`,`outFile`,`rootDir`,`baseUrl`,`tsBuildInfoFile`],en=N(e=>{if(e.strict)for(let t of[`noImplicitAny`,`noImplicitThis`,`strictNullChecks`,`strictFunctionTypes`,`strictBindCallApply`,`strictPropertyInitialization`,`strictBuiltinIteratorReturn`,`alwaysStrict`,`useUnknownInCatchVariables`])e[t]===void 0&&(e[t]=!0);if(e.target){let t=e.target.toLowerCase();t===`es2015`&&(t=`es6`),e.target=t,t===`esnext`&&(e.module??=`es6`,e.useDefineForClassFields??=!0),(t===`es6`||t===`es2016`||t===`es2017`||t===`es2018`||t===`es2019`||t===`es2020`||t===`es2021`||t===`es2022`||t===`es2023`||t===`es2024`)&&(e.module??=`es6`),(t===`es2022`||t===`es2023`||t===`es2024`)&&(e.useDefineForClassFields??=!0)}if(e.module){let t=e.module.toLowerCase();t===`es2015`&&(t=`es6`),e.module=t,(t===`es6`||t===`es2020`||t===`es2022`||t===`esnext`||t===`none`||t===`system`||t===`umd`||t===`amd`)&&(e.moduleResolution??=`classic`),t===`system`&&(e.allowSyntheticDefaultImports??=!0),(t===`node16`||t===`nodenext`||t===`preserve`)&&(e.esModuleInterop??=!0,e.allowSyntheticDefaultImports??=!0),(t===`node16`||t===`nodenext`)&&(e.moduleDetection??=`force`,e.useDefineForClassFields??=!0),t===`node16`&&(e.target??=`es2022`,e.moduleResolution??=`node16`),t===`nodenext`&&(e.target??=`esnext`,e.moduleResolution??=`nodenext`),t===`preserve`&&(e.moduleResolution??=`bundler`)}if(e.moduleResolution){let t=e.moduleResolution.toLowerCase();t===`node`&&(t=`node10`),e.moduleResolution=t,(t===`node16`||t===`nodenext`||t===`bundler`)&&(e.resolvePackageJsonExports??=!0,e.resolvePackageJsonImports??=!0),t===`bundler`&&(e.allowSyntheticDefaultImports??=!0,e.resolveJsonModule??=!0)}e.esModuleInterop&&(e.allowSyntheticDefaultImports??=!0),e.verbatimModuleSyntax&&(e.isolatedModules??=!0,e.preserveConstEnums??=!0),e.isolatedModules&&(e.preserveConstEnums??=!0)},`normalizeCompilerOptions`),tn=N((e,t=new Map)=>{let n=E.resolve(e),r=Zt(n,t),i=E.dirname(n),{compilerOptions:a}=r;if(a){for(let e of $t){let t=a[e];if(t){let n=Qt(t,i);a[e]=n?qt(i,n):t}}for(let e of[`rootDirs`,`typeRoots`]){let t=a[e];t&&(a[e]=t.map(e=>{let t=Qt(e,i);return t?qt(i,t):e}))}let{paths:e}=a;if(e)for(let t of Object.keys(e))e[t]=e[t].map(e=>Qt(e,i)??e);en(a)}for(let e of Jt){let t=r[e];t&&(r[e]=t.map(e=>Qt(e,i)??e))}return r},`parseTsconfig`),nn=N((e=process.cwd(),t=`tsconfig.json`,n=new Map)=>{let r=wt(yt(e),t,n);return r?{path:r,config:tn(r,n)}:null},`getTsconfig`),rn=/\*/g,an=N((e,t)=>{let n=e.match(rn);if(n&&n.length>1)throw Error(t)},`assertStarCount`),on=N(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{prefix:t,suffix:n}}return e},`parsePattern`),sn=N(({prefix:e,suffix:t},n)=>n.startsWith(e)&&n.endsWith(t),`isPatternMatch`),cn=N((e,t,n)=>Object.entries(e).map(([e,r])=>(an(e,`Pattern '${e}' can have at most one '*' character.`),{pattern:on(e),substitutions:r.map(r=>{if(an(r,`Substitution '${r}' in pattern '${e}' can have at most one '*' character.`),!t&&!Tt.test(r))throw Error(`Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?`);return E.resolve(n,r)})})),`parsePaths`),ln=N(e=>{let{compilerOptions:t}=e.config;if(!t)return null;let{baseUrl:n,paths:r}=t;if(!n&&!r)return null;let i=Bt in t&&t[Bt],a=E.resolve(E.dirname(e.path),n||i||`.`),o=r?cn(r,n,a):[];return e=>{if(Tt.test(e))return[];let t=[];for(let n of o){if(n.pattern===e)return n.substitutions.map(yt);typeof n.pattern!=`string`&&t.push(n)}let r,i=-1;for(let n of t)sn(n.pattern,e)&&n.pattern.prefix.length>i&&(i=n.pattern.prefix.length,r=n);if(!r)return n?[yt(E.join(a,e))]:[];let s=e.slice(r.pattern.prefix.length,e.length-r.pattern.suffix.length);return r.substitutions.map(e=>yt(e.replace(`*`,s)))}},`createPathsMatcher`),un=N(e=>{let t=``;for(let n=0;n<e.length;n+=1){let r=e[n],i=r.toUpperCase();t+=r===i?r.toLowerCase():i}return t},`s`),dn=N(()=>Math.floor(Math.random()*26),`m`),fn=N(e=>Array.from({length:e},()=>String.fromCodePoint(dn()+(Math.random()>.5?65:97))).join(``),`S`),pn=N((e=je)=>{let t=process.execPath;if(e.existsSync(t))return!e.existsSync(un(t));let n=`/${fn(10)}`;e.writeFileSync(n,``);let r=!e.existsSync(un(n));return e.unlinkSync(n),r},`l`),{join:mn}=E.posix,hn={ts:[`.ts`,`.tsx`,`.d.ts`],cts:[`.cts`,`.d.cts`],mts:[`.mts`,`.d.mts`]},gn=N(e=>{let t=[...hn.ts],n=[...hn.cts],r=[...hn.mts];return e!=null&&e.allowJs&&(t.push(`.js`,`.jsx`),n.push(`.cjs`),r.push(`.mjs`)),[...t,...n,...r]},`getSupportedExtensions`),_n=N(e=>{let t=[];if(!e)return t;let{outDir:n,declarationDir:r}=e;return n&&t.push(n),r&&t.push(r),t},`getDefaultExcludeSpec`),vn=N(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),`escapeForRegexp`),yn=`(?!(${[`node_modules`,`bower_components`,`jspm_packages`].join(`|`)})(/|$))`,bn=/(?:^|\/)[^.*?]+$/,xn=`**/*`,Sn=`[^/]`,Cn=`[^./]`,wn=process.platform===`win32`;N(({config:e,path:t},n=pn())=>{if(`extends`in e)throw Error(`tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.`);if(!E.isAbsolute(t))throw Error(`The tsconfig path must be absolute`);wn&&(t=yt(t));let r=E.dirname(t),{files:i,include:a,exclude:o,compilerOptions:s}=e,c=i?.map(e=>mn(r,e)),l=gn(s),u=n?``:`i`,d=(o||_n(s)).map(e=>{let t=vn(mn(r,e)).replaceAll(String.raw`\*\*/`,`(.+/)?`).replaceAll(String.raw`\*`,`${Sn}*`).replaceAll(String.raw`\?`,Sn);return RegExp(`^${t}($|/)`,u)}),f=i||a?a:[xn],p=f?f.map(e=>{let t=mn(r,e);bn.test(t)&&(t=mn(t,xn));let n=vn(t).replaceAll(String.raw`/\*\*`,`(/${yn}${Cn}${Sn}*)*?`).replaceAll(/(\/)?\\\*/g,(e,t)=>{let n=`(${Cn}|(\\.(?!min\\.js$))?)*`;return t?`/${yn}${Cn}${n}`:n}).replaceAll(/(\/)?\\\?/g,(e,t)=>{let n=Sn;return t?`/${yn}${n}`:n});return RegExp(`^${n}$`,u)}):void 0;return t=>{if(!E.isAbsolute(t))throw Error(`filePath must be absolute`);if(wn&&(t=yt(t)),c!=null&&c.includes(t)||!(!l.some(e=>t.endsWith(e))||d.some(e=>e.test(t)))&&p&&p.some(e=>e.test(t)))return e}},`createFilesMatcher`);const P=e=>M.default.bold(M.default.cyan(e));function Tn(e){let t=(e.startsWith(`#`)?e.slice(1):e).match(/^([a-f\d]{6}|[a-f\d]{3})$/i)?.[1];if(!t)return[0,0,0];let n=t.length===3?[...t].map(e=>e+e).join(``):t,r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]}function En(e){let[t,n,r]=Tn(e),i=`\x1b[38;2;${t};${n};${r}m`;return e=>M.default.isColorSupported?`${i}${e}[39m`:e}function Dn(e){let[t,n,r]=Tn(e),i=`\x1b[48;2;${t};${n};${r}m`;return e=>M.default.isColorSupported?`${i}${e}[49m`:e}function On(e,t,n){throw Error(n?`No known conditions for "${t}" specifier in "${e}" package`:`Missing "${t}" specifier in "${e}" package`)}function kn(e,t,n,r){let i,a,o=An(e,n),s=function(e){let t=new Set([`default`,...e.conditions||[]]);return e.unsafe||t.add(e.require?`require`:`import`),e.unsafe||t.add(e.browser?`browser`:`node`),t}(r||{}),c=t[o];if(c===void 0){let e,n,r,i;for(i in t)n&&i.length<n.length||(i[i.length-1]===`/`&&o.startsWith(i)?(a=o.substring(i.length),n=i):i.length>1&&(r=i.indexOf(`*`,1),~r&&(e=RegExp(`^`+i.substring(0,r)+`(.*)`+i.substring(1+r)+`$`).exec(o),e&&e[1]&&(a=e[1],n=i))));c=t[n]}return c||On(e,o),i=jn(c,s),i||On(e,o,1),a&&function(e,t){let n,r=0,i=e.length,a=/[*]/g,o=/[/]$/;for(;r<i;r++)e[r]=a.test(n=e[r])?n.replace(a,t):o.test(n)?n+t:n}(i,a),i}function An(e,t,n){if(e===t||t===`.`)return`.`;let r=e+`/`,i=r.length,a=t.slice(0,i)===r,o=a?t.slice(i):t;return o[0]===`#`?o:a||!n?o.slice(0,2)===`./`?o:`./`+o:o}function jn(e,t,n){if(e){if(typeof e==`string`)return n&&n.add(e),[e];let r,i;if(Array.isArray(e)){for(i=n||new Set,r=0;r<e.length;r++)jn(e[r],t,i);if(!n&&i.size)return[...i]}else for(r in e)if(t.has(r))return jn(e[r],t,n)}}function Mn(e,t,n){let r,i=e.exports;if(i){if(typeof i==`string`)i={".":i};else for(r in i){r[0]!==`.`&&(i={".":i});break}return kn(e.name,i,t||`.`,n)}}function Nn(e,t,n){if(e.imports)return kn(e.name,e.imports,t,n)}function Pn(e,t,n){return(t=An(e.name,t||`.`))[0]===`#`?Nn(e,t,n):Mn(e,t,n)}function Fn(){return Ln(In(`../package.json`))}function In(e){let t=Me(new URL(`.`,import.meta.url));return E.resolve(t,e)}function Ln(e){let t=D.readFileSync(e,{encoding:`utf8`});return JSON.parse(t)}function Rn(e,t){let n=be(E.resolve(e,`noop.js`)).resolve.paths(t);if(!n)return;let r;for(let e of n){let n=E.join(e,t,`package.json`);if(D.existsSync(n)){r=n;break}}if(!r)return;let i=D.readFileSync(r,`utf8`);return{pkg:JSON.parse(i),path:r}}const zn=be(import.meta.url);var Bn=Object.create,Vn=Object.defineProperty,Hn=Object.getOwnPropertyDescriptor,Un=Object.getOwnPropertyNames,Wn=Object.getPrototypeOf,Gn=Object.prototype.hasOwnProperty,Kn=(e=>typeof zn<`u`?zn:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof zn<`u`?zn:e)[t]}):e)(function(e){if(typeof zn<`u`)return zn.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),qn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jn=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Un(t))!Gn.call(e,i)&&i!==n&&Vn(e,i,{get:()=>t[i],enumerable:!(r=Hn(t,i))||r.enumerable});return e},Yn=(e,t,n)=>(n=e==null?{}:Bn(Wn(e)),Jn(t||!e||!e.__esModule?Vn(n,`default`,{value:e,enumerable:!0}):n,e)),Xn=qn((e,t)=>{t.exports=a,a.sync=o;var n=Kn(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),Zn=qn((e,t)=>{t.exports=r,r.sync=i;var n=Kn(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}}),Qn=qn((e,t)=>{Kn(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?Xn():Zn();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),$n=qn((e,t)=>{var n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=Kn(`path`),i=n?`;`:`:`,a=Qn(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}}),er=qn((e,t)=>{var n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),tr=qn((e,t)=>{var n=Kn(`path`),r=$n(),i=er();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),nr=qn((e,t)=>{var n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),rr=qn((e,t)=>{t.exports=/^#!(.*)/}),ir=qn((e,t)=>{var n=rr();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),ar=qn((e,t)=>{var n=Kn(`fs`),r=ir();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i}),or=qn((e,t)=>{var n=Kn(`path`),r=tr(),i=nr(),a=ar(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),sr=qn((e,t)=>{var n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t,`spawn`);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),cr=qn((e,t)=>{var n=Kn(`child_process`),r=or(),i=sr();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i}),lr=/^path$/i,ur={key:`PATH`,value:``};function dr(e){for(let t in e){if(!Object.prototype.hasOwnProperty.call(e,t)||!lr.test(t))continue;let n=e[t];return n?{key:t,value:n}:ur}return ur}function fr(e,t){let n=t.value.split(Fe),r=e,i;do n.push(Re(r,`node_modules`,`.bin`)),i=r,r=Ie(r);while(r!==i);return{key:t.key,value:n.join(Fe)}}function pr(e,t){let n={...process.env,...t},r=fr(e,dr(n));return n[r.key]=r.value,n}var mr=e=>{let t=e.length,n=new Be,r=()=>{--t===0&&n.emit(`end`)};for(let t of e)t.pipe(n,{end:!1}),t.on(`end`,r);return n},hr=Yn(cr(),1),gr=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}},_r={timeout:void 0,persist:!1},vr={windowsHide:!0};function yr(e,t){return{command:Le(e),args:t??[]}}function br(e){let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(),n;n.addEventListener(`abort`,()=>{t.abort(n.reason)},{signal:t.signal})}return t.signal}var xr=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={..._r,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(e=>{this._resolveClose=e})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return Sr(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=mr(t),r=Ve.createInterface({input:n});for await(let e of r)yield e.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new gr(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error(`No process was started`);let t=``,n=``;if(this._streamOut)for await(let e of this._streamOut)n+=e.toString();if(this._streamErr)for await(let e of this._streamErr)t+=e.toString();if(await this._processClosed,this._options?.stdin&&await this._options.stdin,e.removeAllListeners(),this._thrownError)throw this._thrownError;let r={stderr:t,stdout:n,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new gr(this,r);return r}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=ze(),t=this._options,n={...vr,...t.nodeOptions},r=[];this._resetState(),t.timeout!==void 0&&r.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&r.push(t.signal),t.persist===!0&&(n.detached=!0),r.length>0&&(n.signal=br(r)),n.env=pr(e,n.env);let{command:i,args:a}=yr(this._command,this._args),o=(0,hr._parse)(i,a,n),s=Pe(o.command,o.args,o.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once(`error`,this._onError),s.once(`close`,this._onClose),t.stdin!==void 0&&s.stdin&&t.stdin.process){let{stdout:e}=t.stdin.process;e&&e.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name===`AbortError`&&(!(e.cause instanceof Error)||e.cause.name!==`TimeoutError`)){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}},Sr=(e,t,n)=>{let r=new xr(e,t,n);return r.spawn(),r};function Cr(e,t){return n=>n.length>1?[e,t,n[0],`--`,...n.slice(1)]:[e,t,n[0]]}function wr(){return e=>[`deno`,`run`,`npm:${e[0]}`,...e.slice(1)]}const Tr={agent:[`npm`,0],run:Cr(`npm`,`run`),install:[`npm`,`i`,0],frozen:[`npm`,`ci`,0],global:[`npm`,`i`,`-g`,0],add:[`npm`,`i`,0],upgrade:[`npm`,`update`,0],"upgrade-interactive":null,execute:[`npx`,0],"execute-local":[`npx`,0],uninstall:[`npm`,`uninstall`,0],global_uninstall:[`npm`,`uninstall`,`-g`,0]},Er={agent:[`yarn`,0],run:[`yarn`,`run`,0],install:[`yarn`,`install`,0],frozen:[`yarn`,`install`,`--frozen-lockfile`,0],global:[`yarn`,`global`,`add`,0],add:[`yarn`,`add`,0],upgrade:[`yarn`,`upgrade`,0],"upgrade-interactive":[`yarn`,`upgrade-interactive`,0],execute:[`npx`,0],"execute-local":Cr(`yarn`,`exec`),uninstall:[`yarn`,`remove`,0],global_uninstall:[`yarn`,`global`,`remove`,0]},Dr={...Er,frozen:[`yarn`,`install`,`--immutable`,0],upgrade:[`yarn`,`up`,0],"upgrade-interactive":[`yarn`,`up`,`-i`,0],execute:[`yarn`,`dlx`,0],"execute-local":[`yarn`,`exec`,0],global:[`npm`,`i`,`-g`,0],global_uninstall:[`npm`,`uninstall`,`-g`,0]},Or={agent:[`pnpm`,0],run:[`pnpm`,`run`,0],install:[`pnpm`,`i`,0],frozen:[`pnpm`,`i`,`--frozen-lockfile`,0],global:[`pnpm`,`add`,`-g`,0],add:[`pnpm`,`add`,0],upgrade:[`pnpm`,`update`,0],"upgrade-interactive":[`pnpm`,`update`,`-i`,0],execute:[`pnpm`,`dlx`,0],"execute-local":[`pnpm`,`exec`,0],uninstall:[`pnpm`,`remove`,0],global_uninstall:[`pnpm`,`remove`,`--global`,0]},kr={agent:[`bun`,0],run:[`bun`,`run`,0],install:[`bun`,`install`,0],frozen:[`bun`,`install`,`--frozen-lockfile`,0],global:[`bun`,`add`,`-g`,0],add:[`bun`,`add`,0],upgrade:[`bun`,`update`,0],"upgrade-interactive":[`bun`,`update`,0],execute:[`bun`,`x`,0],"execute-local":[`bun`,`x`,0],uninstall:[`bun`,`remove`,0],global_uninstall:[`bun`,`remove`,`-g`,0]},Ar={agent:[`deno`,0],run:[`deno`,`task`,0],install:[`deno`,`install`,0],frozen:[`deno`,`install`,`--frozen`,0],global:[`deno`,`install`,`-g`,0],add:[`deno`,`add`,0],upgrade:[`deno`,`outdated`,`--update`,0],"upgrade-interactive":[`deno`,`outdated`,`--update`,0],execute:wr(),"execute-local":[`deno`,`task`,`--eval`,0],uninstall:[`deno`,`remove`,0],global_uninstall:[`deno`,`uninstall`,`-g`,0]},jr={npm:Tr,yarn:Er,"yarn@berry":Dr,pnpm:Or,"pnpm@6":{...Or,run:Cr(`pnpm`,`run`)},bun:kr,deno:Ar};function Mr(e,t,n){let r=jr[e][t];return Nr(r,n)}function Nr(e,t){if(e==null)return null;let n=typeof e==`function`?e(t):e.flatMap(e=>typeof e==`number`?t:[e]);return{command:n[0],args:n.slice(1)}}const Pr=[`npm`,`yarn`,`yarn@berry`,`pnpm`,`pnpm@6`,`bun`,`deno`],Fr={"bun.lock":`bun`,"bun.lockb":`bun`,"deno.lock":`deno`,"pnpm-lock.yaml":`pnpm`,"pnpm-workspace.yaml":`pnpm`,"yarn.lock":`yarn`,"package-lock.json":`npm`,"npm-shrinkwrap.json":`npm`},Ir={"node_modules/.deno/":`deno`,"node_modules/.pnpm/":`pnpm`,"node_modules/.yarn-state.yml":`yarn`,"node_modules/.yarn_integrity":`yarn`,"node_modules/.package-lock.json":`npm`,".pnp.cjs":`yarn`,".pnp.js":`yarn`,"bun.lock":`bun`,"bun.lockb":`bun`};async function Lr(e,t){try{let n=await He.stat(e);return t===`file`?n.isFile():n.isDirectory()}catch{return!1}}function Rr(){let e=T.env.npm_config_user_agent;if(!e)return null;let t=e.split(`/`)[0];return Pr.includes(t)?t:null}function*zr(e=T.cwd()){let t=E.resolve(e),{root:n}=E.parse(t);for(;t&&t!==n;)yield t,t=E.dirname(t)}async function Br(e,t){return!e||!Lr(e,`file`)?null:await Ur(e,t)}async function Vr(e={}){let{cwd:t,strategies:n=[`lockfile`,`packageManager-field`,`devEngines-field`],onUnknown:r}=e,i;if(typeof e.stopDir==`string`){let t=E.resolve(e.stopDir);i=e=>e===t}else i=e.stopDir;for(let e of zr(t)){for(let t of n)switch(t){case`lockfile`:for(let t of Object.keys(Fr))if(await Lr(E.join(e,t),`file`)){let n=Fr[t];return await Br(E.join(e,`package.json`),r)||{name:n,agent:n}}break;case`packageManager-field`:case`devEngines-field`:{let t=await Br(E.join(e,`package.json`),r);if(t)return t;break}case`install-metadata`:for(let t of Object.keys(Ir)){let n=t.endsWith(`/`)?`dir`:`file`;if(await Lr(E.join(e,t),n)){let e=Ir[t];return{name:e,agent:e===`yarn`?Wr(t)?`yarn`:`yarn@berry`:e}}}break}if(i?.(e))break}return null}function Hr(e){let t=e=>e?.match(/\d+(\.\d+){0,2}/)?.[0]??e;if(typeof e.packageManager==`string`){let[n,r]=e.packageManager.replace(/^\^/,``).split(`@`);return{name:n,ver:t(r)}}if(typeof e.devEngines?.packageManager?.name==`string`)return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}async function Ur(e,t){try{let n=JSON.parse(await He.readFile(e,`utf8`)),r,i=Hr(n);if(i){let e=i.name,a=i.ver,o=a;return e===`yarn`&&a&&Number.parseInt(a)>1?(r=`yarn@berry`,o=`berry`,{name:e,agent:r,version:o}):e===`pnpm`&&a&&Number.parseInt(a)<7?(r=`pnpm@6`,{name:e,agent:r,version:o}):Pr.includes(e)?(r=e,{name:e,agent:r,version:o}):t?.(n.packageManager)??null}}catch{}return null}function Wr(e){return e.endsWith(`.yarn_integrity`)}async function Gr({registryIndex:e,config:t}){let n={ui:t.resolvedPaths.ui,components:t.resolvedPaths.components,hooks:t.resolvedPaths.hooks},r=[];for(let t of Object.values(n)){if(!O(t))continue;let n=await k.readdir(t,{withFileTypes:!0});for(let t of n)if(t.isDirectory()){let n=e.find(e=>e.name===t.name);n&&r.push(n)}}let i=e.find(e=>e.name===`utils`);return i&&r.push(i),r}async function Kr(e){if(qr(e)){if(O(E.join(e,`.svelte-kit`)))return;let t=(await Vr({cwd:e}))?.agent??`npm`,n=Mr(t,`execute-local`,[`svelte-kit`,`sync`]);try{await Sr(n.command,n.args,{throwOnError:!0,nodeOptions:{cwd:e}})}catch(e){let r=`${n.command} ${n.args.join(` `)}`,i=Mr(t,`install`,[]);throw new g(`Failed to run '${r}'. Ensure that your dependencies have been installed first with '${`${i.command} ${i.args.join(` `)}`}' and try again.`,{cause:e})}}}function qr(e){let t=Jr(e);return{...t.devDependencies,...t.dependencies}[`@sveltejs/kit`]!==void 0}function Jr(e){return Ln(E.resolve(e,`package.json`))}function Yr(e){let t=ln(e.tsconfig)?.(e.importPath)?.[0];if(t)return t;let n=Jr(e.cwd);if(e.importPath.startsWith(`#`)){let t=Xr(n,E.resolve(e.cwd,`package.json`),e.importPath);if(t)return t}let r=Object.keys({...n.dependencies,...n.devDependencies});for(let t of r){if(!e.importPath.startsWith(t))continue;let n=Rn(e.cwd,t);if(!n)continue;let r=Xr(n.pkg,n.path,e.importPath);if(r)return r}}function Xr(e,t,n){try{let r=Pn(e,n+`/noop.js`)?.[0];if(r){let e=Ne(t),n=new URL(r.slice(0,-8),e).href;return Me(n)}}catch{return}}var F=t(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}}))();function Zr(e,t,n){if(!n.some(e=>!e.disabled))return e;let r=e+t,i=Math.max(n.length-1,0),a=r<0?i:r>i?0:r;return n[a].disabled?Zr(a,t<0?-1:1,n):a}const Qr=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,$r=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ei=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,ti=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ni=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ri=/\t{1,1000}/y,ii=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,ai=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,oi=/\p{M}+/gu,si={limit:1/0,ellipsis:``},ci=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?ci(i,si,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;t:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(oi,``)){let t=e.codePointAt(0)||0;if(w=$r(t)?d:ei(t)?p:l!==f&&Qr(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break t}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(ai.lastIndex=h,ai.test(e)){if(_=ai.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ai.lastIndex;continue}if(ti.lastIndex=h,ti.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=ti.lastIndex;continue}if(ni.lastIndex=h,ni.test(e)){if(_=ni.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ni.lastIndex;continue}if(ri.lastIndex=h,ri.test(e)){if(_=ri.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ri.lastIndex;continue}if(ii.lastIndex=h,ii.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=ii.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},li={limit:1/0,ellipsis:``,ellipsisWidth:0},ui=(e,t={})=>ci(e,li,t).width,di=`]8;;`,fi=RegExp(`(?:\\[(?<code>\\d+)m|\\${di}(?<uri>.*))`,`y`),pi=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},mi=e=>`[${e}m`,hi=e=>`${di}${e}`,gi=e=>e.map(e=>ui(e)),_i=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:ui(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=ui(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(di,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},vi=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(ui(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},yi=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=gi(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=ui(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),_i(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){_i(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){_i(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>vi(e)));let l=c.join(`
|
|
9
|
-
`),u=l[Symbol.iterator](),d=u.next(),f=u.next(),p=0;for(;!d.done;){let e=d.value,t=f.value;if(r+=e,e===`\x1B`||e===``){
|
|
10
|
-
`?(a&&(r+=
|
|
11
|
-
`&&(i&&n&&(r+=
|
|
8
|
+
`+` `.repeat(t));var Pt;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Pt||={});function Ft(e,t=[],n=Pt.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return N(o,`onValue`),It(e,{onObjectBegin:N(()=>{let e={};o(e),a.push(i),i=e,r=null},`onObjectBegin`),onObjectProperty:N(e=>{r=e},`onObjectProperty`),onObjectEnd:N(()=>{i=a.pop()},`onObjectEnd`),onArrayBegin:N(()=>{let e=[];o(e),a.push(i),i=e,r=null},`onArrayBegin`),onArrayEnd:N(()=>{i=a.pop()},`onArrayEnd`),onLiteralValue:o,onError:N((e,n,r)=>{t.push({error:e,offset:n,length:r})},`onError`)},n),i[0]}N(Ft,`parse$1`);function It(e,t,n=Pt.DEFAULT){let r=kt(e,!1),i=[];function a(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}N(a,`toNoArgVisit`);function o(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}N(o,`toNoArgVisitWithPath`);function s(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}N(s,`toOneArgVisit`);function c(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}N(c,`toOneArgVisitWithPath`);let l=o(t.onObjectBegin),u=c(t.onObjectProperty),d=a(t.onObjectEnd),f=o(t.onArrayBegin),p=a(t.onArrayEnd),m=c(t.onLiteralValue),h=s(t.onSeparator),g=a(t.onComment),_=s(t.onError),v=n&&n.disallowComments,y=n&&n.allowTrailingComma;function b(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:v||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(e){case 12:case 13:v?x(10):g();break;case 16:x(1);break;case 15:case 14:break;default:return e}}}N(b,`scanNext`);function x(e,t=[],n=[]){if(_(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){b();break}else if(n.indexOf(e)!==-1)break;e=b()}}}N(x,`handleError`);function S(e){let t=r.getTokenValue();return e?m(t):(u(t),i.push(t)),b(),!0}N(S,`parseString`);function C(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(x(2),t=0),m(t);break;case 7:m(null);break;case 8:m(!0);break;case 9:m(!1);break;default:return!1}return b(),!0}N(C,`parseLiteral`);function w(){return r.getToken()===10?(S(!1),r.getToken()===6?(h(`:`),b(),ne()||x(4,[],[2,5])):x(5,[],[2,5]),i.pop(),!0):(x(3,[],[2,5]),!1)}N(w,`parseProperty`);function ee(){l(),b();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||x(4,[],[]),h(`,`),b(),r.getToken()===2&&y)break}else e&&x(6,[],[]);w()||x(4,[],[2,5]),e=!0}return d(),r.getToken()===2?b():x(7,[2],[]),!0}N(ee,`parseObject`);function te(){f(),b();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||x(4,[],[]),h(`,`),b(),r.getToken()===4&&y)break}else t&&x(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,ne()||x(4,[],[4,5]),t=!0}return p(),e||i.pop(),r.getToken()===4?b():x(8,[4],[]),!0}N(te,`parseArray`);function ne(){switch(r.getToken()){case 3:return te();case 1:return ee();case 10:return S(!0);default:return C()}}return N(ne,`parseValue`),b(),r.getToken()===17?n.allowEmptyContent?!0:(x(4,[],[]),!1):ne()?(r.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}N(It,`visit`);var Lt;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(Lt||={});var Rt;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(Rt||={});const zt=Ft;var Bt;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(Bt||={});const Vt=N((e,t)=>zt(wt(t,e,`utf8`)),`readJsonc`),Ht=Symbol(`implicitBaseUrl`),Ut="${configDir}",Wt=N(()=>{let{findPnpApi:e}=xe;return e&&e(process.cwd())},`getPnpApi`),Gt=N((e,t,n,r)=>{let i=`resolveFromPackageJsonPath:${e}:${t}:${n}`;if(r!=null&&r.has(i))return r.get(i);let a=Vt(e,r);if(!a)return;let o=t||`tsconfig.json`;if(!n&&a.exports)try{let[e]=yt(a.exports,t,[`require`,`types`]);o=e}catch{return!1}else !t&&a.tsconfig&&(o=a.tsconfig);return o=E.join(e,`..`,o),r?.set(i,o),o},`resolveFromPackageJsonPath`),Kt=`package.json`,qt=`tsconfig.json`,Jt=N((e,t,n)=>{let r=e;if(e===`..`&&(r=E.join(r,qt)),e[0]===`.`&&(r=E.resolve(t,r)),E.isAbsolute(r)){if(Ct(n,r)){if(Tt(n,r).isFile())return r}else if(!r.endsWith(`.json`)){let e=`${r}.json`;if(Ct(n,e))return e}return}let[i,...a]=e.split(`/`),o=i[0]===`@`?`${i}/${a.shift()}`:i,s=a.join(`/`),c=Wt();if(c){let{resolveRequest:r}=c;try{if(o===e){let e=r(E.join(o,Kt),t);if(e){let t=Gt(e,s,!1,n);if(t&&Ct(n,t))return t}}else{let n;try{n=r(e,t,{extensions:[`.json`]})}catch{n=r(E.join(e,qt),t)}if(n)return n}}catch{}}let l=Et(E.resolve(t),E.join(`node_modules`,o),n);if(!l||!Tt(n,l).isDirectory())return;let u=E.join(l,Kt);if(Ct(n,u)){let e=Gt(u,s,!1,n);if(e===!1)return;if(e&&Ct(n,e)&&Tt(n,e).isFile())return e}let d=E.join(l,s),f=d.endsWith(`.json`);if(!f){let e=`${d}.json`;if(Ct(n,e))return e}if(Ct(n,d)){if(Tt(n,d).isDirectory()){let e=E.join(d,Kt);if(Ct(n,e)){let t=Gt(e,``,!0,n);if(t&&Ct(n,t))return t}let t=E.join(d,qt);if(Ct(n,t))return t}else if(f)return d}},`resolveExtendsPath`),Yt=N((e,t)=>Ot(E.relative(e,t)),`pathRelative`),Xt=[`files`,`include`,`exclude`],Zt=N((e,t,n,r)=>{let i=Jt(e,t,r);if(!i)throw Error(`File '${e}' not found.`);if(n.has(i))throw Error(`Circularity detected while resolving configuration: ${i}`);n.add(i);let a=E.dirname(i),o=$t(i,r,n);delete o.references;let{compilerOptions:s}=o;if(s){let{baseUrl:e}=s;e&&!e.startsWith(Ut)&&(s.baseUrl=xt(E.relative(t,E.join(a,e)))||`./`);let{outDir:n}=s;n&&(n.startsWith(Ut)||(n=E.relative(t,E.join(a,n))),s.outDir=xt(n)||`./`)}for(let e of Xt){let n=o[e];n&&(o[e]=n.map(e=>e.startsWith(Ut)?e:xt(E.relative(t,E.join(a,e)))))}return o},`resolveExtends`),Qt=[`outDir`,`declarationDir`],$t=N((e,t,n=new Set)=>{let r;try{r=Vt(e,t)||{}}catch{throw Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof r!=`object`)throw SyntaxError(`Failed to parse tsconfig at: ${e}`);let i=E.dirname(e);if(r.compilerOptions){let{compilerOptions:e}=r;e.paths&&!e.baseUrl&&(e[Ht]=i)}if(r.extends){let e=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;for(let a of e.reverse()){let e=Zt(a,i,new Set(n),t),o={...e,...r,compilerOptions:{...e.compilerOptions,...r.compilerOptions}};e.watchOptions&&(o.watchOptions={...e.watchOptions,...r.watchOptions}),r=o}}if(r.compilerOptions){let{compilerOptions:e}=r;for(let t of[`baseUrl`,`rootDir`]){let n=e[t];n&&!n.startsWith(Ut)&&(e[t]=Yt(i,E.resolve(i,n)))}for(let t of Qt){let n=e[t];n&&(Array.isArray(r.exclude)||(r.exclude=[]),r.exclude.includes(n)||r.exclude.push(n),n.startsWith(Ut)||(n=Ot(n)),e[t]=n)}}else r.compilerOptions={};if(r.include?(r.include=r.include.map(xt),r.files&&delete r.files):r.files&&=r.files.map(e=>e.startsWith(Ut)?e:Ot(e)),r.watchOptions){let{watchOptions:e}=r;e.excludeDirectories&&=e.excludeDirectories.map(e=>xt(E.resolve(i,e)))}return r},`_parseTsconfig`),en=N((e,t)=>{if(e.startsWith(Ut))return xt(E.join(t,e.slice(12)))},`interpolateConfigDir`),tn=[`outDir`,`declarationDir`,`outFile`,`rootDir`,`baseUrl`,`tsBuildInfoFile`],nn=N(e=>{if(e.strict)for(let t of[`noImplicitAny`,`noImplicitThis`,`strictNullChecks`,`strictFunctionTypes`,`strictBindCallApply`,`strictPropertyInitialization`,`strictBuiltinIteratorReturn`,`alwaysStrict`,`useUnknownInCatchVariables`])e[t]===void 0&&(e[t]=!0);if(e.target){let t=e.target.toLowerCase();t===`es2015`&&(t=`es6`),e.target=t,t===`esnext`&&(e.module??=`es6`,e.useDefineForClassFields??=!0),(t===`es6`||t===`es2016`||t===`es2017`||t===`es2018`||t===`es2019`||t===`es2020`||t===`es2021`||t===`es2022`||t===`es2023`||t===`es2024`)&&(e.module??=`es6`),(t===`es2022`||t===`es2023`||t===`es2024`)&&(e.useDefineForClassFields??=!0)}if(e.module){let t=e.module.toLowerCase();t===`es2015`&&(t=`es6`),e.module=t,(t===`es6`||t===`es2020`||t===`es2022`||t===`esnext`||t===`none`||t===`system`||t===`umd`||t===`amd`)&&(e.moduleResolution??=`classic`),t===`system`&&(e.allowSyntheticDefaultImports??=!0),(t===`node16`||t===`nodenext`||t===`preserve`)&&(e.esModuleInterop??=!0,e.allowSyntheticDefaultImports??=!0),(t===`node16`||t===`nodenext`)&&(e.moduleDetection??=`force`,e.useDefineForClassFields??=!0),t===`node16`&&(e.target??=`es2022`,e.moduleResolution??=`node16`),t===`nodenext`&&(e.target??=`esnext`,e.moduleResolution??=`nodenext`),t===`preserve`&&(e.moduleResolution??=`bundler`)}if(e.moduleResolution){let t=e.moduleResolution.toLowerCase();t===`node`&&(t=`node10`),e.moduleResolution=t,(t===`node16`||t===`nodenext`||t===`bundler`)&&(e.resolvePackageJsonExports??=!0,e.resolvePackageJsonImports??=!0),t===`bundler`&&(e.allowSyntheticDefaultImports??=!0,e.resolveJsonModule??=!0)}e.esModuleInterop&&(e.allowSyntheticDefaultImports??=!0),e.verbatimModuleSyntax&&(e.isolatedModules??=!0,e.preserveConstEnums??=!0),e.isolatedModules&&(e.preserveConstEnums??=!0)},`normalizeCompilerOptions`),rn=N((e,t=new Map)=>{let n=E.resolve(e),r=$t(n,t),i=E.dirname(n),{compilerOptions:a}=r;if(a){for(let e of tn){let t=a[e];if(t){let n=en(t,i);a[e]=n?Yt(i,n):t}}for(let e of[`rootDirs`,`typeRoots`]){let t=a[e];t&&(a[e]=t.map(e=>{let t=en(e,i);return t?Yt(i,t):e}))}let{paths:e}=a;if(e)for(let t of Object.keys(e))e[t]=e[t].map(e=>en(e,i)??e);nn(a)}for(let e of Xt){let t=r[e];t&&(r[e]=t.map(e=>en(e,i)??e))}return r},`parseTsconfig`),an=N((e=process.cwd(),t=`tsconfig.json`,n=new Map)=>{let r=Et(xt(e),t,n);return r?{path:r,config:rn(r,n)}:null},`getTsconfig`),on=/\*/g,sn=N((e,t)=>{let n=e.match(on);if(n&&n.length>1)throw Error(t)},`assertStarCount`),cn=N(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{prefix:t,suffix:n}}return e},`parsePattern`),ln=N(({prefix:e,suffix:t},n)=>n.startsWith(e)&&n.endsWith(t),`isPatternMatch`),un=N((e,t,n)=>Object.entries(e).map(([e,r])=>(sn(e,`Pattern '${e}' can have at most one '*' character.`),{pattern:cn(e),substitutions:r.map(r=>{if(sn(r,`Substitution '${r}' in pattern '${e}' can have at most one '*' character.`),!t&&!Dt.test(r))throw Error(`Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?`);return E.resolve(n,r)})})),`parsePaths`),dn=N(e=>{let{compilerOptions:t}=e.config;if(!t)return null;let{baseUrl:n,paths:r}=t;if(!n&&!r)return null;let i=Ht in t&&t[Ht],a=E.resolve(E.dirname(e.path),n||i||`.`),o=r?un(r,n,a):[];return e=>{if(Dt.test(e))return[];let t=[];for(let n of o){if(n.pattern===e)return n.substitutions.map(xt);typeof n.pattern!=`string`&&t.push(n)}let r,i=-1;for(let n of t)ln(n.pattern,e)&&n.pattern.prefix.length>i&&(i=n.pattern.prefix.length,r=n);if(!r)return n?[xt(E.join(a,e))]:[];let s=e.slice(r.pattern.prefix.length,e.length-r.pattern.suffix.length);return r.substitutions.map(e=>xt(e.replace(`*`,s)))}},`createPathsMatcher`),fn=N(e=>{let t=``;for(let n=0;n<e.length;n+=1){let r=e[n],i=r.toUpperCase();t+=r===i?r.toLowerCase():i}return t},`s`),pn=N(()=>Math.floor(Math.random()*26),`m`),mn=N(e=>Array.from({length:e},()=>String.fromCodePoint(pn()+(Math.random()>.5?65:97))).join(``),`S`),hn=N((e=Ne)=>{let t=process.execPath;if(e.existsSync(t))return!e.existsSync(fn(t));let n=`/${mn(10)}`;e.writeFileSync(n,``);let r=!e.existsSync(fn(n));return e.unlinkSync(n),r},`l`),{join:gn}=E.posix,_n={ts:[`.ts`,`.tsx`,`.d.ts`],cts:[`.cts`,`.d.cts`],mts:[`.mts`,`.d.mts`]},vn=N(e=>{let t=[..._n.ts],n=[..._n.cts],r=[..._n.mts];return e!=null&&e.allowJs&&(t.push(`.js`,`.jsx`),n.push(`.cjs`),r.push(`.mjs`)),[...t,...n,...r]},`getSupportedExtensions`),yn=N(e=>{let t=[];if(!e)return t;let{outDir:n,declarationDir:r}=e;return n&&t.push(n),r&&t.push(r),t},`getDefaultExcludeSpec`),bn=N(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),`escapeForRegexp`),xn=`(?!(${[`node_modules`,`bower_components`,`jspm_packages`].join(`|`)})(/|$))`,Sn=/(?:^|\/)[^.*?]+$/,Cn=`**/*`,wn=`[^/]`,Tn=`[^./]`,En=process.platform===`win32`;N(({config:e,path:t},n=hn())=>{if(`extends`in e)throw Error(`tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.`);if(!E.isAbsolute(t))throw Error(`The tsconfig path must be absolute`);En&&(t=xt(t));let r=E.dirname(t),{files:i,include:a,exclude:o,compilerOptions:s}=e,c=i?.map(e=>gn(r,e)),l=vn(s),u=n?``:`i`,d=(o||yn(s)).map(e=>{let t=bn(gn(r,e)).replaceAll(String.raw`\*\*/`,`(.+/)?`).replaceAll(String.raw`\*`,`${wn}*`).replaceAll(String.raw`\?`,wn);return RegExp(`^${t}($|/)`,u)}),f=i||a?a:[Cn],p=f?f.map(e=>{let t=gn(r,e);Sn.test(t)&&(t=gn(t,Cn));let n=bn(t).replaceAll(String.raw`/\*\*`,`(/${xn}${Tn}${wn}*)*?`).replaceAll(/(\/)?\\\*/g,(e,t)=>{let n=`(${Tn}|(\\.(?!min\\.js$))?)*`;return t?`/${xn}${Tn}${n}`:n}).replaceAll(/(\/)?\\\?/g,(e,t)=>{let n=wn;return t?`/${xn}${n}`:n});return RegExp(`^${n}$`,u)}):void 0;return t=>{if(!E.isAbsolute(t))throw Error(`filePath must be absolute`);if(En&&(t=xt(t)),c!=null&&c.includes(t)||!(!l.some(e=>t.endsWith(e))||d.some(e=>e.test(t)))&&p&&p.some(e=>e.test(t)))return e}},`createFilesMatcher`);const P=e=>M.default.bold(M.default.cyan(e));function Dn(e){let t=(e.startsWith(`#`)?e.slice(1):e).match(/^([a-f\d]{6}|[a-f\d]{3})$/i)?.[1];if(!t)return[0,0,0];let n=t.length===3?[...t].map(e=>e+e).join(``):t,r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]}function On(e){let[t,n,r]=Dn(e),i=`\x1b[38;2;${t};${n};${r}m`;return e=>M.default.isColorSupported?`${i}${e}[39m`:e}function kn(e){let[t,n,r]=Dn(e),i=`\x1b[48;2;${t};${n};${r}m`;return e=>M.default.isColorSupported?`${i}${e}[49m`:e}function An(e,t,n){throw Error(n?`No known conditions for "${t}" specifier in "${e}" package`:`Missing "${t}" specifier in "${e}" package`)}function jn(e,t,n,r){let i,a,o=Mn(e,n),s=function(e){let t=new Set([`default`,...e.conditions||[]]);return e.unsafe||t.add(e.require?`require`:`import`),e.unsafe||t.add(e.browser?`browser`:`node`),t}(r||{}),c=t[o];if(c===void 0){let e,n,r,i;for(i in t)n&&i.length<n.length||(i[i.length-1]===`/`&&o.startsWith(i)?(a=o.substring(i.length),n=i):i.length>1&&(r=i.indexOf(`*`,1),~r&&(e=RegExp(`^`+i.substring(0,r)+`(.*)`+i.substring(1+r)+`$`).exec(o),e&&e[1]&&(a=e[1],n=i))));c=t[n]}return c||An(e,o),i=Nn(c,s),i||An(e,o,1),a&&function(e,t){let n,r=0,i=e.length,a=/[*]/g,o=/[/]$/;for(;r<i;r++)e[r]=a.test(n=e[r])?n.replace(a,t):o.test(n)?n+t:n}(i,a),i}function Mn(e,t,n){if(e===t||t===`.`)return`.`;let r=e+`/`,i=r.length,a=t.slice(0,i)===r,o=a?t.slice(i):t;return o[0]===`#`?o:a||!n?o.slice(0,2)===`./`?o:`./`+o:o}function Nn(e,t,n){if(e){if(typeof e==`string`)return n&&n.add(e),[e];let r,i;if(Array.isArray(e)){for(i=n||new Set,r=0;r<e.length;r++)Nn(e[r],t,i);if(!n&&i.size)return[...i]}else for(r in e)if(t.has(r))return Nn(e[r],t,n)}}function Pn(e,t,n){let r,i=e.exports;if(i){if(typeof i==`string`)i={".":i};else for(r in i){r[0]!==`.`&&(i={".":i});break}return jn(e.name,i,t||`.`,n)}}function Fn(e,t,n){if(e.imports)return jn(e.name,e.imports,t,n)}function In(e,t,n){return(t=Mn(e.name,t||`.`))[0]===`#`?Fn(e,t,n):Pn(e,t,n)}function Ln(){return zn(Rn(`../package.json`))}function Rn(e){let t=Pe(new URL(`.`,import.meta.url));return E.resolve(t,e)}function zn(e){let t=D.readFileSync(e,{encoding:`utf8`});return JSON.parse(t)}function Bn(e,t){let n=Se(E.resolve(e,`noop.js`)).resolve.paths(t);if(!n)return;let r;for(let e of n){let n=E.join(e,t,`package.json`);if(D.existsSync(n)){r=n;break}}if(!r)return;let i=D.readFileSync(r,`utf8`);return{pkg:JSON.parse(i),path:r}}const Vn=Se(import.meta.url);var Hn=Object.create,Un=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,Gn=Object.getOwnPropertyNames,Kn=Object.getPrototypeOf,qn=Object.prototype.hasOwnProperty,Jn=(e=>typeof Vn<`u`?Vn:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof Vn<`u`?Vn:e)[t]}):e)(function(e){if(typeof Vn<`u`)return Vn.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),Yn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Xn=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Gn(t))!qn.call(e,i)&&i!==n&&Un(e,i,{get:()=>t[i],enumerable:!(r=Wn(t,i))||r.enumerable});return e},Zn=(e,t,n)=>(n=e==null?{}:Hn(Kn(e)),Xn(t||!e||!e.__esModule?Un(n,`default`,{value:e,enumerable:!0}):n,e)),Qn=Yn((e,t)=>{t.exports=a,a.sync=o;var n=Jn(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),$n=Yn((e,t)=>{t.exports=r,r.sync=i;var n=Jn(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}}),er=Yn((e,t)=>{Jn(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?Qn():$n();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),tr=Yn((e,t)=>{var n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=Jn(`path`),i=n?`;`:`:`,a=er(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}}),nr=Yn((e,t)=>{var n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),rr=Yn((e,t)=>{var n=Jn(`path`),r=tr(),i=nr();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),ir=Yn((e,t)=>{var n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),ar=Yn((e,t)=>{t.exports=/^#!(.*)/}),or=Yn((e,t)=>{var n=ar();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),sr=Yn((e,t)=>{var n=Jn(`fs`),r=or();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i}),cr=Yn((e,t)=>{var n=Jn(`path`),r=rr(),i=ir(),a=sr(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),lr=Yn((e,t)=>{var n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t,`spawn`);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),ur=Yn((e,t)=>{var n=Jn(`child_process`),r=cr(),i=lr();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i}),dr=/^path$/i,fr={key:`PATH`,value:``};function pr(e){for(let t in e){if(!Object.prototype.hasOwnProperty.call(e,t)||!dr.test(t))continue;let n=e[t];return n?{key:t,value:n}:fr}return fr}function mr(e,t){let n=t.value.split(Le),r=e,i;do n.push(Be(r,`node_modules`,`.bin`)),i=r,r=Re(r);while(r!==i);return{key:t.key,value:n.join(Le)}}function hr(e,t){let n={...process.env,...t},r=mr(e,pr(n));return n[r.key]=r.value,n}var gr=e=>{let t=e.length,n=new He,r=()=>{--t===0&&n.emit(`end`)};for(let t of e)t.pipe(n,{end:!1}),t.on(`end`,r);return n},_r=Zn(ur(),1),vr=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}},yr={timeout:void 0,persist:!1},br={windowsHide:!0};function xr(e,t){return{command:ze(e),args:t??[]}}function Sr(e){let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(),n;n.addEventListener(`abort`,()=>{t.abort(n.reason)},{signal:t.signal})}return t.signal}var Cr=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={...yr,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(e=>{this._resolveClose=e})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return wr(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=gr(t),r=Ue.createInterface({input:n});for await(let e of r)yield e.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new vr(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error(`No process was started`);let t=``,n=``;if(this._streamOut)for await(let e of this._streamOut)n+=e.toString();if(this._streamErr)for await(let e of this._streamErr)t+=e.toString();if(await this._processClosed,this._options?.stdin&&await this._options.stdin,e.removeAllListeners(),this._thrownError)throw this._thrownError;let r={stderr:t,stdout:n,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new vr(this,r);return r}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=Ve(),t=this._options,n={...br,...t.nodeOptions},r=[];this._resetState(),t.timeout!==void 0&&r.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&r.push(t.signal),t.persist===!0&&(n.detached=!0),r.length>0&&(n.signal=Sr(r)),n.env=hr(e,n.env);let{command:i,args:a}=xr(this._command,this._args),o=(0,_r._parse)(i,a,n),s=Ie(o.command,o.args,o.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once(`error`,this._onError),s.once(`close`,this._onClose),t.stdin!==void 0&&s.stdin&&t.stdin.process){let{stdout:e}=t.stdin.process;e&&e.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name===`AbortError`&&(!(e.cause instanceof Error)||e.cause.name!==`TimeoutError`)){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}},wr=(e,t,n)=>{let r=new Cr(e,t,n);return r.spawn(),r};function Tr(e,t){return n=>n.length>1?[e,t,n[0],`--`,...n.slice(1)]:[e,t,n[0]]}function Er(){return e=>[`deno`,`run`,`npm:${e[0]}`,...e.slice(1)]}const Dr={agent:[`npm`,0],run:Tr(`npm`,`run`),install:[`npm`,`i`,0],frozen:[`npm`,`ci`,0],global:[`npm`,`i`,`-g`,0],add:[`npm`,`i`,0],upgrade:[`npm`,`update`,0],"upgrade-interactive":null,execute:[`npx`,0],"execute-local":[`npx`,0],uninstall:[`npm`,`uninstall`,0],global_uninstall:[`npm`,`uninstall`,`-g`,0]},Or={agent:[`yarn`,0],run:[`yarn`,`run`,0],install:[`yarn`,`install`,0],frozen:[`yarn`,`install`,`--frozen-lockfile`,0],global:[`yarn`,`global`,`add`,0],add:[`yarn`,`add`,0],upgrade:[`yarn`,`upgrade`,0],"upgrade-interactive":[`yarn`,`upgrade-interactive`,0],execute:[`npx`,0],"execute-local":Tr(`yarn`,`exec`),uninstall:[`yarn`,`remove`,0],global_uninstall:[`yarn`,`global`,`remove`,0]},kr={...Or,frozen:[`yarn`,`install`,`--immutable`,0],upgrade:[`yarn`,`up`,0],"upgrade-interactive":[`yarn`,`up`,`-i`,0],execute:[`yarn`,`dlx`,0],"execute-local":[`yarn`,`exec`,0],global:[`npm`,`i`,`-g`,0],global_uninstall:[`npm`,`uninstall`,`-g`,0]},Ar={agent:[`pnpm`,0],run:[`pnpm`,`run`,0],install:[`pnpm`,`i`,0],frozen:[`pnpm`,`i`,`--frozen-lockfile`,0],global:[`pnpm`,`add`,`-g`,0],add:[`pnpm`,`add`,0],upgrade:[`pnpm`,`update`,0],"upgrade-interactive":[`pnpm`,`update`,`-i`,0],execute:[`pnpm`,`dlx`,0],"execute-local":[`pnpm`,`exec`,0],uninstall:[`pnpm`,`remove`,0],global_uninstall:[`pnpm`,`remove`,`--global`,0]},jr={agent:[`bun`,0],run:[`bun`,`run`,0],install:[`bun`,`install`,0],frozen:[`bun`,`install`,`--frozen-lockfile`,0],global:[`bun`,`add`,`-g`,0],add:[`bun`,`add`,0],upgrade:[`bun`,`update`,0],"upgrade-interactive":[`bun`,`update`,0],execute:[`bun`,`x`,0],"execute-local":[`bun`,`x`,0],uninstall:[`bun`,`remove`,0],global_uninstall:[`bun`,`remove`,`-g`,0]},Mr={agent:[`deno`,0],run:[`deno`,`task`,0],install:[`deno`,`install`,0],frozen:[`deno`,`install`,`--frozen`,0],global:[`deno`,`install`,`-g`,0],add:[`deno`,`add`,0],upgrade:[`deno`,`outdated`,`--update`,0],"upgrade-interactive":[`deno`,`outdated`,`--update`,0],execute:Er(),"execute-local":[`deno`,`task`,`--eval`,0],uninstall:[`deno`,`remove`,0],global_uninstall:[`deno`,`uninstall`,`-g`,0]},Nr={npm:Dr,yarn:Or,"yarn@berry":kr,pnpm:Ar,"pnpm@6":{...Ar,run:Tr(`pnpm`,`run`)},bun:jr,deno:Mr};function Pr(e,t,n){let r=Nr[e][t];return Fr(r,n)}function Fr(e,t){if(e==null)return null;let n=typeof e==`function`?e(t):e.flatMap(e=>typeof e==`number`?t:[e]);return{command:n[0],args:n.slice(1)}}const Ir=[`npm`,`yarn`,`yarn@berry`,`pnpm`,`pnpm@6`,`bun`,`deno`],Lr={"bun.lock":`bun`,"bun.lockb":`bun`,"deno.lock":`deno`,"pnpm-lock.yaml":`pnpm`,"pnpm-workspace.yaml":`pnpm`,"yarn.lock":`yarn`,"package-lock.json":`npm`,"npm-shrinkwrap.json":`npm`},Rr={"node_modules/.deno/":`deno`,"node_modules/.pnpm/":`pnpm`,"node_modules/.yarn-state.yml":`yarn`,"node_modules/.yarn_integrity":`yarn`,"node_modules/.package-lock.json":`npm`,".pnp.cjs":`yarn`,".pnp.js":`yarn`,"bun.lock":`bun`,"bun.lockb":`bun`};async function zr(e,t){try{let n=await We.stat(e);return t===`file`?n.isFile():n.isDirectory()}catch{return!1}}function Br(){let e=T.env.npm_config_user_agent;if(!e)return null;let t=e.split(`/`)[0];return Ir.includes(t)?t:null}function*Vr(e=T.cwd()){let t=E.resolve(e),{root:n}=E.parse(t);for(;t&&t!==n;)yield t,t=E.dirname(t)}async function Hr(e,t){return!e||!zr(e,`file`)?null:await Gr(e,t)}async function Ur(e={}){let{cwd:t,strategies:n=[`lockfile`,`packageManager-field`,`devEngines-field`],onUnknown:r}=e,i;if(typeof e.stopDir==`string`){let t=E.resolve(e.stopDir);i=e=>e===t}else i=e.stopDir;for(let e of Vr(t)){for(let t of n)switch(t){case`lockfile`:for(let t of Object.keys(Lr))if(await zr(E.join(e,t),`file`)){let n=Lr[t];return await Hr(E.join(e,`package.json`),r)||{name:n,agent:n}}break;case`packageManager-field`:case`devEngines-field`:{let t=await Hr(E.join(e,`package.json`),r);if(t)return t;break}case`install-metadata`:for(let t of Object.keys(Rr)){let n=t.endsWith(`/`)?`dir`:`file`;if(await zr(E.join(e,t),n)){let e=Rr[t];return{name:e,agent:e===`yarn`?Kr(t)?`yarn`:`yarn@berry`:e}}}break}if(i?.(e))break}return null}function Wr(e){let t=e=>e?.match(/\d+(\.\d+){0,2}/)?.[0]??e;if(typeof e.packageManager==`string`){let[n,r]=e.packageManager.replace(/^\^/,``).split(`@`);return{name:n,ver:t(r)}}if(typeof e.devEngines?.packageManager?.name==`string`)return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}async function Gr(e,t){try{let n=JSON.parse(await We.readFile(e,`utf8`)),r,i=Wr(n);if(i){let e=i.name,a=i.ver,o=a;return e===`yarn`&&a&&Number.parseInt(a)>1?(r=`yarn@berry`,o=`berry`,{name:e,agent:r,version:o}):e===`pnpm`&&a&&Number.parseInt(a)<7?(r=`pnpm@6`,{name:e,agent:r,version:o}):Ir.includes(e)?(r=e,{name:e,agent:r,version:o}):t?.(n.packageManager)??null}}catch{}return null}function Kr(e){return e.endsWith(`.yarn_integrity`)}async function qr({registryIndex:e,config:t}){let n={ui:t.resolvedPaths.ui,components:t.resolvedPaths.components,hooks:t.resolvedPaths.hooks},r=[];for(let t of Object.values(n)){if(!O(t))continue;let n=await k.readdir(t,{withFileTypes:!0});for(let t of n)if(t.isDirectory()){let n=e.find(e=>e.name===t.name);n&&r.push(n)}}let i=e.find(e=>e.name===`utils`);return i&&r.push(i),r}async function Jr(e){if(Yr(e)){if(O(E.join(e,`.svelte-kit`)))return;let t=(await Ur({cwd:e}))?.agent??`npm`,n=Pr(t,`execute-local`,[`svelte-kit`,`sync`]);try{await wr(n.command,n.args,{throwOnError:!0,nodeOptions:{cwd:e}})}catch(e){let r=`${n.command} ${n.args.join(` `)}`,i=Pr(t,`install`,[]);throw new g(`Failed to run '${r}'. Ensure that your dependencies have been installed first with '${`${i.command} ${i.args.join(` `)}`}' and try again.`,{cause:e})}}}function Yr(e){let t=Xr(e);return{...t.devDependencies,...t.dependencies}[`@sveltejs/kit`]!==void 0}function Xr(e){return zn(E.resolve(e,`package.json`))}function Zr(e){let t=dn(e.tsconfig)?.(e.importPath)?.[0];if(t)return t;let n=Xr(e.cwd);if(e.importPath.startsWith(`#`)){let t=Qr(n,E.resolve(e.cwd,`package.json`),e.importPath);if(t)return t}let r=Object.keys({...n.dependencies,...n.devDependencies});for(let t of r){if(!e.importPath.startsWith(t))continue;let n=Bn(e.cwd,t);if(!n)continue;let r=Qr(n.pkg,n.path,e.importPath);if(r)return r}}function Qr(e,t,n){try{let r=In(e,n+`/noop.js`)?.[0];if(r){let e=Fe(t),n=new URL(r.slice(0,-8),e).href;return Pe(n)}}catch{return}}var F=t(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}}))();function $r(e,t,n){if(!n.some(e=>!e.disabled))return e;let r=e+t,i=Math.max(n.length-1,0),a=r<0?i:r>i?0:r;return n[a].disabled?$r(a,t<0?-1:1,n):a}const ei=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,ti=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ni=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,ri=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ii=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ai=/\t{1,1000}/y,oi=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,si=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,ci=/\p{M}+/gu,li={limit:1/0,ellipsis:``},ui=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?ui(i,li,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;t:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(ci,``)){let t=e.codePointAt(0)||0;if(w=ti(t)?d:ni(t)?p:l!==f&&ei(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break t}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(si.lastIndex=h,si.test(e)){if(_=si.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=si.lastIndex;continue}if(ri.lastIndex=h,ri.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=ri.lastIndex;continue}if(ii.lastIndex=h,ii.test(e)){if(_=ii.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ii.lastIndex;continue}if(ai.lastIndex=h,ai.test(e)){if(_=ai.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ai.lastIndex;continue}if(oi.lastIndex=h,oi.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=oi.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},di={limit:1/0,ellipsis:``,ellipsisWidth:0},fi=(e,t={})=>ui(e,di,t).width,pi=`]8;;`,mi=RegExp(`(?:\\[(?<code>\\d+)m|\\${pi}(?<uri>.*))`,`y`),hi=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},gi=e=>`[${e}m`,_i=e=>`${pi}${e}`,vi=e=>e.map(e=>fi(e)),yi=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:fi(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=fi(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(pi,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},bi=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(fi(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},xi=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=vi(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=fi(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),yi(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){yi(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){yi(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>bi(e)));let l=c.join(`
|
|
9
|
+
`),u=l[Symbol.iterator](),d=u.next(),f=u.next(),p=0;for(;!d.done;){let e=d.value,t=f.value;if(r+=e,e===`\x1B`||e===``){mi.lastIndex=p+1;let e=mi.exec(l)?.groups;if(e?.code!==void 0){let t=Number.parseFloat(e.code);i=t===39?void 0:t}else e?.uri!==void 0&&(a=e.uri.length===0?void 0:e.uri)}let n=i?hi(i):void 0;t===`
|
|
10
|
+
`?(a&&(r+=_i(``)),i&&n&&(r+=gi(n))):e===`
|
|
11
|
+
`&&(i&&n&&(r+=gi(i)),a&&(r+=_i(a))),p+=e.length,d=f,f=u.next()}return r};function Si(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
12
12
|
`,`
|
|
13
13
|
`).split(`
|
|
14
|
-
`).map(e=>
|
|
15
|
-
`)}const
|
|
14
|
+
`).map(e=>xi(e,t,n)).join(`
|
|
15
|
+
`)}const Ci={actions:new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]]),messages:{cancel:`Canceled`,error:`Something went wrong`},withGuide:!0};function wi(e,t){if(typeof e==`string`)return Ci.aliases.get(e)===t;for(let n of e)if(n!==void 0&&wi(n,t))return!0;return!1}function Ti(e,t){if(e===t)return;let n=e.split(`
|
|
16
16
|
`),r=t.split(`
|
|
17
|
-
`),i=Math.max(n.length,r.length),a=[];for(let e=0;e<i;e++)n[e]!==r[e]&&a.push(e);return{lines:a,numLinesBefore:n.length,numLinesAfter:r.length,numLines:i}}const
|
|
17
|
+
`),i=Math.max(n.length,r.length),a=[];for(let e=0;e<i;e++)n[e]!==r[e]&&a.push(e);return{lines:a,numLinesBefore:n.length,numLinesAfter:r.length,numLines:i}}const Ei=globalThis.process.platform.startsWith(`win`),Di=Symbol(`clack:cancel`);function I(e){return e===Di}function Oi(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function ki({input:e=Ce,output:t=we,overwrite:n=!0,hideCursor:r=!0}={}){let i=Je.createInterface({input:e,output:t,prompt:``,tabSize:1});Je.emitKeypressEvents(e,i),e instanceof Xe&&e.isTTY&&e.setRawMode(!0);let a=(i,{name:o,sequence:s})=>{if(wi([String(i),o,s],`cancel`)){r&&t.write(F.cursor.show),process.exit(0);return}if(!n)return;let c=o===`return`?0:-1,l=o===`return`?-1:0;Je.moveCursor(t,c,l,()=>{Je.clearLine(t,1,()=>{e.once(`keypress`,a)})})};return r&&t.write(F.cursor.hide),e.once(`keypress`,a),()=>{e.off(`keypress`,a),r&&t.write(F.cursor.show),e instanceof Xe&&e.isTTY&&!Ei&&e.setRawMode(!1),i.terminal=!1,i.close()}}const Ai=e=>`columns`in e&&typeof e.columns==`number`?e.columns:80,ji=e=>`rows`in e&&typeof e.rows==`number`?e.rows:20;function Mi(e,t,n,r=n){return Si(t,Ai(e??we)-n.length,{hard:!0,trim:!1}).split(`
|
|
18
18
|
`).map((e,t)=>`${t===0?r:n}${e}`).join(`
|
|
19
|
-
`)}var
|
|
20
|
-
`),
|
|
21
|
-
`).length-1;this.output.write(F.cursor.move(-999,e*-1))}render(){let e=
|
|
19
|
+
`)}var Ni=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame=``;_subscribers=new Map;_cursor=0;state=`initial`;error=``;value;userInput=``;constructor(e,t=!0){let{input:n=Ce,output:r=we,render:i,signal:a,...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=a,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(Di);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}this.rl=Ye.createInterface({input:this.input,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on(`keypress`,this.onKeypress),Oi(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(F.cursor.show),this.output.off(`resize`,this.render),Oi(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(F.cursor.show),this.output.off(`resize`,this.render),Oi(this.input,!1),e(Di)})})}_isActionKey(e,t){return e===` `}_setValue(e){this.value=e,this.emit(`value`,this.value)}_setUserInput(e,t){this.userInput=e??``,this.emit(`userInput`,this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:`u`}),this._setUserInput(``)}onKeypress(e,t){if(this._track&&t.name!==`return`&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:`h`}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&Ci.aliases.has(t.name)&&this.emit(`cursor`,Ci.aliases.get(t.name)),Ci.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),this.emit(`key`,e?.toLowerCase(),t),t?.name===`return`){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state=`error`,this.rl?.write(this.userInput))}this.state!==`error`&&(this.state=`submit`)}wi([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
|
|
20
|
+
`),Oi(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Si(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
21
|
+
`).length-1;this.output.write(F.cursor.move(-999,e*-1))}render(){let e=Si(this._render(this)??``,process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(F.cursor.hide);else{let t=Ti(this._prevFrame,e),n=ji(this.output);if(this.restoreCursor(),t){let r=Math.max(0,t.numLinesAfter-n),i=Math.max(0,t.numLinesBefore-n),a=t.lines.find(e=>e>=r);if(a===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(F.cursor.move(0,a-i)),this.output.write(F.erase.lines(1));let t=e.split(`
|
|
22
22
|
`);this.output.write(t[a]),this._prevFrame=e,this.output.write(F.cursor.move(0,t.length-a-1));return}else if(t.lines.length>1){if(r<i)a=r;else{let e=a-i;e>0&&this.output.write(F.cursor.move(0,e))}this.output.write(F.erase.down());let t=e.split(`
|
|
23
23
|
`).slice(a);this.output.write(t.join(`
|
|
24
|
-
`)),this._prevFrame=e;return}}this.output.write(F.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},Mi=class extends ji{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`userInput`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(F.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}};let Ni=class extends ji{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions;this.value=this.value!==void 0&&this.value.length===e.length?[]:e.map(e=>e.value)}toggleInvert(){let e=this.value;e&&(this.value=this._enabledOptions.filter(t=>!e.includes(t.value)).map(e=>e.value))}toggleValue(){this.value===void 0&&(this.value=[]),this.value=this.value.includes(this._value)?this.value.filter(e=>e!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0);this.cursor=this.options[t].disabled?Zr(t,1,this.options):t,this.on(`key`,e=>{e===`a`&&this.toggleAll(),e===`i`&&this.toggleInvert()}),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=Zr(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=Zr(this.cursor,1,this.options);break;case`space`:this.toggleValue();break}})}};var Pi=class extends ji{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let t=this.options.findIndex(({value:t})=>t===e.initialValue),n=t===-1?0:t;this.cursor=this.options[n].disabled?Zr(n,1,this.options):n,this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=Zr(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=Zr(this.cursor,1,this.options);break}this.changeValue()})}},Fi=class extends ji{get userInputWithCursor(){if(this.state===`submit`)return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let t=e.slice(0,this.cursor),[n,...r]=e.slice(this.cursor);return`${t}${A(`inverse`,n)}${r.join(``)}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on(`userInput`,e=>{this._setValue(e)}),this.on(`finalize`,()=>{this.value||=e.defaultValue,this.value===void 0&&(this.value=``)})}};function Ii(){return T.platform===`win32`?!!T.env.CI||!!T.env.WT_SESSION||!!T.env.TERMINUS_SUBLIME||T.env.ConEmuTask===`{cmd::Cmder}`||T.env.TERM_PROGRAM===`Terminus-Sublime`||T.env.TERM_PROGRAM===`vscode`||T.env.TERM===`xterm-256color`||T.env.TERM===`alacritty`||T.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:T.env.TERM!==`linux`}const Li=Ii(),Ri=()=>process.env.CI===`true`,zi=e=>e.isTTY===!0,L=(e,t)=>Li?e:t,Bi=L(`◆`,`*`),Vi=L(`■`,`x`),Hi=L(`▲`,`x`),Ui=L(`◇`,`o`),Wi=L(`┌`,`T`),R=L(`│`,`|`),Gi=L(`└`,`—`),Ki=L(`●`,`>`),qi=L(`○`,` `),Ji=L(`◻`,`[•]`),Yi=L(`◼`,`[+]`),Xi=L(`◻`,`[ ]`),Zi=L(`─`,`-`),Qi=L(`╮`,`+`),$i=L(`├`,`+`),ea=L(`╯`,`+`),ta=L(`╰`,`+`),na=L(`●`,`•`),ra=L(`◆`,`*`),ia=L(`▲`,`!`),aa=L(`■`,`x`),oa=e=>{switch(e){case`initial`:case`active`:return A(`cyan`,Bi);case`cancel`:return A(`red`,Vi);case`error`:return A(`yellow`,Hi);case`submit`:return A(`green`,Ui)}},sa=e=>{switch(e){case`initial`:case`active`:return A(`cyan`,R);case`cancel`:return A(`red`,R);case`error`:return A(`yellow`,R);case`submit`:return A(`green`,R)}},ca=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,la=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ua=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,da=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,fa=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,pa=/\t{1,1000}/y,ma=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,ha=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,ga=/\p{M}+/gu,_a={limit:1/0,ellipsis:``},va=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?va(i,_a,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;e:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(ga,``)){let t=e.codePointAt(0)||0;if(w=la(t)?d:ua(t)?p:l!==f&&ca(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break e}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(ha.lastIndex=h,ha.test(e)){if(_=ha.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ha.lastIndex;continue}if(da.lastIndex=h,da.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=da.lastIndex;continue}if(fa.lastIndex=h,fa.test(e)){if(_=fa.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=fa.lastIndex;continue}if(pa.lastIndex=h,pa.test(e)){if(_=pa.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=pa.lastIndex;continue}if(ma.lastIndex=h,ma.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=ma.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},ya={limit:1/0,ellipsis:``,ellipsisWidth:0},ba=(e,t={})=>va(e,ya,t).width,xa=`]8;;`,Sa=RegExp(`(?:\\[(?<code>\\d+)m|\\${xa}(?<uri>.*))`,`y`),Ca=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},wa=e=>`[${e}m`,Ta=e=>`${xa}${e}`,Ea=e=>e.map(e=>ba(e)),Da=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:ba(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=ba(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(xa,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Oa=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(ba(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},ka=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=Ea(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=ba(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),Da(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){Da(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){Da(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>Oa(e)));let l=c.join(`
|
|
25
|
-
`),u=l[Symbol.iterator](),d=u.next(),f=u.next(),p=0;for(;!d.done;){let e=d.value,t=f.value;if(r+=e,e===`\x1B`||e===``){
|
|
26
|
-
`?(a&&(r+=
|
|
27
|
-
`&&(i&&n&&(r+=
|
|
24
|
+
`)),this._prevFrame=e;return}}this.output.write(F.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},Pi=class extends Ni{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`userInput`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(F.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}};let Fi=class extends Ni{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions;this.value=this.value!==void 0&&this.value.length===e.length?[]:e.map(e=>e.value)}toggleInvert(){let e=this.value;e&&(this.value=this._enabledOptions.filter(t=>!e.includes(t.value)).map(e=>e.value))}toggleValue(){this.value===void 0&&(this.value=[]),this.value=this.value.includes(this._value)?this.value.filter(e=>e!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0);this.cursor=this.options[t].disabled?$r(t,1,this.options):t,this.on(`key`,e=>{e===`a`&&this.toggleAll(),e===`i`&&this.toggleInvert()}),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=$r(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=$r(this.cursor,1,this.options);break;case`space`:this.toggleValue();break}})}};var Ii=class extends Ni{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let t=this.options.findIndex(({value:t})=>t===e.initialValue),n=t===-1?0:t;this.cursor=this.options[n].disabled?$r(n,1,this.options):n,this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=$r(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=$r(this.cursor,1,this.options);break}this.changeValue()})}},Li=class extends Ni{get userInputWithCursor(){if(this.state===`submit`)return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let t=e.slice(0,this.cursor),[n,...r]=e.slice(this.cursor);return`${t}${A(`inverse`,n)}${r.join(``)}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on(`userInput`,e=>{this._setValue(e)}),this.on(`finalize`,()=>{this.value||=e.defaultValue,this.value===void 0&&(this.value=``)})}};function Ri(){return T.platform===`win32`?!!T.env.CI||!!T.env.WT_SESSION||!!T.env.TERMINUS_SUBLIME||T.env.ConEmuTask===`{cmd::Cmder}`||T.env.TERM_PROGRAM===`Terminus-Sublime`||T.env.TERM_PROGRAM===`vscode`||T.env.TERM===`xterm-256color`||T.env.TERM===`alacritty`||T.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:T.env.TERM!==`linux`}const zi=Ri(),Bi=()=>process.env.CI===`true`,Vi=e=>e.isTTY===!0,L=(e,t)=>zi?e:t,Hi=L(`◆`,`*`),Ui=L(`■`,`x`),Wi=L(`▲`,`x`),Gi=L(`◇`,`o`),Ki=L(`┌`,`T`),R=L(`│`,`|`),qi=L(`└`,`—`),Ji=L(`●`,`>`),Yi=L(`○`,` `),Xi=L(`◻`,`[•]`),Zi=L(`◼`,`[+]`),Qi=L(`◻`,`[ ]`),$i=L(`─`,`-`),ea=L(`╮`,`+`),ta=L(`├`,`+`),na=L(`╯`,`+`),ra=L(`╰`,`+`),ia=L(`●`,`•`),aa=L(`◆`,`*`),oa=L(`▲`,`!`),sa=L(`■`,`x`),ca=e=>{switch(e){case`initial`:case`active`:return A(`cyan`,Hi);case`cancel`:return A(`red`,Ui);case`error`:return A(`yellow`,Wi);case`submit`:return A(`green`,Gi)}},la=e=>{switch(e){case`initial`:case`active`:return A(`cyan`,R);case`cancel`:return A(`red`,R);case`error`:return A(`yellow`,R);case`submit`:return A(`green`,R)}},ua=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,da=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,fa=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,pa=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ma=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ha=/\t{1,1000}/y,ga=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,_a=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,va=/\p{M}+/gu,ya={limit:1/0,ellipsis:``},ba=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?ba(i,ya,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,p=n.wideWidth??2,m=0,h=0,g=e.length,_=0,v=!1,y=g,b=Math.max(0,r-a),x=0,S=0,C=0,w=0;e:for(;;){if(S>x||h>=g&&h>m){let t=e.slice(x,S)||e.slice(m,h);_=0;for(let e of t.replaceAll(va,``)){let t=e.codePointAt(0)||0;if(w=da(t)?d:fa(t)?p:l!==f&&ua(t)?l:f,C+w>b&&(y=Math.min(y,Math.max(x,m)+_)),C+w>r){v=!0;break e}_+=e.length,C+=w}x=S=0}if(h>=g)break;if(_a.lastIndex=h,_a.test(e)){if(_=_a.lastIndex-h,w=_*f,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/f))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=_a.lastIndex;continue}if(pa.lastIndex=h,pa.test(e)){if(C+o>b&&(y=Math.min(y,h)),C+o>r){v=!0;break}C+=o,x=m,S=h,h=m=pa.lastIndex;continue}if(ma.lastIndex=h,ma.test(e)){if(_=ma.lastIndex-h,w=_*s,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/s))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ma.lastIndex;continue}if(ha.lastIndex=h,ha.test(e)){if(_=ha.lastIndex-h,w=_*c,C+w>b&&(y=Math.min(y,h+Math.floor((b-C)/c))),C+w>r){v=!0;break}C+=w,x=m,S=h,h=m=ha.lastIndex;continue}if(ga.lastIndex=h,ga.test(e)){if(C+u>b&&(y=Math.min(y,h)),C+u>r){v=!0;break}C+=u,x=m,S=h,h=m=ga.lastIndex;continue}h+=1}return{width:v?b:C,index:v?y:g,truncated:v,ellipsed:v&&r>=a}},xa={limit:1/0,ellipsis:``,ellipsisWidth:0},Sa=(e,t={})=>ba(e,xa,t).width,Ca=`]8;;`,wa=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ca}(?<uri>.*))`,`y`),Ta=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ea=e=>`[${e}m`,Da=e=>`${Ca}${e}`,Oa=e=>e.map(e=>Sa(e)),ka=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:Sa(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=Sa(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Ca,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Aa=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(Sa(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},ja=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=Oa(o),c=[``];for(let[e,r]of o.entries()){n.trim!==!1&&(c[c.length-1]=(c.at(-1)??``).trimStart());let i=Sa(c.at(-1)??``);if(e!==0&&(i>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),i=0),(i>0||n.trim===!1)&&(c[c.length-1]+=` `,i++)),n.hard&&s[e]>t){let n=t-i,a=1+Math.floor((s[e]-n-1)/t);Math.floor((s[e]-1)/t)<a&&c.push(``),ka(c,r,t);continue}if(i+s[e]>t&&i>0&&s[e]>0){if(n.wordWrap===!1&&i<t){ka(c,r,t);continue}c.push(``)}if(i+s[e]>t&&n.wordWrap===!1){ka(c,r,t);continue}c[c.length-1]+=r}n.trim!==!1&&(c=c.map(e=>Aa(e)));let l=c.join(`
|
|
25
|
+
`),u=l[Symbol.iterator](),d=u.next(),f=u.next(),p=0;for(;!d.done;){let e=d.value,t=f.value;if(r+=e,e===`\x1B`||e===``){wa.lastIndex=p+1;let e=wa.exec(l)?.groups;if(e?.code!==void 0){let t=Number.parseFloat(e.code);i=t===39?void 0:t}else e?.uri!==void 0&&(a=e.uri.length===0?void 0:e.uri)}let n=i?Ta(i):void 0;t===`
|
|
26
|
+
`?(a&&(r+=Da(``)),i&&n&&(r+=Ea(n))):e===`
|
|
27
|
+
`&&(i&&n&&(r+=Ea(i)),a&&(r+=Da(a))),p+=e.length,d=f,f=u.next()}return r};function Ma(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
28
28
|
`,`
|
|
29
29
|
`).split(`
|
|
30
|
-
`).map(e=>
|
|
31
|
-
`)}const
|
|
32
|
-
`);g.push(i),_+=i.length}if(_>u){let t=0,n=0,r=_,i=e-v,a=(e,t)=>
|
|
33
|
-
`:``}${
|
|
30
|
+
`).map(e=>ja(e,t,n)).join(`
|
|
31
|
+
`)}const Na=(e,t,n,r,i)=>{let a=t,o=0;for(let t=n;t<r;t++){let n=e[t];if(a-=n.length,o++,a<=i)break}return{lineCount:a,removals:o}},Pa=({cursor:e,options:t,style:n,output:r=process.stdout,maxItems:i=1/0,columnPadding:a=0,rowPadding:o=4})=>{let s=Ai(r)-a,c=ji(r),l=A(`dim`,`...`),u=Math.max(c-o,0),d=Math.max(Math.min(i,u),5),f=0;e>=d-3&&(f=Math.max(Math.min(e-d+3,t.length-d),0));let p=d<t.length&&f>0,m=d<t.length&&f+d<t.length,h=Math.min(f+d,t.length),g=[],_=0;p&&_++,m&&_++;let v=f+(p?1:0),y=h-(m?1:0);for(let r=v;r<y;r++){let i=Ma(n(t[r],r===e),s,{hard:!0,trim:!1}).split(`
|
|
32
|
+
`);g.push(i),_+=i.length}if(_>u){let t=0,n=0,r=_,i=e-v,a=(e,t)=>Na(g,r,e,t,u);p?({lineCount:r,removals:t}=a(0,i),r>u&&({lineCount:r,removals:n}=a(i+1,g.length))):({lineCount:r,removals:n}=a(i+1,g.length),r>u&&({lineCount:r,removals:t}=a(0,i))),t>0&&(p=!0,g.splice(0,t)),n>0&&(m=!0,g.splice(g.length-n,n))}let b=[];p&&b.push(l);for(let e of g)for(let t of e)b.push(t);return m&&b.push(l),b},Fa=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new Pi({active:t,inactive:n,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let r=e.withGuide??Ci.withGuide,i=`${r?`${A(`gray`,R)}
|
|
33
|
+
`:``}${ca(this.state)} ${e.message}
|
|
34
34
|
`,a=this.value?t:n;switch(this.state){case`submit`:return`${i}${r?`${A(`gray`,R)} `:``}${A(`dim`,a)}`;case`cancel`:return`${i}${r?`${A(`gray`,R)} `:``}${A([`strikethrough`,`dim`],a)}${r?`
|
|
35
|
-
${A(`gray`,R)}`:``}`;default:{let a=r?`${A(`cyan`,R)} `:``,o=r?A(`cyan`,
|
|
35
|
+
${A(`gray`,R)}`:``}`;default:{let a=r?`${A(`cyan`,R)} `:``,o=r?A(`cyan`,qi):``;return`${i}${a}${this.value?`${A(`green`,Ji)} ${t}`:`${A(`dim`,Yi)} ${A(`dim`,t)}`}${e.vertical?r?`
|
|
36
36
|
${A(`cyan`,R)} `:`
|
|
37
|
-
`:` ${A(`dim`,`/`)} `}${this.value?`${A(`dim`,
|
|
37
|
+
`:` ${A(`dim`,`/`)} `}${this.value?`${A(`dim`,Yi)} ${A(`dim`,n)}`:`${A(`green`,Ji)} ${n}`}
|
|
38
38
|
${o}
|
|
39
|
-
`}}}}).prompt()},
|
|
39
|
+
`}}}}).prompt()},Ia=async(e,t)=>{let n={},r=Object.keys(e);for(let i of r){let r=e[i],a=await r({results:n})?.catch(e=>{throw e});if(typeof t?.onCancel==`function`&&I(a)){n[i]=`canceled`,t.onCancel({results:n});continue}n[i]=a}return n},z={message:(e=[],{symbol:t=A(`gray`,R),secondarySymbol:n=A(`gray`,R),output:r=process.stdout,spacing:i=1,withGuide:a}={})=>{let o=[],s=a??Ci.withGuide,c=s?n:``,l=s?`${t} `:``,u=s?`${n} `:``;for(let e=0;e<i;e++)o.push(c);let d=Array.isArray(e)?e:e.split(`
|
|
40
40
|
`);if(d.length>0){let[e,...r]=d;e.length>0?o.push(`${l}${e}`):o.push(s?t:``);for(let e of r)e.length>0?o.push(`${u}${e}`):o.push(s?n:``)}r.write(`${o.join(`
|
|
41
41
|
`)}
|
|
42
|
-
`)},info:(e,t)=>{z.message(e,{...t,symbol:A(`blue`,
|
|
42
|
+
`)},info:(e,t)=>{z.message(e,{...t,symbol:A(`blue`,ia)})},success:(e,t)=>{z.message(e,{...t,symbol:A(`green`,aa)})},step:(e,t)=>{z.message(e,{...t,symbol:A(`green`,Gi)})},warn:(e,t)=>{z.message(e,{...t,symbol:A(`yellow`,oa)})},warning:(e,t)=>{z.warn(e,t)},error:(e,t)=>{z.message(e,{...t,symbol:A(`red`,sa)})}},La=(e=``,t)=>{let n=t?.output??process.stdout,r=t?.withGuide??Ci.withGuide?`${A(`gray`,qi)} `:``;n.write(`${r}${A(`red`,e)}
|
|
43
43
|
|
|
44
|
-
`)},
|
|
45
|
-
`)},
|
|
46
|
-
${A(`gray`,
|
|
44
|
+
`)},Ra=(e=``,t)=>{let n=t?.output??process.stdout,r=t?.withGuide??Ci.withGuide?`${A(`gray`,Ki)} `:``;n.write(`${r}${e}
|
|
45
|
+
`)},za=(e=``,t)=>{let n=t?.output??process.stdout,r=t?.withGuide??Ci.withGuide?`${A(`gray`,R)}
|
|
46
|
+
${A(`gray`,qi)} `:``;n.write(`${r}${e}
|
|
47
47
|
|
|
48
|
-
`)},
|
|
48
|
+
`)},Ba=(e,t)=>e.split(`
|
|
49
49
|
`).map(e=>t(e)).join(`
|
|
50
|
-
`),
|
|
51
|
-
${A(`reset`,A(`dim`,`Press ${A([`gray`,`bgWhite`,`inverse`],` space `)} to select, ${A(`gray`,A(`bgWhite`,A(`inverse`,` enter `)))} to submit`))}`},render(){let n=
|
|
50
|
+
`),Va=e=>{let t=(e,t)=>{let n=e.label??String(e.value);return t===`disabled`?`${A(`gray`,Qi)} ${Ba(n,e=>A([`strikethrough`,`gray`],e))}${e.hint?` ${A(`dim`,`(${e.hint??`disabled`})`)}`:``}`:t===`active`?`${A(`cyan`,Xi)} ${n}${e.hint?` ${A(`dim`,`(${e.hint})`)}`:``}`:t===`selected`?`${A(`green`,Zi)} ${Ba(n,e=>A(`dim`,e))}${e.hint?` ${A(`dim`,`(${e.hint})`)}`:``}`:t===`cancelled`?`${Ba(n,e=>A([`strikethrough`,`dim`],e))}`:t===`active-selected`?`${A(`green`,Zi)} ${n}${e.hint?` ${A(`dim`,`(${e.hint})`)}`:``}`:t===`submitted`?`${Ba(n,e=>A(`dim`,e))}`:`${A(`dim`,Qi)} ${Ba(n,e=>A(`dim`,e))}`},n=e.required??!0;return new Fi({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:n,cursorAt:e.cursorAt,validate(e){if(n&&(e===void 0||e.length===0))return`Please select at least one option.
|
|
51
|
+
${A(`reset`,A(`dim`,`Press ${A([`gray`,`bgWhite`,`inverse`],` space `)} to select, ${A(`gray`,A(`bgWhite`,A(`inverse`,` enter `)))} to submit`))}`},render(){let n=Mi(e.output,e.message,`${la(this.state)} `,`${ca(this.state)} `),r=`${A(`gray`,R)}
|
|
52
52
|
${n}
|
|
53
|
-
`,i=this.value??[],a=(e,n)=>{if(e.disabled)return t(e,`disabled`);let r=i.includes(e.value);return n&&r?t(e,`active-selected`):r?t(e,`selected`):t(e,n?`active`:`inactive`)};switch(this.state){case`submit`:{let n=this.options.filter(({value:e})=>i.includes(e)).map(e=>t(e,`submitted`)).join(A(`dim`,`, `))||A(`dim`,`none`);return`${r}${
|
|
53
|
+
`,i=this.value??[],a=(e,n)=>{if(e.disabled)return t(e,`disabled`);let r=i.includes(e.value);return n&&r?t(e,`active-selected`):r?t(e,`selected`):t(e,n?`active`:`inactive`)};switch(this.state){case`submit`:{let n=this.options.filter(({value:e})=>i.includes(e)).map(e=>t(e,`submitted`)).join(A(`dim`,`, `))||A(`dim`,`none`);return`${r}${Mi(e.output,n,`${A(`gray`,R)} `)}`}case`cancel`:{let n=this.options.filter(({value:e})=>i.includes(e)).map(e=>t(e,`cancelled`)).join(A(`dim`,`, `));return n.trim()===``?`${r}${A(`gray`,R)}`:`${r}${Mi(e.output,n,`${A(`gray`,R)} `)}
|
|
54
54
|
${A(`gray`,R)}`}case`error`:{let t=`${A(`yellow`,R)} `,n=this.error.split(`
|
|
55
|
-
`).map((e,t)=>t===0?`${A(`yellow`,
|
|
55
|
+
`).map((e,t)=>t===0?`${A(`yellow`,qi)} ${A(`yellow`,e)}`:` ${e}`).join(`
|
|
56
56
|
`),i=r.split(`
|
|
57
57
|
`).length,o=n.split(`
|
|
58
|
-
`).length+1;return`${r}${t}${
|
|
58
|
+
`).length+1;return`${r}${t}${Pa({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:t.length,rowPadding:i+o,style:a}).join(`
|
|
59
59
|
${t}`)}
|
|
60
60
|
${n}
|
|
61
61
|
`}default:{let t=`${A(`cyan`,R)} `,n=r.split(`
|
|
62
|
-
`).length;return`${r}${t}${
|
|
62
|
+
`).length;return`${r}${t}${Pa({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:t.length,rowPadding:n+2,style:a}).join(`
|
|
63
63
|
${t}`)}
|
|
64
|
-
${A(`cyan`,
|
|
65
|
-
`}}}}).prompt()},
|
|
66
|
-
`),a=i.reduce((e,t)=>Math.max(
|
|
67
|
-
`).map(a),``],s=
|
|
64
|
+
${A(`cyan`,qi)}
|
|
65
|
+
`}}}}).prompt()},Ha=e=>A(`dim`,e),Ua=(e,t,n)=>{let r={hard:!0,trim:!1},i=Ma(e,t,r).split(`
|
|
66
|
+
`),a=i.reduce((e,t)=>Math.max(Sa(t),e),0);return Ma(e,t-(i.map(n).reduce((e,t)=>Math.max(Sa(t),e),0)-a),r)},Wa=(e=``,t=``,n)=>{let r=n?.output??T.stdout,i=n?.withGuide??Ci.withGuide,a=n?.format??Ha,o=[``,...Ua(e,Ai(r)-6,a).split(`
|
|
67
|
+
`).map(a),``],s=Sa(t),c=Math.max(o.reduce((e,t)=>{let n=Sa(t);return n>e?n:e},0),s)+2,l=o.map(e=>`${A(`gray`,R)} ${e}${` `.repeat(c-Sa(e))}${A(`gray`,R)}`).join(`
|
|
68
68
|
`),u=i?`${A(`gray`,R)}
|
|
69
|
-
`:``,d=i
|
|
69
|
+
`:``,d=i?ta:ra;r.write(`${u}${A(`green`,Gi)} ${A(`reset`,t)} ${A(`gray`,$i.repeat(Math.max(c-s-1,1))+ea)}
|
|
70
70
|
${l}
|
|
71
|
-
${A(`gray`,d
|
|
72
|
-
`)},
|
|
73
|
-
`);let e=
|
|
74
|
-
`);e.length>1&&n.write(F.cursor.up(e.length-1)),n.write(F.cursor.to(0)),n.write(F.erase.down())},ee=e=>e.replace(/\.+$/,``),te=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},ne=c.withGuide??
|
|
75
|
-
`);let r=0,i=0;S(),d=setInterval(()=>{if(l&&m===h)return;w(),h=m;let t=v(a[r]),o;if(l)o=`${t} ${m}...`;else if(e===`timer`)o=`${t} ${m} ${te(g)}`;else{let e=`.`.repeat(Math.floor(i)).slice(0,3);o=`${t} ${m}${e}`}let s=
|
|
71
|
+
${A(`gray`,d+$i.repeat(c+2)+na)}
|
|
72
|
+
`)},Ga=e=>A(`magenta`,e),Ka=({indicator:e=`dots`,onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:a=zi?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],delay:o=zi?80:120,signal:s,...c}={})=>{let l=Bi(),u,d,f=!1,p=!1,m=``,h,g=performance.now(),_=Ai(n),v=c?.styleFrame??Ga,y=e=>{let n=e>1?i??Ci.messages.error:r??Ci.messages.cancel;p=e===1,f&&(ie(n,e),p&&typeof t==`function`&&t())},b=()=>y(2),x=()=>y(1),S=()=>{process.on(`uncaughtExceptionMonitor`,b),process.on(`unhandledRejection`,b),process.on(`SIGINT`,x),process.on(`SIGTERM`,x),process.on(`exit`,y),s&&s.addEventListener(`abort`,x)},C=()=>{process.removeListener(`uncaughtExceptionMonitor`,b),process.removeListener(`unhandledRejection`,b),process.removeListener(`SIGINT`,x),process.removeListener(`SIGTERM`,x),process.removeListener(`exit`,y),s&&s.removeEventListener(`abort`,x)},w=()=>{if(h===void 0)return;l&&n.write(`
|
|
73
|
+
`);let e=Ma(h,_,{hard:!0,trim:!1}).split(`
|
|
74
|
+
`);e.length>1&&n.write(F.cursor.up(e.length-1)),n.write(F.cursor.to(0)),n.write(F.erase.down())},ee=e=>e.replace(/\.+$/,``),te=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},ne=c.withGuide??Ci.withGuide,re=(t=``)=>{f=!0,u=ki({output:n}),m=ee(t),g=performance.now(),ne&&n.write(`${A(`gray`,R)}
|
|
75
|
+
`);let r=0,i=0;S(),d=setInterval(()=>{if(l&&m===h)return;w(),h=m;let t=v(a[r]),o;if(l)o=`${t} ${m}...`;else if(e===`timer`)o=`${t} ${m} ${te(g)}`;else{let e=`.`.repeat(Math.floor(i)).slice(0,3);o=`${t} ${m}${e}`}let s=Ma(o,_,{hard:!0,trim:!1});n.write(s),r=r+1<a.length?r+1:0,i=i<4?i+.125:0},o)},ie=(t=``,r=0,i=!1)=>{if(!f)return;f=!1,clearInterval(d),w();let a=r===0?A(`green`,Gi):r===1?A(`red`,Ui):A(`red`,Wi);m=t??m,i||(e===`timer`?n.write(`${a} ${m} ${te(g)}
|
|
76
76
|
`):n.write(`${a} ${m}
|
|
77
|
-
`)),C(),u()};return{start:re,stop:(e=``)=>ie(e,0),message:(e=``)=>{m=ee(e??m)},cancel:(e=``)=>ie(e,1),error:(e=``)=>ie(e,2),clear:()=>ie(``,0,!0),get isCancelled(){return p}}},
|
|
77
|
+
`)),C(),u()};return{start:re,stop:(e=``)=>ie(e,0),message:(e=``)=>{m=ee(e??m)},cancel:(e=``)=>ie(e,1),error:(e=``)=>ie(e,2),clear:()=>ie(``,0,!0),get isCancelled(){return p}}},qa=(e,t)=>e.includes(`
|
|
78
78
|
`)?e.split(`
|
|
79
79
|
`).map(e=>t(e)).join(`
|
|
80
|
-
`):t(e),
|
|
80
|
+
`):t(e),Ja=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`disabled`:return`${A(`gray`,Yi)} ${qa(n,e=>A(`gray`,e))}${e.hint?` ${A(`dim`,`(${e.hint??`disabled`})`)}`:``}`;case`selected`:return`${qa(n,e=>A(`dim`,e))}`;case`active`:return`${A(`green`,Ji)} ${n}${e.hint?` ${A(`dim`,`(${e.hint})`)}`:``}`;case`cancelled`:return`${qa(n,e=>A([`strikethrough`,`dim`],e))}`;default:return`${A(`dim`,Yi)} ${qa(n,e=>A(`dim`,e))}`}};return new Ii({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let n=e.withGuide??Ci.withGuide,r=`${ca(this.state)} `,i=`${la(this.state)} `,a=Mi(e.output,e.message,i,r),o=`${n?`${A(`gray`,R)}
|
|
81
81
|
`:``}${a}
|
|
82
|
-
`;switch(this.state){case`submit`:{let r=n?`${A(`gray`,R)} `:``;return`${o}${
|
|
83
|
-
${A(`gray`,R)}`:``}`}default:{let r=n?`${A(`cyan`,R)} `:``,i=n?A(`cyan`,
|
|
84
|
-
`).length,s=n?2:1;return`${o}${r}${
|
|
82
|
+
`;switch(this.state){case`submit`:{let r=n?`${A(`gray`,R)} `:``;return`${o}${Mi(e.output,t(this.options[this.cursor],`selected`),r)}`}case`cancel`:{let r=n?`${A(`gray`,R)} `:``;return`${o}${Mi(e.output,t(this.options[this.cursor],`cancelled`),r)}${n?`
|
|
83
|
+
${A(`gray`,R)}`:``}`}default:{let r=n?`${A(`cyan`,R)} `:``,i=n?A(`cyan`,qi):``,a=o.split(`
|
|
84
|
+
`).length,s=n?2:1;return`${o}${r}${Pa({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:r.length,rowPadding:a+s,style:(e,n)=>t(e,e.disabled?`disabled`:n?`active`:`inactive`)}).join(`
|
|
85
85
|
${r}`)}
|
|
86
86
|
${i}
|
|
87
|
-
`}}}}).prompt()},
|
|
87
|
+
`}}}}).prompt()},Ya=`${A(`gray`,R)} `,Xa={message:async(e,{symbol:t=A(`gray`,R)}={})=>{process.stdout.write(`${A(`gray`,R)}
|
|
88
88
|
${t} `);let n=3;for await(let t of e){t=t.replace(/\n/g,`
|
|
89
|
-
${
|
|
90
|
-
`)&&(n=3+
|
|
91
|
-
`))).length);let e=
|
|
92
|
-
${
|
|
93
|
-
`)},info:e=>
|
|
94
|
-
`),t.write(`${A(`green`,
|
|
89
|
+
${Ya}`),t.includes(`
|
|
90
|
+
`)&&(n=3+qe(t.slice(t.lastIndexOf(`
|
|
91
|
+
`))).length);let e=qe(t).length;n+e<process.stdout.columns?(n+=e,process.stdout.write(t)):(process.stdout.write(`
|
|
92
|
+
${Ya}${t.trimStart()}`),n=3+qe(t.trimStart()).length)}process.stdout.write(`
|
|
93
|
+
`)},info:e=>Xa.message(e,{symbol:A(`blue`,ia)}),success:e=>Xa.message(e,{symbol:A(`green`,aa)}),step:e=>Xa.message(e,{symbol:A(`green`,Gi)}),warn:e=>Xa.message(e,{symbol:A(`yellow`,oa)}),warning:e=>Xa.warn(e),error:e=>Xa.message(e,{symbol:A(`red`,sa)})},Za=async(e,t)=>{for(let n of e){if(n.enabled===!1)continue;let e=Ka(t);e.start(n.title);let r=await n.task(e.message);e.stop(r||n.title)}},Qa=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,``),$a=e=>{let t=e.output??process.stdout,n=Ai(t),r=A(`gray`,R),i=e.spacing??1,a=e.retainLog===!0,o=!Bi()&&Vi(t);t.write(`${r}
|
|
94
|
+
`),t.write(`${A(`green`,Gi)} ${e.title}
|
|
95
95
|
`);for(let e=0;e<i;e++)t.write(`${r}
|
|
96
96
|
`);let s=[{value:``,full:``}],c=!1,l=e=>{if(s.length===0)return;let r=0;e&&(r+=i+2);for(let e of s){let{value:t,result:i}=e,a=i?.message??t;if(a.length===0)continue;i===void 0&&e.header!==void 0&&e.header!==``&&(a+=`
|
|
97
97
|
${e.header}`);let o=a.split(`
|
|
@@ -99,51 +99,51 @@ ${e.header}`);let o=a.split(`
|
|
|
99
99
|
${e.value}`:e.value;e.header!==void 0&&e.header!==``&&z.message(e.header.split(`
|
|
100
100
|
`).map(e=>A(`bold`,e)),{output:t,secondarySymbol:r,symbol:r,spacing:0}),z.message(o.split(`
|
|
101
101
|
`).map(e=>A(`dim`,e)),{output:t,secondarySymbol:r,symbol:r,spacing:n??i})},d=()=>{for(let e of s){let{header:t,value:n,full:r}=e;(t===void 0||t.length===0)&&n.length===0||u(e,void 0,a===!0&&r.length>0)}},f=(t,n,r)=>{if(l(!1),(r?.raw!==!0||!c)&&t.value!==``&&(t.value+=`
|
|
102
|
-
`),t.value+=
|
|
102
|
+
`),t.value+=Qa(n),c=r?.raw===!0,e.limit!==void 0){let n=t.value.split(`
|
|
103
103
|
`),r=n.length-e.limit;if(r>0){let e=n.splice(0,r);a&&(t.full+=(t.full===``?``:`
|
|
104
104
|
`)+e.join(`
|
|
105
105
|
`))}t.value=n.join(`
|
|
106
|
-
`)}o&&p()},p=()=>{for(let e of s)e.result?e.result.status===`error`?z.error(e.result.message,{output:t,secondarySymbol:r,spacing:0}):z.success(e.result.message,{output:t,secondarySymbol:r,spacing:0}):e.value!==``&&u(e,0)},m=(e,t)=>{l(!1),e.result=t,o&&p()};return{message(e,t){f(s[0],e,t)},group(e){let t={header:e,value:``,full:``};return s.push(t),{message(e,n){f(t,e,n)},error(e){m(t,{status:`error`,message:e})},success(e){m(t,{status:`success`,message:e})}}},error(e,n){l(!0),z.error(e,{output:t,secondarySymbol:r,spacing:1}),n?.showLog!==!1&&d(),s.splice(1,s.length-1),s[0].value=``,s[0].full=``},success(e,n){l(!0),z.success(e,{output:t,secondarySymbol:r,spacing:1}),n?.showLog===!0&&d(),s.splice(1,s.length-1),s[0].value=``,s[0].full=``}}},
|
|
107
|
-
`:``}${
|
|
108
|
-
`,r=e.placeholder?A(`inverse`,e.placeholder[0])+A(`dim`,e.placeholder.slice(1)):A([`inverse`,`hidden`],`_`),i=this.userInput?this.userInputWithCursor:r,a=this.value??``;switch(this.state){case`error`:{let e=this.error?` ${A(`yellow`,this.error)}`:``,r=t?`${A(`yellow`,R)} `:``,a=t?A(`yellow`,
|
|
106
|
+
`)}o&&p()},p=()=>{for(let e of s)e.result?e.result.status===`error`?z.error(e.result.message,{output:t,secondarySymbol:r,spacing:0}):z.success(e.result.message,{output:t,secondarySymbol:r,spacing:0}):e.value!==``&&u(e,0)},m=(e,t)=>{l(!1),e.result=t,o&&p()};return{message(e,t){f(s[0],e,t)},group(e){let t={header:e,value:``,full:``};return s.push(t),{message(e,n){f(t,e,n)},error(e){m(t,{status:`error`,message:e})},success(e){m(t,{status:`success`,message:e})}}},error(e,n){l(!0),z.error(e,{output:t,secondarySymbol:r,spacing:1}),n?.showLog!==!1&&d(),s.splice(1,s.length-1),s[0].value=``,s[0].full=``},success(e,n){l(!0),z.success(e,{output:t,secondarySymbol:r,spacing:1}),n?.showLog===!0&&d(),s.splice(1,s.length-1),s[0].value=``,s[0].full=``}}},eo=e=>new Li({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??Ci.withGuide,n=`${`${t?`${A(`gray`,R)}
|
|
107
|
+
`:``}${ca(this.state)} `}${e.message}
|
|
108
|
+
`,r=e.placeholder?A(`inverse`,e.placeholder[0])+A(`dim`,e.placeholder.slice(1)):A([`inverse`,`hidden`],`_`),i=this.userInput?this.userInputWithCursor:r,a=this.value??``;switch(this.state){case`error`:{let e=this.error?` ${A(`yellow`,this.error)}`:``,r=t?`${A(`yellow`,R)} `:``,a=t?A(`yellow`,qi):``;return`${n.trim()}
|
|
109
109
|
${r}${i}
|
|
110
110
|
${a}${e}
|
|
111
111
|
`}case`submit`:{let e=a?` ${A(`dim`,a)}`:``;return`${n}${t?A(`gray`,R):``}${e}`}case`cancel`:{let e=a?` ${A([`strikethrough`,`dim`],a)}`:``,r=t?A(`gray`,R):``;return`${n}${r}${e}${a.trim()?`
|
|
112
112
|
${r}`:``}`}default:return`${n}${t?`${A(`cyan`,R)} `:``}${i}
|
|
113
|
-
${t?A(`cyan`,
|
|
114
|
-
`}}}).prompt();function
|
|
113
|
+
${t?A(`cyan`,qi):``}
|
|
114
|
+
`}}}).prompt();function to(){let e=Ln();Ra(kn(`#FF5500`)(M.default.black(` shadcn-svelte `))+M.default.gray(` v${e.version} `)),(typeof Bun<`u`||typeof Deno<`u`)&&z.warn(`You are currently using an unsupported runtime. Only Node.js v22 or higher is officially supported. Continue at your own risk.`)}function B(e=`Operation cancelled.`){La(e),T.exit(0)}function no(e,t=9){return e.reduce((e,n,r)=>r%t===0?`${e},\n${n}`:`${e}, ${n}`)}function ro(e){z.message(),typeof e==`string`&&(La(e),T.exit(1)),(e instanceof g||e instanceof _)&&(La(io(e)),T.exit(1)),e instanceof Error&&(La(io(e)),T.exit(1)),La(`Something went wrong. Please try again.`),T.exit(1)}function io(e){return`${e.stack??e.message}${e.cause?`\n [cause]: ${e.cause instanceof Error?io(e.cause):e.cause}`:``}`}async function ao(e){let t=so(e);if(t)return await oo(e,t)}async function oo(e,t){await Jr(e);let n=ho(e,t),r=E.basename(n.path);if(!n.config.compilerOptions?.paths)throw h(`Missing ${P(`paths`)} field in your ${P(r)} for path aliases. See: ${M.default.underline(`${b}/docs/installation/manual#configure-path-aliases`)}`);let i=(e,t)=>new _(`Invalid import alias found: (${P(`"${e}": "${t}"`)}) in ${P(`components.json`)}.
|
|
115
115
|
- Import aliases ${M.default.underline(`must use`)} existing path aliases defined in your ${P(r)} (e.g. "${e}": "$lib/${e}").
|
|
116
|
-
- See: ${M.default.underline(`${b}/docs/installation/manual#configure-path-aliases`)}.`),a={cwd:e,tailwindCss:E.resolve(e,t.tailwind.css)};for(let[r,o]of Object.entries(t.aliases)){let t=
|
|
117
|
-
`,`utf8`)}function
|
|
118
|
-
`}});if(t&&t.length>0){let r=t[t.length-1];e.insertAfter(r,n)}else e.nodes&&e.nodes.length>0?e.insertAfter(e.nodes[0],n):e.append(n);e.insertBefore(n,j.comment({text:`---break---`}))}}function
|
|
119
|
-
`}});e.append(i),e.insertBefore(i,j.comment({text:`---break---`})),
|
|
120
|
-
`}}),e.append(t),e.insertBefore(t,j.comment({text:`---break---`}))),t}function
|
|
116
|
+
- See: ${M.default.underline(`${b}/docs/installation/manual#configure-path-aliases`)}.`),a={cwd:e,tailwindCss:E.resolve(e,t.tailwind.css)};for(let[r,o]of Object.entries(t.aliases)){let t=Zr({cwd:e,importPath:o,tsconfig:n});if(!t)throw i(r,o);a[r]=E.normalize(t)}let o=Yr(e);return t.style&&!ne.includes(t.style)&&(z.warn(`Unsupported style found in ${P(`components.json`)}: ${P(t.style)}. Using ${P(ae.style)} instead.`),t.style=ae.style),fe.parse({...t,sveltekit:o,resolvedPaths:a})}function so(e){let t=E.resolve(e,`components.json`);if(D.existsSync(t))try{let e=D.readFileSync(t,{encoding:`utf8`});return co(JSON.parse(e))}catch(e){if(!(e instanceof p))throw e;let n=i(e);throw new _(`Invalid configuration found in ${P(t)}.\n\n${n}`)}}function co(e){let t=me.parse(e);return t.aliases={components:lo(t.aliases.components),utils:lo(t.aliases.utils),ui:lo(t.aliases.ui),hooks:lo(t.aliases.hooks),lib:lo(t.aliases.lib)},t}function lo(e){return de(e.replace(/[\u{0080}-\u{FFFF}]/gu,``))}function uo(e){if(Zr(e)===void 0)return`"${M.default.bold(e.importPath)}" does not use an existing path alias defined in your ${M.default.bold(E.basename(e.tsconfig.path))}. See: ${M.default.underline(`${b}/docs/installation/manual#configure-path-aliases`)}`}async function fo(e){let t=await po(`lib`,`$lib`,e),n=await po(`components`,`${t}/components`,e);return{libAlias:t,componentAlias:n,uiAlias:await po(`ui`,`${n}/ui`,e),utilsAlias:await po(`utils`,`${t}/utils`,e),hooksAlias:await po(`hooks`,`${t}/hooks`,e)}}async function po(e,t,n){let r=n[`${e}Alias`];if(r===void 0){let i=await eo({message:`Configure the import alias for ${P(e)}:`,initialValue:n.existingConfig?.aliases[e]??t,placeholder:ue.aliases[e],validate:e=>uo({cwd:n.cwd,tsconfig:n.tsconfig,importPath:e??``})});I(i)&&B(),r=de(i)}return r}function mo(e,t){let n=E.resolve(e,`components.json`),r=he.parse(t,{jitless:!0});D.writeFileSync(n,JSON.stringify(r,null,` `)+`
|
|
117
|
+
`,`utf8`)}function ho(e,t){let n,r;if(typeof t.typescript==`object`){let i=E.resolve(e,t.typescript.config);r=E.basename(i),n=an(i,r)}else r=t.typescript?`tsconfig.json`:`jsconfig.json`,n=an(E.resolve(e,`package.json`),r);if(!n){let e=`Failed to find a ${P(r)} file. `;throw t.typescript?e+=`See: ${M.default.underline(`${b}/docs/components-json#typescript`)}`:e+=`See: ${M.default.underline(`${b}/docs/installation#opt-out-of-typescript`)}`,h(e)}return n}function go(){let{env:e}=T;return e.HTTP_PROXY||e.http_proxy||e.HTTPS_PROXY||e.https_proxy||e.npm_config_proxy||e.npm_config_https_proxy}function _o(e){if(process.env.COMPONENTS_REGISTRY_URL)return process.env.COMPONENTS_REGISTRY_URL;let t=process.env.REGISTRY_URL??e.registry;return new URL(t+`/styles/${e.style??`vega`}`).toString()}function vo(e){let t=_o(e);return new URL(t).origin}async function yo(e){try{let[t]=await Co([l(e,`index.json`)]);return ce.parse(t)}catch(e){throw e instanceof g?e:h(`Failed to fetch components from registry.`,e)}}function bo(){return le.map(e=>({name:e,label:`${e.charAt(0).toUpperCase()}${e.slice(1)}`}))}async function xo({registryUrl:e,registryIndex:t,items:n,parentUrl:r}){let i=[];for(let a of n){let n,o=t.find(e=>e.name===a);if(!o){let t=a.startsWith(`./`)||a.startsWith(`../`);if(u(a)||r&&t){n=new URL(a,r);let[e]=await Co([n]);o=pe.parse(e)}else{if(r)throw h(`Registry item '${a}' does not exist in the remote registry at '${r.origin}', nor is it a valid URL or relative path.`);let t=`Registry item '${a}' does not exist in the registry at '${e}'.`;throw e!==S&&(t+=`\n\nIf you're trying to use shadcn-svelte components, ensure your 'registry' property in components.json is set to '${S}'.`),h(t)}}if(i.push(o),o.registryDependencies?.length){let r=await xo({registryUrl:e,registryIndex:t,items:o.registryDependencies,parentUrl:n});i.push(...r)}}return i.filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t)}async function So({baseUrl:e,items:t}){let n=t.filter(e=>!(`relativeUrl`in e)),r=t.filter(e=>`relativeUrl`in e);try{let t=(await Co(r.map(t=>l(e,t.relativeUrl)))).concat(n);return pe.array().parse(t)}catch(e){throw e instanceof g?e:h(`Failed to fetch tree from registry.`,e)}}async function Co(e){let t=go(),n=t?Qe({url:t}):{},r=e.map(async e=>{let t=await Ze(e,{...n});if(!t.ok)throw h(`Failed to fetch registry from ${e}: ${t.status} ${t.statusText}`);try{return await t.json()}catch(t){throw h(`Error parsing json response from ${e}: Error ${t}`)}});try{return await Promise.all(r)}catch(e){throw e instanceof g?e:h(`Failed to fetch registry.`,e)}}function wo(e,t){if(t===`registry:ui`)return e.resolvedPaths.ui;if(t===`registry:lib`)return e.resolvedPaths.lib;if(t===`registry:hook`)return e.resolvedPaths.hooks;if(t===`registry:file`||t===`registry:font`||t===`registry:base`)return e.resolvedPaths.cwd;if(t===`registry:style`||t===`registry:theme`)return E.basename(e.resolvedPaths.tailwindCss);if(t===`registry:block`||t===`registry:component`)return e.resolvedPaths.components;if(t===`registry:page`)return e.sveltekit?E.resolve(e.resolvedPaths.cwd,`src`,`routes`):e.resolvedPaths.components;throw Error(`TODO: unhandled item type ${t}`)}function To(e,t,n){if(n.target.startsWith(`~/`))return E.resolve(e.resolvedPaths.cwd,n.target.replace(`~/`,``));if(t.name===`utils`){let t=e.resolvedPaths.utils;return t.match(/.*\.(ts|js)$/)?t:`${t}.ts`}let r;return r=n.type===`registry:file`?wo(e,t.type):wo(e,n.type),E.resolve(r,n.target)}var Eo=e(t(((e,t)=>{var n=function(e){return r(e)&&!i(e)};function r(e){return!!e&&typeof e==`object`}function i(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||o(e)}var a=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function o(e){return e.$$typeof===a}function s(e){return Array.isArray(e)?[]:{}}function c(e,t){return t.clone!==!1&&t.isMergeableObject(e)?g(s(e),e,t):e}function l(e,t,n){return e.concat(t).map(function(e){return c(e,n)})}function u(e,t){if(!t.customMerge)return g;var n=t.customMerge(e);return typeof n==`function`?n:g}function d(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function f(e){return Object.keys(e).concat(d(e))}function p(e,t){try{return t in e}catch{return!1}}function m(e,t){return p(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function h(e,t,n){var r={};return n.isMergeableObject(e)&&f(e).forEach(function(t){r[t]=c(e[t],n)}),f(t).forEach(function(i){m(e,i)||(p(e,i)&&n.isMergeableObject(t[i])?r[i]=u(i,n)(e[i],t[i],n):r[i]=c(t[i],n))}),r}function g(e,t,r){r||={},r.arrayMerge=r.arrayMerge||l,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=c;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):c(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return g(e,n,t)},{})},t.exports=g}))(),1);const Do=`.dark`,Oo=`:root`;function ko(e,t,n={}){let r={overwriteCssVars:n.overwriteCssVars??!0},i=e.nodes?.some(e=>e.type===`atrule`&&(e.name===`import`||e.name===`theme`))??!1;if(i&&t.dark&&Object.keys(t.dark).length>0&&Ao(e),t.light){let n=!1;e.walkRules(e=>{e.selectors.includes(Oo)&&(n=!0,jo(e,t.light,r.overwriteCssVars))}),!n&&i&&Mo(e,Oo,t.light,r.overwriteCssVars)}if(t.dark){let n=!1;e.walkRules(e=>{e.selectors.includes(Do)&&(n=!0,jo(e,t.dark,r.overwriteCssVars))}),!n&&i&&Mo(e,Do,t.dark,r.overwriteCssVars)}t.theme&&i&&No(e,t.theme,r.overwriteCssVars),i&&(t.light||t.dark)&&Po(e,t)}function Ao(e){if(!e.nodes?.find(e=>e.type===`atrule`&&e.name===`custom-variant`)){let t=e.nodes?.filter(e=>e.type===`atrule`&&e.name===`import`),n=j.atRule({name:`custom-variant`,params:`dark (&:is(.dark *))`,raws:{semicolon:!0,before:`
|
|
118
|
+
`}});if(t&&t.length>0){let r=t[t.length-1];e.insertAfter(r,n)}else e.nodes&&e.nodes.length>0?e.insertAfter(e.nodes[0],n):e.append(n);e.insertBefore(n,j.comment({text:`---break---`}))}}function jo(e,t,n){for(let[r,i]of Object.entries(t)){let t=`--${r.replace(/^--/,``)}`;t===`--sidebar-background`&&(t=`--sidebar`);let a=Io(i)?`hsl(${i})`:i,o=j.decl({prop:t,value:a,raws:{semicolon:!0}}),s=e.nodes?.find(e=>e.type===`decl`&&e.prop===t);n?s?s.replaceWith(o):e.append(o):s||e.append(o)}}function Mo(e,t,n,r){let i=j.rule({selector:t,raws:{semicolon:!0,between:` `,before:`
|
|
119
|
+
`}});e.append(i),e.insertBefore(i,j.comment({text:`---break---`})),jo(i,n,r)}function No(e,t,n){let r=Fo(e);for(let[e,i]of Object.entries(t)){let t=`--${e.replace(/^--/,``)}`,a=j.decl({prop:t,value:i,raws:{semicolon:!0}}),o=r.nodes?.find(e=>e.type===`decl`&&e.prop===t);n?o?o.replaceWith(a):r.append(a):o||r.append(a)}}function Po(e,t){let n=Array.from(new Set(Object.keys(t).flatMap(e=>Object.keys(t[e]??{}))));if(n.length===0)return;let r=Fo(e),i=r.nodes?.filter(e=>e.type===`decl`&&e.prop.startsWith(`--`));for(let e of n){let n=Object.values(t).find(t=>t?.[e])?.[e];if(!n)continue;if(e===`radius`){for(let[e,t]of Object.entries({sm:`calc(var(--radius) * 0.6)`,md:`calc(var(--radius) * 0.8)`,lg:`var(--radius)`,xl:`calc(var(--radius) * 1.4)`,"2xl":`calc(var(--radius) * 1.8)`,"3xl":`calc(var(--radius) * 2.2)`,"4xl":`calc(var(--radius) * 2.6)`})){let n=j.decl({prop:`--radius-${e}`,value:t,raws:{semicolon:!0}});r.nodes?.find(e=>e.type===`decl`&&e.prop===n.prop)||r.append(n)}continue}let a=Io(n)||Lo(n)?`--color-${e.replace(/^--/,``)}`:`--${e.replace(/^--/,``)}`;a===`--color-sidebar-background`&&(a=`--color-sidebar`);let o=`var(--${e})`;a===`--color-sidebar`&&(o=`var(--sidebar)`);let s=j.decl({prop:a,value:o,raws:{semicolon:!0}});r.nodes?.find(e=>e.type===`decl`&&e.prop===s.prop)||(i&&i.length>0?r.insertAfter(i[i.length-1],s):r.append(s))}}function Fo(e){let t=e.nodes?.find(e=>e.type===`atrule`&&e.name===`theme`&&(e.params===`inline`||e.params===``));return t||(t=j.atRule({name:`theme`,params:`inline`,raws:{semicolon:!0,between:` `,before:`
|
|
120
|
+
`}}),e.append(t),e.insertBefore(t,j.comment({text:`---break---`}))),t}function Io(e){if(e.startsWith(`hsl`)||e.startsWith(`rgb`)||e.startsWith(`#`)||e.startsWith(`oklch`))return!1;let t=e.split(` `);return t.length===3&&t.slice(1,3).every(e=>e.includes(`%`))}function Lo(e){return e.startsWith(`hsl`)||e.startsWith(`rgb`)||e.startsWith(`#`)||e.startsWith(`oklch`)||e.includes(`--color-`)}function Ro(e,t){let n=[],r,i;e.walkAtRules(e=>{if(e.name===`import`&&(r=e),e.name!==`plugin`)return;let a=e.params.trim();i=e,t.includes(a.replace(/['"]/g,``))&&n.push(a.replace(/['"]/g,``))});for(let a of t)if(!n.includes(a)){let t=j.atRule({name:`plugin`,params:`"${a}"`});i?i.after(t):r?r.after(t):e.prepend(t)}}function zo(e){return`
|
|
121
121
|
`+(e?.replaceAll(`
|
|
122
|
-
`,``)??``)+` `}function
|
|
122
|
+
`,``)??``)+` `}function Bo(e=``){let t=e.trim().replace(/\s+/g,` `),n=t.match(/^(['"])(.+)\1$/);if(n?.[2])return n[2].trim();let r=t.match(/^url\((.*)\)$/i);if(r?.[1]!==void 0){let e=r[1].trim();return`url(${(e.match(/^(['"])(.+)\1$/)?.[2]??e).trim()})`}return t}function Vo(e,t){for(let[n,r]of Object.entries(t))if(n.startsWith(`@`)){let t=n.match(/@([a-zA-Z-]+)\s*(.*)/);if(!t)continue;let[,i,a=``]=t;if(i===`import`){let t=Bo(a);if(!e.nodes?.find(e=>e.type===`atrule`&&e.name===`import`&&Bo(e.params)===t)){let t=j.atRule({name:`import`,params:a,raws:{semicolon:!0}}),n=e.nodes?.filter(e=>e.type===`atrule`&&e.name===`import`);if(n&&n.length>0){let r=n[n.length-1];t.raws.before=`
|
|
123
123
|
`,e.insertAfter(r,t)}else t.raws.before=``,e.prepend(t)}continue}if(i===`plugin`){let t=a;a&&!a.startsWith(`"`)&&!a.startsWith(`'`)&&(t=`"${a}"`);let n=(e=``)=>e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.slice(1,-1):e;if(!e.nodes?.find(e=>e.type!==`atrule`||e.name!==`plugin`?!1:n(e.params)===n(a))){let n=j.atRule({name:`plugin`,params:t,raws:{semicolon:!0,before:`
|
|
124
124
|
`}}),r=e.nodes?.filter(e=>e.type===`atrule`&&e.name===`import`),i=e.nodes?.filter(e=>e.type===`atrule`&&e.name===`plugin`);if(i&&i.length>0){let t=i[i.length-1];e.insertAfter(t,n)}else if(r&&r.length>0){let t=r[r.length-1];e.insertAfter(t,n),e.insertBefore(n,j.comment({text:`---break---`})),e.insertAfter(n,j.comment({text:`---break---`}))}else e.prepend(n),e.insertBefore(n,j.comment({text:`---break---`})),e.insertAfter(n,j.comment({text:`---break---`}))}continue}if(typeof r==`object`&&Object.keys(r).length===0){if(!e.nodes?.find(e=>e.type===`atrule`&&e.name===i&&e.params===a)){let t=j.atRule({name:i,params:a,raws:{semicolon:!0}});e.append(t),e.insertBefore(t,j.comment({text:`---break---`}))}continue}if(i===`keyframes`){let t=e.nodes?.find(e=>e.type===`atrule`&&e.name===`theme`&&e.params===`inline`);t||(t=j.atRule({name:`theme`,params:`inline`,raws:{semicolon:!0,between:` `,before:`
|
|
125
|
-
`}}),e.append(t),e.insertBefore(t,j.comment({text:`---break---`})));let n=t.nodes?.find(e=>e.type===`atrule`&&e.name===`keyframes`&&e.params===a),i;if(n?(i=j.atRule({name:`keyframes`,params:a,raws:{semicolon:!0,between:` `,before:
|
|
126
|
-
`}});if(e.append(t),e.insertBefore(t,j.comment({text:`---break---`})),typeof r==`object`)for(let[e,n]of Object.entries(r))if(typeof n==`string`){let r=j.decl({prop:e,value:n,raws:{semicolon:!0,before:
|
|
127
|
-
`:
|
|
128
|
-
`),r={plugins:[],...t};if(!r.cssVars&&!r.css&&!r.plugins.length)return e;let i
|
|
125
|
+
`}}),e.append(t),e.insertBefore(t,j.comment({text:`---break---`})));let n=t.nodes?.find(e=>e.type===`atrule`&&e.name===`keyframes`&&e.params===a),i;if(n?(i=j.atRule({name:`keyframes`,params:a,raws:{semicolon:!0,between:` `,before:zo(t.raws.before)}}),n.replaceWith(i)):(i=j.atRule({name:`keyframes`,params:a,raws:{semicolon:!0,between:` `,before:zo(t.raws.before)}}),t.append(i)),typeof r==`object`)for(let[e,t]of Object.entries(r))Uo(i,e,t);continue}if(i===`utility`){let t=e.nodes?.find(e=>e.type===`atrule`&&e.name===i&&e.params===a);if(t){if(typeof r==`object`)for(let[e,n]of Object.entries(r))if(typeof n==`string`){let r=t.nodes?.find(t=>t.type===`decl`&&t.prop===e),i=j.decl({prop:e,value:n,raws:{semicolon:!0,before:zo(t.raws.before)}});r?r.replaceWith(i):t.append(i)}else if(e.startsWith(`@`)&&typeof n==`object`&&n&&Object.keys(n).length===0){let n=e.match(/@([a-zA-Z-]+)\s*(.*)/);if(n){let[,e=``,r=``]=n;if(!t.nodes?.find(t=>t.type===`atrule`&&t.name===e&&t.params===r)){let n=j.atRule({name:e,params:r,raws:{semicolon:!0,before:zo(t.raws.before)}});t.append(n)}}}else typeof n==`object`&&Uo(t,e,n)}else{let t=j.atRule({name:i,params:a,raws:{semicolon:!0,between:` `,before:`
|
|
126
|
+
`}});if(e.append(t),e.insertBefore(t,j.comment({text:`---break---`})),typeof r==`object`)for(let[e,n]of Object.entries(r))if(typeof n==`string`){let r=j.decl({prop:e,value:n,raws:{semicolon:!0,before:zo(t.raws.before)}});t.append(r)}else if(e.startsWith(`@`)&&typeof n==`object`&&n&&Object.keys(n).length===0){let n=e.match(/@([a-zA-Z-]+)\s*(.*)/);if(n){let[,e=``,r=``]=n;if(!t.nodes?.find(t=>t.type===`atrule`&&t.name===e&&t.params===r)){let n=j.atRule({name:e,params:r,raws:{semicolon:!0,before:zo(t.raws.before)}});t.append(n)}}}else typeof n==`object`&&Uo(t,e,n)}continue}if(i===`property`){Uo(e,n,r);continue}Ho(e,i,a,r)}else Uo(e,n,r)}function Ho(e,t,n,r){let i=e.nodes?.find(e=>e.type===`atrule`&&e.name===t&&e.params===n);if(!i){let r=e.type===`root`;i=j.atRule({name:t,params:n,raws:{semicolon:!0,between:` `,before:r?`
|
|
127
|
+
`:zo(e.raws.before)}}),e.append(i),e.insertBefore(i,j.comment({text:`---break---`}))}if(typeof r==`object`)for(let[e,t]of Object.entries(r))if(e.startsWith(`@`)){let n=e.match(/@([a-zA-Z-]+)\s*(.*)/);if(n){let[,e=``,r=``]=n;Ho(i,e,r,t)}}else Uo(i,e,t);else if(typeof r==`string`)try{let t=j.parse(`.temp{${r}}`).first;if(t&&t.nodes){let n=j.rule({selector:`temp`,raws:{semicolon:!0,between:` `,before:zo(e.raws.before)}});t.nodes.forEach(e=>{if(e.type===`decl`){let t=e.clone();t.raws.before=zo(n.raws.before),n.append(t)}}),n.nodes?.length&&i.append(n)}}catch(e){throw console.error(`Error parsing at-rule content:`,r,e),e}}function Uo(e,t,n){let r=e.nodes?.find(e=>e.type===`rule`&&e.selector===t);if(r||(r=j.rule({selector:t,raws:{semicolon:!0,between:` `,before:zo(e.raws.before)}}),e.append(r)),typeof n==`object`)for(let[i,a]of Object.entries(n))if(i.startsWith(`@`)&&typeof a==`object`&&a&&Object.keys(a).length===0){let e=i.match(/@([a-zA-Z-]+)\s*(.*)/);if(e){let[,t=``,n=``]=e;if(!r.nodes?.find(e=>e.type===`atrule`&&e.name===t&&e.params===n)){if(t===`apply`){let e=r.nodes?.find(e=>e.type===`atrule`&&e.name===`apply`);if(e){e.params=et(e.params,n);continue}}let e=j.atRule({name:t,params:n,raws:{semicolon:!0,before:zo(r.raws.before)}});r.append(e)}}}else if(typeof a==`string`){let e=j.decl({prop:i,value:a,raws:{semicolon:!0,before:zo(r.raws.before)}}),t=r.nodes?.find(e=>e.type===`decl`&&e.prop===i);t?t.replaceWith(e):r.append(e)}else typeof a==`object`&&Uo(e,i.startsWith(`&`)?t.replace(/^([^:]+)/,`$1${i.substring(1)}`):i,a);else if(typeof n==`string`)try{let e=j.parse(`.temp{${n}}`).first;e&&e.nodes&&e.nodes.forEach(e=>{if(e.type===`decl`){let t=e.clone();t.raws.before=zo(r?.raws.before),r?.append(t)}})}catch(e){throw console.error(`Error parsing rule content:`,t,n,e),e}}function Wo(e,t){let n=e.endsWith(`
|
|
128
|
+
`),r={plugins:[],...t};if(!r.cssVars&&!r.css&&!r.plugins.length)return e;let i=$e(e);r.plugins.length&&Ro(i,r.plugins),r.cssVars&&ko(i,r.cssVars,{overwriteCssVars:r.overwriteCssVars}),r.css&&Vo(i,r.css);let a=i.toString();if(i.nodes&&i.nodes.length>0){let e=i.nodes[i.nodes.length-1];e.type===`atrule`&&!e.nodes&&!a.trimEnd().endsWith(`;`)&&(a=a.trimEnd()+`;`)}return a=a.replace(/\/\* ---break--- \*\//g,``),a=a.replace(/(\n\s*\n)+/g,`
|
|
129
129
|
|
|
130
130
|
`),a=a.trimEnd(),n&&!a.endsWith(`
|
|
131
131
|
`)&&(a+=`
|
|
132
|
-
`),a}function Ho(e){if(e.length===0)return{css:{},cssVars:{},dependencies:[]};let t={},n={},r=[];for(let i of e){let e=i.name.replace(`font-`,``),a=i.dependency??`@fontsource-variable/${e}`;r.push(a),t[`@import "${a}"`]={},n.theme??={},n.theme[i.variable]=i.family}let i=new Map;for(let t of e){let e=t.selector??`html`,n=t.variable.replace(`--`,``);i.has(e)||i.set(e,[]),i.get(e).push(n)}t[`@layer base`]??={};for(let[e,n]of Array.from(i.entries())){let r=n.join(` `);t[`@layer base`][e]??={};let i=Object.keys(t[`@layer base`][e]).find(e=>e.startsWith(`@apply `));i?(delete t[`@layer base`][e][i],t[`@layer base`][e][`${i} ${r}`]={}):t[`@layer base`][e][`@apply ${r}`]={}}return{css:t,cssVars:n,dependencies:r}}const Uo=[`registry:style`,`registry:theme`];async function Wo(e){let t=new Set,n=new Set,i=new Set,a=new Set(e.selectedItems),o=[],s=e.config.resolvedPaths.cwd,c=ho(e.config),l=[],u={},d={},f=await bo({baseUrl:c,items:await yo({registryUrl:c,registryIndex:await _o(c),items:Array.from(a)})});f.length===0&&B(`Selected items not found.`);let p=[];for(let t of f){a.add(t.name);for(let e of t.registryDependencies??[])a.add(e);t.files?.some(n=>O(Co(e.config,t,n)))&&p.push(t.name)}if(e.overwrite===!1&&p.length>0){let t=eo(p);z.warn(`The following items ${M.default.bold(M.default.yellow(`already exist`))}:\n${M.default.gray(t)}`);let n=await Na({message:`Would you like to ${M.default.bold(M.default.red(`overwrite`))} all existing files?`,active:`Yes, overwrite everything`,inactive:`No, let me decide individually`,initialValue:!1});I(n)&&B(),e.overwrite=n}for(let c of f){if(!Uo.includes(c.type)){let t=So(e.config,c.type);O(t)||await k.mkdir(t,{recursive:!0});let n=E.relative(s,E.resolve(t,c.name));if(!e.overwrite&&p.includes(c.name)&&a.has(c.name)){z.warn(`Item ${P(c.name)} already exists at ${M.default.gray(n)}`);let e=await Na({message:`Would you like to ${M.default.bold(M.default.red(`overwrite`))} your existing ${P(c.name)} ${c.type}?`});if(I(e)&&B(),e===!1)continue}}e.deps?(c.dependencies?.forEach(e=>t.add(e)),c.devDependencies?.forEach(e=>n.add(e))):(c.dependencies?.forEach(e=>i.add(e)),c.devDependencies?.forEach(e=>i.add(e))),c.type===`registry:font`&&l.push({name:c.name,...c.font}),o.push({title:c.name===`init`?`Setting up shadcn-svelte base configuration`:`Adding ${P(c.name)}`,async task(){for(let i of c.files??[]){let a=Co(e.config,c,i),{content:o,dependencies:s,devDependencies:l,filePath:u}=await ve({content:i.content,filePath:a,config:e.config},[ge,v,_e,!e.config.typescript&&r]);s?.forEach(e=>t.add(e)),l?.forEach(e=>n.add(e));let d=E.parse(u).dir;O(d)||await k.mkdir(d,{recursive:!0}),await k.writeFile(u,o,`utf8`)}if(c.cssVars&&(u=(0,wo.default)(u,c.cssVars)),c.css&&(d=(0,wo.default)(d,c.css)),c.name!==`init`){if(Uo.includes(c.type)){let t=E.relative(s,e.config.resolvedPaths.tailwindCss);return`${P(c.name)} installed at ${M.default.gray(t)}`}let t=So(e.config,c.type),n=E.relative(s,E.resolve(t,c.name));return`${P(c.name)} installed at ${M.default.gray(n)}`}}})}await Ya(o);let{css:m,cssVars:h,dependencies:g}=Ho(l);if(d=(0,wo.default)(d,m),u=(0,wo.default)(u,h),g.forEach(e=>n.add(e)),Object.keys(u).length||Object.keys(d).length){let t=e.config.resolvedPaths.tailwindCss,n=E.relative(s,t);if(!e.overwrite){let t=await Na({message:`A new ${P(`style`)} is ready to be installed. Existing CSS variables may be ${M.default.bold(M.default.red(`overwritten`))} in ${P(n)}. Continue?`,initialValue:!0});I(t)&&B(),e.overwrite=t}await Ya([{title:`Updating stylesheet`,enabled:e.overwrite,async task(){let e=Vo(await k.readFile(t,`utf8`),{css:d,cssVars:u});return await k.writeFile(t,e,`utf8`),`${P(`Stylesheet`)} updated at ${M.default.dim(n)}`}}])}return{skippedDeps:i,dependencies:t,devDependencies:n}}var Go=t(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Ko=t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),qo=t(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Go(),a=Ko();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Jo=t(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Yo=t(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),Xo=t(((e,t)=>{let n=Ko(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=Go(),{safeRe:a,t:o}=qo(),s=Jo(),{compareIdentifiers:c}=Yo();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),c(this.major,t.major)||c(this.minor,t.minor)||c(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),Zo=t(((e,t)=>{let n=Xo();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),Qo=t(((e,t)=>{let n=Zo();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),$o=t(((e,t)=>{let n=Zo();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),es=t(((e,t)=>{let n=Xo();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),ts=t(((e,t)=>{let n=Zo();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),ns=t(((e,t)=>{let n=Xo();t.exports=(e,t)=>new n(e,t).major})),rs=t(((e,t)=>{let n=Xo();t.exports=(e,t)=>new n(e,t).minor})),is=t(((e,t)=>{let n=Xo();t.exports=(e,t)=>new n(e,t).patch})),as=t(((e,t)=>{let n=Zo();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),os=t(((e,t)=>{let n=Xo();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),ss=t(((e,t)=>{let n=os();t.exports=(e,t,r)=>n(t,e,r)})),cs=t(((e,t)=>{let n=os();t.exports=(e,t)=>n(e,t,!0)})),ls=t(((e,t)=>{let n=Xo();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),us=t(((e,t)=>{let n=ls();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),ds=t(((e,t)=>{let n=ls();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),fs=t(((e,t)=>{let n=os();t.exports=(e,t,r)=>n(e,t,r)>0})),ps=t(((e,t)=>{let n=os();t.exports=(e,t,r)=>n(e,t,r)<0})),ms=t(((e,t)=>{let n=os();t.exports=(e,t,r)=>n(e,t,r)===0})),hs=t(((e,t)=>{let n=os();t.exports=(e,t,r)=>n(e,t,r)!==0})),gs=t(((e,t)=>{let n=os();t.exports=(e,t,r)=>n(e,t,r)>=0})),_s=t(((e,t)=>{let n=os();t.exports=(e,t,r)=>n(e,t,r)<=0})),vs=t(((e,t)=>{let n=ms(),r=hs(),i=fs(),a=gs(),o=ps(),s=_s();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),ys=t(((e,t)=>{let n=Xo(),r=Zo(),{safeRe:i,t:a}=qo();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),bs=t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),xs=t(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,re(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>ne(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ie(this.set[t],e,this.options))return!0;return!1}};let r=new(bs()),i=Jo(),a=Ss(),o=Ko(),s=Xo(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=qo(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=Go(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=te(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ee(e,t)).join(` `)),ee=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},te=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),ne=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),re=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),ie=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Ss=t(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=Jo(),{safeRe:i,t:a}=qo(),o=vs(),s=Ko(),c=Xo(),l=xs()})),Cs=t(((e,t)=>{let n=xs();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),ws=t(((e,t)=>{let n=xs();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Ts=t(((e,t)=>{let n=Xo(),r=xs();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),Es=t(((e,t)=>{let n=Xo(),r=xs();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Ds=t(((e,t)=>{let n=Xo(),r=xs(),i=fs();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),Os=t(((e,t)=>{let n=xs();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),ks=t(((e,t)=>{let n=Xo(),r=Ss(),{ANY:i}=r,a=xs(),o=Cs(),s=fs(),c=ps(),l=_s(),u=gs();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),As=t(((e,t)=>{let n=ks();t.exports=(e,t,r)=>n(e,t,`>`,r)})),js=t(((e,t)=>{let n=ks();t.exports=(e,t,r)=>n(e,t,`<`,r)})),Ms=t(((e,t)=>{let n=xs();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),Ns=t(((e,t)=>{let n=Cs(),r=os();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),Ps=t(((e,t)=>{let n=xs(),r=Ss(),{ANY:i}=r,a=Cs(),o=os(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),V=e(t(((e,t)=>{let n=qo(),r=Go(),i=Xo(),a=Yo();t.exports={parse:Zo(),valid:Qo(),clean:$o(),inc:es(),diff:ts(),major:ns(),minor:rs(),patch:is(),prerelease:as(),compare:os(),rcompare:ss(),compareLoose:cs(),compareBuild:ls(),sort:us(),rsort:ds(),gt:fs(),lt:ps(),eq:ms(),neq:hs(),gte:gs(),lte:_s(),cmp:vs(),coerce:ys(),Comparator:Ss(),Range:xs(),satisfies:Cs(),toComparators:ws(),maxSatisfying:Ts(),minSatisfying:Es(),minVersion:Ds(),validRange:Os(),outside:ks(),gtr:As(),ltr:js(),intersects:Ms(),simplifyRange:Ns(),subset:Ps(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),1);function Fs(e,t){return Ee(e)?e:Oe(t||`.`,e)}function Is(e,t){let{stop:n,cwd:r}=t||{},i=Fs(e,r),a=!n,o,s=[];for(n&&=Fs(n,r);(a||i!==n)&&(s.push(i),i=Te(o=i),i!==o););return s}function Ls(e,t){let n,r;for(n of Is(t&&t.cwd||``,t))if(r=De(n,e),O(r))return r}var Rs=e(t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.{0,2}\/|^\.{1,2}$/,l=/\/$/,u=`node-ignore`;typeof Symbol<`u`&&(u=Symbol.for(`node-ignore`));let d=u,f=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),p=/([0-z])-([0-z])/g,m=()=>!1,h=e=>e.replace(p,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),g=e=>{let{length:t}=e;return e.slice(0,t-t%2)},_=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${g(r)}${i}`:i===`]`&&r.length%2==0?`[${h(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],v=/(^|\\\/)?\\\*$/,y=`regex`,b=`checkRegex`,x={[y](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[b](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},S=e=>_.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),C=e=>typeof e==`string`,w=e=>e&&C(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,ee=e=>e.split(s).filter(Boolean);var te=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,f(this,`body`,n),f(this,`ignoreCase`,r),f(this,`regexPrefix`,a)}get regex(){let e=`_`+y;return this[e]?this[e]:this._make(y,e)}get checkRegex(){let e=`_`+b;return this[e]?this[e]:this._make(b,e)}_make(e,t){let n=this.regexPrefix.replace(v,x[e]),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return f(this,t,r)}};let ne=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(a,`!`).replace(o,`#`);let s=S(i);return new te(e,t,i,n,r,s)};var re=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[d]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(C(e)&&(e={pattern:e}),w(e.pattern)){let t=ne(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(C(e)?ee(e):e).forEach(this._add,this),this._added}test(e,t,n){let r=!1,i=!1,a;this._rules.forEach(o=>{let{negative:s}=o;i===s&&r!==i||s&&!r&&!i&&!t||o[n].test(e)&&(r=!s,i=s,a=s?void 0:o)});let o={ignored:r,unignored:i};return a&&(o.rule=a),o}};let ie=(e,t)=>{throw new t(e)},ae=(e,t,n)=>C(e)?e?ae.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),oe=e=>c.test(e);ae.isNotRelative=oe,ae.convert=e=>e;var se=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){f(this,d,!0),this._rules=new re(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){let i=e&&ae.convert(e);return ae(i,e,this._strictPathCheck?ie:m),this._t(i,t,n,r)}checkIgnore(e){if(!l.test(e))return this.test(e);let t=e.split(`/`).filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join(`/`)+`/`,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,b)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`).filter(Boolean),r.pop(),!r.length)return t[e]=this._rules.test(e,n,y);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._rules.test(e,n,y)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let ce=e=>new se(e),le=e=>ae(e&&ae.convert(e),e,m),ue=()=>{ae.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;ae.isNotRelative=t=>e.test(t)||oe(t)};typeof process<`u`&&process.platform===`win32`&&ue(),t.exports=ce,ce.default=ce,t.exports.isPathValid=le,f(t.exports,Symbol.for(`setupWindows`),ue)}))(),1);const zs=[`app.css`,`main.css`,`globals.css`,`global.css`,`layout.css`],Bs=[`node_modules`,`.git`,`.svelte-kit`];function Vs(e,t){let n,r=Hs(e);for(let i of r){let r=E.basename(i);if(zs.includes(r)){n=t?.relative?E.relative(e,i):i;break}}let i=Ws(e),a=i&&t?.relative?E.relative(e,i):i;return{cssPath:n,tsconfigPath:a}}function Hs(e){return Us(e,[])}function Us(e,t){let n=[],r=D.readdirSync(e,{withFileTypes:!0}),i=E.join(e,`.gitignore`);if(D.existsSync(i)){let n=D.readFileSync(i,{encoding:`utf8`}),r=(0,Rs.default)().add(n);t.push({dirPath:e,ig:r})}for(let i of r){let r=E.join(e,i.name);Bs.some(t=>e.includes(t))||t.some(e=>{let t=E.relative(e.dirPath,r);return Rs.default.isPathValid(t)===!1?!1:e.ig.ignores(t)})||(i.isFile()&&n.push(r),i.isDirectory()&&n.push(...Us(r,t)))}return n}function Ws(e){for(let t of[`tsconfig.json`,`jsconfig.json`]){let n=Ls(t,{cwd:e});if(n)return n}}const Gs=Pr.filter(e=>!e.includes(`@`));async function Ks(e,t){let n=(await Vr({cwd:e}))?.agent;if(!n&&t){let e=Gs.map(e=>({value:e,label:e}));e.unshift({label:`None`,value:void 0});let t=await Ka({options:e,initialValue:Rr()??void 0,message:`Which package manager do you want to use?`});return I(t)&&B(),t}return n}async function qs({cwd:e,prompt:t,dependencies:n,devDependencies:r}){let i=await Ks(e,t);if(!i)return;let a=i===`deno`?`npm:`:``,o=Jr(e),s={...o.dependencies,...o.devDependencies},c=e=>{let{name:t,version:n}=Js(e),r=V.default.coerce(s[t]);if(!(r&&V.default.satisfies(r,n,{loose:!0})))return`${a}${t}@${n}`},l=r.map(c).filter(e=>e!==void 0),u=Mr(i,`add`,[`-D`,...l]),d=n.map(c).filter(e=>e!==void 0),f=Mr(i,`add`,d);if(!u||!f)throw h(`Could not detect a package manager in ${e}.`);let p=Za({title:`Installing dependencies with ${i}...`,limit:Math.ceil(process.stdout.rows/2),spacing:0,retainLog:!0}),m=(t,n)=>{let r=Sr(t,n,{throwOnError:!0,nodeOptions:{cwd:e}});return r.process?.stdout?.on(`data`,e=>p.message(e.toString(),{raw:!0})),r.process?.stderr?.on(`data`,e=>p.message(e.toString(),{raw:!0})),r};try{d.length>0&&await m(f.command,f.args),l.length>0&&await m(u.command,u.args),p.success(`Successfully installed dependencies`)}catch{p.error(`Failed to install dependencies`),Fa(`Operation failed.`),process.exit(2)}}function Js(e){let t=e,n=`latest`;if(e.startsWith(`@`)?e.includes(`@`,1)&&([,t,n]=e.split(/(.*)(?:@)(.*)/)):e.includes(`@`,1)&&([t,n]=e.split(`@`)),!t||!n)throw h(`Failed to parse dependency: ${e}`);return{name:t,version:n}}function Ys({cwd:e,config:t,skipPreflight:n}){let r=Rn(e,`svelte`)?.pkg,i=Rn(e,`tailwindcss`)?.pkg,a=Jr(e),o={...a.dependencies,...a.devDependencies},s=Xs({svelte:r?.version??o.svelte,tailwindcss:i?.version??o.tailwindcss},e,t);if(s.ok)return s.config;if(!n)throw s.error;return Ha(`${M.default.red(s.error.message)}\nContinuing with ${M.default.bold(`--skip-preflight`)}.`),s.config}function Xs(e,t,n){if(!e.tailwindcss||!e.svelte)return{ok:!1,config:n,error:h(`This CLI requires Tailwind CSS and Svelte to be installed.
|
|
133
|
-
`)};let r=V.satisfies(V.coerce(e.tailwindcss)??``,`^3.0.0`),i=V.satisfies(V.coerce(e.tailwindcss)??``,`^4.0.0`),a=V.satisfies(V.coerce(e.svelte)??``,`^5.0.0`);return i&&a?(n&&new URL(n.registry).host===`next.shadcn-svelte.com`&&(n.$schema=
|
|
132
|
+
`),a}function Go(e){if(e.length===0)return{css:{},cssVars:{},dependencies:[]};let t={},n={},r=[];for(let i of e){let e=i.name.replace(`font-`,``),a=i.dependency??`@fontsource-variable/${e}`;r.push(a),t[`@import "${a}"`]={},n.theme??={},n.theme[i.variable]=i.family}let i=new Map;for(let t of e){let e=t.selector??`html`,n=t.variable.replace(`--`,``);i.has(e)||i.set(e,[]),i.get(e).push(n)}t[`@layer base`]??={};for(let[e,n]of Array.from(i.entries())){let r=n.join(` `);t[`@layer base`][e]??={};let i=Object.keys(t[`@layer base`][e]).find(e=>e.startsWith(`@apply `));i?(delete t[`@layer base`][e][i],t[`@layer base`][e][`${i} ${r}`]={}):t[`@layer base`][e][`@apply ${r}`]={}}return{css:t,cssVars:n,dependencies:r}}const Ko=[`registry:style`,`registry:theme`];async function qo(e){let t=new Set,n=new Set,i=new Set,a=new Set(e.selectedItems),o=[],s=e.config.resolvedPaths.cwd,c=_o(e.config),l=[],u={},d={},f=await So({baseUrl:c,items:await xo({registryUrl:c,registryIndex:await yo(c),items:Array.from(a)})});f.length===0&&B(`Selected items not found.`);let p=[];for(let t of f){a.add(t.name);for(let e of t.registryDependencies??[])a.add(e);t.files?.some(n=>O(To(e.config,t,n)))&&p.push(t.name)}if(e.overwrite===!1&&p.length>0){let t=no(p);z.warn(`The following items ${M.default.bold(M.default.yellow(`already exist`))}:\n${M.default.gray(t)}`);let n=await Fa({message:`Would you like to ${M.default.bold(M.default.red(`overwrite`))} all existing files?`,active:`Yes, overwrite everything`,inactive:`No, let me decide individually`,initialValue:!1});I(n)&&B(),e.overwrite=n}for(let c of f){if(!Ko.includes(c.type)){let t=wo(e.config,c.type);O(t)||await k.mkdir(t,{recursive:!0});let n=E.relative(s,E.resolve(t,c.name));if(!e.overwrite&&p.includes(c.name)&&a.has(c.name)){z.warn(`Item ${P(c.name)} already exists at ${M.default.gray(n)}`);let e=await Fa({message:`Would you like to ${M.default.bold(M.default.red(`overwrite`))} your existing ${P(c.name)} ${c.type}?`});if(I(e)&&B(),e===!1)continue}}e.deps?(c.dependencies?.forEach(e=>t.add(e)),c.devDependencies?.forEach(e=>n.add(e))):(c.dependencies?.forEach(e=>i.add(e)),c.devDependencies?.forEach(e=>i.add(e))),c.type===`registry:font`&&l.push({name:c.name,...c.font}),o.push({title:c.name===`init`?`Setting up shadcn-svelte base configuration`:`Adding ${P(c.name)}`,async task(){for(let i of c.files??[]){let a=To(e.config,c,i),{content:o,dependencies:s,devDependencies:l,filePath:u}=await be({content:i.content,filePath:a,config:e.config},[ve,v,ye,!e.config.typescript&&r]);s?.forEach(e=>t.add(e)),l?.forEach(e=>n.add(e));let d=E.parse(u).dir;O(d)||await k.mkdir(d,{recursive:!0}),await k.writeFile(u,o,`utf8`)}if(c.cssVars&&(u=(0,Eo.default)(u,c.cssVars)),c.css&&(d=(0,Eo.default)(d,c.css)),c.name!==`init`){if(Ko.includes(c.type)){let t=E.relative(s,e.config.resolvedPaths.tailwindCss);return`${P(c.name)} installed at ${M.default.gray(t)}`}let t=wo(e.config,c.type),n=E.relative(s,E.resolve(t,c.name));return`${P(c.name)} installed at ${M.default.gray(n)}`}}})}await Za(o);let{css:m,cssVars:h,dependencies:g}=Go(l);if(d=(0,Eo.default)(d,m),u=(0,Eo.default)(u,h),g.forEach(e=>n.add(e)),Object.keys(u).length||Object.keys(d).length){let t=e.config.resolvedPaths.tailwindCss,n=E.relative(s,t);if(!e.overwrite){let t=await Fa({message:`A new ${P(`style`)} is ready to be installed. Existing CSS variables may be ${M.default.bold(M.default.red(`overwritten`))} in ${P(n)}. Continue?`,initialValue:!0});I(t)&&B(),e.overwrite=t}await Za([{title:`Updating stylesheet`,enabled:e.overwrite,async task(){let e=Wo(await k.readFile(t,`utf8`),{css:d,cssVars:u});return await k.writeFile(t,e,`utf8`),`${P(`Stylesheet`)} updated at ${M.default.dim(n)}`}}])}return{skippedDeps:i,dependencies:t,devDependencies:n}}var Jo=t(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Yo=t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Xo=t(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Jo(),a=Yo();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Zo=t(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Qo=t(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),$o=t(((e,t)=>{let n=Yo(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=Jo(),{safeRe:a,t:o}=Xo(),s=Zo(),{compareIdentifiers:c}=Qo();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),c(this.major,t.major)||c(this.minor,t.minor)||c(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),es=t(((e,t)=>{let n=$o();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),ts=t(((e,t)=>{let n=es();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),ns=t(((e,t)=>{let n=es();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),rs=t(((e,t)=>{let n=$o();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),is=t(((e,t)=>{let n=es();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),as=t(((e,t)=>{let n=$o();t.exports=(e,t)=>new n(e,t).major})),os=t(((e,t)=>{let n=$o();t.exports=(e,t)=>new n(e,t).minor})),ss=t(((e,t)=>{let n=$o();t.exports=(e,t)=>new n(e,t).patch})),cs=t(((e,t)=>{let n=es();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),ls=t(((e,t)=>{let n=$o();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),us=t(((e,t)=>{let n=ls();t.exports=(e,t,r)=>n(t,e,r)})),ds=t(((e,t)=>{let n=ls();t.exports=(e,t)=>n(e,t,!0)})),fs=t(((e,t)=>{let n=$o();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),ps=t(((e,t)=>{let n=fs();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),ms=t(((e,t)=>{let n=fs();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),hs=t(((e,t)=>{let n=ls();t.exports=(e,t,r)=>n(e,t,r)>0})),gs=t(((e,t)=>{let n=ls();t.exports=(e,t,r)=>n(e,t,r)<0})),_s=t(((e,t)=>{let n=ls();t.exports=(e,t,r)=>n(e,t,r)===0})),vs=t(((e,t)=>{let n=ls();t.exports=(e,t,r)=>n(e,t,r)!==0})),ys=t(((e,t)=>{let n=ls();t.exports=(e,t,r)=>n(e,t,r)>=0})),bs=t(((e,t)=>{let n=ls();t.exports=(e,t,r)=>n(e,t,r)<=0})),xs=t(((e,t)=>{let n=_s(),r=vs(),i=hs(),a=ys(),o=gs(),s=bs();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),Ss=t(((e,t)=>{let n=$o(),r=es(),{safeRe:i,t:a}=Xo();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),Cs=t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),ws=t(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,re(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>ne(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ie(this.set[t],e,this.options))return!0;return!1}};let r=new(Cs()),i=Zo(),a=Ts(),o=Yo(),s=$o(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=Xo(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=Jo(),h=e=>e.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=te(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ee(e,t)).join(` `)),ee=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},te=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),ne=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),re=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),ie=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Ts=t(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=Zo(),{safeRe:i,t:a}=Xo(),o=xs(),s=Yo(),c=$o(),l=ws()})),Es=t(((e,t)=>{let n=ws();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Ds=t(((e,t)=>{let n=ws();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),Os=t(((e,t)=>{let n=$o(),r=ws();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),ks=t(((e,t)=>{let n=$o(),r=ws();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),As=t(((e,t)=>{let n=$o(),r=ws(),i=hs();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),js=t(((e,t)=>{let n=ws();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),Ms=t(((e,t)=>{let n=$o(),r=Ts(),{ANY:i}=r,a=ws(),o=Es(),s=hs(),c=gs(),l=bs(),u=ys();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),Ns=t(((e,t)=>{let n=Ms();t.exports=(e,t,r)=>n(e,t,`>`,r)})),Ps=t(((e,t)=>{let n=Ms();t.exports=(e,t,r)=>n(e,t,`<`,r)})),Fs=t(((e,t)=>{let n=ws();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),Is=t(((e,t)=>{let n=Es(),r=ls();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),Ls=t(((e,t)=>{let n=ws(),r=Ts(),{ANY:i}=r,a=Es(),o=ls(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!a(s.semver,String(e),n))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!a(u.semver,String(e),n))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),V=e(t(((e,t)=>{let n=Xo(),r=Jo(),i=$o(),a=Qo();t.exports={parse:es(),valid:ts(),clean:ns(),inc:rs(),diff:is(),major:as(),minor:os(),patch:ss(),prerelease:cs(),compare:ls(),rcompare:us(),compareLoose:ds(),compareBuild:fs(),sort:ps(),rsort:ms(),gt:hs(),lt:gs(),eq:_s(),neq:vs(),gte:ys(),lte:bs(),cmp:xs(),coerce:Ss(),Comparator:Ts(),Range:ws(),satisfies:Es(),toComparators:Ds(),maxSatisfying:Os(),minSatisfying:ks(),minVersion:As(),validRange:js(),outside:Ms(),gtr:Ns(),ltr:Ps(),intersects:Fs(),simplifyRange:Is(),subset:Ls(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))(),1);function Rs(e,t){return Oe(e)?e:Ae(t||`.`,e)}function zs(e,t){let{stop:n,cwd:r}=t||{},i=Rs(e,r),a=!n,o,s=[];for(n&&=Rs(n,r);(a||i!==n)&&(s.push(i),i=De(o=i),i!==o););return s}function Bs(e,t){let n,r;for(n of zs(t&&t.cwd||``,t))if(r=ke(n,e),O(r))return r}var Vs=e(t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.{0,2}\/|^\.{1,2}$/,l=/\/$/,u=`node-ignore`;typeof Symbol<`u`&&(u=Symbol.for(`node-ignore`));let d=u,f=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),p=/([0-z])-([0-z])/g,m=()=>!1,h=e=>e.replace(p,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),g=e=>{let{length:t}=e;return e.slice(0,t-t%2)},_=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${g(r)}${i}`:i===`]`&&r.length%2==0?`[${h(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],v=/(^|\\\/)?\\\*$/,y=`regex`,b=`checkRegex`,x={[y](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[b](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},S=e=>_.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),C=e=>typeof e==`string`,w=e=>e&&C(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,ee=e=>e.split(s).filter(Boolean);var te=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,f(this,`body`,n),f(this,`ignoreCase`,r),f(this,`regexPrefix`,a)}get regex(){let e=`_`+y;return this[e]?this[e]:this._make(y,e)}get checkRegex(){let e=`_`+b;return this[e]?this[e]:this._make(b,e)}_make(e,t){let n=this.regexPrefix.replace(v,x[e]),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return f(this,t,r)}};let ne=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(a,`!`).replace(o,`#`);let s=S(i);return new te(e,t,i,n,r,s)};var re=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[d]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(C(e)&&(e={pattern:e}),w(e.pattern)){let t=ne(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(C(e)?ee(e):e).forEach(this._add,this),this._added}test(e,t,n){let r=!1,i=!1,a;this._rules.forEach(o=>{let{negative:s}=o;i===s&&r!==i||s&&!r&&!i&&!t||o[n].test(e)&&(r=!s,i=s,a=s?void 0:o)});let o={ignored:r,unignored:i};return a&&(o.rule=a),o}};let ie=(e,t)=>{throw new t(e)},ae=(e,t,n)=>C(e)?e?ae.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),oe=e=>c.test(e);ae.isNotRelative=oe,ae.convert=e=>e;var se=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){f(this,d,!0),this._rules=new re(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){let i=e&&ae.convert(e);return ae(i,e,this._strictPathCheck?ie:m),this._t(i,t,n,r)}checkIgnore(e){if(!l.test(e))return this.test(e);let t=e.split(`/`).filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join(`/`)+`/`,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,b)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`).filter(Boolean),r.pop(),!r.length)return t[e]=this._rules.test(e,n,y);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._rules.test(e,n,y)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let ce=e=>new se(e),le=e=>ae(e&&ae.convert(e),e,m),ue=()=>{ae.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;ae.isNotRelative=t=>e.test(t)||oe(t)};typeof process<`u`&&process.platform===`win32`&&ue(),t.exports=ce,ce.default=ce,t.exports.isPathValid=le,f(t.exports,Symbol.for(`setupWindows`),ue)}))(),1);const Hs=[`app.css`,`main.css`,`globals.css`,`global.css`,`layout.css`],Us=[`node_modules`,`.git`,`.svelte-kit`];function Ws(e,t){let n,r=Gs(e);for(let i of r){let r=E.basename(i);if(Hs.includes(r)){n=t?.relative?E.relative(e,i):i;break}}let i=qs(e),a=i&&t?.relative?E.relative(e,i):i;return{cssPath:n,tsconfigPath:a}}function Gs(e){return Ks(e,[])}function Ks(e,t){let n=[],r=D.readdirSync(e,{withFileTypes:!0}),i=E.join(e,`.gitignore`);if(D.existsSync(i)){let n=D.readFileSync(i,{encoding:`utf8`}),r=(0,Vs.default)().add(n);t.push({dirPath:e,ig:r})}for(let i of r){let r=E.join(e,i.name);Us.some(t=>e.includes(t))||t.some(e=>{let t=E.relative(e.dirPath,r);return Vs.default.isPathValid(t)===!1?!1:e.ig.ignores(t)})||(i.isFile()&&n.push(r),i.isDirectory()&&n.push(...Ks(r,t)))}return n}function qs(e){for(let t of[`tsconfig.json`,`jsconfig.json`]){let n=Bs(t,{cwd:e});if(n)return n}}const Js=Ir.filter(e=>!e.includes(`@`));async function Ys(e,t){let n=(await Ur({cwd:e}))?.agent;if(!n&&t){let e=Js.map(e=>({value:e,label:e}));e.unshift({label:`None`,value:void 0});let t=await Ja({options:e,initialValue:Br()??void 0,message:`Which package manager do you want to use?`});return I(t)&&B(),t}return n}async function Xs({cwd:e,prompt:t,dependencies:n,devDependencies:r}){let i=await Ys(e,t);if(!i)return;let a=i===`deno`?`npm:`:``,o=Xr(e),s={...o.dependencies,...o.devDependencies},c=e=>{let{name:t,version:n}=Zs(e),r=V.default.coerce(s[t]);if(!(r&&V.default.satisfies(r,n,{loose:!0})))return`${a}${t}@${n}`},l=r.map(c).filter(e=>e!==void 0),u=Pr(i,`add`,[`-D`,...l]),d=n.map(c).filter(e=>e!==void 0),f=Pr(i,`add`,d);if(!u||!f)throw h(`Could not detect a package manager in ${e}.`);let p=$a({title:`Installing dependencies with ${i}...`,limit:Math.ceil(process.stdout.rows/2),spacing:0,retainLog:!0}),m=(t,n)=>{let r=wr(t,n,{throwOnError:!0,nodeOptions:{cwd:e}});return r.process?.stdout?.on(`data`,e=>p.message(e.toString(),{raw:!0})),r.process?.stderr?.on(`data`,e=>p.message(e.toString(),{raw:!0})),r};try{d.length>0&&await m(f.command,f.args),l.length>0&&await m(u.command,u.args),p.success(`Successfully installed dependencies`)}catch{p.error(`Failed to install dependencies`),La(`Operation failed.`),process.exit(2)}}function Zs(e){let t=e,n=`latest`;if(e.startsWith(`@`)?e.includes(`@`,1)&&([,t,n]=e.split(/(.*)(?:@)(.*)/)):e.includes(`@`,1)&&([t,n]=e.split(`@`)),!t||!n)throw h(`Failed to parse dependency: ${e}`);return{name:t,version:n}}function Qs({cwd:e,config:t,skipPreflight:n}){let r=Bn(e,`svelte`)?.pkg,i=Bn(e,`tailwindcss`)?.pkg,a=Xr(e),o={...a.dependencies,...a.devDependencies},s=$s({svelte:r?.version??o.svelte,tailwindcss:i?.version??o.tailwindcss},e,t);if(s.ok)return s.config;if(!n)throw s.error;return Wa(`${M.default.red(s.error.message)}\nContinuing with ${M.default.bold(`--skip-preflight`)}.`),s.config}function $s(e,t,n){if(!e.tailwindcss||!e.svelte)return{ok:!1,config:n,error:h(`This CLI requires Tailwind CSS and Svelte to be installed.
|
|
133
|
+
`)};let r=V.satisfies(V.coerce(e.tailwindcss)??``,`^3.0.0`),i=V.satisfies(V.coerce(e.tailwindcss)??``,`^4.0.0`),a=V.satisfies(V.coerce(e.svelte)??``,`^5.0.0`);return i&&a?(n&&new URL(n.registry).host===`next.shadcn-svelte.com`&&(n.$schema=ue.$schema,n.registry=ue.registry,mo(t,n),z.step(`Config file ${P(`components.json`)} updated`)),{ok:!0,config:n}):r&&a?n&&(n.style?(n.registry=`${y}/registry/${n.style}`,mo(t,n),z.step(`Config file ${P(`components.json`)} updated`),{ok:!0,config:n}):{ok:!0,config:n}):{ok:!1,config:n,error:h(`This CLI version requires Tailwind CSS (v3 or v4) and Svelte v5.\n\nIf you are on Svelte v4, use ${P(`shadcn-svelte@0.14 add`)} instead, or consider migrating to Svelte 5: ${b}/docs/migration/svelte-5`)}}const ec=o({components:m().array().optional(),yes:a(),all:a(),overwrite:a(),cwd:m(),deps:a(),proxy:m().optional(),skipPreflight:a()}),tc=new Te().command(`add`).description(`add components to your project`).argument(`[components...]`,`the components to add or a url to the component`).option(`-c, --cwd <path>`,`the working directory`,T.cwd()).option(`--no-deps`,`skips adding & installing package dependencies`).option(`--skip-preflight`,`ignore preflight checks and continue`,!1).option(`-a, --all`,`install all components to your project`,!1).option(`-y, --yes`,`skip confirmation prompt`,!1).option(`-o, --overwrite`,`overwrite existing files`,!1).option(`--proxy <proxy>`,`fetch components from registry using a proxy`,go()).action(async(e,t)=>{try{to();let n=ec.parse({components:e,...t}),r=E.resolve(n.cwd);if(!O(r))throw h(`The path ${M.default.cyan(r)} does not exist. Please try again.`);let i=await ao(r);if(!i)throw new _(`Configuration file is missing. Please run ${M.default.green(`init`)} to create a ${P(`components.json`)} file.`);await nc(r,Qs({config:i,cwd:r,skipPreflight:n.skipPreflight}),n),za(`${M.default.green(`Success!`)} Components added.`)}catch(e){ro(e)}});async function nc(e,t,n){n.proxy!==void 0&&(T.env.HTTP_PROXY=n.proxy,z.info(`You are using the provided proxy: ${M.default.green(n.proxy)}`));let r=(await yo(_o(t))).filter(e=>e.type===`registry:ui`),i=new Set(n.all?r.map(({name:e})=>e):n.components);if(i.size===0){let e=await Va({message:`Which ${P(`components`)} would you like to add?`,maxItems:10,options:r.map(e=>{let t=[...e.registryDependencies??[]];return n.deps&&(t=t.concat(e.dependencies??[]).concat(e.devDependencies??[])),{label:e.name,value:e.name,hint:t.length?`also adds: ${t.join(`, `)}`:void 0}})});I(e)&&B(),i=new Set(e)}else{let e=no(Array.from(i));z.step(`Components to install:\n${M.default.gray(e)}`)}if(n.yes===!1){let e=await Fa({message:`Ready to install ${P(`components`)}${n.deps?` and ${P(`dependencies`)}?`:`?`}`,initialValue:!0});(I(e)||e===!1)&&B()}let a=await qo({config:t,deps:n.deps,overwrite:n.overwrite,selectedItems:Array.from(i)});if(n.deps)await Xs({cwd:e,prompt:n.deps,dependencies:Array.from(a.dependencies),devDependencies:Array.from(a.devDependencies)});else if(a.skippedDeps.size){let e=no([...a.skippedDeps],7);z.warn(`Components have been installed ${M.default.bold(M.default.red(`without`))} the following ${P(`dependencies`)}:\n${M.default.gray(e)}`)}}function rc(e,t){let n=Bn(e,`svelte`)?.pkg,r=Bn(e,`tailwindcss`)?.pkg,i=Xr(e),a={...i.dependencies,...i.devDependencies},o=ic({svelte:n?.version??a.svelte,tailwindcss:r?.version??a.tailwindcss});if(!o.ok){if(!t.skipPreflight)throw o.error;Wa(`${M.default.red(o.error.message)}\nContinuing initialization with ${M.default.bold(`--skip-preflight`)}.`)}}function ic(e){if(!e.tailwindcss||!e.svelte)return{ok:!1,error:h(`This CLI version requires Tailwind CSS v4 and Svelte v5 to initialize a project.
|
|
134
134
|
`)};let t=V.satisfies(V.coerce(e.tailwindcss)||``,`^3.0.0`),n=V.satisfies(V.coerce(e.tailwindcss)||``,`^4.0.0`),r=V.satisfies(V.coerce(e.svelte)||``,`^4.0.0`),i=V.satisfies(V.coerce(e.svelte)||``,`^5.0.0`);return t&&i?{ok:!1,error:h(`Initializing a project with Tailwind v3 is not supported.
|
|
135
135
|
|
|
136
136
|
This CLI version requires Tailwind v4 and Svelte v5 for the ${P(`init`)} command.\n\nYou have two options:\n1. Update Tailwind CSS to v4 and try again.\n2. Use ${P(`shadcn-svelte@1.0.0-next.10`)} that supports initializing projects with Tailwind v3.\n\nReferences:\nTailwind v4 Guide: ${M.default.underline(`${b}/docs/migration/tailwind-v4`)}\nLegacy Tailwind v3 Docs: ${M.default.underline(`${y}/docs`)}\n\n`)}:t&&r?{ok:!1,error:h(`Initializing a project with Tailwind v3 and Svelte v4 is not supported.\n\nThis CLI version requires Tailwind v4 and Svelte v5 for the ${P(`init`)} command.\n\nPlease use ${P(`shadcn-svelte@0.14`)} that supports Tailwind v3 + Svelte v4.\n\n`)}:!n||!i?{ok:!1,error:h(`This CLI version requires Tailwind CSS v4 and Svelte v5 to initialize a project.
|
|
137
|
-
`)}:{ok:!0}}let
|
|
138
|
-
`)){if(/^\s*#/.test(t))continue;let e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,``)}}const hc=We(et.execFile),gc=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await He.access(n,Ue.F_OK),r=!0}catch{}if(!r)return e;let i=mc(await He.readFile(n,{encoding:`utf8`}));return i===void 0?e:(t=i,t=t.endsWith(`/`)?t:`${t}/`,t)}})(),_c=uc?async()=>`${await gc()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:fc;let vc;const yc=async()=>(vc??=(async()=>{try{let e=await _c();return await He.access(e,Ue.X_OK),!0}catch{return!1}})(),vc),bc=async()=>{let e=await _c(),{stdout:t}=await pc(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{powerShellPath:e});return t.trim()},xc=async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await hc(`wslpath`,[`-aw`,e],{encoding:`utf8`});return t.trim()}catch{return e}};function Sc(e,t,n){let r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let e=n();return r(e),e},set(e){r(e)}}),e}const Cc=We(tt);async function wc(){if(T.platform!==`darwin`)throw Error(`macOS only`);let{stdout:e}=await Cc(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??`com.apple.Safari`;return t===`com.apple.safari`?`com.apple.Safari`:t}const Tc=We(tt);async function Ec(e,{humanReadableOutput:t=!0,signal:n}={}){if(T.platform!==`darwin`)throw Error(`macOS only`);let r=t?[]:[`-ss`],i={};n&&(i.signal=n);let{stdout:a}=await Tc(`osascript`,[`-e`,e,r],i);return a.trim()}async function Dc(e){return Ec(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}const Oc=We(tt),kc={MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeBHTML:{name:`Edge Beta`,id:`com.microsoft.edge.beta`},MSEdgeDHTML:{name:`Edge Dev`,id:`com.microsoft.edge.dev`},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},ChromeBHTML:{name:`Chrome Beta`,id:`com.google.chrome.beta`},ChromeDHTML:{name:`Chrome Dev`,id:`com.google.chrome.dev`},ChromiumHTM:{name:`Chromium`,id:`org.chromium.Chromium`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveDHTML:{name:`Brave Dev`,id:`com.brave.Browser.dev`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},OperaStable:{name:`Opera`,id:`com.operasoftware.Opera`},VivaldiHTM:{name:`Vivaldi`,id:`com.vivaldi.Vivaldi`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`}},Ac=new Map(Object.entries(kc));var jc=class extends Error{};async function Mc(e=Oc){let{stdout:t}=await e(`reg`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new jc(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=n.groups,i=r.lastIndexOf(`.`),a=r.lastIndexOf(`-`),o=i===-1?void 0:r.slice(0,i),s=a===-1?void 0:r.slice(0,a);return kc[r]??kc[o]??kc[s]??{name:r,id:r}}const Nc=We(tt),Pc=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase());async function Fc(){if(T.platform===`darwin`){let e=await wc();return{name:await Dc(e),id:e}}if(T.platform===`linux`){let{stdout:e}=await Nc(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:Pc(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(T.platform===`win32`)return Mc();throw Error(`Only macOS, Linux, and Windows are supported`)}var Ic=!!(T.env.SSH_CONNECTION||T.env.SSH_CLIENT||T.env.SSH_TTY);const Lc=Symbol(`fallbackAttempt`),Rc=import.meta.url?E.dirname(Me(import.meta.url)):``,zc=E.join(Rc,`xdg-open`),{platform:Bc,arch:Vc}=T,Hc=async(e,t)=>{if(e.length===0)return;let n=[];for(let r of e)try{return await t(r)}catch(e){n.push(e)}throw AggregateError(n,`Failed to open in all supported apps`)},Uc=async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[Lc]===!0;if(delete e[Lc],Array.isArray(e.app))return Hc(e.app,t=>Uc({...e,app:t,[Lc]:!0}));let{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return Hc(n,t=>Uc({...e,app:{name:t,arguments:r},[Lc]:!0}));if(n===`browser`||n===`browserPrivate`){let t={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`,"com.apple.safari":`safari`},i={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},a;if(uc){let e=await bc();a=Ac.get(e)??{}}else a=await Fc();if(a.id in t){let o=t[a.id.toLowerCase()];if(n===`browserPrivate`){if(o===`safari`)throw Error(`Safari doesn't support opening in private mode via command line`);r.push(i[o])}return Uc({...e,app:{name:qc[o],arguments:r}})}throw Error(`${a.name} is not supported as a default browser`)}let i,a=[],o={},s=!1;if(uc&&!cc()&&!Ic&&!n&&(s=await yc()),Bc===`darwin`)i=`open`,e.wait&&a.push(`--wait-apps`),e.background&&a.push(`--background`),e.newInstance&&a.push(`--new`),n&&a.push(`-a`,n);else if(Bc===`win32`||s){i=await _c(),a.push(...pc.argumentsPrefix),uc||(o.windowsVerbatimArguments=!0),uc&&e.target&&(e.target=await xc(e.target));let t=[`$ProgressPreference = 'SilentlyContinue';`,`Start`];e.wait&&t.push(`-Wait`),n?(t.push(pc.escapeArgument(n)),e.target&&r.push(e.target)):e.target&&t.push(pc.escapeArgument(e.target)),r.length>0&&(r=r.map(e=>pc.escapeArgument(e)),t.push(`-ArgumentList`,r.join(`,`))),e.target=pc.encodeCommand(t.join(` `)),e.wait||(o.stdio=`ignore`)}else{if(n)i=n;else{let e=!Rc||Rc===`/`,t=!1;try{await He.access(zc,Ue.X_OK),t=!0}catch{}i=T.versions.electron??(Bc===`android`||e||!t)?`xdg-open`:zc}r.length>0&&a.push(...r),e.wait||(o.stdio=`ignore`,o.detached=!0)}Bc===`darwin`&&r.length>0&&a.push(`--args`,...r),e.target&&a.push(e.target);let c=et.spawn(i,a,o);return e.wait?new Promise((t,n)=>{c.once(`error`,n),c.once(`close`,r=>{if(!e.allowNonzeroExitCode&&r!==0){n(Error(`Exited with code ${r}`));return}t(c)})}):t?new Promise((e,t)=>{c.once(`error`,t),c.once(`spawn`,()=>{c.once(`close`,n=>{if(c.off(`error`,t),n!==0){t(Error(`Exited with code ${n}`));return}c.unref(),e(c)})})}):(c.unref(),new Promise((e,t)=>{c.once(`error`,t),c.once(`spawn`,()=>{c.off(`error`,t),e(c)})}))},Wc=(e,t)=>{if(typeof e!=`string`)throw TypeError("Expected a `target`");return Uc({...t,target:e})};function Gc(e){if(typeof e==`string`||Array.isArray(e))return e;let{[Vc]:t}=e;if(!t)throw Error(`${Vc} is not supported`);return t}function Kc({[Bc]:e},{wsl:t}={}){if(t&&uc)return Gc(t);if(!e)throw Error(`${Bc} is not supported`);return Gc(e)}const qc={browser:`browser`,browserPrivate:`browserPrivate`};Sc(qc,`chrome`,()=>Kc({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`,`chromium-browser`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),Sc(qc,`brave`,()=>Kc({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),Sc(qc,`firefox`,()=>Kc({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),Sc(qc,`edge`,()=>Kc({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),Sc(qc,`safari`,()=>Kc({darwin:`Safari`}));var Jc=Wc;const Yc={nova:{title:`Nova`,description:`Lucide / Geist`,hint:`Reduced spacing for compact layouts.`,style:`nova`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`lucide`,font:`geist`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},vega:{title:`Vega`,description:`Lucide / Inter`,hint:`The classic shadcn/ui look.`,style:`vega`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`lucide`,font:`inter`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},maia:{title:`Maia`,description:`Hugeicons / Figtree`,hint:`Soft and rounded, with generous spacing.`,style:`maia`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`hugeicons`,font:`figtree`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},lyra:{title:`Lyra`,description:`Phosphor / JetBrains Mono`,hint:`Boxy and sharp. Pairs well with mono fonts.`,style:`lyra`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`phosphor`,font:`jetbrains-mono`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},mira:{title:`Mira`,description:`Hugeicons / Inter`,hint:`Compact. Made for dense interfaces.`,style:`mira`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`hugeicons`,font:`inter`,menuAccent:`subtle`,menuColor:`default`,radius:`default`}};async function Xc(e){let t=await Ka({message:`You didn't provide a preset for the design system, how would you like to continue?`,initialValue:e?.style===void 0?`presets`:`prompt`,options:Object.entries(Zc).map(([e,t])=>({label:t.label,value:e}))});return I(t)&&B(),await Zc[t].select(e)}const Zc={presets:{label:`Choose from a list of pre-configured presets`,select:e=>$c(e)},customize:{label:`Create my own preset at ${M.default.bold(`shadcn-svelte.com/create`)}`,select:e=>Qc(e)},prompt:{label:`Prompt me for the preset`,select:e=>el(e)}};async function Qc(e){let t=go(e??ce),n=new URL(`/create`,t).toString(),r=Wa();r.start(`Opening ${M.default.bold(n)} in your browser`),await Jc(n),r.stop(`Opened ${M.default.bold(n)} in your browser`);let i=e=>(e.startsWith(`--preset `)&&(e=e.slice(9)),e),a=await Qa({message:`When you're done, paste the code back here and we'll use it to configure your project.`,placeholder:"Click on the `--preset <code>` button and paste the code here",validate:e=>{if(!ae(i(e??``)))return`Invalid preset code`}});return I(a)&&B(),ee(i(a))}async function $c(e){let t=await Ka({message:`Choose from a list of pre-configured presets`,initialValue:e?.style??`vega`,options:c(Yc).map(([e,t])=>({label:`${t.title} - ${t.description}`,value:e,hint:t.hint}))});return I(t)&&B(),Yc[t]}async function el(e){let t=await Pa({style:()=>Ka({message:`Choose a style`,initialValue:e?.style??ce.style,options:c(Yc).map(([e,t])=>({label:t.title,value:e,hint:t.hint}))}),radius:()=>Ka({message:`Choose a radius`,initialValue:`default`,options:c(w).map(([e,t])=>({label:`${t.label} ${t.value}`,value:e}))}),baseColor:()=>Ka({message:`Choose a base color`,initialValue:e?.tailwind.baseColor??ce.tailwind.baseColor,options:c(ne).map(([e,t])=>({label:`${En(t.color)(`■`)} ${t.name}`,value:e}))}),theme:({results:e})=>Ka({message:`Choose a theme`,initialValue:e.baseColor,options:c(ie).map(([e,t])=>({label:`${En(t.color)(`■`)} ${t.name}`,value:e}))}),iconLibrary:()=>Ka({message:`Choose an icon library`,initialValue:e?.iconLibrary??ce.iconLibrary,options:c(f).map(([e,t])=>({label:t.title,value:t.name,hint:t.packages.join(`, `)}))}),font:()=>Ka({message:`Choose a font`,initialValue:`inter`,options:te.map(e=>({label:s(e),value:e}))})},{onCancel:()=>B()});return{style:t.style,baseColor:t.baseColor,theme:t.theme,iconLibrary:t.iconLibrary,font:t.font,radius:t.radius,menuColor:e?.menuColor??ce.menuColor,menuAccent:e?.menuAccent??ce.menuAccent}}const tl=vo(),nl=o({cwd:m(),baseColor:m().optional(),preset:m().optional(),css:m().optional(),componentsAlias:m().optional(),utilsAlias:m().optional(),libAlias:m().optional(),hooksAlias:m().optional(),uiAlias:m().optional(),deps:a(),overwrite:a(),proxy:m().optional(),skipPreflight:a()}),rl=new Ce().command(`init`).description(`initialize your project and install dependencies`).option(`--preset <preset>`,`the preset to use`).option(`-c, --cwd <path>`,`the working directory`,T.cwd()).option(`-o, --overwrite`,`overwrite existing files`,!1).option(`--no-deps`,`disable adding & installing dependencies`).option(`--skip-preflight`,`ignore preflight checks and continue`,!1).addOption(new we(`--base-color <name>`,`the base color for the components`).choices(tl.map(e=>e.name))).addOption(new we(`--design-system-url`)).option(`--css <path>`,`path to the global CSS file`).option(`--components-alias <path>`,`import alias for components`).option(`--lib-alias <path>`,`import alias for lib`).option(`--utils-alias <path>`,`import alias for utils`).option(`--hooks-alias <path>`,`import alias for hooks`).option(`--ui-alias <path>`,`import alias for ui`).option(`--proxy <proxy>`,`fetch items from registry using a proxy`,mo()).action(async e=>{$a();let t=nl.parse(e),n=E.resolve(t.cwd);try{if(!O(n))throw h(`The path ${M.default.cyan(n)} does not exist. Please try again.`);let e=null;t.preset!==void 0&&(e=ee(t.preset),e===null&&z.warn(`${M.default.dim(`--preset ${t.preset}`)} is not a valid preset.`)),ec(n,{skipPreflight:t.skipPreflight});let r=ao(n);r&&=Ys({cwd:n,config:r,skipPreflight:t.skipPreflight});let{resolvedConfig:i,decidedPresets:a,styleChanged:o}=await al({cwd:n,presetConfig:e,existingConfig:r,options:t});await ol({cwd:n,config:i,decidedPresets:a,options:t,styleChanged:o}),La(`${M.default.green(`Success!`)} Project initialization completed.`)}catch(e){to(e)}});function il(e,t,n){if(t.css&&!O(E.resolve(e,t.css)))throw h(`The provided global CSS file path ${M.default.cyan(t.css)} does not exist. Please enter a valid path.`);for(let[r,i]of Object.entries(t)){if(!r.endsWith(`Alias`))continue;let t=co({cwd:e,importPath:i,tsconfig:n});if(t)throw h(t)}}async function al({cwd:e,presetConfig:t,existingConfig:n,options:r}){let i=n??structuredClone(ce);await Kr(e);let{cssPath:a,tsconfigPath:o}=Vs(e,{relative:!0}),s;if(n)s=po(e,n);else{if(o)i.typescript=o.includes(`tsconfig`);else{let t=await Qa({message:`Where is your ${P(`tsconfig/jsconfig`)} file?`,placeholder:`tsconfig.json`,validate:t=>{let n=E.resolve(e,t??``);if(!(t&&O(n)))return`"${M.default.bold(t)}" does not exist. Please enter a valid path.`}});I(t)&&B(),i.typescript={config:t}}s=po(e,i)}il(e,r,s);let c=t??await Xc(n),l=r.css;if(l===void 0){let t=ce.tailwind.css,r=await Qa({message:`Where is your ${P(`global CSS`)} file? ${M.default.gray(`(this file will be overwritten)`)}`,initialValue:n?.tailwind.css??a??t,placeholder:a??t,validate:t=>{if(!(t&&O(E.resolve(e,t))))return`"${M.default.bold(t)}" does not exist. Please enter a valid path.`}});I(r)&&B(),l=r}let{utilsAlias:u,libAlias:d,componentAlias:f,hooksAlias:p,uiAlias:m}=await lo({...r,tsconfig:s,cwd:e,existingConfig:n}),h=oo({...i,tailwind:{css:l,baseColor:c.baseColor},aliases:{utils:u,lib:d,components:f,hooks:p,ui:m},style:c.style,iconLibrary:c.iconLibrary,menuColor:c.menuColor,menuAccent:c.menuAccent}),g;return g=n?n.style!==c.style||n.menuColor!==c.menuColor||n.menuAccent!==c.menuAccent:!1,{resolvedConfig:await io(e,h),decidedPresets:c,styleChanged:g}}async function ol({cwd:e,config:t,decidedPresets:n,options:r,styleChanged:i}){r.proxy!==void 0&&(T.env.HTTP_PROXY=r.proxy,z.info(`You are using the provided proxy: ${M.default.green(r.proxy)}`));let a=[];a.push({title:`Creating config file`,async task(){return fo(e,t),`Config file ${P(`components.json`)} created`}}),a.push({title:`Validating alias paths`,async task(){for(let[e,n]of Object.entries(t.resolvedPaths)){let t=E.extname(n)?E.dirname(n):n;e===`utils`&&n.endsWith(`/utils`)&&(t=t.replace(/\/utils$/,``)),!O(t)&&e!==`utils`&&await k.mkdir(t,{recursive:!0})}return`Alias paths validated`}}),await Ya(a);let o=ho(t),s=re(n),c=new URL(`/init?preset=${s}`,o).toString(),l=[],u=r.overwrite;if(i&&(l=(await Gr({registryIndex:await _o(o),config:t})).filter(e=>e.name!==`utils`).map(e=>e.name),l.length>0&&!u)){z.warn(`The registry style has changed to ${M.default.bold(M.default.yellow(n.style))}.`);let e=await Na({message:`Would you like to ${M.default.bold(M.default.red(`overwrite`))} your existing components?`,initialValue:!0});I(e)&&B(),u=e}let d=await Wo({selectedItems:[c,...l],config:t,deps:r.deps,overwrite:u});if(r.deps)await qs({cwd:e,prompt:r.deps,dependencies:Array.from(d.dependencies),devDependencies:Array.from(d.devDependencies)});else if(d.skippedDeps.size){let e=eo([...d.skippedDeps],7);z.warn(`shadcn-svelte has been initialized ${M.default.bold(M.default.red(`without`))} the following ${P(`dependencies`)}:\n${M.default.gray(e)}`)}}const sl=o({all:a(),components:m().array().optional(),cwd:m(),proxy:m().optional(),yes:a(),skipPreflight:a(),deps:a()}),cl=new Ce().command(`update`,{hidden:!0}).description(`update components in your project`).argument(`[components...]`,`name of components`).option(`-c, --cwd <path>`,`the working directory`,T.cwd()).option(`--skip-preflight`,`ignore preflight checks and continue`,!1).option(`--no-deps`,`skips adding & installing package dependencies`).option(`-a, --all`,`update all existing components`,!1).option(`-y, --yes`,`skip confirmation prompt`,!1).option(`--proxy <proxy>`,`fetch components from registry using a proxy`,mo()).action(async(e,t)=>{$a();try{let n=sl.parse({components:e,...t}),r=E.resolve(n.cwd);if(!O(r))throw h(`The path ${M.default.cyan(r)} does not exist. Please try again.`);let i=await ro(r);if(!i)throw h(`Configuration file is missing. Please run ${M.default.green(`init`)} to create a ${P(`components.json`)} file.`);await ll(r,Ys({config:i,cwd:r,skipPreflight:n.skipPreflight}),n),La(`${M.default.green(`Success!`)} Component update completed.`)}catch(e){to(e)}});async function ll(e,t,n){n.proxy!==void 0&&(T.env.HTTP_PROXY=n.proxy,z.info(`You are using the provided proxy: ${M.default.green(n.proxy)}`));let i=n.components,a=ho(t),o=await _o(a),s=await Gr({registryIndex:o,config:t}),c=n.all?s:[];if(c.length===0&&i!==void 0&&(c=s.filter(e=>i.includes(e.name))),c.length===0){let e=await za({message:`Which components would you like to update?`,maxItems:10,options:s.map(e=>({label:e.name,value:e,hint:e.registryDependencies?.length?`also updates: ${e.registryDependencies.join(`, `)}`:void 0}))});I(e)&&B(),c=e}else{let e=eo(c.map(({name:e})=>e));z.step(`Components to update:\n${M.default.gray(e)}`)}if(n.yes===!1){let e=await Na({message:`Ready to update ${P(`components`)}? ${M.default.gray(`(Make sure you have committed your changes before proceeding!)`)}`,initialValue:!0});(I(e)||e===!1)&&B()}let l=[],u=await bo({baseUrl:a,items:await yo({registryUrl:a,registryIndex:o,items:c.map(e=>e.name)})});u.sort((e,t)=>e.name.localeCompare(t.name));let d={},f=new Set,p=new Set,m=[],h={},g={};for(let e of u){let i=So(t,e.type);e.dependencies?.forEach(e=>f.add(e)),e.devDependencies?.forEach(e=>p.add(e)),e.type===`registry:font`&&m.push({name:e.name,...e.font}),l.push({title:`Updating ${P(e.name)}`,async task(){for(let n of e.files??[]){let i=Co(t,e,n),{content:a,dependencies:o,devDependencies:s,filePath:c}=await ve({content:n.content,filePath:i,config:t},[ge,v,_e,!t.typescript&&r]);o?.forEach(e=>f.add(e)),s?.forEach(e=>p.add(e));let l=E.parse(c).dir;O(l)||await k.mkdir(l,{recursive:!0}),await k.writeFile(c,a,`utf8`)}e.css&&(g=(0,wo.default)(g,e.css)),e.cssVars&&(h=(0,wo.default)(h,e.cssVars));let a=E.resolve(i,e.name);if(e.files&&e.files?.length>1){let n=e.files.map(n=>{let r=Co(t,e,n);return!t.typescript&&r.endsWith(`.ts`)?r.replace(`.ts`,`.js`):r}),r=(await k.readdir(a,{withFileTypes:!0})).map(e=>E.resolve(e.parentPath,e.name)).filter(e=>!n.includes(e));r.length>0&&(d[e.name]=r)}let o=E.relative(n.cwd,a);return`${P(e.name)} updated at ${M.default.gray(o)}`}})}let{css:_,cssVars:y,dependencies:b}=Ho(m);if(g=(0,wo.default)(g,_),h=(0,wo.default)(h,y),b.forEach(e=>p.add(e)),(Object.keys(h).length>0||Object.keys(g).length>0)&&l.push({title:`Updating stylesheet`,async task(){let n=t.resolvedPaths.tailwindCss,r=Vo(await k.readFile(n,`utf8`),{css:g,cssVars:h});await k.writeFile(n,r,`utf8`);let i=E.relative(e,n);return`${P(`Stylesheet`)} updated at ${M.default.dim(i)}`}}),await Ya(l),n.deps)await qs({cwd:e,dependencies:Array.from(f),devDependencies:Array.from(p),prompt:!0});else if(f.size>0||p.size>0){let e=eo([...f,...p],7);z.warn(`Components have been updated ${M.default.bold(M.default.red(`without`))} the following ${P(`dependencies`)}:\n${M.default.gray(e)}`)}for(let[t,n]of Object.entries(d))z.warn(`The ${P(t)} component does not use the following files:\n${n.map(t=>M.default.white(`- ${M.default.gray(E.relative(e,t))}`)).join(`
|
|
139
|
-
`)}`);Object.keys(d).length>0&&z.message(M.default.bold(`You may want to delete them.`))}var
|
|
140
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),
|
|
141
|
-
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Ol).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=W.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=e.sourceType===`module`,this.strict=this.inModule||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&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Yl),this.regexpState=null,this.privateNameStack=[]},pu={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};K.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},pu.inFunction.get=function(){return(this.currentVarScope().flags&Xl)>0},pu.inGenerator.get=function(){return(this.currentVarScope().flags&Ql)>0},pu.inAsync.get=function(){return(this.currentVarScope().flags&Zl)>0},pu.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(ru|iu))return!1;if(t&Xl)return(t&Zl)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},pu.allowSuper.get=function(){return(this.currentThisScope().flags&tu)>0||this.options.allowSuperOutsideMethod},pu.allowDirectSuper.get=function(){return(this.currentThisScope().flags&nu)>0},pu.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},pu.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(ru|iu)||t&Xl&&!(t&$l))return!0}return!1},pu.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ru)>0},K.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},K.parse=function(e,t){return new this(t,e).parse()},K.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},K.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(K.prototype,pu);var mu=K.prototype,hu=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;mu.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){G.lastIndex=e,e+=G.exec(this.input)[0].length;var t=hu.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){G.lastIndex=e+t[0].length;var n=G.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||Ol.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,G.lastIndex=e,e+=G.exec(this.input)[0].length,this.input[e]===`;`&&e++}},mu.eat=function(e){return this.type===e?(this.next(),!0):!1},mu.isContextual=function(e){return this.type===W.name&&this.value===e&&!this.containsEsc},mu.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},mu.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},mu.canInsertSemicolon=function(){return this.type===W.eof||this.type===W.braceR||Ol.test(this.input.slice(this.lastTokEnd,this.start))},mu.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},mu.semicolon=function(){!this.eat(W.semi)&&!this.insertSemicolon()&&this.unexpected()},mu.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},mu.expect=function(e){this.eat(e)||this.unexpected()},mu.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var gu=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};mu.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},mu.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},mu.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},mu.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var q=K.prototype;q.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==W.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var _u={kind:`loop`},vu={kind:`switch`};q.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;G.lastIndex=this.pos;var t=G.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(Sl(r,!0)){for(var i=n+1;Cl(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var a=this.input.slice(n,i);if(!vl.test(a))return!0}return!1},q.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;G.lastIndex=this.pos;var e=G.exec(this.input),t=this.pos+e[0].length,n;return!Ol.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(Cl(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},q.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;G.lastIndex=this.pos;var n=G.exec(this.input),r=this.pos+n[0].length;if(Ol.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||Cl(a=this.input.charCodeAt(i))||a>55295&&a<56320)return!1;G.lastIndex=i;var o=G.exec(this.input);if(o&&Ol.test(this.input.slice(i,i+o[0].length)))return!1}if(t){var s=r+2,c;if(this.input.slice(r,s)===`of`&&(s===this.input.length||!Cl(c=this.input.charCodeAt(s))&&!(c>55295&&c<56320)))return!1}var l=this.input.charCodeAt(r);return Sl(l,!0)||l===92},q.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},q.isUsing=function(e){return this.isUsingKeyword(!1,e)},q.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=W._var,a=`let`),r){case W._break:case W._continue:return this.parseBreakContinueStatement(i,r.keyword);case W._debugger:return this.parseDebuggerStatement(i);case W._do:return this.parseDoStatement(i);case W._for:return this.parseForStatement(i);case W._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case W._class:return e&&this.unexpected(),this.parseClass(i,!0);case W._if:return this.parseIfStatement(i);case W._return:return this.parseReturnStatement(i);case W._switch:return this.parseSwitchStatement(i);case W._throw:return this.parseThrowStatement(i);case W._try:return this.parseTryStatement(i);case W._const:case W._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case W._while:return this.parseWhileStatement(i);case W._with:return this.parseWithStatement(i);case W.braceL:return this.parseBlock(!0,i);case W.semi:return this.parseEmptyStatement(i);case W._export:case W._import:if(this.options.ecmaVersion>10&&r===W._import){G.lastIndex=this.pos;var o=G.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===W._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return t&&this.options.sourceType===`script`&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===W.name&&d.type===`Identifier`&&this.eat(W.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},q.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(W.semi)||this.insertSemicolon()?e.label=null:this.type===W.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},q.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},q.parseDoStatement=function(e){return this.next(),this.labels.push(_u),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(W._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(W.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},q.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(_u),this.enterScope(0),this.expect(W.parenL),this.type===W.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===W._var||this.type===W._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&this.next(),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new gu,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===W._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===W._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},q.parseForAfterInit=function(e,t,n){return(this.type===W._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===W._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},q.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,bu|(n?0:xu),!1,t)},q.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(W._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},q.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(W.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},q.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(W.braceL),this.labels.push(vu),this.enterScope(0);for(var t,n=!1;this.type!==W.braceR;)if(this.type===W._case||this.type===W._default){var r=this.type===W._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(W.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},q.parseThrowStatement=function(e){return this.next(),Ol.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var yu=[];q.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?eu:0),this.checkLValPattern(e,t?du:lu),this.expect(W.parenR),e},q.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===W._catch){var t=this.startNode();this.next(),this.eat(W.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(W._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},q.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},q.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(_u),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},q.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},q.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},q.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===W._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},q.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},q.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(W.braceL),e&&this.enterScope(0);this.type!==W.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},q.parseFor=function(e,t){return e.init=t,this.expect(W.semi),e.test=this.type===W.semi?null:this.parseExpression(),this.expect(W.semi),e.update=this.type===W.parenR?null:this.parseExpression(),this.expect(W.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},q.parseForIn=function(e,t){var n=this.type===W._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(W.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},q.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(W.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===W._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==W._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&!(t&&(this.type===W._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(W.comma))break}return e},q.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?cu:lu,!1)};var bu=1,xu=2,Su=4;q.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===W.star&&t&xu&&this.unexpected(),e.generator=this.eat(W.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&bu&&(e.id=t&Su&&this.type!==W.name?null:this.parseIdent(),e.id&&!(t&xu)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?cu:lu:uu));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ou(e.async,e.generator)),t&bu||(e.id=this.type===W.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&bu?`FunctionDeclaration`:`FunctionExpression`)},q.parseFunctionParams=function(e){this.expect(W.parenL),e.params=this.parseBindingList(W.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},q.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(W.braceL);this.type!==W.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Cu(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},q.parseClassElement=function(e){if(this.eat(W.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(W.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===W.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===W.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(W.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===W.parenL||o!==`method`||i||a){var l=!n.static&&wu(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},q.isClassElementNameStart=function(){return this.type===W.name||this.type===W.privateId||this.type===W.num||this.type===W.string||this.type===W.bracketL||this.type.keyword},q.parseClassElementName=function(e){this.type===W.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},q.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&wu(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},q.parseClassField=function(e){return wu(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&wu(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(W.eq)?(this.enterScope(iu|tu),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},q.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ru|tu);this.type!==W.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},q.parseClassId=function(e,t){this.type===W.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,lu,!1)):(t===!0&&this.unexpected(),e.id=null)},q.parseClassSuper=function(e){e.superClass=this.eat(W._extends)?this.parseExprSubscripts(null,!1):null},q.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},q.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];Il(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Cu(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function wu(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}q.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==W.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},q.parseExport=function(e,t){if(this.next(),this.eat(W.star))return this.parseExportAllDeclaration(e,t);if(this.eat(W._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==W.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},q.parseExportDeclaration=function(e){return this.parseStatement(null)},q.parseExportDefaultDeclaration=function(){var e;if(this.type===W._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,bu|Su,!1,e)}else if(this.type===W._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},q.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),Il(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},q.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},q.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},q.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},q.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},q.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(W.braceL);!this.eat(W.braceR);){if(n)n=!1;else if(this.expect(W.comma),this.afterTrailingComma(W.braceR))break;t.push(this.parseExportSpecifier(e))}return t},q.parseImport=function(e){return this.next(),this.type===W.string?(e.specifiers=yu,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===W.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},q.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,lu),this.finishNode(e,`ImportSpecifier`)},q.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,lu),this.finishNode(e,`ImportDefaultSpecifier`)},q.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,lu),this.finishNode(e,`ImportNamespaceSpecifier`)},q.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===W.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(W.comma)))return e;if(this.type===W.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(W.braceL);!this.eat(W.braceR);){if(t)t=!1;else if(this.expect(W.comma),this.afterTrailingComma(W.braceR))break;e.push(this.parseImportSpecifier())}return e},q.parseWithClause=function(){var e=[];if(!this.eat(W._with))return e;this.expect(W.braceL);for(var t={},n=!0;!this.eat(W.braceR);){if(n)n=!1;else if(this.expect(W.comma),this.afterTrailingComma(W.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;Il(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},q.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===W.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(W.colon),this.type!==W.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},q.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===W.string){var e=this.parseLiteral(this.value);return Vl.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},q.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},q.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Tu=K.prototype;Tu.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Tu.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Tu.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Tu.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==W.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Tu.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case W.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(W.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case W.braceL:return this.parseObj(!0)}return this.parseIdent()},Tu.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(W.comma),t&&this.type===W.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===W.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===W.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Tu.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Tu.parseBindingListItem=function(e){return e},Tu.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(W.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Tu.checkLValSimple=function(e,t,n){t===void 0&&(t=su);var r=t!==su;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===lu&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(Il(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==fu&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Tu.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=su),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Tu.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=su),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Eu=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},J={b_stat:new Eu(`{`,!1),b_expr:new Eu(`{`,!0),b_tmpl:new Eu("${",!1),p_stat:new Eu(`(`,!1),p_expr:new Eu(`(`,!0),q_tmpl:new Eu("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Eu(`function`,!1),f_expr:new Eu(`function`,!0),f_expr_gen:new Eu(`function`,!0,!1,null,!0),f_gen:new Eu(`function`,!1,!1,null,!0)},Du=K.prototype;Du.initialContext=function(){return[J.b_stat]},Du.curContext=function(){return this.context[this.context.length-1]},Du.braceIsBlock=function(e){var t=this.curContext();return t===J.f_expr||t===J.f_stat?!0:e===W.colon&&(t===J.b_stat||t===J.b_expr)?!t.isExpr:e===W._return||e===W.name&&this.exprAllowed?Ol.test(this.input.slice(this.lastTokEnd,this.start)):e===W._else||e===W.semi||e===W.eof||e===W.parenR||e===W.arrow?!0:e===W.braceL?t===J.b_stat:e===W._var||e===W._const||e===W.name?!1:!this.exprAllowed},Du.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Du.updateContext=function(e){var t,n=this.type;n.keyword&&e===W.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Du.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},W.parenR.updateContext=W.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===J.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},W.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?J.b_stat:J.b_expr),this.exprAllowed=!0},W.dollarBraceL.updateContext=function(){this.context.push(J.b_tmpl),this.exprAllowed=!0},W.parenL.updateContext=function(e){var t=e===W._if||e===W._for||e===W._with||e===W._while;this.context.push(t?J.p_stat:J.p_expr),this.exprAllowed=!0},W.incDec.updateContext=function(){},W._function.updateContext=W._class.updateContext=function(e){e.beforeExpr&&e!==W._else&&!(e===W.semi&&this.curContext()!==J.p_stat)&&!(e===W._return&&Ol.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===W.colon||e===W.braceL)&&this.curContext()===J.b_stat)?this.context.push(J.f_expr):this.context.push(J.f_stat),this.exprAllowed=!1},W.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},W.backQuote.updateContext=function(){this.curContext()===J.q_tmpl?this.context.pop():this.context.push(J.q_tmpl),this.exprAllowed=!1},W.star.updateContext=function(e){if(e===W._function){var t=this.context.length-1;this.context[t]===J.f_expr?this.context[t]=J.f_expr_gen:this.context[t]=J.f_gen}this.exprAllowed=!0},W.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==W.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Y=K.prototype;Y.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},Y.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===W.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(W.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},Y.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new gu,r=!0);var s=this.start,c=this.startLoc;(this.type===W.parenL||this.type===W.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===W.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===W.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Y.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(W.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(W.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Y.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Y.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==W._in)&&a>r){var o=this.type===W.logicalOR||this.type===W.logicalAND,s=this.type===W.coalesce;s&&(a=W.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===W.coalesce||s&&(this.type===W.logicalOR||this.type===W.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},Y.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Y.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===W.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&Ou(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&ku(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===W.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==W._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(W.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1);else return o};function Ou(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&Ou(e.expression)}function ku(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&ku(e.expression)||e.type===`ParenthesizedExpression`&&ku(e.expression)}Y.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},Y.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},Y.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(W.arrow)},Y.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Y.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(W.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(W.bracketL);if(l||c&&this.type!==W.parenL&&this.type!==W.backQuote||this.eat(W.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(W.bracketR)):this.type===W.privateId&&e.type!==`Super`?u.property=this.parsePrivateIdent():u.property=this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(W.parenL)){var d=new gu,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(W.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===W.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},Y.parseExprAtom=function(e,t,n){this.type===W.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case W._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===W.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==W.dot&&this.type!==W.bracketL&&this.type!==W.parenL&&this.unexpected(),this.finishNode(r,`Super`);case W._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case W.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(W._function))return this.overrideContext(J.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(W.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===W.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(W.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case W.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case W.num:case W.string:return this.parseLiteral(this.value);case W._null:case W._true:case W._false:return r=this.startNode(),r.value=this.type===W._null?null:this.type===W._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case W.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case W.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(W.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case W.braceL:return this.overrideContext(J.b_expr),this.parseObj(!1,e);case W._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case W._class:return this.parseClass(this.startNode(),!1);case W._new:return this.parseNew();case W.backQuote:return this.parseTemplate();case W._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Y.parseExprAtomDefault=function(){this.unexpected()},Y.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===W.parenL&&!e)return this.parseDynamicImport(t);if(this.type===W.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}else this.unexpected()},Y.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(W.parenR)?e.options=null:(this.expect(W.comma),this.afterTrailingComma(W.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(W.parenR)||(this.expect(W.comma),this.afterTrailingComma(W.parenR)||this.unexpected())));else if(!this.eat(W.parenR)){var t=this.start;this.eat(W.comma)&&this.eat(W.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Y.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Y.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},Y.parseParenExpression=function(){this.expect(W.parenL);var e=this.parseExpression();return this.expect(W.parenR),e},Y.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Y.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new gu,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==W.parenR;)if(l?l=!1:this.expect(W.comma),a&&this.afterTrailingComma(W.parenR,!0)){u=!0;break}else if(this.type===W.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===W.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}else c.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(W.parenR),e&&this.shouldParseArrow(c)&&this.eat(W.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}else return i},Y.parseParenItem=function(e){return e},Y.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Au=[];Y.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===W.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(W.parenL)?e.arguments=this.parseExprList(W.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Au,this.finishNode(e,`NewExpression`)},Y.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===W.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
137
|
+
`)}:{ok:!0}}let ac;function oc(){try{return D.statSync(`/.dockerenv`),!0}catch{return!1}}function sc(){try{return D.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}function cc(){return ac===void 0&&(ac=oc()||sc()),ac}let lc;const uc=()=>{try{return D.statSync(`/run/.containerenv`),!0}catch{return!1}};function dc(){return lc===void 0&&(lc=uc()||cc()),lc}const fc=()=>{if(T.platform!==`linux`)return!1;if(it.release().toLowerCase().includes(`microsoft`))return!dc();try{if(D.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`))return!dc()}catch{}return D.existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)||D.existsSync(`/run/WSL`)?!dc():!1};var pc=T.env.__IS_WSL_TEST__?fc:fc();const mc=Ke(nt.execFile),hc=()=>`${T.env.SYSTEMROOT||T.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,gc=async(e,t={})=>{let{powerShellPath:n,...r}=t,i=gc.encodeCommand(e);return mc(n??hc(),[...gc.argumentsPrefix,i],{encoding:`utf8`,...r})};gc.argumentsPrefix=[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`],gc.encodeCommand=e=>at.from(e,`utf16le`).toString(`base64`),gc.escapeArgument=e=>`'${String(e).replaceAll(`'`,`''`)}'`;function _c(e){for(let t of e.split(`
|
|
138
|
+
`)){if(/^\s*#/.test(t))continue;let e=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(e)return e.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,``)}}const vc=Ke(nt.execFile),yc=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await We.access(n,Ge.F_OK),r=!0}catch{}if(!r)return e;let i=_c(await We.readFile(n,{encoding:`utf8`}));return i===void 0?e:(t=i,t=t.endsWith(`/`)?t:`${t}/`,t)}})(),bc=pc?async()=>`${await yc()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:hc;let xc;const Sc=async()=>(xc??=(async()=>{try{let e=await bc();return await We.access(e,Ge.X_OK),!0}catch{return!1}})(),xc),Cc=async()=>{let e=await bc(),{stdout:t}=await gc(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{powerShellPath:e});return t.trim()},wc=async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await vc(`wslpath`,[`-aw`,e],{encoding:`utf8`});return t.trim()}catch{return e}};function Tc(e,t,n){let r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let e=n();return r(e),e},set(e){r(e)}}),e}const Ec=Ke(rt);async function Dc(){if(T.platform!==`darwin`)throw Error(`macOS only`);let{stdout:e}=await Ec(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??`com.apple.Safari`;return t===`com.apple.safari`?`com.apple.Safari`:t}const Oc=Ke(rt);async function kc(e,{humanReadableOutput:t=!0,signal:n}={}){if(T.platform!==`darwin`)throw Error(`macOS only`);let r=t?[]:[`-ss`],i={};n&&(i.signal=n);let{stdout:a}=await Oc(`osascript`,[`-e`,e,r],i);return a.trim()}async function Ac(e){return kc(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}const jc=Ke(rt),Mc={MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeBHTML:{name:`Edge Beta`,id:`com.microsoft.edge.beta`},MSEdgeDHTML:{name:`Edge Dev`,id:`com.microsoft.edge.dev`},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},ChromeBHTML:{name:`Chrome Beta`,id:`com.google.chrome.beta`},ChromeDHTML:{name:`Chrome Dev`,id:`com.google.chrome.dev`},ChromiumHTM:{name:`Chromium`,id:`org.chromium.Chromium`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveDHTML:{name:`Brave Dev`,id:`com.brave.Browser.dev`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},OperaStable:{name:`Opera`,id:`com.operasoftware.Opera`},VivaldiHTM:{name:`Vivaldi`,id:`com.vivaldi.Vivaldi`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`}},Nc=new Map(Object.entries(Mc));var Pc=class extends Error{};async function Fc(e=jc){let{stdout:t}=await e(`reg`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new Pc(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=n.groups,i=r.lastIndexOf(`.`),a=r.lastIndexOf(`-`),o=i===-1?void 0:r.slice(0,i),s=a===-1?void 0:r.slice(0,a);return Mc[r]??Mc[o]??Mc[s]??{name:r,id:r}}const Ic=Ke(rt),Lc=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase());async function Rc(){if(T.platform===`darwin`){let e=await Dc();return{name:await Ac(e),id:e}}if(T.platform===`linux`){let{stdout:e}=await Ic(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:Lc(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(T.platform===`win32`)return Fc();throw Error(`Only macOS, Linux, and Windows are supported`)}var zc=!!(T.env.SSH_CONNECTION||T.env.SSH_CLIENT||T.env.SSH_TTY);const Bc=Symbol(`fallbackAttempt`),Vc=import.meta.url?E.dirname(Pe(import.meta.url)):``,Hc=E.join(Vc,`xdg-open`),{platform:Uc,arch:Wc}=T,Gc=async(e,t)=>{if(e.length===0)return;let n=[];for(let r of e)try{return await t(r)}catch(e){n.push(e)}throw AggregateError(n,`Failed to open in all supported apps`)},Kc=async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[Bc]===!0;if(delete e[Bc],Array.isArray(e.app))return Gc(e.app,t=>Kc({...e,app:t,[Bc]:!0}));let{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return Gc(n,t=>Kc({...e,app:{name:t,arguments:r},[Bc]:!0}));if(n===`browser`||n===`browserPrivate`){let t={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`,"com.apple.safari":`safari`},i={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},a;if(pc){let e=await Cc();a=Nc.get(e)??{}}else a=await Rc();if(a.id in t){let o=t[a.id.toLowerCase()];if(n===`browserPrivate`){if(o===`safari`)throw Error(`Safari doesn't support opening in private mode via command line`);r.push(i[o])}return Kc({...e,app:{name:Xc[o],arguments:r}})}throw Error(`${a.name} is not supported as a default browser`)}let i,a=[],o={},s=!1;if(pc&&!dc()&&!zc&&!n&&(s=await Sc()),Uc===`darwin`)i=`open`,e.wait&&a.push(`--wait-apps`),e.background&&a.push(`--background`),e.newInstance&&a.push(`--new`),n&&a.push(`-a`,n);else if(Uc===`win32`||s){i=await bc(),a.push(...gc.argumentsPrefix),pc||(o.windowsVerbatimArguments=!0),pc&&e.target&&(e.target=await wc(e.target));let t=[`$ProgressPreference = 'SilentlyContinue';`,`Start`];e.wait&&t.push(`-Wait`),n?(t.push(gc.escapeArgument(n)),e.target&&r.push(e.target)):e.target&&t.push(gc.escapeArgument(e.target)),r.length>0&&(r=r.map(e=>gc.escapeArgument(e)),t.push(`-ArgumentList`,r.join(`,`))),e.target=gc.encodeCommand(t.join(` `)),e.wait||(o.stdio=`ignore`)}else{if(n)i=n;else{let e=!Vc||Vc===`/`,t=!1;try{await We.access(Hc,Ge.X_OK),t=!0}catch{}i=T.versions.electron??(Uc===`android`||e||!t)?`xdg-open`:Hc}r.length>0&&a.push(...r),e.wait||(o.stdio=`ignore`,o.detached=!0)}Uc===`darwin`&&r.length>0&&a.push(`--args`,...r),e.target&&a.push(e.target);let c=nt.spawn(i,a,o);return e.wait?new Promise((t,n)=>{c.once(`error`,n),c.once(`close`,r=>{if(!e.allowNonzeroExitCode&&r!==0){n(Error(`Exited with code ${r}`));return}t(c)})}):t?new Promise((e,t)=>{c.once(`error`,t),c.once(`spawn`,()=>{c.once(`close`,n=>{if(c.off(`error`,t),n!==0){t(Error(`Exited with code ${n}`));return}c.unref(),e(c)})})}):(c.unref(),new Promise((e,t)=>{c.once(`error`,t),c.once(`spawn`,()=>{c.off(`error`,t),e(c)})}))},qc=(e,t)=>{if(typeof e!=`string`)throw TypeError("Expected a `target`");return Kc({...t,target:e})};function Jc(e){if(typeof e==`string`||Array.isArray(e))return e;let{[Wc]:t}=e;if(!t)throw Error(`${Wc} is not supported`);return t}function Yc({[Uc]:e},{wsl:t}={}){if(t&&pc)return Jc(t);if(!e)throw Error(`${Uc} is not supported`);return Jc(e)}const Xc={browser:`browser`,browserPrivate:`browserPrivate`};Tc(Xc,`chrome`,()=>Yc({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`,`chromium-browser`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),Tc(Xc,`brave`,()=>Yc({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),Tc(Xc,`firefox`,()=>Yc({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),Tc(Xc,`edge`,()=>Yc({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),Tc(Xc,`safari`,()=>Yc({darwin:`Safari`}));var Zc=qc;const Qc={nova:{title:`Nova`,description:`Lucide / Geist`,hint:`Reduced spacing for compact layouts.`,style:`nova`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`lucide`,font:`geist`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},vega:{title:`Vega`,description:`Lucide / Inter`,hint:`The classic shadcn/ui look.`,style:`vega`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`lucide`,font:`inter`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},maia:{title:`Maia`,description:`Hugeicons / Figtree`,hint:`Soft and rounded, with generous spacing.`,style:`maia`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`hugeicons`,font:`figtree`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},lyra:{title:`Lyra`,description:`Phosphor / JetBrains Mono`,hint:`Boxy and sharp. Pairs well with mono fonts.`,style:`lyra`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`phosphor`,font:`jetbrains-mono`,menuAccent:`subtle`,menuColor:`default`,radius:`default`},mira:{title:`Mira`,description:`Hugeicons / Inter`,hint:`Compact. Made for dense interfaces.`,style:`mira`,baseColor:`neutral`,theme:`neutral`,iconLibrary:`hugeicons`,font:`inter`,menuAccent:`subtle`,menuColor:`default`,radius:`default`}};async function $c(e){let t=await Ja({message:`You didn't provide a preset for the design system, how would you like to continue?`,initialValue:e?.style===void 0?`presets`:`prompt`,options:Object.entries(el).map(([e,t])=>({label:t.label,value:e}))});return I(t)&&B(),await el[t].select(e)}const el={presets:{label:`Choose from a list of pre-configured presets`,select:e=>nl(e)},customize:{label:`Create my own preset at ${M.default.bold(`shadcn-svelte.com/create`)}`,select:e=>tl(e)},prompt:{label:`Prompt me for the preset`,select:e=>rl(e)}};async function tl(e){let t=vo(e??ue),n=new URL(`/create`,t).toString(),r=Ka();r.start(`Opening ${M.default.bold(n)} in your browser`),await Zc(n),r.stop(`Opened ${M.default.bold(n)} in your browser`);let i=e=>(e.startsWith(`--preset `)&&(e=e.slice(9)),e),a=await eo({message:`When you're done, paste the code back here and we'll use it to configure your project.`,placeholder:"Click on the `--preset <code>` button and paste the code here",validate:e=>{if(!se(i(e??``)))return`Invalid preset code`}});return I(a)&&B(),ee(i(a))}async function nl(e){let t=await Ja({message:`Choose from a list of pre-configured presets`,initialValue:e?.style??`vega`,options:c(Qc).map(([e,t])=>({label:`${t.title} - ${t.description}`,value:e,hint:t.hint}))});return I(t)&&B(),Qc[t]}async function rl(e){let t=await Ia({style:()=>Ja({message:`Choose a style`,initialValue:e?.style??ue.style,options:c(Qc).map(([e,t])=>({label:t.title,value:e,hint:t.hint}))}),radius:()=>Ja({message:`Choose a radius`,initialValue:`default`,options:c(w).map(([e,t])=>({label:`${t.label} ${t.value}`,value:e}))}),baseColor:()=>Ja({message:`Choose a base color`,initialValue:e?.tailwind.baseColor??ue.tailwind.baseColor,options:c(re).map(([e,t])=>({label:`${On(t.color)(`■`)} ${t.name}`,value:e}))}),theme:({results:e})=>Ja({message:`Choose a theme`,initialValue:e.baseColor,options:c(oe).map(([e,t])=>({label:`${On(t.color)(`■`)} ${t.name}`,value:e}))}),iconLibrary:()=>Ja({message:`Choose an icon library`,initialValue:e?.iconLibrary??ue.iconLibrary,options:c(f).map(([e,t])=>({label:t.title,value:t.name,hint:t.packages.join(`, `)}))}),font:()=>Ja({message:`Choose a font`,initialValue:`inter`,options:te.map(e=>({label:s(e),value:e}))})},{onCancel:()=>B()});return{style:t.style,baseColor:t.baseColor,theme:t.theme,iconLibrary:t.iconLibrary,font:t.font,radius:t.radius,menuColor:e?.menuColor??ue.menuColor,menuAccent:e?.menuAccent??ue.menuAccent}}const il=bo(),al=o({cwd:m(),baseColor:m().optional(),preset:m().optional(),css:m().optional(),componentsAlias:m().optional(),utilsAlias:m().optional(),libAlias:m().optional(),hooksAlias:m().optional(),uiAlias:m().optional(),deps:a(),overwrite:a(),proxy:m().optional(),skipPreflight:a()}),ol=new Te().command(`init`).description(`initialize your project and install dependencies`).option(`--preset <preset>`,`the preset to use`).option(`-c, --cwd <path>`,`the working directory`,T.cwd()).option(`-o, --overwrite`,`overwrite existing files`,!1).option(`--no-deps`,`disable adding & installing dependencies`).option(`--skip-preflight`,`ignore preflight checks and continue`,!1).addOption(new Ee(`--base-color <name>`,`the base color for the components`).choices(il.map(e=>e.name))).addOption(new Ee(`--design-system-url`)).option(`--css <path>`,`path to the global CSS file`).option(`--components-alias <path>`,`import alias for components`).option(`--lib-alias <path>`,`import alias for lib`).option(`--utils-alias <path>`,`import alias for utils`).option(`--hooks-alias <path>`,`import alias for hooks`).option(`--ui-alias <path>`,`import alias for ui`).option(`--proxy <proxy>`,`fetch items from registry using a proxy`,go()).action(async e=>{to();let t=al.parse(e),n=E.resolve(t.cwd);try{if(!O(n))throw h(`The path ${M.default.cyan(n)} does not exist. Please try again.`);let e=null;t.preset!==void 0&&(e=ee(t.preset),e===null&&z.warn(`${M.default.dim(`--preset ${t.preset}`)} is not a valid preset.`)),rc(n,{skipPreflight:t.skipPreflight});let r=so(n);r&&=Qs({cwd:n,config:r,skipPreflight:t.skipPreflight});let{resolvedConfig:i,decidedPresets:a,styleChanged:o}=await cl({cwd:n,presetConfig:e,existingConfig:r,options:t});await ll({cwd:n,config:i,decidedPresets:a,options:t,styleChanged:o}),za(`${M.default.green(`Success!`)} Project initialization completed.`)}catch(e){ro(e)}});function sl(e,t,n){if(t.css&&!O(E.resolve(e,t.css)))throw h(`The provided global CSS file path ${M.default.cyan(t.css)} does not exist. Please enter a valid path.`);for(let[r,i]of Object.entries(t)){if(!r.endsWith(`Alias`))continue;let t=uo({cwd:e,importPath:i,tsconfig:n});if(t)throw h(t)}}async function cl({cwd:e,presetConfig:t,existingConfig:n,options:r}){let i=n??structuredClone(ue);await Jr(e);let{cssPath:a,tsconfigPath:o}=Ws(e,{relative:!0}),s;if(n)s=ho(e,n);else{if(o)i.typescript=o.includes(`tsconfig`);else{let t=await eo({message:`Where is your ${P(`tsconfig/jsconfig`)} file?`,placeholder:`tsconfig.json`,validate:t=>{let n=E.resolve(e,t??``);if(!(t&&O(n)))return`"${M.default.bold(t)}" does not exist. Please enter a valid path.`}});I(t)&&B(),i.typescript={config:t}}s=ho(e,i)}sl(e,r,s);let c=t??await $c(n),l=r.css;if(l===void 0){let t=ue.tailwind.css,r=await eo({message:`Where is your ${P(`global CSS`)} file? ${M.default.gray(`(this file will be overwritten)`)}`,initialValue:n?.tailwind.css??a??t,placeholder:a??t,validate:t=>{if(!(t&&O(E.resolve(e,t))))return`"${M.default.bold(t)}" does not exist. Please enter a valid path.`}});I(r)&&B(),l=r}let{utilsAlias:u,libAlias:d,componentAlias:f,hooksAlias:p,uiAlias:m}=await fo({...r,tsconfig:s,cwd:e,existingConfig:n}),h=co({...i,tailwind:{css:l,baseColor:c.baseColor},aliases:{utils:u,lib:d,components:f,hooks:p,ui:m},style:c.style,iconLibrary:c.iconLibrary,menuColor:c.menuColor,menuAccent:c.menuAccent}),g;return g=n?n.style!==c.style||n.menuColor!==c.menuColor||n.menuAccent!==c.menuAccent:!1,{resolvedConfig:await oo(e,h),decidedPresets:c,styleChanged:g}}async function ll({cwd:e,config:t,decidedPresets:n,options:r,styleChanged:i}){r.proxy!==void 0&&(T.env.HTTP_PROXY=r.proxy,z.info(`You are using the provided proxy: ${M.default.green(r.proxy)}`));let a=[];a.push({title:`Creating config file`,async task(){return mo(e,t),`Config file ${P(`components.json`)} created`}}),a.push({title:`Validating alias paths`,async task(){for(let[e,n]of Object.entries(t.resolvedPaths)){let t=E.extname(n)?E.dirname(n):n;e===`utils`&&n.endsWith(`/utils`)&&(t=t.replace(/\/utils$/,``)),!O(t)&&e!==`utils`&&await k.mkdir(t,{recursive:!0})}return`Alias paths validated`}}),await Za(a);let o=_o(t),s=ie(n),c=new URL(`/init?preset=${s}`,o).toString(),l=[],u=r.overwrite;if(i&&(l=(await qr({registryIndex:await yo(o),config:t})).filter(e=>e.name!==`utils`).map(e=>e.name),l.length>0&&!u)){z.warn(`The registry style has changed to ${M.default.bold(M.default.yellow(n.style))}.`);let e=await Fa({message:`Would you like to ${M.default.bold(M.default.red(`overwrite`))} your existing components?`,initialValue:!0});I(e)&&B(),u=e}let d=await qo({selectedItems:[c,...l],config:t,deps:r.deps,overwrite:u});if(r.deps)await Xs({cwd:e,prompt:r.deps,dependencies:Array.from(d.dependencies),devDependencies:Array.from(d.devDependencies)});else if(d.skippedDeps.size){let e=no([...d.skippedDeps],7);z.warn(`shadcn-svelte has been initialized ${M.default.bold(M.default.red(`without`))} the following ${P(`dependencies`)}:\n${M.default.gray(e)}`)}}const ul=o({all:a(),components:m().array().optional(),cwd:m(),proxy:m().optional(),yes:a(),skipPreflight:a(),deps:a()}),dl=new Te().command(`update`,{hidden:!0}).description(`update components in your project`).argument(`[components...]`,`name of components`).option(`-c, --cwd <path>`,`the working directory`,T.cwd()).option(`--skip-preflight`,`ignore preflight checks and continue`,!1).option(`--no-deps`,`skips adding & installing package dependencies`).option(`-a, --all`,`update all existing components`,!1).option(`-y, --yes`,`skip confirmation prompt`,!1).option(`--proxy <proxy>`,`fetch components from registry using a proxy`,go()).action(async(e,t)=>{to();try{let n=ul.parse({components:e,...t}),r=E.resolve(n.cwd);if(!O(r))throw h(`The path ${M.default.cyan(r)} does not exist. Please try again.`);let i=await ao(r);if(!i)throw h(`Configuration file is missing. Please run ${M.default.green(`init`)} to create a ${P(`components.json`)} file.`);await fl(r,Qs({config:i,cwd:r,skipPreflight:n.skipPreflight}),n),za(`${M.default.green(`Success!`)} Component update completed.`)}catch(e){ro(e)}});async function fl(e,t,n){n.proxy!==void 0&&(T.env.HTTP_PROXY=n.proxy,z.info(`You are using the provided proxy: ${M.default.green(n.proxy)}`));let i=n.components,a=_o(t),o=await yo(a),s=await qr({registryIndex:o,config:t}),c=n.all?s:[];if(c.length===0&&i!==void 0&&(c=s.filter(e=>i.includes(e.name))),c.length===0){let e=await Va({message:`Which components would you like to update?`,maxItems:10,options:s.map(e=>({label:e.name,value:e,hint:e.registryDependencies?.length?`also updates: ${e.registryDependencies.join(`, `)}`:void 0}))});I(e)&&B(),c=e}else{let e=no(c.map(({name:e})=>e));z.step(`Components to update:\n${M.default.gray(e)}`)}if(n.yes===!1){let e=await Fa({message:`Ready to update ${P(`components`)}? ${M.default.gray(`(Make sure you have committed your changes before proceeding!)`)}`,initialValue:!0});(I(e)||e===!1)&&B()}let l=[],u=await So({baseUrl:a,items:await xo({registryUrl:a,registryIndex:o,items:c.map(e=>e.name)})});u.sort((e,t)=>e.name.localeCompare(t.name));let d={},f=new Set,p=new Set,m=[],h={},g={};for(let e of u){let i=wo(t,e.type);e.dependencies?.forEach(e=>f.add(e)),e.devDependencies?.forEach(e=>p.add(e)),e.type===`registry:font`&&m.push({name:e.name,...e.font}),l.push({title:`Updating ${P(e.name)}`,async task(){for(let n of e.files??[]){let i=To(t,e,n),{content:a,dependencies:o,devDependencies:s,filePath:c}=await be({content:n.content,filePath:i,config:t},[ve,v,ye,!t.typescript&&r]);o?.forEach(e=>f.add(e)),s?.forEach(e=>p.add(e));let l=E.parse(c).dir;O(l)||await k.mkdir(l,{recursive:!0}),await k.writeFile(c,a,`utf8`)}e.css&&(g=(0,Eo.default)(g,e.css)),e.cssVars&&(h=(0,Eo.default)(h,e.cssVars));let a=E.resolve(i,e.name);if(e.files&&e.files?.length>1){let n=e.files.map(n=>{let r=To(t,e,n);return!t.typescript&&r.endsWith(`.ts`)?r.replace(`.ts`,`.js`):r}),r=(await k.readdir(a,{withFileTypes:!0})).map(e=>E.resolve(e.parentPath,e.name)).filter(e=>!n.includes(e));r.length>0&&(d[e.name]=r)}let o=E.relative(n.cwd,a);return`${P(e.name)} updated at ${M.default.gray(o)}`}})}let{css:_,cssVars:y,dependencies:b}=Go(m);if(g=(0,Eo.default)(g,_),h=(0,Eo.default)(h,y),b.forEach(e=>p.add(e)),(Object.keys(h).length>0||Object.keys(g).length>0)&&l.push({title:`Updating stylesheet`,async task(){let n=t.resolvedPaths.tailwindCss,r=Wo(await k.readFile(n,`utf8`),{css:g,cssVars:h});await k.writeFile(n,r,`utf8`);let i=E.relative(e,n);return`${P(`Stylesheet`)} updated at ${M.default.dim(i)}`}}),await Za(l),n.deps)await Xs({cwd:e,dependencies:Array.from(f),devDependencies:Array.from(p),prompt:!0});else if(f.size>0||p.size>0){let e=no([...f,...p],7);z.warn(`Components have been updated ${M.default.bold(M.default.red(`without`))} the following ${P(`dependencies`)}:\n${M.default.gray(e)}`)}for(let[t,n]of Object.entries(d))z.warn(`The ${P(t)} component does not use the following files:\n${n.map(t=>M.default.white(`- ${M.default.gray(E.relative(e,t))}`)).join(`
|
|
139
|
+
`)}`);Object.keys(d).length>0&&z.message(M.default.bold(`You may want to delete them.`))}var pl=n({Node:()=>Lu,Parser:()=>K,Position:()=>Gl,SourceLocation:()=>Kl,TokContext:()=>ku,Token:()=>jd,TokenType:()=>H,defaultOptions:()=>Jl,getLineInfo:()=>ql,isIdentifierChar:()=>El,isIdentifierStart:()=>Tl,isNewLine:()=>Nl,keywordTypes:()=>Al,lineBreak:()=>jl,lineBreakG:()=>Ml,nonASCIIwhitespace:()=>Fl,parse:()=>Id,parseExpressionAt:()=>Ld,tokContexts:()=>J,tokTypes:()=>W,tokenizer:()=>Rd,version:()=>Fd}),ml=[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,80,3,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,343,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,330,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,726,6,110,6,6,9,4759,9,787719,239],hl=[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,71,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,2,60,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,328,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,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,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,496,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,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],gl=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,_l=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,vl={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`},yl=`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`,bl={5:yl,"5module":yl+` export import`,6:yl+` const class extends export import super`},xl=/^in(stanceof)?$/,Sl=RegExp(`[`+_l+`]`),Cl=RegExp(`[`+_l+gl+`]`);function wl(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Tl(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Sl.test(String.fromCharCode(e)):t===!1?!1:wl(e,hl)}function El(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Cl.test(String.fromCharCode(e)):t===!1?!1:wl(e,hl)||wl(e,ml)}var H=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function Dl(e,t){return new H(e,{beforeExpr:!0,binop:t})}var Ol={beforeExpr:!0},kl={startsExpr:!0},Al={};function U(e,t){return t===void 0&&(t={}),t.keyword=e,Al[e]=new H(e,t)}var W={num:new H(`num`,kl),regexp:new H(`regexp`,kl),string:new H(`string`,kl),name:new H(`name`,kl),privateId:new H(`privateId`,kl),eof:new H(`eof`),bracketL:new H(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new H(`]`),braceL:new H(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new H(`}`),parenL:new H(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new H(`)`),comma:new H(`,`,Ol),semi:new H(`;`,Ol),colon:new H(`:`,Ol),dot:new H(`.`),question:new H(`?`,Ol),questionDot:new H(`?.`),arrow:new H(`=>`,Ol),template:new H(`template`),invalidTemplate:new H(`invalidTemplate`),ellipsis:new H(`...`,Ol),backQuote:new H("`",kl),dollarBraceL:new H("${",{beforeExpr:!0,startsExpr:!0}),eq:new H(`=`,{beforeExpr:!0,isAssign:!0}),assign:new H(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new H(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new H(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Dl(`||`,1),logicalAND:Dl(`&&`,2),bitwiseOR:Dl(`|`,3),bitwiseXOR:Dl(`^`,4),bitwiseAND:Dl(`&`,5),equality:Dl(`==/!=/===/!==`,6),relational:Dl(`</>/<=/>=`,7),bitShift:Dl(`<</>>/>>>`,8),plusMin:new H(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Dl(`%`,10),star:Dl(`*`,10),slash:Dl(`/`,10),starstar:new H(`**`,{beforeExpr:!0}),coalesce:Dl(`??`,1),_break:U(`break`),_case:U(`case`,Ol),_catch:U(`catch`),_continue:U(`continue`),_debugger:U(`debugger`),_default:U(`default`,Ol),_do:U(`do`,{isLoop:!0,beforeExpr:!0}),_else:U(`else`,Ol),_finally:U(`finally`),_for:U(`for`,{isLoop:!0}),_function:U(`function`,kl),_if:U(`if`),_return:U(`return`,Ol),_switch:U(`switch`),_throw:U(`throw`,Ol),_try:U(`try`),_var:U(`var`),_const:U(`const`),_while:U(`while`,{isLoop:!0}),_with:U(`with`),_new:U(`new`,{beforeExpr:!0,startsExpr:!0}),_this:U(`this`,kl),_super:U(`super`,kl),_class:U(`class`,kl),_extends:U(`extends`,Ol),_export:U(`export`),_import:U(`import`,kl),_null:U(`null`,kl),_true:U(`true`,kl),_false:U(`false`,kl),_in:U(`in`,{beforeExpr:!0,binop:7}),_instanceof:U(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:U(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:U(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:U(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},jl=/\r\n?|\n|\u2028|\u2029/,Ml=new RegExp(jl.source,`g`);function Nl(e){return e===10||e===13||e===8232||e===8233}function Pl(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(Nl(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Fl=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,G=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Il=Object.prototype,Ll=Il.hasOwnProperty,Rl=Il.toString,zl=Object.hasOwn||(function(e,t){return Ll.call(e,t)}),Bl=Array.isArray||(function(e){return Rl.call(e)===`[object Array]`}),Vl=Object.create(null);function Hl(e){return Vl[e]||(Vl[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function Ul(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Wl=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Gl=function(e,t){this.line=e,this.column=t};Gl.prototype.offset=function(e){return new Gl(this.line,this.column+e)};var Kl=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function ql(e,t){for(var n=1,r=0;;){var i=Pl(e,r,t);if(i<0)return new Gl(n,t-r);++n,r=i}}var Jl={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Yl=!1;function Xl(e){var t={};for(var n in Jl)t[n]=e&&zl(e,n)?e[n]:Jl[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Yl&&typeof console==`object`&&console.warn&&(Yl=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
140
|
+
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),Bl(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return Bl(t.onComment)&&(t.onComment=Zl(t,t.onComment)),t}function Zl(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new Kl(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var Ql=1,$l=2,eu=4,tu=8,nu=16,ru=32,iu=64,au=128,ou=256,su=512,cu=Ql|$l|ou;function lu(e,t){return $l|(e?eu:0)|(t?tu:0)}var uu=0,du=1,fu=2,pu=3,mu=4,hu=5,K=function(e,t,n){this.options=e=Xl(e),this.sourceFile=e.sourceFile,this.keywords=Hl(bl[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=vl[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=Hl(r);var i=(r?r+` `:``)+vl.strict;this.reservedWordsStrict=Hl(i),this.reservedWordsStrictBind=Hl(i+` `+vl.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
|
|
141
|
+
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(jl).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=W.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=e.sourceType===`module`,this.strict=this.inModule||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&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Ql),this.regexpState=null,this.privateNameStack=[]},gu={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};K.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},gu.inFunction.get=function(){return(this.currentVarScope().flags&$l)>0},gu.inGenerator.get=function(){return(this.currentVarScope().flags&tu)>0},gu.inAsync.get=function(){return(this.currentVarScope().flags&eu)>0},gu.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(ou|su))return!1;if(t&$l)return(t&eu)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},gu.allowSuper.get=function(){return(this.currentThisScope().flags&iu)>0||this.options.allowSuperOutsideMethod},gu.allowDirectSuper.get=function(){return(this.currentThisScope().flags&au)>0},gu.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},gu.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(ou|su)||t&$l&&!(t&nu))return!0}return!1},gu.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ou)>0},K.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},K.parse=function(e,t){return new this(t,e).parse()},K.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},K.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(K.prototype,gu);var _u=K.prototype,vu=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;_u.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){G.lastIndex=e,e+=G.exec(this.input)[0].length;var t=vu.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){G.lastIndex=e+t[0].length;var n=G.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||jl.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,G.lastIndex=e,e+=G.exec(this.input)[0].length,this.input[e]===`;`&&e++}},_u.eat=function(e){return this.type===e?(this.next(),!0):!1},_u.isContextual=function(e){return this.type===W.name&&this.value===e&&!this.containsEsc},_u.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},_u.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},_u.canInsertSemicolon=function(){return this.type===W.eof||this.type===W.braceR||jl.test(this.input.slice(this.lastTokEnd,this.start))},_u.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},_u.semicolon=function(){!this.eat(W.semi)&&!this.insertSemicolon()&&this.unexpected()},_u.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},_u.expect=function(e){this.eat(e)||this.unexpected()},_u.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var yu=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};_u.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},_u.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},_u.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},_u.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var q=K.prototype;q.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==W.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,`Program`)};var bu={kind:`loop`},xu={kind:`switch`};q.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;G.lastIndex=this.pos;var t=G.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(Tl(r,!0)){for(var i=n+1;El(r=this.input.charCodeAt(i),!0);)++i;if(r===92||r>55295&&r<56320)return!0;var a=this.input.slice(n,i);if(!xl.test(a))return!0}return!1},q.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;G.lastIndex=this.pos;var e=G.exec(this.input),t=this.pos+e[0].length,n;return!jl.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(El(n=this.input.charCodeAt(t+8))||n>55295&&n<56320))},q.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;G.lastIndex=this.pos;var n=G.exec(this.input),r=this.pos+n[0].length;if(jl.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||El(a=this.input.charCodeAt(i))||a>55295&&a<56320)return!1;G.lastIndex=i;var o=G.exec(this.input);if(o&&jl.test(this.input.slice(i,i+o[0].length)))return!1}if(t){var s=r+2,c;if(this.input.slice(r,s)===`of`&&(s===this.input.length||!El(c=this.input.charCodeAt(s))&&!(c>55295&&c<56320)))return!1}var l=this.input.charCodeAt(r);return Tl(l,!0)||l===92},q.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},q.isUsing=function(e){return this.isUsingKeyword(!1,e)},q.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=W._var,a=`let`),r){case W._break:case W._continue:return this.parseBreakContinueStatement(i,r.keyword);case W._debugger:return this.parseDebuggerStatement(i);case W._do:return this.parseDoStatement(i);case W._for:return this.parseForStatement(i);case W._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case W._class:return e&&this.unexpected(),this.parseClass(i,!0);case W._if:return this.parseIfStatement(i);case W._return:return this.parseReturnStatement(i);case W._switch:return this.parseSwitchStatement(i);case W._throw:return this.parseThrowStatement(i);case W._try:return this.parseTryStatement(i);case W._const:case W._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case W._while:return this.parseWhileStatement(i);case W._with:return this.parseWithStatement(i);case W.braceL:return this.parseBlock(!0,i);case W.semi:return this.parseEmptyStatement(i);case W._export:case W._import:if(this.options.ecmaVersion>10&&r===W._import){G.lastIndex=this.pos;var o=G.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===W._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return t&&this.options.sourceType===`script`&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===W.name&&d.type===`Identifier`&&this.eat(W.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},q.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(W.semi)||this.insertSemicolon()?e.label=null:this.type===W.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},q.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},q.parseDoStatement=function(e){return this.next(),this.labels.push(bu),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(W._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(W.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},q.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(bu),this.enterScope(0),this.expect(W.parenL),this.type===W.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===W._var||this.type===W._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&this.next(),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new yu,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===W._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===W._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},q.parseForAfterInit=function(e,t,n){return(this.type===W._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===W._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},q.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Cu|(n?0:wu),!1,t)},q.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(W._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},q.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,`'return' outside of function`),this.next(),this.eat(W.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},q.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(W.braceL),this.labels.push(xu),this.enterScope(0);for(var t,n=!1;this.type!==W.braceR;)if(this.type===W._case||this.type===W._default){var r=this.type===W._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(W.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},q.parseThrowStatement=function(e){return this.next(),jl.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Su=[];q.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?ru:0),this.checkLValPattern(e,t?mu:fu),this.expect(W.parenR),e},q.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===W._catch){var t=this.startNode();this.next(),this.eat(W.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(W._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},q.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},q.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(bu),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},q.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},q.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},q.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===W._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},q.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},q.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(W.braceL),e&&this.enterScope(0);this.type!==W.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},q.parseFor=function(e,t){return e.init=t,this.expect(W.semi),e.test=this.type===W.semi?null:this.parseExpression(),this.expect(W.semi),e.update=this.type===W.parenR?null:this.parseExpression(),this.expect(W.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},q.parseForIn=function(e,t){var n=this.type===W._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(W.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},q.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(W.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===W._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==W._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&!(t&&(this.type===W._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(W.comma))break}return e},q.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?du:fu,!1)};var Cu=1,wu=2,Tu=4;q.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===W.star&&t&wu&&this.unexpected(),e.generator=this.eat(W.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Cu&&(e.id=t&Tu&&this.type!==W.name?null:this.parseIdent(),e.id&&!(t&wu)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?du:fu:pu));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(lu(e.async,e.generator)),t&Cu||(e.id=this.type===W.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Cu?`FunctionDeclaration`:`FunctionExpression`)},q.parseFunctionParams=function(e){this.expect(W.parenL),e.params=this.parseBindingList(W.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},q.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(W.braceL);this.type!==W.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Eu(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},q.parseClassElement=function(e){if(this.eat(W.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(W.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===W.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===W.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(W.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===W.parenL||o!==`method`||i||a){var l=!n.static&&Du(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},q.isClassElementNameStart=function(){return this.type===W.name||this.type===W.privateId||this.type===W.num||this.type===W.string||this.type===W.bracketL||this.type.keyword},q.parseClassElementName=function(e){this.type===W.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},q.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Du(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},q.parseClassField=function(e){return Du(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Du(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(W.eq)?(this.enterScope(su|iu),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},q.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ou|iu);this.type!==W.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},q.parseClassId=function(e,t){this.type===W.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,fu,!1)):(t===!0&&this.unexpected(),e.id=null)},q.parseClassSuper=function(e){e.superClass=this.eat(W._extends)?this.parseExprSubscripts(null,!1):null},q.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},q.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];zl(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Eu(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Du(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}q.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==W.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},q.parseExport=function(e,t){if(this.next(),this.eat(W.star))return this.parseExportAllDeclaration(e,t);if(this.eat(W._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==W.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},q.parseExportDeclaration=function(e){return this.parseStatement(null)},q.parseExportDefaultDeclaration=function(){var e;if(this.type===W._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Cu|Tu,!1,e)}else if(this.type===W._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},q.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),zl(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},q.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},q.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},q.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},q.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},q.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(W.braceL);!this.eat(W.braceR);){if(n)n=!1;else if(this.expect(W.comma),this.afterTrailingComma(W.braceR))break;t.push(this.parseExportSpecifier(e))}return t},q.parseImport=function(e){return this.next(),this.type===W.string?(e.specifiers=Su,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===W.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},q.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,fu),this.finishNode(e,`ImportSpecifier`)},q.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,fu),this.finishNode(e,`ImportDefaultSpecifier`)},q.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,fu),this.finishNode(e,`ImportNamespaceSpecifier`)},q.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===W.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(W.comma)))return e;if(this.type===W.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(W.braceL);!this.eat(W.braceR);){if(t)t=!1;else if(this.expect(W.comma),this.afterTrailingComma(W.braceR))break;e.push(this.parseImportSpecifier())}return e},q.parseWithClause=function(){var e=[];if(!this.eat(W._with))return e;this.expect(W.braceL);for(var t={},n=!0;!this.eat(W.braceR);){if(n)n=!1;else if(this.expect(W.comma),this.afterTrailingComma(W.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;zl(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},q.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===W.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(W.colon),this.type!==W.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},q.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===W.string){var e=this.parseLiteral(this.value);return Wl.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},q.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},q.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Ou=K.prototype;Ou.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Ou.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Ou.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Ou.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==W.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Ou.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case W.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(W.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case W.braceL:return this.parseObj(!0)}return this.parseIdent()},Ou.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(W.comma),t&&this.type===W.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===W.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===W.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Ou.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Ou.parseBindingListItem=function(e){return e},Ou.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(W.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Ou.checkLValSimple=function(e,t,n){t===void 0&&(t=uu);var r=t!==uu;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===fu&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(zl(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==hu&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Ou.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=uu),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Ou.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=uu),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var ku=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},J={b_stat:new ku(`{`,!1),b_expr:new ku(`{`,!0),b_tmpl:new ku("${",!1),p_stat:new ku(`(`,!1),p_expr:new ku(`(`,!0),q_tmpl:new ku("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ku(`function`,!1),f_expr:new ku(`function`,!0),f_expr_gen:new ku(`function`,!0,!1,null,!0),f_gen:new ku(`function`,!1,!1,null,!0)},Au=K.prototype;Au.initialContext=function(){return[J.b_stat]},Au.curContext=function(){return this.context[this.context.length-1]},Au.braceIsBlock=function(e){var t=this.curContext();return t===J.f_expr||t===J.f_stat?!0:e===W.colon&&(t===J.b_stat||t===J.b_expr)?!t.isExpr:e===W._return||e===W.name&&this.exprAllowed?jl.test(this.input.slice(this.lastTokEnd,this.start)):e===W._else||e===W.semi||e===W.eof||e===W.parenR||e===W.arrow?!0:e===W.braceL?t===J.b_stat:e===W._var||e===W._const||e===W.name?!1:!this.exprAllowed},Au.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Au.updateContext=function(e){var t,n=this.type;n.keyword&&e===W.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Au.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},W.parenR.updateContext=W.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===J.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},W.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?J.b_stat:J.b_expr),this.exprAllowed=!0},W.dollarBraceL.updateContext=function(){this.context.push(J.b_tmpl),this.exprAllowed=!0},W.parenL.updateContext=function(e){var t=e===W._if||e===W._for||e===W._with||e===W._while;this.context.push(t?J.p_stat:J.p_expr),this.exprAllowed=!0},W.incDec.updateContext=function(){},W._function.updateContext=W._class.updateContext=function(e){e.beforeExpr&&e!==W._else&&!(e===W.semi&&this.curContext()!==J.p_stat)&&!(e===W._return&&jl.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===W.colon||e===W.braceL)&&this.curContext()===J.b_stat)?this.context.push(J.f_expr):this.context.push(J.f_stat),this.exprAllowed=!1},W.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},W.backQuote.updateContext=function(){this.curContext()===J.q_tmpl?this.context.pop():this.context.push(J.q_tmpl),this.exprAllowed=!1},W.star.updateContext=function(e){if(e===W._function){var t=this.context.length-1;this.context[t]===J.f_expr?this.context[t]=J.f_expr_gen:this.context[t]=J.f_gen}this.exprAllowed=!0},W.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==W.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Y=K.prototype;Y.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},Y.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===W.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(W.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},Y.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new yu,r=!0);var s=this.start,c=this.startLoc;(this.type===W.parenL||this.type===W.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===W.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===W.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Y.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(W.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(W.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Y.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Y.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==W._in)&&a>r){var o=this.type===W.logicalOR||this.type===W.logicalAND,s=this.type===W.coalesce;s&&(a=W.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===W.coalesce||s&&(this.type===W.logicalOR||this.type===W.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},Y.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Y.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===W.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&ju(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Mu(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===W.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==W._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(W.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1);else return o};function ju(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&ju(e.expression)}function Mu(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Mu(e.expression)||e.type===`ParenthesizedExpression`&&Mu(e.expression)}Y.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},Y.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},Y.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(W.arrow)},Y.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Y.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(W.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(W.bracketL);if(l||c&&this.type!==W.parenL&&this.type!==W.backQuote||this.eat(W.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(W.bracketR)):this.type===W.privateId&&e.type!==`Super`?u.property=this.parsePrivateIdent():u.property=this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(W.parenL)){var d=new yu,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(W.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===W.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},Y.parseExprAtom=function(e,t,n){this.type===W.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case W._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===W.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==W.dot&&this.type!==W.bracketL&&this.type!==W.parenL&&this.unexpected(),this.finishNode(r,`Super`);case W._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case W.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(W._function))return this.overrideContext(J.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(W.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===W.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(W.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case W.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case W.num:case W.string:return this.parseLiteral(this.value);case W._null:case W._true:case W._false:return r=this.startNode(),r.value=this.type===W._null?null:this.type===W._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case W.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case W.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(W.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case W.braceL:return this.overrideContext(J.b_expr),this.parseObj(!1,e);case W._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case W._class:return this.parseClass(this.startNode(),!1);case W._new:return this.parseNew();case W.backQuote:return this.parseTemplate();case W._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Y.parseExprAtomDefault=function(){this.unexpected()},Y.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===W.parenL&&!e)return this.parseDynamicImport(t);if(this.type===W.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}else this.unexpected()},Y.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(W.parenR)?e.options=null:(this.expect(W.comma),this.afterTrailingComma(W.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(W.parenR)||(this.expect(W.comma),this.afterTrailingComma(W.parenR)||this.unexpected())));else if(!this.eat(W.parenR)){var t=this.start;this.eat(W.comma)&&this.eat(W.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Y.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Y.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},Y.parseParenExpression=function(){this.expect(W.parenL);var e=this.parseExpression();return this.expect(W.parenR),e},Y.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Y.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new yu,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==W.parenR;)if(l?l=!1:this.expect(W.comma),a&&this.afterTrailingComma(W.parenR,!0)){u=!0;break}else if(this.type===W.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===W.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}else c.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(W.parenR),e&&this.shouldParseArrow(c)&&this.eat(W.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}else return i},Y.parseParenItem=function(e){return e},Y.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Nu=[];Y.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===W.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(W.parenL)?e.arguments=this.parseExprList(W.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Nu,this.finishNode(e,`NewExpression`)},Y.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===W.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
|
|
142
142
|
`),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
143
|
-
`),cooked:this.value},this.next(),n.tail=this.type===W.backQuote,this.finishNode(n,`TemplateElement`)},Y.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===W.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(W.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(W.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Y.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===W.name||this.type===W.num||this.type===W.string||this.type===W.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===W.star)&&!Ol.test(this.input.slice(this.lastTokEnd,this.start))},Y.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(W.braceR);){if(r)r=!1;else if(this.expect(W.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(W.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Y.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(W.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===W.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===W.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(W.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(W.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Y.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Y.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===W.colon&&this.unexpected(),this.eat(W.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===W.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==W.comma&&this.type!==W.braceR&&this.type!==W.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===W.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},Y.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(W.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(W.bracketR),e.key;e.computed=!1}return e.key=this.type===W.num||this.type===W.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Y.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Y.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ou(t,r.generator)|tu|(n?nu:0)),this.expect(W.parenL),r.params=this.parseBindingList(W.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Y.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(ou(n,!1)|$l),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Y.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==W.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,fu),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Y.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Y.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,cu,t?null:n)}},Y.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(W.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===W.comma?o=null:this.type===W.ellipsis?(o=this.parseSpread(r),r&&this.type===W.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Y.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&au)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Y.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Y.parseIdentNode=function(){var e=this.startNode();return this.type===W.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name===`class`||e.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=W.name):this.unexpected(),e},Y.parsePrivateIdent=function(){var e=this.startNode();return this.type===W.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Y.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===W.semi||this.canInsertSemicolon()||this.type!==W.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(W.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Y.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var ju=K.prototype;ju.raise=function(e,t){var n=Wl(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},ju.raiseRecoverable=ju.raise,ju.curPosition=function(){if(this.options.locations)return new Hl(this.curLine,this.pos-this.lineStart)};var Mu=K.prototype,Nu=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Mu.enterScope=function(e){this.scopeStack.push(new Nu(e))},Mu.exitScope=function(){this.scopeStack.pop()},Mu.treatFunctionsAsVarInScope=function(e){return e.flags&Xl||!this.inModule&&e.flags&Yl},Mu.declareName=function(e,t,n){var r=!1;if(t===lu){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Yl&&delete this.undefinedExports[e]}else if(t===du)this.currentScope().lexical.push(e);else if(t===uu){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&eu&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&Yl&&delete this.undefinedExports[e],s.flags&au)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Mu.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Mu.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Mu.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(au|iu|ru))return t}},Mu.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(au|iu|ru)&&!(t.flags&$l))return t}};var Pu=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new Ul(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Fu=K.prototype;Fu.startNode=function(){return new Pu(this,this.start,this.startLoc)},Fu.startNodeAt=function(e,t){return new Pu(this,e,t)};function Iu(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Fu.finishNode=function(e,t){return Iu.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Fu.finishNodeAt=function(e,t,n,r){return Iu.call(this,e,t,n,r)},Fu.copyNode=function(e){var t=new Pu(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Lu=`Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz`,Ru=`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`,zu=Ru+` Extended_Pictographic`,Bu=zu,Vu=Bu+` EBase EComp EMod EPres ExtPict`,Hu=Vu,Uu=Hu,Wu={9:Ru,10:zu,11:Bu,12:Vu,13:Hu,14:Uu},Gu=`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`,Ku={9:``,10:``,11:``,12:``,13:``,14:Gu},qu=`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`,Ju=`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`,Yu=Ju+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,Xu=Yu+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,Zu=Xu+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,Qu=Zu+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,$u=Qu+` `+Lu,ed={9:Ju,10:Yu,11:Xu,12:Zu,13:Qu,14:$u},td={};function nd(e){var t=td[e]={binary:zl(Wu[e]+` `+qu),binaryOfStrings:zl(Ku[e]),nonBinary:{General_Category:zl(qu),Script:zl(ed[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var rd=0,id=[9,10,11,12,13,14];rd<id.length;rd+=1){var ad=id[rd];nd(ad)}var X=K.prototype,od=function(e,t){this.parent=e,this.base=t||this};od.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},od.prototype.sibling=function(){return new od(this.parent,this.base)};var sd=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=td[e.options.ecmaVersion>=14?14:e.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};sd.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},sd.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},sd.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},sd.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},sd.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},sd.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},sd.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},sd.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1},sd.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},X.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function cd(e){for(var t in e)return!0;return!1}X.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&cd(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},X.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},X.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new od(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},X.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},X.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},X.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},X.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},X.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},X.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},X.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},X.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},X.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},X.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},X.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&ld(n);)t+=Bl(n),e.advance();return t};function ld(e){return e===105||e===109||e===115}X.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},X.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},X.regexp_eatSyntaxCharacter=function(e){var t=e.current();return ud(t)?(e.lastIntValue=t,e.advance(),!0):!1};function ud(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}X.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!ud(n);)e.advance();return e.pos!==t},X.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},X.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`);t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},X.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},X.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Bl(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Bl(e.lastIntValue);return!0}return!1},X.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),dd(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function dd(e){return Sl(e,!0)||e===36||e===95}X.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),fd(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function fd(e){return Cl(e,!0)||e===36||e===95||e===8204||e===8205}X.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},X.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},X.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},X.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},X.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},X.regexp_eatZero=function(e){return e.current()===48&&!wd(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},X.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},X.regexp_eatControlLetter=function(e){var t=e.current();return pd(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function pd(e){return e>=65&&e<=90||e>=97&&e<=122}X.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&md(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function md(e){return e>=0&&e<=1114111}X.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},X.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var hd=0,gd=1,_d=2;X.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(vd(t))return e.lastIntValue=-1,e.advance(),gd;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===_d&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return hd};function vd(e){return e===100||e===68||e===115||e===83||e===119||e===87}X.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),gd}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return hd},X.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Il(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},X.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return gd;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return _d;e.raise(`Invalid property name`)},X.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;yd(t=e.current());)e.lastStringValue+=Bl(t),e.advance();return e.lastStringValue!==``};function yd(e){return pd(e)||e===95}X.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;bd(t=e.current());)e.lastStringValue+=Bl(t),e.advance();return e.lastStringValue!==``};function bd(e){return yd(e)||wd(e)}X.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},X.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===_d&&e.raise(`Negated character class may contain strings`),!0}return!1},X.regexp_classContents=function(e){return e.current()===93?gd:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),gd)},X.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},X.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Dd(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},X.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},X.regexp_classSetExpression=function(e){var t=gd,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===_d&&(t=_d);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==_d&&(t=gd);continue}e.raise(`Invalid character in character class`)}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`);for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===_d&&(t=_d)}},X.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},X.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?gd:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},X.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===_d&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},X.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},X.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===_d&&(t=_d);return t},X.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?gd:_d},X.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&xd(n)||Sd(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function xd(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Sd(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}X.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Cd(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Cd(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}X.regexp_eatClassControlLetter=function(e){var t=e.current();return wd(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},X.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},X.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;wd(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function wd(e){return e>=48&&e<=57}X.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Td(n=e.current());)e.lastIntValue=16*e.lastIntValue+Ed(n),e.advance();return e.pos!==t};function Td(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ed(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}X.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},X.regexp_eatOctalDigit=function(e){var t=e.current();return Dd(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Dd(e){return e>=48&&e<=55}X.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Td(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Ed(i),e.advance()}return!0};var Od=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Ul(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Z=K.prototype;Z.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Od(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Z.getToken=function(){return this.next(),new Od(this)},typeof Symbol<`u`&&(Z[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===W.eof,value:t}}}}),Z.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(W.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Z.readToken=function(e){return Sl(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Z.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},Z.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=jl(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Z.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Al(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Z.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++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 loop}break;default:if(e>8&&e<14||e>=5760&&Ml.test(String.fromCharCode(e)))++this.pos;else break loop}}},Z.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Z.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(W.ellipsis)):(++this.pos,this.finishToken(W.dot))},Z.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(W.assign,2):this.finishOp(W.slash,1)},Z.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?W.star:W.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=W.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(W.assign,n+1):this.finishOp(r,n)},Z.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(W.assign,3):this.finishOp(e===124?W.logicalOR:W.logicalAND,2):t===61?this.finishOp(W.assign,2):this.finishOp(e===124?W.bitwiseOR:W.bitwiseAND,1)},Z.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(W.assign,2):this.finishOp(W.bitwiseXOR,1)},Z.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Ol.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(W.incDec,2):t===61?this.finishOp(W.assign,2):this.finishOp(W.plusMin,1)},Z.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(W.assign,n+1):this.finishOp(W.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(W.relational,n))},Z.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(W.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(W.arrow)):this.finishOp(e===61?W.eq:W.prefix,1)},Z.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(W.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(W.assign,3):this.finishOp(W.coalesce,2)}return this.finishOp(W.question,1)},Z.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Sl(t,!0)||t===92))return this.finishToken(W.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+Bl(t)+`'`)},Z.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(W.parenL);case 41:return++this.pos,this.finishToken(W.parenR);case 59:return++this.pos,this.finishToken(W.semi);case 44:return++this.pos,this.finishToken(W.comma);case 91:return++this.pos,this.finishToken(W.bracketL);case 93:return++this.pos,this.finishToken(W.bracketR);case 123:return++this.pos,this.finishToken(W.braceL);case 125:return++this.pos,this.finishToken(W.braceR);case 58:return++this.pos,this.finishToken(W.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(W.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===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(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(W.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+Bl(e)+`'`)},Z.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Z.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(Ol.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new sd(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(W.regexp,{pattern:i,flags:o,value:c})},Z.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function kd(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Ad(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Z.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Ad(this.input.slice(t,this.pos)),++this.pos):Sl(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(W.num,n)},Z.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Ad(this.input.slice(t,this.pos));return++this.pos,Sl(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(W.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),Sl(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=kd(this.input.slice(t,this.pos),n);return this.finishToken(W.num,a)},Z.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Z.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Al(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(W.string,t)};var jd={};Z.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===jd)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Z.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw jd;this.raise(e,t)},Z.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===W.template||this.type===W.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(W.dollarBraceL)):(++this.pos,this.finishToken(W.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(W.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Al(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
143
|
+
`),cooked:this.value},this.next(),n.tail=this.type===W.backQuote,this.finishNode(n,`TemplateElement`)},Y.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===W.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(W.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(W.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Y.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===W.name||this.type===W.num||this.type===W.string||this.type===W.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===W.star)&&!jl.test(this.input.slice(this.lastTokEnd,this.start))},Y.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(W.braceR);){if(r)r=!1;else if(this.expect(W.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(W.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Y.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(W.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===W.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===W.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(W.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(W.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Y.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Y.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===W.colon&&this.unexpected(),this.eat(W.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===W.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==W.comma&&this.type!==W.braceR&&this.type!==W.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===W.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},Y.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(W.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(W.bracketR),e.key;e.computed=!1}return e.key=this.type===W.num||this.type===W.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Y.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Y.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(lu(t,r.generator)|iu|(n?au:0)),this.expect(W.parenL),r.params=this.parseBindingList(W.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Y.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(lu(n,!1)|nu),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Y.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==W.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,hu),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Y.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Y.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,du,t?null:n)}},Y.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(W.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===W.comma?o=null:this.type===W.ellipsis?(o=this.parseSpread(r),r&&this.type===W.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Y.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&cu)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Y.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Y.parseIdentNode=function(){var e=this.startNode();return this.type===W.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name===`class`||e.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=W.name):this.unexpected(),e},Y.parsePrivateIdent=function(){var e=this.startNode();return this.type===W.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Y.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===W.semi||this.canInsertSemicolon()||this.type!==W.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(W.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Y.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var Pu=K.prototype;Pu.raise=function(e,t){var n=ql(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},Pu.raiseRecoverable=Pu.raise,Pu.curPosition=function(){if(this.options.locations)return new Gl(this.curLine,this.pos-this.lineStart)};var Fu=K.prototype,Iu=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Fu.enterScope=function(e){this.scopeStack.push(new Iu(e))},Fu.exitScope=function(){this.scopeStack.pop()},Fu.treatFunctionsAsVarInScope=function(e){return e.flags&$l||!this.inModule&&e.flags&Ql},Fu.declareName=function(e,t,n){var r=!1;if(t===fu){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Ql&&delete this.undefinedExports[e]}else if(t===mu)this.currentScope().lexical.push(e);else if(t===pu){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&ru&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&Ql&&delete this.undefinedExports[e],s.flags&cu)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Fu.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Fu.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Fu.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(cu|su|ou))return t}},Fu.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(cu|su|ou)&&!(t.flags&nu))return t}};var Lu=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new Kl(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Ru=K.prototype;Ru.startNode=function(){return new Lu(this,this.start,this.startLoc)},Ru.startNodeAt=function(e,t){return new Lu(this,e,t)};function zu(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Ru.finishNode=function(e,t){return zu.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Ru.finishNodeAt=function(e,t,n,r){return zu.call(this,e,t,n,r)},Ru.copyNode=function(e){var t=new Lu(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Bu=`Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz`,Vu=`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`,Hu=Vu+` Extended_Pictographic`,Uu=Hu,Wu=Uu+` EBase EComp EMod EPres ExtPict`,Gu=Wu,Ku=Gu,qu={9:Vu,10:Hu,11:Uu,12:Wu,13:Gu,14:Ku},Ju=`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`,Yu={9:``,10:``,11:``,12:``,13:``,14:Ju},Xu=`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`,Zu=`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`,Qu=Zu+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,$u=Qu+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,ed=$u+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,td=ed+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,nd=td+` `+Bu,rd={9:Zu,10:Qu,11:$u,12:ed,13:td,14:nd},id={};function ad(e){var t=id[e]={binary:Hl(qu[e]+` `+Xu),binaryOfStrings:Hl(Yu[e]),nonBinary:{General_Category:Hl(Xu),Script:Hl(rd[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var od=0,sd=[9,10,11,12,13,14];od<sd.length;od+=1){var cd=sd[od];ad(cd)}var X=K.prototype,ld=function(e,t){this.parent=e,this.base=t||this};ld.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},ld.prototype.sibling=function(){return new ld(this.parent,this.base)};var ud=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=id[e.options.ecmaVersion>=14?14:e.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};ud.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},ud.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},ud.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},ud.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},ud.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},ud.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},ud.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},ud.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1},ud.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},X.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function dd(e){for(var t in e)return!0;return!1}X.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&dd(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},X.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},X.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new ld(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},X.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},X.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},X.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},X.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},X.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},X.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},X.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},X.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},X.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},X.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},X.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&fd(n);)t+=Ul(n),e.advance();return t};function fd(e){return e===105||e===109||e===115}X.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},X.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},X.regexp_eatSyntaxCharacter=function(e){var t=e.current();return pd(t)?(e.lastIntValue=t,e.advance(),!0):!1};function pd(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}X.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!pd(n);)e.advance();return e.pos!==t},X.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},X.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`);t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},X.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},X.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Ul(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Ul(e.lastIntValue);return!0}return!1},X.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),md(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function md(e){return Tl(e,!0)||e===36||e===95}X.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),hd(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function hd(e){return El(e,!0)||e===36||e===95||e===8204||e===8205}X.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},X.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},X.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},X.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},X.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},X.regexp_eatZero=function(e){return e.current()===48&&!Dd(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},X.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},X.regexp_eatControlLetter=function(e){var t=e.current();return gd(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function gd(e){return e>=65&&e<=90||e>=97&&e<=122}X.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&_d(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function _d(e){return e>=0&&e<=1114111}X.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},X.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var vd=0,yd=1,bd=2;X.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(xd(t))return e.lastIntValue=-1,e.advance(),yd;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===bd&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return vd};function xd(e){return e===100||e===68||e===115||e===83||e===119||e===87}X.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),yd}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return vd},X.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){zl(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},X.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return yd;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return bd;e.raise(`Invalid property name`)},X.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Sd(t=e.current());)e.lastStringValue+=Ul(t),e.advance();return e.lastStringValue!==``};function Sd(e){return gd(e)||e===95}X.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Cd(t=e.current());)e.lastStringValue+=Ul(t),e.advance();return e.lastStringValue!==``};function Cd(e){return Sd(e)||Dd(e)}X.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},X.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===bd&&e.raise(`Negated character class may contain strings`),!0}return!1},X.regexp_classContents=function(e){return e.current()===93?yd:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),yd)},X.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},X.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Ad(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},X.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},X.regexp_classSetExpression=function(e){var t=yd,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===bd&&(t=bd);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==bd&&(t=yd);continue}e.raise(`Invalid character in character class`)}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`);for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===bd&&(t=bd)}},X.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},X.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?yd:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},X.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===bd&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},X.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},X.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===bd&&(t=bd);return t},X.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?yd:bd},X.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&wd(n)||Td(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function wd(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Td(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}X.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Ed(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Ed(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}X.regexp_eatClassControlLetter=function(e){var t=e.current();return Dd(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},X.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},X.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Dd(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Dd(e){return e>=48&&e<=57}X.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Od(n=e.current());)e.lastIntValue=16*e.lastIntValue+kd(n),e.advance();return e.pos!==t};function Od(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function kd(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}X.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},X.regexp_eatOctalDigit=function(e){var t=e.current();return Ad(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Ad(e){return e>=48&&e<=55}X.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Od(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+kd(i),e.advance()}return!0};var jd=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Kl(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Z=K.prototype;Z.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new jd(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Z.getToken=function(){return this.next(),new jd(this)},typeof Symbol<`u`&&(Z[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===W.eof,value:t}}}}),Z.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(W.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Z.readToken=function(e){return Tl(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Z.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},Z.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=Pl(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Z.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Nl(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Z.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++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 loop}break;default:if(e>8&&e<14||e>=5760&&Fl.test(String.fromCharCode(e)))++this.pos;else break loop}}},Z.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Z.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(W.ellipsis)):(++this.pos,this.finishToken(W.dot))},Z.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(W.assign,2):this.finishOp(W.slash,1)},Z.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?W.star:W.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=W.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(W.assign,n+1):this.finishOp(r,n)},Z.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(W.assign,3):this.finishOp(e===124?W.logicalOR:W.logicalAND,2):t===61?this.finishOp(W.assign,2):this.finishOp(e===124?W.bitwiseOR:W.bitwiseAND,1)},Z.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(W.assign,2):this.finishOp(W.bitwiseXOR,1)},Z.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||jl.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(W.incDec,2):t===61?this.finishOp(W.assign,2):this.finishOp(W.plusMin,1)},Z.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(W.assign,n+1):this.finishOp(W.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(W.relational,n))},Z.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(W.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(W.arrow)):this.finishOp(e===61?W.eq:W.prefix,1)},Z.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(W.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(W.assign,3):this.finishOp(W.coalesce,2)}return this.finishOp(W.question,1)},Z.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Tl(t,!0)||t===92))return this.finishToken(W.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+Ul(t)+`'`)},Z.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(W.parenL);case 41:return++this.pos,this.finishToken(W.parenR);case 59:return++this.pos,this.finishToken(W.semi);case 44:return++this.pos,this.finishToken(W.comma);case 91:return++this.pos,this.finishToken(W.bracketL);case 93:return++this.pos,this.finishToken(W.bracketR);case 123:return++this.pos,this.finishToken(W.braceL);case 125:return++this.pos,this.finishToken(W.braceR);case 58:return++this.pos,this.finishToken(W.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(W.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===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(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(W.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+Ul(e)+`'`)},Z.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Z.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(jl.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new ud(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(W.regexp,{pattern:i,flags:o,value:c})},Z.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Md(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Nd(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Z.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Nd(this.input.slice(t,this.pos)),++this.pos):Tl(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(W.num,n)},Z.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Nd(this.input.slice(t,this.pos));return++this.pos,Tl(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(W.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),Tl(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Md(this.input.slice(t,this.pos),n);return this.finishToken(W.num,a)},Z.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Z.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Nl(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(W.string,t)};var Pd={};Z.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Pd)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Z.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Pd;this.raise(e,t)},Z.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===W.template||this.type===W.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(W.dollarBraceL)):(++this.pos,this.finishToken(W.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(W.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Nl(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
144
144
|
`;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},Z.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(W.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
145
145
|
`&&++this.pos;case`
|
|
146
146
|
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},Z.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
147
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Bl(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return Al(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Z.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Z.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(Cl(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?Sl:Cl)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Bl(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Z.readWord=function(){var e=this.readWord1(),t=W.name;return this.keywords.test(e)&&(t=Dl[e]),this.finishToken(t,e)};var Md=`8.15.0`;K.acorn={Parser:K,version:Md,defaultOptions:Gl,Position:Hl,SourceLocation:Ul,getLineInfo:Wl,Node:Pu,TokenType:H,tokTypes:W,keywordTypes:Dl,TokContext:Eu,tokContexts:J,isIdentifierChar:Cl,isIdentifierStart:Sl,Token:Od,isNewLine:Al,lineBreak:Ol,lineBreakG:kl,nonASCIIwhitespace:Ml};function Nd(e,t){return K.parse(e,t)}function Pd(e,t,n){return K.parseExpressionAt(e,t,n)}function Fd(e,t){return K.tokenizer(e,t)}var Id=!0;function Ld(e,t={}){return new H(`name`,t)}var Rd=new WeakMap;function zd(e){let t=e.Parser.acorn||e,n=Rd.get(t);if(!n){let e=function(e){return[...[W.name,W.string,W.num],...Object.values(Dl),...Object.values(s)].includes(e)},t=function(e){return[...[W.name],...Object.values(Dl),...Object.values(s)].includes(e)},r=function(e){return[...Object.values(s),W.name].includes(e)},i=function(e){return[s.abstract,s.declare,s.enum,s.module,s.namespace,s.interface,s.type].includes(e)},a=function(e){return[s.keyof,s.readonly,s.unique].includes(e)},o=function(e){return e===W.invalidTemplate},s=Hd(),c=Vd(),l=Bd(),u=RegExp(`^(?:${Object.keys(s).join(`|`)})$`);c.jsxTagStart.updateContext=function(){this.context.push(l.tc_expr),this.context.push(l.tc_oTag),this.exprAllowed=!1},c.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===l.tc_oTag&&e===W.slash||t===l.tc_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===l.tc_expr):this.exprAllowed=!0},n={tokTypes:{...s,...c},tokContexts:{...l},keywordsRegExp:u,tokenIsLiteralPropertyName:e,tokenIsKeywordOrIdentifier:t,tokenIsIdentifier:r,tokenIsTSDeclarationStart:i,tokenIsTSTypeOperator:a,tokenIsTemplate:o}}return n}function Bd(){return{tc_oTag:new Eu(`<tag`,!1,!1),tc_cTag:new Eu(`</tag`,!1,!1),tc_expr:new Eu(`<tag>...</tag>`,!0,!0)}}function Vd(){return{at:new H(`@`),jsxName:new H(`jsxName`),jsxText:new H(`jsxText`,{beforeExpr:!0}),jsxTagStart:new H(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new H(`jsxTagEnd`)}}function Hd(){return{assert:Ld(`assert`,{startsExpr:Id}),asserts:Ld(`asserts`,{startsExpr:Id}),global:Ld(`global`,{startsExpr:Id}),keyof:Ld(`keyof`,{startsExpr:Id}),readonly:Ld(`readonly`,{startsExpr:Id}),unique:Ld(`unique`,{startsExpr:Id}),abstract:Ld(`abstract`,{startsExpr:Id}),declare:Ld(`declare`,{startsExpr:Id}),enum:Ld(`enum`,{startsExpr:Id}),module:Ld(`module`,{startsExpr:Id}),namespace:Ld(`namespace`,{startsExpr:Id}),interface:Ld(`interface`,{startsExpr:Id}),type:Ld(`type`,{startsExpr:Id})}}var Ud=512,Wd=1024,Gd=1,Kd=2,qd=4,Jd=8,Yd=16,Xd=64,Zd=128,Qd=256,$d=512,ef=1024;Gd|Kd|Jd|Zd,Gd|0|Jd|0,Gd|0|qd|0,Gd|0|Yd|0,Kd|0|Zd,Kd|0;var tf=Gd|Kd|Jd|Qd;0|ef,0|Xd,Gd|0|Xd,tf|$d,0|ef;var nf=4,rf=2,af=1;rf|af,rf|nf,af|nf;var of=RegExp(`(?=((?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*))\\1(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)`,`y`),sf=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function cf(e,t){let n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function lf(e,t){let{computed:n,key:r}=e;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}var Q={AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' 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:e})=>`Cannot find name '${e}'.`,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:e})=>`'declare' is not allowed in ${e}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:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' 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:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:`Index signatures cannot have the 'abstract' modifier.`,IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,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:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[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.`,MixedLabeledAndUnlabeledElements:`Tuple members must all have names or all not have names.`,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:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,PrivateMethodsHasAccessibility:({modifier:e})=>`Private methods cannot have an accessibility modifier ('${e}').`,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:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,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:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,LetInLexicalBinding:`'let' is not allowed to be used as a name in 'let' or 'const' declarations.`},uf={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 df(e,t,n){let{tokTypes:r}=n,{tokTypes:i}=t;return class extends e{takeDecorators(e){let t=this.decoratorStack[this.decoratorStack.length-1];t.length&&(e.decorators=t,this.resetStartLocationFromNode(e,t[0]),this.decoratorStack[this.decoratorStack.length-1]=[])}parseDecorators(e){let t=this.decoratorStack[this.decoratorStack.length-1];for(;this.match(i.at);){let e=this.parseDecorator();t.push(e)}this.match(r._export)?e||this.unexpected():this.canHaveLeadingDecorator()||this.raise(this.start,uf.UnexpectedLeadingDecorator)}parseDecorator(){let e=this.startNode();this.next(),this.decoratorStack.push([]);let t=this.start,n=this.startLoc,i;if(this.match(r.parenL)){let e=this.start,t=this.startLoc;if(this.next(),i=this.parseExpression(),this.expect(r.parenR),this.options.preserveParens){let n=this.startNodeAt(e,t);n.expression=i,i=this.finishNode(n,`ParenthesizedExpression`)}}else for(i=this.parseIdent(!1);this.eat(r.dot);){let e=this.startNodeAt(t,n);e.object=i,e.property=this.parseIdent(!0),e.computed=!1,i=this.finishNode(e,`MemberExpression`)}return e.expression=this.parseMaybeDecoratorArguments(i),this.decoratorStack.pop(),this.finishNode(e,`Decorator`)}parseMaybeDecoratorArguments(e){if(this.eat(r.parenL)){let t=this.startNodeAtNode(e);return t.callee=e,t.arguments=this.parseExprList(r.parenR,!1),this.finishNode(t,`CallExpression`)}return e}}}var ff={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,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:`♦`},pf=/^[\da-fA-F]+$/,mf=/^\d+$/;function hf(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return hf(e.object)+`.`+hf(e.property)}function gf(e,t,n,r){let i=e.tokTypes,a=t.tokTypes,o=e.isNewLine,s=e.isIdentifierChar,c=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},r||{});return class extends n{jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(a.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(a.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`>`:`}`)+'` or `{"'+this.input[this.pos]+'"}`?');default:o(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
|
|
147
|
+
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Ul(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return Nl(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Z.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Z.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(El(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?Tl:El)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Ul(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Z.readWord=function(){var e=this.readWord1(),t=W.name;return this.keywords.test(e)&&(t=Al[e]),this.finishToken(t,e)};var Fd=`8.15.0`;K.acorn={Parser:K,version:Fd,defaultOptions:Jl,Position:Gl,SourceLocation:Kl,getLineInfo:ql,Node:Lu,TokenType:H,tokTypes:W,keywordTypes:Al,TokContext:ku,tokContexts:J,isIdentifierChar:El,isIdentifierStart:Tl,Token:jd,isNewLine:Nl,lineBreak:jl,lineBreakG:Ml,nonASCIIwhitespace:Fl};function Id(e,t){return K.parse(e,t)}function Ld(e,t,n){return K.parseExpressionAt(e,t,n)}function Rd(e,t){return K.tokenizer(e,t)}var zd=!0;function Bd(e,t={}){return new H(`name`,t)}var Vd=new WeakMap;function Hd(e){let t=e.Parser.acorn||e,n=Vd.get(t);if(!n){let e=function(e){return[...[W.name,W.string,W.num],...Object.values(Al),...Object.values(s)].includes(e)},t=function(e){return[...[W.name],...Object.values(Al),...Object.values(s)].includes(e)},r=function(e){return[...Object.values(s),W.name].includes(e)},i=function(e){return[s.abstract,s.declare,s.enum,s.module,s.namespace,s.interface,s.type].includes(e)},a=function(e){return[s.keyof,s.readonly,s.unique].includes(e)},o=function(e){return e===W.invalidTemplate},s=Gd(),c=Wd(),l=Ud(),u=RegExp(`^(?:${Object.keys(s).join(`|`)})$`);c.jsxTagStart.updateContext=function(){this.context.push(l.tc_expr),this.context.push(l.tc_oTag),this.exprAllowed=!1},c.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===l.tc_oTag&&e===W.slash||t===l.tc_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===l.tc_expr):this.exprAllowed=!0},n={tokTypes:{...s,...c},tokContexts:{...l},keywordsRegExp:u,tokenIsLiteralPropertyName:e,tokenIsKeywordOrIdentifier:t,tokenIsIdentifier:r,tokenIsTSDeclarationStart:i,tokenIsTSTypeOperator:a,tokenIsTemplate:o}}return n}function Ud(){return{tc_oTag:new ku(`<tag`,!1,!1),tc_cTag:new ku(`</tag`,!1,!1),tc_expr:new ku(`<tag>...</tag>`,!0,!0)}}function Wd(){return{at:new H(`@`),jsxName:new H(`jsxName`),jsxText:new H(`jsxText`,{beforeExpr:!0}),jsxTagStart:new H(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new H(`jsxTagEnd`)}}function Gd(){return{assert:Bd(`assert`,{startsExpr:zd}),asserts:Bd(`asserts`,{startsExpr:zd}),global:Bd(`global`,{startsExpr:zd}),keyof:Bd(`keyof`,{startsExpr:zd}),readonly:Bd(`readonly`,{startsExpr:zd}),unique:Bd(`unique`,{startsExpr:zd}),abstract:Bd(`abstract`,{startsExpr:zd}),declare:Bd(`declare`,{startsExpr:zd}),enum:Bd(`enum`,{startsExpr:zd}),module:Bd(`module`,{startsExpr:zd}),namespace:Bd(`namespace`,{startsExpr:zd}),interface:Bd(`interface`,{startsExpr:zd}),type:Bd(`type`,{startsExpr:zd})}}var Kd=512,qd=1024,Jd=1,Yd=2,Xd=4,Zd=8,Qd=16,$d=64,ef=128,tf=256,nf=512,rf=1024;Jd|Yd|Zd|ef,Jd|0|Zd|0,Jd|0|Xd|0,Jd|0|Qd|0,Yd|0|ef,Yd|0;var af=Jd|Yd|Zd|tf;0|rf,0|$d,Jd|0|$d,af|nf,0|rf;var of=4,sf=2,cf=1;sf|cf,sf|of,cf|of;var lf=RegExp(`(?=((?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*))\\1(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)`,`y`),uf=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function df(e,t){let n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function ff(e,t){let{computed:n,key:r}=e;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}var Q={AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' 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:e})=>`Cannot find name '${e}'.`,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:e})=>`'declare' is not allowed in ${e}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:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' 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:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:`Index signatures cannot have the 'abstract' modifier.`,IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,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:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[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.`,MixedLabeledAndUnlabeledElements:`Tuple members must all have names or all not have names.`,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:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,PrivateMethodsHasAccessibility:({modifier:e})=>`Private methods cannot have an accessibility modifier ('${e}').`,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:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,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:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,LetInLexicalBinding:`'let' is not allowed to be used as a name in 'let' or 'const' declarations.`},pf={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 mf(e,t,n){let{tokTypes:r}=n,{tokTypes:i}=t;return class extends e{takeDecorators(e){let t=this.decoratorStack[this.decoratorStack.length-1];t.length&&(e.decorators=t,this.resetStartLocationFromNode(e,t[0]),this.decoratorStack[this.decoratorStack.length-1]=[])}parseDecorators(e){let t=this.decoratorStack[this.decoratorStack.length-1];for(;this.match(i.at);){let e=this.parseDecorator();t.push(e)}this.match(r._export)?e||this.unexpected():this.canHaveLeadingDecorator()||this.raise(this.start,pf.UnexpectedLeadingDecorator)}parseDecorator(){let e=this.startNode();this.next(),this.decoratorStack.push([]);let t=this.start,n=this.startLoc,i;if(this.match(r.parenL)){let e=this.start,t=this.startLoc;if(this.next(),i=this.parseExpression(),this.expect(r.parenR),this.options.preserveParens){let n=this.startNodeAt(e,t);n.expression=i,i=this.finishNode(n,`ParenthesizedExpression`)}}else for(i=this.parseIdent(!1);this.eat(r.dot);){let e=this.startNodeAt(t,n);e.object=i,e.property=this.parseIdent(!0),e.computed=!1,i=this.finishNode(e,`MemberExpression`)}return e.expression=this.parseMaybeDecoratorArguments(i),this.decoratorStack.pop(),this.finishNode(e,`Decorator`)}parseMaybeDecoratorArguments(e){if(this.eat(r.parenL)){let t=this.startNodeAtNode(e);return t.callee=e,t.arguments=this.parseExprList(r.parenR,!1),this.finishNode(t,`CallExpression`)}return e}}}var hf={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,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:`♦`},gf=/^[\da-fA-F]+$/,_f=/^\d+$/;function vf(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return vf(e.object)+`.`+vf(e.property)}function yf(e,t,n,r){let i=e.tokTypes,a=t.tokTypes,o=e.isNewLine,s=e.isIdentifierChar,c=Object.assign({allowNamespaces:!0,allowNamespacedObjects:!0},r||{});return class extends n{jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(a.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(a.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`>`:`}`)+'` or `{"'+this.input[this.pos]+'"}`?');default:o(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
|
|
148
148
|
`:`\r
|
|
149
|
-
`):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):o(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(i.string,t)}jsx_readEntity(){let e=``,t=0,n,r=this.input[this.pos];r!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let i=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(r=this.input[this.pos++],r===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),pf.test(e)&&(n=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),mf.test(e)&&(n=String.fromCharCode(parseInt(e,10)))):n=ff[e];break}e+=r}return n||(this.pos=i,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(s(e)||e===45);return this.finishToken(a.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===a.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let e=this.start,t=this.startLoc,n=this.jsx_parseIdentifier();if(!c.allowNamespaces||!this.eat(i.colon))return n;var r=this.startNodeAt(e,t);return r.namespace=n,r.name=this.jsx_parseIdentifier(),this.finishNode(r,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===a.jsxTagEnd)return``;let e=this.start,t=this.startLoc,n=this.jsx_parseNamespacedName();for(this.type===i.dot&&n.type===`JSXNamespacedName`&&!c.allowNamespacedObjects&&this.unexpected();this.eat(i.dot);){let r=this.startNodeAt(e,t);r.object=n,r.property=this.jsx_parseIdentifier(),n=this.finishNode(r,`JSXMemberExpression`)}return n}jsx_parseAttributeValue(){switch(this.type){case i.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case a.jsxTagStart:case i.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===i.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(i.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(i.braceL)?(this.expect(i.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(i.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(i.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==i.slash&&this.type!==a.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(i.slash),this.expect(a.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(a.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],o=this.jsx_parseOpeningElementAt(e,t),s=null;if(!o.selfClosing){contents:for(;;)switch(this.type){case a.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(i.slash)){s=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case a.jsxText:r.push(this.parseExprAtom());break;case i.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}hf(s.name)!==hf(o.name)&&this.raise(s.start,`Expected corresponding JSX closing tag for <`+hf(o.name)+`>`)}let c=o.name?`Element`:`Fragment`;return n[`opening`+c]=o,n[`closing`+c]=s,n.children=r,this.type===i.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+c)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}}}function _f(e,t,n){let{tokTypes:r}=t,{tokTypes:i}=n;return class extends e{parseMaybeImportAttributes(e){if(this.type===i._with||this.type===r.assert){this.next();let t=this.parseImportAttributes();t&&(e.attributes=t)}}parseImportAttributes(){this.expect(i.braceL);let e=this.parseWithEntries();return this.expect(i.braceR),e}parseWithEntries(){let e=[],t=new Set;do{if(this.type===i.braceR)break;let n=this.startNode(),r;r=this.type===i.string?this.parseLiteral(this.value):this.parseIdent(!0),this.next(),n.key=r,t.has(n.key.name)&&this.raise(this.pos,`Duplicated key in attributes`),t.add(n.key.name),this.type!==i.string&&this.raise(this.pos,`Only string is supported as an attribute value`),n.value=this.parseLiteral(this.value),e.push(this.finishNode(n,`ImportAttribute`))}while(this.eat(i.comma));return e}}}var vf=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function yf(e){if(!e)throw Error(`Assert fail`)}function bf(e){return e===`accessor`}function xf(e){return e===`in`||e===`out`}var Sf=1,Cf=2,wf=4,$={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:8,BIND_FLAGS_TS_EXPORT_ONLY:1024,BIND_FLAGS_TS_IMPORT:4096,BIND_FLAGS_TS_ENUM:256,BIND_FLAGS_TS_CONST_ENUM:512,BIND_FLAGS_CLASS:128};function Tf(e,t){return $.SCOPE_FUNCTION|(e?$.SCOPE_ASYNC:0)|(t?$.SCOPE_GENERATOR:0)}function Ef(e){if(e.type!==`MemberExpression`)return!1;let{computed:t,property:n}=e;return t&&(n.type!==`TemplateLiteral`||n.expressions.length>0)?!1:Df(e.object)}function Df(e){return e.type===`Identifier`?!0:e.type!==`MemberExpression`||e.computed?!1:Df(e.object)}function Of(e){return e===`private`||e===`public`||e===`protected`}function kf(e){return!!e.startsExpr}function Af(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function jf(e){switch(e){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 Mf(e){let{dts:t=!1}=e||{},n=!!e?.jsx;return function(r){let i=r.acorn||ul,a=zd(i),o=i.tokTypes,s=i.keywordTypes,c=i.isIdentifierStart,l=i.lineBreak,u=i.isNewLine,d=i.tokContexts,f=i.isIdentifierChar,{tokTypes:p,tokContexts:m,keywordsRegExp:h,tokenIsLiteralPropertyName:g,tokenIsTemplate:_,tokenIsTSDeclarationStart:v,tokenIsIdentifier:y,tokenIsKeywordOrIdentifier:b,tokenIsTSTypeOperator:x}=a;function S(e,t,n=e.length){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(u(t))return r<n-1&&t===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}r=df(r,a,i),e?.jsx&&(r=gf(i,a,r,typeof e.jsx==`boolean`?{}:e.jsx)),r=_f(r,a,i);class C extends r{constructor(e,t,n){super(e,t,n),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=e=>{this.tsParseModifiers({modified:e,allowedModifiers:[`const`],disallowedModifiers:[`in`,`out`],errorTemplate:Q.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return a}get acornTypeScript(){return a}getTokenFromCodeInType(e){return e===62||e===60?this.finishOp(o.relational,1):super.getTokenFromCode(e)}readToken(t){if(!this.inType){let n=this.curContext();if(n===m.tc_expr)return this.jsx_readToken();if(n===m.tc_oTag||n===m.tc_cTag){if(c(t))return this.jsx_readWord();if(t==62)return++this.pos,this.finishToken(p.jsxTagEnd);if((t===34||t===39)&&n==m.tc_oTag)return this.jsx_readString(t)}if(t===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)return++this.pos,e?.jsx?this.finishToken(p.jsxTagStart):this.finishToken(o.relational,`<`)}return super.readToken(t)}getTokenFromCode(e){return this.inType?this.getTokenFromCodeInType(e):e===64?(++this.pos,this.finishToken(p.at)):super.getTokenFromCode(e)}isAbstractClass(){return this.ts_isContextual(p.abstract)&&this.lookahead().type===o._class}finishNode(e,t){return e.type!==``&&e.end!==0?e:super.finishNode(e,t)}tryParse(e,t=this.cloneCurLookaheadState()){let n={node:null};try{return{node:e((e=null)=>{throw n.node=e,n}),error:null,thrown:!1,aborted:!1,failState:null}}catch(e){let r=this.getCurLookaheadState();if(this.setLookaheadState(t),e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:r};if(e===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:r};throw e}}setOptionalParametersError(e,t){e.optionalParametersLoc=t?.loc??this.startLoc}reScan_lt_gt(){this.type===o.relational&&(--this.pos,this.readToken_lt_gt(this.fullCharCodeAtPos()))}reScan_lt(){let{type:e}=this;return e===o.bitShift?(this.pos-=2,this.finishOp(o.relational,1),o.relational):e}resetEndLocation(e,t=this.lastTokEnd,n=this.lastTokEndLoc){e.end=t,e.loc.end=n,this.options.ranges&&(e.range[1]=t)}startNodeAtNode(e){return super.startNodeAt(e.start,e.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(e,t){return t.some(t=>Of(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(`static`)&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{e?.type===`TSTypeCastExpression`&&this.raise(e.typeAnnotation.start,Q.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(e){return e.type===`Identifier`&&e.name===`async`&&this.lastTokEndLoc.column===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&e.start===this.potentialArrowAt}tsIsIdentifier(){return y(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(o.colon)?this.tsParseTypeOrTypePredicateAnnotation(o.colon):void 0}tsTryParseGenericAsyncArrowFunction(e,t,n){if(!this.tsMatchLeftRelational())return;let r=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let n=this.startNodeAt(e,t);return n.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(n),n.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(o.arrow),n});if(this.maybeInArrowParameters=r,i)return super.parseArrowExpression(i,null,!0,n)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===o.relational)return this.tsParseTypeArguments()}tsInNoContext(e){let t=this.context;this.context=[t[0]];try{return e()}finally{this.context=t}}tsTryParseTypeAnnotation(){return this.match(o.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(e,t){let n=e+t.length;if(this.input.slice(e,n)===t){let e=this.input.charCodeAt(n);return!(f(e)||(e&64512)==55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(p.abstract)&&this.lookahead().type===o._new}nextTokenStartSince(e){return vf.lastIndex=e,vf.test(this.input)?vf.lastIndex:e}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}compareLookaheadState(e,t){for(let n of Object.keys(e))if(e[n]!==t[n])return!1;return!0}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,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}}cloneCurLookaheadState(){return{pos:this.pos,value:this.value,type:this.type,start:this.start,end:this.end,context:this.context&&this.context.slice(),startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}}setLookaheadState(e){this.pos=e.pos,this.value=e.value,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.context=e.context,this.startLoc=e.startLoc,this.lastTokEndLoc=e.lastTokEndLoc,this.curLine=e.curLine,this.lineStart=e.lineStart,this.curPosition=e.curPosition,this.containsEsc=e.containsEsc}tsLookAhead(e){let t=this.getCurLookaheadState(),n=e();return this.setLookaheadState(t),n}lookahead(e){let t=this.getCurLookaheadState();if(this.createLookaheadState(),this.isLookahead=!0,e!==void 0)for(let t=0;t<e;t++)this.nextToken();else this.nextToken();this.isLookahead=!1;let n=this.getCurLookaheadState();return this.setLookaheadState(t),n}readWord(){let e=this.readWord1(),t=o.name;return this.keywords.test(e)?t=s[e]:new RegExp(h).test(e)&&(t=p[e]),this.finishToken(t,e)}skipBlockComment(){let e;this.isLookahead||(e=this.options.onComment&&this.curPosition());let t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(let e,n=t;(e=S(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=e;this.isLookahead||this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())}skipLineComment(e){let t=this.pos,n;this.isLookahead||(n=this.options.onComment&&this.curPosition());let r=this.input.charCodeAt(this.pos+=e);for(;this.pos<this.input.length&&!u(r);)r=this.input.charCodeAt(++this.pos);this.isLookahead||this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())}finishToken(e,t){this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());let n=this.type;this.type=e,this.value=t,this.isLookahead||this.updateContext(n)}resetStartLocation(e,t,n){e.start=t,e.loc.start=n,this.options.ranges&&(e.range[0]=t)}isLineTerminator(){return this.eat(o.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return of.lastIndex=this.end,of.test(this.input)}addExtra(e,t,n,r=!0){if(!e)return;let i=e.extra=e.extra||{};r?i[t]=n:Object.defineProperty(i,t,{enumerable:r,value:n})}isLiteralPropertyName(){return g(this.type)}hasPrecedingLineBreak(){return l.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(e,t){return e.name=t,this.finishNode(e,`Identifier`)}resetStartLocationFromNode(e,t){this.resetStartLocation(e,t.start,t.loc.start)}isThisParam(e){return e.type===`Identifier`&&e.name===`this`}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}ts_type_isContextual(e,t){return e===t&&!this.containsEsc}ts_isContextual(e){return this.type===e&&!this.containsEsc}ts_isContextualWithState(e,t){return e.type===t&&!e.containsEsc}isContextualWithState(e,t){return t.type===o.name&&t.value===e&&!t.containsEsc}tsIsStartOfMappedType(){return this.next(),this.eat(o.plusMin)?this.ts_isContextual(p.readonly):(this.ts_isContextual(p.readonly)&&this.next(),!this.match(o.bracketL)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(o._in)))}tsInDisallowConditionalTypesContext(e){let t=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.inDisallowConditionalTypesContext=t}}tsTryParseType(){return this.tsEatThenParseType(o.colon)}match(e){return this.type===e}matchJsx(e){return this.type===a.tokTypes[e]}ts_eatWithState(e,t,n){if(e===n.type){for(let e=0;e<t;e++)this.next();return!0}else return!1}ts_eatContextualWithState(e,t,n){if(h.test(e)){if(this.ts_isContextualWithState(n,p[e])){for(let e=0;e<t;e++)this.next();return!0}return!1}else{if(!this.isContextualWithState(e,n))return!1;for(let e=0;e<t;e++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(o._class)}eatContextual(e){return h.test(e)?this.ts_isContextual(p[e])?(this.next(),!0):!1:super.eatContextual(e)}tsIsExternalModuleReference(){return this.isContextual(`require`)&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(`require`),this.expect(o.parenL),this.match(o.string)||this.unexpected(),e.expression=this.parseExprAtom(),this.expect(o.parenR),this.finishNode(e,`TSExternalModuleReference`)}tsParseEntityName(e=!0){let t=this.parseIdent(e);for(;this.eat(o.dot);){let n=this.startNodeAtNode(t);n.left=t,n.right=this.parseIdent(e),t=this.finishNode(n,`TSQualifiedName`)}return t}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(o.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(o.eq)&&(e.initializer=this.parseMaybeAssign()),this.finishNode(e,`TSEnumMember`)}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(`enum`),e.id=this.parseIdent(),this.checkLValSimple(e.id),this.expect(o.braceL),e.members=this.tsParseDelimitedList(`EnumMembers`,this.tsParseEnumMember.bind(this)),this.expect(o.braceR),this.finishNode(e,`TSEnumDeclaration`)}tsParseModuleBlock(){let e=this.startNode();for(this.enterScope(Ud),this.expect(o.braceL),e.body=[];this.type!==o.braceR;){let t=this.parseStatement(null,!0);e.body.push(t)}return this.next(),super.exitScope(),this.finishNode(e,`TSModuleBlock`)}tsParseAmbientExternalModuleDeclaration(e){return this.ts_isContextual(p.global)?(e.global=!0,e.id=this.parseIdent()):this.match(o.string)?e.id=this.parseLiteral(this.value):this.unexpected(),this.match(o.braceL)?(this.enterScope(Wd),e.body=this.tsParseModuleBlock(),super.exitScope()):super.semicolon(),this.finishNode(e,`TSModuleDeclaration`)}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.type,n;return this.isContextual(`let`)&&(t=o._var,n=`let`),this.tsInAmbientContext(()=>{if(t===o._function)return e.declare=!0,this.parseFunctionStatement(e,!1,!0);if(t===o._class)return e.declare=!0,this.parseClass(e,!0);if(t===p.enum)return this.tsParseEnumDeclaration(e,{declare:!0});if(t===p.global)return this.tsParseAmbientExternalModuleDeclaration(e);if(t===o._const||t===o._var)return!this.match(o._const)||!this.isLookaheadContextual(`enum`)?(e.declare=!0,this.parseVarStatement(e,n||this.value,!0)):(this.expect(o._const),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));if(t===p.interface){let t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}if(y(t))return this.tsParseDeclaration(e,this.value,!0)})}tsIsListTerminator(e){switch(e){case`EnumMembers`:case`TypeMembers`:return this.match(o.braceR);case`HeritageClauseElement`:return this.match(o.braceL);case`TupleElementTypes`:return this.match(o.bracketR);case`TypeParametersOrArguments`:return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(e,t,n,r){let i=[],a=-1;for(;!this.tsIsListTerminator(e);){a=-1;let r=t();if(r==null)return;if(i.push(r),this.eat(o.comma)){a=this.lastTokStart;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(o.comma);return}return r&&(r.value=a),i}tsParseDelimitedList(e,t,n){return Af(this.tsParseDelimitedListWorker(e,t,!0,n))}tsParseBracketedList(e,t,n,r,i){r||(n?this.expect(o.bracketL):this.expect(o.relational));let a=this.tsParseDelimitedList(e,t,i);return n?this.expect(o.bracketR):this.expect(o.relational),a}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(e){return this.match(e)?this.tsNextThenParseType():void 0}tsExpectThenParseType(e){return this.tsDoThenParseType(()=>this.expect(e))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(e){return this.tsInType(()=>(e(),this.tsParseType()))}tsSkipParameterStart(){if(y(this.type)||this.match(o._this))return this.next(),!0;if(this.match(o.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(o.bracketL)){this.next();try{return this.parseBindingList(o.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(o.parenR)||this.match(o.ellipsis)||this.tsSkipParameterStart()&&(this.match(o.colon)||this.match(o.comma)||this.match(o.question)||this.match(o.eq)||this.match(o.parenR)&&(this.next(),this.match(o.arrow))))}tsIsStartOfFunctionType(){return this.tsMatchLeftRelational()?!0:this.match(o.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(e){let t=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.inDisallowConditionalTypesContext=t}}tsParseBindingListForSignature(){return super.parseBindingList(o.parenR,!0,!0).map(e=>(e.type!==`Identifier`&&e.type!==`RestElement`&&e.type!==`ObjectPattern`&&e.type!==`ArrayPattern`&&this.raise(e.start,Q.UnsupportedSignatureParameterKind(e.type)),e))}tsParseTypePredicateAsserts(){if(this.type!==p.asserts)return!1;let e=this.containsEsc;return this.next(),!y(this.type)&&!this.match(o._this)?!1:(e&&this.raise(this.lastTokStart,`Escape sequence in keyword asserts`),!0)}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,`TSThisType`)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(o.colon),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,`TSTypeAnnotation`)}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,`TSTypePredicate`)}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(`is`)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseTypePredicatePrefix(){let e=this.parseIdent();if(this.isContextual(`is`)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let n=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(o._this)){let e=this.tsParseThisTypeOrThisTypePredicate();return e.type===`TSThisType`?(n.parameterName=e,n.asserts=!0,n.typeAnnotation=null,e=this.finishNode(n,`TSTypePredicate`)):(this.resetStartLocationFromNode(e,n),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,`TSTypeAnnotation`)}let i=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!i)return r?(n.parameterName=this.parseIdent(),n.asserts=r,n.typeAnnotation=null,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)):this.tsParseTypeAnnotation(!1,t);let a=this.tsParseTypeAnnotation(!1);return n.parameterName=i,n.typeAnnotation=a,n.asserts=r,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)})}tsFillSignature(e,t){let n=e===o.arrow;t.typeParameters=this.tsTryParseTypeParameters(),this.expect(o.parenL),t.parameters=this.tsParseBindingListForSignature(),(n||this.match(e))&&(t.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(e))}tsTryNextParseConstantContext(){if(this.lookahead().type!==o._const)return null;this.next();let e=this.tsParseTypeReference();return(e.typeParameters||e.typeArguments)&&this.raise(e.typeName.start,Q.CannotFindName({name:`const`})),e}tsParseFunctionOrConstructorType(e,t){let n=this.startNode();return e===`TSConstructorType`&&(n.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(o.arrow,n)),this.finishNode(n,e)}tsParseUnionOrIntersectionType(e,t,n){let r=this.startNode(),i=this.eat(n),a=[];do a.push(t());while(this.eat(n));return a.length===1&&!i?a[0]:(r.types=a,this.finishNode(r,e))}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case`TSTupleType`:case`TSArrayType`:return;default:this.raise(e.start,Q.UnexpectedReadonly)}}tsParseTypeOperator(){let e=this.startNode(),t=this.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t===`readonly`&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,`TSTypeOperator`)}tsParseConstraintForInferType(){if(this.eat(o._extends)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(o.question))return e}}tsParseInferType(){let e=this.startNode();this.expectContextual(`infer`);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,`TSTypeParameter`),this.finishNode(e,`TSInferType`)}tsParseLiteralTypeNode(){let e=this.startNode();return e.literal=(()=>{switch(this.type){case o.num:case o.string:case o._true:case o._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(e,`TSLiteralType`)}tsParseImportType(){let e=this.startNode();return this.expect(o._import),this.expect(o.parenL),this.match(o.string)||this.raise(this.start,Q.UnsupportedImportTypeArgument),e.argument=this.parseExprAtom(),this.expect(o.parenR),this.eat(o.dot)&&(e.qualifier=this.tsParseEntityName()),this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSImportType`)}tsParseTypeQuery(){let e=this.startNode();return this.expect(o._typeof),this.match(o._import)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeQuery`)}tsParseMappedTypeParameter(){let e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(o._in),this.finishNode(e,`TSTypeParameter`)}tsParseMappedType(){let e=this.startNode();return this.expect(o.braceL),this.match(o.plusMin)?(e.readonly=this.value,this.next(),this.expectContextual(`readonly`)):this.eatContextual(`readonly`)&&(e.readonly=!0),this.expect(o.bracketL),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual(`as`)?this.tsParseType():null,this.expect(o.bracketR),this.match(o.plusMin)?(e.optional=this.value,this.next(),this.expect(o.question)):this.eat(o.question)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(o.braceR),this.finishNode(e,`TSMappedType`)}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,`TSTypeLiteral`)}tsParseTupleElementType(){let e=this.startLoc,t=this.start,n=this.eat(o.ellipsis),r=this.tsParseType(),i=this.eat(o.question);if(this.eat(o.colon)){let e=this.startNodeAtNode(r);e.optional=i,r.type===`TSTypeReference`&&!r.typeArguments&&r.typeName.type===`Identifier`?e.label=r.typeName:(this.raise(r.start,Q.InvalidTupleMemberLabel),e.label=r),e.elementType=this.tsParseType(),r=this.finishNode(e,`TSNamedTupleMember`)}else if(i){let e=this.startNodeAtNode(r);e.typeAnnotation=r,r=this.finishNode(e,`TSOptionalType`)}if(n){let n=this.startNodeAt(t,e);n.typeAnnotation=r,r=this.finishNode(n,`TSRestType`)}return r}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList(`TupleElementTypes`,this.tsParseTupleElementType.bind(this),!0,!1);let t=!1,n=null;return e.elementTypes.forEach(e=>{let{type:r}=e;t&&r!==`TSRestType`&&r!==`TSOptionalType`&&!(r===`TSNamedTupleMember`&&e.optional)&&this.raise(e.start,Q.OptionalTypeBeforeRequired),t||=r===`TSNamedTupleMember`&&e.optional||r===`TSOptionalType`;let i=r;r===`TSRestType`&&(e=e.typeAnnotation,i=e.type);let a=i===`TSNamedTupleMember`;n??=a,n!==a&&this.raise(e.start,Q.MixedLabeledAndUnlabeledElements)}),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();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeReference`)}tsMatchLeftRelational(){return this.match(o.relational)&&this.value===`<`}tsMatchRightRelational(){return this.match(o.relational)&&this.value===`>`}tsParseParenthesizedType(){let e=this.startNode();return this.expect(o.parenL),e.typeAnnotation=this.tsParseType(),this.expect(o.parenR),this.finishNode(e,`TSParenthesizedType`)}tsParseNonArrayType(){switch(this.type){case o.string:case o.num:case o._true:case o._false:return this.tsParseLiteralTypeNode();case o.plusMin:if(this.value===`-`){let e=this.startNode();return this.lookahead().type!==o.num&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,`TSLiteralType`)}break;case o._this:return this.tsParseThisTypeOrThisTypePredicate();case o._typeof:return this.tsParseTypeQuery();case o._import:return this.tsParseImportType();case o.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case o.bracketL:return this.tsParseTupleType();case o.parenL:return this.tsParseParenthesizedType();case o.backQuote:case o.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:e}=this;if(y(e)||e===o._void||e===o._null){let t=e===o._void?`TSVoidKeyword`:e===o._null?`TSNullKeyword`:jf(this.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(o.bracketL);)if(this.match(o.bracketR)){let t=this.startNodeAtNode(e);t.elementType=e,this.expect(o.bracketR),e=this.finishNode(t,`TSArrayType`)}else{let t=this.startNodeAtNode(e);t.objectType=e,t.indexType=this.tsParseType(),this.expect(o.bracketR),e=this.finishNode(t,`TSIndexedAccessType`)}return e}tsParseTypeOperatorOrHigher(){return x(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual(`infer`)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSIntersectionType`,this.tsParseTypeOperatorOrHigher.bind(this),o.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSUnionType`,this.tsParseIntersectionTypeOrHigher.bind(this),o.bitwiseOR)}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType(`TSFunctionType`):this.match(o._new)?this.tsParseFunctionOrConstructorType(`TSConstructorType`):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType(`TSConstructorType`,!0):this.tsParseUnionTypeOrHigher()}tsParseType(){yf(this.inType);let e=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(o._extends))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(o.question),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(o.colon),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,`TSConditionalType`)}tsIsUnambiguouslyIndexSignature(){return this.next(),y(this.type)?(this.next(),this.match(o.colon)):!1}tsInType(e){let t=this.inType;this.inType=!0;try{return e()}finally{this.inType=t}}tsTryParseIndexSignature(e){if(!(this.match(o.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(o.bracketL);let t=this.parseIdent();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(o.bracketR),e.parameters=[t];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSIndexSignature`)}tsParseNoneModifiers(e){this.tsParseModifiers({modified:e,allowedModifiers:[],disallowedModifiers:[`in`,`out`],errorTemplate:Q.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(e=this.tsParseNoneModifiers.bind(this)){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(o._extends),t.default=this.tsEatThenParseType(o.eq),this.finishNode(t,`TSTypeParameter`)}tsParseTypeParameters(e){let t=this.startNode();this.tsMatchLeftRelational()||this.matchJsx(`jsxTagStart`)?this.next():this.unexpected();let n={value:-1};return t.params=this.tsParseBracketedList(`TypeParametersOrArguments`,this.tsParseTypeParameter.bind(this,e),!1,!0,n),t.params.length===0&&this.raise(this.start,Q.EmptyTypeParameters),n.value!==-1&&this.addExtra(t,`trailingComma`,n.value),this.finishNode(t,`TSTypeParameterDeclaration`)}tsTryParseTypeParameters(e){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(e)}tsTryParse(e){let t=this.getCurLookaheadState(),n=e();if(n!==void 0&&n!==!1)return n;this.setLookaheadState(t)}tsTokenCanFollowModifier(){return(this.match(o.bracketL)||this.match(o.braceL)||this.match(o.star)||this.match(o.ellipsis)||this.match(o.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(e,t){let n=this.value;if(e.indexOf(n)!==-1&&!this.containsEsc){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}}tsParseModifiersByMap({modified:e,map:t}){for(let n of Object.keys(t))e[n]=t[n]}tsParseModifiers({modified:e,allowedModifiers:t,disallowedModifiers:n,stopOnStartOfClassStaticBlock:r,errorTemplate:i=Q.InvalidModifierOnTypeMember}){let a={},o=(t,n,r,i)=>{n===r&&e[i]&&this.raise(t.column,Q.InvalidModifiersOrder({orderedModifiers:[r,i]}))},s=(t,n,r,i)=>{(e[r]&&n===i||e[i]&&n===r)&&this.raise(t.column,Q.IncompatibleModifiers({modifiers:[r,i]}))};for(;;){let c=this.startLoc,l=this.tsParseModifier(t.concat(n??[]),r);if(!l)break;Of(l)?e.accessibility?this.raise(this.start,Q.DuplicateAccessibilityModifier()):(o(c,l,l,`override`),o(c,l,l,`static`),o(c,l,l,`readonly`),o(c,l,l,`accessor`),a.accessibility=l,e.accessibility=l):xf(l)?e[l]?this.raise(this.start,Q.DuplicateModifier({modifier:l})):(o(c,l,`in`,`out`),a[l]=l,e[l]=!0):bf(l)?e[l]?this.raise(this.start,Q.DuplicateModifier({modifier:l})):(s(c,l,`accessor`,`readonly`),s(c,l,`accessor`,`static`),s(c,l,`accessor`,`override`),a[l]=l,e[l]=!0):l===`const`?e[l]?this.raise(this.start,Q.DuplicateModifier({modifier:l})):(a[l]=l,e[l]=!0):Object.hasOwnProperty.call(e,l)?this.raise(this.start,Q.DuplicateModifier({modifier:l})):(o(c,l,`static`,`readonly`),o(c,l,`static`,`override`),o(c,l,`override`,`readonly`),o(c,l,`abstract`,`override`),s(c,l,`declare`,`override`),s(c,l,`static`,`abstract`),a[l]=l,e[l]=!0),n?.includes(l)&&this.raise(this.start,i)}return a}tsParseInOutModifiers(e){this.tsParseModifiers({modified:e,allowedModifiers:[`in`,`out`],disallowedModifiers:[`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`],errorTemplate:Q.InvalidModifierOnTypeParameter})}parseMaybeUnary(t,n,r,i){return!e?.jsx&&this.tsMatchLeftRelational()?this.tsParseTypeAssertion():super.parseMaybeUnary(t,n,r,i)}tsParseTypeAssertion(){n&&this.raise(this.start,Q.ReservedTypeAssertion);let e=this.tryParse(()=>{let e=this.startNode();return e.typeAnnotation=this.tsTryNextParseConstantContext()||this.tsNextThenParseType(),this.expect(o.relational),e.expression=this.parseMaybeUnary(),this.finishNode(e,`TSTypeAssertion`)});return e.error?this.tsParseTypeParameters(this.tsParseConstModifier):e.node}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(o.relational),this.tsParseDelimitedList(`TypeParametersOrArguments`,this.tsParseType.bind(this))))),e.params.length===0&&this.raise(this.start,Q.EmptyTypeArguments),this.exprAllowed=!1,this.expect(o.relational),this.finishNode(e,`TSTypeParameterInstantiation`)}tsParseHeritageClause(e){let t=this.start,n=this.tsParseDelimitedList(`HeritageClauseElement`,()=>{let e=this.startNode();return e.expression=this.tsParseEntityName(),this.tsMatchLeftRelational()&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,`TSExpressionWithTypeArguments`)});return n.length||this.raise(t,Q.EmptyHeritageClauseType({token:e})),n}tsParseTypeMemberSemicolon(){!this.eat(o.comma)&&!this.isLineTerminator()&&this.expect(o.semi)}tsTryParseAndCatch(e){let t=this.tryParse(t=>e()||t());if(!(t.aborted||!t.node))return t.error&&this.setLookaheadState(t.failState),t.node}tsParseSignatureMember(e,t){return this.tsFillSignature(o.colon,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsParsePropertyOrMethodSignature(e,t){this.eat(o.question)&&(e.optional=!0);let n=e;if(this.match(o.parenL)||this.tsMatchLeftRelational()){t&&this.raise(e.start,Q.ReadonlyForMethodSignature);let r=n;r.kind&&this.tsMatchLeftRelational()&&this.raise(this.start,Q.AccesorCannotHaveTypeParameters),this.tsFillSignature(o.colon,r),this.tsParseTypeMemberSemicolon();let i=`parameters`,a=`typeAnnotation`;if(r.kind===`get`)r[i].length>0&&(this.raise(this.start,`A 'get' accesor must not have any formal parameters.`),this.isThisParam(r[i][0])&&this.raise(this.start,Q.AccesorCannotDeclareThisParameter));else if(r.kind===`set`){if(r[i].length!==1)this.raise(this.start,`A 'get' accesor must not have any formal parameters.`);else{let e=r[i][0];this.isThisParam(e)&&this.raise(this.start,Q.AccesorCannotDeclareThisParameter),e.type===`Identifier`&&e.optional&&this.raise(this.start,Q.SetAccesorCannotHaveOptionalParameter),e.type===`RestElement`&&this.raise(this.start,Q.SetAccesorCannotHaveRestParameter)}r[a]&&this.raise(r[a].start,Q.SetAccesorCannotHaveReturnType)}else r.kind=`method`;return this.finishNode(r,`TSMethodSignature`)}else{let e=n;t&&(e.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSPropertySignature`)}}tsParseTypeMember(){let e=this.startNode();if(this.match(o.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember(`TSCallSignatureDeclaration`,e);if(this.match(o._new)){let t=this.startNode();return this.next(),this.match(o.parenL)||this.tsMatchLeftRelational()?this.tsParseSignatureMember(`TSConstructSignatureDeclaration`,e):(e.key=this.createIdentifier(t,`new`),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({modified:e,allowedModifiers:[`readonly`],disallowedModifiers:[`declare`,`abstract`,`private`,`protected`,`public`,`static`,`override`]}),this.tsTryParseIndexSignature(e)||(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)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseList(e,t){let n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseObjectTypeMembers(){this.expect(o.braceL);let e=this.tsParseList(`TypeMembers`,this.tsParseTypeMember.bind(this));return this.expect(o.braceR),e}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(`interface`),t.declare&&(e.declare=!0),y(this.type)?(e.id=this.parseIdent(),this.checkLValSimple(e.id,$.BIND_TS_INTERFACE)):(e.id=null,this.raise(this.start,Q.MissingInterfaceName)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(o._extends)&&(e.extends=this.tsParseHeritageClause(`extends`));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,`TSInterfaceBody`),this.finishNode(e,`TSInterfaceDeclaration`)}tsParseAbstractDeclaration(e){if(this.match(o._class))return e.abstract=!0,this.parseClass(e,!0);if(this.ts_isContextual(p.interface)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.tsParseInterfaceDeclaration(e)}else this.unexpected(e.start)}tsIsDeclarationStart(){return v(this.type)}tsParseExpressionStatement(e,t){switch(t.name){case`declare`:{let t=this.tsTryParseDeclare(e);if(t)return t.declare=!0,t;break}case`global`:if(this.match(o.braceL)){this.enterScope(Wd);let n=e;return n.global=!0,n.id=t,n.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(n,`TSModuleDeclaration`)}break;default:return this.tsParseDeclaration(e,t.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:e}=this,t=this.isAsyncFunction(),n=this.isLet();if(y(e)){if(t&&!this.containsEsc||n)return!1;if((e===p.type||e===p.interface)&&!this.containsEsc){let e=this.lookahead();if(y(e.type)&&!this.isContextualWithState(`from`,e)||e.type===o.braceL)return!1}}else if(!this.match(o._default))return!1;let r=this.nextTokenStart(),i=this.isUnparsedContextual(r,`from`);if(this.input.charCodeAt(r)===44||y(this.type)&&i)return!0;if(this.match(o._default)&&i){let e=this.input.charCodeAt(this.nextTokenStartSince(r+4));return e===34||e===39}return!1}tsInAmbientContext(e){let t=this.isAmbientContext;this.isAmbientContext=!0;try{return e()}finally{this.isAmbientContext=t}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(e,t=!1){if(e.id=this.parseIdent(),t||this.checkLValSimple(e.id,$.BIND_TS_NAMESPACE),this.eat(o.dot)){let t=this.startNode();this.tsParseModuleOrNamespaceDeclaration(t,!0),e.body=t}else this.enterScope(Wd),e.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(e,`TSModuleDeclaration`)}checkLValSimple(e,t=$.BIND_NONE,n){return(e.type===`TSNonNullExpression`||e.type===`TSAsExpression`)&&(e=e.expression),super.checkLValSimple(e,t,n)}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdent(),this.checkLValSimple(e.id,$.BIND_TS_TYPE),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(o.eq),this.ts_isContextual(p.interface)&&this.lookahead().type!==o.dot){let e=this.startNode();return this.next(),this.finishNode(e,`TSIntrinsicKeyword`)}return this.tsParseType()}),this.semicolon(),this.finishNode(e,`TSTypeAliasDeclaration`)}tsParseDeclaration(e,t,n){switch(t){case`abstract`:if(this.tsCheckLineTerminator(n)&&(this.match(o._class)||y(this.type)))return this.tsParseAbstractDeclaration(e);break;case`module`:if(this.tsCheckLineTerminator(n)){if(this.match(o.string))return this.tsParseAmbientExternalModuleDeclaration(e);if(y(this.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case`namespace`:if(this.tsCheckLineTerminator(n)&&y(this.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case`type`:if(this.tsCheckLineTerminator(n)&&y(this.type))return this.tsParseTypeAliasDeclaration(e);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(e,t){e.isExport=t||!1,e.id=this.parseIdent(),this.checkLValSimple(e.id,$.BIND_LEXICAL),super.expect(o.eq);let n=this.tsParseModuleReference();return e.importKind===`type`&&n.type!==`TSExternalModuleReference`&&this.raise(n.start,Q.ImportAliasHasImportType),e.moduleReference=n,super.semicolon(),this.finishNode(e,`TSImportEqualsDeclaration`)}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:e}=this;if(y(e)){if(this.isContextual(`async`)||this.isContextual(`let`))return!1;if((e===p.type||e===p.interface)&&!this.containsEsc){let e=this.lookahead();if(y(e.type)&&!this.isContextualWithState(`from`,e)||e.type===o.braceL)return!1}}else if(!this.match(o._default))return!1;let t=this.nextTokenStart(),n=this.isUnparsedContextual(t,`from`);if(this.input.charCodeAt(t)===44||y(this.type)&&n)return!0;if(this.match(o._default)&&n){let e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return e===34||e===39}return!1}parseTemplate({isTagged:e=!1}={}){let t=this.startNode();this.next(),t.expressions=[];let n=this.parseTemplateElement({isTagged:e});for(t.quasis=[n];!n.tail;)this.type===o.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(o.dollarBraceL),t.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(o.braceR),t.quasis.push(n=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(t,`TemplateLiteral`)}parseFunction(e,t,n,r,i){this.initFunction(e),(this.ecmaVersion>=9||this.ecmaVersion>=6&&!r)&&(this.type===o.star&&t&Cf&&this.unexpected(),e.generator=this.eat(o.star)),this.ecmaVersion>=8&&(e.async=!!r),t&Sf&&(e.id=t&wf&&this.type!==o.name?null:this.parseIdent());let a=this.yieldPos,s=this.awaitPos,c=this.awaitIdentPos,l=this.maybeInArrowParameters;this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Tf(e.async,e.generator)),t&Sf||(e.id=this.type===o.name?this.parseIdent():null),this.parseFunctionParams(e);let u=t&Sf;return this.parseFunctionBody(e,n,!1,i,{isFunctionDeclaration:u}),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=c,t&Sf&&e.id&&!(t&Cf)&&(e.body?this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?$.BIND_VAR:$.BIND_LEXICAL:$.BIND_FUNCTION):this.checkLValSimple(e.id,$.BIND_NONE)),this.maybeInArrowParameters=l,this.finishNode(e,u?`FunctionDeclaration`:`FunctionExpression`)}parseFunctionBody(e,t=!1,n=!1,r=!1,i){this.match(o.colon)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(o.colon));let a=i?.isFunctionDeclaration?`TSDeclareFunction`:i?.isClassMethod?`TSDeclareMethod`:void 0;return a&&!this.match(o.braceL)&&this.isLineTerminator()?this.finishNode(e,a):a===`TSDeclareFunction`&&this.isAmbientContext&&(this.raise(e.start,Q.DeclareFunctionHasImplementation),e.declare)?(super.parseFunctionBody(e,t,n,!1),this.finishNode(e,a)):(super.parseFunctionBody(e,t,n,r),e)}parseNew(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);let e=this.startNode(),t=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(o.dot)){e.meta=t;let n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}let n=this.start,r=this.startLoc,i=this.type===o._import;e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0,!1),i&&e.callee.type===`ImportExpression`&&this.raise(n,`Cannot use new with import()`);let{callee:a}=e;return a.type===`TSInstantiationExpression`&&!a.extra?.parenthesized&&(e.typeArguments=a.typeArguments,e.callee=a.expression),this.eat(o.parenL)?e.arguments=this.parseExprList(o.parenR,this.ecmaVersion>=8,!1):e.arguments=[],this.finishNode(e,`NewExpression`)}parseExprOp(e,t,n,r,i){if(o._in.binop>r&&!this.hasPrecedingLineBreak()){let a;if(this.isContextual(`as`)&&(a=`TSAsExpression`),this.isContextual(`satisfies`)&&(a=`TSSatisfiesExpression`),a){let o=this.startNodeAt(t,n);o.expression=e;let s=this.tsTryNextParseConstantContext();return s?o.typeAnnotation=s:o.typeAnnotation=this.tsNextThenParseType(),this.finishNode(o,a),this.reScan_lt_gt(),this.parseExprOp(o,t,n,r,i)}}return super.parseExprOp(e,t,n,r,i)}parseImportSpecifiers(){let e=[],t=!0;if(a.tokenIsIdentifier(this.type)&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(o.comma)))return e;if(this.type===o.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(o.braceL);!this.eat(o.braceR);){if(t)t=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;e.push(this.parseImportSpecifier())}return e}parseImport(e){let t=this.lookahead();if(e.importKind=`value`,this.importOrExportOuterKind=`value`,y(t.type)||this.match(o.star)||this.match(o.braceL)){let n=this.lookahead(2);if(n.type!==o.comma&&!this.isContextualWithState(`from`,n)&&n.type!==o.eq&&this.ts_eatContextualWithState(`type`,1,t)&&(this.importOrExportOuterKind=`type`,e.importKind=`type`,t=this.lookahead(),n=this.lookahead(2)),y(t.type)&&n.type===o.eq){this.next();let t=this.tsParseImportEqualsDeclaration(e);return this.importOrExportOuterKind=`value`,t}}return this.next(),this.type===o.string?(e.specifiers=[],e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===o.string?this.parseExprAtom():this.unexpected()),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,Q.TypeImportCannotSpecifyDefaultAndNamed),e}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0)}if(this.match(p.interface)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(e,t){return this.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.parseMaybeImportAttributes(e),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)}parseDynamicImport(e){if(this.next(),e.source=this.parseMaybeAssign(),this.eat(o.comma)&&(e.arguments=[this.parseExpression()]),!this.eat(o.parenR)){let e=this.start;this.eat(o.comma)&&this.eat(o.parenR)?this.raiseRecoverable(e,`Trailing comma is not allowed in import()`):this.unexpected(e)}return this.finishNode(e,`ImportExpression`)}parseExport(e,t){let n=this.lookahead();if(this.ts_eatWithState(o._import,2,n)){this.ts_isContextual(p.type)&&this.lookaheadCharCode()!==61?(e.importKind=`type`,this.importOrExportOuterKind=`type`,this.next()):(e.importKind=`value`,this.importOrExportOuterKind=`value`);let t=this.tsParseImportEqualsDeclaration(e,!0);return this.importOrExportOuterKind=void 0,t}else if(this.ts_eatWithState(o.eq,2,n)){let t=e;return t.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(t,`TSExportAssignment`)}else if(this.ts_eatContextualWithState(`as`,2,n)){let t=e;return this.expectContextual(`namespace`),t.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(t,`TSNamespaceExportDeclaration`)}else{if(this.ts_isContextualWithState(n,p.type)&&this.lookahead(2).type===o.braceL?(this.next(),this.importOrExportOuterKind=`type`,e.exportKind=`type`):(this.importOrExportOuterKind=`value`,e.exportKind=`value`),this.next(),this.eat(o.star))return this.parseExportAllDeclaration(e,t);if(this.eat(o._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.parseMaybeImportAttributes(e);else{for(let t of e.specifiers)this.checkUnreserved(t.local),this.checkLocalExport(t.local),t.local.type===`Literal`&&this.raise(t.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,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),e[t]=!0)}parseMaybeDefault(e,t,n){let r=super.parseMaybeDefault(e,t,n);return r.type===`AssignmentPattern`&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(r.typeAnnotation.start,Q.TypeAnnotationAfterAssign),r}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.end,e.typeAnnotation.loc?.end),e.expression}toAssignableList(e,t){for(let t=0;t<e.length;t++){let n=e[t];n?.type===`TSTypeCastExpression`&&(e[t]=this.typeCastToParameter(n))}return super.toAssignableList(e,t)}reportReservedArrowTypeParam(e){e.params.length===1&&!e.extra?.trailingComma&&n&&this.raise(e.start,Q.ReservedArrowTypeParam)}parseExprAtom(e,t,n){if(this.type===p.jsxText)return this.jsx_parseText();if(this.type===p.jsxTagStart)return this.jsx_parseElement();if(this.type===p.at)return this.parseDecorators(),this.parseExprAtom();if(y(this.type)){let e=this.potentialArrowAt===this.start,n=this.start,r=this.startLoc,i=this.containsEsc,a=this.parseIdent(!1);if(this.ecmaVersion>=8&&!i&&a.name===`async`&&!this.canInsertSemicolon()&&this.eat(o._function))return this.overrideContext(d.f_expr),this.parseFunction(this.startNodeAt(n,r),0,!1,!0,t);if(e&&!this.canInsertSemicolon()){if(this.eat(o.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[a],!1,t);if(this.ecmaVersion>=8&&a.name===`async`&&this.type===o.name&&!i&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return a=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[a],!0,t)}return a}else return super.parseExprAtom(e,t,n)}parseExprAtomDefault(){if(y(this.type)){let e=this.potentialArrowAt===this.start,t=this.containsEsc,n=this.parseIdent();if(!t&&n.name===`async`&&!this.canInsertSemicolon()){let{type:e}=this;if(e===o._function)return this.next(),this.parseFunction(this.startNodeAtNode(n),void 0,!0,!0);if(y(e))if(this.lookaheadCharCode()===61){let e=this.parseIdent(!1);return(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAtNode(n),[e],!0)}else return n}return e&&this.match(o.arrow)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}else this.unexpected()}parseIdentNode(){let e=this.startNode();if(b(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,t,n=!1){let{isAmbientContext:r}=this;this.next(),super.parseVar(e,!1,t,n||r),this.semicolon();let i=this.finishNode(e,`VariableDeclaration`);if(!r)return i;for(let{id:e,init:n}of i.declarations)n&&(t!==`const`||e.typeAnnotation?this.raise(n.start,Q.InitializerNotAllowedInAmbientContext):n.type!==`StringLiteral`&&n.type!==`BooleanLiteral`&&n.type!==`NumericLiteral`&&n.type!==`BigIntLiteral`&&(n.type!==`TemplateLiteral`||n.expressions.length>0)&&!Ef(n)&&this.raise(n.start,Q.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));return i}parseStatement(e,t,n){if(this.match(p.at)&&this.parseDecorators(!0),this.match(o._const)&&this.isLookaheadContextual(`enum`)){let e=this.startNode();return this.expect(o._const),this.tsParseEnumDeclaration(e,{const:!0})}if(this.ts_isContextual(p.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(p.interface)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseStatement(e,t,n)}parseAccessModifier(){return this.tsParseModifier([`public`,`protected`,`private`])}parsePostMemberNameModifiers(e){this.eat(o.question)&&(e.optional=!0),e.readonly&&this.match(o.parenL)&&this.raise(e.start,Q.ClassMethodHasReadonly),e.declare&&this.match(o.parenL)&&this.raise(e.start,Q.ClassMethodHasDeclare)}parseExpressionStatement(e,t){return(t.type===`Identifier`?this.tsParseExpressionStatement(e,t):void 0)||super.parseExpressionStatement(e,t)}shouldParseExportStatement(){return this.tsIsDeclarationStart()||this.match(p.at)?!0:super.shouldParseExportStatement()}parseConditional(e,t,n,r,i){if(this.eat(o.question)){let i=this.startNodeAt(t,n);return i.test=e,i.consequent=this.parseMaybeAssign(),this.expect(o.colon),i.alternate=this.parseMaybeAssign(r),this.finishNode(i,`ConditionalExpression`)}return e}parseMaybeConditional(e,t){let n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(!this.maybeInArrowParameters||!this.match(o.question))return this.parseConditional(i,n,r,e,t);let a=this.tryParse(()=>this.parseConditional(i,n,r,e,t));return a.node?(a.error&&this.setLookaheadState(a.failState),a.node):(a.error&&this.setOptionalParametersError(t,a.error),i)}parseParenItem(e){let t=this.start,n=this.startLoc;if(e=super.parseParenItem(e),this.eat(o.question)&&(e.optional=!0,this.resetEndLocation(e)),this.match(o.colon)){let r=this.startNodeAt(t,n);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,`TSTypeCastExpression`)}return e}parseExportDeclaration(e){if(!this.isAmbientContext&&this.ts_isContextual(p.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.start,n=this.startLoc,r=this.eatContextual(`declare`);r&&(this.ts_isContextual(p.declare)||!this.shouldParseExportStatement())&&this.raise(this.start,Q.ExpectedAmbientAfterExportDeclare);let i=y(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);return i?((i.type===`TSInterfaceDeclaration`||i.type===`TSTypeAliasDeclaration`||r)&&(e.exportKind=`type`),r&&(this.resetStartLocation(i,t,n),i.declare=!0),i):null}parseClassId(e,t){if(!t&&this.isContextual(`implements`))return;super.parseClassId(e,t);let n=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||(this.value===`!`&&this.eat(o.prefix)?e.definite=!0:this.eat(o.question)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassField(e){if(e.key.type===`PrivateIdentifier`)e.abstract&&this.raise(e.start,Q.PrivateElementHasAbstract),e.accessibility&&this.raise(e.start,Q.PrivateElementHasAccessibility({modifier:e.accessibility})),this.parseClassPropertyAnnotation(e);else if(this.parseClassPropertyAnnotation(e),this.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(o.eq)&&this.raise(this.start,Q.DeclareClassFieldHasInitializer),e.abstract&&this.match(o.eq)){let{key:t}=e;this.raise(this.start,Q.AbstractPropertyHasInitializer({propertyName:t.type===`Identifier`&&!e.computed?t.name:`[${this.input.slice(t.start,t.end)}]`}))}return super.parseClassField(e)}parseClassMethod(e,t,n,r){let i=e.kind===`constructor`,a=e.key.type===`PrivateIdentifier`,o=this.tsTryParseTypeParameters(this.tsParseConstModifier);a?(o&&(e.typeParameters=o),e.accessibility&&this.raise(e.start,Q.PrivateMethodsHasAccessibility({modifier:e.accessibility}))):o&&i&&this.raise(o.start,Q.ConstructorHasTypeParameters);let{declare:s=!1,kind:c}=e;s&&(c===`get`||c===`set`)&&this.raise(e.start,Q.DeclareAccessor({kind:c})),o&&(e.typeParameters=o);let l=e.key;e.kind===`constructor`?(t&&this.raise(l.start,`Constructor can't be a generator`),n&&this.raise(l.start,`Constructor can't be an async method`)):e.static&&lf(e,`prototype`)&&this.raise(l.start,`Classes may not have a static property named prototype`);let u=e.value=this.parseMethod(t,n,r,!0,e);return e.kind===`get`&&u.params.length!==0&&this.raiseRecoverable(u.start,`getter should have no params`),e.kind===`set`&&u.params.length!==1&&this.raiseRecoverable(u.start,`setter should have exactly one param`),e.kind===`set`&&u.params[0].type===`RestElement`&&this.raiseRecoverable(u.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)}isClassMethod(){return this.match(o.relational)}parseClassElement(e){if(this.eat(o.semi))return null;let t=this.startNode(),n=``,r=!1,i=!1,a=`method`,s=!1,c=[`declare`,`private`,`public`,`protected`,`accessor`,`override`,`abstract`,`readonly`,`static`];s=!!this.tsParseModifiers({modified:t,allowedModifiers:c,disallowedModifiers:[`in`,`out`],stopOnStartOfClassStaticBlock:!0,errorTemplate:Q.InvalidModifierOnTypeParameterPositions}).static;let l=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(t,c)&&this.raise(this.start,Q.StaticBlockCannotHaveModifier),this.ecmaVersion>=13)return super.parseClassStaticBlock(t),t}else{let c=this.tsTryParseIndexSignature(t);if(c)return t.abstract&&this.raise(t.start,Q.IndexSignatureHasAbstract),t.accessibility&&this.raise(t.start,Q.IndexSignatureHasAccessibility({modifier:t.accessibility})),t.declare&&this.raise(t.start,Q.IndexSignatureHasDeclare),t.override&&this.raise(t.start,Q.IndexSignatureHasOverride),c;if(!this.inAbstractClass&&t.abstract&&this.raise(t.start,Q.NonAbstractClassHasAbstractMethod),t.override&&(e||this.raise(t.start,Q.OverrideNotInSubClass)),t.static=s,s&&(this.isClassElementNameStart()||this.type===o.star||(n=`static`)),!n&&this.ecmaVersion>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===o.star)&&!this.canInsertSemicolon()?i=!0:n=`async`),!n&&(this.ecmaVersion>=9||!i)&&this.eat(o.star)&&(r=!0),!n&&!i&&!r){let e=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?a=e:n=e)}if(n?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=n,this.finishNode(t.key,`Identifier`)):this.parseClassElementName(t),this.parsePostMemberNameModifiers(t),this.isClassMethod()||this.ecmaVersion<13||this.type===o.parenL||a!==`method`||r||i){let n=!t.static&&lf(t,`constructor`),o=n&&e;n&&a!==`method`&&this.raise(t.key.start,`Constructor can't have get/set modifier`),t.kind=n?`constructor`:a,this.parseClassMethod(t,r,i,o)}else this.parseClassField(t);return t}};return t.declare?this.tsInAmbientContext(l):l(),t}isClassElementNameStart(){return this.tsIsIdentifier()?!0:super.isClassElementNameStart()}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.tsMatchLeftRelational()||this.match(o.bitShift))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(`implements`)&&(e.implements=this.tsParseHeritageClause(`implements`))}parseFunctionParams(e){let t=this.tsTryParseTypeParameters(this.tsParseConstModifier);t&&(e.typeParameters=t),super.parseFunctionParams(e)}parseVarId(e,t){super.parseVarId(e,t),e.id.type===`Identifier`&&!this.hasPrecedingLineBreak()&&this.value===`!`&&this.eat(o.prefix)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseArrowExpression(e,t,n,r){this.match(o.colon)&&(e.returnType=this.tsParseTypeAnnotation());let i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;this.enterScope(Tf(n,!1)|$.SCOPE_ARROW),this.initFunction(e);let c=this.maybeInArrowParameters;return this.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,e.params=this.toAssignableList(t,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.maybeInArrowParameters=c,this.finishNode(e,`ArrowFunctionExpression`)}parseMaybeAssignOrigin(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}let r=!1,i=-1,a=-1,s=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,s=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new sf,r=!0);let c=this.start,l=this.startLoc;(this.type===o.parenL||y(this.type))&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);let u=this.parseMaybeConditional(e,t);if(n&&(u=n.call(this,u,c,l)),this.type.isAssign){let n=this.startNodeAt(c,l);return n.operator=this.value,this.type===o.eq&&(u=this.toAssignable(u,!0,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=u.start&&(t.shorthandAssign=-1),this.maybeInArrowParameters||(this.type===o.eq?this.checkLValPattern(u):this.checkLValSimple(u)),n.left=u,this.next(),n.right=this.parseMaybeAssign(e),s>-1&&(t.doubleProto=s),this.finishNode(n,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),u}parseMaybeAssign(t,n,r){let i,o,s;if(e?.jsx&&(this.matchJsx(`jsxTagStart`)||this.tsMatchLeftRelational())){if(i=this.cloneCurLookaheadState(),o=this.tryParse(()=>this.parseMaybeAssignOrigin(t,n,r),i),!o.error)return o.node;let e=this.context,s=e[e.length-1],c=e[e.length-2];s===a.tokContexts.tc_oTag&&c===a.tokContexts.tc_expr?(e.pop(),e.pop()):(s===a.tokContexts.tc_oTag||s===a.tokContexts.tc_expr)&&e.pop()}if(!o?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(t,n,r);(!i||this.compareLookaheadState(i,this.getCurLookaheadState()))&&(i=this.cloneCurLookaheadState());let c,l=this.tryParse(e=>{c=this.tsParseTypeParameters(this.tsParseConstModifier);let i=this.parseMaybeAssignOrigin(t,n,r);return(i.type!==`ArrowFunctionExpression`||i.extra?.parenthesized)&&e(),c?.params.length!==0&&this.resetStartLocationFromNode(i,c),i.typeParameters=c,i},i);if(!l.error&&!l.aborted)return c&&this.reportReservedArrowTypeParam(c),l.node;if(!o&&(yf(!0),s=this.tryParse(()=>this.parseMaybeAssignOrigin(t,n,r),i),!s.error))return s.node;if(o?.node)return this.setLookaheadState(o.failState),o.node;if(l.node)return this.setLookaheadState(l.failState),c&&this.reportReservedArrowTypeParam(c),l.node;if(s?.node)return this.setLookaheadState(s.failState),s.node;throw o?.thrown?o.error:l.thrown?l.error:s?.thrown?s.error:o?.error||l.error||s?.error}parseAssignableListItem(e){let t=[];for(;this.match(p.at);)t.push(this.parseDecorator());let n=this.start,r=this.startLoc,i,a=!1,o=!1;if(e!==void 0){let t={};this.tsParseModifiers({modified:t,allowedModifiers:[`public`,`private`,`protected`,`override`,`readonly`]}),i=t.accessibility,o=t.override,a=t.readonly,e===!1&&(i||a||o)&&this.raise(r.start,Q.UnexpectedParameterModifier)}let s=this.parseMaybeDefault(n,r);this.parseBindingListItem(s);let c=this.parseMaybeDefault(s.start,s.loc,s);if(t.length&&(c.decorators=t),i||a||o){let e=this.startNodeAt(n,r);return i&&(e.accessibility=i),a&&(e.readonly=a),o&&(e.override=o),c.type!==`Identifier`&&c.type!==`AssignmentPattern`&&this.raise(e.start,Q.UnsupportedParameterPropertyKind),e.parameter=c,this.finishNode(e,`TSParameterProperty`)}return c}checkLValInnerPattern(e,t=$.BIND_NONE,n){switch(e.type){case`TSParameterProperty`:this.checkLValInnerPattern(e.parameter,t,n);break;default:super.checkLValInnerPattern(e,t,n);break}}parseBindingListItem(e){this.eat(o.question)&&(e.type!==`Identifier`&&!this.isAmbientContext&&!this.inType&&this.raise(e.start,Q.PatternIsOptional),e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case`TSTypeCastExpression`:return this.isAssignable(e.expression,t);case`TSParameterProperty`:return!0;case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:return!0;case`ObjectExpression`:{let t=e.properties.length-1;return e.properties.every((e,n)=>e.type!==`ObjectMethod`&&(n===t||e.type!==`SpreadElement`)&&this.isAssignable(e))}case`Property`:case`ObjectProperty`:return this.isAssignable(e.value);case`SpreadElement`:return this.isAssignable(e.argument);case`ArrayExpression`:return e.elements.every(e=>e===null||this.isAssignable(e));case`AssignmentExpression`:return e.operator===`=`;case`ParenthesizedExpression`:return this.isAssignable(e.expression);case`MemberExpression`:case`OptionalMemberExpression`:return!t;default:return!1}}toAssignable(e,t=!1,n=new sf){switch(e.type){case`ParenthesizedExpression`:return this.toAssignableParenthesizedExpression(e,t,n);case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:return t||this.raise(e.start,Q.UnexpectedTypeCastInParameter),this.toAssignable(e.expression,t,n);case`MemberExpression`:break;case`AssignmentExpression`:return!t&&e.left.type===`TSTypeCastExpression`&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t,n);case`TSTypeCastExpression`:return this.typeCastToParameter(e);default:return super.toAssignable(e,t,n)}return e}toAssignableParenthesizedExpression(e,t,n){switch(e.expression.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:case`ParenthesizedExpression`:return this.toAssignable(e.expression,t,n);default:return super.toAssignable(e,t,n)}}parseBindingAtom(){switch(this.type){case o._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(e){let t;if(t=this.match(o.colon)?e.every(e=>this.isAssignable(e,!0)):!this.canInsertSemicolon(),t){if(this.match(o.colon)){let e=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(o.colon);return(this.canInsertSemicolon()||!this.match(o.arrow))&&e(),t});if(e.aborted)return this.shouldParseArrowReturnType=void 0,!1;e.thrown||(e.error&&this.setLookaheadState(e.failState),this.shouldParseArrowReturnType=e.node)}return this.match(o.arrow)?!0:(this.shouldParseArrowReturnType=void 0,!1)}return this.shouldParseArrowReturnType=void 0,t}parseParenArrowList(e,t,n,r){let i=this.startNodeAt(e,t);return i.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(i,n,!1,r)}parseParenAndDistinguishExpression(e,t){let n=this.start,r=this.startLoc,i,a=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let s=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let c=this.start,l=this.startLoc,u=[],d=!0,f=!1,p=new sf,m=this.yieldPos,h=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==o.parenR;)if(d?d=!1:this.expect(o.comma),a&&this.afterTrailingComma(o.parenR,!0)){f=!0;break}else if(this.type===o.ellipsis){g=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===o.comma&&this.raise(this.start,`Comma is not permitted after the rest element`);break}else u.push(this.parseMaybeAssign(t,p,this.parseParenItem));let _=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect(o.parenR),this.maybeInArrowParameters=s,e&&this.shouldParseArrow(u)&&this.eat(o.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=h,this.parseParenArrowList(n,r,u,t);(!u.length||f)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(p,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=h||this.awaitPos,u.length>1?(i=this.startNodeAt(c,l),i.expressions=u,this.finishNodeAt(i,`SequenceExpression`,_,v)):i=u[0]}else i=this.parseParenExpression();if(this.options.preserveParens){let e=this.startNodeAt(n,r);return e.expression=i,this.finishNode(e,`ParenthesizedExpression`)}else return i}parseTaggedTemplateExpression(e,t,n,r){let i=this.startNodeAt(t,n);return i.tag=e,i.quasi=this.parseTemplate({isTagged:!0}),r&&this.raise(t,`Tagged Template Literals are not allowed in optionalChain.`),this.finishNode(i,`TaggedTemplateExpression`)}shouldParseAsyncArrow(){if(this.match(o.colon)){let e=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(o.colon);return(this.canInsertSemicolon()||!this.match(o.arrow))&&e(),t});if(e.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!e.thrown)return e.error&&this.setLookaheadState(e.failState),this.shouldParseAsyncArrowReturnType=e.node,!this.canInsertSemicolon()&&this.eat(o.arrow)}else return!this.canInsertSemicolon()&&this.eat(o.arrow)}parseSubscriptAsyncArrow(e,t,n,r){let i=this.startNodeAt(e,t);return i.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(i,n,!0,r)}parseExprList(e,t,n,r){let i=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(o.comma),t&&this.afterTrailingComma(e))break;let s;n&&this.type===o.comma?s=null:this.type===o.ellipsis?(s=this.parseSpread(r),this.maybeInArrowParameters&&this.match(o.colon)&&(s.typeAnnotation=this.tsParseTypeAnnotation()),r&&this.type===o.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):s=this.parseMaybeAssign(!1,r,this.parseParenItem),i.push(s)}return i}parseSubscript(e,t,n,r,i,a,s){let c=a;if(!this.hasPrecedingLineBreak()&&this.value===`!`&&this.match(o.prefix)){this.exprAllowed=!1,this.next();let r=this.startNodeAt(t,n);return r.expression=e,e=this.finishNode(r,`TSNonNullExpression`),e}let l=!1;if(this.match(o.questionDot)&&this.lookaheadCharCode()===60){if(r)return e;e.optional=!0,c=l=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(o.bitShift)){let i,a=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let r=this.tsTryParseGenericAsyncArrowFunction(t,n,s);if(r)return e=r,e}let a=this.tsParseTypeArgumentsInExpression();if(!a)return e;if(l&&!this.match(o.parenL))return i=this.curPosition(),e;if(_(this.type)||this.type===o.backQuote){let r=this.parseTaggedTemplateExpression(e,t,n,c);return r.typeArguments=a,r}if(!r&&this.eat(o.parenL)){let r=new sf,i=this.startNodeAt(t,n);return i.callee=e,i.arguments=this.parseExprList(o.parenR,this.ecmaVersion>=8,!1,r),this.tsCheckForInvalidTypeCasts(i.arguments),i.typeArguments=a,c&&(i.optional=l),this.checkExpressionErrors(r,!0),e=this.finishNode(i,`CallExpression`),e}let u=this.type;if(this.tsMatchRightRelational()||u===o.bitShift||u!==o.parenL&&kf(u)&&!this.hasPrecedingLineBreak())return;let d=this.startNodeAt(t,n);return d.expression=e,d.typeArguments=a,this.finishNode(d,`TSInstantiationExpression`)});if(i&&this.unexpected(i),a)return a.type===`TSInstantiationExpression`&&(this.match(o.dot)||this.match(o.questionDot)&&this.lookaheadCharCode()!==40)&&this.raise(this.start,Q.InvalidPropertyAccessAfterInstantiationExpression),e=a,e}let u=this.ecmaVersion>=11,d=u&&this.eat(o.questionDot);r&&d&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);let f=this.eat(o.bracketL);if(f||d&&this.type!==o.parenL&&this.type!==o.backQuote||this.eat(o.dot)){let r=this.startNodeAt(t,n);r.object=e,f?(r.property=this.parseExpression(),this.expect(o.bracketR)):this.type===o.privateId&&e.type!==`Super`?r.property=this.parsePrivateIdent():r.property=this.parseIdent(this.options.allowReserved!==`never`),r.computed=!!f,u&&(r.optional=d),e=this.finishNode(r,`MemberExpression`)}else if(!r&&this.eat(o.parenL)){let r=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let a=new sf,c=this.yieldPos,l=this.awaitPos,f=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let p=this.parseExprList(o.parenR,this.ecmaVersion>=8,!1,a);if(i&&!d&&this.shouldParseAsyncArrow())this.checkPatternErrors(a,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=c,this.awaitPos=l,this.awaitIdentPos=f,e=this.parseSubscriptAsyncArrow(t,n,p,s);else{this.checkExpressionErrors(a,!0),this.yieldPos=c||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=f||this.awaitIdentPos;let r=this.startNodeAt(t,n);r.callee=e,r.arguments=p,u&&(r.optional=d),e=this.finishNode(r,`CallExpression`)}this.maybeInArrowParameters=r}else if(this.type===o.backQuote){(d||c)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);let r=this.startNodeAt(t,n);r.tag=e,r.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(r,`TaggedTemplateExpression`)}return e}parseGetterSetter(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);let t=e.kind===`get`?0:1,n=e.value.params[0];if(t=n&&this.isThisParam(n)?t+1:t,e.value.params.length!==t){let t=e.value.start;e.kind===`get`?this.raiseRecoverable(t,`getter should have no params`):this.raiseRecoverable(t,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)}parseProperty(e,t){if(!e){let n=[];if(this.match(p.at))for(;this.match(p.at);)n.push(this.parseDecorator());let r=super.parseProperty(e,t);return r.type===`SpreadElement`&&n.length&&this.raise(r.start,uf.SpreadElementDecorator),n.length&&(r.decorators=n,n=[]),r}return super.parseProperty(e,t)}parseCatchClauseParam(){let e=this.parseBindingAtom(),t=e.type===`Identifier`;this.enterScope(t?$.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(e,t?$.BIND_SIMPLE_CATCH:$.BIND_LEXICAL);let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n,this.resetEndLocation(e)),this.expect(o.parenR),e}parseClass(e,t){let n=this.inAbstractClass;this.inAbstractClass=!!e.abstract;try{this.next(),this.takeDecorators(e);let n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);let r=this.enterClassBody(),i=this.startNode(),a=!1;i.body=[];let s=[];for(this.expect(o.braceL);this.type!==o.braceR;){if(this.match(p.at)){s.push(this.parseDecorator());continue}let t=this.parseClassElement(e.superClass!==null);s.length&&(t.decorators=s,this.resetStartLocationFromNode(t,s[0]),s=[]),t&&(i.body.push(t),t.type===`MethodDefinition`&&t.kind===`constructor`&&t.value.type===`FunctionExpression`?(a&&this.raiseRecoverable(t.start,`Duplicate constructor in the same class`),a=!0,t.decorators&&t.decorators.length>0&&this.raise(t.start,uf.DecoratorConstructor)):t.key&&t.key.type===`PrivateIdentifier`&&cf(r,t)&&this.raiseRecoverable(t.key.start,`Identifier '#${t.key.name}' has already been declared`))}return this.strict=n,this.next(),s.length&&this.raise(this.start,uf.TrailingDecorator),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)}finally{this.inAbstractClass=n}}parseClassFunctionParams(){let e=this.tsTryParseTypeParameters(),t=this.parseBindingList(o.parenR,!1,this.ecmaVersion>=8,!0);return e&&(t.typeParameters=e),t}parseMethod(e,t,n,r,i){let a=this.startNode(),s=this.yieldPos,c=this.awaitPos,l=this.awaitIdentPos;if(this.initFunction(a),this.ecmaVersion>=6&&(a.generator=e),this.ecmaVersion>=8&&(a.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Tf(t,a.generator)|$.SCOPE_SUPER|(n?$.SCOPE_DIRECT_SUPER:0)),this.expect(o.parenL),a.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0,!1,{isClassMethod:r}),this.yieldPos=s,this.awaitPos=c,this.awaitIdentPos=l,i&&i.abstract&&a.body){let{key:e}=i;this.raise(i.start,Q.AbstractMethodHasImplementation({methodName:e.type===`Identifier`&&!i.computed?e.name:`[${this.input.slice(e.start,e.end)}]`}))}return this.finishNode(a,`FunctionExpression`)}static parse(e,n){if(n.locations===!1)throw Error(`You have to enable options.locations while using acorn-typescript`);n.locations=!0;let r=new this(n,e);return t&&(r.isAmbientContext=!0),r.parse()}static parseExpressionAt(e,n,r){if(r.locations===!1)throw Error(`You have to enable options.locations while using acorn-typescript`);r.locations=!0;let i=new this(r,e,n);return t&&(i.isAmbientContext=!0),i.nextToken(),i.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(p.type)){let e=this.startNode();return e.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(e,!0,this.importOrExportOuterKind===`type`),this.finishNode(e,`ImportSpecifier`)}else{let e=super.parseImportSpecifier();return e.importKind=`value`,e}}parseExportSpecifier(e){let t=this.ts_isContextual(p.type);if(!this.match(o.string)&&t){let t=this.startNode();return t.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(t,!1,this.importOrExportOuterKind===`type`),this.finishNode(t,`ExportSpecifier`),this.checkExport(e,t.exported,t.exported.start),t}else{let t=super.parseExportSpecifier(e);return t.exportKind=`value`,t}}parseTypeOnlyImportExportSpecifier(e,t,n){let r=t?`imported`:`local`,i=t?`local`:`exported`,a=e[r],o,s=!1,c=!0,l=a.start;if(this.isContextual(`as`)){let e=this.parseIdent();if(this.isContextual(`as`)){let n=this.parseIdent();b(this.type)?(s=!0,a=e,o=t?this.parseIdent():this.parseModuleExportName(),c=!1):(o=n,c=!1)}else b(this.type)?(c=!1,o=t?this.parseIdent():this.parseModuleExportName()):(s=!0,a=e)}else b(this.type)&&(s=!0,t?(a=super.parseIdent(!0),this.isContextual(`as`)||this.checkUnreserved(a)):a=this.parseModuleExportName());s&&n&&this.raise(l,t?Q.TypeModifierIsUsedInTypeImports:Q.TypeModifierIsUsedInTypeExports),e[r]=a,e[i]=o;let u=t?`importKind`:`exportKind`;e[u]=s?`type`:`value`,c&&this.eatContextual(`as`)&&(e[i]=t?this.parseIdent():this.parseModuleExportName()),e[i]||(e[i]=this.copyNode(e[r])),t&&this.checkLValSimple(e[i],$.BIND_LEXICAL)}raiseCommonCheck(e,t,n){switch(t){case`Comma is not permitted after the rest element`:if(this.isAmbientContext&&this.match(o.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(e,t)}return n?super.raiseRecoverable(e,t):super.raise(e,t)}raiseRecoverable(e,t){return this.raiseCommonCheck(e,t,!0)}raise(e,t){return this.raiseCommonCheck(e,t,!0)}updateContext(e){let{type:t}=this;if(t==o.braceL){var n=this.curContext();n==m.tc_oTag?this.context.push(d.b_expr):n==m.tc_expr?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(t===o.slash&&e===p.jsxTagStart)this.context.length-=2,this.context.push(m.tc_cTag),this.exprAllowed=!1;else return super.updateContext(e)}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();if(r&&(n.name=r),this.match(o.relational)||this.match(o.bitShift)){let e=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());e&&(n.typeArguments=e)}for(n.attributes=[];this.type!==o.slash&&this.type!==p.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(o.slash),this.expect(p.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}enterScope(e){e===Wd&&this.importsStack.push([]),super.enterScope(e);let t=super.currentScope();t.types=[],t.enums=[],t.constEnums=[],t.classes=[],t.exportOnlyBindings=[]}exitScope(){super.currentScope().flags===Wd&&this.importsStack.pop(),super.exitScope()}hasImport(e,t){let n=this.importsStack.length;if(this.importsStack[n-1].indexOf(e)>-1)return!0;if(!t&&n>1){for(let t=0;t<n-1;t++)if(this.importsStack[t].indexOf(e)>-1)return!0}return!1}maybeExportDefined(e,t){this.inModule&&e.flags&$.SCOPE_TOP&&this.undefinedExports.delete(t)}declareName(e,t,n){if(t&$.BIND_FLAGS_TS_IMPORT){this.hasImport(e,!0)&&this.raise(n,`Identifier '${e}' has already been declared.`),this.importsStack[this.importsStack.length-1].push(e);return}let r=this.currentScope();if(t&$.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(r,e),r.exportOnlyBindings.push(e);return}t===$.BIND_TS_TYPE||t===$.BIND_TS_INTERFACE?(t===$.BIND_TS_TYPE&&r.types.includes(e)&&this.raise(n,`type '${e}' has already been declared.`),r.types.push(e)):super.declareName(e,t,n),t&$.BIND_FLAGS_TS_ENUM&&r.enums.push(e),t&$.BIND_FLAGS_TS_CONST_ENUM&&r.constEnums.push(e),t&$.BIND_FLAGS_CLASS&&r.classes.push(e)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let n=this.scopeStack.length;for(let e=n-1;e>=0;e--){let n=this.scopeStack[e];if(n.types.indexOf(t)>-1||n.exportOnlyBindings.indexOf(t)>-1)return}super.checkLocalExport(e)}}return C}}const Nf=K.extend(Mf());function Pf(e){let t=Jr(e),n=Ff({dependencies:Rf(t.dependencies,e),devDependencies:Rf(t.devDependencies,e)});return n=If(n),n}function Ff(e){for(let t of Object.values(e))for(let[n,r]of Object.entries(t.versions)){let i=t.deps[r],a=`@types/${n.replace(/^@(.*)\/(.*)/,`$1__$2`)}`;(e.dependencies.versions[a]??e.devDependencies.versions[a])&&i.push(a)}return e}function If(e){for(let t of Object.values(e))for(let[n,r]of Object.entries(t.deps))t.deps[n]=r.map(t=>e.dependencies.versions[t]||e.devDependencies.versions[t]).filter(e=>e!==void 0);return e}const Lf=[`svelte`,`@sveltejs/kit`,`tailwindcss`,`vite`];function Rf(e,t){let n={},r={};for(let[i,a]of Object.entries(e??{})){let e=a?`${i}@${a}`:i,o=n[e]??=[];r[i]=e;let s=Rn(t,i)?.pkg;if(!s)continue;let{peerDependencies:c={},peerDependenciesMeta:l={}}=s;for(let[e]of Object.entries(c))Lf.includes(e)||l[e]?.optional||o.push(e)}return{deps:n,versions:r}}async function zf(e){let{filename:t,source:n}=e,r,i;if(t.endsWith(`.svelte`)){let{code:e}=await $e.preprocess(n,[],{filename:t}),a=$e.parse(e,{filename:t});r=a.instance,a.module&&(i=a.module)}else if(t.endsWith(`.ts`)||t.endsWith(`.js`))r=Nf.parse(n,{ecmaVersion:`latest`,sourceType:`module`,sourceFile:t});else return{};let a=new Set,o=new Set,s=t=>{if(t.type!==`ImportDeclaration`)return;let n=t.source.value;Bf(n,e.dependencies).forEach(e=>a.add(e)),Bf(n,e.devDependencies).forEach(e=>o.add(e))};return he(r,{enter:s}),i&&he(i,{enter:s}),{dependencies:d(a),devDependencies:d(o)}}function Bf(e,t){let n=[],r=(t.versions[e]?e:void 0)??Object.keys(t.versions).find(t=>e.startsWith(t));if(r&&!Lf.includes(r)){let e=t.versions[r],i=t.deps[e];n.push(e),i?.forEach(e=>n.push(e))}return n}const Vf=o({registry:m(),cwd:m(),output:m()}),Hf=new Ce().command(`build`).description(`build components for a shadcn-svelte registry`).argument(`[registry]`,`path to registry.json file`,`./registry.json`).option(`-c, --cwd <path>`,`the working directory`,T.cwd()).option(`-o, --output <path>`,`destination directory for json files`,`./static/r`).action(async(e,t)=>{try{$a();let n=Vf.parse({registry:e,...t}),r=E.resolve(n.cwd),i=E.resolve(n.cwd,n.output),a=E.resolve(n.cwd,n.registry);for(let[e,t]of Object.entries({cwd:r,registry:a}))if(!O(t))throw h(`The '${e}' path ${M.default.cyan(t)} does not exist.`);await Uf({cwd:r,output:i,registry:a}),La(`${M.default.green(`Success!`)} Registry build completed.`)}catch(e){to(e)}});async function Uf(e){let t=Wa();t.start(`Parsing registry schema`);let n=await k.readFile(e.registry,`utf8`),r=me.parse(JSON.parse(n));t.stop(`Parsed registry schema at ${M.default.dim(E.relative(e.cwd,e.registry))}`);let i=r.items.map(e=>({...e,relativeUrl:`${e.name}.json`}));O(e.output)||await k.mkdir(e.output,{recursive:!0});let a=[];a.push({title:`Building registry index`,async task(){let t=E.resolve(e.output,`index.json`),n=oe.parse(i);await k.writeFile(t,JSON.stringify(n,null,` `),`utf8`);let r=E.relative(e.cwd,t);return`Registry index written to ${M.default.dim(r)}`}}),a.push({title:`Building registry items`,async task(t){let n=Pf(e.cwd);if(r.overrideDependencies){let e=(e,t)=>{let{name:n}=Js(e),r=t.versions[n];if(r){let i=t.deps[r];delete t.deps[r],t.versions[n]=e,t.deps[e]=i??[]}};for(let t of r.overrideDependencies)e(t,n.dependencies),e(t,n.devDependencies)}for(let i of r.items){t(`Building item ${M.default.cyan(i.name)}`);let a=i.files.length===1,o=[`registry:page`,`registry:ui`,`registry:file`],s=i.files.map(async e=>{let t=await k.readFile(e.path,`utf8`);t=Gf(r.aliases??={},t);let n=E.basename(e.path),s;return s=a?n:o.includes(e.type)?`${i.name}/${n}`:n,{content:t,name:n,target:s,...e}}),c=await Promise.all(s),l=new Set(i.dependencies),u=new Set(i.devDependencies),f=new Set(i.registryDependencies.map(Wf));if(!(l.size>0&&u.size>0))for(let e of c){let t=await zf({...n,filename:e.name,source:e.content});i.dependencies||t.dependencies?.forEach(e=>{e.startsWith(`@types/`)?u.add(e):l.add(e)}),i.devDependencies||t.devDependencies?.forEach(e=>u.add(e))}let p=de.parse({...i,$schema:`${b}/schema/registry-item.json`,registryDependencies:d(f),dependencies:d(l),devDependencies:d(u),files:c},{jitless:!0}),m=E.resolve(e.output,`${i.name}.json`);await k.writeFile(m,JSON.stringify(p,null,` `),`utf8`)}let i=E.relative(e.cwd,e.output);return`Registry items written to ${M.default.dim(i)}`}}),await Ya(a)}function Wf(e){return e.startsWith(`local:`)?e.replace(/^local:(.*)/,`./$1.json`):e}function Gf(e,t){for(let n of C){let r=x[n],i=e[n]??=r.defaultPath;t=t.replaceAll(i,r.placeholder)}return t}const Kf=new Ce().command(`registry`).addCommand(Hf);var qf=n({add:()=>Qs,init:()=>rl,registry:()=>Kf,update:()=>cl});T.on(`SIGINT`,()=>T.exit(0)),T.on(`SIGTERM`,()=>T.exit(0));const Jf=T.versions.node;Number.parseInt(Jf.split(`.`).at(0))<20&&(console.error(`Node.js v${Jf} is out of date and unsupported!`),console.error(`Please use Node.js v20 or higher.`),T.exit(1));async function Yf(){let e=Fn(),t=new Ce().name(`shadcn-svelte`).description(`Add shadcn-svelte components to your project`).version(e.version||`0.0.0`,`-v, --version`,`display the version number`);for(let e of Object.values(qf))t.addCommand(e);t.parse()}Yf();export{};
|
|
149
|
+
`):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):o(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(i.string,t)}jsx_readEntity(){let e=``,t=0,n,r=this.input[this.pos];r!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let i=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(r=this.input[this.pos++],r===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),gf.test(e)&&(n=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),_f.test(e)&&(n=String.fromCharCode(parseInt(e,10)))):n=hf[e];break}e+=r}return n||(this.pos=i,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(s(e)||e===45);return this.finishToken(a.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===a.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let e=this.start,t=this.startLoc,n=this.jsx_parseIdentifier();if(!c.allowNamespaces||!this.eat(i.colon))return n;var r=this.startNodeAt(e,t);return r.namespace=n,r.name=this.jsx_parseIdentifier(),this.finishNode(r,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===a.jsxTagEnd)return``;let e=this.start,t=this.startLoc,n=this.jsx_parseNamespacedName();for(this.type===i.dot&&n.type===`JSXNamespacedName`&&!c.allowNamespacedObjects&&this.unexpected();this.eat(i.dot);){let r=this.startNodeAt(e,t);r.object=n,r.property=this.jsx_parseIdentifier(),n=this.finishNode(r,`JSXMemberExpression`)}return n}jsx_parseAttributeValue(){switch(this.type){case i.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case a.jsxTagStart:case i.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===i.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(i.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(i.braceL)?(this.expect(i.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(i.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(i.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==i.slash&&this.type!==a.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(i.slash),this.expect(a.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(a.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],o=this.jsx_parseOpeningElementAt(e,t),s=null;if(!o.selfClosing){contents:for(;;)switch(this.type){case a.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(i.slash)){s=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case a.jsxText:r.push(this.parseExprAtom());break;case i.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}vf(s.name)!==vf(o.name)&&this.raise(s.start,`Expected corresponding JSX closing tag for <`+vf(o.name)+`>`)}let c=o.name?`Element`:`Fragment`;return n[`opening`+c]=o,n[`closing`+c]=s,n.children=r,this.type===i.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+c)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}}}function bf(e,t,n){let{tokTypes:r}=t,{tokTypes:i}=n;return class extends e{parseMaybeImportAttributes(e){if(this.type===i._with||this.type===r.assert){this.next();let t=this.parseImportAttributes();t&&(e.attributes=t)}}parseImportAttributes(){this.expect(i.braceL);let e=this.parseWithEntries();return this.expect(i.braceR),e}parseWithEntries(){let e=[],t=new Set;do{if(this.type===i.braceR)break;let n=this.startNode(),r;r=this.type===i.string?this.parseLiteral(this.value):this.parseIdent(!0),this.next(),n.key=r,t.has(n.key.name)&&this.raise(this.pos,`Duplicated key in attributes`),t.add(n.key.name),this.type!==i.string&&this.raise(this.pos,`Only string is supported as an attribute value`),n.value=this.parseLiteral(this.value),e.push(this.finishNode(n,`ImportAttribute`))}while(this.eat(i.comma));return e}}}var xf=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function Sf(e){if(!e)throw Error(`Assert fail`)}function Cf(e){return e===`accessor`}function wf(e){return e===`in`||e===`out`}var Tf=1,Ef=2,Df=4,$={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:8,BIND_FLAGS_TS_EXPORT_ONLY:1024,BIND_FLAGS_TS_IMPORT:4096,BIND_FLAGS_TS_ENUM:256,BIND_FLAGS_TS_CONST_ENUM:512,BIND_FLAGS_CLASS:128};function Of(e,t){return $.SCOPE_FUNCTION|(e?$.SCOPE_ASYNC:0)|(t?$.SCOPE_GENERATOR:0)}function kf(e){if(e.type!==`MemberExpression`)return!1;let{computed:t,property:n}=e;return t&&(n.type!==`TemplateLiteral`||n.expressions.length>0)?!1:Af(e.object)}function Af(e){return e.type===`Identifier`?!0:e.type!==`MemberExpression`||e.computed?!1:Af(e.object)}function jf(e){return e===`private`||e===`public`||e===`protected`}function Mf(e){return!!e.startsExpr}function Nf(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function Pf(e){switch(e){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 Ff(e){let{dts:t=!1}=e||{},n=!!e?.jsx;return function(r){let i=r.acorn||pl,a=Hd(i),o=i.tokTypes,s=i.keywordTypes,c=i.isIdentifierStart,l=i.lineBreak,u=i.isNewLine,d=i.tokContexts,f=i.isIdentifierChar,{tokTypes:p,tokContexts:m,keywordsRegExp:h,tokenIsLiteralPropertyName:g,tokenIsTemplate:_,tokenIsTSDeclarationStart:v,tokenIsIdentifier:y,tokenIsKeywordOrIdentifier:b,tokenIsTSTypeOperator:x}=a;function S(e,t,n=e.length){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(u(t))return r<n-1&&t===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}r=mf(r,a,i),e?.jsx&&(r=yf(i,a,r,typeof e.jsx==`boolean`?{}:e.jsx)),r=bf(r,a,i);class C extends r{constructor(e,t,n){super(e,t,n),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=e=>{this.tsParseModifiers({modified:e,allowedModifiers:[`const`],disallowedModifiers:[`in`,`out`],errorTemplate:Q.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return a}get acornTypeScript(){return a}getTokenFromCodeInType(e){return e===62||e===60?this.finishOp(o.relational,1):super.getTokenFromCode(e)}readToken(t){if(!this.inType){let n=this.curContext();if(n===m.tc_expr)return this.jsx_readToken();if(n===m.tc_oTag||n===m.tc_cTag){if(c(t))return this.jsx_readWord();if(t==62)return++this.pos,this.finishToken(p.jsxTagEnd);if((t===34||t===39)&&n==m.tc_oTag)return this.jsx_readString(t)}if(t===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33)return++this.pos,e?.jsx?this.finishToken(p.jsxTagStart):this.finishToken(o.relational,`<`)}return super.readToken(t)}getTokenFromCode(e){return this.inType?this.getTokenFromCodeInType(e):e===64?(++this.pos,this.finishToken(p.at)):super.getTokenFromCode(e)}isAbstractClass(){return this.ts_isContextual(p.abstract)&&this.lookahead().type===o._class}finishNode(e,t){return e.type!==``&&e.end!==0?e:super.finishNode(e,t)}tryParse(e,t=this.cloneCurLookaheadState()){let n={node:null};try{return{node:e((e=null)=>{throw n.node=e,n}),error:null,thrown:!1,aborted:!1,failState:null}}catch(e){let r=this.getCurLookaheadState();if(this.setLookaheadState(t),e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:r};if(e===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:r};throw e}}setOptionalParametersError(e,t){e.optionalParametersLoc=t?.loc??this.startLoc}reScan_lt_gt(){this.type===o.relational&&(--this.pos,this.readToken_lt_gt(this.fullCharCodeAtPos()))}reScan_lt(){let{type:e}=this;return e===o.bitShift?(this.pos-=2,this.finishOp(o.relational,1),o.relational):e}resetEndLocation(e,t=this.lastTokEnd,n=this.lastTokEndLoc){e.end=t,e.loc.end=n,this.options.ranges&&(e.range[1]=t)}startNodeAtNode(e){return super.startNodeAt(e.start,e.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(e,t){return t.some(t=>jf(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(`static`)&&this.lookaheadCharCode()===123}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{e?.type===`TSTypeCastExpression`&&this.raise(e.typeAnnotation.start,Q.UnexpectedTypeAnnotation)})}atPossibleAsyncArrow(e){return e.type===`Identifier`&&e.name===`async`&&this.lastTokEndLoc.column===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&e.start===this.potentialArrowAt}tsIsIdentifier(){return y(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(o.colon)?this.tsParseTypeOrTypePredicateAnnotation(o.colon):void 0}tsTryParseGenericAsyncArrowFunction(e,t,n){if(!this.tsMatchLeftRelational())return;let r=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let n=this.startNodeAt(e,t);return n.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(n),n.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(o.arrow),n});if(this.maybeInArrowParameters=r,i)return super.parseArrowExpression(i,null,!0,n)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===o.relational)return this.tsParseTypeArguments()}tsInNoContext(e){let t=this.context;this.context=[t[0]];try{return e()}finally{this.context=t}}tsTryParseTypeAnnotation(){return this.match(o.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(e,t){let n=e+t.length;if(this.input.slice(e,n)===t){let e=this.input.charCodeAt(n);return!(f(e)||(e&64512)==55296)}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(p.abstract)&&this.lookahead().type===o._new}nextTokenStartSince(e){return xf.lastIndex=e,xf.test(this.input)?xf.lastIndex:e}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}compareLookaheadState(e,t){for(let n of Object.keys(e))if(e[n]!==t[n])return!1;return!0}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,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}}cloneCurLookaheadState(){return{pos:this.pos,value:this.value,type:this.type,start:this.start,end:this.end,context:this.context&&this.context.slice(),startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}}setLookaheadState(e){this.pos=e.pos,this.value=e.value,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.context=e.context,this.startLoc=e.startLoc,this.lastTokEndLoc=e.lastTokEndLoc,this.curLine=e.curLine,this.lineStart=e.lineStart,this.curPosition=e.curPosition,this.containsEsc=e.containsEsc}tsLookAhead(e){let t=this.getCurLookaheadState(),n=e();return this.setLookaheadState(t),n}lookahead(e){let t=this.getCurLookaheadState();if(this.createLookaheadState(),this.isLookahead=!0,e!==void 0)for(let t=0;t<e;t++)this.nextToken();else this.nextToken();this.isLookahead=!1;let n=this.getCurLookaheadState();return this.setLookaheadState(t),n}readWord(){let e=this.readWord1(),t=o.name;return this.keywords.test(e)?t=s[e]:new RegExp(h).test(e)&&(t=p[e]),this.finishToken(t,e)}skipBlockComment(){let e;this.isLookahead||(e=this.options.onComment&&this.curPosition());let t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(let e,n=t;(e=S(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=e;this.isLookahead||this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())}skipLineComment(e){let t=this.pos,n;this.isLookahead||(n=this.options.onComment&&this.curPosition());let r=this.input.charCodeAt(this.pos+=e);for(;this.pos<this.input.length&&!u(r);)r=this.input.charCodeAt(++this.pos);this.isLookahead||this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())}finishToken(e,t){this.preValue=this.value,this.preToken=this.type,this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());let n=this.type;this.type=e,this.value=t,this.isLookahead||this.updateContext(n)}resetStartLocation(e,t,n){e.start=t,e.loc.start=n,this.options.ranges&&(e.range[0]=t)}isLineTerminator(){return this.eat(o.semi)||super.canInsertSemicolon()}hasFollowingLineBreak(){return lf.lastIndex=this.end,lf.test(this.input)}addExtra(e,t,n,r=!0){if(!e)return;let i=e.extra=e.extra||{};r?i[t]=n:Object.defineProperty(i,t,{enumerable:r,value:n})}isLiteralPropertyName(){return g(this.type)}hasPrecedingLineBreak(){return l.test(this.input.slice(this.lastTokEnd,this.start))}createIdentifier(e,t){return e.name=t,this.finishNode(e,`Identifier`)}resetStartLocationFromNode(e,t){this.resetStartLocation(e,t.start,t.loc.start)}isThisParam(e){return e.type===`Identifier`&&e.name===`this`}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}ts_type_isContextual(e,t){return e===t&&!this.containsEsc}ts_isContextual(e){return this.type===e&&!this.containsEsc}ts_isContextualWithState(e,t){return e.type===t&&!e.containsEsc}isContextualWithState(e,t){return t.type===o.name&&t.value===e&&!t.containsEsc}tsIsStartOfMappedType(){return this.next(),this.eat(o.plusMin)?this.ts_isContextual(p.readonly):(this.ts_isContextual(p.readonly)&&this.next(),!this.match(o.bracketL)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(o._in)))}tsInDisallowConditionalTypesContext(e){let t=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.inDisallowConditionalTypesContext=t}}tsTryParseType(){return this.tsEatThenParseType(o.colon)}match(e){return this.type===e}matchJsx(e){return this.type===a.tokTypes[e]}ts_eatWithState(e,t,n){if(e===n.type){for(let e=0;e<t;e++)this.next();return!0}else return!1}ts_eatContextualWithState(e,t,n){if(h.test(e)){if(this.ts_isContextualWithState(n,p[e])){for(let e=0;e<t;e++)this.next();return!0}return!1}else{if(!this.isContextualWithState(e,n))return!1;for(let e=0;e<t;e++)this.next();return!0}}canHaveLeadingDecorator(){return this.match(o._class)}eatContextual(e){return h.test(e)?this.ts_isContextual(p[e])?(this.next(),!0):!1:super.eatContextual(e)}tsIsExternalModuleReference(){return this.isContextual(`require`)&&this.lookaheadCharCode()===40}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(`require`),this.expect(o.parenL),this.match(o.string)||this.unexpected(),e.expression=this.parseExprAtom(),this.expect(o.parenR),this.finishNode(e,`TSExternalModuleReference`)}tsParseEntityName(e=!0){let t=this.parseIdent(e);for(;this.eat(o.dot);){let n=this.startNodeAtNode(t);n.left=t,n.right=this.parseIdent(e),t=this.finishNode(n,`TSQualifiedName`)}return t}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(o.string)?this.parseLiteral(this.value):this.parseIdent(!0),this.eat(o.eq)&&(e.initializer=this.parseMaybeAssign()),this.finishNode(e,`TSEnumMember`)}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(`enum`),e.id=this.parseIdent(),this.checkLValSimple(e.id),this.expect(o.braceL),e.members=this.tsParseDelimitedList(`EnumMembers`,this.tsParseEnumMember.bind(this)),this.expect(o.braceR),this.finishNode(e,`TSEnumDeclaration`)}tsParseModuleBlock(){let e=this.startNode();for(this.enterScope(Kd),this.expect(o.braceL),e.body=[];this.type!==o.braceR;){let t=this.parseStatement(null,!0);e.body.push(t)}return this.next(),super.exitScope(),this.finishNode(e,`TSModuleBlock`)}tsParseAmbientExternalModuleDeclaration(e){return this.ts_isContextual(p.global)?(e.global=!0,e.id=this.parseIdent()):this.match(o.string)?e.id=this.parseLiteral(this.value):this.unexpected(),this.match(o.braceL)?(this.enterScope(qd),e.body=this.tsParseModuleBlock(),super.exitScope()):super.semicolon(),this.finishNode(e,`TSModuleDeclaration`)}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.type,n;return this.isContextual(`let`)&&(t=o._var,n=`let`),this.tsInAmbientContext(()=>{if(t===o._function)return e.declare=!0,this.parseFunctionStatement(e,!1,!0);if(t===o._class)return e.declare=!0,this.parseClass(e,!0);if(t===p.enum)return this.tsParseEnumDeclaration(e,{declare:!0});if(t===p.global)return this.tsParseAmbientExternalModuleDeclaration(e);if(t===o._const||t===o._var)return!this.match(o._const)||!this.isLookaheadContextual(`enum`)?(e.declare=!0,this.parseVarStatement(e,n||this.value,!0)):(this.expect(o._const),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));if(t===p.interface){let t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}if(y(t))return this.tsParseDeclaration(e,this.value,!0)})}tsIsListTerminator(e){switch(e){case`EnumMembers`:case`TypeMembers`:return this.match(o.braceR);case`HeritageClauseElement`:return this.match(o.braceL);case`TupleElementTypes`:return this.match(o.bracketR);case`TypeParametersOrArguments`:return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(e,t,n,r){let i=[],a=-1;for(;!this.tsIsListTerminator(e);){a=-1;let r=t();if(r==null)return;if(i.push(r),this.eat(o.comma)){a=this.lastTokStart;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(o.comma);return}return r&&(r.value=a),i}tsParseDelimitedList(e,t,n){return Nf(this.tsParseDelimitedListWorker(e,t,!0,n))}tsParseBracketedList(e,t,n,r,i){r||(n?this.expect(o.bracketL):this.expect(o.relational));let a=this.tsParseDelimitedList(e,t,i);return n?this.expect(o.bracketR):this.expect(o.relational),a}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(e){return this.match(e)?this.tsNextThenParseType():void 0}tsExpectThenParseType(e){return this.tsDoThenParseType(()=>this.expect(e))}tsNextThenParseType(){return this.tsDoThenParseType(()=>this.next())}tsDoThenParseType(e){return this.tsInType(()=>(e(),this.tsParseType()))}tsSkipParameterStart(){if(y(this.type)||this.match(o._this))return this.next(),!0;if(this.match(o.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(o.bracketL)){this.next();try{return this.parseBindingList(o.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(o.parenR)||this.match(o.ellipsis)||this.tsSkipParameterStart()&&(this.match(o.colon)||this.match(o.comma)||this.match(o.question)||this.match(o.eq)||this.match(o.parenR)&&(this.next(),this.match(o.arrow))))}tsIsStartOfFunctionType(){return this.tsMatchLeftRelational()?!0:this.match(o.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(e){let t=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.inDisallowConditionalTypesContext=t}}tsParseBindingListForSignature(){return super.parseBindingList(o.parenR,!0,!0).map(e=>(e.type!==`Identifier`&&e.type!==`RestElement`&&e.type!==`ObjectPattern`&&e.type!==`ArrayPattern`&&this.raise(e.start,Q.UnsupportedSignatureParameterKind(e.type)),e))}tsParseTypePredicateAsserts(){if(this.type!==p.asserts)return!1;let e=this.containsEsc;return this.next(),!y(this.type)&&!this.match(o._this)?!1:(e&&this.raise(this.lastTokStart,`Escape sequence in keyword asserts`),!0)}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,`TSThisType`)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(o.colon),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,`TSTypeAnnotation`)}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,`TSTypePredicate`)}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(`is`)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseTypePredicatePrefix(){let e=this.parseIdent();if(this.isContextual(`is`)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let n=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(o._this)){let e=this.tsParseThisTypeOrThisTypePredicate();return e.type===`TSThisType`?(n.parameterName=e,n.asserts=!0,n.typeAnnotation=null,e=this.finishNode(n,`TSTypePredicate`)):(this.resetStartLocationFromNode(e,n),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,`TSTypeAnnotation`)}let i=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!i)return r?(n.parameterName=this.parseIdent(),n.asserts=r,n.typeAnnotation=null,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)):this.tsParseTypeAnnotation(!1,t);let a=this.tsParseTypeAnnotation(!1);return n.parameterName=i,n.typeAnnotation=a,n.asserts=r,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)})}tsFillSignature(e,t){let n=e===o.arrow;t.typeParameters=this.tsTryParseTypeParameters(),this.expect(o.parenL),t.parameters=this.tsParseBindingListForSignature(),(n||this.match(e))&&(t.typeAnnotation=this.tsParseTypeOrTypePredicateAnnotation(e))}tsTryNextParseConstantContext(){if(this.lookahead().type!==o._const)return null;this.next();let e=this.tsParseTypeReference();return(e.typeParameters||e.typeArguments)&&this.raise(e.typeName.start,Q.CannotFindName({name:`const`})),e}tsParseFunctionOrConstructorType(e,t){let n=this.startNode();return e===`TSConstructorType`&&(n.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(o.arrow,n)),this.finishNode(n,e)}tsParseUnionOrIntersectionType(e,t,n){let r=this.startNode(),i=this.eat(n),a=[];do a.push(t());while(this.eat(n));return a.length===1&&!i?a[0]:(r.types=a,this.finishNode(r,e))}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case`TSTupleType`:case`TSArrayType`:return;default:this.raise(e.start,Q.UnexpectedReadonly)}}tsParseTypeOperator(){let e=this.startNode(),t=this.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t===`readonly`&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,`TSTypeOperator`)}tsParseConstraintForInferType(){if(this.eat(o._extends)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.inDisallowConditionalTypesContext||!this.match(o.question))return e}}tsParseInferType(){let e=this.startNode();this.expectContextual(`infer`);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,`TSTypeParameter`),this.finishNode(e,`TSInferType`)}tsParseLiteralTypeNode(){let e=this.startNode();return e.literal=(()=>{switch(this.type){case o.num:case o.string:case o._true:case o._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(e,`TSLiteralType`)}tsParseImportType(){let e=this.startNode();return this.expect(o._import),this.expect(o.parenL),this.match(o.string)||this.raise(this.start,Q.UnsupportedImportTypeArgument),e.argument=this.parseExprAtom(),this.expect(o.parenR),this.eat(o.dot)&&(e.qualifier=this.tsParseEntityName()),this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSImportType`)}tsParseTypeQuery(){let e=this.startNode();return this.expect(o._typeof),this.match(o._import)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeQuery`)}tsParseMappedTypeParameter(){let e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(o._in),this.finishNode(e,`TSTypeParameter`)}tsParseMappedType(){let e=this.startNode();return this.expect(o.braceL),this.match(o.plusMin)?(e.readonly=this.value,this.next(),this.expectContextual(`readonly`)):this.eatContextual(`readonly`)&&(e.readonly=!0),this.expect(o.bracketL),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual(`as`)?this.tsParseType():null,this.expect(o.bracketR),this.match(o.plusMin)?(e.optional=this.value,this.next(),this.expect(o.question)):this.eat(o.question)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(o.braceR),this.finishNode(e,`TSMappedType`)}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,`TSTypeLiteral`)}tsParseTupleElementType(){let e=this.startLoc,t=this.start,n=this.eat(o.ellipsis),r=this.tsParseType(),i=this.eat(o.question);if(this.eat(o.colon)){let e=this.startNodeAtNode(r);e.optional=i,r.type===`TSTypeReference`&&!r.typeArguments&&r.typeName.type===`Identifier`?e.label=r.typeName:(this.raise(r.start,Q.InvalidTupleMemberLabel),e.label=r),e.elementType=this.tsParseType(),r=this.finishNode(e,`TSNamedTupleMember`)}else if(i){let e=this.startNodeAtNode(r);e.typeAnnotation=r,r=this.finishNode(e,`TSOptionalType`)}if(n){let n=this.startNodeAt(t,e);n.typeAnnotation=r,r=this.finishNode(n,`TSRestType`)}return r}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList(`TupleElementTypes`,this.tsParseTupleElementType.bind(this),!0,!1);let t=!1,n=null;return e.elementTypes.forEach(e=>{let{type:r}=e;t&&r!==`TSRestType`&&r!==`TSOptionalType`&&!(r===`TSNamedTupleMember`&&e.optional)&&this.raise(e.start,Q.OptionalTypeBeforeRequired),t||=r===`TSNamedTupleMember`&&e.optional||r===`TSOptionalType`;let i=r;r===`TSRestType`&&(e=e.typeAnnotation,i=e.type);let a=i===`TSNamedTupleMember`;n??=a,n!==a&&this.raise(e.start,Q.MixedLabeledAndUnlabeledElements)}),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();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeReference`)}tsMatchLeftRelational(){return this.match(o.relational)&&this.value===`<`}tsMatchRightRelational(){return this.match(o.relational)&&this.value===`>`}tsParseParenthesizedType(){let e=this.startNode();return this.expect(o.parenL),e.typeAnnotation=this.tsParseType(),this.expect(o.parenR),this.finishNode(e,`TSParenthesizedType`)}tsParseNonArrayType(){switch(this.type){case o.string:case o.num:case o._true:case o._false:return this.tsParseLiteralTypeNode();case o.plusMin:if(this.value===`-`){let e=this.startNode();return this.lookahead().type!==o.num&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,`TSLiteralType`)}break;case o._this:return this.tsParseThisTypeOrThisTypePredicate();case o._typeof:return this.tsParseTypeQuery();case o._import:return this.tsParseImportType();case o.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case o.bracketL:return this.tsParseTupleType();case o.parenL:return this.tsParseParenthesizedType();case o.backQuote:case o.dollarBraceL:return this.tsParseTemplateLiteralType();default:{let{type:e}=this;if(y(e)||e===o._void||e===o._null){let t=e===o._void?`TSVoidKeyword`:e===o._null?`TSNullKeyword`:Pf(this.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(o.bracketL);)if(this.match(o.bracketR)){let t=this.startNodeAtNode(e);t.elementType=e,this.expect(o.bracketR),e=this.finishNode(t,`TSArrayType`)}else{let t=this.startNodeAtNode(e);t.objectType=e,t.indexType=this.tsParseType(),this.expect(o.bracketR),e=this.finishNode(t,`TSIndexedAccessType`)}return e}tsParseTypeOperatorOrHigher(){return x(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual(`infer`)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSIntersectionType`,this.tsParseTypeOperatorOrHigher.bind(this),o.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSUnionType`,this.tsParseIntersectionTypeOrHigher.bind(this),o.bitwiseOR)}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType(`TSFunctionType`):this.match(o._new)?this.tsParseFunctionOrConstructorType(`TSConstructorType`):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType(`TSConstructorType`,!0):this.tsParseUnionTypeOrHigher()}tsParseType(){Sf(this.inType);let e=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(o._extends))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(o.question),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(o.colon),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,`TSConditionalType`)}tsIsUnambiguouslyIndexSignature(){return this.next(),y(this.type)?(this.next(),this.match(o.colon)):!1}tsInType(e){let t=this.inType;this.inType=!0;try{return e()}finally{this.inType=t}}tsTryParseIndexSignature(e){if(!(this.match(o.bracketL)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(o.bracketL);let t=this.parseIdent();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(o.bracketR),e.parameters=[t];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSIndexSignature`)}tsParseNoneModifiers(e){this.tsParseModifiers({modified:e,allowedModifiers:[],disallowedModifiers:[`in`,`out`],errorTemplate:Q.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(e=this.tsParseNoneModifiers.bind(this)){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(o._extends),t.default=this.tsEatThenParseType(o.eq),this.finishNode(t,`TSTypeParameter`)}tsParseTypeParameters(e){let t=this.startNode();this.tsMatchLeftRelational()||this.matchJsx(`jsxTagStart`)?this.next():this.unexpected();let n={value:-1};return t.params=this.tsParseBracketedList(`TypeParametersOrArguments`,this.tsParseTypeParameter.bind(this,e),!1,!0,n),t.params.length===0&&this.raise(this.start,Q.EmptyTypeParameters),n.value!==-1&&this.addExtra(t,`trailingComma`,n.value),this.finishNode(t,`TSTypeParameterDeclaration`)}tsTryParseTypeParameters(e){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(e)}tsTryParse(e){let t=this.getCurLookaheadState(),n=e();if(n!==void 0&&n!==!1)return n;this.setLookaheadState(t)}tsTokenCanFollowModifier(){return(this.match(o.bracketL)||this.match(o.braceL)||this.match(o.star)||this.match(o.ellipsis)||this.match(o.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(e,t){let n=this.value;if(e.indexOf(n)!==-1&&!this.containsEsc){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}}tsParseModifiersByMap({modified:e,map:t}){for(let n of Object.keys(t))e[n]=t[n]}tsParseModifiers({modified:e,allowedModifiers:t,disallowedModifiers:n,stopOnStartOfClassStaticBlock:r,errorTemplate:i=Q.InvalidModifierOnTypeMember}){let a={},o=(t,n,r,i)=>{n===r&&e[i]&&this.raise(t.column,Q.InvalidModifiersOrder({orderedModifiers:[r,i]}))},s=(t,n,r,i)=>{(e[r]&&n===i||e[i]&&n===r)&&this.raise(t.column,Q.IncompatibleModifiers({modifiers:[r,i]}))};for(;;){let c=this.startLoc,l=this.tsParseModifier(t.concat(n??[]),r);if(!l)break;jf(l)?e.accessibility?this.raise(this.start,Q.DuplicateAccessibilityModifier()):(o(c,l,l,`override`),o(c,l,l,`static`),o(c,l,l,`readonly`),o(c,l,l,`accessor`),a.accessibility=l,e.accessibility=l):wf(l)?e[l]?this.raise(this.start,Q.DuplicateModifier({modifier:l})):(o(c,l,`in`,`out`),a[l]=l,e[l]=!0):Cf(l)?e[l]?this.raise(this.start,Q.DuplicateModifier({modifier:l})):(s(c,l,`accessor`,`readonly`),s(c,l,`accessor`,`static`),s(c,l,`accessor`,`override`),a[l]=l,e[l]=!0):l===`const`?e[l]?this.raise(this.start,Q.DuplicateModifier({modifier:l})):(a[l]=l,e[l]=!0):Object.hasOwnProperty.call(e,l)?this.raise(this.start,Q.DuplicateModifier({modifier:l})):(o(c,l,`static`,`readonly`),o(c,l,`static`,`override`),o(c,l,`override`,`readonly`),o(c,l,`abstract`,`override`),s(c,l,`declare`,`override`),s(c,l,`static`,`abstract`),a[l]=l,e[l]=!0),n?.includes(l)&&this.raise(this.start,i)}return a}tsParseInOutModifiers(e){this.tsParseModifiers({modified:e,allowedModifiers:[`in`,`out`],disallowedModifiers:[`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`],errorTemplate:Q.InvalidModifierOnTypeParameter})}parseMaybeUnary(t,n,r,i){return!e?.jsx&&this.tsMatchLeftRelational()?this.tsParseTypeAssertion():super.parseMaybeUnary(t,n,r,i)}tsParseTypeAssertion(){n&&this.raise(this.start,Q.ReservedTypeAssertion);let e=this.tryParse(()=>{let e=this.startNode();return e.typeAnnotation=this.tsTryNextParseConstantContext()||this.tsNextThenParseType(),this.expect(o.relational),e.expression=this.parseMaybeUnary(),this.finishNode(e,`TSTypeAssertion`)});return e.error?this.tsParseTypeParameters(this.tsParseConstModifier):e.node}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(o.relational),this.tsParseDelimitedList(`TypeParametersOrArguments`,this.tsParseType.bind(this))))),e.params.length===0&&this.raise(this.start,Q.EmptyTypeArguments),this.exprAllowed=!1,this.expect(o.relational),this.finishNode(e,`TSTypeParameterInstantiation`)}tsParseHeritageClause(e){let t=this.start,n=this.tsParseDelimitedList(`HeritageClauseElement`,()=>{let e=this.startNode();return e.expression=this.tsParseEntityName(),this.tsMatchLeftRelational()&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,`TSExpressionWithTypeArguments`)});return n.length||this.raise(t,Q.EmptyHeritageClauseType({token:e})),n}tsParseTypeMemberSemicolon(){!this.eat(o.comma)&&!this.isLineTerminator()&&this.expect(o.semi)}tsTryParseAndCatch(e){let t=this.tryParse(t=>e()||t());if(!(t.aborted||!t.node))return t.error&&this.setLookaheadState(t.failState),t.node}tsParseSignatureMember(e,t){return this.tsFillSignature(o.colon,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsParsePropertyOrMethodSignature(e,t){this.eat(o.question)&&(e.optional=!0);let n=e;if(this.match(o.parenL)||this.tsMatchLeftRelational()){t&&this.raise(e.start,Q.ReadonlyForMethodSignature);let r=n;r.kind&&this.tsMatchLeftRelational()&&this.raise(this.start,Q.AccesorCannotHaveTypeParameters),this.tsFillSignature(o.colon,r),this.tsParseTypeMemberSemicolon();let i=`parameters`,a=`typeAnnotation`;if(r.kind===`get`)r[i].length>0&&(this.raise(this.start,`A 'get' accesor must not have any formal parameters.`),this.isThisParam(r[i][0])&&this.raise(this.start,Q.AccesorCannotDeclareThisParameter));else if(r.kind===`set`){if(r[i].length!==1)this.raise(this.start,`A 'get' accesor must not have any formal parameters.`);else{let e=r[i][0];this.isThisParam(e)&&this.raise(this.start,Q.AccesorCannotDeclareThisParameter),e.type===`Identifier`&&e.optional&&this.raise(this.start,Q.SetAccesorCannotHaveOptionalParameter),e.type===`RestElement`&&this.raise(this.start,Q.SetAccesorCannotHaveRestParameter)}r[a]&&this.raise(r[a].start,Q.SetAccesorCannotHaveReturnType)}else r.kind=`method`;return this.finishNode(r,`TSMethodSignature`)}else{let e=n;t&&(e.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSPropertySignature`)}}tsParseTypeMember(){let e=this.startNode();if(this.match(o.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember(`TSCallSignatureDeclaration`,e);if(this.match(o._new)){let t=this.startNode();return this.next(),this.match(o.parenL)||this.tsMatchLeftRelational()?this.tsParseSignatureMember(`TSConstructSignatureDeclaration`,e):(e.key=this.createIdentifier(t,`new`),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({modified:e,allowedModifiers:[`readonly`],disallowedModifiers:[`declare`,`abstract`,`private`,`protected`,`public`,`static`,`override`]}),this.tsTryParseIndexSignature(e)||(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)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseList(e,t){let n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseObjectTypeMembers(){this.expect(o.braceL);let e=this.tsParseList(`TypeMembers`,this.tsParseTypeMember.bind(this));return this.expect(o.braceR),e}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(`interface`),t.declare&&(e.declare=!0),y(this.type)?(e.id=this.parseIdent(),this.checkLValSimple(e.id,$.BIND_TS_INTERFACE)):(e.id=null,this.raise(this.start,Q.MissingInterfaceName)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(o._extends)&&(e.extends=this.tsParseHeritageClause(`extends`));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,`TSInterfaceBody`),this.finishNode(e,`TSInterfaceDeclaration`)}tsParseAbstractDeclaration(e){if(this.match(o._class))return e.abstract=!0,this.parseClass(e,!0);if(this.ts_isContextual(p.interface)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.tsParseInterfaceDeclaration(e)}else this.unexpected(e.start)}tsIsDeclarationStart(){return v(this.type)}tsParseExpressionStatement(e,t){switch(t.name){case`declare`:{let t=this.tsTryParseDeclare(e);if(t)return t.declare=!0,t;break}case`global`:if(this.match(o.braceL)){this.enterScope(qd);let n=e;return n.global=!0,n.id=t,n.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(n,`TSModuleDeclaration`)}break;default:return this.tsParseDeclaration(e,t.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){let{type:e}=this,t=this.isAsyncFunction(),n=this.isLet();if(y(e)){if(t&&!this.containsEsc||n)return!1;if((e===p.type||e===p.interface)&&!this.containsEsc){let e=this.lookahead();if(y(e.type)&&!this.isContextualWithState(`from`,e)||e.type===o.braceL)return!1}}else if(!this.match(o._default))return!1;let r=this.nextTokenStart(),i=this.isUnparsedContextual(r,`from`);if(this.input.charCodeAt(r)===44||y(this.type)&&i)return!0;if(this.match(o._default)&&i){let e=this.input.charCodeAt(this.nextTokenStartSince(r+4));return e===34||e===39}return!1}tsInAmbientContext(e){let t=this.isAmbientContext;this.isAmbientContext=!0;try{return e()}finally{this.isAmbientContext=t}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(e,t=!1){if(e.id=this.parseIdent(),t||this.checkLValSimple(e.id,$.BIND_TS_NAMESPACE),this.eat(o.dot)){let t=this.startNode();this.tsParseModuleOrNamespaceDeclaration(t,!0),e.body=t}else this.enterScope(qd),e.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(e,`TSModuleDeclaration`)}checkLValSimple(e,t=$.BIND_NONE,n){return(e.type===`TSNonNullExpression`||e.type===`TSAsExpression`)&&(e=e.expression),super.checkLValSimple(e,t,n)}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdent(),this.checkLValSimple(e.id,$.BIND_TS_TYPE),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(o.eq),this.ts_isContextual(p.interface)&&this.lookahead().type!==o.dot){let e=this.startNode();return this.next(),this.finishNode(e,`TSIntrinsicKeyword`)}return this.tsParseType()}),this.semicolon(),this.finishNode(e,`TSTypeAliasDeclaration`)}tsParseDeclaration(e,t,n){switch(t){case`abstract`:if(this.tsCheckLineTerminator(n)&&(this.match(o._class)||y(this.type)))return this.tsParseAbstractDeclaration(e);break;case`module`:if(this.tsCheckLineTerminator(n)){if(this.match(o.string))return this.tsParseAmbientExternalModuleDeclaration(e);if(y(this.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case`namespace`:if(this.tsCheckLineTerminator(n)&&y(this.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case`type`:if(this.tsCheckLineTerminator(n)&&y(this.type))return this.tsParseTypeAliasDeclaration(e);break}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(e,t){e.isExport=t||!1,e.id=this.parseIdent(),this.checkLValSimple(e.id,$.BIND_LEXICAL),super.expect(o.eq);let n=this.tsParseModuleReference();return e.importKind===`type`&&n.type!==`TSExternalModuleReference`&&this.raise(n.start,Q.ImportAliasHasImportType),e.moduleReference=n,super.semicolon(),this.finishNode(e,`TSImportEqualsDeclaration`)}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;let{type:e}=this;if(y(e)){if(this.isContextual(`async`)||this.isContextual(`let`))return!1;if((e===p.type||e===p.interface)&&!this.containsEsc){let e=this.lookahead();if(y(e.type)&&!this.isContextualWithState(`from`,e)||e.type===o.braceL)return!1}}else if(!this.match(o._default))return!1;let t=this.nextTokenStart(),n=this.isUnparsedContextual(t,`from`);if(this.input.charCodeAt(t)===44||y(this.type)&&n)return!0;if(this.match(o._default)&&n){let e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return e===34||e===39}return!1}parseTemplate({isTagged:e=!1}={}){let t=this.startNode();this.next(),t.expressions=[];let n=this.parseTemplateElement({isTagged:e});for(t.quasis=[n];!n.tail;)this.type===o.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(o.dollarBraceL),t.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(o.braceR),t.quasis.push(n=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(t,`TemplateLiteral`)}parseFunction(e,t,n,r,i){this.initFunction(e),(this.ecmaVersion>=9||this.ecmaVersion>=6&&!r)&&(this.type===o.star&&t&Ef&&this.unexpected(),e.generator=this.eat(o.star)),this.ecmaVersion>=8&&(e.async=!!r),t&Tf&&(e.id=t&Df&&this.type!==o.name?null:this.parseIdent());let a=this.yieldPos,s=this.awaitPos,c=this.awaitIdentPos,l=this.maybeInArrowParameters;this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Of(e.async,e.generator)),t&Tf||(e.id=this.type===o.name?this.parseIdent():null),this.parseFunctionParams(e);let u=t&Tf;return this.parseFunctionBody(e,n,!1,i,{isFunctionDeclaration:u}),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=c,t&Tf&&e.id&&!(t&Ef)&&(e.body?this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?$.BIND_VAR:$.BIND_LEXICAL:$.BIND_FUNCTION):this.checkLValSimple(e.id,$.BIND_NONE)),this.maybeInArrowParameters=l,this.finishNode(e,u?`FunctionDeclaration`:`FunctionExpression`)}parseFunctionBody(e,t=!1,n=!1,r=!1,i){this.match(o.colon)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(o.colon));let a=i?.isFunctionDeclaration?`TSDeclareFunction`:i?.isClassMethod?`TSDeclareMethod`:void 0;return a&&!this.match(o.braceL)&&this.isLineTerminator()?this.finishNode(e,a):a===`TSDeclareFunction`&&this.isAmbientContext&&(this.raise(e.start,Q.DeclareFunctionHasImplementation),e.declare)?(super.parseFunctionBody(e,t,n,!1),this.finishNode(e,a)):(super.parseFunctionBody(e,t,n,r),e)}parseNew(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);let e=this.startNode(),t=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(o.dot)){e.meta=t;let n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}let n=this.start,r=this.startLoc,i=this.type===o._import;e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0,!1),i&&e.callee.type===`ImportExpression`&&this.raise(n,`Cannot use new with import()`);let{callee:a}=e;return a.type===`TSInstantiationExpression`&&!a.extra?.parenthesized&&(e.typeArguments=a.typeArguments,e.callee=a.expression),this.eat(o.parenL)?e.arguments=this.parseExprList(o.parenR,this.ecmaVersion>=8,!1):e.arguments=[],this.finishNode(e,`NewExpression`)}parseExprOp(e,t,n,r,i){if(o._in.binop>r&&!this.hasPrecedingLineBreak()){let a;if(this.isContextual(`as`)&&(a=`TSAsExpression`),this.isContextual(`satisfies`)&&(a=`TSSatisfiesExpression`),a){let o=this.startNodeAt(t,n);o.expression=e;let s=this.tsTryNextParseConstantContext();return s?o.typeAnnotation=s:o.typeAnnotation=this.tsNextThenParseType(),this.finishNode(o,a),this.reScan_lt_gt(),this.parseExprOp(o,t,n,r,i)}}return super.parseExprOp(e,t,n,r,i)}parseImportSpecifiers(){let e=[],t=!0;if(a.tokenIsIdentifier(this.type)&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(o.comma)))return e;if(this.type===o.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(o.braceL);!this.eat(o.braceR);){if(t)t=!1;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;e.push(this.parseImportSpecifier())}return e}parseImport(e){let t=this.lookahead();if(e.importKind=`value`,this.importOrExportOuterKind=`value`,y(t.type)||this.match(o.star)||this.match(o.braceL)){let n=this.lookahead(2);if(n.type!==o.comma&&!this.isContextualWithState(`from`,n)&&n.type!==o.eq&&this.ts_eatContextualWithState(`type`,1,t)&&(this.importOrExportOuterKind=`type`,e.importKind=`type`,t=this.lookahead(),n=this.lookahead(2)),y(t.type)&&n.type===o.eq){this.next();let t=this.tsParseImportEqualsDeclaration(e);return this.importOrExportOuterKind=`value`,t}}return this.next(),this.type===o.string?(e.specifiers=[],e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===o.string?this.parseExprAtom():this.unexpected()),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,Q.TypeImportCannotSpecifyDefaultAndNamed),e}parseExportDefaultDeclaration(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0)}if(this.match(p.interface)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(e,t){return this.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.parseMaybeImportAttributes(e),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)}parseDynamicImport(e){if(this.next(),e.source=this.parseMaybeAssign(),this.eat(o.comma)&&(e.arguments=[this.parseExpression()]),!this.eat(o.parenR)){let e=this.start;this.eat(o.comma)&&this.eat(o.parenR)?this.raiseRecoverable(e,`Trailing comma is not allowed in import()`):this.unexpected(e)}return this.finishNode(e,`ImportExpression`)}parseExport(e,t){let n=this.lookahead();if(this.ts_eatWithState(o._import,2,n)){this.ts_isContextual(p.type)&&this.lookaheadCharCode()!==61?(e.importKind=`type`,this.importOrExportOuterKind=`type`,this.next()):(e.importKind=`value`,this.importOrExportOuterKind=`value`);let t=this.tsParseImportEqualsDeclaration(e,!0);return this.importOrExportOuterKind=void 0,t}else if(this.ts_eatWithState(o.eq,2,n)){let t=e;return t.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(t,`TSExportAssignment`)}else if(this.ts_eatContextualWithState(`as`,2,n)){let t=e;return this.expectContextual(`namespace`),t.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(t,`TSNamespaceExportDeclaration`)}else{if(this.ts_isContextualWithState(n,p.type)&&this.lookahead(2).type===o.braceL?(this.next(),this.importOrExportOuterKind=`type`,e.exportKind=`type`):(this.importOrExportOuterKind=`value`,e.exportKind=`value`),this.next(),this.eat(o.star))return this.parseExportAllDeclaration(e,t);if(this.eat(o._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.parseMaybeImportAttributes(e);else{for(let t of e.specifiers)this.checkUnreserved(t.local),this.checkLocalExport(t.local),t.local.type===`Literal`&&this.raise(t.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,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),e[t]=!0)}parseMaybeDefault(e,t,n){let r=super.parseMaybeDefault(e,t,n);return r.type===`AssignmentPattern`&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(r.typeAnnotation.start,Q.TypeAnnotationAfterAssign),r}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.end,e.typeAnnotation.loc?.end),e.expression}toAssignableList(e,t){for(let t=0;t<e.length;t++){let n=e[t];n?.type===`TSTypeCastExpression`&&(e[t]=this.typeCastToParameter(n))}return super.toAssignableList(e,t)}reportReservedArrowTypeParam(e){e.params.length===1&&!e.extra?.trailingComma&&n&&this.raise(e.start,Q.ReservedArrowTypeParam)}parseExprAtom(e,t,n){if(this.type===p.jsxText)return this.jsx_parseText();if(this.type===p.jsxTagStart)return this.jsx_parseElement();if(this.type===p.at)return this.parseDecorators(),this.parseExprAtom();if(y(this.type)){let e=this.potentialArrowAt===this.start,n=this.start,r=this.startLoc,i=this.containsEsc,a=this.parseIdent(!1);if(this.ecmaVersion>=8&&!i&&a.name===`async`&&!this.canInsertSemicolon()&&this.eat(o._function))return this.overrideContext(d.f_expr),this.parseFunction(this.startNodeAt(n,r),0,!1,!0,t);if(e&&!this.canInsertSemicolon()){if(this.eat(o.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[a],!1,t);if(this.ecmaVersion>=8&&a.name===`async`&&this.type===o.name&&!i&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return a=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[a],!0,t)}return a}else return super.parseExprAtom(e,t,n)}parseExprAtomDefault(){if(y(this.type)){let e=this.potentialArrowAt===this.start,t=this.containsEsc,n=this.parseIdent();if(!t&&n.name===`async`&&!this.canInsertSemicolon()){let{type:e}=this;if(e===o._function)return this.next(),this.parseFunction(this.startNodeAtNode(n),void 0,!0,!0);if(y(e))if(this.lookaheadCharCode()===61){let e=this.parseIdent(!1);return(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAtNode(n),[e],!0)}else return n}return e&&this.match(o.arrow)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}else this.unexpected()}parseIdentNode(){let e=this.startNode();if(b(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,t,n=!1){let{isAmbientContext:r}=this;this.next(),super.parseVar(e,!1,t,n||r),this.semicolon();let i=this.finishNode(e,`VariableDeclaration`);if(!r)return i;for(let{id:e,init:n}of i.declarations)n&&(t!==`const`||e.typeAnnotation?this.raise(n.start,Q.InitializerNotAllowedInAmbientContext):n.type!==`StringLiteral`&&n.type!==`BooleanLiteral`&&n.type!==`NumericLiteral`&&n.type!==`BigIntLiteral`&&(n.type!==`TemplateLiteral`||n.expressions.length>0)&&!kf(n)&&this.raise(n.start,Q.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));return i}parseStatement(e,t,n){if(this.match(p.at)&&this.parseDecorators(!0),this.match(o._const)&&this.isLookaheadContextual(`enum`)){let e=this.startNode();return this.expect(o._const),this.tsParseEnumDeclaration(e,{const:!0})}if(this.ts_isContextual(p.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(p.interface)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseStatement(e,t,n)}parseAccessModifier(){return this.tsParseModifier([`public`,`protected`,`private`])}parsePostMemberNameModifiers(e){this.eat(o.question)&&(e.optional=!0),e.readonly&&this.match(o.parenL)&&this.raise(e.start,Q.ClassMethodHasReadonly),e.declare&&this.match(o.parenL)&&this.raise(e.start,Q.ClassMethodHasDeclare)}parseExpressionStatement(e,t){return(t.type===`Identifier`?this.tsParseExpressionStatement(e,t):void 0)||super.parseExpressionStatement(e,t)}shouldParseExportStatement(){return this.tsIsDeclarationStart()||this.match(p.at)?!0:super.shouldParseExportStatement()}parseConditional(e,t,n,r,i){if(this.eat(o.question)){let i=this.startNodeAt(t,n);return i.test=e,i.consequent=this.parseMaybeAssign(),this.expect(o.colon),i.alternate=this.parseMaybeAssign(r),this.finishNode(i,`ConditionalExpression`)}return e}parseMaybeConditional(e,t){let n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(!this.maybeInArrowParameters||!this.match(o.question))return this.parseConditional(i,n,r,e,t);let a=this.tryParse(()=>this.parseConditional(i,n,r,e,t));return a.node?(a.error&&this.setLookaheadState(a.failState),a.node):(a.error&&this.setOptionalParametersError(t,a.error),i)}parseParenItem(e){let t=this.start,n=this.startLoc;if(e=super.parseParenItem(e),this.eat(o.question)&&(e.optional=!0,this.resetEndLocation(e)),this.match(o.colon)){let r=this.startNodeAt(t,n);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,`TSTypeCastExpression`)}return e}parseExportDeclaration(e){if(!this.isAmbientContext&&this.ts_isContextual(p.declare))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.start,n=this.startLoc,r=this.eatContextual(`declare`);r&&(this.ts_isContextual(p.declare)||!this.shouldParseExportStatement())&&this.raise(this.start,Q.ExpectedAmbientAfterExportDeclare);let i=y(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);return i?((i.type===`TSInterfaceDeclaration`||i.type===`TSTypeAliasDeclaration`||r)&&(e.exportKind=`type`),r&&(this.resetStartLocation(i,t,n),i.declare=!0),i):null}parseClassId(e,t){if(!t&&this.isContextual(`implements`))return;super.parseClassId(e,t);let n=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||(this.value===`!`&&this.eat(o.prefix)?e.definite=!0:this.eat(o.question)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassField(e){if(e.key.type===`PrivateIdentifier`)e.abstract&&this.raise(e.start,Q.PrivateElementHasAbstract),e.accessibility&&this.raise(e.start,Q.PrivateElementHasAccessibility({modifier:e.accessibility})),this.parseClassPropertyAnnotation(e);else if(this.parseClassPropertyAnnotation(e),this.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(o.eq)&&this.raise(this.start,Q.DeclareClassFieldHasInitializer),e.abstract&&this.match(o.eq)){let{key:t}=e;this.raise(this.start,Q.AbstractPropertyHasInitializer({propertyName:t.type===`Identifier`&&!e.computed?t.name:`[${this.input.slice(t.start,t.end)}]`}))}return super.parseClassField(e)}parseClassMethod(e,t,n,r){let i=e.kind===`constructor`,a=e.key.type===`PrivateIdentifier`,o=this.tsTryParseTypeParameters(this.tsParseConstModifier);a?(o&&(e.typeParameters=o),e.accessibility&&this.raise(e.start,Q.PrivateMethodsHasAccessibility({modifier:e.accessibility}))):o&&i&&this.raise(o.start,Q.ConstructorHasTypeParameters);let{declare:s=!1,kind:c}=e;s&&(c===`get`||c===`set`)&&this.raise(e.start,Q.DeclareAccessor({kind:c})),o&&(e.typeParameters=o);let l=e.key;e.kind===`constructor`?(t&&this.raise(l.start,`Constructor can't be a generator`),n&&this.raise(l.start,`Constructor can't be an async method`)):e.static&&ff(e,`prototype`)&&this.raise(l.start,`Classes may not have a static property named prototype`);let u=e.value=this.parseMethod(t,n,r,!0,e);return e.kind===`get`&&u.params.length!==0&&this.raiseRecoverable(u.start,`getter should have no params`),e.kind===`set`&&u.params.length!==1&&this.raiseRecoverable(u.start,`setter should have exactly one param`),e.kind===`set`&&u.params[0].type===`RestElement`&&this.raiseRecoverable(u.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)}isClassMethod(){return this.match(o.relational)}parseClassElement(e){if(this.eat(o.semi))return null;let t=this.startNode(),n=``,r=!1,i=!1,a=`method`,s=!1,c=[`declare`,`private`,`public`,`protected`,`accessor`,`override`,`abstract`,`readonly`,`static`];s=!!this.tsParseModifiers({modified:t,allowedModifiers:c,disallowedModifiers:[`in`,`out`],stopOnStartOfClassStaticBlock:!0,errorTemplate:Q.InvalidModifierOnTypeParameterPositions}).static;let l=()=>{if(this.tsIsStartOfStaticBlocks()){if(this.next(),this.next(),this.tsHasSomeModifiers(t,c)&&this.raise(this.start,Q.StaticBlockCannotHaveModifier),this.ecmaVersion>=13)return super.parseClassStaticBlock(t),t}else{let c=this.tsTryParseIndexSignature(t);if(c)return t.abstract&&this.raise(t.start,Q.IndexSignatureHasAbstract),t.accessibility&&this.raise(t.start,Q.IndexSignatureHasAccessibility({modifier:t.accessibility})),t.declare&&this.raise(t.start,Q.IndexSignatureHasDeclare),t.override&&this.raise(t.start,Q.IndexSignatureHasOverride),c;if(!this.inAbstractClass&&t.abstract&&this.raise(t.start,Q.NonAbstractClassHasAbstractMethod),t.override&&(e||this.raise(t.start,Q.OverrideNotInSubClass)),t.static=s,s&&(this.isClassElementNameStart()||this.type===o.star||(n=`static`)),!n&&this.ecmaVersion>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===o.star)&&!this.canInsertSemicolon()?i=!0:n=`async`),!n&&(this.ecmaVersion>=9||!i)&&this.eat(o.star)&&(r=!0),!n&&!i&&!r){let e=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?a=e:n=e)}if(n?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=n,this.finishNode(t.key,`Identifier`)):this.parseClassElementName(t),this.parsePostMemberNameModifiers(t),this.isClassMethod()||this.ecmaVersion<13||this.type===o.parenL||a!==`method`||r||i){let n=!t.static&&ff(t,`constructor`),o=n&&e;n&&a!==`method`&&this.raise(t.key.start,`Constructor can't have get/set modifier`),t.kind=n?`constructor`:a,this.parseClassMethod(t,r,i,o)}else this.parseClassField(t);return t}};return t.declare?this.tsInAmbientContext(l):l(),t}isClassElementNameStart(){return this.tsIsIdentifier()?!0:super.isClassElementNameStart()}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.tsMatchLeftRelational()||this.match(o.bitShift))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(`implements`)&&(e.implements=this.tsParseHeritageClause(`implements`))}parseFunctionParams(e){let t=this.tsTryParseTypeParameters(this.tsParseConstModifier);t&&(e.typeParameters=t),super.parseFunctionParams(e)}parseVarId(e,t){super.parseVarId(e,t),e.id.type===`Identifier`&&!this.hasPrecedingLineBreak()&&this.value===`!`&&this.eat(o.prefix)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseArrowExpression(e,t,n,r){this.match(o.colon)&&(e.returnType=this.tsParseTypeAnnotation());let i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;this.enterScope(Of(n,!1)|$.SCOPE_ARROW),this.initFunction(e);let c=this.maybeInArrowParameters;return this.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,e.params=this.toAssignableList(t,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.maybeInArrowParameters=c,this.finishNode(e,`ArrowFunctionExpression`)}parseMaybeAssignOrigin(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}let r=!1,i=-1,a=-1,s=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,s=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new uf,r=!0);let c=this.start,l=this.startLoc;(this.type===o.parenL||y(this.type))&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);let u=this.parseMaybeConditional(e,t);if(n&&(u=n.call(this,u,c,l)),this.type.isAssign){let n=this.startNodeAt(c,l);return n.operator=this.value,this.type===o.eq&&(u=this.toAssignable(u,!0,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=u.start&&(t.shorthandAssign=-1),this.maybeInArrowParameters||(this.type===o.eq?this.checkLValPattern(u):this.checkLValSimple(u)),n.left=u,this.next(),n.right=this.parseMaybeAssign(e),s>-1&&(t.doubleProto=s),this.finishNode(n,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),u}parseMaybeAssign(t,n,r){let i,o,s;if(e?.jsx&&(this.matchJsx(`jsxTagStart`)||this.tsMatchLeftRelational())){if(i=this.cloneCurLookaheadState(),o=this.tryParse(()=>this.parseMaybeAssignOrigin(t,n,r),i),!o.error)return o.node;let e=this.context,s=e[e.length-1],c=e[e.length-2];s===a.tokContexts.tc_oTag&&c===a.tokContexts.tc_expr?(e.pop(),e.pop()):(s===a.tokContexts.tc_oTag||s===a.tokContexts.tc_expr)&&e.pop()}if(!o?.error&&!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(t,n,r);(!i||this.compareLookaheadState(i,this.getCurLookaheadState()))&&(i=this.cloneCurLookaheadState());let c,l=this.tryParse(e=>{c=this.tsParseTypeParameters(this.tsParseConstModifier);let i=this.parseMaybeAssignOrigin(t,n,r);return(i.type!==`ArrowFunctionExpression`||i.extra?.parenthesized)&&e(),c?.params.length!==0&&this.resetStartLocationFromNode(i,c),i.typeParameters=c,i},i);if(!l.error&&!l.aborted)return c&&this.reportReservedArrowTypeParam(c),l.node;if(!o&&(Sf(!0),s=this.tryParse(()=>this.parseMaybeAssignOrigin(t,n,r),i),!s.error))return s.node;if(o?.node)return this.setLookaheadState(o.failState),o.node;if(l.node)return this.setLookaheadState(l.failState),c&&this.reportReservedArrowTypeParam(c),l.node;if(s?.node)return this.setLookaheadState(s.failState),s.node;throw o?.thrown?o.error:l.thrown?l.error:s?.thrown?s.error:o?.error||l.error||s?.error}parseAssignableListItem(e){let t=[];for(;this.match(p.at);)t.push(this.parseDecorator());let n=this.start,r=this.startLoc,i,a=!1,o=!1;if(e!==void 0){let t={};this.tsParseModifiers({modified:t,allowedModifiers:[`public`,`private`,`protected`,`override`,`readonly`]}),i=t.accessibility,o=t.override,a=t.readonly,e===!1&&(i||a||o)&&this.raise(r.start,Q.UnexpectedParameterModifier)}let s=this.parseMaybeDefault(n,r);this.parseBindingListItem(s);let c=this.parseMaybeDefault(s.start,s.loc,s);if(t.length&&(c.decorators=t),i||a||o){let e=this.startNodeAt(n,r);return i&&(e.accessibility=i),a&&(e.readonly=a),o&&(e.override=o),c.type!==`Identifier`&&c.type!==`AssignmentPattern`&&this.raise(e.start,Q.UnsupportedParameterPropertyKind),e.parameter=c,this.finishNode(e,`TSParameterProperty`)}return c}checkLValInnerPattern(e,t=$.BIND_NONE,n){switch(e.type){case`TSParameterProperty`:this.checkLValInnerPattern(e.parameter,t,n);break;default:super.checkLValInnerPattern(e,t,n);break}}parseBindingListItem(e){this.eat(o.question)&&(e.type!==`Identifier`&&!this.isAmbientContext&&!this.inType&&this.raise(e.start,Q.PatternIsOptional),e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case`TSTypeCastExpression`:return this.isAssignable(e.expression,t);case`TSParameterProperty`:return!0;case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:return!0;case`ObjectExpression`:{let t=e.properties.length-1;return e.properties.every((e,n)=>e.type!==`ObjectMethod`&&(n===t||e.type!==`SpreadElement`)&&this.isAssignable(e))}case`Property`:case`ObjectProperty`:return this.isAssignable(e.value);case`SpreadElement`:return this.isAssignable(e.argument);case`ArrayExpression`:return e.elements.every(e=>e===null||this.isAssignable(e));case`AssignmentExpression`:return e.operator===`=`;case`ParenthesizedExpression`:return this.isAssignable(e.expression);case`MemberExpression`:case`OptionalMemberExpression`:return!t;default:return!1}}toAssignable(e,t=!1,n=new uf){switch(e.type){case`ParenthesizedExpression`:return this.toAssignableParenthesizedExpression(e,t,n);case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:return t||this.raise(e.start,Q.UnexpectedTypeCastInParameter),this.toAssignable(e.expression,t,n);case`MemberExpression`:break;case`AssignmentExpression`:return!t&&e.left.type===`TSTypeCastExpression`&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t,n);case`TSTypeCastExpression`:return this.typeCastToParameter(e);default:return super.toAssignable(e,t,n)}return e}toAssignableParenthesizedExpression(e,t,n){switch(e.expression.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:case`ParenthesizedExpression`:return this.toAssignable(e.expression,t,n);default:return super.toAssignable(e,t,n)}}parseBindingAtom(){switch(this.type){case o._this:return this.parseIdent(!0);default:return super.parseBindingAtom()}}shouldParseArrow(e){let t;if(t=this.match(o.colon)?e.every(e=>this.isAssignable(e,!0)):!this.canInsertSemicolon(),t){if(this.match(o.colon)){let e=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(o.colon);return(this.canInsertSemicolon()||!this.match(o.arrow))&&e(),t});if(e.aborted)return this.shouldParseArrowReturnType=void 0,!1;e.thrown||(e.error&&this.setLookaheadState(e.failState),this.shouldParseArrowReturnType=e.node)}return this.match(o.arrow)?!0:(this.shouldParseArrowReturnType=void 0,!1)}return this.shouldParseArrowReturnType=void 0,t}parseParenArrowList(e,t,n,r){let i=this.startNodeAt(e,t);return i.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(i,n,!1,r)}parseParenAndDistinguishExpression(e,t){let n=this.start,r=this.startLoc,i,a=this.ecmaVersion>=8;if(this.ecmaVersion>=6){let s=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let c=this.start,l=this.startLoc,u=[],d=!0,f=!1,p=new uf,m=this.yieldPos,h=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==o.parenR;)if(d?d=!1:this.expect(o.comma),a&&this.afterTrailingComma(o.parenR,!0)){f=!0;break}else if(this.type===o.ellipsis){g=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===o.comma&&this.raise(this.start,`Comma is not permitted after the rest element`);break}else u.push(this.parseMaybeAssign(t,p,this.parseParenItem));let _=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect(o.parenR),this.maybeInArrowParameters=s,e&&this.shouldParseArrow(u)&&this.eat(o.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=h,this.parseParenArrowList(n,r,u,t);(!u.length||f)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(p,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=h||this.awaitPos,u.length>1?(i=this.startNodeAt(c,l),i.expressions=u,this.finishNodeAt(i,`SequenceExpression`,_,v)):i=u[0]}else i=this.parseParenExpression();if(this.options.preserveParens){let e=this.startNodeAt(n,r);return e.expression=i,this.finishNode(e,`ParenthesizedExpression`)}else return i}parseTaggedTemplateExpression(e,t,n,r){let i=this.startNodeAt(t,n);return i.tag=e,i.quasi=this.parseTemplate({isTagged:!0}),r&&this.raise(t,`Tagged Template Literals are not allowed in optionalChain.`),this.finishNode(i,`TaggedTemplateExpression`)}shouldParseAsyncArrow(){if(this.match(o.colon)){let e=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(o.colon);return(this.canInsertSemicolon()||!this.match(o.arrow))&&e(),t});if(e.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!e.thrown)return e.error&&this.setLookaheadState(e.failState),this.shouldParseAsyncArrowReturnType=e.node,!this.canInsertSemicolon()&&this.eat(o.arrow)}else return!this.canInsertSemicolon()&&this.eat(o.arrow)}parseSubscriptAsyncArrow(e,t,n,r){let i=this.startNodeAt(e,t);return i.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(i,n,!0,r)}parseExprList(e,t,n,r){let i=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(o.comma),t&&this.afterTrailingComma(e))break;let s;n&&this.type===o.comma?s=null:this.type===o.ellipsis?(s=this.parseSpread(r),this.maybeInArrowParameters&&this.match(o.colon)&&(s.typeAnnotation=this.tsParseTypeAnnotation()),r&&this.type===o.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):s=this.parseMaybeAssign(!1,r,this.parseParenItem),i.push(s)}return i}parseSubscript(e,t,n,r,i,a,s){let c=a;if(!this.hasPrecedingLineBreak()&&this.value===`!`&&this.match(o.prefix)){this.exprAllowed=!1,this.next();let r=this.startNodeAt(t,n);return r.expression=e,e=this.finishNode(r,`TSNonNullExpression`),e}let l=!1;if(this.match(o.questionDot)&&this.lookaheadCharCode()===60){if(r)return e;e.optional=!0,c=l=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(o.bitShift)){let i,a=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let r=this.tsTryParseGenericAsyncArrowFunction(t,n,s);if(r)return e=r,e}let a=this.tsParseTypeArgumentsInExpression();if(!a)return e;if(l&&!this.match(o.parenL))return i=this.curPosition(),e;if(_(this.type)||this.type===o.backQuote){let r=this.parseTaggedTemplateExpression(e,t,n,c);return r.typeArguments=a,r}if(!r&&this.eat(o.parenL)){let r=new uf,i=this.startNodeAt(t,n);return i.callee=e,i.arguments=this.parseExprList(o.parenR,this.ecmaVersion>=8,!1,r),this.tsCheckForInvalidTypeCasts(i.arguments),i.typeArguments=a,c&&(i.optional=l),this.checkExpressionErrors(r,!0),e=this.finishNode(i,`CallExpression`),e}let u=this.type;if(this.tsMatchRightRelational()||u===o.bitShift||u!==o.parenL&&Mf(u)&&!this.hasPrecedingLineBreak())return;let d=this.startNodeAt(t,n);return d.expression=e,d.typeArguments=a,this.finishNode(d,`TSInstantiationExpression`)});if(i&&this.unexpected(i),a)return a.type===`TSInstantiationExpression`&&(this.match(o.dot)||this.match(o.questionDot)&&this.lookaheadCharCode()!==40)&&this.raise(this.start,Q.InvalidPropertyAccessAfterInstantiationExpression),e=a,e}let u=this.ecmaVersion>=11,d=u&&this.eat(o.questionDot);r&&d&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);let f=this.eat(o.bracketL);if(f||d&&this.type!==o.parenL&&this.type!==o.backQuote||this.eat(o.dot)){let r=this.startNodeAt(t,n);r.object=e,f?(r.property=this.parseExpression(),this.expect(o.bracketR)):this.type===o.privateId&&e.type!==`Super`?r.property=this.parsePrivateIdent():r.property=this.parseIdent(this.options.allowReserved!==`never`),r.computed=!!f,u&&(r.optional=d),e=this.finishNode(r,`MemberExpression`)}else if(!r&&this.eat(o.parenL)){let r=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let a=new uf,c=this.yieldPos,l=this.awaitPos,f=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let p=this.parseExprList(o.parenR,this.ecmaVersion>=8,!1,a);if(i&&!d&&this.shouldParseAsyncArrow())this.checkPatternErrors(a,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=c,this.awaitPos=l,this.awaitIdentPos=f,e=this.parseSubscriptAsyncArrow(t,n,p,s);else{this.checkExpressionErrors(a,!0),this.yieldPos=c||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=f||this.awaitIdentPos;let r=this.startNodeAt(t,n);r.callee=e,r.arguments=p,u&&(r.optional=d),e=this.finishNode(r,`CallExpression`)}this.maybeInArrowParameters=r}else if(this.type===o.backQuote){(d||c)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);let r=this.startNodeAt(t,n);r.tag=e,r.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(r,`TaggedTemplateExpression`)}return e}parseGetterSetter(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);let t=e.kind===`get`?0:1,n=e.value.params[0];if(t=n&&this.isThisParam(n)?t+1:t,e.value.params.length!==t){let t=e.value.start;e.kind===`get`?this.raiseRecoverable(t,`getter should have no params`):this.raiseRecoverable(t,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)}parseProperty(e,t){if(!e){let n=[];if(this.match(p.at))for(;this.match(p.at);)n.push(this.parseDecorator());let r=super.parseProperty(e,t);return r.type===`SpreadElement`&&n.length&&this.raise(r.start,pf.SpreadElementDecorator),n.length&&(r.decorators=n,n=[]),r}return super.parseProperty(e,t)}parseCatchClauseParam(){let e=this.parseBindingAtom(),t=e.type===`Identifier`;this.enterScope(t?$.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(e,t?$.BIND_SIMPLE_CATCH:$.BIND_LEXICAL);let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n,this.resetEndLocation(e)),this.expect(o.parenR),e}parseClass(e,t){let n=this.inAbstractClass;this.inAbstractClass=!!e.abstract;try{this.next(),this.takeDecorators(e);let n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);let r=this.enterClassBody(),i=this.startNode(),a=!1;i.body=[];let s=[];for(this.expect(o.braceL);this.type!==o.braceR;){if(this.match(p.at)){s.push(this.parseDecorator());continue}let t=this.parseClassElement(e.superClass!==null);s.length&&(t.decorators=s,this.resetStartLocationFromNode(t,s[0]),s=[]),t&&(i.body.push(t),t.type===`MethodDefinition`&&t.kind===`constructor`&&t.value.type===`FunctionExpression`?(a&&this.raiseRecoverable(t.start,`Duplicate constructor in the same class`),a=!0,t.decorators&&t.decorators.length>0&&this.raise(t.start,pf.DecoratorConstructor)):t.key&&t.key.type===`PrivateIdentifier`&&df(r,t)&&this.raiseRecoverable(t.key.start,`Identifier '#${t.key.name}' has already been declared`))}return this.strict=n,this.next(),s.length&&this.raise(this.start,pf.TrailingDecorator),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)}finally{this.inAbstractClass=n}}parseClassFunctionParams(){let e=this.tsTryParseTypeParameters(),t=this.parseBindingList(o.parenR,!1,this.ecmaVersion>=8,!0);return e&&(t.typeParameters=e),t}parseMethod(e,t,n,r,i){let a=this.startNode(),s=this.yieldPos,c=this.awaitPos,l=this.awaitIdentPos;if(this.initFunction(a),this.ecmaVersion>=6&&(a.generator=e),this.ecmaVersion>=8&&(a.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Of(t,a.generator)|$.SCOPE_SUPER|(n?$.SCOPE_DIRECT_SUPER:0)),this.expect(o.parenL),a.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0,!1,{isClassMethod:r}),this.yieldPos=s,this.awaitPos=c,this.awaitIdentPos=l,i&&i.abstract&&a.body){let{key:e}=i;this.raise(i.start,Q.AbstractMethodHasImplementation({methodName:e.type===`Identifier`&&!i.computed?e.name:`[${this.input.slice(e.start,e.end)}]`}))}return this.finishNode(a,`FunctionExpression`)}static parse(e,n){if(n.locations===!1)throw Error(`You have to enable options.locations while using acorn-typescript`);n.locations=!0;let r=new this(n,e);return t&&(r.isAmbientContext=!0),r.parse()}static parseExpressionAt(e,n,r){if(r.locations===!1)throw Error(`You have to enable options.locations while using acorn-typescript`);r.locations=!0;let i=new this(r,e,n);return t&&(i.isAmbientContext=!0),i.nextToken(),i.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(p.type)){let e=this.startNode();return e.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(e,!0,this.importOrExportOuterKind===`type`),this.finishNode(e,`ImportSpecifier`)}else{let e=super.parseImportSpecifier();return e.importKind=`value`,e}}parseExportSpecifier(e){let t=this.ts_isContextual(p.type);if(!this.match(o.string)&&t){let t=this.startNode();return t.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(t,!1,this.importOrExportOuterKind===`type`),this.finishNode(t,`ExportSpecifier`),this.checkExport(e,t.exported,t.exported.start),t}else{let t=super.parseExportSpecifier(e);return t.exportKind=`value`,t}}parseTypeOnlyImportExportSpecifier(e,t,n){let r=t?`imported`:`local`,i=t?`local`:`exported`,a=e[r],o,s=!1,c=!0,l=a.start;if(this.isContextual(`as`)){let e=this.parseIdent();if(this.isContextual(`as`)){let n=this.parseIdent();b(this.type)?(s=!0,a=e,o=t?this.parseIdent():this.parseModuleExportName(),c=!1):(o=n,c=!1)}else b(this.type)?(c=!1,o=t?this.parseIdent():this.parseModuleExportName()):(s=!0,a=e)}else b(this.type)&&(s=!0,t?(a=super.parseIdent(!0),this.isContextual(`as`)||this.checkUnreserved(a)):a=this.parseModuleExportName());s&&n&&this.raise(l,t?Q.TypeModifierIsUsedInTypeImports:Q.TypeModifierIsUsedInTypeExports),e[r]=a,e[i]=o;let u=t?`importKind`:`exportKind`;e[u]=s?`type`:`value`,c&&this.eatContextual(`as`)&&(e[i]=t?this.parseIdent():this.parseModuleExportName()),e[i]||(e[i]=this.copyNode(e[r])),t&&this.checkLValSimple(e[i],$.BIND_LEXICAL)}raiseCommonCheck(e,t,n){switch(t){case`Comma is not permitted after the rest element`:if(this.isAmbientContext&&this.match(o.comma)&&this.lookaheadCharCode()===41){this.next();return}else return super.raise(e,t)}return n?super.raiseRecoverable(e,t):super.raise(e,t)}raiseRecoverable(e,t){return this.raiseCommonCheck(e,t,!0)}raise(e,t){return this.raiseCommonCheck(e,t,!0)}updateContext(e){let{type:t}=this;if(t==o.braceL){var n=this.curContext();n==m.tc_oTag?this.context.push(d.b_expr):n==m.tc_expr?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(t===o.slash&&e===p.jsxTagStart)this.context.length-=2,this.context.push(m.tc_cTag),this.exprAllowed=!1;else return super.updateContext(e)}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();if(r&&(n.name=r),this.match(o.relational)||this.match(o.bitShift)){let e=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());e&&(n.typeArguments=e)}for(n.attributes=[];this.type!==o.slash&&this.type!==p.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(o.slash),this.expect(p.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}enterScope(e){e===qd&&this.importsStack.push([]),super.enterScope(e);let t=super.currentScope();t.types=[],t.enums=[],t.constEnums=[],t.classes=[],t.exportOnlyBindings=[]}exitScope(){super.currentScope().flags===qd&&this.importsStack.pop(),super.exitScope()}hasImport(e,t){let n=this.importsStack.length;if(this.importsStack[n-1].indexOf(e)>-1)return!0;if(!t&&n>1){for(let t=0;t<n-1;t++)if(this.importsStack[t].indexOf(e)>-1)return!0}return!1}maybeExportDefined(e,t){this.inModule&&e.flags&$.SCOPE_TOP&&this.undefinedExports.delete(t)}declareName(e,t,n){if(t&$.BIND_FLAGS_TS_IMPORT){this.hasImport(e,!0)&&this.raise(n,`Identifier '${e}' has already been declared.`),this.importsStack[this.importsStack.length-1].push(e);return}let r=this.currentScope();if(t&$.BIND_FLAGS_TS_EXPORT_ONLY){this.maybeExportDefined(r,e),r.exportOnlyBindings.push(e);return}t===$.BIND_TS_TYPE||t===$.BIND_TS_INTERFACE?(t===$.BIND_TS_TYPE&&r.types.includes(e)&&this.raise(n,`type '${e}' has already been declared.`),r.types.push(e)):super.declareName(e,t,n),t&$.BIND_FLAGS_TS_ENUM&&r.enums.push(e),t&$.BIND_FLAGS_TS_CONST_ENUM&&r.constEnums.push(e),t&$.BIND_FLAGS_CLASS&&r.classes.push(e)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let n=this.scopeStack.length;for(let e=n-1;e>=0;e--){let n=this.scopeStack[e];if(n.types.indexOf(t)>-1||n.exportOnlyBindings.indexOf(t)>-1)return}super.checkLocalExport(e)}}return C}}const If=K.extend(Ff());function Lf(e){let t=Xr(e),n=Rf({dependencies:Vf(t.dependencies,e),devDependencies:Vf(t.devDependencies,e)});return n=zf(n),n}function Rf(e){for(let t of Object.values(e))for(let[n,r]of Object.entries(t.versions)){let i=t.deps[r],a=`@types/${n.replace(/^@(.*)\/(.*)/,`$1__$2`)}`;(e.dependencies.versions[a]??e.devDependencies.versions[a])&&i.push(a)}return e}function zf(e){for(let t of Object.values(e))for(let[n,r]of Object.entries(t.deps))t.deps[n]=r.map(t=>e.dependencies.versions[t]||e.devDependencies.versions[t]).filter(e=>e!==void 0);return e}const Bf=[`svelte`,`@sveltejs/kit`,`tailwindcss`,`vite`];function Vf(e,t){let n={},r={};for(let[i,a]of Object.entries(e??{})){let e=a?`${i}@${a}`:i,o=n[e]??=[];r[i]=e;let s=Bn(t,i)?.pkg;if(!s)continue;let{peerDependencies:c={},peerDependenciesMeta:l={}}=s;for(let[e]of Object.entries(c))Bf.includes(e)||l[e]?.optional||o.push(e)}return{deps:n,versions:r}}async function Hf(e){let{filename:t,source:n}=e,r,i;if(t.endsWith(`.svelte`)){let{code:e}=await tt.preprocess(n,[],{filename:t}),a=tt.parse(e,{filename:t});r=a.instance,a.module&&(i=a.module)}else if(t.endsWith(`.ts`)||t.endsWith(`.js`))r=If.parse(n,{ecmaVersion:`latest`,sourceType:`module`,sourceFile:t});else return{};let a=new Set,o=new Set,s=t=>{if(t.type!==`ImportDeclaration`)return;let n=t.source.value;Uf(n,e.dependencies).forEach(e=>a.add(e)),Uf(n,e.devDependencies).forEach(e=>o.add(e))};return _e(r,{enter:s}),i&&_e(i,{enter:s}),{dependencies:d(a),devDependencies:d(o)}}function Uf(e,t){let n=[],r=(t.versions[e]?e:void 0)??Object.keys(t.versions).find(t=>e.startsWith(t));if(r&&!Bf.includes(r)){let e=t.versions[r],i=t.deps[e];n.push(e),i?.forEach(e=>n.push(e))}return n}const Wf=o({registry:m(),cwd:m(),output:m()}),Gf=new Te().command(`build`).description(`build components for a shadcn-svelte registry`).argument(`[registry]`,`path to registry.json file`,`./registry.json`).option(`-c, --cwd <path>`,`the working directory`,T.cwd()).option(`-o, --output <path>`,`destination directory for json files`,`./static/r`).action(async(e,t)=>{try{to();let n=Wf.parse({registry:e,...t}),r=E.resolve(n.cwd),i=E.resolve(n.cwd,n.output),a=E.resolve(n.cwd,n.registry);for(let[e,t]of Object.entries({cwd:r,registry:a}))if(!O(t))throw h(`The '${e}' path ${M.default.cyan(t)} does not exist.`);await Kf({cwd:r,output:i,registry:a}),za(`${M.default.green(`Success!`)} Registry build completed.`)}catch(e){ro(e)}});async function Kf(e){let t=Ka();t.start(`Parsing registry schema`);let n=await k.readFile(e.registry,`utf8`),r=ge.parse(JSON.parse(n));t.stop(`Parsed registry schema at ${M.default.dim(E.relative(e.cwd,e.registry))}`);let i=r.items.map(e=>({...e,relativeUrl:`${e.name}.json`}));O(e.output)||await k.mkdir(e.output,{recursive:!0});let a=[];a.push({title:`Building registry index`,async task(){let t=E.resolve(e.output,`index.json`),n=ce.parse(i);await k.writeFile(t,JSON.stringify(n,null,` `),`utf8`);let r=E.relative(e.cwd,t);return`Registry index written to ${M.default.dim(r)}`}}),a.push({title:`Building registry items`,async task(t){let n=Lf(e.cwd);if(r.overrideDependencies){let e=(e,t)=>{let{name:n}=Zs(e),r=t.versions[n];if(r){let i=t.deps[r];delete t.deps[r],t.versions[n]=e,t.deps[e]=i??[]}};for(let t of r.overrideDependencies)e(t,n.dependencies),e(t,n.devDependencies)}for(let i of r.items){t(`Building item ${M.default.cyan(i.name)}`);let a=i.files.length===1,o=[`registry:page`,`registry:ui`,`registry:file`],s=i.files.map(async e=>{let t=await k.readFile(e.path,`utf8`);t=Jf(r.aliases??={},t);let n=E.basename(e.path),s;return s=a?n:o.includes(e.type)?`${i.name}/${n}`:n,{content:t,name:n,target:s,...e}}),c=await Promise.all(s),l=new Set(i.dependencies),u=new Set(i.devDependencies),f=new Set(i.registryDependencies.map(qf));if(!(l.size>0&&u.size>0))for(let e of c){let t=await Hf({...n,filename:e.name,source:e.content});i.dependencies||t.dependencies?.forEach(e=>{e.startsWith(`@types/`)?u.add(e):l.add(e)}),i.devDependencies||t.devDependencies?.forEach(e=>u.add(e))}let p=pe.parse({...i,$schema:`${b}/schema/registry-item.json`,registryDependencies:d(f),dependencies:d(l),devDependencies:d(u),files:c},{jitless:!0}),m=E.resolve(e.output,`${i.name}.json`);await k.writeFile(m,JSON.stringify(p,null,` `),`utf8`)}let i=E.relative(e.cwd,e.output);return`Registry items written to ${M.default.dim(i)}`}}),await Za(a)}function qf(e){return e.startsWith(`local:`)?e.replace(/^local:(.*)/,`./$1.json`):e}function Jf(e,t){for(let n of C){let r=x[n],i=e[n]??=r.defaultPath;t=t.replaceAll(i,r.placeholder)}return t}const Yf=new Te().command(`registry`).addCommand(Gf);var Xf=n({add:()=>tc,init:()=>ol,registry:()=>Yf,update:()=>dl});T.on(`SIGINT`,()=>T.exit(0)),T.on(`SIGTERM`,()=>T.exit(0));const Zf=T.versions.node;Number.parseInt(Zf.split(`.`).at(0))<20&&(console.error(`Node.js v${Zf} is out of date and unsupported!`),console.error(`Please use Node.js v20 or higher.`),T.exit(1));async function Qf(){let e=Ln(),t=new Te().name(`shadcn-svelte`).description(`Add shadcn-svelte components to your project`).version(e.version||`0.0.0`,`-v, --version`,`display the version number`);for(let e of Object.values(Xf))t.addCommand(e);t.parse()}Qf();export{};
|