@frontfriend/sdk 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +64 -64
- package/dist/lib/core/adoption.js +1 -1
- package/dist/lib/core/application-adoption.js +1 -1
- package/dist/lib/core/token-processor.js +6 -6
- package/dist/mcp.cjs +69 -69
- package/dist/next.js +1 -1
- package/dist/package.json +1 -1
- package/dist/vite.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var S=j((q,F)=>{F.exports={name:"@frontfriend/sdk",version:"1.3.
|
|
1
|
+
var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var S=j((q,F)=>{F.exports={name:"@frontfriend/sdk",version:"1.3.1"}});var C=j(($,b)=>{var{name:w}=S();b.exports={PACKAGE_NAME:w}});var{PACKAGE_NAME:m}=C(),u=require("fs"),E=require("http"),O=require("https"),r=require("path"),g=["contracts","tokens","components"],T=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],k={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},x=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],I=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function A(n){try{return JSON.parse(u.readFileSync(n,"utf8"))}catch{return{}}}function h(n){if(n===void 0)return null;if(!Array.isArray(n)){let t=new Error("`adopt` in frontfriend.config.js must be an array.");throw t.code="FRONTFRIEND_CONFIG_VALIDATION",t}let e=n.filter(t=>!g.includes(t));if(e.length>0){let t=new Error(`Unknown Frontfriend adoption level: ${e.join(", ")}.`);throw t.code="FRONTFRIEND_CONFIG_VALIDATION",t}let i=n.includes("components")?2:n.includes("tokens")?1:0;return g.slice(0,i+1)}function _(n){for(let[e,i]of Object.entries(k)){let t=i.find(s=>u.existsSync(r.join(n,s)));if(!t)continue;let c=u.readFileSync(r.join(n,t),"utf8");return{buildTool:e,present:c.includes(`${m}/${e}`)}}return{buildTool:null,present:!1}}function v(n){let e=[r.join(n,"components","ui"),r.join(n,"src","components","ui"),r.join(n,"app","components","ui")].filter(c=>u.existsSync(c)),i=new Set;function t(c){for(let s of u.readdirSync(c,{withFileTypes:!0})){let o=r.join(c,s.name);if(s.isDirectory())t(o);else if(/\.(js|jsx|ts|tsx|vue)$/.test(s.name)){if(!u.readFileSync(o,"utf8").includes(m))continue;let a=r.basename(s.name,r.extname(s.name));i.add(a.toLowerCase()==="index"?r.basename(c):a.toLowerCase())}}}return e.forEach(t),[...i].sort()}function P(n){let e=A(r.join(n,"package.json")),i={...e.dependencies||{},...e.devDependencies||{}},t=i.tailwindcss||null,s=[A(r.join(n,"components.json"))?.tailwind?.css,...T].filter(Boolean).find(a=>u.existsSync(r.join(n,a))),o=s?u.readFileSync(r.join(n,s),"utf8"):"",l=I.filter(a=>i[a]);return!l.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(o)&&!o.includes(`${m}/theme.css`)&&l.push("css-custom-properties"),{nativeTokens:{present:o.includes("/* Frontfriend managed native tokens: start */"),file:s||null},tailwind:{present:!!t,version:t,major:t&&Number((String(t).match(/\d+/)||[])[0])||null},componentsJson:u.existsSync(r.join(n,"components.json")),themeImport:{present:o.includes(`${m}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(o),file:s||null},plugin:_(n),frontfriendComponents:v(n),foreignComponentLibraries:x.filter(a=>i[a]),foreignTokenSystems:l}}function D(n,e,{baseLibrary:i}={}){let t=h(n)||g,c=t.includes("tokens"),s=t.includes("components"),o=[];return c&&!e.themeImport.present&&!e.nativeTokens?.present&&o.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!c&&e.themeImport.present&&o.push("Frontfriend tokens are present in CSS but are not adopted in config."),s&&i==="shadcn"&&!e.componentsJson&&o.push("Config adopts components, but components.json was not observed."),!s&&e.frontfriendComponents.length>0&&o.push("Frontfriend components are installed but are not adopted in config."),o}function L({apiUrl:n,token:e,ffId:i,name:t,adopt:c,observed:s,framework:o,primitive:l}){if(!n||!e||!i||!t||!o||l===void 0)return Promise.resolve({reported:!1,unavailable:!0});let a=new URL("/api/apps/sync",n),y=JSON.stringify({ffId:i,name:t,adopt:h(c),observed:s,runtime:"sdk",framework:o,primitive:l}),N=a.protocol==="https:"?O:E;return new Promise(d=>{let f=N.request(a,{method:"POST",headers:{authorization:`Bearer ${e}`,"content-type":"application/json","content-length":Buffer.byteLength(y)}},p=>{p.resume(),p.on("end",()=>{p.statusCode>=200&&p.statusCode<300?d({reported:!0,unavailable:!1}):d({reported:!1,unavailable:!0})})});f.on("error",()=>d({reported:!1,unavailable:!0})),f.setTimeout(1500,()=>{f.destroy(),d({reported:!1,unavailable:!0})}),f.end(y)})}module.exports={ADOPTION_LEVELS:g,normalizeAdopt:h,probeAdoption:P,adoptionWarnings:D,reportAdoption:L};
|
|
@@ -3,7 +3,7 @@ var Rr=Object.create;var Pt=Object.defineProperty;var Nr=Object.getOwnPropertyDe
|
|
|
3
3
|
`)?s.body.slice(0,-1):s.body;return["<!-- frontfriend design mirror \u2014 DO NOT EDIT (overwritten by `frontfriend design sync`)",`slug: ${s.slug}`,`maturity: ${s.maturity}`,`implemented: ${s.implemented}`,`implementation: ${s.implementation||"unknown"}`,`version: ${s.version}`,"-->","",r,""].join(`
|
|
4
4
|
`)}function ti(s){return[`# Frontfriend design mirror \u2014 ${s.name}`,"","This directory is a READ-ONLY mirror of the Design System design contracts",`(Design System "${s.name}", ff-id \`${s.ff_id}\`) managed on the Frontfriend platform.`,"","Every file here is overwritten by `frontfriend design sync`. Do not edit by","hand: local changes are discarded on the next sync, and files whose contract","was removed upstream are deleted. Edit contracts on the platform instead.",""].join(`
|
|
5
5
|
`)}function cs({design_system:s,contracts:r}){let o=[...r].filter(l=>ft(l.slug)).sort((l,p)=>l.kind.localeCompare(p.kind)||l.slug.localeCompare(p.slug)),c={"README.md":ti(s)};for(let l of o)c[l.slug]=ei(l);return c}function Zt(s,r){let o={};for(let[l,p]of Object.entries(s))r[l]!==p&&(o[l]=p);let c=Object.keys(r).filter(l=>!(l in s)).sort();return{writes:o,deletes:c}}var ii=s=>os("sha256").update(s).digest("hex");function Wr(s){return Object.fromEntries(Object.entries(s).filter(([r])=>r!=="README.md"&&ft(r)).map(([r,o])=>[r,ii(o)]))}function Hr(s,r){let o=()=>{throw new Error("Invalid or incomplete mirror response. No local files were changed; retry sync.")};(!s||typeof s.design_system?.ff_id!="string"||typeof s.design_system?.name!="string"||!Array.isArray(s.contracts))&&o();let c=new Map;for(let h of s.contracts)(!h||!ft(h.slug)||h.slug==="README.md"||typeof h.body!="string"||typeof h.kind!="string"||typeof h.maturity!="string"||typeof h.implemented!="boolean"||!Number.isSafeInteger(h.version)||h.version<1||c.has(h.slug))&&o(),c.set(h.slug,ei(h));if(s.protocol===void 0)return s.manifest!==void 0&&o(),Zt(cs(s),r);(s.protocol!==1||!Array.isArray(s.manifest))&&o();let l={"README.md":ti(s.design_system)},p=new Set;for(let h of s.manifest){(!h||!ft(h.slug)||h.slug==="README.md"||!/^[a-f0-9]{64}$/.test(h.hash)||p.has(h.slug))&&o(),p.add(h.slug);let f=c.get(h.slug)??r[h.slug];(typeof f!="string"||ii(f)!==h.hash)&&o(),Object.defineProperty(l,h.slug,{value:f,enumerable:!0})}return[...c.keys()].some(h=>!p.has(h))&&o(),Zt(l,r)}function zr(s){let r={};if(!Me.existsSync(s))return r;let o=c=>{for(let l of Me.readdirSync(c,{withFileTypes:!0})){let p=Te.join(c,l.name);if(l.isDirectory())o(p);else if(l.isFile()){let h=Te.relative(s,p).split(Te.sep).join("/");r[h]=Me.readFileSync(p,"utf8")}}};return o(s),r}function Gr(s,r){for(let[o,c]of Object.entries(r.writes)){let l=Te.join(s,...o.split("/"));Me.mkdirSync(Te.dirname(l),{recursive:!0}),Me.writeFileSync(l,c)}for(let o of r.deletes){let c=Te.join(s,...o.split("/"));Me.rmSync(c,{force:!0});let l=Te.dirname(c),p=Te.resolve(s);for(;Te.resolve(l)!==p&&Me.existsSync(l)&&Me.readdirSync(l).length===0;)Me.rmdirSync(l),l=Te.dirname(l)}}function Jr(s,r,o){if(!r||s.contract_selection!==1||s.selection?.design_snapshot_id!==r.snapshotId||s.selection?.digest!==r.snapshotDigest||s.app?.id!==r.appId||s.design_system?.ff_id!==o)throw new Error("Contract mirror does not match the selected App snapshot.");let c=[...r.sharedContracts,...r.contracts],l=s.manifest??s.contracts,p=new Map(c.map(h=>[h.slug,h]));if(!Array.isArray(l)||!Array.isArray(s.contracts)||l.length!==c.length||new Set(l.map(h=>h.slug)).size!==c.length||l.some(h=>!p.has(h.slug)))throw new Error("Contract mirror inventory does not match the snapshot.");for(let h of s.contracts){let f=p.get(h.slug);if(!f||h.revision_id!==f.revisionId||h.digest!==f.digest||h.version!==f.version||h.kind!==f.kind)throw new Error("Contract body identity does not match its snapshot pin.");let d={appId:r.contracts.some(w=>w.slug===f.slug)?r.appId:null,body:h.body,designSystemId:r.designSystemId,kind:h.kind,maturity:h.maturity,slug:h.slug,title:h.title};if(os("sha256").update(JSON.stringify(d)).digest("hex")!==f.digest)throw new Error("Contract content does not match its immutable digest.")}return c}us.exports={validatePinnedMirror:Jr,MIRROR_DIR:$r,FRONTFRIEND_GITIGNORE_PATH:Ur,renderFrontfriendGitignore:qr,isSafeSlug:ft,renderContractFile:ei,renderMirrorReadme:ti,buildMirrorTree:cs,planMirrorSync:Zt,hashMirrorFile:ii,knownMirrorHashes:Wr,planMirrorResponse:Hr,readMirrorTree:zr,applyMirrorPlan:Gr}});var ci=Ee((ga,vs)=>{var oi=require("fs"),fe=require("path");function fs(s,r="JSON"){let o="",c=0,l=s.charCodeAt(0)===65279?s.slice(1):s;for(;c<l.length;){let h=l[c];if(h==='"'){let f=c+1;for(;f<l.length&&l[f]!=='"';)f+=l[f]==="\\"?2:1;o+=l.slice(c,f+1),c=f+1}else if(h==="/"&&l[c+1]==="/")for(;c<l.length&&l[c]!==`
|
|
6
|
-
`;)c+=1;else if(h==="/"&&l[c+1]==="*"){let f=l.indexOf("*/",c+2);if(f===-1)throw new Error(`Cannot read ${r}: unterminated comment.`);o+=l.slice(c,f+2).replace(/[^\n]/g," "),c=f+2}else o+=h,c+=1}let p="";for(let h=0;h<o.length;h+=1){let f=o[h];if(f==='"'){let d=h+1;for(;d<o.length&&o[d]!=='"';)d+=o[d]==="\\"?2:1;p+=o.slice(h,d+1),h=d;continue}if(f===","){let d=h+1;for(;d<o.length&&/\s/.test(o[d]);)d+=1;if(o[d]==="}"||o[d]==="]")continue}p+=f}try{return p.trim()?JSON.parse(p):{}}catch(h){throw new Error(`Cannot read ${r}: ${h.message}`)}}function ds(s){return fs(oi.readFileSync(s,"utf8"),s)}var Tt=s=>{try{return oi.statSync(s).isFile()}catch{return!1}};function ms(s,r){if(typeof s!="string"||!s)throw new Error('tsconfig "extends" must be a non-empty string.');let o=c=>Tt(c)?c:!c.endsWith(".json")&&Tt(`${c}.json`)?`${c}.json`:null;if(s.startsWith(".")||fe.isAbsolute(s)){let c=o(fe.resolve(r,s));if(c)return c;throw new Error(`File '${s}' not found (tsconfig extends, from ${r}).`)}for(let c=r;;c=fe.dirname(c)){let l=fe.join(c,"node_modules",s),p=o(l);if(p)return p;let h=null;try{h=JSON.parse(oi.readFileSync(fe.join(l,"package.json"),"utf8"))}catch{h=null}if(h&&typeof h.tsconfig=="string"&&Tt(fe.join(l,h.tsconfig)))return fe.join(l,h.tsconfig);if(Tt(fe.join(l,"tsconfig.json")))return fe.join(l,"tsconfig.json");if(fe.dirname(c)===c)break}for(let c of[s,`${s}/tsconfig.json`,`${s}.json`])try{return require.resolve(c,{paths:[r]})}catch{}throw new Error(`File '${s}' not found (tsconfig extends, from ${r}).`)}function gs(s,r,o=new Set){let c=fe.resolve(s);if(o.has(c))throw new Error(`Circularity detected while resolving configuration: ${c}`);let l=new Set(o).add(c),p=ds(c),h=fe.dirname(c),f={},d=p.extends===void 0?[]:Array.isArray(p.extends)?p.extends:[p.extends];for(let I of d)f={...f,...gs(ms(I,h),r,l)};let v=p.compilerOptions&&typeof p.compilerOptions=="object"?p.compilerOptions:{},w=I=>typeof I=="string"?I.replace(/\$\{configDir\}/g,r):I;return typeof v.baseUrl=="string"&&(f.baseUrl=fe.resolve(h,w(v.baseUrl))),v.paths&&typeof v.paths=="object"&&(f.paths=Object.fromEntries(Object.entries(v.paths).map(([I,A])=>[I,Array.isArray(A)?A.map(w):A])),f.pathsBasePath=h),f}function Zr(s){let r=gs(s,fe.dirname(fe.resolve(s)));return r.paths?{base:r.baseUrl||r.pathsBasePath||fe.dirname(s),paths:r.paths}:null}vs.exports={parseJsonc:fs,readJsonc:ds,resolveExtends:ms,readConfigPaths:Zr}});var Ot={};Yt(Ot,{materializeInstallationPath:()=>li,readProjectPaths:()=>ys,resolveCanonicalUiDirectory:()=>bs,resolveConfiguredAlias:()=>Lt});function xs(s){try{return JSON.parse(tt.default.readFileSync(s,"utf8"))}catch{return null}}function ys(s){for(let r of["tsconfig.json","tsconfig.app.json","jsconfig.json"]){let o=me.default.join(s,r);if(!tt.default.existsSync(o))continue;let c=en(o);if(c)return c}return{base:s,paths:{"@/*":[tt.default.existsSync(me.default.join(s,"src"))?"src/*":"*"]}}}function Lt(s,r,o=ys(s)){for(let[c,l]of Object.entries(o.paths)){if(!Array.isArray(l)||typeof l[0]!="string")continue;let[p,h=""]=c.split("*");if(!r.startsWith(p)||!r.endsWith(h)||!c.includes("*")&&r!==c)continue;let f=r.slice(p.length,h?-h.length:void 0);return me.default.resolve(o.base,l[0].replace("*",f))}return r.startsWith("@/")?me.default.resolve(s,tt.default.existsSync(me.default.join(s,"src"))?"src":".",r.slice(2)):me.default.resolve(s,r)}function ui(s,r){let o=me.default.relative(s,r).replace(/\\/g,"/");if(!o||o===".."||o.startsWith("../")||me.default.posix.isAbsolute(o))throw new Error("The canonical ui alias must stay inside the Application root.");return o}function bs(s,r){if(r)return ui(s,Lt(s,r));let c=xs(me.default.join(s,"components.json"))?.aliases?.ui;return typeof c=="string"&&c?ui(s,Lt(s,c)):tt.default.existsSync(me.default.join(s,"src"))?"src/components/ui":"components/ui"}function li(s){if(s.installationLayout==="shadcn"&&/^(?:lib|hooks|components)\//.test(s.path)){let c=xs(me.default.join(s.root,"components.json"))?.aliases||{},l=/^lib\/utils\.[^.]+$/.test(s.path),p=s.path.split("/")[0],h=l&&c.utils?c.utils:c[p]||`@/${p}`,f=Lt(s.root,h);return ui(s.root,l&&c.utils?f+me.default.extname(s.path):me.default.join(f,s.path.slice(p.length+1)))}if(s.source!=="canonical"&&s.installationLayout!=="shadcn"||!s.path.startsWith("ui/"))return s.path;let r=s.path.slice(3);return me.default.posix.join(bs(s.root,s.configuredUiPath),r)}var tt,me,en,mt=Zi(()=>{tt=Ze(require("node:fs")),me=Ze(require("node:path")),{readConfigPaths:en}=ci()});var Ss=Ee((xa,rn)=>{rn.exports={name:"@frontfriend/sdk",version:"1.3.0"}});var Cs=Ee((ya,ks)=>{var{name:nn}=Ss();ks.exports={PACKAGE_NAME:nn}});var pi=Ee((ba,As)=>{var{PACKAGE_NAME:jt}=Cs(),$e=require("fs"),an=require("http"),on=require("https"),ye=require("path"),Vt=["contracts","tokens","components"],cn=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],un={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},ln=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],hn=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function Is(s){try{return JSON.parse($e.readFileSync(s,"utf8"))}catch{return{}}}function hi(s){if(s===void 0)return null;if(!Array.isArray(s)){let c=new Error("`adopt` in frontfriend.config.js must be an array.");throw c.code="FRONTFRIEND_CONFIG_VALIDATION",c}let r=s.filter(c=>!Vt.includes(c));if(r.length>0){let c=new Error(`Unknown Frontfriend adoption level: ${r.join(", ")}.`);throw c.code="FRONTFRIEND_CONFIG_VALIDATION",c}let o=s.includes("components")?2:s.includes("tokens")?1:0;return Vt.slice(0,o+1)}function pn(s){for(let[r,o]of Object.entries(un)){let c=o.find(p=>$e.existsSync(ye.join(s,p)));if(!c)continue;let l=$e.readFileSync(ye.join(s,c),"utf8");return{buildTool:r,present:l.includes(`${jt}/${r}`)}}return{buildTool:null,present:!1}}function fn(s){let r=[ye.join(s,"components","ui"),ye.join(s,"src","components","ui"),ye.join(s,"app","components","ui")].filter(l=>$e.existsSync(l)),o=new Set;function c(l){for(let p of $e.readdirSync(l,{withFileTypes:!0})){let h=ye.join(l,p.name);if(p.isDirectory())c(h);else if(/\.(js|jsx|ts|tsx|vue)$/.test(p.name)){if(!$e.readFileSync(h,"utf8").includes(jt))continue;let d=ye.basename(p.name,ye.extname(p.name));o.add(d.toLowerCase()==="index"?ye.basename(l):d.toLowerCase())}}}return r.forEach(c),[...o].sort()}function dn(s){let r=Is(ye.join(s,"package.json")),o={...r.dependencies||{},...r.devDependencies||{}},c=o.tailwindcss||null,p=[Is(ye.join(s,"components.json"))?.tailwind?.css,...cn].filter(Boolean).find(d=>$e.existsSync(ye.join(s,d))),h=p?$e.readFileSync(ye.join(s,p),"utf8"):"",f=hn.filter(d=>o[d]);return!f.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(h)&&!h.includes(`${jt}/theme.css`)&&f.push("css-custom-properties"),{nativeTokens:{present:h.includes("/* Frontfriend managed native tokens: start */"),file:p||null},tailwind:{present:!!c,version:c,major:c&&Number((String(c).match(/\d+/)||[])[0])||null},componentsJson:$e.existsSync(ye.join(s,"components.json")),themeImport:{present:h.includes(`${jt}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(h),file:p||null},plugin:pn(s),frontfriendComponents:fn(s),foreignComponentLibraries:ln.filter(d=>o[d]),foreignTokenSystems:f}}function mn(s,r,{baseLibrary:o}={}){let c=hi(s)||Vt,l=c.includes("tokens"),p=c.includes("components"),h=[];return l&&!r.themeImport.present&&!r.nativeTokens?.present&&h.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!l&&r.themeImport.present&&h.push("Frontfriend tokens are present in CSS but are not adopted in config."),p&&o==="shadcn"&&!r.componentsJson&&h.push("Config adopts components, but components.json was not observed."),!p&&r.frontfriendComponents.length>0&&h.push("Frontfriend components are installed but are not adopted in config."),h}function gn({apiUrl:s,token:r,ffId:o,name:c,adopt:l,observed:p,framework:h,primitive:f}){if(!s||!r||!o||!c||!h||f===void 0)return Promise.resolve({reported:!1,unavailable:!0});let d=new URL("/api/apps/sync",s),v=JSON.stringify({ffId:o,name:c,adopt:hi(l),observed:p,runtime:"sdk",framework:h,primitive:f}),w=d.protocol==="https:"?on:an;return new Promise(I=>{let A=w.request(d,{method:"POST",headers:{authorization:`Bearer ${r}`,"content-type":"application/json","content-length":Buffer.byteLength(v)}},B=>{B.resume(),B.on("end",()=>{B.statusCode>=200&&B.statusCode<300?I({reported:!0,unavailable:!1}):I({reported:!1,unavailable:!0})})});A.on("error",()=>I({reported:!1,unavailable:!0})),A.setTimeout(1500,()=>{A.destroy(),I({reported:!1,unavailable:!0})}),A.end(v)})}As.exports={ADOPTION_LEVELS:Vt,normalizeAdopt:hi,probeAdoption:dn,adoptionWarnings:mn,reportAdoption:gn}});var Es=Ee((Ft,_s)=>{(function(s,r){typeof Ft=="object"&&typeof _s<"u"?r(Ft):typeof define=="function"&&define.amd?define(["exports"],r):(s=typeof globalThis<"u"?globalThis:s||self,r(s.acorn={}))})(Ft,function(s){"use strict";var r=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],o=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],c="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",l="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",p={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"},h="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",f={5:h,"5module":h+" export import",6:h+" const class extends export import super"},d=/^in(stanceof)?$/,v=new RegExp("["+l+"]"),w=new RegExp("["+l+c+"]");function I(e,t){for(var i=65536,n=0;n<t.length;n+=2){if(i+=t[n],i>e)return!1;if(i+=t[n+1],i>=e)return!0}return!1}function A(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&v.test(String.fromCharCode(e)):t===!1?!1:I(e,o)}function B(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&&w.test(String.fromCharCode(e)):t===!1?!1:I(e,o)||I(e,r)}var _=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function T(e,t){return new _(e,{beforeExpr:!0,binop:t})}var R={beforeExpr:!0},E={startsExpr:!0},oe={};function O(e,t){return t===void 0&&(t={}),t.keyword=e,oe[e]=new _(e,t)}var a={num:new _("num",E),regexp:new _("regexp",E),string:new _("string",E),name:new _("name",E),privateId:new _("privateId",E),eof:new _("eof"),bracketL:new _("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new _("]"),braceL:new _("{",{beforeExpr:!0,startsExpr:!0}),braceR:new _("}"),parenL:new _("(",{beforeExpr:!0,startsExpr:!0}),parenR:new _(")"),comma:new _(",",R),semi:new _(";",R),colon:new _(":",R),dot:new _("."),question:new _("?",R),questionDot:new _("?."),arrow:new _("=>",R),template:new _("template"),invalidTemplate:new _("invalidTemplate"),ellipsis:new _("...",R),backQuote:new _("`",E),dollarBraceL:new _("${",{beforeExpr:!0,startsExpr:!0}),eq:new _("=",{beforeExpr:!0,isAssign:!0}),assign:new _("_=",{beforeExpr:!0,isAssign:!0}),incDec:new _("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new _("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new _("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new _("**",{beforeExpr:!0}),coalesce:T("??",1),_break:O("break"),_case:O("case",R),_catch:O("catch"),_continue:O("continue"),_debugger:O("debugger"),_default:O("default",R),_do:O("do",{isLoop:!0,beforeExpr:!0}),_else:O("else",R),_finally:O("finally"),_for:O("for",{isLoop:!0}),_function:O("function",E),_if:O("if"),_return:O("return",R),_switch:O("switch"),_throw:O("throw",R),_try:O("try"),_var:O("var"),_const:O("const"),_while:O("while",{isLoop:!0}),_with:O("with"),_new:O("new",{beforeExpr:!0,startsExpr:!0}),_this:O("this",E),_super:O("super",E),_class:O("class",E),_extends:O("extends",R),_export:O("export"),_import:O("import",E),_null:O("null",E),_true:O("true",E),_false:O("false",E),_in:O("in",{beforeExpr:!0,binop:7}),_instanceof:O("instanceof",{beforeExpr:!0,binop:7}),_typeof:O("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:O("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:O("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,j=new RegExp(b.source,"g");function V(e){return e===10||e===13||e===8232||e===8233}function W(e,t,i){i===void 0&&(i=e.length);for(var n=t;n<i;n++){var u=e.charCodeAt(n);if(V(u))return n<i-1&&u===13&&e.charCodeAt(n+1)===10?n+2:n+1}return-1}var Y=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,q=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ee=Object.prototype,xe=ee.hasOwnProperty,nt=ee.toString,re=Object.hasOwn||function(e,t){return xe.call(e,t)},bt=Array.isArray||function(e){return nt.call(e)==="[object Array]"},zt=Object.create(null);function Re(e){return zt[e]||(zt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ue(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var wt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,S=function(t,i){this.line=t,this.column=i};S.prototype.offset=function(t){return new S(this.line,this.column+t)};var $=function(t,i,n){this.start=i,this.end=n,t.sourceFile!==null&&(this.source=t.sourceFile)};function te(e,t){for(var i=1,n=0;;){var u=W(e,n,t);if(u<0)return new S(i,t-n);++i,n=u}}var Se={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Oe=!1;function ne(e){var t={};for(var i in Se)t[i]=e&&re(e,i)?e[i]:Se[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Oe&&typeof console=="object"&&console.warn&&(Oe=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
6
|
+
`;)c+=1;else if(h==="/"&&l[c+1]==="*"){let f=l.indexOf("*/",c+2);if(f===-1)throw new Error(`Cannot read ${r}: unterminated comment.`);o+=l.slice(c,f+2).replace(/[^\n]/g," "),c=f+2}else o+=h,c+=1}let p="";for(let h=0;h<o.length;h+=1){let f=o[h];if(f==='"'){let d=h+1;for(;d<o.length&&o[d]!=='"';)d+=o[d]==="\\"?2:1;p+=o.slice(h,d+1),h=d;continue}if(f===","){let d=h+1;for(;d<o.length&&/\s/.test(o[d]);)d+=1;if(o[d]==="}"||o[d]==="]")continue}p+=f}try{return p.trim()?JSON.parse(p):{}}catch(h){throw new Error(`Cannot read ${r}: ${h.message}`)}}function ds(s){return fs(oi.readFileSync(s,"utf8"),s)}var Tt=s=>{try{return oi.statSync(s).isFile()}catch{return!1}};function ms(s,r){if(typeof s!="string"||!s)throw new Error('tsconfig "extends" must be a non-empty string.');let o=c=>Tt(c)?c:!c.endsWith(".json")&&Tt(`${c}.json`)?`${c}.json`:null;if(s.startsWith(".")||fe.isAbsolute(s)){let c=o(fe.resolve(r,s));if(c)return c;throw new Error(`File '${s}' not found (tsconfig extends, from ${r}).`)}for(let c=r;;c=fe.dirname(c)){let l=fe.join(c,"node_modules",s),p=o(l);if(p)return p;let h=null;try{h=JSON.parse(oi.readFileSync(fe.join(l,"package.json"),"utf8"))}catch{h=null}if(h&&typeof h.tsconfig=="string"&&Tt(fe.join(l,h.tsconfig)))return fe.join(l,h.tsconfig);if(Tt(fe.join(l,"tsconfig.json")))return fe.join(l,"tsconfig.json");if(fe.dirname(c)===c)break}for(let c of[s,`${s}/tsconfig.json`,`${s}.json`])try{return require.resolve(c,{paths:[r]})}catch{}throw new Error(`File '${s}' not found (tsconfig extends, from ${r}).`)}function gs(s,r,o=new Set){let c=fe.resolve(s);if(o.has(c))throw new Error(`Circularity detected while resolving configuration: ${c}`);let l=new Set(o).add(c),p=ds(c),h=fe.dirname(c),f={},d=p.extends===void 0?[]:Array.isArray(p.extends)?p.extends:[p.extends];for(let I of d)f={...f,...gs(ms(I,h),r,l)};let v=p.compilerOptions&&typeof p.compilerOptions=="object"?p.compilerOptions:{},w=I=>typeof I=="string"?I.replace(/\$\{configDir\}/g,r):I;return typeof v.baseUrl=="string"&&(f.baseUrl=fe.resolve(h,w(v.baseUrl))),v.paths&&typeof v.paths=="object"&&(f.paths=Object.fromEntries(Object.entries(v.paths).map(([I,A])=>[I,Array.isArray(A)?A.map(w):A])),f.pathsBasePath=h),f}function Zr(s){let r=gs(s,fe.dirname(fe.resolve(s)));return r.paths?{base:r.baseUrl||r.pathsBasePath||fe.dirname(s),paths:r.paths}:null}vs.exports={parseJsonc:fs,readJsonc:ds,resolveExtends:ms,readConfigPaths:Zr}});var Ot={};Yt(Ot,{materializeInstallationPath:()=>li,readProjectPaths:()=>ys,resolveCanonicalUiDirectory:()=>bs,resolveConfiguredAlias:()=>Lt});function xs(s){try{return JSON.parse(tt.default.readFileSync(s,"utf8"))}catch{return null}}function ys(s){for(let r of["tsconfig.json","tsconfig.app.json","jsconfig.json"]){let o=me.default.join(s,r);if(!tt.default.existsSync(o))continue;let c=en(o);if(c)return c}return{base:s,paths:{"@/*":[tt.default.existsSync(me.default.join(s,"src"))?"src/*":"*"]}}}function Lt(s,r,o=ys(s)){for(let[c,l]of Object.entries(o.paths)){if(!Array.isArray(l)||typeof l[0]!="string")continue;let[p,h=""]=c.split("*");if(!r.startsWith(p)||!r.endsWith(h)||!c.includes("*")&&r!==c)continue;let f=r.slice(p.length,h?-h.length:void 0);return me.default.resolve(o.base,l[0].replace("*",f))}return r.startsWith("@/")?me.default.resolve(s,tt.default.existsSync(me.default.join(s,"src"))?"src":".",r.slice(2)):me.default.resolve(s,r)}function ui(s,r){let o=me.default.relative(s,r).replace(/\\/g,"/");if(!o||o===".."||o.startsWith("../")||me.default.posix.isAbsolute(o))throw new Error("The canonical ui alias must stay inside the Application root.");return o}function bs(s,r){if(r)return ui(s,Lt(s,r));let c=xs(me.default.join(s,"components.json"))?.aliases?.ui;return typeof c=="string"&&c?ui(s,Lt(s,c)):tt.default.existsSync(me.default.join(s,"src"))?"src/components/ui":"components/ui"}function li(s){if(s.installationLayout==="shadcn"&&/^(?:lib|hooks|components)\//.test(s.path)){let c=xs(me.default.join(s.root,"components.json"))?.aliases||{},l=/^lib\/utils\.[^.]+$/.test(s.path),p=s.path.split("/")[0],h=l&&c.utils?c.utils:c[p]||`@/${p}`,f=Lt(s.root,h);return ui(s.root,l&&c.utils?f+me.default.extname(s.path):me.default.join(f,s.path.slice(p.length+1)))}if(s.source!=="canonical"&&s.installationLayout!=="shadcn"||!s.path.startsWith("ui/"))return s.path;let r=s.path.slice(3);return me.default.posix.join(bs(s.root,s.configuredUiPath),r)}var tt,me,en,mt=Zi(()=>{tt=Ze(require("node:fs")),me=Ze(require("node:path")),{readConfigPaths:en}=ci()});var Ss=Ee((xa,rn)=>{rn.exports={name:"@frontfriend/sdk",version:"1.3.1"}});var Cs=Ee((ya,ks)=>{var{name:nn}=Ss();ks.exports={PACKAGE_NAME:nn}});var pi=Ee((ba,As)=>{var{PACKAGE_NAME:jt}=Cs(),$e=require("fs"),an=require("http"),on=require("https"),ye=require("path"),Vt=["contracts","tokens","components"],cn=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],un={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},ln=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],hn=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function Is(s){try{return JSON.parse($e.readFileSync(s,"utf8"))}catch{return{}}}function hi(s){if(s===void 0)return null;if(!Array.isArray(s)){let c=new Error("`adopt` in frontfriend.config.js must be an array.");throw c.code="FRONTFRIEND_CONFIG_VALIDATION",c}let r=s.filter(c=>!Vt.includes(c));if(r.length>0){let c=new Error(`Unknown Frontfriend adoption level: ${r.join(", ")}.`);throw c.code="FRONTFRIEND_CONFIG_VALIDATION",c}let o=s.includes("components")?2:s.includes("tokens")?1:0;return Vt.slice(0,o+1)}function pn(s){for(let[r,o]of Object.entries(un)){let c=o.find(p=>$e.existsSync(ye.join(s,p)));if(!c)continue;let l=$e.readFileSync(ye.join(s,c),"utf8");return{buildTool:r,present:l.includes(`${jt}/${r}`)}}return{buildTool:null,present:!1}}function fn(s){let r=[ye.join(s,"components","ui"),ye.join(s,"src","components","ui"),ye.join(s,"app","components","ui")].filter(l=>$e.existsSync(l)),o=new Set;function c(l){for(let p of $e.readdirSync(l,{withFileTypes:!0})){let h=ye.join(l,p.name);if(p.isDirectory())c(h);else if(/\.(js|jsx|ts|tsx|vue)$/.test(p.name)){if(!$e.readFileSync(h,"utf8").includes(jt))continue;let d=ye.basename(p.name,ye.extname(p.name));o.add(d.toLowerCase()==="index"?ye.basename(l):d.toLowerCase())}}}return r.forEach(c),[...o].sort()}function dn(s){let r=Is(ye.join(s,"package.json")),o={...r.dependencies||{},...r.devDependencies||{}},c=o.tailwindcss||null,p=[Is(ye.join(s,"components.json"))?.tailwind?.css,...cn].filter(Boolean).find(d=>$e.existsSync(ye.join(s,d))),h=p?$e.readFileSync(ye.join(s,p),"utf8"):"",f=hn.filter(d=>o[d]);return!f.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(h)&&!h.includes(`${jt}/theme.css`)&&f.push("css-custom-properties"),{nativeTokens:{present:h.includes("/* Frontfriend managed native tokens: start */"),file:p||null},tailwind:{present:!!c,version:c,major:c&&Number((String(c).match(/\d+/)||[])[0])||null},componentsJson:$e.existsSync(ye.join(s,"components.json")),themeImport:{present:h.includes(`${jt}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(h),file:p||null},plugin:pn(s),frontfriendComponents:fn(s),foreignComponentLibraries:ln.filter(d=>o[d]),foreignTokenSystems:f}}function mn(s,r,{baseLibrary:o}={}){let c=hi(s)||Vt,l=c.includes("tokens"),p=c.includes("components"),h=[];return l&&!r.themeImport.present&&!r.nativeTokens?.present&&h.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!l&&r.themeImport.present&&h.push("Frontfriend tokens are present in CSS but are not adopted in config."),p&&o==="shadcn"&&!r.componentsJson&&h.push("Config adopts components, but components.json was not observed."),!p&&r.frontfriendComponents.length>0&&h.push("Frontfriend components are installed but are not adopted in config."),h}function gn({apiUrl:s,token:r,ffId:o,name:c,adopt:l,observed:p,framework:h,primitive:f}){if(!s||!r||!o||!c||!h||f===void 0)return Promise.resolve({reported:!1,unavailable:!0});let d=new URL("/api/apps/sync",s),v=JSON.stringify({ffId:o,name:c,adopt:hi(l),observed:p,runtime:"sdk",framework:h,primitive:f}),w=d.protocol==="https:"?on:an;return new Promise(I=>{let A=w.request(d,{method:"POST",headers:{authorization:`Bearer ${r}`,"content-type":"application/json","content-length":Buffer.byteLength(v)}},B=>{B.resume(),B.on("end",()=>{B.statusCode>=200&&B.statusCode<300?I({reported:!0,unavailable:!1}):I({reported:!1,unavailable:!0})})});A.on("error",()=>I({reported:!1,unavailable:!0})),A.setTimeout(1500,()=>{A.destroy(),I({reported:!1,unavailable:!0})}),A.end(v)})}As.exports={ADOPTION_LEVELS:Vt,normalizeAdopt:hi,probeAdoption:dn,adoptionWarnings:mn,reportAdoption:gn}});var Es=Ee((Ft,_s)=>{(function(s,r){typeof Ft=="object"&&typeof _s<"u"?r(Ft):typeof define=="function"&&define.amd?define(["exports"],r):(s=typeof globalThis<"u"?globalThis:s||self,r(s.acorn={}))})(Ft,function(s){"use strict";var r=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],o=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],c="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",l="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",p={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"},h="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",f={5:h,"5module":h+" export import",6:h+" const class extends export import super"},d=/^in(stanceof)?$/,v=new RegExp("["+l+"]"),w=new RegExp("["+l+c+"]");function I(e,t){for(var i=65536,n=0;n<t.length;n+=2){if(i+=t[n],i>e)return!1;if(i+=t[n+1],i>=e)return!0}return!1}function A(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&v.test(String.fromCharCode(e)):t===!1?!1:I(e,o)}function B(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&&w.test(String.fromCharCode(e)):t===!1?!1:I(e,o)||I(e,r)}var _=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function T(e,t){return new _(e,{beforeExpr:!0,binop:t})}var R={beforeExpr:!0},E={startsExpr:!0},oe={};function O(e,t){return t===void 0&&(t={}),t.keyword=e,oe[e]=new _(e,t)}var a={num:new _("num",E),regexp:new _("regexp",E),string:new _("string",E),name:new _("name",E),privateId:new _("privateId",E),eof:new _("eof"),bracketL:new _("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new _("]"),braceL:new _("{",{beforeExpr:!0,startsExpr:!0}),braceR:new _("}"),parenL:new _("(",{beforeExpr:!0,startsExpr:!0}),parenR:new _(")"),comma:new _(",",R),semi:new _(";",R),colon:new _(":",R),dot:new _("."),question:new _("?",R),questionDot:new _("?."),arrow:new _("=>",R),template:new _("template"),invalidTemplate:new _("invalidTemplate"),ellipsis:new _("...",R),backQuote:new _("`",E),dollarBraceL:new _("${",{beforeExpr:!0,startsExpr:!0}),eq:new _("=",{beforeExpr:!0,isAssign:!0}),assign:new _("_=",{beforeExpr:!0,isAssign:!0}),incDec:new _("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new _("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new _("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new _("**",{beforeExpr:!0}),coalesce:T("??",1),_break:O("break"),_case:O("case",R),_catch:O("catch"),_continue:O("continue"),_debugger:O("debugger"),_default:O("default",R),_do:O("do",{isLoop:!0,beforeExpr:!0}),_else:O("else",R),_finally:O("finally"),_for:O("for",{isLoop:!0}),_function:O("function",E),_if:O("if"),_return:O("return",R),_switch:O("switch"),_throw:O("throw",R),_try:O("try"),_var:O("var"),_const:O("const"),_while:O("while",{isLoop:!0}),_with:O("with"),_new:O("new",{beforeExpr:!0,startsExpr:!0}),_this:O("this",E),_super:O("super",E),_class:O("class",E),_extends:O("extends",R),_export:O("export"),_import:O("import",E),_null:O("null",E),_true:O("true",E),_false:O("false",E),_in:O("in",{beforeExpr:!0,binop:7}),_instanceof:O("instanceof",{beforeExpr:!0,binop:7}),_typeof:O("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:O("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:O("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,j=new RegExp(b.source,"g");function V(e){return e===10||e===13||e===8232||e===8233}function W(e,t,i){i===void 0&&(i=e.length);for(var n=t;n<i;n++){var u=e.charCodeAt(n);if(V(u))return n<i-1&&u===13&&e.charCodeAt(n+1)===10?n+2:n+1}return-1}var Y=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,q=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ee=Object.prototype,xe=ee.hasOwnProperty,nt=ee.toString,re=Object.hasOwn||function(e,t){return xe.call(e,t)},bt=Array.isArray||function(e){return nt.call(e)==="[object Array]"},zt=Object.create(null);function Re(e){return zt[e]||(zt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ue(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var wt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,S=function(t,i){this.line=t,this.column=i};S.prototype.offset=function(t){return new S(this.line,this.column+t)};var $=function(t,i,n){this.start=i,this.end=n,t.sourceFile!==null&&(this.source=t.sourceFile)};function te(e,t){for(var i=1,n=0;;){var u=W(e,n,t);if(u<0)return new S(i,t-n);++i,n=u}}var Se={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Oe=!1;function ne(e){var t={};for(var i in Se)t[i]=e&&re(e,i)?e[i]:Se[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Oe&&typeof console=="object"&&console.warn&&(Oe=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
7
7
|
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),bt(t.onToken)){var n=t.onToken;t.onToken=function(u){return n.push(u)}}if(bt(t.onComment)&&(t.onComment=Ue(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function Ue(e,t){return function(i,n,u,m,g,x){var y={type:i?"Block":"Line",value:n,start:u,end:m};e.locations&&(y.loc=new $(this,g,x)),e.ranges&&(y.range=[u,m]),t.push(y)}}var de=1,Q=2,G=4,H=8,be=16,Pe=32,qe=64,Je=128,ae=256,je=512,le=1024,ie=de|Q|ae;function ce(e,t){return Q|(e?G:0)|(t?H:0)}var ke=0,at=1,Ve=2,Ci=3,Ii=4,Ai=5,X=function(t,i,n){this.options=t=ne(t),this.sourceFile=t.sourceFile,this.keywords=Re(f[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var u="";t.allowReserved!==!0&&(u=p[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(u+=" await")),this.reservedWords=Re(u);var m=(u?u+" ":"")+p.strict;this.reservedWordsStrict=Re(m),this.reservedWordsStrictBind=Re(m+" "+p.strictBind),this.input=String(i),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
|
|
8
8
|
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(b).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=a.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=t.sourceType==="module",this.strict=this.inModule||t.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Q:de),this.regexpState=null,this.privateNameStack=[]},Ce={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};X.prototype.parse=function(){var t=this,i=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return t.parseTopLevel(i)})},Ce.inFunction.get=function(){return(this.currentVarScope().flags&Q)>0},Ce.inGenerator.get=function(){return(this.currentVarScope().flags&H)>0},Ce.inAsync.get=function(){return(this.currentVarScope().flags&G)>0},Ce.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ae|je))return!1;if(i&Q)return(i&G)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ce.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&de)},Ce.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&qe)>0||this.options.allowSuperOutsideMethod},Ce.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Je)>0},Ce.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ce.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ae|je)||i&Q&&!(i&be))return!0}return!1},Ce.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return!(t&le||!this.inModule&&t&de)},Ce.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ae)>0},X.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var n=this,u=0;u<t.length;u++)n=t[u](n);return n},X.parse=function(t,i){return new this(i,t).parse()},X.parseExpressionAt=function(t,i,n){var u=new this(n,t,i);return u.nextToken(),u.parseExpression()},X.tokenizer=function(t,i){return new this(i,t)},Object.defineProperties(X.prototype,Ce);var he=X.prototype,tr=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;he.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){q.lastIndex=e,e+=q.exec(this.input)[0].length;var t=tr.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){q.lastIndex=e+t[0].length;var i=q.exec(this.input),n=i.index+i[0].length,u=this.input.charAt(n);return u===";"||u==="}"||b.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(u)||u==="!"&&this.input.charAt(n+1)==="=")}e+=t[0].length,q.lastIndex=e,e+=q.exec(this.input)[0].length,this.input[e]===";"&&e++}},he.eat=function(e){return this.type===e?(this.next(),!0):!1},he.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc},he.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},he.catchStackOverflow=function(e){try{return e()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}},he.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},he.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||b.test(this.input.slice(this.lastTokEnd,this.start))},he.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},he.semicolon=function(){!this.eat(a.semi)&&!this.insertSemicolon()&&this.unexpected()},he.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},he.expect=function(e){this.eat(e)||this.unexpected()},he.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var St=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};he.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},he.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},he.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")},he.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var C=X.prototype;C.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==a.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var n=0,u=Object.keys(this.undefinedExports);n<u.length;n+=1){var m=u[n];this.raiseRecoverable(this.undefinedExports[m].start,"Export '"+m+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var Gt={kind:"loop"},ir={kind:"switch"};C.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;q.lastIndex=this.pos;var t=q.exec(this.input),i=this.pos+t[0].length,n=this.fullCharCodeAt(i);if(n===91||n===92)return!0;if(e)return!1;if(n===123)return!0;if(A(n)){var u=i;do i+=n<=65535?1:2;while(B(n=this.fullCharCodeAt(i)));if(n===92)return!0;var m=this.input.slice(u,i);if(!d.test(m))return!0}return!1},C.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;q.lastIndex=this.pos;var e=q.exec(this.input),t=this.pos+e[0].length,i;return!b.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(B(i=this.fullCharCodeAt(t+8))||i===92))},C.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;q.lastIndex=this.pos;var i=q.exec(this.input),n=this.pos+i[0].length;if(b.test(this.input.slice(this.pos,n)))return!1;if(e){var u=n+5,m;if(this.input.slice(n,u)!=="using"||u===this.input.length||B(m=this.fullCharCodeAt(u))||m===92)return!1;q.lastIndex=u;var g=q.exec(this.input);if(n=u+g[0].length,g&&b.test(this.input.slice(u,n)))return!1}var x=this.fullCharCodeAt(n);if(!A(x)&&x!==92)return!1;var y=n;do n+=x<=65535?1:2;while(B(x=this.fullCharCodeAt(n)));if(x===92)return!0;var N=this.input.slice(y,n);if(d.test(N))return!1;if(t&&!e&&N==="of"){q.lastIndex=n;var M=q.exec(this.input);if(n=n+M[0].length,this.input.charCodeAt(n)!==61||(x=this.input.charCodeAt(n+1))===61||x===62)return!1}return!0},C.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},C.isUsing=function(e){return this.isUsingKeyword(!1,e)},C.parseStatement=function(e,t,i){var n=this.type,u=this.startNode(),m;switch(this.isLet(e)&&(n=a._var,m="let"),n){case a._break:case a._continue:return this.parseBreakContinueStatement(u,n.keyword);case a._debugger:return this.parseDebuggerStatement(u);case a._do:return this.parseDoStatement(u);case a._for:return this.parseForStatement(u);case a._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(u,!1,!e);case a._class:return e&&this.unexpected(),this.parseClass(u,!0);case a._if:return this.parseIfStatement(u);case a._return:return this.parseReturnStatement(u);case a._switch:return this.parseSwitchStatement(u);case a._throw:return this.parseThrowStatement(u);case a._try:return this.parseTryStatement(u);case a._const:case a._var:return m=m||this.value,e&&m!=="var"&&this.unexpected(),this.parseVarStatement(u,m);case a._while:return this.parseWhileStatement(u);case a._with:return this.parseWithStatement(u);case a.braceL:return this.parseBlock(!0,u);case a.semi:return this.parseEmptyStatement(u);case a._export:case a._import:if(this.options.ecmaVersion>10&&n===a._import){q.lastIndex=this.pos;var g=q.exec(this.input),x=this.pos+g[0].length,y=this.input.charCodeAt(x);if(y===40||y===46)return this.parseExpressionStatement(u,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'")),n===a._import?this.parseImport(u):this.parseExport(u,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(u,!0,!e);var N=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(N)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),N==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(u,!1,N),this.semicolon(),this.finishNode(u,"VariableDeclaration");var M=this.value,K=this.parseExpression();return n===a.name&&K.type==="Identifier"&&this.eat(a.colon)?this.parseLabeledStatement(u,M,K,e):this.parseExpressionStatement(u,K)}},C.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(a.semi)||this.insertSemicolon()?e.label=null:this.type!==a.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var u=this.labels[n];if((e.label==null||u.name===e.label.name)&&(u.kind!=null&&(i||u.kind==="loop")||e.label&&i))break}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},C.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},C.parseDoStatement=function(e){return this.next(),this.labels.push(Gt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(a._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(a.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},C.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Gt),this.enterScope(0),this.expect(a.parenL),this.type===a.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===a._var||this.type===a._const||i){var n=this.startNode(),u=i?"let":this.value;return this.next(),this.parseVar(n,!0,u),this.finishNode(n,"VariableDeclaration"),this.parseForAfterInit(e,n,t)}var m=this.isContextual("let"),g=!1,x=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(x){var y=this.startNode();return this.next(),x==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(y,!0,x),this.finishNode(y,"VariableDeclaration"),this.parseForAfterInit(e,y,t)}var N=this.containsEsc,M=new St,K=this.start,pe=t>-1?this.parseExprSubscripts(M,"await"):this.parseExpression(!0,M);return this.type===a._in||(g=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===a._in&&this.unexpected(t),e.await=!0):g&&this.options.ecmaVersion>=8&&(pe.start===K&&!N&&pe.type==="Identifier"&&pe.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),m&&g&&this.raise(pe.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(pe,!1,M),this.checkLValPattern(pe),this.parseForIn(e,pe)):(this.checkExpressionErrors(M,!0),t>-1&&this.unexpected(t),this.parseFor(e,pe))},C.parseForAfterInit=function(e,t,i){return(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.type===a._in?((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))},C.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ot|(i?0:Jt),!1,t)},C.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},C.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(a.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},C.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(ir),this.enterScope(le);for(var t,i=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var n=this.type===a._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(a.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")},C.parseThrowStatement=function(e){return this.next(),b.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 sr=[];C.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Pe:0),this.checkLValPattern(e,t?Ii:Ve),this.expect(a.parenR),e},C.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===a._catch){var t=this.startNode();this.next(),this.eat(a.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(a._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},C.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},C.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Gt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},C.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")},C.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},C.parseLabeledStatement=function(e,t,i,n){for(var u=0,m=this.labels;u<m.length;u+=1){var g=m[u];g.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var x=this.type.isLoop?"loop":this.type===a._switch?"switch":null,y=this.labels.length-1;y>=0;y--){var N=this.labels[y];if(N.statementStart===e.start)N.statementStart=this.start,N.kind=x;else break}return this.labels.push({name:t,kind:x,statementStart:this.start}),e.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},C.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},C.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(a.braceL),e&&this.enterScope(0);this.type!==a.braceR;){var n=this.parseStatement(null);t.body.push(n)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},C.parseFor=function(e,t){return e.init=t,this.expect(a.semi),e.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),e.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},C.parseForIn=function(e,t){var i=this.type===a._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},C.parseVar=function(e,t,i,n){for(e.declarations=[],e.kind=i;;){var u=this.startNode();if(this.parseVarId(u,i),this.eat(a.eq)?u.init=this.parseMaybeAssign(t):!n&&i==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==a._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!n&&u.id.type!=="Identifier"&&!(t&&(this.type===a._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):u.init=null,e.declarations.push(this.finishNode(u,"VariableDeclarator")),!this.eat(a.comma))break}return e},C.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?at:Ve,!1)};var ot=1,Jt=2,_i=4;C.parseFunction=function(e,t,i,n,u){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===a.star&&t&Jt&&this.unexpected(),e.generator=this.eat(a.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&ot&&(e.id=t&_i&&this.type!==a.name?null:this.parseIdent(),e.id&&!(t&Jt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?at:Ve:Ci));var m=this.yieldPos,g=this.awaitPos,x=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ce(e.async,e.generator)),t&ot||(e.id=this.type===a.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,u),this.yieldPos=m,this.awaitPos=g,this.awaitIdentPos=x,this.finishNode(e,t&ot?"FunctionDeclaration":"FunctionExpression")},C.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},C.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),u=this.startNode(),m=!1;for(u.body=[],this.expect(a.braceL);this.type!==a.braceR;){var g=this.parseClassElement(e.superClass!==null);g&&(u.body.push(g),g.type==="MethodDefinition"&&g.kind==="constructor"?(m&&this.raiseRecoverable(g.start,"Duplicate constructor in the same class"),m=!0):g.key&&g.key.type==="PrivateIdentifier"&&rr(n,g)&&this.raiseRecoverable(g.key.start,"Identifier '#"+g.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(u,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},C.parseClassElement=function(e){if(this.eat(a.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),n="",u=!1,m=!1,g="method",x=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===a.star?x=!0:n="static"}if(i.static=x,!n&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon()?m=!0:n="async"),!n&&(t>=9||!m)&&this.eat(a.star)&&(u=!0),!n&&!m&&!u){var y=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?g=y:n=y)}if(n?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=n,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===a.parenL||g!=="method"||u||m){var N=!i.static&&kt(i,"constructor"),M=N&&e;N&&g!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=N?"constructor":g,this.parseClassMethod(i,u,m,M)}else this.parseClassField(i);return i},C.isClassElementNameStart=function(){return this.type===a.name||this.type===a.privateId||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword},C.parseClassElementName=function(e){this.type===a.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)},C.parseClassMethod=function(e,t,i,n){var u=e.key;e.kind==="constructor"?(t&&this.raise(u.start,"Constructor can't be a generator"),i&&this.raise(u.start,"Constructor can't be an async method")):e.static&&kt(e,"prototype")&&this.raise(u.start,"Classes may not have a static property named prototype");var m=e.value=this.parseMethod(t,i,n);return e.kind==="get"&&m.params.length!==0&&this.raiseRecoverable(m.start,"getter should have no params"),e.kind==="set"&&m.params.length!==1&&this.raiseRecoverable(m.start,"setter should have exactly one param"),e.kind==="set"&&m.params[0].type==="RestElement"&&this.raiseRecoverable(m.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},C.parseClassField=function(e){return kt(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&kt(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(a.eq)?(this.enterScope(je|qe),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},C.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ae|qe);this.type!==a.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},C.parseClassId=function(e,t){this.type===a.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Ve,!1)):(t===!0&&this.unexpected(),e.id=null)},C.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null},C.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},C.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,u=n===0?null:this.privateNameStack[n-1],m=0;m<i.length;++m){var g=i[m];re(t,g.name)||(u?u.used.push(g):this.raiseRecoverable(g.start,"Private field '#"+g.name+"' must be declared in an enclosing class"))}};function rr(e,t){var i=t.key.name,n=e[i],u="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(u=(t.static?"s":"i")+t.kind),n==="iget"&&u==="iset"||n==="iset"&&u==="iget"||n==="sget"&&u==="sset"||n==="sset"&&u==="sget"?(e[i]="true",!1):n?!0:(e[i]=u,!1)}function kt(e,t){var i=e.computed,n=e.key;return!i&&(n.type==="Identifier"&&n.name===t||n.type==="Literal"&&n.value===t)}C.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!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},C.parseExport=function(e,t){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,t);if(this.eat(a._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!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,n=e.specifiers;i<n.length;i+=1){var u=n[i];this.checkUnreserved(u.local),this.checkLocalExport(u.local),u.local.type==="Literal"&&this.raise(u.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")},C.parseExportDeclaration=function(e){return this.parseStatement(null)},C.parseExportDefaultDeclaration=function(){var e;if(this.type===a._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ot|_i,!1,e)}else if(this.type===a._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var n=this.parseMaybeAssign();return this.semicolon(),n}},C.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),re(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},C.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var n=0,u=t.properties;n<u.length;n+=1){var m=u[n];this.checkPatternExport(e,m)}else if(i==="ArrayPattern")for(var g=0,x=t.elements;g<x.length;g+=1){var y=x[g];y&&this.checkPatternExport(e,y)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)},C.checkVariableExport=function(e,t){if(e)for(var i=0,n=t;i<n.length;i+=1){var u=n[i];this.checkPatternExport(e,u.id)}},C.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},C.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")},C.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(a.braceL);!this.eat(a.braceR);){if(i)i=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;t.push(this.parseExportSpecifier(e))}return t},C.parseImport=function(e){return this.next(),this.type===a.string?(e.specifiers=sr,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===a.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},C.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,Ve),this.finishNode(e,"ImportSpecifier")},C.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Ve),this.finishNode(e,"ImportDefaultSpecifier")},C.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Ve),this.finishNode(e,"ImportNamespaceSpecifier")},C.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===a.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma)))return e;if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(a.braceL);!this.eat(a.braceR);){if(t)t=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;e.push(this.parseImportSpecifier())}return e},C.parseWithClause=function(){var e=[];if(!this.eat(a._with))return e;this.expect(a.braceL);for(var t={},i=!0;!this.eat(a.braceR);){if(i)i=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;var n=this.parseImportAttribute(),u=n.key.type==="Identifier"?n.key.name:n.key.value;re(t,u)&&this.raiseRecoverable(n.key.start,"Duplicate attribute key '"+u+"'"),t[u]=!0,e.push(n)}return e},C.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},C.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);return wt.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},C.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)},C.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 Ie=X.prototype;Ie.toAssignable=function(e,t,i){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",i&&this.checkPatternErrors(i,!0);for(var n=0,u=e.properties;n<u.length;n+=1){var m=u[n];this.toAssignable(m,t),m.type==="RestElement"&&(m.argument.type==="ArrayPattern"||m.argument.type==="ObjectPattern")&&this.raise(m.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",i&&this.checkPatternErrors(i,!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,i);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 i&&this.checkPatternErrors(i,!0);return e},Ie.toAssignableList=function(e,t){for(var i=e.length,n=0;n<i;n++){var u=e[n];u&&this.toAssignable(u,t)}if(i){var m=e[i-1];this.options.ecmaVersion===6&&t&&m&&m.type==="RestElement"&&m.argument.type!=="Identifier"&&this.unexpected(m.argument.start)}return e},Ie.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},Ie.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==a.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},Ie.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case a.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(a.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case a.braceL:return this.parseObj(!0)}return this.parseIdent()},Ie.parseBindingList=function(e,t,i,n){for(var u=[],m=!0;!this.eat(e);)if(m?m=!1:this.expect(a.comma),t&&this.type===a.comma)u.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===a.ellipsis){var g=this.parseRestBinding();this.parseBindingListItem(g),u.push(g),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else u.push(this.parseAssignableListItem(n))}return u},Ie.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Ie.parseBindingListItem=function(e){return e},Ie.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(a.eq))return i;var n=this.startNodeAt(e,t);return n.left=i,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},Ie.checkLValSimple=function(e,t,i){t===void 0&&(t=ke);var n=t!==ke;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(n?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(t===Ve&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(re(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Ai&&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":n&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return n&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(n?"Binding":"Assigning to")+" rvalue")}},Ie.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=ke),e.type){case"ObjectPattern":for(var n=0,u=e.properties;n<u.length;n+=1){var m=u[n];this.checkLValInnerPattern(m,t,i)}break;case"ArrayPattern":for(var g=0,x=e.elements;g<x.length;g+=1){var y=x[g];y&&this.checkLValInnerPattern(y,t,i)}break;default:this.checkLValSimple(e,t,i)}},Ie.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=ke),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var Ae=function(t,i,n,u,m){this.token=t,this.isExpr=!!i,this.preserveSpace=!!n,this.override=u,this.generator=!!m},J={b_stat:new Ae("{",!1),b_expr:new Ae("{",!0),b_tmpl:new Ae("${",!1),p_stat:new Ae("(",!1),p_expr:new Ae("(",!0),q_tmpl:new Ae("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Ae("function",!1),f_expr:new Ae("function",!0),f_expr_gen:new Ae("function",!0,!1,null,!0),f_gen:new Ae("function",!1,!1,null,!0)},Ke=X.prototype;Ke.initialContext=function(){return[J.b_stat]},Ke.curContext=function(){return this.context[this.context.length-1]},Ke.braceIsBlock=function(e){var t=this.curContext();return t===J.f_expr||t===J.f_stat?!0:e===a.colon&&(t===J.b_stat||t===J.b_expr)?!t.isExpr:e===a._return||e===a.name&&this.exprAllowed?b.test(this.input.slice(this.lastTokEnd,this.start)):e===a._else||e===a.semi||e===a.eof||e===a.parenR||e===a.arrow?!0:e===a.braceL?t===J.b_stat:e===a._var||e===a._const||e===a.name?!1:!this.exprAllowed},Ke.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},Ke.updateContext=function(e){var t,i=this.type;i.keyword&&e===a.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},Ke.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},a.parenR.updateContext=a.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},a.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?J.b_stat:J.b_expr),this.exprAllowed=!0},a.dollarBraceL.updateContext=function(){this.context.push(J.b_tmpl),this.exprAllowed=!0},a.parenL.updateContext=function(e){var t=e===a._if||e===a._for||e===a._with||e===a._while;this.context.push(t?J.p_stat:J.p_expr),this.exprAllowed=!0},a.incDec.updateContext=function(){},a._function.updateContext=a._class.updateContext=function(e){e.beforeExpr&&e!==a._else&&!(e===a.semi&&this.curContext()!==J.p_stat)&&!(e===a._return&&b.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===a.colon||e===a.braceL)&&this.curContext()===J.b_stat)?this.context.push(J.f_expr):this.context.push(J.f_stat),this.exprAllowed=!1},a.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},a.backQuote.updateContext=function(){this.curContext()===J.q_tmpl?this.context.pop():this.context.push(J.q_tmpl),this.exprAllowed=!1},a.star.updateContext=function(e){if(e===a._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},a.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==a.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var L=X.prototype;L.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n=e.key,u;switch(n.type){case"Identifier":u=n.name;break;case"Literal":u=String(n.value);break;default:return}var m=e.kind;if(this.options.ecmaVersion>=6){u==="__proto__"&&m==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),t.proto=!0);return}u="$"+u;var g=t[u];if(g){var x;m==="init"?x=this.strict&&g.init||g.get||g.set:x=g.init||g[m],x&&this.raiseRecoverable(n.start,"Redefinition of property")}else g=t[u]={init:!1,get:!1,set:!1};g[m]=!0}},L.parseExpression=function(e,t){var i=this;return this.catchStackOverflow(function(){var n=i.start,u=i.startLoc,m=i.parseMaybeAssign(e,t);if(i.type===a.comma){var g=i.startNodeAt(n,u);for(g.expressions=[m];i.eat(a.comma);)g.expressions.push(i.parseMaybeAssign(e,t));return i.finishNode(g,"SequenceExpression")}return m})},L.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,u=-1,m=-1,g=-1;t?(u=t.parenthesizedAssign,m=t.trailingComma,g=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new St,n=!0);var x=this.start,y=this.startLoc;(this.type===a.parenL||this.type===a.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var N=this.parseMaybeConditional(e,t);if(i&&(N=i.call(this,N,x,y)),this.type.isAssign){var M=this.startNodeAt(x,y);return M.operator=this.value,this.type===a.eq&&(N=this.toAssignable(N,!1,t)),n||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=N.start&&(t.shorthandAssign=-1),this.type===a.eq?this.checkLValPattern(N):this.checkLValSimple(N),M.left=N,this.next(),M.right=this.parseMaybeAssign(e),g>-1&&(t.doubleProto=g),this.finishNode(M,"AssignmentExpression")}else n&&this.checkExpressionErrors(t,!0);return u>-1&&(t.parenthesizedAssign=u),m>-1&&(t.trailingComma=m),N},L.parseMaybeConditional=function(e,t){var i=this.start,n=this.startLoc,u=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return u;if(!(u.type==="ArrowFunctionExpression"&&u.start===i)&&this.eat(a.question)){var m=this.startNodeAt(i,n);return m.test=u,m.consequent=this.parseMaybeAssign(),this.expect(a.colon),m.alternate=this.parseMaybeAssign(e),this.finishNode(m,"ConditionalExpression")}return u},L.parseExprOps=function(e,t){var i=this.start,n=this.startLoc,u=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||u.start===i&&u.type==="ArrowFunctionExpression"?u:this.parseExprOp(u,i,n,-1,e)},L.parseExprOp=function(e,t,i,n,u){var m=this.type.binop;if(m!=null&&(!u||this.type!==a._in)&&m>n){var g=this.type===a.logicalOR||this.type===a.logicalAND,x=this.type===a.coalesce;x&&(m=a.logicalAND.binop);var y=this.value;this.next();var N=this.start,M=this.startLoc,K=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,u),N,M,m,u),pe=this.buildBinary(t,i,e,K,y,g||x);return(g&&this.type===a.coalesce||x&&(this.type===a.logicalOR||this.type===a.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(pe,t,i,n,u)}return e},L.buildBinary=function(e,t,i,n,u,m){n.type==="PrivateIdentifier"&&this.raise(n.start,"Private identifier can only be left side of binary expression");var g=this.startNodeAt(e,t);return g.left=i,g.operator=u,g.right=n,this.finishNode(g,m?"LogicalExpression":"BinaryExpression")},L.parseMaybeUnary=function(e,t,i,n){var u=this.start,m=this.startLoc,g;if(this.isContextual("await")&&this.canAwait)g=this.parseAwait(n),t=!0;else if(this.type.prefix){var x=this.startNode(),y=this.type===a.incDec;x.operator=this.value,x.prefix=!0,this.next(),x.argument=this.parseMaybeUnary(null,!0,y,n),this.checkExpressionErrors(e,!0),y?this.checkLValSimple(x.argument):this.strict&&x.operator==="delete"&&Ei(x.argument)?this.raiseRecoverable(x.start,"Deleting local variable in strict mode"):x.operator==="delete"&&Kt(x.argument)?this.raiseRecoverable(x.start,"Private fields can not be deleted"):t=!0,g=this.finishNode(x,y?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===a.privateId)(n||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),g=this.parsePrivateIdent(),this.type!==a._in&&this.unexpected();else{if(g=this.parseExprSubscripts(e,n),this.checkExpressionErrors(e))return g;for(;this.type.postfix&&!this.canInsertSemicolon();){var N=this.startNodeAt(u,m);N.operator=this.value,N.prefix=!1,N.argument=g,this.checkLValSimple(g),this.next(),g=this.finishNode(N,"UpdateExpression")}}if(!i&&this.eat(a.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(u,m,g,this.parseMaybeUnary(null,!1,!1,n),"**",!1);else return g};function Ei(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Ei(e.expression)}function Kt(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Kt(e.expression)||e.type==="ParenthesizedExpression"&&Kt(e.expression)}L.parseExprSubscripts=function(e,t){var i=this.start,n=this.startLoc,u=this.parseExprAtom(e,t);if(u.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return u;var m=this.parseSubscripts(u,i,n,!1,t);return e&&m.type==="MemberExpression"&&(e.parenthesizedAssign>=m.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=m.start&&(e.parenthesizedBind=-1),e.trailingComma>=m.start&&(e.trailingComma=-1)),m},L.parseSubscripts=function(e,t,i,n,u){for(var m=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,g=!1;;){var x=this.parseSubscript(e,t,i,n,m,g,u);if(x.optional&&(g=!0),x===e||x.type==="ArrowFunctionExpression"){if(g){var y=this.startNodeAt(t,i);y.expression=x,x=this.finishNode(y,"ChainExpression")}return x}e=x}},L.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(a.arrow)},L.parseSubscriptAsyncArrow=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,n)},L.parseSubscript=function(e,t,i,n,u,m,g){var x=this.options.ecmaVersion>=11,y=x&&this.eat(a.questionDot);n&&y&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var N=this.eat(a.bracketL);if(N||y&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){var M=this.startNodeAt(t,i);M.object=e,N?(M.property=this.parseExpression(),this.expect(a.bracketR)):this.type===a.privateId&&e.type!=="Super"?M.property=this.parsePrivateIdent():M.property=this.parseIdent(this.options.allowReserved!=="never"),M.computed=!!N,x&&(M.optional=y),e=this.finishNode(M,"MemberExpression")}else if(!n&&this.eat(a.parenL)){var K=new St,pe=this.yieldPos,lt=this.awaitPos,Qe=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Et=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1,K);if(u&&!y&&this.shouldParseAsyncArrow())return this.checkPatternErrors(K,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=pe,this.awaitPos=lt,this.awaitIdentPos=Qe,this.parseSubscriptAsyncArrow(t,i,Et,g);this.checkExpressionErrors(K,!0),this.yieldPos=pe||this.yieldPos,this.awaitPos=lt||this.awaitPos,this.awaitIdentPos=Qe||this.awaitIdentPos;var Ye=this.startNodeAt(t,i);Ye.callee=e,Ye.arguments=Et,x&&(Ye.optional=y),e=this.finishNode(Ye,"CallExpression")}else if(this.type===a.backQuote){(y||m)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Xe=this.startNodeAt(t,i);Xe.tag=e,Xe.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(Xe,"TaggedTemplateExpression")}return e},L.parseExprAtom=function(e,t,i){this.type===a.slash&&this.readRegexp();var n,u=this.potentialArrowAt===this.start;switch(this.type){case a._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),n=this.startNode(),this.next(),this.type===a.parenL&&!this.allowDirectSuper&&this.raise(n.start,"super() call outside constructor of a subclass"),this.type!==a.dot&&this.type!==a.bracketL&&this.type!==a.parenL&&this.unexpected(),this.finishNode(n,"Super");case a._this:return n=this.startNode(),this.next(),this.finishNode(n,"ThisExpression");case a.name:var m=this.start,g=this.startLoc,x=this.containsEsc,y=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!x&&y.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(J.f_expr),this.parseFunction(this.startNodeAt(m,g),0,!1,!0,t);if(u&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(m,g),[y],!1,t);if(this.options.ecmaVersion>=8&&y.name==="async"&&this.type===a.name&&!x&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return y=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(a.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(m,g),[y],!0,t)}return y;case a.regexp:var N=this.value;return n=this.parseLiteral(N.value),n.regex={pattern:N.pattern,flags:N.flags},n;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return n=this.startNode(),n.value=this.type===a._null?null:this.type===a._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case a.parenL:var M=this.start,K=this.parseParenAndDistinguishExpression(u,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(K)&&(e.parenthesizedAssign=M),e.parenthesizedBind<0&&(e.parenthesizedBind=M)),K;case a.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(a.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case a.braceL:return this.overrideContext(J.b_expr),this.parseObj(!1,e);case a._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case a._class:return this.parseClass(this.startNode(),!1);case a._new:return this.parseNew();case a.backQuote:return this.parseTemplate();case a._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},L.parseExprAtomDefault=function(){this.unexpected()},L.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===a.parenL&&!e)return this.parseDynamicImport(t);if(this.type===a.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()},L.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(a.parenR)?e.options=null:(this.expect(a.comma),this.afterTrailingComma(a.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(a.parenR)||(this.expect(a.comma),this.afterTrailingComma(a.parenR)||this.unexpected())));else if(!this.eat(a.parenR)){var t=this.start;this.eat(a.comma)&&this.eat(a.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},L.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")},L.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.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},L.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e},L.shouldParseArrow=function(e){return!this.canInsertSemicolon()},L.parseParenAndDistinguishExpression=function(e,t){var i=this.start,n=this.startLoc,u,m=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var g=this.start,x=this.startLoc,y=[],N=!0,M=!1,K=new St,pe=this.yieldPos,lt=this.awaitPos,Qe;for(this.yieldPos=0,this.awaitPos=0;this.type!==a.parenR;)if(N?N=!1:this.expect(a.comma),m&&this.afterTrailingComma(a.parenR,!0)){M=!0;break}else if(this.type===a.ellipsis){Qe=this.start,y.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else y.push(this.parseMaybeAssign(!1,K,this.parseParenItem));var Et=this.lastTokEnd,Ye=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(y)&&this.eat(a.arrow))return this.checkPatternErrors(K,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=pe,this.awaitPos=lt,this.parseParenArrowList(i,n,y,t);(!y.length||M)&&this.unexpected(this.lastTokStart),Qe&&this.unexpected(Qe),this.checkExpressionErrors(K,!0),this.yieldPos=pe||this.yieldPos,this.awaitPos=lt||this.awaitPos,y.length>1?(u=this.startNodeAt(g,x),u.expressions=y,this.finishNodeAt(u,"SequenceExpression",Et,Ye)):u=y[0]}else u=this.parseParenExpression();if(this.options.preserveParens){var Xe=this.startNodeAt(i,n);return Xe.expression=u,this.finishNode(Xe,"ParenthesizedExpression")}else return u},L.parseParenItem=function(e){return e},L.parseParenArrowList=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,n)};var nr=[];L.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===a.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=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'"),i&&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 n=this.start,u=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,u,!0,!1),e.callee.type==="Super"&&this.raiseRecoverable(n,"Invalid use of 'super'"),this.eat(a.parenL)?e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1):e.arguments=nr,this.finishNode(e,"NewExpression")},L.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===a.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
|
|
9
9
|
`),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var $=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var
|
|
2
|
-
`,{mode:384}),h.renameSync(r,a);try{h.chmodSync(a,384)}catch{}}finally{h.rmSync(r,{force:!0})}}async function
|
|
3
|
-
`)}
|
|
1
|
+
var $=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var W=$((He,L)=>{var h=require("fs");function ce(a){try{let e=h.readFileSync(a,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}function fe(a){try{return h.readFileSync(a,"utf8").replace(/^\uFEFF/,"")}catch(e){if(e.code==="ENOENT")return null;throw e}}function me(a,e,r=2){let t=JSON.stringify(e,null,r);h.writeFileSync(a,t,"utf8")}function de(a,e){h.writeFileSync(a,e,"utf8")}function ue(a,e){if(e==null||typeof e=="object"&&Object.keys(e).length===0||Array.isArray(e)&&e.length===0){let t=`module.exports = ${Array.isArray(e)?"[]":"{}"};`;h.writeFileSync(a,t,"utf8")}else{let r=`module.exports = ${JSON.stringify(e,null,2)};`;h.writeFileSync(a,r,"utf8")}}function pe(a){return h.existsSync(a)}function he(a){h.mkdirSync(a,{recursive:!0})}function ve(a){h.rmSync(a,{recursive:!0,force:!0})}function ge(a){h.rmSync(a,{force:!0})}function be(a,e){h.mkdirSync(require("path").dirname(a),{recursive:!0,mode:448});let r=`${a}.${process.pid}.${Date.now()}.tmp`;try{h.writeFileSync(r,`${JSON.stringify(e,null,2)}
|
|
2
|
+
`,{mode:384}),h.renameSync(r,a);try{h.chmodSync(a,384)}catch{}}finally{h.rmSync(r,{force:!0})}}async function ye(a,e,r){h.mkdirSync(require("path").dirname(a),{recursive:!0,mode:448});let t=`${a}.lock`,o=Date.now()+2e4,n;for(;n===void 0;)try{n=h.openSync(t,"wx",384),h.writeFileSync(n,String(process.pid))}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(h.readFileSync(t,"utf8"));if(Number.isInteger(c)&&c>0)try{process.kill(c,0)}catch(l){if(l.code==="ESRCH"){h.unlinkSync(t);continue}}}catch(c){if(c.code==="ENOENT")continue}if(Date.now()>=o)throw r();await new Promise(c=>setTimeout(c,50))}try{return await e()}finally{h.closeSync(n),h.unlinkSync(t)}}L.exports={writePrivateJsonFileAtomic:be,withPrivateFileLock:ye,readJsonFileSafe:ce,readFileSafe:fe,writeJsonFile:me,writeTextFile:de,writeModuleExportsFile:ue,fileExists:pe,ensureDirectoryExists:he,removeDirectory:ve,removeFile:ge}});var P=$((Je,M)=>{var F=class extends Error{constructor(e,r,t){super(e),this.name="APIError",this.statusCode=r,this.url=t,this.code=`API_${r}`}},O=class extends Error{constructor(e,r){super(e),this.name="CacheError",this.operation=r,this.code=`CACHE_${r.toUpperCase()}`}},z=class extends Error{constructor(e,r){super(e),this.name="ConfigError",this.field=r,this.code=r?`CONFIG_${String(r).toUpperCase()}`:"CONFIG_ERROR"}},E=class extends Error{constructor(e,r){super(e),this.name="ProcessingError",this.token=r,this.code="PROCESSING_ERROR"}};M.exports={APIError:F,CacheError:O,ConfigError:z,ProcessingError:E}});var G=$((Ge,J)=>{var q=["open","closed","checked","unchecked","indeterminate","active"],U={open:['[data-expanded]:not([data-expanded="false"])','[data-popup-open]:not([data-popup-open="false"])','[data-panel-open]:not([data-panel-open="false"])']},K="on",H=["/* Dark mode follows the root class the theme picker toggles. */","@custom-variant dark {"," &:is(.dark, .dark *) {"," @slot;"," }","}",""],j=[...H,"/* Cross-primitive state variants (Radix `data-state=x`, Base UI `data-x`). */",...q.flatMap(a=>{let e=[`[data-state="${a}"]`,`[data-${a}]:not([data-${a}="false"])`,...U[a]||[]];return[`@custom-variant data-${a} {`,...e.map((r,t)=>` &:where(${r})${t===e.length-1?" {":","}`)," @slot;"," }","}",""]}),`@custom-variant data-${K} {`,' &:where([data-state="on"]),',' &:where([aria-pressed="true"]) {'," @slot;"," }","}","","@custom-variant data-selected {",' &:where([data-selected="true"]) {'," @slot;"," }","}","","@custom-variant data-disabled {",' &:where([data-disabled="true"]),',' &:where([data-disabled]:not([data-disabled="false"])) {'," @slot;"," }","}","",...["horizontal","vertical"].flatMap(a=>[`@custom-variant data-${a} {`,` &:where([data-orientation="${a}"]) {`," @slot;"," }","}",""])],ke=j.filter(a=>a.startsWith("@custom-variant ")).map(a=>a.slice(16).replace(" {",""));function $e(){return j.join(`
|
|
3
|
+
`)}J.exports={CROSS_PRIMITIVE_STATES:q,DARK_VARIANT_CSS:H,EXTRA_STATE_MATCHERS:U,PRESSED_STATE:K,STATE_VARIANT_CSS:j,STATE_VARIANT_NAMES:ke,stateVariantCss:$e}});var X=$((Be,B)=>{var we=`
|
|
4
4
|
@property --scroll-fade-t {
|
|
5
5
|
syntax: "<length-percentage>";
|
|
6
6
|
inherits: false;
|
|
@@ -549,6 +549,6 @@ var $=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var L=$((He,I)=>{v
|
|
|
549
549
|
-webkit-text-fill-color: currentColor;
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
`;function xe(){return $e}G.exports={motionUtilityCss:xe}});var Z=$((Xe,Y)=>{function X(a,e=[]){return!a||typeof a!="object"?[]:"$value"in a?[[e,a.$value]]:Object.entries(a).flatMap(([r,t])=>X(t,[...e,r]))}function we(a){return a.join("-").replace(/\./g,"_")}function b(a,e){return X(a).map(([r,t])=>[`${e}${we(r)}`,String(t)])}function Se(a){if(!a||typeof a!="object")return{theme:[],root:[]};let e=b(a.spacing,"--spacing-"),r=a.spacing?.["1"]?.$value,t=a.font||{},o=a.motion||{},n=a.layout||{},d=o.easing?.standard?.$value,l=o.duration?.normal?.$value;return{theme:[...r?[["--spacing",String(r)]]:[],...e,...b(t.size,"--text-"),...b(t.weight,"--font-weight-"),...b(t.lineHeight,"--leading-"),...b(t.letterSpacing,"--tracking-"),...b(a.blur,"--blur-"),...b(o.easing,"--ease-"),...d?[["--default-transition-timing-function",String(d)]]:[],...l?[["--default-transition-duration",String(l)]]:[],...b(n.screen,"--breakpoint-")],root:[...b(a.opacity,"--opacity-"),...b(a.border?.width,"--border-width-"),...b(a.border?.style,"--border-style-"),...b(o.duration,"--duration-"),...b(n.maxWidth,"--max-width-"),...b(n.container,"--layout-container-"),...b(n.gutter,"--gutter-")]}}Y.exports={foundationTheme:Se}});var D=$((Ye,Q)=>{var Ce="classes.txt",_e="classes.css";Q.exports={CLASSES_SOURCE_FILE:Ce,CSS_CLASSES_SOURCE_FILE:_e}});var ae=$((Ze,te)=>{var Fe=new Set(["after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]),Oe=new Set(["active","focus","focus-visible","focus-within","hover"]),ze=new Set(["sm","md","lg","xl","2xl","any-pointer-coarse","any-pointer-fine","any-pointer-none","contrast-less","contrast-more","forced-colors","inverted-colors","landscape","motion-reduce","motion-safe","noscript","pointer-coarse","pointer-fine","pointer-none","portrait","print","starting"]),Ee=/^(?:min-|max-|@|supports-|in-(?!range$))/,je=/^\[&(?::(?:active|focus|focus-visible|focus-within|hover))+\]$/;function Ve(a){let e=[],r=0,t=0;for(let o=0;o<a.length;o+=1){let n=a[o];n==="["||n==="("?r+=1:(n==="]"||n===")")&&r>0?r-=1:n===":"&&r===0&&(e.push(a.slice(t,o)),t=o+1)}return e.push(a.slice(t)),{variants:e.slice(0,-1),utility:e[e.length-1]}}function ee(a){return a.replace(/\/[\w-]+$/,"")}function S(a){let e=ee(a);return Fe.has(e)||e.startsWith("[")&&e.includes("::")}function C(a){let e=ee(a);return Oe.has(e)||ze.has(e)?!0:e.startsWith("[")?e.startsWith("[@")||je.test(e):e.startsWith("not-")?C(e.slice(4)):Ee.test(e)}function re(a){if(typeof a!="string"||!a.includes(":"))return null;let e=a.startsWith("!")?"!":"",{variants:r,utility:t}=Ve(a.slice(e.length)),o=null,n=[];for(let i of r)o!==null&&!C(i)&&n.push(i),o===null&&S(i)&&(o=i);if(n.length===0)return null;let d=r.reduce((i,u,p)=>S(u)?p:i,-1),l=r.slice(0,d).filter(i=>!S(i)),c=r.slice(d+1),m=`${e}${[...l,...c.filter(i=>!C(i)),r[d],...c.filter(C),t].join(":")}`,f=r.filter(S),s=f.length>1?`${f.join(" and ")} are pseudo-elements, and a selector can hold only one`:`${n.join(", ")} cannot follow the pseudo-element ${o}; only hover, focus, focus-visible, focus-within, active, in-* and media, container or supports variants can`;return{className:a,pseudoElement:o,chained:n,suggestion:m,reason:s}}function Ae(a){return re(a)===null}te.exports={isCompilableClass:Ae,uncompilableClass:re}});var{fileExists:Qe,readJsonFileSafe:De}=L(),Ne=require("color"),Re=require("https"),er=require("fs"),rr=require("path"),{ProcessingError:Te}=M(),{STATE_VARIANT_CSS:Ie}=J(),{motionUtilityCss:Le}=B(),{foundationTheme:We}=Z(),{CLASSES_SOURCE_FILE:Me}=D(),{isCompilableClass:oe}=ae(),Pe={"--background":"oklch(1 0 0)","--foreground":"oklch(0.145 0 0)","--card":"oklch(1 0 0)","--card-foreground":"oklch(0.145 0 0)","--popover":"oklch(1 0 0)","--popover-foreground":"oklch(0.145 0 0)","--primary":"oklch(0.205 0 0)","--primary-foreground":"oklch(0.985 0 0)","--secondary":"oklch(0.97 0 0)","--secondary-foreground":"oklch(0.205 0 0)","--muted":"oklch(0.97 0 0)","--muted-foreground":"oklch(0.556 0 0)","--accent":"oklch(0.97 0 0)","--accent-foreground":"oklch(0.205 0 0)","--destructive":"oklch(0.577 0.245 27.325)","--destructive-foreground":"oklch(0.985 0 0)","--border":"oklch(0.922 0 0)","--input":"oklch(0.922 0 0)","--ring":"oklch(0.708 0 0)","--sidebar":"oklch(0.985 0 0)","--sidebar-foreground":"oklch(0.145 0 0)","--sidebar-primary":"oklch(0.205 0 0)","--sidebar-primary-foreground":"oklch(0.985 0 0)","--sidebar-accent":"oklch(0.97 0 0)","--sidebar-accent-foreground":"oklch(0.205 0 0)","--sidebar-border":"oklch(0.922 0 0)","--sidebar-ring":"oklch(0.708 0 0)","--chart-1":"oklch(0.646 0.222 41.116)","--chart-2":"oklch(0.6 0.118 184.704)","--chart-3":"oklch(0.398 0.07 227.392)","--chart-4":"oklch(0.828 0.189 84.429)","--chart-5":"oklch(0.769 0.188 70.08)"},qe={"--background":["--bg-default","--bg-neutral-low","--layer-base"],"--foreground":["--text-neutral-strong","--text-default"],"--card":["--layer-1","--bg-neutral-low","--bg-default"],"--card-foreground":["--text-neutral-strong","--text-default"],"--popover":["--layer-1","--bg-neutral-low","--bg-default"],"--popover-foreground":["--text-neutral-strong","--text-default"],"--primary":["--bg-brand-mid","--bg-brand-strong"],"--primary-foreground":["--text-onbrand-strong","--text-inverse-low"],"--secondary":["--bg-interactive-subtle","--bg-neutral-low"],"--secondary-foreground":["--text-oninteractive-subtle","--text-neutral-strong"],"--muted":["--bg-neutral-low","--bg-disabled"],"--muted-foreground":["--text-neutral-subtle","--text-disabled"],"--accent":["--bg-interactive-low","--bg-brand-low","--bg-neutral-low"],"--accent-foreground":["--text-oninteractive-low","--text-brand-strong","--text-neutral-strong"],"--destructive":["--bg-negative-mid","--bg-negative-subtle"],"--destructive-foreground":["--text-onnegative-subtle","--text-inverse-low"],"--border":["--border-neutral-subtle","--border-default"],"--input":["--border-neutral-subtle","--border-default"],"--ring":["--border-brand-mid","--bg-brand-mid"],"--sidebar":["--layer-1","--bg-neutral-low","--bg-default"],"--sidebar-foreground":["--text-neutral-strong","--text-default"],"--sidebar-primary":["--bg-brand-mid","--bg-brand-strong"],"--sidebar-primary-foreground":["--text-onbrand-strong","--text-inverse-low"],"--sidebar-accent":["--bg-interactive-low","--bg-neutral-low"],"--sidebar-accent-foreground":["--text-oninteractive-low","--text-neutral-strong"],"--sidebar-border":["--border-neutral-subtle","--border-default"],"--sidebar-ring":["--border-brand-mid","--bg-brand-mid"],"--chart-1":["--bg-brand-mid","--bg-brand-strong"],"--chart-2":["--bg-interactive-mid","--bg-interactive-low"],"--chart-3":["--bg-positive-mid","--bg-positive-subtle"],"--chart-4":["--bg-warning-mid","--bg-warning-subtle"],"--chart-5":["--bg-negative-mid","--bg-negative-subtle"]};function Ue(a,e,r){for(let t of e||[])if(a[t])return a[t];return r}function se(a={}){return Object.fromEntries(Object.entries(a?.radius||{}).filter(([,e])=>typeof e?.$value=="string").map(([e,r])=>[e.toLowerCase(),r.$value.replace(/\{([^}]+)\}/g,(t,o)=>`var(--${o.replace(/\./g,"-").toLowerCase()})`)]))}function ie(a={},e={}){let r={};for(let[o,n]of Object.entries(qe))r[o]=Ue(a,n,Pe[o]);let t=e.borderRadius||{};return r["--radius"]=t.default||t.md||t.lg||"0.625rem",r["--radius-sm"]=t.sm||"calc(var(--radius) - 4px)",r["--radius-md"]=t.md||"calc(var(--radius) - 2px)",r["--radius-lg"]=t.lg||"var(--radius)",r["--radius-xl"]=t.xl||"calc(var(--radius) + 4px)",r}var V=class{constructor(e={}){this.config=e}hexToOklch(e){if(typeof e=="string"&&/^oklch\(.*\)$/i.test(e.trim()))return e.trim();try{let r=Ne(e),t=r.rgb(),o=t.red()/255,n=t.green()/255,d=t.blue()/255,l=w=>w<=.04045?w/12.92:Math.pow((w+.055)/1.055,2.4),c=l(o),m=l(n),f=l(d),s=c*.4124564+m*.3575761+f*.1804375,i=c*.2126729+m*.7151522+f*.072175,u=c*.0193339+m*.119192+f*.9503041,p=Math.cbrt(.8189330101*s+.3618667424*i-.1288597137*u),v=Math.cbrt(.0329845436*s+.9293118715*i+.0361456387*u),g=Math.cbrt(.0482003018*s+.2643662691*i+.633851707*u),y=.2104542553*p+.793617785*v-.0040720468*g,x=1.9779984951*p-2.428592205*v+.4505937099*g,k=.0259040371*p+.7827717662*v-.808675766*g,ne=Math.sqrt(x*x+k*k),_=Math.atan2(k,x)*180/Math.PI;_<0&&(_+=360);let A=Math.round(y*1e3)/1e3,N=Math.round(ne*1e3)/1e3,R=Math.round(_*100)/100,T=r.alpha();if(T<1){let w=Math.round(T*100)/100;return`oklch(${A} ${N} ${R} / ${w})`}return`oklch(${A} ${N} ${R})`}catch(r){throw new Te(`Failed to convert color ${e}: ${r.message}`,e)}}processColors(e){let r={},t={},o={backgroundColor:{},textColor:{},borderColor:{}};if(!e||typeof e!="object")return console.log(" \u26A0\uFE0F No valid color data to process"),{variables:r,colorMap:t,utilities:o};let n=(d,l="")=>{for(let[c,m]of Object.entries(d))if(m&&typeof m=="object")if(m.$value){let f=l?`${l}-${c}`:c,s=`--color-${f}`,i=this.hexToOklch(m.$value);r[s]=i,t[f]=s;let u=`var(${s})`;o.backgroundColor[f]=u,o.textColor[f]=u,o.borderColor[f]=u}else{let f=l?`${l}-${c}`:c;n(m,f)}};return e&&(e.colors?n(e.colors):n(e)),{variables:r,colorMap:t,utilities:o}}processSemanticTokens(e,r){let t={},o={backgroundColor:{},textColor:{},borderColor:{}},n=c=>c.replace(/ /g,"").replace(/\./g,"-").toLowerCase(),d=c=>{if(typeof c!="string")return null;let m=c.match(/^\{(.+)\}$/);if(!m)return null;let f=m[1].split(".");return f[0]==="colors"&&f.length>1?f[1]==="colors"&&f.length>2?f.slice(2).join("-"):f.slice(1).join("-"):f.join("-")},l=(c,m)=>{if(e[c])for(let[f,s]of Object.entries(e[c])){if(f==="disabled"){let i=d(s.$value);if(i){let u=r[i];if(u){let p=`--${c}-disabled`;t[p]=`var(${u})`,o[m].disabled=`var(${p})`}}continue}for(let[i,u]of Object.entries(s))for(let[p,v]of Object.entries(u)){let g=n(`${f}-${i}-${p}`);g.endsWith("-default")&&(g=g.slice(0,-8));let y=`--${c}-${g}`,x=d(v.$value);if(x){let k=r[x];k&&(t[y]=`var(${k})`,o[m][g]=`var(${y})`)}else if(v.$value){let k=this.hexToOklch(v.$value);t[y]=k,o[m][g]=`var(${y})`}}}};if(l("bg","backgroundColor"),l("text","textColor"),l("border","borderColor"),e.layer)for(let[c,m]of Object.entries(e.layer)){let f=`--layer-${c}`,s=d(m.$value);if(s){let i=s.replace(/\./g,"-").toLowerCase();if(i.endsWith("-default")&&(i=i.slice(0,-8)),i.startsWith("bg-")||i.startsWith("text-")||i.startsWith("border-")){let u=`--${i}`;t[f]=`var(${u})`,o.backgroundColor[`layer-${c}`]=`var(${f})`}else{let u=r[i];u&&(t[f]=`var(${u})`,o.backgroundColor[`layer-${c}`]=`var(${f})`)}}else if(m.$value){let i=this.hexToOklch(m.$value);t[f]=i,o.backgroundColor[`layer-${c}`]=`var(${f})`}}if(e.overlay)for(let[c,m]of Object.entries(e.overlay)){let f=`--overlay-${c}`;m.$value&&(t[f]=m.$value,o.backgroundColor[`overlay-${c}`]=`var(${f})`)}if(e.icon){o.fill||(o.fill={});for(let[c,m]of Object.entries(e.icon)){if(c==="disabled"){let f=d(m.$value);if(f){let s=r[f];if(s){let i="--icon-disabled";t[i]=`var(${s})`,o.textColor["icon-disabled"]=`var(${i})`,o.fill["icon-disabled"]=`var(${i})`}}continue}for(let[f,s]of Object.entries(m))for(let[i,u]of Object.entries(s)){let p=n(`icon-${c}-${f}-${i}`);p.endsWith("-default")&&(p=p.slice(0,-8));let v=`--${p}`,g=d(u.$value);if(g){let y=r[g];y&&(t[v]=`var(${y})`,o.textColor[p]=`var(${v})`,o.fill[p]=`var(${v})`)}}}}return{semanticVariables:t,tokens:o}}async fetchFontCss(e,{timeoutMs:r=1e4}={}){if(!Number.isFinite(r)||r<=0)throw new Error("Font CSS timeout must be positive");return new Promise((t,o)=>{let n,d=setTimeout(()=>{let c=new Error("Font CSS request timed out");o(c),n?.destroy(c)},r);d.unref?.();let l=c=>{clearTimeout(d),o(c)};try{n=Re.get(e,c=>{let m="";if(c.on("error",l),c.on("aborted",()=>l(new Error("Font CSS response was interrupted"))),c.statusCode!==200){l(new Error(`Failed to fetch font CSS: ${c.statusCode}`)),c.destroy?.();return}c.on("data",f=>{m+=f}),c.on("end",()=>{clearTimeout(d),t(m)})}),n.on("error",l)}catch(c){l(c)}})}parseFontFaces(e){let r=/@font-face\s*{([^}]+)}/g,t=[],o;for(;(o=r.exec(e))!==null;){let n=o[1].trim().split(";").filter(Boolean),d={};n.forEach(l=>{let c=l.indexOf(":");if(c!==-1){let m=l.slice(0,c).trim(),f=l.slice(c+1).trim();m==="font-family"?d[m]=f.replace(/["']/g,""):d[m]=f}}),d.src&&(d.src=d.src.replace(/url\(["']?/,"url('").replace(/["']?\)/,"')")),t.push(d)}return t}async processFonts(e){let r=[];if(!e||typeof e!="object")return r;let t=Object.keys(e).filter(o=>o.startsWith("font"));for(let o of t){let n=e[o];if(typeof n=="string"&&n.startsWith("http"))try{let d=await this.fetchFontCss(n),l=this.parseFontFaces(d);l.length>0&&r.push(...l)}catch(d){console.warn(`Failed to process font ${o}:`,d.message)}}return r}processFontFamilies(e){let r={};if(!e||!e.font||!e.font.family)return r;let t=e.font.family;for(let[o,n]of Object.entries(t))if(n&&n.$value){let d=o.toLowerCase(),l=n.$value;typeof l=="string"&&l.startsWith("{")&&l.endsWith("}")&&(l=l.slice(1,-1));let c=m=>m.split(" ").map(f=>f.charAt(0).toUpperCase()+f.slice(1).toLowerCase()).join(" ");if(l.includes(","))r[d]=l;else{let m=c(l);m.includes(" ")&&!m.startsWith('"')&&!m.startsWith("'")?r[d]=`"${m}", sans-serif`:r[d]=`${m}, sans-serif`}}return r}processAnimations(e){let r={},t={};if(!e||typeof e!="object")return{keyframes:r,animations:t};for(let[o,n]of Object.entries(e))if(n&&typeof n=="object"){let d=`${o}`;if(n.keyframes){let c={};for(let[m,f]of Object.entries(n.keyframes))f&&typeof f=="object"&&(c[m]=f);r[d]=c}let l=[d,n.duration||"1s",n.easing||"ease",n.delay||"0s",n.iterations||"1",n.direction||"normal",n.fillMode||"none"].join(" ");t[o]=l}return{keyframes:r,animations:t}}generateSafelistClasses(e){let r=[];if(e.backgroundColor)for(let t of Object.keys(e.backgroundColor))r.push(`bg-${t}`);if(e.textColor)for(let t of Object.keys(e.textColor))r.push(`text-${t}`);if(e.borderColor)for(let t of Object.keys(e.borderColor))r.push(`border-${t}`);if(e.fill)for(let t of Object.keys(e.fill))r.push(`fill-${t}`),t.startsWith("icon-")&&r.push(`text-${t}`);if(e.fontFamily)for(let t of Object.keys(e.fontFamily))r.push(`font-${t}`);if(e.animations)for(let t of Object.keys(e.animations))r.push(`animate-${t}`);return r}extractClassesFromComponentsConfig(e){let r=new Set,t=n=>{typeof n=="string"&&n.split(/\s+/).filter(l=>l.length>0).forEach(l=>{r.add(l)})},o=n=>{if(!(!n||typeof n!="object"))for(let d in n){if(d==="icons")continue;let l=n[d];typeof l=="string"?t(l):typeof l=="object"&&o(l)}};return e&&o(e),Array.from(r).filter(oe).sort()}generateClassesContent(e=[]){e=e.filter(oe);let r=["/*"," * Frontfriend Component Classes"," *"," * This file contains all classes used in Frontfriend component configs."," * Tailwind v4 scans this file via @source to generate utilities."," * DO NOT EDIT - Auto-generated by frontfriend CLI"," */","","/*"," * Classes:"],t=" * ";for(let o of[...new Set(e)].sort())t.length+o.length+1>100?(r.push(t),t=` * ${o}`):t+=(t===" * "?"":" ")+o;return t!==" * "&&r.push(t),r.push(" */"),r.join(`
|
|
553
|
-
`)}processCustomCss(e){return!e||typeof e!="string"?{}:{raw:e}}async process(e){try{let r={variables:{},semanticVariables:{},semanticDarkVariables:{},utilities:{},fontFaces:[],keyframes:{},animations:{},safelist:[],metadata:{},custom:e.customCss?this.processCustomCss(e.customCss):{}},t=e.colors;if(t){let o=this.processColors(t);r.variables={...r.variables,...o.variables},r.utilities={...r.utilities,...o.utilities},r.colorMap=o.colorMap||{}}else r.colorMap={};if(e.semantic&&r.colorMap){let o=this.processSemanticTokens(e.semantic,r.colorMap);r.semanticVariables=o.semanticVariables,o.tokens&&(r.tokens=o.tokens,r.utilities=o.tokens)}if(e.semanticDark&&r.colorMap){let o=this.processSemanticTokens(e.semanticDark,r.colorMap);r.semanticDarkVariables=o.semanticVariables}if(e.fonts&&(r.fontFaces=await this.processFonts(e.fonts)),e.globalTokens){r.fontFamilies=this.processFontFamilies(e.globalTokens);let o=
|
|
554
|
-
`)}};module.exports=
|
|
552
|
+
`;function xe(){return we}B.exports={motionUtilityCss:xe}});var Q=$((Xe,Z)=>{function V(a,e=[]){return!a||typeof a!="object"?[]:"$value"in a?[[e,a.$value]]:Object.entries(a).flatMap(([r,t])=>V(t,[...e,r]))}function Y(a){return a.join("-").replace(/\./g,"_")}function b(a,e){return V(a).map(([r,t])=>[`${e}${Y(r)}`,String(t)])}function Se(a){if(!a||typeof a!="object")return{theme:[],root:[]};let e=b(a.spacing,"--spacing-"),r=a.spacing?.["1"]?.$value,t=a.font||{},o=t.weight?.regular?.$value,n=a.motion||{},d=a.layout||{},c=n.easing?.standard?.$value,l=n.duration?.normal?.$value;return{theme:[...r?[["--spacing",String(r)]]:[],...e,...b(t.size,"--text-"),...V(t.sizeLineHeight).map(([m,f])=>[`--text-${Y(m)}--line-height`,String(f)]),...b(t.weight,"--font-weight-"),...o!==void 0&&t.weight?.normal?.$value===void 0?[["--font-weight-normal",String(o)]]:[],...b(t.lineHeight,"--leading-"),...b(t.letterSpacing,"--tracking-"),...b(a.blur,"--blur-"),...b(n.easing,"--ease-"),...c?[["--default-transition-timing-function",String(c)]]:[],...l?[["--default-transition-duration",String(l)]]:[],...b(d.screen,"--breakpoint-")],root:[...b(a.opacity,"--opacity-"),...b(a.border?.width,"--border-width-"),...b(a.border?.style,"--border-style-"),...b(n.duration,"--duration-"),...b(d.maxWidth,"--max-width-"),...b(d.container,"--layout-container-"),...b(d.gutter,"--gutter-")]}}Z.exports={foundationTheme:Se}});var ee=$((Ye,D)=>{var Ce="classes.txt",_e="classes.css";D.exports={CLASSES_SOURCE_FILE:Ce,CSS_CLASSES_SOURCE_FILE:_e}});var oe=$((Ze,ae)=>{var Fe=new Set(["after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]),Oe=new Set(["active","focus","focus-visible","focus-within","hover"]),ze=new Set(["sm","md","lg","xl","2xl","any-pointer-coarse","any-pointer-fine","any-pointer-none","contrast-less","contrast-more","forced-colors","inverted-colors","landscape","motion-reduce","motion-safe","noscript","pointer-coarse","pointer-fine","pointer-none","portrait","print","starting"]),Ee=/^(?:min-|max-|@|supports-|in-(?!range$))/,je=/^\[&(?::(?:active|focus|focus-visible|focus-within|hover))+\]$/;function Ve(a){let e=[],r=0,t=0;for(let o=0;o<a.length;o+=1){let n=a[o];n==="["||n==="("?r+=1:(n==="]"||n===")")&&r>0?r-=1:n===":"&&r===0&&(e.push(a.slice(t,o)),t=o+1)}return e.push(a.slice(t)),{variants:e.slice(0,-1),utility:e[e.length-1]}}function re(a){return a.replace(/\/[\w-]+$/,"")}function S(a){let e=re(a);return Fe.has(e)||e.startsWith("[")&&e.includes("::")}function C(a){let e=re(a);return Oe.has(e)||ze.has(e)?!0:e.startsWith("[")?e.startsWith("[@")||je.test(e):e.startsWith("not-")?C(e.slice(4)):Ee.test(e)}function te(a){if(typeof a!="string"||!a.includes(":"))return null;let e=a.startsWith("!")?"!":"",{variants:r,utility:t}=Ve(a.slice(e.length)),o=null,n=[];for(let i of r)o!==null&&!C(i)&&n.push(i),o===null&&S(i)&&(o=i);if(n.length===0)return null;let d=r.reduce((i,u,p)=>S(u)?p:i,-1),c=r.slice(0,d).filter(i=>!S(i)),l=r.slice(d+1),m=`${e}${[...c,...l.filter(i=>!C(i)),r[d],...l.filter(C),t].join(":")}`,f=r.filter(S),s=f.length>1?`${f.join(" and ")} are pseudo-elements, and a selector can hold only one`:`${n.join(", ")} cannot follow the pseudo-element ${o}; only hover, focus, focus-visible, focus-within, active, in-* and media, container or supports variants can`;return{className:a,pseudoElement:o,chained:n,suggestion:m,reason:s}}function Ae(a){return te(a)===null}ae.exports={isCompilableClass:Ae,uncompilableClass:te}});var{fileExists:Qe,readJsonFileSafe:De}=W(),Ne=require("color"),Re=require("https"),er=require("fs"),rr=require("path"),{ProcessingError:Te}=P(),{STATE_VARIANT_CSS:Ie}=G(),{motionUtilityCss:Le}=X(),{foundationTheme:We}=Q(),{CLASSES_SOURCE_FILE:Me}=ee(),{isCompilableClass:se}=oe(),Pe={"--background":"oklch(1 0 0)","--foreground":"oklch(0.145 0 0)","--card":"oklch(1 0 0)","--card-foreground":"oklch(0.145 0 0)","--popover":"oklch(1 0 0)","--popover-foreground":"oklch(0.145 0 0)","--primary":"oklch(0.205 0 0)","--primary-foreground":"oklch(0.985 0 0)","--secondary":"oklch(0.97 0 0)","--secondary-foreground":"oklch(0.205 0 0)","--muted":"oklch(0.97 0 0)","--muted-foreground":"oklch(0.556 0 0)","--accent":"oklch(0.97 0 0)","--accent-foreground":"oklch(0.205 0 0)","--destructive":"oklch(0.577 0.245 27.325)","--destructive-foreground":"oklch(0.985 0 0)","--border":"oklch(0.922 0 0)","--input":"oklch(0.922 0 0)","--ring":"oklch(0.708 0 0)","--sidebar":"oklch(0.985 0 0)","--sidebar-foreground":"oklch(0.145 0 0)","--sidebar-primary":"oklch(0.205 0 0)","--sidebar-primary-foreground":"oklch(0.985 0 0)","--sidebar-accent":"oklch(0.97 0 0)","--sidebar-accent-foreground":"oklch(0.205 0 0)","--sidebar-border":"oklch(0.922 0 0)","--sidebar-ring":"oklch(0.708 0 0)","--chart-1":"oklch(0.646 0.222 41.116)","--chart-2":"oklch(0.6 0.118 184.704)","--chart-3":"oklch(0.398 0.07 227.392)","--chart-4":"oklch(0.828 0.189 84.429)","--chart-5":"oklch(0.769 0.188 70.08)"},qe={"--background":["--bg-default","--bg-neutral-low","--layer-base"],"--foreground":["--text-neutral-strong","--text-default"],"--card":["--layer-1","--bg-neutral-low","--bg-default"],"--card-foreground":["--text-neutral-strong","--text-default"],"--popover":["--layer-1","--bg-neutral-low","--bg-default"],"--popover-foreground":["--text-neutral-strong","--text-default"],"--primary":["--bg-brand-mid","--bg-brand-strong"],"--primary-foreground":["--text-onbrand-strong","--text-inverse-low"],"--secondary":["--bg-interactive-subtle","--bg-neutral-low"],"--secondary-foreground":["--text-oninteractive-subtle","--text-neutral-strong"],"--muted":["--bg-neutral-low","--bg-disabled"],"--muted-foreground":["--text-neutral-subtle","--text-disabled"],"--accent":["--bg-interactive-low","--bg-brand-low","--bg-neutral-low"],"--accent-foreground":["--text-oninteractive-low","--text-brand-strong","--text-neutral-strong"],"--destructive":["--bg-negative-mid","--bg-negative-subtle"],"--destructive-foreground":["--text-onnegative-subtle","--text-inverse-low"],"--border":["--border-neutral-subtle","--border-default"],"--input":["--border-neutral-subtle","--border-default"],"--ring":["--border-brand-mid","--bg-brand-mid"],"--sidebar":["--layer-1","--bg-neutral-low","--bg-default"],"--sidebar-foreground":["--text-neutral-strong","--text-default"],"--sidebar-primary":["--bg-brand-mid","--bg-brand-strong"],"--sidebar-primary-foreground":["--text-onbrand-strong","--text-inverse-low"],"--sidebar-accent":["--bg-interactive-low","--bg-neutral-low"],"--sidebar-accent-foreground":["--text-oninteractive-low","--text-neutral-strong"],"--sidebar-border":["--border-neutral-subtle","--border-default"],"--sidebar-ring":["--border-brand-mid","--bg-brand-mid"],"--chart-1":["--bg-brand-mid","--bg-brand-strong"],"--chart-2":["--bg-interactive-mid","--bg-interactive-low"],"--chart-3":["--bg-positive-mid","--bg-positive-subtle"],"--chart-4":["--bg-warning-mid","--bg-warning-subtle"],"--chart-5":["--bg-negative-mid","--bg-negative-subtle"]};function Ue(a,e,r){for(let t of e||[])if(a[t])return a[t];return r}function ie(a={}){return Object.fromEntries(Object.entries(a?.radius||{}).filter(([,e])=>typeof e?.$value=="string").map(([e,r])=>[e.toLowerCase(),r.$value.replace(/\{([^}]+)\}/g,(t,o)=>`var(--${o.replace(/\./g,"-").toLowerCase()})`)]))}function ne(a={},e={}){let r={};for(let[o,n]of Object.entries(qe))r[o]=Ue(a,n,Pe[o]);let t=e.borderRadius||{};return r["--radius"]=t.default||t.md||t.lg||"0.625rem",r["--radius-sm"]=t.sm||"calc(var(--radius) - 4px)",r["--radius-md"]=t.md||"calc(var(--radius) - 2px)",r["--radius-lg"]=t.lg||"var(--radius)",r["--radius-xl"]=t.xl||"calc(var(--radius) + 4px)",r}var A=class{constructor(e={}){this.config=e}hexToOklch(e){if(typeof e=="string"&&/^oklch\(.*\)$/i.test(e.trim()))return e.trim();try{let r=Ne(e),t=r.rgb(),o=t.red()/255,n=t.green()/255,d=t.blue()/255,c=x=>x<=.04045?x/12.92:Math.pow((x+.055)/1.055,2.4),l=c(o),m=c(n),f=c(d),s=l*.4124564+m*.3575761+f*.1804375,i=l*.2126729+m*.7151522+f*.072175,u=l*.0193339+m*.119192+f*.9503041,p=Math.cbrt(.8189330101*s+.3618667424*i-.1288597137*u),v=Math.cbrt(.0329845436*s+.9293118715*i+.0361456387*u),g=Math.cbrt(.0482003018*s+.2643662691*i+.633851707*u),y=.2104542553*p+.793617785*v-.0040720468*g,w=1.9779984951*p-2.428592205*v+.4505937099*g,k=.0259040371*p+.7827717662*v-.808675766*g,le=Math.sqrt(w*w+k*k),_=Math.atan2(k,w)*180/Math.PI;_<0&&(_+=360);let N=Math.round(y*1e3)/1e3,R=Math.round(le*1e3)/1e3,T=Math.round(_*100)/100,I=r.alpha();if(I<1){let x=Math.round(I*100)/100;return`oklch(${N} ${R} ${T} / ${x})`}return`oklch(${N} ${R} ${T})`}catch(r){throw new Te(`Failed to convert color ${e}: ${r.message}`,e)}}processColors(e){let r={},t={},o={backgroundColor:{},textColor:{},borderColor:{}};if(!e||typeof e!="object")return console.log(" \u26A0\uFE0F No valid color data to process"),{variables:r,colorMap:t,utilities:o};let n=(d,c="")=>{for(let[l,m]of Object.entries(d))if(m&&typeof m=="object")if(m.$value){let f=c?`${c}-${l}`:l,s=`--color-${f}`,i=this.hexToOklch(m.$value);r[s]=i,t[f]=s;let u=`var(${s})`;o.backgroundColor[f]=u,o.textColor[f]=u,o.borderColor[f]=u}else{let f=c?`${c}-${l}`:l;n(m,f)}};return e&&(e.colors?n(e.colors):n(e)),{variables:r,colorMap:t,utilities:o}}processSemanticTokens(e,r){let t={},o={backgroundColor:{},textColor:{},borderColor:{}},n=l=>l.replace(/ /g,"").replace(/\./g,"-").toLowerCase(),d=l=>{if(typeof l!="string")return null;let m=l.match(/^\{(.+)\}$/);if(!m)return null;let f=m[1].split(".");return f[0]==="colors"&&f.length>1?f[1]==="colors"&&f.length>2?f.slice(2).join("-"):f.slice(1).join("-"):f.join("-")},c=(l,m)=>{if(e[l])for(let[f,s]of Object.entries(e[l])){if(f==="disabled"){let i=d(s.$value);if(i){let u=r[i];if(u){let p=`--${l}-disabled`;t[p]=`var(${u})`,o[m].disabled=`var(${p})`}}continue}for(let[i,u]of Object.entries(s))for(let[p,v]of Object.entries(u)){let g=n(`${f}-${i}-${p}`);g.endsWith("-default")&&(g=g.slice(0,-8));let y=`--${l}-${g}`,w=d(v.$value);if(w){let k=r[w];k&&(t[y]=`var(${k})`,o[m][g]=`var(${y})`)}else if(v.$value){let k=this.hexToOklch(v.$value);t[y]=k,o[m][g]=`var(${y})`}}}};if(c("bg","backgroundColor"),c("text","textColor"),c("border","borderColor"),e.layer)for(let[l,m]of Object.entries(e.layer)){let f=`--layer-${l}`,s=d(m.$value);if(s){let i=s.replace(/\./g,"-").toLowerCase();if(i.endsWith("-default")&&(i=i.slice(0,-8)),i.startsWith("bg-")||i.startsWith("text-")||i.startsWith("border-")){let u=`--${i}`;t[f]=`var(${u})`,o.backgroundColor[`layer-${l}`]=`var(${f})`}else{let u=r[i];u&&(t[f]=`var(${u})`,o.backgroundColor[`layer-${l}`]=`var(${f})`)}}else if(m.$value){let i=this.hexToOklch(m.$value);t[f]=i,o.backgroundColor[`layer-${l}`]=`var(${f})`}}if(e.overlay)for(let[l,m]of Object.entries(e.overlay)){let f=`--overlay-${l}`;m.$value&&(t[f]=m.$value,o.backgroundColor[`overlay-${l}`]=`var(${f})`)}if(e.icon){o.fill||(o.fill={});for(let[l,m]of Object.entries(e.icon)){if(l==="disabled"){let f=d(m.$value);if(f){let s=r[f];if(s){let i="--icon-disabled";t[i]=`var(${s})`,o.textColor["icon-disabled"]=`var(${i})`,o.fill["icon-disabled"]=`var(${i})`}}continue}for(let[f,s]of Object.entries(m))for(let[i,u]of Object.entries(s)){let p=n(`icon-${l}-${f}-${i}`);p.endsWith("-default")&&(p=p.slice(0,-8));let v=`--${p}`,g=d(u.$value);if(g){let y=r[g];y&&(t[v]=`var(${y})`,o.textColor[p]=`var(${v})`,o.fill[p]=`var(${v})`)}}}}return{semanticVariables:t,tokens:o}}async fetchFontCss(e,{timeoutMs:r=1e4}={}){if(!Number.isFinite(r)||r<=0)throw new Error("Font CSS timeout must be positive");return new Promise((t,o)=>{let n,d=setTimeout(()=>{let l=new Error("Font CSS request timed out");o(l),n?.destroy(l)},r);d.unref?.();let c=l=>{clearTimeout(d),o(l)};try{n=Re.get(e,l=>{let m="";if(l.on("error",c),l.on("aborted",()=>c(new Error("Font CSS response was interrupted"))),l.statusCode!==200){c(new Error(`Failed to fetch font CSS: ${l.statusCode}`)),l.destroy?.();return}l.on("data",f=>{m+=f}),l.on("end",()=>{clearTimeout(d),t(m)})}),n.on("error",c)}catch(l){c(l)}})}parseFontFaces(e){let r=/@font-face\s*{([^}]+)}/g,t=[],o;for(;(o=r.exec(e))!==null;){let n=o[1].trim().split(";").filter(Boolean),d={};n.forEach(c=>{let l=c.indexOf(":");if(l!==-1){let m=c.slice(0,l).trim(),f=c.slice(l+1).trim();m==="font-family"?d[m]=f.replace(/["']/g,""):d[m]=f}}),d.src&&(d.src=d.src.replace(/url\(["']?/,"url('").replace(/["']?\)/,"')")),t.push(d)}return t}async processFonts(e){let r=[];if(!e||typeof e!="object")return r;let t=Object.keys(e).filter(o=>o.startsWith("font"));for(let o of t){let n=e[o];if(typeof n=="string"&&n.startsWith("http"))try{let d=await this.fetchFontCss(n),c=this.parseFontFaces(d);c.length>0&&r.push(...c)}catch(d){console.warn(`Failed to process font ${o}:`,d.message)}}return r}processFontFamilies(e){let r={};if(!e||!e.font||!e.font.family)return r;let t=e.font.family;for(let[o,n]of Object.entries(t))if(n&&n.$value){let d=o.toLowerCase(),c=n.$value;typeof c=="string"&&c.startsWith("{")&&c.endsWith("}")&&(c=c.slice(1,-1));let l=m=>m.split(" ").map(f=>f.charAt(0).toUpperCase()+f.slice(1).toLowerCase()).join(" ");if(c.includes(","))r[d]=c;else{let m=l(c);m.includes(" ")&&!m.startsWith('"')&&!m.startsWith("'")?r[d]=`"${m}", sans-serif`:r[d]=`${m}, sans-serif`}}return r}processAnimations(e){let r={},t={};if(!e||typeof e!="object")return{keyframes:r,animations:t};for(let[o,n]of Object.entries(e))if(n&&typeof n=="object"){let d=`${o}`;if(n.keyframes){let l={};for(let[m,f]of Object.entries(n.keyframes))f&&typeof f=="object"&&(l[m]=f);r[d]=l}let c=[d,n.duration||"1s",n.easing||"ease",n.delay||"0s",n.iterations||"1",n.direction||"normal",n.fillMode||"none"].join(" ");t[o]=c}return{keyframes:r,animations:t}}generateSafelistClasses(e){let r=[];if(e.backgroundColor)for(let t of Object.keys(e.backgroundColor))r.push(`bg-${t}`);if(e.textColor)for(let t of Object.keys(e.textColor))r.push(`text-${t}`);if(e.borderColor)for(let t of Object.keys(e.borderColor))r.push(`border-${t}`);if(e.fill)for(let t of Object.keys(e.fill))r.push(`fill-${t}`),t.startsWith("icon-")&&r.push(`text-${t}`);if(e.fontFamily)for(let t of Object.keys(e.fontFamily))r.push(`font-${t}`);if(e.animations)for(let t of Object.keys(e.animations))r.push(`animate-${t}`);return r}extractClassesFromComponentsConfig(e){let r=new Set,t=n=>{typeof n=="string"&&n.split(/\s+/).filter(c=>c.length>0).forEach(c=>{r.add(c)})},o=n=>{if(!(!n||typeof n!="object"))for(let d in n){if(d==="icons")continue;let c=n[d];typeof c=="string"?t(c):typeof c=="object"&&o(c)}};return e&&o(e),Array.from(r).filter(se).sort()}generateClassesContent(e=[]){e=e.filter(se);let r=["/*"," * Frontfriend Component Classes"," *"," * This file contains all classes used in Frontfriend component configs."," * Tailwind v4 scans this file via @source to generate utilities."," * DO NOT EDIT - Auto-generated by frontfriend CLI"," */","","/*"," * Classes:"],t=" * ";for(let o of[...new Set(e)].sort())t.length+o.length+1>100?(r.push(t),t=` * ${o}`):t+=(t===" * "?"":" ")+o;return t!==" * "&&r.push(t),r.push(" */"),r.join(`
|
|
553
|
+
`)}processCustomCss(e){return!e||typeof e!="string"?{}:{raw:e}}async process(e){try{let r={variables:{},semanticVariables:{},semanticDarkVariables:{},utilities:{},fontFaces:[],keyframes:{},animations:{},safelist:[],metadata:{},custom:e.customCss?this.processCustomCss(e.customCss):{}},t=e.colors;if(t){let o=this.processColors(t);r.variables={...r.variables,...o.variables},r.utilities={...r.utilities,...o.utilities},r.colorMap=o.colorMap||{}}else r.colorMap={};if(e.semantic&&r.colorMap){let o=this.processSemanticTokens(e.semantic,r.colorMap);r.semanticVariables=o.semanticVariables,o.tokens&&(r.tokens=o.tokens,r.utilities=o.tokens)}if(e.semanticDark&&r.colorMap){let o=this.processSemanticTokens(e.semanticDark,r.colorMap);r.semanticDarkVariables=o.semanticVariables}if(e.fonts&&(r.fontFaces=await this.processFonts(e.fonts)),e.globalTokens){r.fontFamilies=this.processFontFamilies(e.globalTokens);let o=ie(e.globalTokens);Object.keys(o).length&&(r.utilities.borderRadius=o),r.fontFamilies&&(r.utilities.fontFamily||(r.utilities.fontFamily={}),Object.assign(r.utilities.fontFamily,r.fontFamilies))}if(e.animations){let o=this.processAnimations(e.animations);r.keyframes=o.keyframes,r.animations=o.animations}return r.safelist=this.generateSafelistClasses(r.tokens||r.utilities),r.metadata={timestamp:new Date().toISOString(),version:e.version||"2.0.0",ffId:e.ffId},r}catch(r){throw console.error("Error processing tokens:",r),r}}buildSemanticColorNamespaces(e){let r=[["","border","--border-"],["layer-","layer","--layer-"],["overlay-","overlay","--overlay-"],["icon-","icon","--icon-"]],t=[["","bg","--bg-"],["layer-","layer","--layer-"],["overlay-","overlay","--overlay-"],["icon-","icon","--icon-"]],n=[{namespace:"--background-color",roles:t},{namespace:"--text-color",roles:[["","text","--text-"],["layer-","layer","--layer-"],["overlay-","overlay","--overlay-"],["icon-","icon","--icon-"]]},{namespace:"--border-color",roles:r},{namespace:"--ring-color",roles:r},{namespace:"--outline-color",roles:r},{namespace:"--stroke",roles:r},{namespace:"--ring-offset-color",roles:t},{namespace:"--fill",roles:t}],d=[];for(let{namespace:c,roles:l}of n)for(let[m,f,s]of l)for(let i of e[f]||[])d.push(` ${c}-${m}${i}: var(${s}${i});`);return d.length===0?[]:["","@theme {",...d,"}"]}generateThemeCSSFromProcessedTokens(e){return this.generateThemeCSS({variables:e.variables||{},semanticVariables:e.semanticVariables||{},semanticDarkVariables:e.semanticDarkVariables||{},fontFamilies:e.tokens?.fontFamily||{},utilities:{borderRadius:ie(e.globalTokens)},foundation:We(e.globalTokens),shadows:e.shadows,fontFaces:e.fonts||[],keyframes:e.keyframes||{},animations:e.animations||{},custom:e.custom||{}})}generateThemeCSS(e){let r=['@import "tw-animate-css";',"",...Ie,Le(),"@theme {"];for(let[s,i]of Object.entries(e.variables||{}))r.push(` ${s}: ${i};`);for(let[s,i]of Object.entries(e.fontFamilies||{})){let u=s.startsWith("--")?s:`--font-${s}`,p=Array.isArray(i)?i.join(", "):i;r.push(` ${u}: ${p};`)}e.fontFamilies?.primary&&!e.fontFamilies.sans&&r.push(" --font-sans: var(--font-primary);");for(let[s,i]of Object.entries(e.utilities?.spacing||{})){let u=s.startsWith("--")?s:`--spacing-${s}`;r.push(` ${u}: ${i};`)}for(let[s,i]of Object.entries(e.utilities?.borderRadius||{})){let u=s.startsWith("--")?s:`--radius-${s}`;r.push(` ${u}: ${i};`)}for(let[s,i]of e.foundation?.theme||[])r.push(` ${s}: ${i};`);r.push("}","");let t=e.shadows?.light||{},o=e.shadows?.dark||{},n=[...new Set([...Object.keys(t),...Object.keys(o)])];if(n.length){r.push("@theme inline {");for(let s of n)r.push(` --shadow-${s}: var(--elevation-${s});`);r.push("}","")}let d=e.foundation?.root||[];if(d.length){r.push(":root {");for(let[s,i]of d)r.push(` ${s}: ${i};`);r.push("}","")}let c=e.semanticVariables||{},l=ne(c,e.utilities||{});r.push(":root:not(.dark) {");for(let[s,i]of Object.entries(l))r.push(` ${s}: ${i};`);for(let[s,i]of Object.entries(c))r.push(` ${s}: ${i};`);for(let[s,i]of Object.entries(t))r.push(` --elevation-${s}: ${i};`);if(r.push("}"),e.semanticDarkVariables&&Object.keys(e.semanticDarkVariables).length>0||Object.keys(o).length>0){let s={...c,...e.semanticDarkVariables},i=ne(s,e.utilities||{});r.push("",":root.dark {");for(let[u,p]of Object.entries(i))r.push(` ${u}: ${p};`);for(let[u,p]of Object.entries(e.semanticDarkVariables||{}))r.push(` ${u}: ${p};`);for(let[u,p]of Object.entries(o))r.push(` --elevation-${u}: ${p};`);r.push("}")}let m={bg:[],text:[],border:[],icon:[],layer:[],overlay:[]};for(let s of Object.keys(e.semanticVariables||{}))s.startsWith("--bg-")&&m.bg.push(s.slice(5)),s.startsWith("--text-")&&m.text.push(s.slice(7)),s.startsWith("--border-")&&m.border.push(s.slice(9)),s.startsWith("--icon-")&&m.icon.push(s.slice(7)),s.startsWith("--layer-")&&m.layer.push(s.slice(8)),s.startsWith("--overlay-")&&m.overlay.push(s.slice(10));let f=(s,i)=>{r.push("",`@utility ${s} {`);for(let u of i)r.push(` ${u}`);r.push("}")};for(let s of m.icon)f(`icon-${s}`,[`color: var(--icon-${s});`]);r.push(...this.buildSemanticColorNamespaces(m));for(let s of e.fontFaces||[]){r.push("","@font-face {");for(let[i,u]of Object.entries(s)){let p=i.replace(/([A-Z])/g,"-$1").toLowerCase(),v=Array.isArray(u)?u.join(", "):u;r.push(` ${p}: ${v};`)}r.push("}")}for(let[s,i]of Object.entries(e.keyframes||{})){r.push("",`@keyframes ${s} {`);for(let[u,p]of Object.entries(i)){r.push(` ${u} {`);for(let[v,g]of Object.entries(p)){let y=v.replace(/([A-Z])/g,"-$1").toLowerCase();r.push(` ${y}: ${g};`)}r.push(" }")}r.push("}")}for(let[s,i]of Object.entries(e.animations||{}))f(`animate-${s}`,[`animation: ${i};`]);return e.custom?.raw&&r.push("","/* Custom CSS */",e.custom.raw),r.push("","/* Component classes for Tailwind scanning */",`@source './${Me}';`),r.join(`
|
|
554
|
+
`)}};module.exports=A;
|