@frontfriend/sdk 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +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.2.6"}});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};
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.2.8"}});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.2.6"}});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.2.8"}});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,`
package/dist/mcp.cjs CHANGED
@@ -15,7 +15,7 @@ Defaulting to 2020, but this will stop working in the future.`)),R.ecmaVersion=1
15
15
  `;break;default:l+=String.fromCharCode(k);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),R=this.pos}else++this.pos}},tt.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(m.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
16
16
  `&&++this.pos;case`
17
17
  `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},tt.readEscapedChar=function(l){var R=this.input.charCodeAt(++this.pos);switch(++this.pos,R){case 110:return`
18
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return we(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),l){var k=this.pos-1;this.invalidStringToken(k,"Invalid escape sequence in template string")}default:if(R>=48&&R<=55){var q=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],J=parseInt(q,8);return J>255&&(q=q.slice(0,-1),J=parseInt(q,8)),this.pos+=q.length-1,R=this.input.charCodeAt(this.pos),(q!=="0"||R===56||R===57)&&(this.strict||l)&&this.invalidStringToken(this.pos-1-q.length,l?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(J)}return E(R)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(R)}},tt.readHexChar=function(l){var R=this.pos,k=this.readInt(16,l);return k===null&&this.invalidStringToken(R,"Bad character escape sequence"),k},tt.readWord1=function(){this.containsEsc=!1;for(var l="",R=!0,k=this.pos,q=this.options.ecmaVersion>=6;this.pos<this.input.length;){var J=this.fullCharCodeAtPos();if(_(J,q))this.pos+=J<=65535?1:2;else if(J===92){this.containsEsc=!0,l+=this.input.slice(k,this.pos);var ae=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var le=this.readCodePoint();(R?p:_)(le,q)||this.invalidStringToken(ae,"Invalid Unicode escape"),l+=we(le),k=this.pos}else break;R=!1}return l+this.input.slice(k,this.pos)},tt.readWord=function(){var l=this.readWord1(),R=m.name;return this.keywords.test(l)&&(R=w[l]),this.finishToken(R,l)};var dt="8.17.0";lt.acorn={Parser:lt,version:dt,defaultOptions:C,Position:j,SourceLocation:U,getLineInfo:B,Node:sn,TokenType:h,tokTypes:m,keywordTypes:w,TokContext:cr,tokContexts:Rt,isIdentifierChar:_,isIdentifierStart:p,Token:Gr,isNewLine:E,lineBreak:O,lineBreakG:P,nonASCIIwhitespace:D};function ln(l,R){return lt.parse(l,R)}function Nt(l,R,k){return lt.parseExpressionAt(l,R,k)}function Cu(l,R){return lt.tokenizer(l,R)}e.Node=sn,e.Parser=lt,e.Position=j,e.SourceLocation=U,e.TokContext=cr,e.Token=Gr,e.TokenType=h,e.defaultOptions=C,e.getLineInfo=B,e.isIdentifierChar=_,e.isIdentifierStart=p,e.isNewLine=E,e.keywordTypes=w,e.lineBreak=O,e.lineBreakG=P,e.nonASCIIwhitespace=D,e.parse=ln,e.parseExpressionAt=Nt,e.tokContexts=Rt,e.tokTypes=m,e.tokenizer=Cu,e.version=dt})});var ey=ee((m_e,oE)=>{var{parse:z6}=rE();function _c(){let e=new Error("Configuration reads require a data-only object export. Remove executable statements from frontfriend.config.js.");return e.code="FRONTFRIEND_CONFIG_VALIDATION",e}function iE(e){if(e.type!=="Property"||e.computed||e.method||e.kind!=="init")throw _c();let t=e.key.type==="Identifier"?e.key.name:e.key.value;if(typeof t!="string"||["__proto__","constructor","prototype"].includes(t))throw _c();return t}function nE(e){if(e.type==="ExportDefaultDeclaration")return e.declaration;let t=e.type==="ExpressionStatement"?e.expression:null;return t?.type==="AssignmentExpression"&&t.operator==="="&&t.left.type==="MemberExpression"&&!t.left.computed&&t.left.object.name==="module"&&t.left.property.name==="exports"?t.right:null}function V6(e,t){if(e.type!=="VariableDeclaration"||e.declarations.length!==1)return null;let[r]=e.declarations;return r.id.type!=="Identifier"||t?.type!=="Identifier"||t.name!==r.id.name?null:r.init}function F6(e){let r=z6(e,{ecmaVersion:"latest",sourceType:"module"}).body.filter(o=>o.type!=="EmptyStatement"&&!o.directive),i=r.length===1?nE(r[0]):r.length===2?V6(r[0],nE(r[1])):null;if(i?.type!=="ObjectExpression")throw _c();function n(o,a=0){if(a>64)throw _c();if(o.type==="Literal"&&(o.value===null||["string","number","boolean"].includes(typeof o.value)))return o.value;if(o.type==="ArrayExpression")return o.elements.map(s=>{if(!s)throw _c();return n(s,a+1)});if(o.type==="ObjectExpression")return Object.fromEntries(o.properties.map(s=>[iE(s),n(s.value,a+1)]));if(o.type==="UnaryExpression"&&["-","+"].includes(o.operator)&&o.argument.type==="Literal"&&typeof o.argument.value=="number")return o.operator==="-"?-o.argument.value:o.argument.value;if(o.type==="TemplateLiteral"&&o.expressions.length===0)return o.quasis[0].value.cooked;if(o.type==="MemberExpression"&&!o.computed&&o.object.type==="MemberExpression"&&!o.object.computed&&o.object.object.name==="process"&&o.object.property.name==="env")return process.env[o.property.name];if(o.type==="LogicalExpression"&&["||","??"].includes(o.operator)){let s=n(o.left,a+1);return o.operator==="||"?s||n(o.right,a+1):s??n(o.right,a+1)}throw _c()}return{config:n(i),expression:i}}oE.exports={parseStaticConfig:F6,propertyName:iE}});var cE=ee((h_e,sE)=>{var bo=require("path"),{fileExists:ty}=rs();function aE(e,t=process.cwd()){let r=t;for(;r!==bo.parse(r).root;){let i=bo.join(r,e);if(ty(i))return i;r=bo.dirname(r)}return null}function J6(e,t=process.cwd(),r=null){let i=[],n=t,o=10;for(let a=0;a<o;a++){i.push(bo.join(n,e)),a<3&&i.push(bo.join(n,"../".repeat(a+1)+e));let s=bo.dirname(n);if(s===n)break;n=s}i.push(bo.join(__dirname,"../../../",e));for(let a of i)if(ty(a)&&(!r||r(a)))return a;return null}function Z6(e,t=process.cwd()){let r=e.map(i=>bo.isAbsolute(i)?i:bo.join(t,i));for(let i of r)if(ty(i))return i;return null}function H6(e=process.cwd()){let t=aE("frontfriend.config.js",e);return t?bo.dirname(t):e}sE.exports={findFileUpward:aE,findDirectoryUpward:J6,findDirectoryWithPaths:Z6,resolveProjectRoot:H6}});var Os=ee((g_e,B6)=>{B6.exports={name:"@frontfriend/sdk",version:"1.2.6"}});var xu=ee((y_e,uE)=>{var{name:K6}=Os();uE.exports={PACKAGE_NAME:K6}});var Is=ee((v_e,dE)=>{var{PACKAGE_NAME:Nd}=xu(),Ua=require("fs"),W6=require("http"),G6=require("https"),ti=require("path"),Md=["contracts","tokens","components"],Y6=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],X6={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},Q6=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],eF=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function lE(e){try{return JSON.parse(Ua.readFileSync(e,"utf8"))}catch{return{}}}function ry(e){if(e===void 0)return null;if(!Array.isArray(e)){let i=new Error("`adopt` in frontfriend.config.js must be an array.");throw i.code="FRONTFRIEND_CONFIG_VALIDATION",i}let t=e.filter(i=>!Md.includes(i));if(t.length>0){let i=new Error(`Unknown Frontfriend adoption level: ${t.join(", ")}.`);throw i.code="FRONTFRIEND_CONFIG_VALIDATION",i}let r=e.includes("components")?2:e.includes("tokens")?1:0;return Md.slice(0,r+1)}function tF(e){for(let[t,r]of Object.entries(X6)){let i=r.find(o=>Ua.existsSync(ti.join(e,o)));if(!i)continue;let n=Ua.readFileSync(ti.join(e,i),"utf8");return{buildTool:t,present:n.includes(`${Nd}/${t}`)}}return{buildTool:null,present:!1}}function rF(e){let t=[ti.join(e,"components","ui"),ti.join(e,"src","components","ui"),ti.join(e,"app","components","ui")].filter(n=>Ua.existsSync(n)),r=new Set;function i(n){for(let o of Ua.readdirSync(n,{withFileTypes:!0})){let a=ti.join(n,o.name);if(o.isDirectory())i(a);else if(/\.(js|jsx|ts|tsx|vue)$/.test(o.name)){if(!Ua.readFileSync(a,"utf8").includes(Nd))continue;let c=ti.basename(o.name,ti.extname(o.name));r.add(c.toLowerCase()==="index"?ti.basename(n):c.toLowerCase())}}}return t.forEach(i),[...r].sort()}function nF(e){let t=lE(ti.join(e,"package.json")),r={...t.dependencies||{},...t.devDependencies||{}},i=r.tailwindcss||null,o=[lE(ti.join(e,"components.json"))?.tailwind?.css,...Y6].filter(Boolean).find(c=>Ua.existsSync(ti.join(e,c))),a=o?Ua.readFileSync(ti.join(e,o),"utf8"):"",s=eF.filter(c=>r[c]);return!s.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(a)&&!a.includes(`${Nd}/theme.css`)&&s.push("css-custom-properties"),{nativeTokens:{present:a.includes("/* Frontfriend managed native tokens: start */"),file:o||null},tailwind:{present:!!i,version:i,major:i&&Number((String(i).match(/\d+/)||[])[0])||null},componentsJson:Ua.existsSync(ti.join(e,"components.json")),themeImport:{present:a.includes(`${Nd}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(a),file:o||null},plugin:tF(e),frontfriendComponents:rF(e),foreignComponentLibraries:Q6.filter(c=>r[c]),foreignTokenSystems:s}}function iF(e,t,{baseLibrary:r}={}){let i=ry(e)||Md,n=i.includes("tokens"),o=i.includes("components"),a=[];return n&&!t.themeImport.present&&!t.nativeTokens?.present&&a.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!n&&t.themeImport.present&&a.push("Frontfriend tokens are present in CSS but are not adopted in config."),o&&r==="shadcn"&&!t.componentsJson&&a.push("Config adopts components, but components.json was not observed."),!o&&t.frontfriendComponents.length>0&&a.push("Frontfriend components are installed but are not adopted in config."),a}function oF({apiUrl:e,token:t,ffId:r,name:i,adopt:n,observed:o,framework:a,primitive:s}){if(!e||!t||!r||!i||!a||s===void 0)return Promise.resolve({reported:!1,unavailable:!0});let c=new URL("/api/apps/sync",e),u=JSON.stringify({ffId:r,name:i,adopt:ry(n),observed:o,runtime:"sdk",framework:a,primitive:s}),d=c.protocol==="https:"?G6:W6;return new Promise(f=>{let p=d.request(c,{method:"POST",headers:{authorization:`Bearer ${t}`,"content-type":"application/json","content-length":Buffer.byteLength(u)}},_=>{_.resume(),_.on("end",()=>{_.statusCode>=200&&_.statusCode<300?f({reported:!0,unavailable:!1}):f({reported:!1,unavailable:!0})})});p.on("error",()=>f({reported:!1,unavailable:!0})),p.setTimeout(1500,()=>{p.destroy(),f({reported:!1,unavailable:!0})}),p.end(u)})}dE.exports={ADOPTION_LEVELS:Md,normalizeAdopt:ry,probeAdoption:nF,adoptionWarnings:iF,reportAdoption:oF}});var xd=ee((b_e,pE)=>{var qu=require("path"),{parseStaticConfig:aF}=ey(),{findFileUpward:sF}=cE(),{fileExists:__e,readJsonFileSafe:fE,readFileSafe:cF}=rs(),{normalizeAdopt:uF}=Is();function ny(e,t){let r=qu.dirname(t),i={...e,ffId:e["ff-id"]||null,appRoot:r};if(!i.name){let n=fE(qu.join(r,"package.json"))?.name;n&&(i.name=n)}return e.adopt!==void 0&&(i.adopt=uF(e.adopt),i.adoptExplicit=!0),i}async function lF(e){return aF(cF(e)).config}var iy=class{findConfigFile(t=process.cwd()){return sF("frontfriend.config.js",t)}isESModule(t){try{let r=qu.join(t,"package.json"),i=fE(r);if(i)return i.type==="module"}catch{}return!1}async load({startDir:t=process.cwd(),strict:r=!1,fresh:i=!1}={}){let n=this.findConfigFile(t);if(n)try{if(i)return ny(await lF(n),n);let o,a=qu.dirname(n);if(n.endsWith(".js")&&this.isESModule(a)){let u=await import(`file://${n}`);o=u.default||u}else o=require(n);return ny(o,n)}catch(o){if(r||o.code==="FRONTFRIEND_CONFIG_VALIDATION")throw o;console.error("Error loading frontfriend.config.js:",o.message)}return{ffId:null,appRoot:t}}loadSync(){let t=this.findConfigFile();if(t)try{let r=qu.dirname(t);if(t.endsWith(".js")&&this.isESModule(r))console.error("Error: frontfriend.config.js is an ES module. Please use the async load() method");else{let n=require(t);return ny(n,t)}}catch(r){if(r.code==="FRONTFRIEND_CONFIG_VALIDATION")throw r;console.error("Error loading frontfriend.config.js:",r.message)}return{ffId:null,appRoot:process.cwd()}}};pE.exports=iy});var qd={};go(qd,{ProjectTargetError:()=>os,SUPPORTED_PROJECT_TARGETS:()=>mE,assertMatchingProjectTargets:()=>hE,defaultV4ProjectTarget:()=>fF,parseProjectTarget:()=>jn,projectTargetKey:()=>za,registryRoute:()=>mF,resolveProjectTarget:()=>pF});function za(e){return`${e.framework}/${e.primitive}`}function jn(e,t="Project target"){let r=e,i=typeof r?.framework=="string"?r.framework.trim().toLowerCase():"",n=typeof r?.primitive=="string"?r.primitive.trim().toLowerCase():"",o=`${i}/${n}`;if(!i||!n||!dF.has(o))throw new os("INVALID_PROJECT_TARGET",`${t} must be exactly one of react/radix, react/base, react/aria, or vue/reka; received ${o}.`,{framework:i||null,primitive:n||null});return{framework:i,primitive:n}}function fF(e="react"){return jn({framework:e,primitive:e==="vue"?"reka":"base"})}function hE(e){let t=Object.entries(e).filter(([,n])=>n!=null).map(([n,o])=>[n,jn(o,n)]);if(t.length===0)throw new os("PROJECT_TARGET_REQUIRED","A persisted or configured Project target is required.");let r=za(t[0][1]);if(t.find(([,n])=>za(n)!==r))throw new os("PROJECT_TARGET_MISMATCH",`Project target mismatch: ${t.map(([n,o])=>`${n}=${za(o)}`).join(", ")}.`,{targets:Object.fromEntries(t)});return t[0][1]}function pF({persisted:e,configured:t,app:r,release:i,lock:n,proposed:o}={}){let a={persisted:e,configured:t,app:r,release:i,lock:n};if(Object.values(a).some(s=>s!=null))return hE(a);if(o)return jn(o,"migration proposal");throw new os("PROJECT_TARGET_REQUIRED","A Project target is required; package detection may only propose one during migration.")}function mF(e,t){throw jn(e),String(t||"").trim(),new os("CURRENT_ROUTE_RETIRED","Components resolve only from an authenticated immutable Design System Release.")}var mE,dF,os,Cs=Ve(()=>{mE=Object.freeze([Object.freeze({framework:"react",primitive:"radix"}),Object.freeze({framework:"react",primitive:"base"}),Object.freeze({framework:"react",primitive:"aria"}),Object.freeze({framework:"vue",primitive:"reka"})]),dF=new Set(mE.map(e=>`${e.framework}/${e.primitive}`)),os=class extends Error{constructor(t,r,i={}){super(r),this.name="ProjectTargetError",this.code=t,Object.assign(this,i)}}});var wE=ee((S_e,SE)=>{var gE=require("fs"),yE=require("path"),{parseProjectTarget:hF,ProjectTargetError:gF}=(Cs(),ei(qd)),yF=[["radix",e=>e==="radix-ui"||e.startsWith("@radix-ui/")&&e!=="@radix-ui/react-slot"],["base",e=>e==="@base-ui-components/react"||e==="@base-ui/react"],["aria",e=>e==="react-aria-components"||e==="react-aria"],["reka",e=>e==="reka-ui"||e==="radix-vue"]];function vE(e){return JSON.parse(gE.readFileSync(e,"utf8"))}function _E(e){try{let t=vE(yE.join(e,"package.json"));return{...t.dependencies||{},...t.devDependencies||{}}}catch{return{}}}function bE(e){let t=_E(e);return t.vue||t["@vitejs/plugin-vue"]||t.nuxt?"vue":"react"}var Dd=e=>`${e.framework}/${e.primitive}`;function oy(e,t){try{return{status:"supported",target:hF(e),...t}}catch(r){if(!(r instanceof gF))throw r;return{status:"unsupported",detected:e,reason:r.message,...t}}}function vF(e,{persisted:t,declared:r,allowMissingComponents:i=!1}={}){let n=yE.join(e,"components.json"),o=gE.existsSync(n),a=_E(e),s=bE(e),c=t?.framework&&t?.primitive?t:r,u=c?.framework===s&&c?.primitive&&(s==="react"?a.react:a.vue||a.nuxt);if(!o&&!u&&!i)return{status:"not_shadcn",reason:"components.json was not found: this is not a shadcn application. Run `npx shadcn@latest init` (`npx shadcn-vue@latest init` for Vue) first, or run connect in the application directory."};let d;try{d=o?vE(n):{}}catch(w){return{status:i?"unsupported":"not_shadcn",reason:`components.json is not valid JSON (${w.message}).`}}let f=typeof d?.style=="string"?d.style:null,p=o?[`components.json${f?` (style ${f})`:""}`]:["Explicit Project target for a new application"],_=s==="vue"?["vue","@vitejs/plugin-vue","nuxt"].find(w=>a[w]):a.react?"react":null;_&&p.push(`package.json: ${_}`);let h=new Map;for(let[w,$]of yF){let m=Object.keys(a).sort().find($);m&&h.set(w,`package.json: ${m}`)}let y=f&&/^(radix|base|aria|reka)-/.exec(f)?.[1];y&&!h.has(y)&&h.set(y,`components.json: style ${f}`),p.push(...h.values());let v={components_json:o?"components.json":null,evidence:p};if(t?.framework&&t?.primitive)return oy({framework:t.framework,primitive:t.primitive},v);if(h.size>1)return{status:"conflict",reason:`Evidence for several primitives (${[...h.keys()].join(", ")}): a project uses one Project target. Remove the unused primitive, then run connect again.`,...v};let g=h.size===1?{framework:[...h.keys()][0]==="reka"?"vue":s,primitive:[...h.keys()][0]}:null;if(r?.framework||r?.primitive){let w={framework:r.framework||s,primitive:r.primitive||g?.primitive};return w.primitive?g&&Dd(g)!==Dd(w)?{status:"conflict",reason:`The declared target ${Dd(w)} conflicts with the project, which shows ${Dd(g)}.`,...v}:oy(w,v):{status:"undetermined",reason:"The primitive cannot be determined. Pass --primitive with --framework.",...v}}return g?oy(g,v):{status:"undetermined",reason:"components.json exists, but no primitive package is installed yet, so the primitive cannot be determined. Pass --primitive: radix, base or aria for React, reka for Vue.",...v}}SE.exports={detectShadcnProject:vF,detectProjectFramework:bE}});var Ud=ee((w_e,PE)=>{var{parseStaticConfig:ay,propertyName:Ld}=ey(),{fileExists:$E,readFileSafe:sy,writeTextFile:cy,readJsonFileSafe:_F}=rs(),bc=require("path"),{normalizeAdopt:RE}=Is(),{parseProjectTarget:bF}=(Cs(),ei(qd));function EE(e){try{return _F(e)??{}}catch{return{}}}function SF(e){return EE(bc.join(e,"package.json")).name||bc.basename(e)}function wF(e={}){let t={...e};return delete t.ffId,delete t.appRoot,delete t.adoptExplicit,delete t["auth-token"],delete t.authToken,t}function $F(e,t,{ffId:r,name:i,adopt:n,framework:o,primitive:a,apiUrl:s,baseLibrary:c,tag:u}){let d=bF({framework:o,primitive:a},"Setup Project target"),f=wF(t),p={name:i.trim(),"ff-id":r.trim(),adopt:RE(n),framework:d.framework,primitive:d.primitive};if(u!==void 0){if(typeof u!="string"||!u.trim())throw new Error("Release tag must not be empty.");p.tag=u.trim()}if(c!==void 0){if(!["frontfriend","shadcn"].includes(c))throw new Error("Base library must be frontfriend or shadcn.");p.baseLibrary=c}s&&(p["api-url"]=String(s).replace(/\/+$/,""),delete f.apiUrl);for(let[y,v]of Object.entries(f))y in p||(p[y]=v);let _=bc.join(e,"frontfriend.config.js"),h;if($E(_)){let y=sy(_),{expression:v}=ay(y),g=new Set(["name","ff-id","adopt","framework","primitive",...u!==void 0?["tag","releaseTagId"]:[],...s?["api-url","apiUrl"]:[],...c!==void 0?["baseLibrary"]:[]]),w=new Set(["auth-token","authToken","ffId","appRoot","adoptExplicit"]),$=v.properties.filter(O=>!g.has(Ld(O))&&!w.has(Ld(O))).map(O=>y.slice(O.start,O.end));h=[...Object.entries(p).filter(([O])=>g.has(O)).map(([O,P])=>`${JSON.stringify(O)}: ${JSON.stringify(P)}`),...$]}else h=Object.entries(p).map(([y,v])=>`${JSON.stringify(y)}: ${JSON.stringify(v)}`);return cy(_,uy(e,h)),p}function uy(e,t){let r=`{
18
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return we(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),l){var k=this.pos-1;this.invalidStringToken(k,"Invalid escape sequence in template string")}default:if(R>=48&&R<=55){var q=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],J=parseInt(q,8);return J>255&&(q=q.slice(0,-1),J=parseInt(q,8)),this.pos+=q.length-1,R=this.input.charCodeAt(this.pos),(q!=="0"||R===56||R===57)&&(this.strict||l)&&this.invalidStringToken(this.pos-1-q.length,l?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(J)}return E(R)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(R)}},tt.readHexChar=function(l){var R=this.pos,k=this.readInt(16,l);return k===null&&this.invalidStringToken(R,"Bad character escape sequence"),k},tt.readWord1=function(){this.containsEsc=!1;for(var l="",R=!0,k=this.pos,q=this.options.ecmaVersion>=6;this.pos<this.input.length;){var J=this.fullCharCodeAtPos();if(_(J,q))this.pos+=J<=65535?1:2;else if(J===92){this.containsEsc=!0,l+=this.input.slice(k,this.pos);var ae=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var le=this.readCodePoint();(R?p:_)(le,q)||this.invalidStringToken(ae,"Invalid Unicode escape"),l+=we(le),k=this.pos}else break;R=!1}return l+this.input.slice(k,this.pos)},tt.readWord=function(){var l=this.readWord1(),R=m.name;return this.keywords.test(l)&&(R=w[l]),this.finishToken(R,l)};var dt="8.17.0";lt.acorn={Parser:lt,version:dt,defaultOptions:C,Position:j,SourceLocation:U,getLineInfo:B,Node:sn,TokenType:h,tokTypes:m,keywordTypes:w,TokContext:cr,tokContexts:Rt,isIdentifierChar:_,isIdentifierStart:p,Token:Gr,isNewLine:E,lineBreak:O,lineBreakG:P,nonASCIIwhitespace:D};function ln(l,R){return lt.parse(l,R)}function Nt(l,R,k){return lt.parseExpressionAt(l,R,k)}function Cu(l,R){return lt.tokenizer(l,R)}e.Node=sn,e.Parser=lt,e.Position=j,e.SourceLocation=U,e.TokContext=cr,e.Token=Gr,e.TokenType=h,e.defaultOptions=C,e.getLineInfo=B,e.isIdentifierChar=_,e.isIdentifierStart=p,e.isNewLine=E,e.keywordTypes=w,e.lineBreak=O,e.lineBreakG=P,e.nonASCIIwhitespace=D,e.parse=ln,e.parseExpressionAt=Nt,e.tokContexts=Rt,e.tokTypes=m,e.tokenizer=Cu,e.version=dt})});var ey=ee((m_e,oE)=>{var{parse:z6}=rE();function _c(){let e=new Error("Configuration reads require a data-only object export. Remove executable statements from frontfriend.config.js.");return e.code="FRONTFRIEND_CONFIG_VALIDATION",e}function iE(e){if(e.type!=="Property"||e.computed||e.method||e.kind!=="init")throw _c();let t=e.key.type==="Identifier"?e.key.name:e.key.value;if(typeof t!="string"||["__proto__","constructor","prototype"].includes(t))throw _c();return t}function nE(e){if(e.type==="ExportDefaultDeclaration")return e.declaration;let t=e.type==="ExpressionStatement"?e.expression:null;return t?.type==="AssignmentExpression"&&t.operator==="="&&t.left.type==="MemberExpression"&&!t.left.computed&&t.left.object.name==="module"&&t.left.property.name==="exports"?t.right:null}function V6(e,t){if(e.type!=="VariableDeclaration"||e.declarations.length!==1)return null;let[r]=e.declarations;return r.id.type!=="Identifier"||t?.type!=="Identifier"||t.name!==r.id.name?null:r.init}function F6(e){let r=z6(e,{ecmaVersion:"latest",sourceType:"module"}).body.filter(o=>o.type!=="EmptyStatement"&&!o.directive),i=r.length===1?nE(r[0]):r.length===2?V6(r[0],nE(r[1])):null;if(i?.type!=="ObjectExpression")throw _c();function n(o,a=0){if(a>64)throw _c();if(o.type==="Literal"&&(o.value===null||["string","number","boolean"].includes(typeof o.value)))return o.value;if(o.type==="ArrayExpression")return o.elements.map(s=>{if(!s)throw _c();return n(s,a+1)});if(o.type==="ObjectExpression")return Object.fromEntries(o.properties.map(s=>[iE(s),n(s.value,a+1)]));if(o.type==="UnaryExpression"&&["-","+"].includes(o.operator)&&o.argument.type==="Literal"&&typeof o.argument.value=="number")return o.operator==="-"?-o.argument.value:o.argument.value;if(o.type==="TemplateLiteral"&&o.expressions.length===0)return o.quasis[0].value.cooked;if(o.type==="MemberExpression"&&!o.computed&&o.object.type==="MemberExpression"&&!o.object.computed&&o.object.object.name==="process"&&o.object.property.name==="env")return process.env[o.property.name];if(o.type==="LogicalExpression"&&["||","??"].includes(o.operator)){let s=n(o.left,a+1);return o.operator==="||"?s||n(o.right,a+1):s??n(o.right,a+1)}throw _c()}return{config:n(i),expression:i}}oE.exports={parseStaticConfig:F6,propertyName:iE}});var cE=ee((h_e,sE)=>{var bo=require("path"),{fileExists:ty}=rs();function aE(e,t=process.cwd()){let r=t;for(;r!==bo.parse(r).root;){let i=bo.join(r,e);if(ty(i))return i;r=bo.dirname(r)}return null}function J6(e,t=process.cwd(),r=null){let i=[],n=t,o=10;for(let a=0;a<o;a++){i.push(bo.join(n,e)),a<3&&i.push(bo.join(n,"../".repeat(a+1)+e));let s=bo.dirname(n);if(s===n)break;n=s}i.push(bo.join(__dirname,"../../../",e));for(let a of i)if(ty(a)&&(!r||r(a)))return a;return null}function Z6(e,t=process.cwd()){let r=e.map(i=>bo.isAbsolute(i)?i:bo.join(t,i));for(let i of r)if(ty(i))return i;return null}function H6(e=process.cwd()){let t=aE("frontfriend.config.js",e);return t?bo.dirname(t):e}sE.exports={findFileUpward:aE,findDirectoryUpward:J6,findDirectoryWithPaths:Z6,resolveProjectRoot:H6}});var Os=ee((g_e,B6)=>{B6.exports={name:"@frontfriend/sdk",version:"1.2.8"}});var xu=ee((y_e,uE)=>{var{name:K6}=Os();uE.exports={PACKAGE_NAME:K6}});var Is=ee((v_e,dE)=>{var{PACKAGE_NAME:Nd}=xu(),Ua=require("fs"),W6=require("http"),G6=require("https"),ti=require("path"),Md=["contracts","tokens","components"],Y6=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],X6={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},Q6=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],eF=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function lE(e){try{return JSON.parse(Ua.readFileSync(e,"utf8"))}catch{return{}}}function ry(e){if(e===void 0)return null;if(!Array.isArray(e)){let i=new Error("`adopt` in frontfriend.config.js must be an array.");throw i.code="FRONTFRIEND_CONFIG_VALIDATION",i}let t=e.filter(i=>!Md.includes(i));if(t.length>0){let i=new Error(`Unknown Frontfriend adoption level: ${t.join(", ")}.`);throw i.code="FRONTFRIEND_CONFIG_VALIDATION",i}let r=e.includes("components")?2:e.includes("tokens")?1:0;return Md.slice(0,r+1)}function tF(e){for(let[t,r]of Object.entries(X6)){let i=r.find(o=>Ua.existsSync(ti.join(e,o)));if(!i)continue;let n=Ua.readFileSync(ti.join(e,i),"utf8");return{buildTool:t,present:n.includes(`${Nd}/${t}`)}}return{buildTool:null,present:!1}}function rF(e){let t=[ti.join(e,"components","ui"),ti.join(e,"src","components","ui"),ti.join(e,"app","components","ui")].filter(n=>Ua.existsSync(n)),r=new Set;function i(n){for(let o of Ua.readdirSync(n,{withFileTypes:!0})){let a=ti.join(n,o.name);if(o.isDirectory())i(a);else if(/\.(js|jsx|ts|tsx|vue)$/.test(o.name)){if(!Ua.readFileSync(a,"utf8").includes(Nd))continue;let c=ti.basename(o.name,ti.extname(o.name));r.add(c.toLowerCase()==="index"?ti.basename(n):c.toLowerCase())}}}return t.forEach(i),[...r].sort()}function nF(e){let t=lE(ti.join(e,"package.json")),r={...t.dependencies||{},...t.devDependencies||{}},i=r.tailwindcss||null,o=[lE(ti.join(e,"components.json"))?.tailwind?.css,...Y6].filter(Boolean).find(c=>Ua.existsSync(ti.join(e,c))),a=o?Ua.readFileSync(ti.join(e,o),"utf8"):"",s=eF.filter(c=>r[c]);return!s.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(a)&&!a.includes(`${Nd}/theme.css`)&&s.push("css-custom-properties"),{nativeTokens:{present:a.includes("/* Frontfriend managed native tokens: start */"),file:o||null},tailwind:{present:!!i,version:i,major:i&&Number((String(i).match(/\d+/)||[])[0])||null},componentsJson:Ua.existsSync(ti.join(e,"components.json")),themeImport:{present:a.includes(`${Nd}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(a),file:o||null},plugin:tF(e),frontfriendComponents:rF(e),foreignComponentLibraries:Q6.filter(c=>r[c]),foreignTokenSystems:s}}function iF(e,t,{baseLibrary:r}={}){let i=ry(e)||Md,n=i.includes("tokens"),o=i.includes("components"),a=[];return n&&!t.themeImport.present&&!t.nativeTokens?.present&&a.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!n&&t.themeImport.present&&a.push("Frontfriend tokens are present in CSS but are not adopted in config."),o&&r==="shadcn"&&!t.componentsJson&&a.push("Config adopts components, but components.json was not observed."),!o&&t.frontfriendComponents.length>0&&a.push("Frontfriend components are installed but are not adopted in config."),a}function oF({apiUrl:e,token:t,ffId:r,name:i,adopt:n,observed:o,framework:a,primitive:s}){if(!e||!t||!r||!i||!a||s===void 0)return Promise.resolve({reported:!1,unavailable:!0});let c=new URL("/api/apps/sync",e),u=JSON.stringify({ffId:r,name:i,adopt:ry(n),observed:o,runtime:"sdk",framework:a,primitive:s}),d=c.protocol==="https:"?G6:W6;return new Promise(f=>{let p=d.request(c,{method:"POST",headers:{authorization:`Bearer ${t}`,"content-type":"application/json","content-length":Buffer.byteLength(u)}},_=>{_.resume(),_.on("end",()=>{_.statusCode>=200&&_.statusCode<300?f({reported:!0,unavailable:!1}):f({reported:!1,unavailable:!0})})});p.on("error",()=>f({reported:!1,unavailable:!0})),p.setTimeout(1500,()=>{p.destroy(),f({reported:!1,unavailable:!0})}),p.end(u)})}dE.exports={ADOPTION_LEVELS:Md,normalizeAdopt:ry,probeAdoption:nF,adoptionWarnings:iF,reportAdoption:oF}});var xd=ee((b_e,pE)=>{var qu=require("path"),{parseStaticConfig:aF}=ey(),{findFileUpward:sF}=cE(),{fileExists:__e,readJsonFileSafe:fE,readFileSafe:cF}=rs(),{normalizeAdopt:uF}=Is();function ny(e,t){let r=qu.dirname(t),i={...e,ffId:e["ff-id"]||null,appRoot:r};if(!i.name){let n=fE(qu.join(r,"package.json"))?.name;n&&(i.name=n)}return e.adopt!==void 0&&(i.adopt=uF(e.adopt),i.adoptExplicit=!0),i}async function lF(e){return aF(cF(e)).config}var iy=class{findConfigFile(t=process.cwd()){return sF("frontfriend.config.js",t)}isESModule(t){try{let r=qu.join(t,"package.json"),i=fE(r);if(i)return i.type==="module"}catch{}return!1}async load({startDir:t=process.cwd(),strict:r=!1,fresh:i=!1}={}){let n=this.findConfigFile(t);if(n)try{if(i)return ny(await lF(n),n);let o,a=qu.dirname(n);if(n.endsWith(".js")&&this.isESModule(a)){let u=await import(`file://${n}`);o=u.default||u}else o=require(n);return ny(o,n)}catch(o){if(r||o.code==="FRONTFRIEND_CONFIG_VALIDATION")throw o;console.error("Error loading frontfriend.config.js:",o.message)}return{ffId:null,appRoot:t}}loadSync(){let t=this.findConfigFile();if(t)try{let r=qu.dirname(t);if(t.endsWith(".js")&&this.isESModule(r))console.error("Error: frontfriend.config.js is an ES module. Please use the async load() method");else{let n=require(t);return ny(n,t)}}catch(r){if(r.code==="FRONTFRIEND_CONFIG_VALIDATION")throw r;console.error("Error loading frontfriend.config.js:",r.message)}return{ffId:null,appRoot:process.cwd()}}};pE.exports=iy});var qd={};go(qd,{ProjectTargetError:()=>os,SUPPORTED_PROJECT_TARGETS:()=>mE,assertMatchingProjectTargets:()=>hE,defaultV4ProjectTarget:()=>fF,parseProjectTarget:()=>jn,projectTargetKey:()=>za,registryRoute:()=>mF,resolveProjectTarget:()=>pF});function za(e){return`${e.framework}/${e.primitive}`}function jn(e,t="Project target"){let r=e,i=typeof r?.framework=="string"?r.framework.trim().toLowerCase():"",n=typeof r?.primitive=="string"?r.primitive.trim().toLowerCase():"",o=`${i}/${n}`;if(!i||!n||!dF.has(o))throw new os("INVALID_PROJECT_TARGET",`${t} must be exactly one of react/radix, react/base, react/aria, or vue/reka; received ${o}.`,{framework:i||null,primitive:n||null});return{framework:i,primitive:n}}function fF(e="react"){return jn({framework:e,primitive:e==="vue"?"reka":"base"})}function hE(e){let t=Object.entries(e).filter(([,n])=>n!=null).map(([n,o])=>[n,jn(o,n)]);if(t.length===0)throw new os("PROJECT_TARGET_REQUIRED","A persisted or configured Project target is required.");let r=za(t[0][1]);if(t.find(([,n])=>za(n)!==r))throw new os("PROJECT_TARGET_MISMATCH",`Project target mismatch: ${t.map(([n,o])=>`${n}=${za(o)}`).join(", ")}.`,{targets:Object.fromEntries(t)});return t[0][1]}function pF({persisted:e,configured:t,app:r,release:i,lock:n,proposed:o}={}){let a={persisted:e,configured:t,app:r,release:i,lock:n};if(Object.values(a).some(s=>s!=null))return hE(a);if(o)return jn(o,"migration proposal");throw new os("PROJECT_TARGET_REQUIRED","A Project target is required; package detection may only propose one during migration.")}function mF(e,t){throw jn(e),String(t||"").trim(),new os("CURRENT_ROUTE_RETIRED","Components resolve only from an authenticated immutable Design System Release.")}var mE,dF,os,Cs=Ve(()=>{mE=Object.freeze([Object.freeze({framework:"react",primitive:"radix"}),Object.freeze({framework:"react",primitive:"base"}),Object.freeze({framework:"react",primitive:"aria"}),Object.freeze({framework:"vue",primitive:"reka"})]),dF=new Set(mE.map(e=>`${e.framework}/${e.primitive}`)),os=class extends Error{constructor(t,r,i={}){super(r),this.name="ProjectTargetError",this.code=t,Object.assign(this,i)}}});var wE=ee((S_e,SE)=>{var gE=require("fs"),yE=require("path"),{parseProjectTarget:hF,ProjectTargetError:gF}=(Cs(),ei(qd)),yF=[["radix",e=>e==="radix-ui"||e.startsWith("@radix-ui/")&&e!=="@radix-ui/react-slot"],["base",e=>e==="@base-ui-components/react"||e==="@base-ui/react"],["aria",e=>e==="react-aria-components"||e==="react-aria"],["reka",e=>e==="reka-ui"||e==="radix-vue"]];function vE(e){return JSON.parse(gE.readFileSync(e,"utf8"))}function _E(e){try{let t=vE(yE.join(e,"package.json"));return{...t.dependencies||{},...t.devDependencies||{}}}catch{return{}}}function bE(e){let t=_E(e);return t.vue||t["@vitejs/plugin-vue"]||t.nuxt?"vue":"react"}var Dd=e=>`${e.framework}/${e.primitive}`;function oy(e,t){try{return{status:"supported",target:hF(e),...t}}catch(r){if(!(r instanceof gF))throw r;return{status:"unsupported",detected:e,reason:r.message,...t}}}function vF(e,{persisted:t,declared:r,allowMissingComponents:i=!1}={}){let n=yE.join(e,"components.json"),o=gE.existsSync(n),a=_E(e),s=bE(e),c=t?.framework&&t?.primitive?t:r,u=c?.framework===s&&c?.primitive&&(s==="react"?a.react:a.vue||a.nuxt);if(!o&&!u&&!i)return{status:"not_shadcn",reason:"components.json was not found: this is not a shadcn application. Run `npx shadcn@latest init` (`npx shadcn-vue@latest init` for Vue) first, or run connect in the application directory."};let d;try{d=o?vE(n):{}}catch(w){return{status:i?"unsupported":"not_shadcn",reason:`components.json is not valid JSON (${w.message}).`}}let f=typeof d?.style=="string"?d.style:null,p=o?[`components.json${f?` (style ${f})`:""}`]:["Explicit Project target for a new application"],_=s==="vue"?["vue","@vitejs/plugin-vue","nuxt"].find(w=>a[w]):a.react?"react":null;_&&p.push(`package.json: ${_}`);let h=new Map;for(let[w,$]of yF){let m=Object.keys(a).sort().find($);m&&h.set(w,`package.json: ${m}`)}let y=f&&/^(radix|base|aria|reka)-/.exec(f)?.[1];y&&!h.has(y)&&h.set(y,`components.json: style ${f}`),p.push(...h.values());let v={components_json:o?"components.json":null,evidence:p};if(t?.framework&&t?.primitive)return oy({framework:t.framework,primitive:t.primitive},v);if(h.size>1)return{status:"conflict",reason:`Evidence for several primitives (${[...h.keys()].join(", ")}): a project uses one Project target. Remove the unused primitive, then run connect again.`,...v};let g=h.size===1?{framework:[...h.keys()][0]==="reka"?"vue":s,primitive:[...h.keys()][0]}:null;if(r?.framework||r?.primitive){let w={framework:r.framework||s,primitive:r.primitive||g?.primitive};return w.primitive?g&&Dd(g)!==Dd(w)?{status:"conflict",reason:`The declared target ${Dd(w)} conflicts with the project, which shows ${Dd(g)}.`,...v}:oy(w,v):{status:"undetermined",reason:"The primitive cannot be determined. Pass --primitive with --framework.",...v}}return g?oy(g,v):{status:"undetermined",reason:"components.json exists, but no primitive package is installed yet, so the primitive cannot be determined. Pass --primitive: radix, base or aria for React, reka for Vue.",...v}}SE.exports={detectShadcnProject:vF,detectProjectFramework:bE}});var Ud=ee((w_e,PE)=>{var{parseStaticConfig:ay,propertyName:Ld}=ey(),{fileExists:$E,readFileSafe:sy,writeTextFile:cy,readJsonFileSafe:_F}=rs(),bc=require("path"),{normalizeAdopt:RE}=Is(),{parseProjectTarget:bF}=(Cs(),ei(qd));function EE(e){try{return _F(e)??{}}catch{return{}}}function SF(e){return EE(bc.join(e,"package.json")).name||bc.basename(e)}function wF(e={}){let t={...e};return delete t.ffId,delete t.appRoot,delete t.adoptExplicit,delete t["auth-token"],delete t.authToken,t}function $F(e,t,{ffId:r,name:i,adopt:n,framework:o,primitive:a,apiUrl:s,baseLibrary:c,tag:u}){let d=bF({framework:o,primitive:a},"Setup Project target"),f=wF(t),p={name:i.trim(),"ff-id":r.trim(),adopt:RE(n),framework:d.framework,primitive:d.primitive};if(u!==void 0){if(typeof u!="string"||!u.trim())throw new Error("Release tag must not be empty.");p.tag=u.trim()}if(c!==void 0){if(!["frontfriend","shadcn"].includes(c))throw new Error("Base library must be frontfriend or shadcn.");p.baseLibrary=c}s&&(p["api-url"]=String(s).replace(/\/+$/,""),delete f.apiUrl);for(let[y,v]of Object.entries(f))y in p||(p[y]=v);let _=bc.join(e,"frontfriend.config.js"),h;if($E(_)){let y=sy(_),{expression:v}=ay(y),g=new Set(["name","ff-id","adopt","framework","primitive",...u!==void 0?["tag","releaseTagId"]:[],...s?["api-url","apiUrl"]:[],...c!==void 0?["baseLibrary"]:[]]),w=new Set(["auth-token","authToken","ffId","appRoot","adoptExplicit"]),$=v.properties.filter(O=>!g.has(Ld(O))&&!w.has(Ld(O))).map(O=>y.slice(O.start,O.end));h=[...Object.entries(p).filter(([O])=>g.has(O)).map(([O,P])=>`${JSON.stringify(O)}: ${JSON.stringify(P)}`),...$]}else h=Object.entries(p).map(([y,v])=>`${JSON.stringify(y)}: ${JSON.stringify(v)}`);return cy(_,uy(e,h)),p}function uy(e,t){let r=`{
19
19
  ${t.join(`,
20
20
  `)}
21
21
  }`;return EE(bc.join(e,"package.json")).type==="module"?`const config = ${r};
package/dist/next.js CHANGED
@@ -1,4 +1,4 @@
1
- var w=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var gr=w((Lf,Oo)=>{Oo.exports={name:"@frontfriend/sdk",version:"1.2.6"}});var yr=w((Of,vr)=>{var{name:Vo}=gr();vr.exports={PACKAGE_NAME:Vo}});var Me=w((Vf,Er)=>{var Fo="https://app.frontfriend.dev",Do=".cache/frontfriend",$o={JS:["tokens.js","variables.js","semanticVariables.js","semanticDarkVariables.js","keyframes.js","animations.js","safelist.js","custom.js"],JSON:["fonts.json","icons.json","components-config.json","iconLibrary.json","version.json","versionMetadata.json","metadata.json","base.json","nativeTokens.json"]},qo={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function jo(r){if(!r)return null;try{let i=new URL(r);return i.hostname.startsWith("app.")?`${i.protocol}//${i.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}Er.exports={DEFAULT_API_URL:Fo,CACHE_DIR_NAME:Do,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:$o,ENV_VARS:qo,deriveRegistryFromApiUrl:jo}});var Sr=w((Ff,br)=>{var qt=class extends Error{constructor(i,n,o){super(i),this.name="APIError",this.statusCode=n,this.url=o,this.code=`API_${n}`}},jt=class extends Error{constructor(i,n){super(i),this.name="CacheError",this.operation=n,this.code=`CACHE_${n.toUpperCase()}`}},Bt=class extends Error{constructor(i,n){super(i),this.name="ConfigError",this.field=n,this.code=n?`CONFIG_${String(n).toUpperCase()}`:"CONFIG_ERROR"}},Ut=class extends Error{constructor(i,n){super(i),this.name="ProcessingError",this.token=n,this.code="PROCESSING_ERROR"}};br.exports={APIError:qt,CacheError:jt,ConfigError:Bt,ProcessingError:Ut}});var Ge=w((Df,wr)=>{var j=require("fs");function Bo(r){try{let i=j.readFileSync(r,"utf8");return JSON.parse(i)}catch(i){if(i.code==="ENOENT")return null;throw i}}function Uo(r){try{return j.readFileSync(r,"utf8").replace(/^\uFEFF/,"")}catch(i){if(i.code==="ENOENT")return null;throw i}}function Mo(r,i,n=2){let o=JSON.stringify(i,null,n);j.writeFileSync(r,o,"utf8")}function Go(r,i){j.writeFileSync(r,i,"utf8")}function Ho(r,i){if(i==null||typeof i=="object"&&Object.keys(i).length===0||Array.isArray(i)&&i.length===0){let o=`module.exports = ${Array.isArray(i)?"[]":"{}"};`;j.writeFileSync(r,o,"utf8")}else{let n=`module.exports = ${JSON.stringify(i,null,2)};`;j.writeFileSync(r,n,"utf8")}}function Wo(r){return j.existsSync(r)}function Xo(r){j.mkdirSync(r,{recursive:!0})}function zo(r){j.rmSync(r,{recursive:!0,force:!0})}function Ko(r){j.rmSync(r,{force:!0})}function Yo(r,i){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let n=`${r}.${process.pid}.${Date.now()}.tmp`;try{j.writeFileSync(n,`${JSON.stringify(i,null,2)}
1
+ var w=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var gr=w((Lf,Oo)=>{Oo.exports={name:"@frontfriend/sdk",version:"1.2.8"}});var yr=w((Of,vr)=>{var{name:Vo}=gr();vr.exports={PACKAGE_NAME:Vo}});var Me=w((Vf,Er)=>{var Fo="https://app.frontfriend.dev",Do=".cache/frontfriend",$o={JS:["tokens.js","variables.js","semanticVariables.js","semanticDarkVariables.js","keyframes.js","animations.js","safelist.js","custom.js"],JSON:["fonts.json","icons.json","components-config.json","iconLibrary.json","version.json","versionMetadata.json","metadata.json","base.json","nativeTokens.json"]},qo={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function jo(r){if(!r)return null;try{let i=new URL(r);return i.hostname.startsWith("app.")?`${i.protocol}//${i.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}Er.exports={DEFAULT_API_URL:Fo,CACHE_DIR_NAME:Do,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:$o,ENV_VARS:qo,deriveRegistryFromApiUrl:jo}});var Sr=w((Ff,br)=>{var qt=class extends Error{constructor(i,n,o){super(i),this.name="APIError",this.statusCode=n,this.url=o,this.code=`API_${n}`}},jt=class extends Error{constructor(i,n){super(i),this.name="CacheError",this.operation=n,this.code=`CACHE_${n.toUpperCase()}`}},Bt=class extends Error{constructor(i,n){super(i),this.name="ConfigError",this.field=n,this.code=n?`CONFIG_${String(n).toUpperCase()}`:"CONFIG_ERROR"}},Ut=class extends Error{constructor(i,n){super(i),this.name="ProcessingError",this.token=n,this.code="PROCESSING_ERROR"}};br.exports={APIError:qt,CacheError:jt,ConfigError:Bt,ProcessingError:Ut}});var Ge=w((Df,wr)=>{var j=require("fs");function Bo(r){try{let i=j.readFileSync(r,"utf8");return JSON.parse(i)}catch(i){if(i.code==="ENOENT")return null;throw i}}function Uo(r){try{return j.readFileSync(r,"utf8").replace(/^\uFEFF/,"")}catch(i){if(i.code==="ENOENT")return null;throw i}}function Mo(r,i,n=2){let o=JSON.stringify(i,null,n);j.writeFileSync(r,o,"utf8")}function Go(r,i){j.writeFileSync(r,i,"utf8")}function Ho(r,i){if(i==null||typeof i=="object"&&Object.keys(i).length===0||Array.isArray(i)&&i.length===0){let o=`module.exports = ${Array.isArray(i)?"[]":"{}"};`;j.writeFileSync(r,o,"utf8")}else{let n=`module.exports = ${JSON.stringify(i,null,2)};`;j.writeFileSync(r,n,"utf8")}}function Wo(r){return j.existsSync(r)}function Xo(r){j.mkdirSync(r,{recursive:!0})}function zo(r){j.rmSync(r,{recursive:!0,force:!0})}function Ko(r){j.rmSync(r,{force:!0})}function Yo(r,i){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let n=`${r}.${process.pid}.${Date.now()}.tmp`;try{j.writeFileSync(n,`${JSON.stringify(i,null,2)}
2
2
  `,{mode:384}),j.renameSync(n,r);try{j.chmodSync(r,384)}catch{}}finally{j.rmSync(n,{force:!0})}}async function Jo(r,i,n){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let o=`${r}.lock`,l=Date.now()+2e4,h;for(;h===void 0;)try{h=j.openSync(o,"wx",384),j.writeFileSync(h,String(process.pid))}catch(f){if(f.code!=="EEXIST")throw f;try{let m=Number(j.readFileSync(o,"utf8"));if(Number.isInteger(m)&&m>0)try{process.kill(m,0)}catch(y){if(y.code==="ESRCH"){j.unlinkSync(o);continue}}}catch(m){if(m.code==="ENOENT")continue}if(Date.now()>=l)throw n();await new Promise(m=>setTimeout(m,50))}try{return await i()}finally{j.closeSync(h),j.unlinkSync(o)}}wr.exports={writePrivateJsonFileAtomic:Yo,withPrivateFileLock:Jo,readJsonFileSafe:Bo,readFileSafe:Uo,writeJsonFile:Mo,writeTextFile:Go,writeModuleExportsFile:Ho,fileExists:Wo,ensureDirectoryExists:Xo,removeDirectory:zo,removeFile:Ko}});var _r=w(($f,Cr)=>{var Qo="classes.txt",Zo="classes.css";Cr.exports={CLASSES_SOURCE_FILE:Qo,CSS_CLASSES_SOURCE_FILE:Zo}});var Pr=w((qf,Rr)=>{var Q=require("path"),{CACHE_DIR_NAME:eu,CACHE_TTL_MS:tu,CACHE_FILES:Ir}=Me(),{CacheError:Mt}=Sr(),{readJsonFileSafe:ut,readFileSafe:iu,writeJsonFile:kr,writeTextFile:Ar,writeModuleExportsFile:Nr,fileExists:Gt,ensureDirectoryExists:ru,removeDirectory:su,removeFile:nu}=Ge(),{CLASSES_SOURCE_FILE:au,CSS_CLASSES_SOURCE_FILE:ou}=_r(),Ht=class r{constructor(i=process.cwd()){this.appRoot=i,this.cacheDir=Q.join(i,"node_modules",eu),this.metadataFile=Q.join(this.cacheDir,"metadata.json"),this.maxAge=tu}getCacheDir(){return this.cacheDir}isLocalOnly(){return ut(this.metadataFile)?.version==="local-components"}getIconLibrary(){let i=Q.join(this.cacheDir,"iconLibrary.json");return Gt(i)?ut(i):null}exists(){return Gt(this.cacheDir)}isValid(){if(!this.exists())return!1;try{let i=ut(this.metadataFile);if(!i)return!1;let n=new Date(i.timestamp).getTime();return Date.now()-n<this.maxAge}catch{return!1}}load(){if(!this.exists())return null;try{let i={};for(let n of Ir.JS){let o=Q.join(this.cacheDir,n);if(Gt(o)){let l=n.replace(".js","");try{let h=iu(o);if(h!==null){let f={},m={exports:f};new Function("module","exports",h)(m,f),i[l]=m.exports}}catch(h){console.warn(`[Frontfriend] Failed to load ${n}: ${h.message}`),(h.message.includes("Unexpected token")||h.message.includes("Invalid character"))&&console.warn("[Frontfriend] This might be a BOM or encoding issue. Try deleting node_modules/.cache/frontfriend and running `npx frontfriend init` again.")}}}for(let n of Ir.JSON){let o=Q.join(this.cacheDir,n),l=n.replace(".json",""),h=ut(o);h!==null&&(i[l]=h)}return i["components-config"]&&(i.componentsConfig=i["components-config"],delete i["components-config"]),i.cls&&!i.safelist&&(i.safelist=i.cls,delete i.cls),i}catch(i){throw new Mt(`Failed to load cache: ${i.message}`,"read")}}save(i){try{ru(this.cacheDir);let n={timestamp:new Date().toISOString(),version:i.metadata?.version||"2.0.0",ffId:i.metadata?.ffId},o=["tokens","variables","semanticVariables","semanticDarkVariables","keyframes","animations","safelist","custom"];for(let h of o)if(i[h]!==void 0){let f=Q.join(this.cacheDir,`${h}.js`);Nr(f,i[h])}if(i.safelist&&Array.isArray(i.safelist)){let h=Q.join(this.cacheDir,"safelist.js");Nr(h,i.safelist)}let l={fonts:i.fonts,icons:i.icons||i.iconSet,"components-config":i.componentsConfig,iconLibrary:i.iconLibrary,version:i.version,versionMetadata:i.versionMetadata,base:i.base,nativeTokens:i.nativeTokens};for(let[h,f]of Object.entries(l))if(f!==void 0){let m=Q.join(this.cacheDir,`${h}.json`);kr(m,f)}i.themeCSS!==void 0&&Ar(Q.join(this.cacheDir,"theme.css"),i.themeCSS),i.classesContent!==void 0&&(Ar(Q.join(this.cacheDir,au),i.classesContent),nu(Q.join(this.cacheDir,ou))),kr(this.metadataFile,n)}catch(n){throw new Mt(`Failed to save cache: ${n.message}`,"write")}}saveAtomic(i,n=()=>{}){let o=require("node:fs"),{randomUUID:l}=require("node:crypto");o.mkdirSync(Q.dirname(this.cacheDir),{recursive:!0});let h=`${this.cacheDir}.write-lock`,f;try{f=o.openSync(h,"wx")}catch(x){if(x.code!=="EEXIST")throw x;let I=Number(o.readFileSync(h,"utf8")),g=!0;if(I>0)try{process.kill(I,0)}catch(S){g=S.code!=="ESRCH"}if(g)throw new Mt("Another process is installing tokens. Retry after it completes.","write");o.unlinkSync(h),f=o.openSync(h,"wx")}let m=`${this.cacheDir}.previous`,y=`${this.cacheDir}.${l()}.pending`;try{o.writeFileSync(f,String(process.pid)),!o.existsSync(this.cacheDir)&&o.existsSync(m)&&o.renameSync(m,this.cacheDir);let x=new r(this.appRoot);x.cacheDir=y,x.metadataFile=Q.join(y,"metadata.json"),x.save(i),o.existsSync(m)&&o.rmSync(m,{recursive:!0}),o.existsSync(this.cacheDir)&&o.renameSync(this.cacheDir,m);try{o.renameSync(y,this.cacheDir),n()}catch(I){throw o.rmSync(this.cacheDir,{recursive:!0,force:!0}),o.existsSync(m)&&o.renameSync(m,this.cacheDir),I}o.rmSync(m,{recursive:!0,force:!0})}finally{o.rmSync(y,{recursive:!0,force:!0}),o.closeSync(f),o.rmSync(h,{force:!0})}}clear(){this.exists()&&su(this.cacheDir)}};Rr.exports=Ht});var Vr=w((jf,Or)=>{function pe(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Wt(r,i){if(!pe(r)||!pe(i))return i===void 0?r:i;let n={...r};for(let[o,l]of Object.entries(i))n[o]=o in n?Wt(n[o],l):l;return n}function Xt(r,i,n=[],o=[]){if(r===void 0||i===void 0)return o;if(!pe(r)||!pe(i))return o.push(n.join(".")),o;for(let l of Object.keys(r))l in i&&Xt(r[l],i[l],[...n,l],o);return o}function Tr(r){return pe(r)&&("styles"in r||"behavior"in r)}function Lr(r,i="component"){if(!Tr(r)||!pe(r.styles)||r.behavior!==void 0&&!pe(r.behavior)||Object.keys(r).some(o=>!["styles","behavior"].includes(o)))throw new TypeError(`Component ${i} must use the styles/behavior envelope`);let n=Xt(r.styles,r.behavior,[i]);if(n.length>0)throw new Error(`Component config styles/behavior conflict at ${n.join(", ")}`);return Wt(r.styles||{},r.behavior||{})}function uu(r){if(!pe(r))return r;let i=!1,n={};for(let[o,l]of Object.entries(r))n[o]=Lr(l,o),n[o]!==l&&(i=!0);return i?n:r}Or.exports={isPlainObject:pe,deepMerge:Wt,findTreeConflicts:Xt,isComponentEnvelope:Tr,toRuntimeComponentConfig:Lr,toRuntimeComponentsConfig:uu}});var jr=w((Bf,qr)=>{qr.exports=$r;$r.sync=hu;var Fr=require("fs");function cu(r,i){var n=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var o=0;o<n.length;o++){var l=n[o].toLowerCase();if(l&&r.substr(-l.length).toLowerCase()===l)return!0}return!1}function Dr(r,i,n){return!r.isSymbolicLink()&&!r.isFile()?!1:cu(i,n)}function $r(r,i,n){Fr.stat(r,function(o,l){n(o,o?!1:Dr(l,r,i))})}function hu(r,i){return Dr(Fr.statSync(r),r,i)}});var Hr=w((Uf,Gr)=>{Gr.exports=Ur;Ur.sync=lu;var Br=require("fs");function Ur(r,i,n){Br.stat(r,function(o,l){n(o,o?!1:Mr(l,i))})}function lu(r,i){return Mr(Br.statSync(r),i)}function Mr(r,i){return r.isFile()&&fu(r,i)}function fu(r,i){var n=r.mode,o=r.uid,l=r.gid,h=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),f=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),m=parseInt("100",8),y=parseInt("010",8),x=parseInt("001",8),I=m|y,g=n&x||n&y&&l===f||n&m&&o===h||n&I&&h===0;return g}});var Xr=w((Gf,Wr)=>{var Mf=require("fs"),ct;process.platform==="win32"||global.TESTING_WINDOWS?ct=jr():ct=Hr();Wr.exports=zt;zt.sync=pu;function zt(r,i,n){if(typeof i=="function"&&(n=i,i={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,l){zt(r,i||{},function(h,f){h?l(h):o(f)})})}ct(r,i||{},function(o,l){o&&(o.code==="EACCES"||i&&i.ignoreErrors)&&(o=null,l=!1),n(o,l)})}function pu(r,i){try{return ct.sync(r,i||{})}catch(n){if(i&&i.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var es=w((Hf,Zr)=>{var Re=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",zr=require("path"),du=Re?";":":",Kr=Xr(),Yr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),Jr=(r,i)=>{let n=i.colon||du,o=r.match(/\//)||Re&&r.match(/\\/)?[""]:[...Re?[process.cwd()]:[],...(i.path||process.env.PATH||"").split(n)],l=Re?i.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",h=Re?l.split(n):[""];return Re&&r.indexOf(".")!==-1&&h[0]!==""&&h.unshift(""),{pathEnv:o,pathExt:h,pathExtExe:l}},Qr=(r,i,n)=>{typeof i=="function"&&(n=i,i={}),i||(i={});let{pathEnv:o,pathExt:l,pathExtExe:h}=Jr(r,i),f=[],m=x=>new Promise((I,g)=>{if(x===o.length)return i.all&&f.length?I(f):g(Yr(r));let S=o[x],E=/^".*"$/.test(S)?S.slice(1,-1):S,N=zr.join(E,r),B=!E&&/^\.[\\\/]/.test(r)?r.slice(0,2)+N:N;I(y(B,x,0))}),y=(x,I,g)=>new Promise((S,E)=>{if(g===l.length)return S(m(I+1));let N=l[g];Kr(x+N,{pathExt:h},(B,Y)=>{if(!B&&Y)if(i.all)f.push(x+N);else return S(x+N);return S(y(x,I,g+1))})});return n?m(0).then(x=>n(null,x),n):m(0)},mu=(r,i)=>{i=i||{};let{pathEnv:n,pathExt:o,pathExtExe:l}=Jr(r,i),h=[];for(let f=0;f<n.length;f++){let m=n[f],y=/^".*"$/.test(m)?m.slice(1,-1):m,x=zr.join(y,r),I=!y&&/^\.[\\\/]/.test(r)?r.slice(0,2)+x:x;for(let g=0;g<o.length;g++){let S=I+o[g];try{if(Kr.sync(S,{pathExt:l}))if(i.all)h.push(S);else return S}catch{}}}if(i.all&&h.length)return h;if(i.nothrow)return null;throw Yr(r)};Zr.exports=Qr;Qr.sync=mu});var is=w((Wf,Kt)=>{"use strict";var ts=(r={})=>{let i=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(i).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};Kt.exports=ts;Kt.exports.default=ts});var as=w((Xf,ns)=>{"use strict";var rs=require("path"),xu=es(),gu=is();function ss(r,i){let n=r.options.env||process.env,o=process.cwd(),l=r.options.cwd!=null,h=l&&process.chdir!==void 0&&!process.chdir.disabled;if(h)try{process.chdir(r.options.cwd)}catch{}let f;try{f=xu.sync(r.command,{path:n[gu({env:n})],pathExt:i?rs.delimiter:void 0})}catch{}finally{h&&process.chdir(o)}return f&&(f=rs.resolve(l?r.options.cwd:"",f)),f}function vu(r){return ss(r)||ss(r,!0)}ns.exports=vu});var os=w((zf,Jt)=>{"use strict";var Yt=/([()\][%!^"`<>&|;, *?])/g;function yu(r){return r=r.replace(Yt,"^$1"),r}function Eu(r,i){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(Yt,"^$1"),i&&(r=r.replace(Yt,"^$1")),r}Jt.exports.command=yu;Jt.exports.argument=Eu});var cs=w((Kf,us)=>{"use strict";us.exports=/^#!(.*)/});var ls=w((Yf,hs)=>{"use strict";var bu=cs();hs.exports=(r="")=>{let i=r.match(bu);if(!i)return null;let[n,o]=i[0].replace(/#! ?/,"").split(" "),l=n.split("/").pop();return l==="env"?o:o?`${l} ${o}`:l}});var ps=w((Jf,fs)=>{"use strict";var Qt=require("fs"),Su=ls();function wu(r){let n=Buffer.alloc(150),o;try{o=Qt.openSync(r,"r"),Qt.readSync(o,n,0,150,0),Qt.closeSync(o)}catch{}return Su(n.toString())}fs.exports=wu});var gs=w((Qf,xs)=>{"use strict";var Cu=require("path"),ds=as(),ms=os(),_u=ps(),Iu=process.platform==="win32",ku=/\.(?:com|exe)$/i,Au=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Nu(r){r.file=ds(r);let i=r.file&&_u(r.file);return i?(r.args.unshift(r.file),r.command=i,ds(r)):r.file}function Ru(r){if(!Iu)return r;let i=Nu(r),n=!ku.test(i);if(r.options.forceShell||n){let o=Au.test(i);r.command=Cu.normalize(r.command),r.command=ms.command(r.command),r.args=r.args.map(h=>ms.argument(h,o));let l=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${l}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function Pu(r,i,n){i&&!Array.isArray(i)&&(n=i,i=null),i=i?i.slice(0):[],n=Object.assign({},n);let o={command:r,args:i,options:n,file:void 0,original:{command:r,args:i}};return n.shell?o:Ru(o)}xs.exports=Pu});var Es=w((Zf,ys)=>{"use strict";var Zt=process.platform==="win32";function ei(r,i){return Object.assign(new Error(`${i} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${i} ${r.command}`,path:r.command,spawnargs:r.args})}function Tu(r,i){if(!Zt)return;let n=r.emit;r.emit=function(o,l){if(o==="exit"){let h=vs(l,i);if(h)return n.call(r,"error",h)}return n.apply(r,arguments)}}function vs(r,i){return Zt&&r===1&&!i.file?ei(i.original,"spawn"):null}function Lu(r,i){return Zt&&r===1&&!i.file?ei(i.original,"spawnSync"):null}ys.exports={hookChildProcess:Tu,verifyENOENT:vs,verifyENOENTSync:Lu,notFoundError:ei}});var ws=w((ep,Pe)=>{"use strict";var bs=require("child_process"),ti=gs(),ii=Es();function Ss(r,i,n){let o=ti(r,i,n),l=bs.spawn(o.command,o.args,o.options);return ii.hookChildProcess(l,o),l}function Ou(r,i,n){let o=ti(r,i,n),l=bs.spawnSync(o.command,o.args,o.options);return l.error=l.error||ii.verifyENOENTSync(l.status,o),l}Pe.exports=Ss;Pe.exports.spawn=Ss;Pe.exports.sync=Ou;Pe.exports._parse=ti;Pe.exports._enoent=ii});var Te=w((tp,Cs)=>{"use strict";var Vu="2.0.0",Fu=Number.MAX_SAFE_INTEGER||9007199254740991,Du=16,$u=250,qu=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Cs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Du,MAX_SAFE_BUILD_LENGTH:$u,MAX_SAFE_INTEGER:Fu,RELEASE_TYPES:qu,SEMVER_SPEC_VERSION:Vu,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var He=w((ip,_s)=>{"use strict";var ju=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};_s.exports=ju});var Le=w((ue,Is)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ri,MAX_SAFE_BUILD_LENGTH:Bu,MAX_LENGTH:Uu}=Te(),Mu=He();ue=Is.exports={};var Gu=ue.re=[],Hu=ue.safeRe=[],C=ue.src=[],Wu=ue.safeSrc=[],_=ue.t={},Xu=0,si="[a-zA-Z0-9-]",zu=[["\\s",1],["\\d",Uu],[si,Bu]],Ku=r=>{for(let[i,n]of zu)r=r.split(`${i}*`).join(`${i}{0,${n}}`).split(`${i}+`).join(`${i}{1,${n}}`);return r},T=(r,i,n)=>{let o=Ku(i),l=Xu++;Mu(r,l,i),_[r]=l,C[l]=i,Wu[l]=o,Gu[l]=new RegExp(i,n?"g":void 0),Hu[l]=new RegExp(o,n?"g":void 0)};T("NUMERICIDENTIFIER","0|[1-9]\\d*");T("NUMERICIDENTIFIERLOOSE","\\d+");T("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${si}*`);T("MAINVERSION",`(${C[_.NUMERICIDENTIFIER]})\\.(${C[_.NUMERICIDENTIFIER]})\\.(${C[_.NUMERICIDENTIFIER]})`);T("MAINVERSIONLOOSE",`(${C[_.NUMERICIDENTIFIERLOOSE]})\\.(${C[_.NUMERICIDENTIFIERLOOSE]})\\.(${C[_.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASEIDENTIFIER",`(?:${C[_.NONNUMERICIDENTIFIER]}|${C[_.NUMERICIDENTIFIER]})`);T("PRERELEASEIDENTIFIERLOOSE",`(?:${C[_.NONNUMERICIDENTIFIER]}|${C[_.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASE",`(?:-(${C[_.PRERELEASEIDENTIFIER]}(?:\\.${C[_.PRERELEASEIDENTIFIER]})*))`);T("PRERELEASELOOSE",`(?:-?(${C[_.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[_.PRERELEASEIDENTIFIERLOOSE]})*))`);T("BUILDIDENTIFIER",`${si}+`);T("BUILD",`(?:\\+(${C[_.BUILDIDENTIFIER]}(?:\\.${C[_.BUILDIDENTIFIER]})*))`);T("FULLPLAIN",`v?${C[_.MAINVERSION]}${C[_.PRERELEASE]}?${C[_.BUILD]}?`);T("FULL",`^${C[_.FULLPLAIN]}$`);T("LOOSEPLAIN",`[v=\\s]*${C[_.MAINVERSIONLOOSE]}${C[_.PRERELEASELOOSE]}?${C[_.BUILD]}?`);T("LOOSE",`^${C[_.LOOSEPLAIN]}$`);T("GTLT","((?:<|>)?=?)");T("XRANGEIDENTIFIERLOOSE",`${C[_.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);T("XRANGEIDENTIFIER",`${C[_.NUMERICIDENTIFIER]}|x|X|\\*`);T("XRANGEPLAIN",`[v=\\s]*(${C[_.XRANGEIDENTIFIER]})(?:\\.(${C[_.XRANGEIDENTIFIER]})(?:\\.(${C[_.XRANGEIDENTIFIER]})(?:${C[_.PRERELEASE]})?${C[_.BUILD]}?)?)?`);T("XRANGEPLAINLOOSE",`[v=\\s]*(${C[_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[_.XRANGEIDENTIFIERLOOSE]})(?:${C[_.PRERELEASELOOSE]})?${C[_.BUILD]}?)?)?`);T("XRANGE",`^${C[_.GTLT]}\\s*${C[_.XRANGEPLAIN]}$`);T("XRANGELOOSE",`^${C[_.GTLT]}\\s*${C[_.XRANGEPLAINLOOSE]}$`);T("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ri}})(?:\\.(\\d{1,${ri}}))?(?:\\.(\\d{1,${ri}}))?`);T("COERCE",`${C[_.COERCEPLAIN]}(?:$|[^\\d])`);T("COERCEFULL",C[_.COERCEPLAIN]+`(?:${C[_.PRERELEASE]})?(?:${C[_.BUILD]})?(?:$|[^\\d])`);T("COERCERTL",C[_.COERCE],!0);T("COERCERTLFULL",C[_.COERCEFULL],!0);T("LONETILDE","(?:~>?)");T("TILDETRIM",`(\\s*)${C[_.LONETILDE]}\\s+`,!0);ue.tildeTrimReplace="$1~";T("TILDE",`^${C[_.LONETILDE]}${C[_.XRANGEPLAIN]}$`);T("TILDELOOSE",`^${C[_.LONETILDE]}${C[_.XRANGEPLAINLOOSE]}$`);T("LONECARET","(?:\\^)");T("CARETTRIM",`(\\s*)${C[_.LONECARET]}\\s+`,!0);ue.caretTrimReplace="$1^";T("CARET",`^${C[_.LONECARET]}${C[_.XRANGEPLAIN]}$`);T("CARETLOOSE",`^${C[_.LONECARET]}${C[_.XRANGEPLAINLOOSE]}$`);T("COMPARATORLOOSE",`^${C[_.GTLT]}\\s*(${C[_.LOOSEPLAIN]})$|^$`);T("COMPARATOR",`^${C[_.GTLT]}\\s*(${C[_.FULLPLAIN]})$|^$`);T("COMPARATORTRIM",`(\\s*)${C[_.GTLT]}\\s*(${C[_.LOOSEPLAIN]}|${C[_.XRANGEPLAIN]})`,!0);ue.comparatorTrimReplace="$1$2$3";T("HYPHENRANGE",`^\\s*(${C[_.XRANGEPLAIN]})\\s+-\\s+(${C[_.XRANGEPLAIN]})\\s*$`);T("HYPHENRANGELOOSE",`^\\s*(${C[_.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[_.XRANGEPLAINLOOSE]})\\s*$`);T("STAR","(<|>)?=?\\s*\\*");T("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");T("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ht=w((rp,ks)=>{"use strict";var Yu=Object.freeze({loose:!0}),Ju=Object.freeze({}),Qu=r=>r?typeof r!="object"?Yu:r:Ju;ks.exports=Qu});var ni=w((sp,Rs)=>{"use strict";var As=/^[0-9]+$/,Ns=(r,i)=>{if(typeof r=="number"&&typeof i=="number")return r===i?0:r<i?-1:1;let n=As.test(r),o=As.test(i);return n&&o&&(r=+r,i=+i),r===i?0:n&&!o?-1:o&&!n?1:r<i?-1:1},Zu=(r,i)=>Ns(i,r);Rs.exports={compareIdentifiers:Ns,rcompareIdentifiers:Zu}});var G=w((np,Ts)=>{"use strict";var lt=He(),{MAX_LENGTH:Ps,MAX_SAFE_INTEGER:ft}=Te(),{safeRe:pt,t:dt}=Le(),ec=ht(),{compareIdentifiers:ai}=ni(),tc=(r,i)=>{let n=i.split(".");if(n.length>r.length)return!1;for(let o=0;o<n.length;o++)if(ai(r[o],n[o])!==0)return!1;return!0},oi=class r{constructor(i,n){if(n=ec(n),i instanceof r){if(i.loose===!!n.loose&&i.includePrerelease===!!n.includePrerelease)return i;i=i.version}else if(typeof i!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof i}".`);if(i.length>Ps)throw new TypeError(`version is longer than ${Ps} characters`);lt("SemVer",i,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let o=i.trim().match(n.loose?pt[dt.LOOSE]:pt[dt.FULL]);if(!o)throw new TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>ft||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ft||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ft||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(l=>{if(/^[0-9]+$/.test(l)){let h=+l;if(h>=0&&h<ft)return h}return l}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(i){if(lt("SemVer.compare",this.version,this.options,i),!(i instanceof r)){if(typeof i=="string"&&i===this.version)return 0;i=new r(i,this.options)}return i.version===this.version?0:this.compareMain(i)||this.comparePre(i)}compareMain(i){return i instanceof r||(i=new r(i,this.options)),this.major<i.major?-1:this.major>i.major?1:this.minor<i.minor?-1:this.minor>i.minor?1:this.patch<i.patch?-1:this.patch>i.patch?1:0}comparePre(i){if(i instanceof r||(i=new r(i,this.options)),this.prerelease.length&&!i.prerelease.length)return-1;if(!this.prerelease.length&&i.prerelease.length)return 1;if(!this.prerelease.length&&!i.prerelease.length)return 0;let n=0;do{let o=this.prerelease[n],l=i.prerelease[n];if(lt("prerelease compare",n,o,l),o===void 0&&l===void 0)return 0;if(l===void 0)return 1;if(o===void 0)return-1;if(o===l)continue;return ai(o,l)}while(++n)}compareBuild(i){i instanceof r||(i=new r(i,this.options));let n=0;do{let o=this.build[n],l=i.build[n];if(lt("build compare",n,o,l),o===void 0&&l===void 0)return 0;if(l===void 0)return 1;if(o===void 0)return-1;if(o===l)continue;return ai(o,l)}while(++n)}inc(i,n,o){if(i.startsWith("pre")){if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let l=`-${n}`.match(this.options.loose?pt[dt.PRERELEASELOOSE]:pt[dt.PRERELEASE]);if(!l||l[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(i){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let l=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[l];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(l)}}if(n){let h=[n,l];if(o===!1&&(h=[n]),tc(this.prerelease,n)){let f=this.prerelease[n.split(".").length];isNaN(f)&&(this.prerelease=h)}else this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${i}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Ts.exports=oi});var ge=w((ap,Os)=>{"use strict";var Ls=G(),ic=(r,i,n=!1)=>{if(r instanceof Ls)return r;try{return new Ls(r,i)}catch(o){if(!n)return null;throw o}};Os.exports=ic});var Fs=w((op,Vs)=>{"use strict";var rc=ge(),sc=(r,i)=>{let n=rc(r,i);return n?n.version:null};Vs.exports=sc});var $s=w((up,Ds)=>{"use strict";var nc=ge(),ac=(r,i)=>{let n=nc(r.trim().replace(/^[=v]+/,""),i);return n?n.version:null};Ds.exports=ac});var Bs=w((cp,js)=>{"use strict";var qs=G(),oc=(r,i,n,o,l)=>{typeof n=="string"&&(l=o,o=n,n=void 0);try{return new qs(r instanceof qs?r.version:r,n).inc(i,o,l).version}catch{return null}};js.exports=oc});var Gs=w((hp,Ms)=>{"use strict";var Us=ge(),uc=(r,i)=>{let n=Us(r,null,!0),o=Us(i,null,!0),l=n.compare(o);if(l===0)return null;let h=l>0,f=h?n:o,m=h?o:n,y=!!f.prerelease.length;if(!!m.prerelease.length&&!y){if(!m.patch&&!m.minor)return"major";if(m.compareMain(f)===0)return m.minor&&!m.patch?"minor":"patch"}let I=y?"pre":"";return n.major!==o.major?I+"major":n.minor!==o.minor?I+"minor":n.patch!==o.patch?I+"patch":"prerelease"};Ms.exports=uc});var Ws=w((lp,Hs)=>{"use strict";var cc=G(),hc=(r,i)=>new cc(r,i).major;Hs.exports=hc});var zs=w((fp,Xs)=>{"use strict";var lc=G(),fc=(r,i)=>new lc(r,i).minor;Xs.exports=fc});var Ys=w((pp,Ks)=>{"use strict";var pc=G(),dc=(r,i)=>new pc(r,i).patch;Ks.exports=dc});var Qs=w((dp,Js)=>{"use strict";var mc=ge(),xc=(r,i)=>{let n=mc(r,i);return n&&n.prerelease.length?n.prerelease:null};Js.exports=xc});var re=w((mp,en)=>{"use strict";var Zs=G(),gc=(r,i,n)=>new Zs(r,n).compare(new Zs(i,n));en.exports=gc});var rn=w((xp,tn)=>{"use strict";var vc=re(),yc=(r,i,n)=>vc(i,r,n);tn.exports=yc});var nn=w((gp,sn)=>{"use strict";var Ec=re(),bc=(r,i)=>Ec(r,i,!0);sn.exports=bc});var mt=w((vp,on)=>{"use strict";var an=G(),Sc=(r,i,n)=>{let o=new an(r,n),l=new an(i,n);return o.compare(l)||o.compareBuild(l)};on.exports=Sc});var cn=w((yp,un)=>{"use strict";var wc=mt(),Cc=(r,i)=>r.sort((n,o)=>wc(n,o,i));un.exports=Cc});var ln=w((Ep,hn)=>{"use strict";var _c=mt(),Ic=(r,i)=>r.sort((n,o)=>_c(o,n,i));hn.exports=Ic});var We=w((bp,fn)=>{"use strict";var kc=re(),Ac=(r,i,n)=>kc(r,i,n)>0;fn.exports=Ac});var xt=w((Sp,pn)=>{"use strict";var Nc=re(),Rc=(r,i,n)=>Nc(r,i,n)<0;pn.exports=Rc});var ui=w((wp,dn)=>{"use strict";var Pc=re(),Tc=(r,i,n)=>Pc(r,i,n)===0;dn.exports=Tc});var ci=w((Cp,mn)=>{"use strict";var Lc=re(),Oc=(r,i,n)=>Lc(r,i,n)!==0;mn.exports=Oc});var gt=w((_p,xn)=>{"use strict";var Vc=re(),Fc=(r,i,n)=>Vc(r,i,n)>=0;xn.exports=Fc});var vt=w((Ip,gn)=>{"use strict";var Dc=re(),$c=(r,i,n)=>Dc(r,i,n)<=0;gn.exports=$c});var hi=w((kp,vn)=>{"use strict";var qc=ui(),jc=ci(),Bc=We(),Uc=gt(),Mc=xt(),Gc=vt(),Hc=(r,i,n,o)=>{switch(i){case"===":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r===n;case"!==":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r!==n;case"":case"=":case"==":return qc(r,n,o);case"!=":return jc(r,n,o);case">":return Bc(r,n,o);case">=":return Uc(r,n,o);case"<":return Mc(r,n,o);case"<=":return Gc(r,n,o);default:throw new TypeError(`Invalid operator: ${i}`)}};vn.exports=Hc});var En=w((Ap,yn)=>{"use strict";var Wc=G(),Xc=ge(),{safeRe:yt,t:Et}=Le(),zc=(r,i)=>{if(r instanceof Wc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;i=i||{};let n=null;if(!i.rtl)n=r.match(i.includePrerelease?yt[Et.COERCEFULL]:yt[Et.COERCE]);else{let y=i.includePrerelease?yt[Et.COERCERTLFULL]:yt[Et.COERCERTL],x;for(;(x=y.exec(r))&&(!n||n.index+n[0].length!==r.length);)(!n||x.index+x[0].length!==n.index+n[0].length)&&(n=x),y.lastIndex=x.index+x[1].length+x[2].length;y.lastIndex=-1}if(n===null)return null;let o=n[2],l=n[3]||"0",h=n[4]||"0",f=i.includePrerelease&&n[5]?`-${n[5]}`:"",m=i.includePrerelease&&n[6]?`+${n[6]}`:"";return Xc(`${o}.${l}.${h}${f}${m}`,i)};yn.exports=zc});var Sn=w((Np,bn)=>{"use strict";var Kc=ge(),Yc=Te(),Jc=G(),Qc=(r,i,n)=>{if(!Yc.RELEASE_TYPES.includes(i))return null;let o=Zc(r,n);return o&&eh(o,i)},Zc=(r,i)=>{let n=r instanceof Jc?r.version:r;return Kc(n,i)},eh=(r,i)=>{if(th(i))return r.version;switch(r.prerelease=[],i){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},th=r=>r.startsWith("pre");bn.exports=Qc});var Cn=w((Rp,wn)=>{"use strict";var li=class{constructor(){this.max=1e3,this.map=new Map}get(i){let n=this.map.get(i);if(n!==void 0)return this.map.delete(i),this.map.set(i,n),n}delete(i){return this.map.delete(i)}set(i,n){if(!this.delete(i)&&n!==void 0){if(this.map.size>=this.max){let l=this.map.keys().next().value;this.delete(l)}this.map.set(i,n)}return this}};wn.exports=li});var se=w((Pp,An)=>{"use strict";var ih=/\s+/g,fi=class r{constructor(i,n){if(n=sh(n),i instanceof r)return i.loose===!!n.loose&&i.includePrerelease===!!n.includePrerelease?i:new r(i.raw,n);if(i instanceof pi)return this.raw=i.value,this.set=[[i]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=i.trim().replace(ih," "),this.set=this.raw.split("||").map(o=>this.parseRange(o.trim())).filter(o=>o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let o=this.set[0];if(this.set=this.set.filter(l=>!In(l[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let l of this.set)if(l.length===1&&ph(l[0])){this.set=[l];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let i=0;i<this.set.length;i++){i>0&&(this.formatted+="||");let n=this.set[i];for(let o=0;o<n.length;o++)o>0&&(this.formatted+=" "),this.formatted+=n[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(i){i=i.replace(fh,"");let o=((this.options.includePrerelease&&hh)|(this.options.loose&&lh))+":"+i,l=_n.get(o);if(l)return l;let h=this.options.loose,f=h?K[H.HYPHENRANGELOOSE]:K[H.HYPHENRANGE];i=i.replace(f,Ch(this.options.includePrerelease)),$("hyphen replace",i),i=i.replace(K[H.COMPARATORTRIM],oh),$("comparator trim",i),i=i.replace(K[H.TILDETRIM],uh),$("tilde trim",i),i=i.replace(K[H.CARETTRIM],ch),$("caret trim",i);let m=i.split(" ").map(g=>dh(g,this.options)).join(" ").split(/\s+/).map(g=>wh(g,this.options));h&&(m=m.filter(g=>($("loose invalid filter",g,this.options),!!g.match(K[H.COMPARATORLOOSE])))),$("range list",m);let y=new Map,x=m.map(g=>new pi(g,this.options));for(let g of x){if(In(g))return[g];y.set(g.value,g)}y.size>1&&y.has("")&&y.delete("");let I=[...y.values()];return _n.set(o,I),I}intersects(i,n){if(!(i instanceof r))throw new TypeError("a Range is required");return this.set.some(o=>kn(o,n)&&i.set.some(l=>kn(l,n)&&o.every(h=>l.every(f=>h.intersects(f,n)))))}test(i){if(!i)return!1;if(typeof i=="string")try{i=new nh(i,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(_h(this.set[n],i,this.options))return!0;return!1}};An.exports=fi;var rh=Cn(),_n=new rh,sh=ht(),pi=Xe(),$=He(),nh=G(),{safeRe:K,src:ah,t:H,comparatorTrimReplace:oh,tildeTrimReplace:uh,caretTrimReplace:ch}=Le(),{FLAG_INCLUDE_PRERELEASE:hh,FLAG_LOOSE:lh}=Te(),fh=new RegExp(ah[H.BUILD],"g"),In=r=>r.value==="<0.0.0-0",ph=r=>r.value==="",kn=(r,i)=>{let n=!0,o=r.slice(),l=o.pop();for(;n&&o.length;)n=o.every(h=>l.intersects(h,i)),l=o.pop();return n},dh=(r,i)=>(r=r.replace(K[H.BUILD],""),$("comp",r,i),r=vh(r,i),$("caret",r),r=xh(r,i),$("tildes",r),r=Eh(r,i),$("xrange",r),r=Sh(r,i),$("stars",r),r),U=r=>!r||r.toLowerCase()==="x"||r==="*",mh=(r,i,n)=>U(r)&&!U(i)||U(i)&&n&&!U(n),xh=(r,i)=>r.trim().split(/\s+/).map(n=>gh(n,i)).join(" "),gh=(r,i)=>{let n=i.loose?K[H.TILDELOOSE]:K[H.TILDE],o=i.includePrerelease?"-0":"";return r.replace(n,(l,h,f,m,y)=>{$("tilde",r,l,h,f,m,y);let x;return U(h)?x="":U(f)?x=`>=${h}.0.0${o} <${+h+1}.0.0-0`:U(m)?x=`>=${h}.${f}.0${o} <${h}.${+f+1}.0-0`:y?($("replaceTilde pr",y),x=`>=${h}.${f}.${m}-${y} <${h}.${+f+1}.0-0`):x=`>=${h}.${f}.${m} <${h}.${+f+1}.0-0`,$("tilde return",x),x})},vh=(r,i)=>r.trim().split(/\s+/).map(n=>yh(n,i)).join(" "),yh=(r,i)=>{$("caret",r,i);let n=i.loose?K[H.CARETLOOSE]:K[H.CARET],o=i.includePrerelease?"-0":"";return r.replace(n,(l,h,f,m,y)=>{$("caret",r,l,h,f,m,y);let x;return U(h)?x="":U(f)?x=`>=${h}.0.0${o} <${+h+1}.0.0-0`:U(m)?h==="0"?x=`>=${h}.${f}.0${o} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.0${o} <${+h+1}.0.0-0`:y?($("replaceCaret pr",y),h==="0"?f==="0"?x=`>=${h}.${f}.${m}-${y} <${h}.${f}.${+m+1}-0`:x=`>=${h}.${f}.${m}-${y} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.${m}-${y} <${+h+1}.0.0-0`):($("no pr"),h==="0"?f==="0"?x=`>=${h}.${f}.${m} <${h}.${f}.${+m+1}-0`:x=`>=${h}.${f}.${m} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.${m} <${+h+1}.0.0-0`),$("caret return",x),x})},Eh=(r,i)=>($("replaceXRanges",r,i),r.split(/\s+/).map(n=>bh(n,i)).join(" ")),bh=(r,i)=>{r=r.trim();let n=i.loose?K[H.XRANGELOOSE]:K[H.XRANGE];return r.replace(n,(o,l,h,f,m,y)=>{if($("xRange",r,o,l,h,f,m,y),mh(h,f,m))return r;let x=U(h),I=x||U(f),g=I||U(m),S=g;return l==="="&&S&&(l=""),y=i.includePrerelease?"-0":"",x?l===">"||l==="<"?o="<0.0.0-0":o="*":l&&S?(I&&(f=0),m=0,l===">"?(l=">=",I?(h=+h+1,f=0,m=0):(f=+f+1,m=0)):l==="<="&&(l="<",I?h=+h+1:f=+f+1),l==="<"&&(y="-0"),o=`${l+h}.${f}.${m}${y}`):I?o=`>=${h}.0.0${y} <${+h+1}.0.0-0`:g&&(o=`>=${h}.${f}.0${y} <${h}.${+f+1}.0-0`),$("xRange return",o),o})},Sh=(r,i)=>($("replaceStars",r,i),r.trim().replace(K[H.STAR],"")),wh=(r,i)=>($("replaceGTE0",r,i),r.trim().replace(K[i.includePrerelease?H.GTE0PRE:H.GTE0],"")),Ch=r=>(i,n,o,l,h,f,m,y,x,I,g,S)=>(U(o)?n="":U(l)?n=`>=${o}.0.0${r?"-0":""}`:U(h)?n=`>=${o}.${l}.0${r?"-0":""}`:f?n=`>=${n}`:n=`>=${n}${r?"-0":""}`,U(x)?y="":U(I)?y=`<${+x+1}.0.0-0`:U(g)?y=`<${x}.${+I+1}.0-0`:S?y=`<=${x}.${I}.${g}-${S}`:r?y=`<${x}.${I}.${+g+1}-0`:y=`<=${y}`,`${n} ${y}`.trim()),_h=(r,i,n)=>{for(let o=0;o<r.length;o++)if(!r[o].test(i))return!1;if(i.prerelease.length&&!n.includePrerelease){for(let o=0;o<r.length;o++)if($(r[o].semver),r[o].semver!==pi.ANY&&r[o].semver.prerelease.length>0){let l=r[o].semver;if(l.major===i.major&&l.minor===i.minor&&l.patch===i.patch)return!0}return!1}return!0}});var Xe=w((Tp,On)=>{"use strict";var ze=Symbol("SemVer ANY"),xi=class r{static get ANY(){return ze}constructor(i,n){if(n=Nn(n),i instanceof r){if(i.loose===!!n.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),mi("comparator",i,n),this.options=n,this.loose=!!n.loose,this.parse(i),this.semver===ze?this.value="":this.value=this.operator+this.semver.version,mi("comp",this)}parse(i){let n=this.options.loose?Rn[Pn.COMPARATORLOOSE]:Rn[Pn.COMPARATOR],o=i.match(n);if(!o)throw new TypeError(`Invalid comparator: ${i}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new Tn(o[2],this.options.loose):this.semver=ze}toString(){return this.value}test(i){if(mi("Comparator.test",i,this.options.loose),this.semver===ze||i===ze)return!0;if(typeof i=="string")try{i=new Tn(i,this.options)}catch{return!1}return di(i,this.operator,this.semver,this.options)}intersects(i,n){if(!(i instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Ln(i.value,n).test(this.value):i.operator===""?i.value===""?!0:new Ln(this.value,n).test(i.semver):(n=Nn(n),n.includePrerelease&&(this.value==="<0.0.0-0"||i.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||i.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&i.operator.startsWith(">")||this.operator.startsWith("<")&&i.operator.startsWith("<")||this.semver.version===i.semver.version&&this.operator.includes("=")&&i.operator.includes("=")||di(this.semver,"<",i.semver,n)&&this.operator.startsWith(">")&&i.operator.startsWith("<")||di(this.semver,">",i.semver,n)&&this.operator.startsWith("<")&&i.operator.startsWith(">")))}};On.exports=xi;var Nn=ht(),{safeRe:Rn,t:Pn}=Le(),di=hi(),mi=He(),Tn=G(),Ln=se()});var Ke=w((Lp,Vn)=>{"use strict";var Ih=se(),kh=(r,i,n)=>{try{i=new Ih(i,n)}catch{return!1}return i.test(r)};Vn.exports=kh});var Dn=w((Op,Fn)=>{"use strict";var Ah=se(),Nh=(r,i)=>new Ah(r,i).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));Fn.exports=Nh});var qn=w((Vp,$n)=>{"use strict";var Rh=G(),Ph=se(),Th=(r,i,n)=>{let o=null,l=null,h=null;try{h=new Ph(i,n)}catch{return null}return r.forEach(f=>{h.test(f)&&(!o||l.compare(f)===-1)&&(o=f,l=new Rh(o,n))}),o};$n.exports=Th});var Bn=w((Fp,jn)=>{"use strict";var Lh=G(),Oh=se(),Vh=(r,i,n)=>{let o=null,l=null,h=null;try{h=new Oh(i,n)}catch{return null}return r.forEach(f=>{h.test(f)&&(!o||l.compare(f)===1)&&(o=f,l=new Lh(o,n))}),o};jn.exports=Vh});var Gn=w((Dp,Mn)=>{"use strict";var gi=G(),Fh=se(),Un=We(),Dh=(r,i)=>{r=new Fh(r,i);let n=new gi("0.0.0");if(r.test(n)||(n=new gi("0.0.0-0"),r.test(n)))return n;n=null;for(let o=0;o<r.set.length;++o){let l=r.set[o],h=null;l.forEach(f=>{let m=new gi(f.semver.version);switch(f.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!h||Un(m,h))&&(h=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${f.operator}`)}}),h&&(!n||Un(n,h))&&(n=h)}return n&&r.test(n)?n:null};Mn.exports=Dh});var Wn=w(($p,Hn)=>{"use strict";var $h=se(),qh=(r,i)=>{try{return new $h(r,i).range||"*"}catch{return null}};Hn.exports=qh});var bt=w((qp,Yn)=>{"use strict";var jh=G(),Kn=Xe(),{ANY:Bh}=Kn,Uh=se(),Mh=Ke(),Xn=We(),zn=xt(),Gh=vt(),Hh=gt(),Wh=(r,i,n,o)=>{r=new jh(r,o),i=new Uh(i,o);let l,h,f,m,y;switch(n){case">":l=Xn,h=Gh,f=zn,m=">",y=">=";break;case"<":l=zn,h=Hh,f=Xn,m="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mh(r,i,o))return!1;for(let x=0;x<i.set.length;++x){let I=i.set[x],g=null,S=null;if(I.forEach(E=>{E.semver===Bh&&(E=new Kn(">=0.0.0")),g=g||E,S=S||E,l(E.semver,g.semver,o)?g=E:f(E.semver,S.semver,o)&&(S=E)}),g.operator===m||g.operator===y||(!S.operator||S.operator===m)&&h(r,S.semver))return!1;if(S.operator===y&&f(r,S.semver))return!1}return!0};Yn.exports=Wh});var Qn=w((jp,Jn)=>{"use strict";var Xh=bt(),zh=(r,i,n)=>Xh(r,i,">",n);Jn.exports=zh});var ea=w((Bp,Zn)=>{"use strict";var Kh=bt(),Yh=(r,i,n)=>Kh(r,i,"<",n);Zn.exports=Yh});var ra=w((Up,ia)=>{"use strict";var ta=se(),Jh=(r,i,n)=>(r=new ta(r,n),i=new ta(i,n),r.intersects(i,n));ia.exports=Jh});var na=w((Mp,sa)=>{"use strict";var Qh=Ke(),Zh=re();sa.exports=(r,i,n)=>{let o=[],l=null,h=null,f=r.sort((I,g)=>Zh(I,g,n));for(let I of f)Qh(I,i,n)?(h=I,l||(l=I)):(h&&o.push([l,h]),h=null,l=null);l&&o.push([l,null]);let m=[];for(let[I,g]of o)I===g?m.push(I):!g&&I===f[0]?m.push("*"):g?I===f[0]?m.push(`<=${g}`):m.push(`${I} - ${g}`):m.push(`>=${I}`);let y=m.join(" || "),x=typeof i.raw=="string"?i.raw:String(i);return y.length<x.length?y:i}});var la=w((Gp,ha)=>{"use strict";var aa=se(),Ei=Xe(),{ANY:vi}=Ei,yi=Ke(),bi=re(),el=(r,i,n={})=>{if(r===i)return!0;r=new aa(r,n),i=new aa(i,n);let o=!1;e:for(let l of r.set){for(let h of i.set){let f=il(l,h,n);if(o=o||f!==null,f)continue e}if(o)return!1}return!0},tl=[new Ei(">=0.0.0-0")],oa=[new Ei(">=0.0.0")],il=(r,i,n)=>{if(r===i)return!0;if(r.length===1&&r[0].semver===vi){if(i.length===1&&i[0].semver===vi)return!0;n.includePrerelease?r=tl:r=oa}if(i.length===1&&i[0].semver===vi){if(n.includePrerelease)return!0;i=oa}let o=new Set,l,h;for(let E of r)E.operator===">"||E.operator===">="?l=ua(l,E,n):E.operator==="<"||E.operator==="<="?h=ca(h,E,n):o.add(E.semver);if(o.size>1)return null;let f;if(l&&h){if(f=bi(l.semver,h.semver,n),f>0)return null;if(f===0&&(l.operator!==">="||h.operator!=="<="))return null}for(let E of o){if(l&&!yi(E,String(l),n)||h&&!yi(E,String(h),n))return null;for(let N of i)if(!yi(E,String(N),n))return!1;return!0}let m,y,x,I,g=h&&!n.includePrerelease&&h.semver.prerelease.length?h.semver:!1,S=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1;g&&g.prerelease.length===1&&h.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(let E of i){if(I=I||E.operator===">"||E.operator===">=",x=x||E.operator==="<"||E.operator==="<=",l){if(S&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===S.major&&E.semver.minor===S.minor&&E.semver.patch===S.patch&&(S=!1),E.operator===">"||E.operator===">="){if(m=ua(l,E,n),m===E&&m!==l)return!1}else if(l.operator===">="&&!E.test(l.semver))return!1}if(h){if(g&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===g.major&&E.semver.minor===g.minor&&E.semver.patch===g.patch&&(g=!1),E.operator==="<"||E.operator==="<="){if(y=ca(h,E,n),y===E&&y!==h)return!1}else if(h.operator==="<="&&!E.test(h.semver))return!1}if(!E.operator&&(h||l)&&f!==0)return!1}return!(l&&x&&!h&&f!==0||h&&I&&!l&&f!==0||S||g)},ua=(r,i,n)=>{if(!r)return i;let o=bi(r.semver,i.semver,n);return o>0?r:o<0||i.operator===">"&&r.operator===">="?i:r},ca=(r,i,n)=>{if(!r)return i;let o=bi(r.semver,i.semver,n);return o<0?r:o>0||i.operator==="<"&&r.operator==="<="?i:r};ha.exports=el});var ma=w((Hp,da)=>{"use strict";var Si=Le(),fa=Te(),rl=G(),pa=ni(),sl=ge(),nl=Fs(),al=$s(),ol=Bs(),ul=Gs(),cl=Ws(),hl=zs(),ll=Ys(),fl=Qs(),pl=re(),dl=rn(),ml=nn(),xl=mt(),gl=cn(),vl=ln(),yl=We(),El=xt(),bl=ui(),Sl=ci(),wl=gt(),Cl=vt(),_l=hi(),Il=En(),kl=Sn(),Al=Xe(),Nl=se(),Rl=Ke(),Pl=Dn(),Tl=qn(),Ll=Bn(),Ol=Gn(),Vl=Wn(),Fl=bt(),Dl=Qn(),$l=ea(),ql=ra(),jl=na(),Bl=la();da.exports={parse:sl,valid:nl,clean:al,inc:ol,diff:ul,major:cl,minor:hl,patch:ll,prerelease:fl,compare:pl,rcompare:dl,compareLoose:ml,compareBuild:xl,sort:gl,rsort:vl,gt:yl,lt:El,eq:bl,neq:Sl,gte:wl,lte:Cl,cmp:_l,coerce:Il,truncate:kl,Comparator:Al,Range:Nl,satisfies:Rl,toComparators:Pl,maxSatisfying:Tl,minSatisfying:Ll,minVersion:Ol,validRange:Vl,outside:Fl,gtr:Dl,ltr:$l,intersects:ql,simplifyRange:jl,subset:Bl,SemVer:rl,re:Si.re,src:Si.src,tokens:Si.t,SEMVER_SPEC_VERSION:fa.SEMVER_SPEC_VERSION,RELEASE_TYPES:fa.RELEASE_TYPES,compareIdentifiers:pa.compareIdentifiers,rcompareIdentifiers:pa.rcompareIdentifiers}});var Ii=w((Wp,Ia)=>{var ve=require("fs"),ne=require("path"),ga=ws(),ae=ma(),{DEFAULT_API_URL:Ul}=Me(),va=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function wi(r){let i=typeof r=="string"&&r.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!i)throw new Error(`Invalid npm dependency: ${String(r)}`);return{name:i[1],version:i[2]}}function Ci(r){let i=new Map;for(let n of r){let{name:o,version:l}=wi(n),h=i.get(o);i.set(o,h&&l?ya(o,h,l):l||h)}return i}function ya(r,i,n){if(i===n)return i;let o=ae.validRange(i),l=ae.validRange(n);if(o&&l)try{if(ae.subset(l,o))return n;if(ae.subset(o,l))return i}catch{}throw new Error(`Conflicting registry versions for ${r}: ${i} and ${n}`)}function Ml(r,i){let n=typeof r=="string"&&ae.validRange(r),o=ae.validRange(i);if(!n||!o)return!1;try{return ae.subset(n,o)}catch{return!1}}function wt(r,i){if(Ml(r,i))return"satisfied";let n=typeof r=="string"&&ae.validRange(r),o=ae.validRange(i);if(!n||!o)return"incomparable";try{let l=ae.minVersion(n),h=ae.minVersion(o);return!l||!h?"incomparable":ae.lt(l,h)?"lower":"newer"}catch{return"incomparable"}}function St(r,i){let n=va.find(o=>Object.hasOwn(r[o]||{},i));return n?{section:n,existing:r[n][i]}:null}function Ea(r,i){let n=Ci(i);if(n.size===0)return;let o=ne.join(r,"package.json"),l=JSON.parse(ve.readFileSync(o,"utf8"));for(let[h,f]of n){let m=St(l,h),y=m?.section||"dependencies";l[y]||={};let x=m?.existing;l[y][h]=x===void 0?f||"latest":f&&wt(x,f)==="lower"?f:x}ve.writeFileSync(o,`${JSON.stringify(l,null,2)}
3
3
  `)}function Ct(r){let i=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];for(let n=ne.resolve(r);;n=ne.dirname(n)){let o=ne.join(n,"package.json");if(ve.existsSync(o)){let l=JSON.parse(ve.readFileSync(o,"utf8")),h=String(l.packageManager||"").split("@")[0];if(["npm","pnpm","yarn","bun"].includes(h))return h}for(let[l,h]of i)if(ve.existsSync(ne.join(n,l)))return h;if(ne.dirname(n)===n)return"npm"}}var xa={npm:"npx",pnpm:"pnpm exec",yarn:"yarn",bun:"bunx"};function ba(r,i=process.cwd()){let n;try{n=Ct(i)}catch{n="npm"}return`${xa[n]||xa.npm} frontfriend ${r}`}function Gl(r,i=process.cwd()){let n=null;try{n=r?new URL(r).origin:null}catch{n=null}return ba(n&&n!==new URL(Ul).origin?`login --api-url ${n}`:"login",i)}function Sa(r){return JSON.parse(ve.readFileSync(ne.join(r,"package.json"),"utf8"))}function _i(r,i){let n=Ci(i);if(n.size===0)return[];let o=Sa(r),l=[];for(let[h,f]of n){let m=St(o,h);m&&(!f||wt(m.existing,f)!=="lower")||l.push(f?`${h}@${f}`:h)}return l}function Hl(r,i){let n=i.filter(g=>g.required),o=Ci(n.flatMap(g=>g.dependencies)),l=(g,S)=>S.filter(E=>E.dependencies.some(N=>wi(N).name===g)).map(E=>E.component).filter(Boolean),h=i.filter(g=>!g.required);if(o.size===0&&h.length===0)return{missing:[],kept:[],repair:[]};let f=Sa(r),m=[],y=[];for(let[g,S]of o){let E=St(f,g);if(!E){m.push(S?`${g}@${S}`:g);continue}if(!S)continue;let N=wt(E.existing,S);N==="lower"?m.push(`${g}@${S}`):N!=="satisfied"&&y.push({name:g,current:E.existing,declared:S,components:l(g,n)})}let x=new Map;for(let g of h.flatMap(S=>S.dependencies)){let{name:S,version:E}=wi(g);if(o.has(S)||St(f,S))continue;let N=x.get(S),B=E||N?.version;if(N?.version&&E&&N.version!==E)try{B=ya(S,N.version,E)}catch{B=N.version}x.set(S,{version:B})}let I=[...x].map(([g,{version:S}])=>({request:S?`${g}@${S}`:g,components:l(g,h)}));return{missing:m,kept:y,repair:I}}function wa(r,i){return[r==="npm"?"install":"add",...i]}function Wl(r){return/^[\w@/.:^~=+-]+$/.test(r)?r:`'${r.replace(/'/g,"'\\''")}'`}function Ca(r,i){let n=Ct(r);return[n,...wa(n,i)].map(Wl).join(" ")}function _a(r,i,{stdio:n="inherit"}={}){let o=_i(r,i);if(o.length===0)return;let l=Ct(r),h=ga.sync(l,wa(l,o),{cwd:r,stdio:n});if(h.error||h.status!==0)throw Ea(r,i),h.error||new Error(`${l} dependency installation failed with status ${h.status}. Dependencies were saved; run ${l} install.`)}function Xl(r,i,{install:n=!0,stdio:o="inherit",log:l=console.log}={}){let h=_i(r,i);if(h.length===0)return{missing:h,command:null,installed:!1};let f=Ca(r,h);if(!n)return l(`\u{1F4E6} Component dependencies missing from package.json. Install them with:
4
4
  ${f}`),{missing:h,command:f,installed:!1};l(`\u{1F4E6} Installing component dependencies: ${f}`);try{return _a(r,h,{stdio:o}),{missing:h,command:f,installed:!0}}catch(m){return l(`\u26A0\uFE0F Component dependencies were not installed: ${m.message}
package/dist/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@frontfriend/sdk",
3
- "version": "1.2.6"
3
+ "version": "1.2.8"
4
4
  }