@frontfriend/sdk 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/cli.js +1 -1
- package/dist/lib/core/adoption.js +1 -1
- package/dist/lib/core/application-adoption.js +1 -1
- package/dist/mcp.cjs +1 -1
- package/dist/next.js +1 -1
- package/dist/package.json +1 -1
- package/dist/vite.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -244,6 +244,8 @@ An applied adoption installs the npm dependencies of the components it adds or m
|
|
|
244
244
|
|
|
245
245
|
A private component deleted from the Design System leaves every Release. `update` removes its pin from `frontfriend.lock.json` and prints `custom/... was deleted from the design system. Its files in <path> were kept; remove them and their imports if you no longer use them.` It never deletes those files. `add` and `download` refuse a deleted component that the lock pins; `diff` and `doctor` report the pin until `update` removes it. `update --json` (with `--yes` or `--dry-run`) prints one JSON result on stdout, with the removed pins in `components_removed`.
|
|
246
246
|
|
|
247
|
+
A contract deleted from the Design System leaves every Release too. `update` removes it from `frontfriend.lock.json`, its file from `.frontfriend/design/` and its rules from `.frontfriend/rules/`.
|
|
248
|
+
|
|
247
249
|
To apply the latest published Release of the App's tag in one step (lock, component source, npm dependencies, token cache), run:
|
|
248
250
|
|
|
249
251
|
```bash
|
|
@@ -253,7 +255,7 @@ npx frontfriend adopt --yes
|
|
|
253
255
|
|
|
254
256
|
`adopt` never adopts a draft: a component or foundation commit reaches the App once it is published in a Release.
|
|
255
257
|
|
|
256
|
-
Coding agents adopt through the MCP bridge instead: the local tool `adopt_design { project_path, dry_run?, scope? }` runs the same adoption without a prompt and returns a JSON summary (snapshot, Release, changed pins, files written, `npm_dependencies`, `token_cache`). It returns the install command for missing npm dependencies instead of running the package manager.
|
|
258
|
+
Coding agents adopt through the MCP bridge instead: the local tool `adopt_design { project_path, dry_run?, scope? }` runs the same adoption without a prompt and returns a JSON summary (snapshot, Release, changed pins, files written, `components_removed`, `npm_dependencies`, `token_cache`). It returns the install command for missing npm dependencies instead of running the package manager.
|
|
257
259
|
|
|
258
260
|
See the [CLI reference](https://frontfriend.dev/docs/cli-reference/) for all options.
|
|
259
261
|
|
|
@@ -328,7 +330,7 @@ npx frontfriend init --tag <tag-name-or-id>
|
|
|
328
330
|
|
|
329
331
|
After the tokens, an online `init` signed in as a person registers the App named in `frontfriend.config.js` on its tag (`--tag`, then `tag`) with its `framework` and `primitive`, so `update` and the design reads find it. When Studio refuses the registration, `init` stops with the reason; the installed tokens stay. With a machine credential, or with `--no-register`, `init` installs the selected tokens and never registers the App or changes its Release tag (see [Builds and CI](#builds-and-ci)). During an outage it keeps the tokens and asks you to run `init` again. When the App adopts contracts and `frontfriend.lock.json` pins a design snapshot, `init` also writes that snapshot's contracts to `.frontfriend/design/` and, when they are missing or belong to another snapshot, its rules to `.frontfriend/rules/`: the same files `update` writes.
|
|
330
332
|
|
|
331
|
-
`frontfriend.lock.json` lists its contract pins by slug, then kind, and its `adoptionDigest` does not depend on the order of the pins. A lock written by an earlier SDK in another order is still valid; `update` keeps its bytes until the adoption itself changes.
|
|
333
|
+
`frontfriend.lock.json` lists its contract pins by slug, then kind, and its `adoptionDigest` does not depend on the order of the pins. A lock written by an earlier SDK in another order is still valid; `update` keeps its bytes until the adoption itself changes. The lock pins each component file by hash (`baselineHash`), not by its source. To merge a local edit with an incoming change, `update` rebuilds the previous source from the pinned Release; if that Release cannot be read, the file is reported as a conflict. A lock written by SDK 1.2.5 or earlier still works; the next `update` drops its inline source.
|
|
332
334
|
|
|
333
335
|
Every online `init` keeps a verified copy of the selected tokens in `.frontfriend/artifacts`. When Studio is unreachable (network failure, timeout or server error), a signed-in `init` restores that copy. A first install during an outage has no copy to restore.
|
|
334
336
|
|
|
@@ -358,7 +360,7 @@ FF_AUTH_TOKEN=<machine credential> npx frontfriend init --tag <tag-name>
|
|
|
358
360
|
|
|
359
361
|
A machine credential is read-only for the App. `init` installs the tokens of the requested tag and prints `Build mode: App registration skipped (machine credential).`; it never registers the App or moves its Release tag in Studio, so a preview build on `next` does not move a production App off `base`. Pass `--no-register` to get the same behavior with any credential. Studio never changes an App for a machine credential either: it answers the registration of an earlier SDK with the App unchanged, so those builds also install the requested tag and leave the App on its own tag. If Studio refuses a registration with `MACHINE_CREDENTIAL_READ_ONLY`, `init` reports the registration as skipped and succeeds.
|
|
360
362
|
|
|
361
|
-
`update`, `adopt`, `download` and `
|
|
363
|
+
`update`, `adopt`, `download`, `add` and `design sync` with a machine credential use the App's current Release tag. They stop with a message when the selection would bind the App or move it to another tag. `connect` stops at its login step: it registers the App, which needs a person's login (`frontfriend login`, with `FF_AUTH_TOKEN` unset). Change an App's tag in Studio or with a person's login.
|
|
362
364
|
|
|
363
365
|
## Existing Tailwind clients
|
|
364
366
|
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var g9=Object.create;var up=Object.defineProperty;var y9=Object.getOwnPropertyDescriptor;var v9=Object.getOwnPropertyNames;var _9=Object.getPrototypeOf,b9=Object.prototype.hasOwnProperty;var Ve=(e,t)=>()=>(e&&(t=e(e=0)),t);var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bo=(e,t)=>{for(var r in t)up(e,r,{get:t[r],enumerable:!0})},VE=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of v9(t))!b9.call(e,n)&&n!==r&&up(e,n,{get:()=>t[n],enumerable:!(i=y9(t,n))||i.enumerable});return e};var Bi=(e,t,r)=>(r=e!=null?g9(_9(e)):{},VE(t||!e||!e.__esModule?up(r,"default",{value:e,enumerable:!0}):r,e)),Mr=e=>VE(up({},"__esModule",{value:!0}),e);var xa=B((VIe,S9)=>{S9.exports={name:"@frontfriend/sdk",version:"1.2.6"}});var So=B((JIe,JE)=>{var{name:w9}=xa();JE.exports={PACKAGE_NAME:w9}});var fa=B((BIe,BE)=>{var $9="https://app.frontfriend.dev",R9=".cache/frontfriend",E9={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"]},P9={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function O9(e){if(!e)return null;try{let t=new URL(e);return t.hostname.startsWith("app.")?`${t.protocol}//${t.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}BE.exports={DEFAULT_API_URL:$9,CACHE_DIR_NAME:R9,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:E9,ENV_VARS:P9,deriveRegistryFromApiUrl:O9}});var WE=B((HIe,GE)=>{GE.exports=KE;KE.sync=C9;var HE=require("fs");function I9(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function ZE(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:I9(t,r)}function KE(e,t,r){HE.stat(e,function(i,n){r(i,i?!1:ZE(n,e,t))})}function C9(e,t){return ZE(HE.statSync(e),e,t)}});var tP=B((ZIe,eP)=>{eP.exports=XE;XE.sync=k9;var YE=require("fs");function XE(e,t,r){YE.stat(e,function(i,n){r(i,i?!1:QE(n,t))})}function k9(e,t){return QE(YE.statSync(e),t)}function QE(e,t){return e.isFile()&&T9(e,t)}function T9(e,t){var r=e.mode,i=e.uid,n=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,f=r&l||r&c&&n===s||r&a&&i===o||r&u&&o===0;return f}});var nP=B((GIe,rP)=>{var KIe=require("fs"),dp;process.platform==="win32"||global.TESTING_WINDOWS?dp=WE():dp=tP();rP.exports=Qv;Qv.sync=j9;function Qv(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Qv(e,t||{},function(o,s){o?n(o):i(s)})})}dp(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function j9(e,t){try{return dp.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var uP=B((WIe,lP)=>{var sl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",iP=require("path"),A9=sl?";":":",oP=nP(),sP=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),aP=(e,t)=>{let r=t.colon||A9,i=e.match(/\//)||sl&&e.match(/\\/)?[""]:[...sl?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=sl?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=sl?n.split(r):[""];return sl&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},cP=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:o}=aP(e,t),s=[],a=l=>new Promise((u,f)=>{if(l===i.length)return t.all&&s.length?u(s):f(sP(e));let p=i[l],g=/^".*"$/.test(p)?p.slice(1,-1):p,h=iP.join(g,e),v=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;u(c(v,l,0))}),c=(l,u,f)=>new Promise((p,g)=>{if(f===n.length)return p(a(u+1));let h=n[f];oP(l+h,{pathExt:o},(v,y)=>{if(!v&&y)if(t.all)s.push(l+h);else return p(l+h);return p(c(l,u,f+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},N9=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=aP(e,t),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=iP.join(c,e),u=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<i.length;f++){let p=u+i[f];try{if(oP.sync(p,{pathExt:n}))if(t.all)o.push(p);else return p}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw sP(e)};lP.exports=cP;cP.sync=N9});var fP=B((YIe,e_)=>{"use strict";var dP=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};e_.exports=dP;e_.exports.default=dP});var gP=B((XIe,mP)=>{"use strict";var pP=require("path"),x9=uP(),M9=fP();function hP(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=x9.sync(e.command,{path:r[M9({env:r})],pathExt:t?pP.delimiter:void 0})}catch{}finally{o&&process.chdir(i)}return s&&(s=pP.resolve(n?e.options.cwd:"",s)),s}function q9(e){return hP(e)||hP(e,!0)}mP.exports=q9});var yP=B((QIe,r_)=>{"use strict";var t_=/([()\][%!^"`<>&|;, *?])/g;function L9(e){return e=e.replace(t_,"^$1"),e}function D9(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(t_,"^$1"),t&&(e=e.replace(t_,"^$1")),e}r_.exports.command=L9;r_.exports.argument=D9});var _P=B((eCe,vP)=>{"use strict";vP.exports=/^#!(.*)/});var SP=B((tCe,bP)=>{"use strict";var U9=_P();bP.exports=(e="")=>{let t=e.match(U9);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var $P=B((rCe,wP)=>{"use strict";var n_=require("fs"),z9=SP();function F9(e){let r=Buffer.alloc(150),i;try{i=n_.openSync(e,"r"),n_.readSync(i,r,0,150,0),n_.closeSync(i)}catch{}return z9(r.toString())}wP.exports=F9});var OP=B((nCe,PP)=>{"use strict";var V9=require("path"),RP=gP(),EP=yP(),J9=$P(),B9=process.platform==="win32",H9=/\.(?:com|exe)$/i,Z9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function K9(e){e.file=RP(e);let t=e.file&&J9(e.file);return t?(e.args.unshift(e.file),e.command=t,RP(e)):e.file}function G9(e){if(!B9)return e;let t=K9(e),r=!H9.test(t);if(e.options.forceShell||r){let i=Z9.test(t);e.command=V9.normalize(e.command),e.command=EP.command(e.command),e.args=e.args.map(o=>EP.argument(o,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function W9(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:G9(i)}PP.exports=W9});var kP=B((iCe,CP)=>{"use strict";var i_=process.platform==="win32";function o_(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Y9(e,t){if(!i_)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let o=IP(n,t);if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}function IP(e,t){return i_&&e===1&&!t.file?o_(t.original,"spawn"):null}function X9(e,t){return i_&&e===1&&!t.file?o_(t.original,"spawnSync"):null}CP.exports={hookChildProcess:Y9,verifyENOENT:IP,verifyENOENTSync:X9,notFoundError:o_}});var c_=B((oCe,al)=>{"use strict";var TP=require("child_process"),s_=OP(),a_=kP();function jP(e,t,r){let i=s_(e,t,r),n=TP.spawn(i.command,i.args,i.options);return a_.hookChildProcess(n,i),n}function Q9(e,t,r){let i=s_(e,t,r),n=TP.spawnSync(i.command,i.args,i.options);return n.error=n.error||a_.verifyENOENTSync(n.status,i),n}al.exports=jP;al.exports.spawn=jP;al.exports.sync=Q9;al.exports._parse=s_;al.exports._enoent=a_});var cl=B((sCe,AP)=>{"use strict";var eB="2.0.0",tB=Number.MAX_SAFE_INTEGER||9007199254740991,rB=16,nB=250,iB=["major","premajor","minor","preminor","patch","prepatch","prerelease"];AP.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:rB,MAX_SAFE_BUILD_LENGTH:nB,MAX_SAFE_INTEGER:tB,RELEASE_TYPES:iB,SEMVER_SPEC_VERSION:eB,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Fu=B((aCe,NP)=>{"use strict";var oB=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};NP.exports=oB});var ll=B((Bo,xP)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:l_,MAX_SAFE_BUILD_LENGTH:sB,MAX_LENGTH:aB}=cl(),cB=Fu();Bo=xP.exports={};var lB=Bo.re=[],uB=Bo.safeRe=[],Ze=Bo.src=[],dB=Bo.safeSrc=[],Ke=Bo.t={},fB=0,u_="[a-zA-Z0-9-]",pB=[["\\s",1],["\\d",aB],[u_,sB]],hB=e=>{for(let[t,r]of pB)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},St=(e,t,r)=>{let i=hB(t),n=fB++;cB(e,n,t),Ke[e]=n,Ze[n]=t,dB[n]=i,lB[n]=new RegExp(t,r?"g":void 0),uB[n]=new RegExp(i,r?"g":void 0)};St("NUMERICIDENTIFIER","0|[1-9]\\d*");St("NUMERICIDENTIFIERLOOSE","\\d+");St("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u_}*`);St("MAINVERSION",`(${Ze[Ke.NUMERICIDENTIFIER]})\\.(${Ze[Ke.NUMERICIDENTIFIER]})\\.(${Ze[Ke.NUMERICIDENTIFIER]})`);St("MAINVERSIONLOOSE",`(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})\\.(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})\\.(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASEIDENTIFIER",`(?:${Ze[Ke.NONNUMERICIDENTIFIER]}|${Ze[Ke.NUMERICIDENTIFIER]})`);St("PRERELEASEIDENTIFIERLOOSE",`(?:${Ze[Ke.NONNUMERICIDENTIFIER]}|${Ze[Ke.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASE",`(?:-(${Ze[Ke.PRERELEASEIDENTIFIER]}(?:\\.${Ze[Ke.PRERELEASEIDENTIFIER]})*))`);St("PRERELEASELOOSE",`(?:-?(${Ze[Ke.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Ze[Ke.PRERELEASEIDENTIFIERLOOSE]})*))`);St("BUILDIDENTIFIER",`${u_}+`);St("BUILD",`(?:\\+(${Ze[Ke.BUILDIDENTIFIER]}(?:\\.${Ze[Ke.BUILDIDENTIFIER]})*))`);St("FULLPLAIN",`v?${Ze[Ke.MAINVERSION]}${Ze[Ke.PRERELEASE]}?${Ze[Ke.BUILD]}?`);St("FULL",`^${Ze[Ke.FULLPLAIN]}$`);St("LOOSEPLAIN",`[v=\\s]*${Ze[Ke.MAINVERSIONLOOSE]}${Ze[Ke.PRERELEASELOOSE]}?${Ze[Ke.BUILD]}?`);St("LOOSE",`^${Ze[Ke.LOOSEPLAIN]}$`);St("GTLT","((?:<|>)?=?)");St("XRANGEIDENTIFIERLOOSE",`${Ze[Ke.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);St("XRANGEIDENTIFIER",`${Ze[Ke.NUMERICIDENTIFIER]}|x|X|\\*`);St("XRANGEPLAIN",`[v=\\s]*(${Ze[Ke.XRANGEIDENTIFIER]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIER]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIER]})(?:${Ze[Ke.PRERELEASE]})?${Ze[Ke.BUILD]}?)?)?`);St("XRANGEPLAINLOOSE",`[v=\\s]*(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:${Ze[Ke.PRERELEASELOOSE]})?${Ze[Ke.BUILD]}?)?)?`);St("XRANGE",`^${Ze[Ke.GTLT]}\\s*${Ze[Ke.XRANGEPLAIN]}$`);St("XRANGELOOSE",`^${Ze[Ke.GTLT]}\\s*${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("COERCEPLAIN",`(^|[^\\d])(\\d{1,${l_}})(?:\\.(\\d{1,${l_}}))?(?:\\.(\\d{1,${l_}}))?`);St("COERCE",`${Ze[Ke.COERCEPLAIN]}(?:$|[^\\d])`);St("COERCEFULL",Ze[Ke.COERCEPLAIN]+`(?:${Ze[Ke.PRERELEASE]})?(?:${Ze[Ke.BUILD]})?(?:$|[^\\d])`);St("COERCERTL",Ze[Ke.COERCE],!0);St("COERCERTLFULL",Ze[Ke.COERCEFULL],!0);St("LONETILDE","(?:~>?)");St("TILDETRIM",`(\\s*)${Ze[Ke.LONETILDE]}\\s+`,!0);Bo.tildeTrimReplace="$1~";St("TILDE",`^${Ze[Ke.LONETILDE]}${Ze[Ke.XRANGEPLAIN]}$`);St("TILDELOOSE",`^${Ze[Ke.LONETILDE]}${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("LONECARET","(?:\\^)");St("CARETTRIM",`(\\s*)${Ze[Ke.LONECARET]}\\s+`,!0);Bo.caretTrimReplace="$1^";St("CARET",`^${Ze[Ke.LONECARET]}${Ze[Ke.XRANGEPLAIN]}$`);St("CARETLOOSE",`^${Ze[Ke.LONECARET]}${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("COMPARATORLOOSE",`^${Ze[Ke.GTLT]}\\s*(${Ze[Ke.LOOSEPLAIN]})$|^$`);St("COMPARATOR",`^${Ze[Ke.GTLT]}\\s*(${Ze[Ke.FULLPLAIN]})$|^$`);St("COMPARATORTRIM",`(\\s*)${Ze[Ke.GTLT]}\\s*(${Ze[Ke.LOOSEPLAIN]}|${Ze[Ke.XRANGEPLAIN]})`,!0);Bo.comparatorTrimReplace="$1$2$3";St("HYPHENRANGE",`^\\s*(${Ze[Ke.XRANGEPLAIN]})\\s+-\\s+(${Ze[Ke.XRANGEPLAIN]})\\s*$`);St("HYPHENRANGELOOSE",`^\\s*(${Ze[Ke.XRANGEPLAINLOOSE]})\\s+-\\s+(${Ze[Ke.XRANGEPLAINLOOSE]})\\s*$`);St("STAR","(<|>)?=?\\s*\\*");St("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");St("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fp=B((cCe,MP)=>{"use strict";var mB=Object.freeze({loose:!0}),gB=Object.freeze({}),yB=e=>e?typeof e!="object"?mB:e:gB;MP.exports=yB});var d_=B((lCe,DP)=>{"use strict";var qP=/^[0-9]+$/,LP=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=qP.test(e),i=qP.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},vB=(e,t)=>LP(t,e);DP.exports={compareIdentifiers:LP,rcompareIdentifiers:vB}});var Sn=B((uCe,zP)=>{"use strict";var pp=Fu(),{MAX_LENGTH:UP,MAX_SAFE_INTEGER:hp}=cl(),{safeRe:mp,t:gp}=ll(),_B=fp(),{compareIdentifiers:f_}=d_(),bB=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let i=0;i<r.length;i++)if(f_(e[i],r[i])!==0)return!1;return!0},p_=class e{constructor(t,r){if(r=_B(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>UP)throw new TypeError(`version is longer than ${UP} characters`);pp("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=t.trim().match(r.loose?mp[gp.LOOSE]:mp[gp.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>hp||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hp||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hp||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<hp)return o}return n}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(pp("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let i=this.prerelease[r],n=t.prerelease[r];if(pp("prerelease compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return f_(i,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let i=this.build[r],n=t.build[r];if(pp("build compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return f_(i,n)}while(++r)}inc(t,r,i){if(t.startsWith("pre")){if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?mp[gp.PRERELEASELOOSE]:mp[gp.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,i);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 n=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let o=[r,n];if(i===!1&&(o=[r]),bB(this.prerelease,r)){let s=this.prerelease[r.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};zP.exports=p_});var Ma=B((dCe,VP)=>{"use strict";var FP=Sn(),SB=(e,t,r=!1)=>{if(e instanceof FP)return e;try{return new FP(e,t)}catch(i){if(!r)return null;throw i}};VP.exports=SB});var BP=B((fCe,JP)=>{"use strict";var wB=Ma(),$B=(e,t)=>{let r=wB(e,t);return r?r.version:null};JP.exports=$B});var ZP=B((pCe,HP)=>{"use strict";var RB=Ma(),EB=(e,t)=>{let r=RB(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};HP.exports=EB});var WP=B((hCe,GP)=>{"use strict";var KP=Sn(),PB=(e,t,r,i,n)=>{typeof r=="string"&&(n=i,i=r,r=void 0);try{return new KP(e instanceof KP?e.version:e,r).inc(t,i,n).version}catch{return null}};GP.exports=PB});var QP=B((mCe,XP)=>{"use strict";var YP=Ma(),OB=(e,t)=>{let r=YP(e,null,!0),i=YP(t,null,!0),n=r.compare(i);if(n===0)return null;let o=n>0,s=o?r:i,a=o?i:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"};XP.exports=OB});var tO=B((gCe,eO)=>{"use strict";var IB=Sn(),CB=(e,t)=>new IB(e,t).major;eO.exports=CB});var nO=B((yCe,rO)=>{"use strict";var kB=Sn(),TB=(e,t)=>new kB(e,t).minor;rO.exports=TB});var oO=B((vCe,iO)=>{"use strict";var jB=Sn(),AB=(e,t)=>new jB(e,t).patch;iO.exports=AB});var aO=B((_Ce,sO)=>{"use strict";var NB=Ma(),xB=(e,t)=>{let r=NB(e,t);return r&&r.prerelease.length?r.prerelease:null};sO.exports=xB});var Hi=B((bCe,lO)=>{"use strict";var cO=Sn(),MB=(e,t,r)=>new cO(e,r).compare(new cO(t,r));lO.exports=MB});var dO=B((SCe,uO)=>{"use strict";var qB=Hi(),LB=(e,t,r)=>qB(t,e,r);uO.exports=LB});var pO=B((wCe,fO)=>{"use strict";var DB=Hi(),UB=(e,t)=>DB(e,t,!0);fO.exports=UB});var yp=B(($Ce,mO)=>{"use strict";var hO=Sn(),zB=(e,t,r)=>{let i=new hO(e,r),n=new hO(t,r);return i.compare(n)||i.compareBuild(n)};mO.exports=zB});var yO=B((RCe,gO)=>{"use strict";var FB=yp(),VB=(e,t)=>e.sort((r,i)=>FB(r,i,t));gO.exports=VB});var _O=B((ECe,vO)=>{"use strict";var JB=yp(),BB=(e,t)=>e.sort((r,i)=>JB(i,r,t));vO.exports=BB});var Vu=B((PCe,bO)=>{"use strict";var HB=Hi(),ZB=(e,t,r)=>HB(e,t,r)>0;bO.exports=ZB});var vp=B((OCe,SO)=>{"use strict";var KB=Hi(),GB=(e,t,r)=>KB(e,t,r)<0;SO.exports=GB});var h_=B((ICe,wO)=>{"use strict";var WB=Hi(),YB=(e,t,r)=>WB(e,t,r)===0;wO.exports=YB});var m_=B((CCe,$O)=>{"use strict";var XB=Hi(),QB=(e,t,r)=>XB(e,t,r)!==0;$O.exports=QB});var _p=B((kCe,RO)=>{"use strict";var eH=Hi(),tH=(e,t,r)=>eH(e,t,r)>=0;RO.exports=tH});var bp=B((TCe,EO)=>{"use strict";var rH=Hi(),nH=(e,t,r)=>rH(e,t,r)<=0;EO.exports=nH});var g_=B((jCe,PO)=>{"use strict";var iH=h_(),oH=m_(),sH=Vu(),aH=_p(),cH=vp(),lH=bp(),uH=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return iH(e,r,i);case"!=":return oH(e,r,i);case">":return sH(e,r,i);case">=":return aH(e,r,i);case"<":return cH(e,r,i);case"<=":return lH(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}};PO.exports=uH});var IO=B((ACe,OO)=>{"use strict";var dH=Sn(),fH=Ma(),{safeRe:Sp,t:wp}=ll(),pH=(e,t)=>{if(e instanceof dH)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Sp[wp.COERCEFULL]:Sp[wp.COERCE]);else{let c=t.includePrerelease?Sp[wp.COERCERTLFULL]:Sp[wp.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let i=r[2],n=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return fH(`${i}.${n}.${o}${s}${a}`,t)};OO.exports=pH});var kO=B((NCe,CO)=>{"use strict";var hH=Ma(),mH=cl(),gH=Sn(),yH=(e,t,r)=>{if(!mH.RELEASE_TYPES.includes(t))return null;let i=vH(e,r);return i&&_H(i,t)},vH=(e,t)=>{let r=e instanceof gH?e.version:e;return hH(r,t)},_H=(e,t)=>{if(bH(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},bH=e=>e.startsWith("pre");CO.exports=yH});var jO=B((xCe,TO)=>{"use strict";var y_=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(t,r)}return this}};TO.exports=y_});var Zi=B((MCe,MO)=>{"use strict";var SH=/\s+/g,v_=class e{constructor(t,r){if(r=$H(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof __)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(SH," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!NO(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&jH(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let i=0;i<r.length;i++)i>0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(TH,"");let i=((this.options.includePrerelease&&CH)|(this.options.loose&&kH))+":"+t,n=AO.get(i);if(n)return n;let o=this.options.loose,s=o?Bn[wn.HYPHENRANGELOOSE]:Bn[wn.HYPHENRANGE];t=t.replace(s,VH(this.options.includePrerelease)),dr("hyphen replace",t),t=t.replace(Bn[wn.COMPARATORTRIM],PH),dr("comparator trim",t),t=t.replace(Bn[wn.TILDETRIM],OH),dr("tilde trim",t),t=t.replace(Bn[wn.CARETTRIM],IH),dr("caret trim",t);let a=t.split(" ").map(f=>AH(f,this.options)).join(" ").split(/\s+/).map(f=>FH(f,this.options));o&&(a=a.filter(f=>(dr("loose invalid filter",f,this.options),!!f.match(Bn[wn.COMPARATORLOOSE])))),dr("range list",a);let c=new Map,l=a.map(f=>new __(f,this.options));for(let f of l){if(NO(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return AO.set(i,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>xO(i,r)&&t.set.some(n=>xO(n,r)&&i.every(o=>n.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new RH(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(JH(this.set[r],t,this.options))return!0;return!1}};MO.exports=v_;var wH=jO(),AO=new wH,$H=fp(),__=Ju(),dr=Fu(),RH=Sn(),{safeRe:Bn,src:EH,t:wn,comparatorTrimReplace:PH,tildeTrimReplace:OH,caretTrimReplace:IH}=ll(),{FLAG_INCLUDE_PRERELEASE:CH,FLAG_LOOSE:kH}=cl(),TH=new RegExp(EH[wn.BUILD],"g"),NO=e=>e.value==="<0.0.0-0",jH=e=>e.value==="",xO=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(o=>n.intersects(o,t)),n=i.pop();return r},AH=(e,t)=>(e=e.replace(Bn[wn.BUILD],""),dr("comp",e,t),e=qH(e,t),dr("caret",e),e=xH(e,t),dr("tildes",e),e=DH(e,t),dr("xrange",e),e=zH(e,t),dr("stars",e),e),Wr=e=>!e||e.toLowerCase()==="x"||e==="*",NH=(e,t,r)=>Wr(e)&&!Wr(t)||Wr(t)&&r&&!Wr(r),xH=(e,t)=>e.trim().split(/\s+/).map(r=>MH(r,t)).join(" "),MH=(e,t)=>{let r=t.loose?Bn[wn.TILDELOOSE]:Bn[wn.TILDE],i=t.includePrerelease?"-0":"";return e.replace(r,(n,o,s,a,c)=>{dr("tilde",e,n,o,s,a,c);let l;return Wr(o)?l="":Wr(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Wr(a)?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c?(dr("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,dr("tilde return",l),l})},qH=(e,t)=>e.trim().split(/\s+/).map(r=>LH(r,t)).join(" "),LH=(e,t)=>{dr("caret",e,t);let r=t.loose?Bn[wn.CARETLOOSE]:Bn[wn.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,o,s,a,c)=>{dr("caret",e,n,o,s,a,c);let l;return Wr(o)?l="":Wr(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Wr(a)?o==="0"?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(dr("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(dr("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),dr("caret return",l),l})},DH=(e,t)=>(dr("replaceXRanges",e,t),e.split(/\s+/).map(r=>UH(r,t)).join(" ")),UH=(e,t)=>{e=e.trim();let r=t.loose?Bn[wn.XRANGELOOSE]:Bn[wn.XRANGE];return e.replace(r,(i,n,o,s,a,c)=>{if(dr("xRange",e,i,n,o,s,a,c),NH(o,s,a))return e;let l=Wr(o),u=l||Wr(s),f=u||Wr(a),p=f;return n==="="&&p&&(n=""),c=t.includePrerelease?"-0":"",l?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&p?(u&&(s=0),a=0,n===">"?(n=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):n==="<="&&(n="<",u?o=+o+1:s=+s+1),n==="<"&&(c="-0"),i=`${n+o}.${s}.${a}${c}`):u?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),dr("xRange return",i),i})},zH=(e,t)=>(dr("replaceStars",e,t),e.trim().replace(Bn[wn.STAR],"")),FH=(e,t)=>(dr("replaceGTE0",e,t),e.trim().replace(Bn[t.includePrerelease?wn.GTE0PRE:wn.GTE0],"")),VH=e=>(t,r,i,n,o,s,a,c,l,u,f,p)=>(Wr(i)?r="":Wr(n)?r=`>=${i}.0.0${e?"-0":""}`:Wr(o)?r=`>=${i}.${n}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,Wr(l)?c="":Wr(u)?c=`<${+l+1}.0.0-0`:Wr(f)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${f}-${p}`:e?c=`<${l}.${u}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),JH=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(dr(e[i].semver),e[i].semver!==__.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}});var Ju=B((qCe,FO)=>{"use strict";var Bu=Symbol("SemVer ANY"),w_=class e{static get ANY(){return Bu}constructor(t,r){if(r=qO(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),S_("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Bu?this.value="":this.value=this.operator+this.semver.version,S_("comp",this)}parse(t){let r=this.options.loose?LO[DO.COMPARATORLOOSE]:LO[DO.COMPARATOR],i=t.match(r);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new UO(i[2],this.options.loose):this.semver=Bu}toString(){return this.value}test(t){if(S_("Comparator.test",t,this.options.loose),this.semver===Bu||t===Bu)return!0;if(typeof t=="string")try{t=new UO(t,this.options)}catch{return!1}return b_(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new zO(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new zO(this.value,r).test(t.semver):(r=qO(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||b_(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||b_(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};FO.exports=w_;var qO=fp(),{safeRe:LO,t:DO}=ll(),b_=g_(),S_=Fu(),UO=Sn(),zO=Zi()});var Hu=B((LCe,VO)=>{"use strict";var BH=Zi(),HH=(e,t,r)=>{try{t=new BH(t,r)}catch{return!1}return t.test(e)};VO.exports=HH});var BO=B((DCe,JO)=>{"use strict";var ZH=Zi(),KH=(e,t)=>new ZH(e,t).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));JO.exports=KH});var ZO=B((UCe,HO)=>{"use strict";var GH=Sn(),WH=Zi(),YH=(e,t,r)=>{let i=null,n=null,o=null;try{o=new WH(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||n.compare(s)===-1)&&(i=s,n=new GH(i,r))}),i};HO.exports=YH});var GO=B((zCe,KO)=>{"use strict";var XH=Sn(),QH=Zi(),eZ=(e,t,r)=>{let i=null,n=null,o=null;try{o=new QH(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||n.compare(s)===1)&&(i=s,n=new XH(i,r))}),i};KO.exports=eZ});var XO=B((FCe,YO)=>{"use strict";var $_=Sn(),tZ=Zi(),WO=Vu(),rZ=(e,t)=>{e=new tZ(e,t);let r=new $_("0.0.0");if(e.test(r)||(r=new $_("0.0.0-0"),e.test(r)))return r;r=null;for(let i=0;i<e.set.length;++i){let n=e.set[i],o=null;n.forEach(s=>{let a=new $_(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||WO(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||WO(r,o))&&(r=o)}return r&&e.test(r)?r:null};YO.exports=rZ});var eI=B((VCe,QO)=>{"use strict";var nZ=Zi(),iZ=(e,t)=>{try{return new nZ(e,t).range||"*"}catch{return null}};QO.exports=iZ});var $p=B((JCe,iI)=>{"use strict";var oZ=Sn(),nI=Ju(),{ANY:sZ}=nI,aZ=Zi(),cZ=Hu(),tI=Vu(),rI=vp(),lZ=bp(),uZ=_p(),dZ=(e,t,r,i)=>{e=new oZ(e,i),t=new aZ(t,i);let n,o,s,a,c;switch(r){case">":n=tI,o=lZ,s=rI,a=">",c=">=";break;case"<":n=rI,o=uZ,s=tI,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(cZ(e,t,i))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],f=null,p=null;if(u.forEach(g=>{g.semver===sZ&&(g=new nI(">=0.0.0")),f=f||g,p=p||g,n(g.semver,f.semver,i)?f=g:s(g.semver,p.semver,i)&&(p=g)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};iI.exports=dZ});var sI=B((BCe,oI)=>{"use strict";var fZ=$p(),pZ=(e,t,r)=>fZ(e,t,">",r);oI.exports=pZ});var cI=B((HCe,aI)=>{"use strict";var hZ=$p(),mZ=(e,t,r)=>hZ(e,t,"<",r);aI.exports=mZ});var dI=B((ZCe,uI)=>{"use strict";var lI=Zi(),gZ=(e,t,r)=>(e=new lI(e,r),t=new lI(t,r),e.intersects(t,r));uI.exports=gZ});var pI=B((KCe,fI)=>{"use strict";var yZ=Hu(),vZ=Hi();fI.exports=(e,t,r)=>{let i=[],n=null,o=null,s=e.sort((u,f)=>vZ(u,f,r));for(let u of s)yZ(u,t,r)?(o=u,n||(n=u)):(o&&i.push([n,o]),o=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,f]of i)u===f?a.push(u):!f&&u===s[0]?a.push("*"):f?u===s[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var _I=B((GCe,vI)=>{"use strict";var hI=Zi(),P_=Ju(),{ANY:R_}=P_,E_=Hu(),O_=Hi(),_Z=(e,t,r={})=>{if(e===t)return!0;e=new hI(e,r),t=new hI(t,r);let i=!1;e:for(let n of e.set){for(let o of t.set){let s=SZ(n,o,r);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},bZ=[new P_(">=0.0.0-0")],mI=[new P_(">=0.0.0")],SZ=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===R_){if(t.length===1&&t[0].semver===R_)return!0;r.includePrerelease?e=bZ:e=mI}if(t.length===1&&t[0].semver===R_){if(r.includePrerelease)return!0;t=mI}let i=new Set,n,o;for(let g of e)g.operator===">"||g.operator===">="?n=gI(n,g,r):g.operator==="<"||g.operator==="<="?o=yI(o,g,r):i.add(g.semver);if(i.size>1)return null;let s;if(n&&o){if(s=O_(n.semver,o.semver,r),s>0)return null;if(s===0&&(n.operator!==">="||o.operator!=="<="))return null}for(let g of i){if(n&&!E_(g,String(n),r)||o&&!E_(g,String(o),r))return null;for(let h of t)if(!E_(g,String(h),r))return!1;return!0}let a,c,l,u,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let g of t){if(u=u||g.operator===">"||g.operator===">=",l=l||g.operator==="<"||g.operator==="<=",n){if(p&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===p.major&&g.semver.minor===p.minor&&g.semver.patch===p.patch&&(p=!1),g.operator===">"||g.operator===">="){if(a=gI(n,g,r),a===g&&a!==n)return!1}else if(n.operator===">="&&!g.test(n.semver))return!1}if(o){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator==="<"||g.operator==="<="){if(c=yI(o,g,r),c===g&&c!==o)return!1}else if(o.operator==="<="&&!g.test(o.semver))return!1}if(!g.operator&&(o||n)&&s!==0)return!1}return!(n&&l&&!o&&s!==0||o&&u&&!n&&s!==0||p||f)},gI=(e,t,r)=>{if(!e)return t;let i=O_(e.semver,t.semver,r);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},yI=(e,t,r)=>{if(!e)return t;let i=O_(e.semver,t.semver,r);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};vI.exports=_Z});var $I=B((WCe,wI)=>{"use strict";var I_=ll(),bI=cl(),wZ=Sn(),SI=d_(),$Z=Ma(),RZ=BP(),EZ=ZP(),PZ=WP(),OZ=QP(),IZ=tO(),CZ=nO(),kZ=oO(),TZ=aO(),jZ=Hi(),AZ=dO(),NZ=pO(),xZ=yp(),MZ=yO(),qZ=_O(),LZ=Vu(),DZ=vp(),UZ=h_(),zZ=m_(),FZ=_p(),VZ=bp(),JZ=g_(),BZ=IO(),HZ=kO(),ZZ=Ju(),KZ=Zi(),GZ=Hu(),WZ=BO(),YZ=ZO(),XZ=GO(),QZ=XO(),e3=eI(),t3=$p(),r3=sI(),n3=cI(),i3=dI(),o3=pI(),s3=_I();wI.exports={parse:$Z,valid:RZ,clean:EZ,inc:PZ,diff:OZ,major:IZ,minor:CZ,patch:kZ,prerelease:TZ,compare:jZ,rcompare:AZ,compareLoose:NZ,compareBuild:xZ,sort:MZ,rsort:qZ,gt:LZ,lt:DZ,eq:UZ,neq:zZ,gte:FZ,lte:VZ,cmp:JZ,coerce:BZ,truncate:HZ,Comparator:ZZ,Range:KZ,satisfies:GZ,toComparators:WZ,maxSatisfying:YZ,minSatisfying:XZ,minVersion:QZ,validRange:e3,outside:t3,gtr:r3,ltr:n3,intersects:i3,simplifyRange:o3,subset:s3,SemVer:wZ,re:I_.re,src:I_.src,tokens:I_.t,SEMVER_SPEC_VERSION:bI.SEMVER_SPEC_VERSION,RELEASE_TYPES:bI.RELEASE_TYPES,compareIdentifiers:SI.compareIdentifiers,rcompareIdentifiers:SI.rcompareIdentifiers}});var pa=B((YCe,NI)=>{var qa=require("fs"),Ki=require("path"),EI=c_(),Gi=$I(),{DEFAULT_API_URL:a3}=fa(),PI=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function C_(e){let t=typeof e=="string"&&e.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!t)throw new Error(`Invalid npm dependency: ${String(e)}`);return{name:t[1],version:t[2]}}function k_(e){let t=new Map;for(let r of e){let{name:i,version:n}=C_(r),o=t.get(i);t.set(i,o&&n?OI(i,o,n):n||o)}return t}function OI(e,t,r){if(t===r)return t;let i=Gi.validRange(t),n=Gi.validRange(r);if(i&&n)try{if(Gi.subset(n,i))return r;if(Gi.subset(i,n))return t}catch{}throw new Error(`Conflicting registry versions for ${e}: ${t} and ${r}`)}function c3(e,t){let r=typeof e=="string"&&Gi.validRange(e),i=Gi.validRange(t);if(!r||!i)return!1;try{return Gi.subset(r,i)}catch{return!1}}function Ep(e,t){if(c3(e,t))return"satisfied";let r=typeof e=="string"&&Gi.validRange(e),i=Gi.validRange(t);if(!r||!i)return"incomparable";try{let n=Gi.minVersion(r),o=Gi.minVersion(i);return!n||!o?"incomparable":Gi.lt(n,o)?"lower":"newer"}catch{return"incomparable"}}function Rp(e,t){let r=PI.find(i=>Object.hasOwn(e[i]||{},t));return r?{section:r,existing:e[r][t]}:null}function II(e,t){let r=k_(t);if(r.size===0)return;let i=Ki.join(e,"package.json"),n=JSON.parse(qa.readFileSync(i,"utf8"));for(let[o,s]of r){let a=Rp(n,o),c=a?.section||"dependencies";n[c]||={};let l=a?.existing;n[c][o]=l===void 0?s||"latest":s&&Ep(l,s)==="lower"?s:l}qa.writeFileSync(i,`${JSON.stringify(n,null,2)}
|
|
2
|
+
var g9=Object.create;var up=Object.defineProperty;var y9=Object.getOwnPropertyDescriptor;var v9=Object.getOwnPropertyNames;var _9=Object.getPrototypeOf,b9=Object.prototype.hasOwnProperty;var Ve=(e,t)=>()=>(e&&(t=e(e=0)),t);var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bo=(e,t)=>{for(var r in t)up(e,r,{get:t[r],enumerable:!0})},VE=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of v9(t))!b9.call(e,n)&&n!==r&&up(e,n,{get:()=>t[n],enumerable:!(i=y9(t,n))||i.enumerable});return e};var Bi=(e,t,r)=>(r=e!=null?g9(_9(e)):{},VE(t||!e||!e.__esModule?up(r,"default",{value:e,enumerable:!0}):r,e)),Mr=e=>VE(up({},"__esModule",{value:!0}),e);var xa=B((VIe,S9)=>{S9.exports={name:"@frontfriend/sdk",version:"1.2.7"}});var So=B((JIe,JE)=>{var{name:w9}=xa();JE.exports={PACKAGE_NAME:w9}});var fa=B((BIe,BE)=>{var $9="https://app.frontfriend.dev",R9=".cache/frontfriend",E9={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"]},P9={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function O9(e){if(!e)return null;try{let t=new URL(e);return t.hostname.startsWith("app.")?`${t.protocol}//${t.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}BE.exports={DEFAULT_API_URL:$9,CACHE_DIR_NAME:R9,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:E9,ENV_VARS:P9,deriveRegistryFromApiUrl:O9}});var WE=B((HIe,GE)=>{GE.exports=KE;KE.sync=C9;var HE=require("fs");function I9(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function ZE(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:I9(t,r)}function KE(e,t,r){HE.stat(e,function(i,n){r(i,i?!1:ZE(n,e,t))})}function C9(e,t){return ZE(HE.statSync(e),e,t)}});var tP=B((ZIe,eP)=>{eP.exports=XE;XE.sync=k9;var YE=require("fs");function XE(e,t,r){YE.stat(e,function(i,n){r(i,i?!1:QE(n,t))})}function k9(e,t){return QE(YE.statSync(e),t)}function QE(e,t){return e.isFile()&&T9(e,t)}function T9(e,t){var r=e.mode,i=e.uid,n=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,f=r&l||r&c&&n===s||r&a&&i===o||r&u&&o===0;return f}});var nP=B((GIe,rP)=>{var KIe=require("fs"),dp;process.platform==="win32"||global.TESTING_WINDOWS?dp=WE():dp=tP();rP.exports=Qv;Qv.sync=j9;function Qv(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Qv(e,t||{},function(o,s){o?n(o):i(s)})})}dp(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function j9(e,t){try{return dp.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var uP=B((WIe,lP)=>{var sl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",iP=require("path"),A9=sl?";":":",oP=nP(),sP=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),aP=(e,t)=>{let r=t.colon||A9,i=e.match(/\//)||sl&&e.match(/\\/)?[""]:[...sl?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=sl?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=sl?n.split(r):[""];return sl&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},cP=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:o}=aP(e,t),s=[],a=l=>new Promise((u,f)=>{if(l===i.length)return t.all&&s.length?u(s):f(sP(e));let p=i[l],g=/^".*"$/.test(p)?p.slice(1,-1):p,h=iP.join(g,e),v=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;u(c(v,l,0))}),c=(l,u,f)=>new Promise((p,g)=>{if(f===n.length)return p(a(u+1));let h=n[f];oP(l+h,{pathExt:o},(v,y)=>{if(!v&&y)if(t.all)s.push(l+h);else return p(l+h);return p(c(l,u,f+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},N9=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=aP(e,t),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=iP.join(c,e),u=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<i.length;f++){let p=u+i[f];try{if(oP.sync(p,{pathExt:n}))if(t.all)o.push(p);else return p}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw sP(e)};lP.exports=cP;cP.sync=N9});var fP=B((YIe,e_)=>{"use strict";var dP=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};e_.exports=dP;e_.exports.default=dP});var gP=B((XIe,mP)=>{"use strict";var pP=require("path"),x9=uP(),M9=fP();function hP(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=x9.sync(e.command,{path:r[M9({env:r})],pathExt:t?pP.delimiter:void 0})}catch{}finally{o&&process.chdir(i)}return s&&(s=pP.resolve(n?e.options.cwd:"",s)),s}function q9(e){return hP(e)||hP(e,!0)}mP.exports=q9});var yP=B((QIe,r_)=>{"use strict";var t_=/([()\][%!^"`<>&|;, *?])/g;function L9(e){return e=e.replace(t_,"^$1"),e}function D9(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(t_,"^$1"),t&&(e=e.replace(t_,"^$1")),e}r_.exports.command=L9;r_.exports.argument=D9});var _P=B((eCe,vP)=>{"use strict";vP.exports=/^#!(.*)/});var SP=B((tCe,bP)=>{"use strict";var U9=_P();bP.exports=(e="")=>{let t=e.match(U9);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var $P=B((rCe,wP)=>{"use strict";var n_=require("fs"),z9=SP();function F9(e){let r=Buffer.alloc(150),i;try{i=n_.openSync(e,"r"),n_.readSync(i,r,0,150,0),n_.closeSync(i)}catch{}return z9(r.toString())}wP.exports=F9});var OP=B((nCe,PP)=>{"use strict";var V9=require("path"),RP=gP(),EP=yP(),J9=$P(),B9=process.platform==="win32",H9=/\.(?:com|exe)$/i,Z9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function K9(e){e.file=RP(e);let t=e.file&&J9(e.file);return t?(e.args.unshift(e.file),e.command=t,RP(e)):e.file}function G9(e){if(!B9)return e;let t=K9(e),r=!H9.test(t);if(e.options.forceShell||r){let i=Z9.test(t);e.command=V9.normalize(e.command),e.command=EP.command(e.command),e.args=e.args.map(o=>EP.argument(o,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function W9(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:G9(i)}PP.exports=W9});var kP=B((iCe,CP)=>{"use strict";var i_=process.platform==="win32";function o_(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Y9(e,t){if(!i_)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let o=IP(n,t);if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}function IP(e,t){return i_&&e===1&&!t.file?o_(t.original,"spawn"):null}function X9(e,t){return i_&&e===1&&!t.file?o_(t.original,"spawnSync"):null}CP.exports={hookChildProcess:Y9,verifyENOENT:IP,verifyENOENTSync:X9,notFoundError:o_}});var c_=B((oCe,al)=>{"use strict";var TP=require("child_process"),s_=OP(),a_=kP();function jP(e,t,r){let i=s_(e,t,r),n=TP.spawn(i.command,i.args,i.options);return a_.hookChildProcess(n,i),n}function Q9(e,t,r){let i=s_(e,t,r),n=TP.spawnSync(i.command,i.args,i.options);return n.error=n.error||a_.verifyENOENTSync(n.status,i),n}al.exports=jP;al.exports.spawn=jP;al.exports.sync=Q9;al.exports._parse=s_;al.exports._enoent=a_});var cl=B((sCe,AP)=>{"use strict";var eB="2.0.0",tB=Number.MAX_SAFE_INTEGER||9007199254740991,rB=16,nB=250,iB=["major","premajor","minor","preminor","patch","prepatch","prerelease"];AP.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:rB,MAX_SAFE_BUILD_LENGTH:nB,MAX_SAFE_INTEGER:tB,RELEASE_TYPES:iB,SEMVER_SPEC_VERSION:eB,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Fu=B((aCe,NP)=>{"use strict";var oB=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};NP.exports=oB});var ll=B((Bo,xP)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:l_,MAX_SAFE_BUILD_LENGTH:sB,MAX_LENGTH:aB}=cl(),cB=Fu();Bo=xP.exports={};var lB=Bo.re=[],uB=Bo.safeRe=[],Ze=Bo.src=[],dB=Bo.safeSrc=[],Ke=Bo.t={},fB=0,u_="[a-zA-Z0-9-]",pB=[["\\s",1],["\\d",aB],[u_,sB]],hB=e=>{for(let[t,r]of pB)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},St=(e,t,r)=>{let i=hB(t),n=fB++;cB(e,n,t),Ke[e]=n,Ze[n]=t,dB[n]=i,lB[n]=new RegExp(t,r?"g":void 0),uB[n]=new RegExp(i,r?"g":void 0)};St("NUMERICIDENTIFIER","0|[1-9]\\d*");St("NUMERICIDENTIFIERLOOSE","\\d+");St("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u_}*`);St("MAINVERSION",`(${Ze[Ke.NUMERICIDENTIFIER]})\\.(${Ze[Ke.NUMERICIDENTIFIER]})\\.(${Ze[Ke.NUMERICIDENTIFIER]})`);St("MAINVERSIONLOOSE",`(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})\\.(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})\\.(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASEIDENTIFIER",`(?:${Ze[Ke.NONNUMERICIDENTIFIER]}|${Ze[Ke.NUMERICIDENTIFIER]})`);St("PRERELEASEIDENTIFIERLOOSE",`(?:${Ze[Ke.NONNUMERICIDENTIFIER]}|${Ze[Ke.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASE",`(?:-(${Ze[Ke.PRERELEASEIDENTIFIER]}(?:\\.${Ze[Ke.PRERELEASEIDENTIFIER]})*))`);St("PRERELEASELOOSE",`(?:-?(${Ze[Ke.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Ze[Ke.PRERELEASEIDENTIFIERLOOSE]})*))`);St("BUILDIDENTIFIER",`${u_}+`);St("BUILD",`(?:\\+(${Ze[Ke.BUILDIDENTIFIER]}(?:\\.${Ze[Ke.BUILDIDENTIFIER]})*))`);St("FULLPLAIN",`v?${Ze[Ke.MAINVERSION]}${Ze[Ke.PRERELEASE]}?${Ze[Ke.BUILD]}?`);St("FULL",`^${Ze[Ke.FULLPLAIN]}$`);St("LOOSEPLAIN",`[v=\\s]*${Ze[Ke.MAINVERSIONLOOSE]}${Ze[Ke.PRERELEASELOOSE]}?${Ze[Ke.BUILD]}?`);St("LOOSE",`^${Ze[Ke.LOOSEPLAIN]}$`);St("GTLT","((?:<|>)?=?)");St("XRANGEIDENTIFIERLOOSE",`${Ze[Ke.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);St("XRANGEIDENTIFIER",`${Ze[Ke.NUMERICIDENTIFIER]}|x|X|\\*`);St("XRANGEPLAIN",`[v=\\s]*(${Ze[Ke.XRANGEIDENTIFIER]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIER]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIER]})(?:${Ze[Ke.PRERELEASE]})?${Ze[Ke.BUILD]}?)?)?`);St("XRANGEPLAINLOOSE",`[v=\\s]*(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:${Ze[Ke.PRERELEASELOOSE]})?${Ze[Ke.BUILD]}?)?)?`);St("XRANGE",`^${Ze[Ke.GTLT]}\\s*${Ze[Ke.XRANGEPLAIN]}$`);St("XRANGELOOSE",`^${Ze[Ke.GTLT]}\\s*${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("COERCEPLAIN",`(^|[^\\d])(\\d{1,${l_}})(?:\\.(\\d{1,${l_}}))?(?:\\.(\\d{1,${l_}}))?`);St("COERCE",`${Ze[Ke.COERCEPLAIN]}(?:$|[^\\d])`);St("COERCEFULL",Ze[Ke.COERCEPLAIN]+`(?:${Ze[Ke.PRERELEASE]})?(?:${Ze[Ke.BUILD]})?(?:$|[^\\d])`);St("COERCERTL",Ze[Ke.COERCE],!0);St("COERCERTLFULL",Ze[Ke.COERCEFULL],!0);St("LONETILDE","(?:~>?)");St("TILDETRIM",`(\\s*)${Ze[Ke.LONETILDE]}\\s+`,!0);Bo.tildeTrimReplace="$1~";St("TILDE",`^${Ze[Ke.LONETILDE]}${Ze[Ke.XRANGEPLAIN]}$`);St("TILDELOOSE",`^${Ze[Ke.LONETILDE]}${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("LONECARET","(?:\\^)");St("CARETTRIM",`(\\s*)${Ze[Ke.LONECARET]}\\s+`,!0);Bo.caretTrimReplace="$1^";St("CARET",`^${Ze[Ke.LONECARET]}${Ze[Ke.XRANGEPLAIN]}$`);St("CARETLOOSE",`^${Ze[Ke.LONECARET]}${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("COMPARATORLOOSE",`^${Ze[Ke.GTLT]}\\s*(${Ze[Ke.LOOSEPLAIN]})$|^$`);St("COMPARATOR",`^${Ze[Ke.GTLT]}\\s*(${Ze[Ke.FULLPLAIN]})$|^$`);St("COMPARATORTRIM",`(\\s*)${Ze[Ke.GTLT]}\\s*(${Ze[Ke.LOOSEPLAIN]}|${Ze[Ke.XRANGEPLAIN]})`,!0);Bo.comparatorTrimReplace="$1$2$3";St("HYPHENRANGE",`^\\s*(${Ze[Ke.XRANGEPLAIN]})\\s+-\\s+(${Ze[Ke.XRANGEPLAIN]})\\s*$`);St("HYPHENRANGELOOSE",`^\\s*(${Ze[Ke.XRANGEPLAINLOOSE]})\\s+-\\s+(${Ze[Ke.XRANGEPLAINLOOSE]})\\s*$`);St("STAR","(<|>)?=?\\s*\\*");St("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");St("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fp=B((cCe,MP)=>{"use strict";var mB=Object.freeze({loose:!0}),gB=Object.freeze({}),yB=e=>e?typeof e!="object"?mB:e:gB;MP.exports=yB});var d_=B((lCe,DP)=>{"use strict";var qP=/^[0-9]+$/,LP=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=qP.test(e),i=qP.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},vB=(e,t)=>LP(t,e);DP.exports={compareIdentifiers:LP,rcompareIdentifiers:vB}});var Sn=B((uCe,zP)=>{"use strict";var pp=Fu(),{MAX_LENGTH:UP,MAX_SAFE_INTEGER:hp}=cl(),{safeRe:mp,t:gp}=ll(),_B=fp(),{compareIdentifiers:f_}=d_(),bB=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let i=0;i<r.length;i++)if(f_(e[i],r[i])!==0)return!1;return!0},p_=class e{constructor(t,r){if(r=_B(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>UP)throw new TypeError(`version is longer than ${UP} characters`);pp("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=t.trim().match(r.loose?mp[gp.LOOSE]:mp[gp.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>hp||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hp||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hp||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<hp)return o}return n}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(pp("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let i=this.prerelease[r],n=t.prerelease[r];if(pp("prerelease compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return f_(i,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let i=this.build[r],n=t.build[r];if(pp("build compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return f_(i,n)}while(++r)}inc(t,r,i){if(t.startsWith("pre")){if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?mp[gp.PRERELEASELOOSE]:mp[gp.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,i);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 n=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let o=[r,n];if(i===!1&&(o=[r]),bB(this.prerelease,r)){let s=this.prerelease[r.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};zP.exports=p_});var Ma=B((dCe,VP)=>{"use strict";var FP=Sn(),SB=(e,t,r=!1)=>{if(e instanceof FP)return e;try{return new FP(e,t)}catch(i){if(!r)return null;throw i}};VP.exports=SB});var BP=B((fCe,JP)=>{"use strict";var wB=Ma(),$B=(e,t)=>{let r=wB(e,t);return r?r.version:null};JP.exports=$B});var ZP=B((pCe,HP)=>{"use strict";var RB=Ma(),EB=(e,t)=>{let r=RB(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};HP.exports=EB});var WP=B((hCe,GP)=>{"use strict";var KP=Sn(),PB=(e,t,r,i,n)=>{typeof r=="string"&&(n=i,i=r,r=void 0);try{return new KP(e instanceof KP?e.version:e,r).inc(t,i,n).version}catch{return null}};GP.exports=PB});var QP=B((mCe,XP)=>{"use strict";var YP=Ma(),OB=(e,t)=>{let r=YP(e,null,!0),i=YP(t,null,!0),n=r.compare(i);if(n===0)return null;let o=n>0,s=o?r:i,a=o?i:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"};XP.exports=OB});var tO=B((gCe,eO)=>{"use strict";var IB=Sn(),CB=(e,t)=>new IB(e,t).major;eO.exports=CB});var nO=B((yCe,rO)=>{"use strict";var kB=Sn(),TB=(e,t)=>new kB(e,t).minor;rO.exports=TB});var oO=B((vCe,iO)=>{"use strict";var jB=Sn(),AB=(e,t)=>new jB(e,t).patch;iO.exports=AB});var aO=B((_Ce,sO)=>{"use strict";var NB=Ma(),xB=(e,t)=>{let r=NB(e,t);return r&&r.prerelease.length?r.prerelease:null};sO.exports=xB});var Hi=B((bCe,lO)=>{"use strict";var cO=Sn(),MB=(e,t,r)=>new cO(e,r).compare(new cO(t,r));lO.exports=MB});var dO=B((SCe,uO)=>{"use strict";var qB=Hi(),LB=(e,t,r)=>qB(t,e,r);uO.exports=LB});var pO=B((wCe,fO)=>{"use strict";var DB=Hi(),UB=(e,t)=>DB(e,t,!0);fO.exports=UB});var yp=B(($Ce,mO)=>{"use strict";var hO=Sn(),zB=(e,t,r)=>{let i=new hO(e,r),n=new hO(t,r);return i.compare(n)||i.compareBuild(n)};mO.exports=zB});var yO=B((RCe,gO)=>{"use strict";var FB=yp(),VB=(e,t)=>e.sort((r,i)=>FB(r,i,t));gO.exports=VB});var _O=B((ECe,vO)=>{"use strict";var JB=yp(),BB=(e,t)=>e.sort((r,i)=>JB(i,r,t));vO.exports=BB});var Vu=B((PCe,bO)=>{"use strict";var HB=Hi(),ZB=(e,t,r)=>HB(e,t,r)>0;bO.exports=ZB});var vp=B((OCe,SO)=>{"use strict";var KB=Hi(),GB=(e,t,r)=>KB(e,t,r)<0;SO.exports=GB});var h_=B((ICe,wO)=>{"use strict";var WB=Hi(),YB=(e,t,r)=>WB(e,t,r)===0;wO.exports=YB});var m_=B((CCe,$O)=>{"use strict";var XB=Hi(),QB=(e,t,r)=>XB(e,t,r)!==0;$O.exports=QB});var _p=B((kCe,RO)=>{"use strict";var eH=Hi(),tH=(e,t,r)=>eH(e,t,r)>=0;RO.exports=tH});var bp=B((TCe,EO)=>{"use strict";var rH=Hi(),nH=(e,t,r)=>rH(e,t,r)<=0;EO.exports=nH});var g_=B((jCe,PO)=>{"use strict";var iH=h_(),oH=m_(),sH=Vu(),aH=_p(),cH=vp(),lH=bp(),uH=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return iH(e,r,i);case"!=":return oH(e,r,i);case">":return sH(e,r,i);case">=":return aH(e,r,i);case"<":return cH(e,r,i);case"<=":return lH(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}};PO.exports=uH});var IO=B((ACe,OO)=>{"use strict";var dH=Sn(),fH=Ma(),{safeRe:Sp,t:wp}=ll(),pH=(e,t)=>{if(e instanceof dH)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Sp[wp.COERCEFULL]:Sp[wp.COERCE]);else{let c=t.includePrerelease?Sp[wp.COERCERTLFULL]:Sp[wp.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let i=r[2],n=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return fH(`${i}.${n}.${o}${s}${a}`,t)};OO.exports=pH});var kO=B((NCe,CO)=>{"use strict";var hH=Ma(),mH=cl(),gH=Sn(),yH=(e,t,r)=>{if(!mH.RELEASE_TYPES.includes(t))return null;let i=vH(e,r);return i&&_H(i,t)},vH=(e,t)=>{let r=e instanceof gH?e.version:e;return hH(r,t)},_H=(e,t)=>{if(bH(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},bH=e=>e.startsWith("pre");CO.exports=yH});var jO=B((xCe,TO)=>{"use strict";var y_=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(t,r)}return this}};TO.exports=y_});var Zi=B((MCe,MO)=>{"use strict";var SH=/\s+/g,v_=class e{constructor(t,r){if(r=$H(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof __)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(SH," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!NO(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&jH(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let i=0;i<r.length;i++)i>0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(TH,"");let i=((this.options.includePrerelease&&CH)|(this.options.loose&&kH))+":"+t,n=AO.get(i);if(n)return n;let o=this.options.loose,s=o?Bn[wn.HYPHENRANGELOOSE]:Bn[wn.HYPHENRANGE];t=t.replace(s,VH(this.options.includePrerelease)),dr("hyphen replace",t),t=t.replace(Bn[wn.COMPARATORTRIM],PH),dr("comparator trim",t),t=t.replace(Bn[wn.TILDETRIM],OH),dr("tilde trim",t),t=t.replace(Bn[wn.CARETTRIM],IH),dr("caret trim",t);let a=t.split(" ").map(f=>AH(f,this.options)).join(" ").split(/\s+/).map(f=>FH(f,this.options));o&&(a=a.filter(f=>(dr("loose invalid filter",f,this.options),!!f.match(Bn[wn.COMPARATORLOOSE])))),dr("range list",a);let c=new Map,l=a.map(f=>new __(f,this.options));for(let f of l){if(NO(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return AO.set(i,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>xO(i,r)&&t.set.some(n=>xO(n,r)&&i.every(o=>n.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new RH(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(JH(this.set[r],t,this.options))return!0;return!1}};MO.exports=v_;var wH=jO(),AO=new wH,$H=fp(),__=Ju(),dr=Fu(),RH=Sn(),{safeRe:Bn,src:EH,t:wn,comparatorTrimReplace:PH,tildeTrimReplace:OH,caretTrimReplace:IH}=ll(),{FLAG_INCLUDE_PRERELEASE:CH,FLAG_LOOSE:kH}=cl(),TH=new RegExp(EH[wn.BUILD],"g"),NO=e=>e.value==="<0.0.0-0",jH=e=>e.value==="",xO=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(o=>n.intersects(o,t)),n=i.pop();return r},AH=(e,t)=>(e=e.replace(Bn[wn.BUILD],""),dr("comp",e,t),e=qH(e,t),dr("caret",e),e=xH(e,t),dr("tildes",e),e=DH(e,t),dr("xrange",e),e=zH(e,t),dr("stars",e),e),Wr=e=>!e||e.toLowerCase()==="x"||e==="*",NH=(e,t,r)=>Wr(e)&&!Wr(t)||Wr(t)&&r&&!Wr(r),xH=(e,t)=>e.trim().split(/\s+/).map(r=>MH(r,t)).join(" "),MH=(e,t)=>{let r=t.loose?Bn[wn.TILDELOOSE]:Bn[wn.TILDE],i=t.includePrerelease?"-0":"";return e.replace(r,(n,o,s,a,c)=>{dr("tilde",e,n,o,s,a,c);let l;return Wr(o)?l="":Wr(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Wr(a)?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c?(dr("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,dr("tilde return",l),l})},qH=(e,t)=>e.trim().split(/\s+/).map(r=>LH(r,t)).join(" "),LH=(e,t)=>{dr("caret",e,t);let r=t.loose?Bn[wn.CARETLOOSE]:Bn[wn.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,o,s,a,c)=>{dr("caret",e,n,o,s,a,c);let l;return Wr(o)?l="":Wr(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Wr(a)?o==="0"?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(dr("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(dr("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),dr("caret return",l),l})},DH=(e,t)=>(dr("replaceXRanges",e,t),e.split(/\s+/).map(r=>UH(r,t)).join(" ")),UH=(e,t)=>{e=e.trim();let r=t.loose?Bn[wn.XRANGELOOSE]:Bn[wn.XRANGE];return e.replace(r,(i,n,o,s,a,c)=>{if(dr("xRange",e,i,n,o,s,a,c),NH(o,s,a))return e;let l=Wr(o),u=l||Wr(s),f=u||Wr(a),p=f;return n==="="&&p&&(n=""),c=t.includePrerelease?"-0":"",l?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&p?(u&&(s=0),a=0,n===">"?(n=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):n==="<="&&(n="<",u?o=+o+1:s=+s+1),n==="<"&&(c="-0"),i=`${n+o}.${s}.${a}${c}`):u?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),dr("xRange return",i),i})},zH=(e,t)=>(dr("replaceStars",e,t),e.trim().replace(Bn[wn.STAR],"")),FH=(e,t)=>(dr("replaceGTE0",e,t),e.trim().replace(Bn[t.includePrerelease?wn.GTE0PRE:wn.GTE0],"")),VH=e=>(t,r,i,n,o,s,a,c,l,u,f,p)=>(Wr(i)?r="":Wr(n)?r=`>=${i}.0.0${e?"-0":""}`:Wr(o)?r=`>=${i}.${n}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,Wr(l)?c="":Wr(u)?c=`<${+l+1}.0.0-0`:Wr(f)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${f}-${p}`:e?c=`<${l}.${u}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),JH=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(dr(e[i].semver),e[i].semver!==__.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}});var Ju=B((qCe,FO)=>{"use strict";var Bu=Symbol("SemVer ANY"),w_=class e{static get ANY(){return Bu}constructor(t,r){if(r=qO(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),S_("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Bu?this.value="":this.value=this.operator+this.semver.version,S_("comp",this)}parse(t){let r=this.options.loose?LO[DO.COMPARATORLOOSE]:LO[DO.COMPARATOR],i=t.match(r);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new UO(i[2],this.options.loose):this.semver=Bu}toString(){return this.value}test(t){if(S_("Comparator.test",t,this.options.loose),this.semver===Bu||t===Bu)return!0;if(typeof t=="string")try{t=new UO(t,this.options)}catch{return!1}return b_(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new zO(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new zO(this.value,r).test(t.semver):(r=qO(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||b_(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||b_(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};FO.exports=w_;var qO=fp(),{safeRe:LO,t:DO}=ll(),b_=g_(),S_=Fu(),UO=Sn(),zO=Zi()});var Hu=B((LCe,VO)=>{"use strict";var BH=Zi(),HH=(e,t,r)=>{try{t=new BH(t,r)}catch{return!1}return t.test(e)};VO.exports=HH});var BO=B((DCe,JO)=>{"use strict";var ZH=Zi(),KH=(e,t)=>new ZH(e,t).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));JO.exports=KH});var ZO=B((UCe,HO)=>{"use strict";var GH=Sn(),WH=Zi(),YH=(e,t,r)=>{let i=null,n=null,o=null;try{o=new WH(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||n.compare(s)===-1)&&(i=s,n=new GH(i,r))}),i};HO.exports=YH});var GO=B((zCe,KO)=>{"use strict";var XH=Sn(),QH=Zi(),eZ=(e,t,r)=>{let i=null,n=null,o=null;try{o=new QH(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||n.compare(s)===1)&&(i=s,n=new XH(i,r))}),i};KO.exports=eZ});var XO=B((FCe,YO)=>{"use strict";var $_=Sn(),tZ=Zi(),WO=Vu(),rZ=(e,t)=>{e=new tZ(e,t);let r=new $_("0.0.0");if(e.test(r)||(r=new $_("0.0.0-0"),e.test(r)))return r;r=null;for(let i=0;i<e.set.length;++i){let n=e.set[i],o=null;n.forEach(s=>{let a=new $_(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||WO(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||WO(r,o))&&(r=o)}return r&&e.test(r)?r:null};YO.exports=rZ});var eI=B((VCe,QO)=>{"use strict";var nZ=Zi(),iZ=(e,t)=>{try{return new nZ(e,t).range||"*"}catch{return null}};QO.exports=iZ});var $p=B((JCe,iI)=>{"use strict";var oZ=Sn(),nI=Ju(),{ANY:sZ}=nI,aZ=Zi(),cZ=Hu(),tI=Vu(),rI=vp(),lZ=bp(),uZ=_p(),dZ=(e,t,r,i)=>{e=new oZ(e,i),t=new aZ(t,i);let n,o,s,a,c;switch(r){case">":n=tI,o=lZ,s=rI,a=">",c=">=";break;case"<":n=rI,o=uZ,s=tI,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(cZ(e,t,i))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],f=null,p=null;if(u.forEach(g=>{g.semver===sZ&&(g=new nI(">=0.0.0")),f=f||g,p=p||g,n(g.semver,f.semver,i)?f=g:s(g.semver,p.semver,i)&&(p=g)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};iI.exports=dZ});var sI=B((BCe,oI)=>{"use strict";var fZ=$p(),pZ=(e,t,r)=>fZ(e,t,">",r);oI.exports=pZ});var cI=B((HCe,aI)=>{"use strict";var hZ=$p(),mZ=(e,t,r)=>hZ(e,t,"<",r);aI.exports=mZ});var dI=B((ZCe,uI)=>{"use strict";var lI=Zi(),gZ=(e,t,r)=>(e=new lI(e,r),t=new lI(t,r),e.intersects(t,r));uI.exports=gZ});var pI=B((KCe,fI)=>{"use strict";var yZ=Hu(),vZ=Hi();fI.exports=(e,t,r)=>{let i=[],n=null,o=null,s=e.sort((u,f)=>vZ(u,f,r));for(let u of s)yZ(u,t,r)?(o=u,n||(n=u)):(o&&i.push([n,o]),o=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,f]of i)u===f?a.push(u):!f&&u===s[0]?a.push("*"):f?u===s[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var _I=B((GCe,vI)=>{"use strict";var hI=Zi(),P_=Ju(),{ANY:R_}=P_,E_=Hu(),O_=Hi(),_Z=(e,t,r={})=>{if(e===t)return!0;e=new hI(e,r),t=new hI(t,r);let i=!1;e:for(let n of e.set){for(let o of t.set){let s=SZ(n,o,r);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},bZ=[new P_(">=0.0.0-0")],mI=[new P_(">=0.0.0")],SZ=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===R_){if(t.length===1&&t[0].semver===R_)return!0;r.includePrerelease?e=bZ:e=mI}if(t.length===1&&t[0].semver===R_){if(r.includePrerelease)return!0;t=mI}let i=new Set,n,o;for(let g of e)g.operator===">"||g.operator===">="?n=gI(n,g,r):g.operator==="<"||g.operator==="<="?o=yI(o,g,r):i.add(g.semver);if(i.size>1)return null;let s;if(n&&o){if(s=O_(n.semver,o.semver,r),s>0)return null;if(s===0&&(n.operator!==">="||o.operator!=="<="))return null}for(let g of i){if(n&&!E_(g,String(n),r)||o&&!E_(g,String(o),r))return null;for(let h of t)if(!E_(g,String(h),r))return!1;return!0}let a,c,l,u,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let g of t){if(u=u||g.operator===">"||g.operator===">=",l=l||g.operator==="<"||g.operator==="<=",n){if(p&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===p.major&&g.semver.minor===p.minor&&g.semver.patch===p.patch&&(p=!1),g.operator===">"||g.operator===">="){if(a=gI(n,g,r),a===g&&a!==n)return!1}else if(n.operator===">="&&!g.test(n.semver))return!1}if(o){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator==="<"||g.operator==="<="){if(c=yI(o,g,r),c===g&&c!==o)return!1}else if(o.operator==="<="&&!g.test(o.semver))return!1}if(!g.operator&&(o||n)&&s!==0)return!1}return!(n&&l&&!o&&s!==0||o&&u&&!n&&s!==0||p||f)},gI=(e,t,r)=>{if(!e)return t;let i=O_(e.semver,t.semver,r);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},yI=(e,t,r)=>{if(!e)return t;let i=O_(e.semver,t.semver,r);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};vI.exports=_Z});var $I=B((WCe,wI)=>{"use strict";var I_=ll(),bI=cl(),wZ=Sn(),SI=d_(),$Z=Ma(),RZ=BP(),EZ=ZP(),PZ=WP(),OZ=QP(),IZ=tO(),CZ=nO(),kZ=oO(),TZ=aO(),jZ=Hi(),AZ=dO(),NZ=pO(),xZ=yp(),MZ=yO(),qZ=_O(),LZ=Vu(),DZ=vp(),UZ=h_(),zZ=m_(),FZ=_p(),VZ=bp(),JZ=g_(),BZ=IO(),HZ=kO(),ZZ=Ju(),KZ=Zi(),GZ=Hu(),WZ=BO(),YZ=ZO(),XZ=GO(),QZ=XO(),e3=eI(),t3=$p(),r3=sI(),n3=cI(),i3=dI(),o3=pI(),s3=_I();wI.exports={parse:$Z,valid:RZ,clean:EZ,inc:PZ,diff:OZ,major:IZ,minor:CZ,patch:kZ,prerelease:TZ,compare:jZ,rcompare:AZ,compareLoose:NZ,compareBuild:xZ,sort:MZ,rsort:qZ,gt:LZ,lt:DZ,eq:UZ,neq:zZ,gte:FZ,lte:VZ,cmp:JZ,coerce:BZ,truncate:HZ,Comparator:ZZ,Range:KZ,satisfies:GZ,toComparators:WZ,maxSatisfying:YZ,minSatisfying:XZ,minVersion:QZ,validRange:e3,outside:t3,gtr:r3,ltr:n3,intersects:i3,simplifyRange:o3,subset:s3,SemVer:wZ,re:I_.re,src:I_.src,tokens:I_.t,SEMVER_SPEC_VERSION:bI.SEMVER_SPEC_VERSION,RELEASE_TYPES:bI.RELEASE_TYPES,compareIdentifiers:SI.compareIdentifiers,rcompareIdentifiers:SI.rcompareIdentifiers}});var pa=B((YCe,NI)=>{var qa=require("fs"),Ki=require("path"),EI=c_(),Gi=$I(),{DEFAULT_API_URL:a3}=fa(),PI=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function C_(e){let t=typeof e=="string"&&e.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!t)throw new Error(`Invalid npm dependency: ${String(e)}`);return{name:t[1],version:t[2]}}function k_(e){let t=new Map;for(let r of e){let{name:i,version:n}=C_(r),o=t.get(i);t.set(i,o&&n?OI(i,o,n):n||o)}return t}function OI(e,t,r){if(t===r)return t;let i=Gi.validRange(t),n=Gi.validRange(r);if(i&&n)try{if(Gi.subset(n,i))return r;if(Gi.subset(i,n))return t}catch{}throw new Error(`Conflicting registry versions for ${e}: ${t} and ${r}`)}function c3(e,t){let r=typeof e=="string"&&Gi.validRange(e),i=Gi.validRange(t);if(!r||!i)return!1;try{return Gi.subset(r,i)}catch{return!1}}function Ep(e,t){if(c3(e,t))return"satisfied";let r=typeof e=="string"&&Gi.validRange(e),i=Gi.validRange(t);if(!r||!i)return"incomparable";try{let n=Gi.minVersion(r),o=Gi.minVersion(i);return!n||!o?"incomparable":Gi.lt(n,o)?"lower":"newer"}catch{return"incomparable"}}function Rp(e,t){let r=PI.find(i=>Object.hasOwn(e[i]||{},t));return r?{section:r,existing:e[r][t]}:null}function II(e,t){let r=k_(t);if(r.size===0)return;let i=Ki.join(e,"package.json"),n=JSON.parse(qa.readFileSync(i,"utf8"));for(let[o,s]of r){let a=Rp(n,o),c=a?.section||"dependencies";n[c]||={};let l=a?.existing;n[c][o]=l===void 0?s||"latest":s&&Ep(l,s)==="lower"?s:l}qa.writeFileSync(i,`${JSON.stringify(n,null,2)}
|
|
3
3
|
`)}function Pp(e){let t=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];for(let r=Ki.resolve(e);;r=Ki.dirname(r)){let i=Ki.join(r,"package.json");if(qa.existsSync(i)){let n=JSON.parse(qa.readFileSync(i,"utf8")),o=String(n.packageManager||"").split("@")[0];if(["npm","pnpm","yarn","bun"].includes(o))return o}for(let[n,o]of t)if(qa.existsSync(Ki.join(r,n)))return o;if(Ki.dirname(r)===r)return"npm"}}var RI={npm:"npx",pnpm:"pnpm exec",yarn:"yarn",bun:"bunx"};function CI(e,t=process.cwd()){let r;try{r=Pp(t)}catch{r="npm"}return`${RI[r]||RI.npm} frontfriend ${e}`}function l3(e,t=process.cwd()){let r=null;try{r=e?new URL(e).origin:null}catch{r=null}return CI(r&&r!==new URL(a3).origin?`login --api-url ${r}`:"login",t)}function kI(e){return JSON.parse(qa.readFileSync(Ki.join(e,"package.json"),"utf8"))}function T_(e,t){let r=k_(t);if(r.size===0)return[];let i=kI(e),n=[];for(let[o,s]of r){let a=Rp(i,o);a&&(!s||Ep(a.existing,s)!=="lower")||n.push(s?`${o}@${s}`:o)}return n}function u3(e,t){let r=t.filter(f=>f.required),i=k_(r.flatMap(f=>f.dependencies)),n=(f,p)=>p.filter(g=>g.dependencies.some(h=>C_(h).name===f)).map(g=>g.component).filter(Boolean),o=t.filter(f=>!f.required);if(i.size===0&&o.length===0)return{missing:[],kept:[],repair:[]};let s=kI(e),a=[],c=[];for(let[f,p]of i){let g=Rp(s,f);if(!g){a.push(p?`${f}@${p}`:f);continue}if(!p)continue;let h=Ep(g.existing,p);h==="lower"?a.push(`${f}@${p}`):h!=="satisfied"&&c.push({name:f,current:g.existing,declared:p,components:n(f,r)})}let l=new Map;for(let f of o.flatMap(p=>p.dependencies)){let{name:p,version:g}=C_(f);if(i.has(p)||Rp(s,p))continue;let h=l.get(p),v=g||h?.version;if(h?.version&&g&&h.version!==g)try{v=OI(p,h.version,g)}catch{v=h.version}l.set(p,{version:v})}let u=[...l].map(([f,{version:p}])=>({request:p?`${f}@${p}`:f,components:n(f,o)}));return{missing:a,kept:c,repair:u}}function TI(e,t){return[e==="npm"?"install":"add",...t]}function d3(e){return/^[\w@/.:^~=+-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function jI(e,t){let r=Pp(e);return[r,...TI(r,t)].map(d3).join(" ")}function AI(e,t,{stdio:r="inherit"}={}){let i=T_(e,t);if(i.length===0)return;let n=Pp(e),o=EI.sync(n,TI(n,i),{cwd:e,stdio:r});if(o.error||o.status!==0)throw II(e,t),o.error||new Error(`${n} dependency installation failed with status ${o.status}. Dependencies were saved; run ${n} install.`)}function f3(e,t,{install:r=!0,stdio:i="inherit",log:n=console.log}={}){let o=T_(e,t);if(o.length===0)return{missing:o,command:null,installed:!1};let s=jI(e,o);if(!r)return n(`\u{1F4E6} Component dependencies missing from package.json. Install them with:
|
|
4
4
|
${s}`),{missing:o,command:s,installed:!1};n(`\u{1F4E6} Installing component dependencies: ${s}`);try{return AI(e,o,{stdio:i}),{missing:o,command:s,installed:!0}}catch(a){return n(`\u26A0\uFE0F Component dependencies were not installed: ${a.message}
|
|
5
5
|
Install them with:
|
|
@@ -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.
|
|
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.7"}});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.7"}});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.7"}});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.
|
|
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.7"}});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
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var C=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var Er=C(($f,Oo)=>{Oo.exports={name:"@frontfriend/sdk",version:"1.2.
|
|
1
|
+
var C=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var Er=C(($f,Oo)=>{Oo.exports={name:"@frontfriend/sdk",version:"1.2.7"}});var Sr=C((qf,br)=>{var{name:Fo}=Er();br.exports={PACKAGE_NAME:Fo}});var Ge=C((jf,wr)=>{var Vo="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}}wr.exports={DEFAULT_API_URL:Vo,CACHE_DIR_NAME:Do,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:$o,ENV_VARS:qo,deriveRegistryFromApiUrl:jo}});var _r=C((Bf,Cr)=>{var Bt=class extends Error{constructor(i,n,o){super(i),this.name="APIError",this.statusCode=n,this.url=o,this.code=`API_${n}`}},Ut=class extends Error{constructor(i,n){super(i),this.name="CacheError",this.operation=n,this.code=`CACHE_${n.toUpperCase()}`}},Mt=class extends Error{constructor(i,n){super(i),this.name="ConfigError",this.field=n,this.code=n?`CONFIG_${String(n).toUpperCase()}`:"CONFIG_ERROR"}},Gt=class extends Error{constructor(i,n){super(i),this.name="ProcessingError",this.token=n,this.code="PROCESSING_ERROR"}};Cr.exports={APIError:Bt,CacheError:Ut,ConfigError:Mt,ProcessingError:Gt}});var He=C((Uf,Ir)=>{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)}}Ir.exports={writePrivateJsonFileAtomic:Yo,withPrivateFileLock:Jo,readJsonFileSafe:Bo,readFileSafe:Uo,writeJsonFile:Mo,writeTextFile:Go,writeModuleExportsFile:Ho,fileExists:Wo,ensureDirectoryExists:Xo,removeDirectory:zo,removeFile:Ko}});var Ht=C((Mf,kr)=>{var Qo="classes.txt",Zo="classes.css";kr.exports={CLASSES_SOURCE_FILE:Qo,CSS_CLASSES_SOURCE_FILE:Zo}});var Lr=C((Gf,Tr)=>{var Q=require("path"),{CACHE_DIR_NAME:eu,CACHE_TTL_MS:tu,CACHE_FILES:Ar}=Ge(),{CacheError:Wt}=_r(),{readJsonFileSafe:ht,readFileSafe:iu,writeJsonFile:Nr,writeTextFile:Rr,writeModuleExportsFile:Pr,fileExists:Xt,ensureDirectoryExists:ru,removeDirectory:su,removeFile:nu}=He(),{CLASSES_SOURCE_FILE:au,CSS_CLASSES_SOURCE_FILE:ou}=Ht(),zt=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 ht(this.metadataFile)?.version==="local-components"}getIconLibrary(){let i=Q.join(this.cacheDir,"iconLibrary.json");return Xt(i)?ht(i):null}exists(){return Xt(this.cacheDir)}isValid(){if(!this.exists())return!1;try{let i=ht(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 Ar.JS){let o=Q.join(this.cacheDir,n);if(Xt(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 Ar.JSON){let o=Q.join(this.cacheDir,n),l=n.replace(".json",""),h=ht(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 Wt(`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`);Pr(f,i[h])}if(i.safelist&&Array.isArray(i.safelist)){let h=Q.join(this.cacheDir,"safelist.js");Pr(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`);Nr(m,f)}i.themeCSS!==void 0&&Rr(Q.join(this.cacheDir,"theme.css"),i.themeCSS),i.classesContent!==void 0&&(Rr(Q.join(this.cacheDir,au),i.classesContent),nu(Q.join(this.cacheDir,ou))),Nr(this.metadataFile,n)}catch(n){throw new Wt(`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 w=Number(o.readFileSync(h,"utf8")),g=!0;if(w>0)try{process.kill(w,0)}catch(S){g=S.code!=="ESRCH"}if(g)throw new Wt("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(w){throw o.rmSync(this.cacheDir,{recursive:!0,force:!0}),o.existsSync(m)&&o.renameSync(m,this.cacheDir),w}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)}};Tr.exports=zt});var Dr=C((Hf,Vr)=>{function de(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Kt(r,i){if(!de(r)||!de(i))return i===void 0?r:i;let n={...r};for(let[o,l]of Object.entries(i))n[o]=o in n?Kt(n[o],l):l;return n}function Yt(r,i,n=[],o=[]){if(r===void 0||i===void 0)return o;if(!de(r)||!de(i))return o.push(n.join(".")),o;for(let l of Object.keys(r))l in i&&Yt(r[l],i[l],[...n,l],o);return o}function Or(r){return de(r)&&("styles"in r||"behavior"in r)}function Fr(r,i="component"){if(!Or(r)||!de(r.styles)||r.behavior!==void 0&&!de(r.behavior)||Object.keys(r).some(o=>!["styles","behavior"].includes(o)))throw new TypeError(`Component ${i} must use the styles/behavior envelope`);let n=Yt(r.styles,r.behavior,[i]);if(n.length>0)throw new Error(`Component config styles/behavior conflict at ${n.join(", ")}`);return Kt(r.styles||{},r.behavior||{})}function uu(r){if(!de(r))return r;let i=!1,n={};for(let[o,l]of Object.entries(r))n[o]=Fr(l,o),n[o]!==l&&(i=!0);return i?n:r}Vr.exports={isPlainObject:de,deepMerge:Kt,findTreeConflicts:Yt,isComponentEnvelope:Or,toRuntimeComponentConfig:Fr,toRuntimeComponentsConfig:uu}});var Ur=C((Wf,Br)=>{Br.exports=jr;jr.sync=hu;var $r=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 qr(r,i,n){return!r.isSymbolicLink()&&!r.isFile()?!1:cu(i,n)}function jr(r,i,n){$r.stat(r,function(o,l){n(o,o?!1:qr(l,r,i))})}function hu(r,i){return qr($r.statSync(r),r,i)}});var Xr=C((Xf,Wr)=>{Wr.exports=Gr;Gr.sync=lu;var Mr=require("fs");function Gr(r,i,n){Mr.stat(r,function(o,l){n(o,o?!1:Hr(l,i))})}function lu(r,i){return Hr(Mr.statSync(r),i)}function Hr(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),w=m|y,g=n&x||n&y&&l===f||n&m&&o===h||n&w&&h===0;return g}});var Kr=C((Kf,zr)=>{var zf=require("fs"),lt;process.platform==="win32"||global.TESTING_WINDOWS?lt=Ur():lt=Xr();zr.exports=Jt;Jt.sync=pu;function Jt(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){Jt(r,i||{},function(h,f){h?l(h):o(f)})})}lt(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 lt.sync(r,i||{})}catch(n){if(i&&i.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var is=C((Yf,ts)=>{var Pe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Yr=require("path"),du=Pe?";":":",Jr=Kr(),Qr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),Zr=(r,i)=>{let n=i.colon||du,o=r.match(/\//)||Pe&&r.match(/\\/)?[""]:[...Pe?[process.cwd()]:[],...(i.path||process.env.PATH||"").split(n)],l=Pe?i.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",h=Pe?l.split(n):[""];return Pe&&r.indexOf(".")!==-1&&h[0]!==""&&h.unshift(""),{pathEnv:o,pathExt:h,pathExtExe:l}},es=(r,i,n)=>{typeof i=="function"&&(n=i,i={}),i||(i={});let{pathEnv:o,pathExt:l,pathExtExe:h}=Zr(r,i),f=[],m=x=>new Promise((w,g)=>{if(x===o.length)return i.all&&f.length?w(f):g(Qr(r));let S=o[x],E=/^".*"$/.test(S)?S.slice(1,-1):S,k=Yr.join(E,r),B=!E&&/^\.[\\\/]/.test(r)?r.slice(0,2)+k:k;w(y(B,x,0))}),y=(x,w,g)=>new Promise((S,E)=>{if(g===l.length)return S(m(w+1));let k=l[g];Jr(x+k,{pathExt:h},(B,Y)=>{if(!B&&Y)if(i.all)f.push(x+k);else return S(x+k);return S(y(x,w,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}=Zr(r,i),h=[];for(let f=0;f<n.length;f++){let m=n[f],y=/^".*"$/.test(m)?m.slice(1,-1):m,x=Yr.join(y,r),w=!y&&/^\.[\\\/]/.test(r)?r.slice(0,2)+x:x;for(let g=0;g<o.length;g++){let S=w+o[g];try{if(Jr.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 Qr(r)};ts.exports=es;es.sync=mu});var ss=C((Jf,Qt)=>{"use strict";var rs=(r={})=>{let i=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(i).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};Qt.exports=rs;Qt.exports.default=rs});var us=C((Qf,os)=>{"use strict";var ns=require("path"),xu=is(),gu=ss();function as(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?ns.delimiter:void 0})}catch{}finally{h&&process.chdir(o)}return f&&(f=ns.resolve(l?r.options.cwd:"",f)),f}function vu(r){return as(r)||as(r,!0)}os.exports=vu});var cs=C((Zf,ei)=>{"use strict";var Zt=/([()\][%!^"`<>&|;, *?])/g;function yu(r){return r=r.replace(Zt,"^$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(Zt,"^$1"),i&&(r=r.replace(Zt,"^$1")),r}ei.exports.command=yu;ei.exports.argument=Eu});var ls=C((ep,hs)=>{"use strict";hs.exports=/^#!(.*)/});var ps=C((tp,fs)=>{"use strict";var bu=ls();fs.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 ms=C((ip,ds)=>{"use strict";var ti=require("fs"),Su=ps();function wu(r){let n=Buffer.alloc(150),o;try{o=ti.openSync(r,"r"),ti.readSync(o,n,0,150,0),ti.closeSync(o)}catch{}return Su(n.toString())}ds.exports=wu});var ys=C((rp,vs)=>{"use strict";var Cu=require("path"),xs=us(),gs=cs(),_u=ms(),Iu=process.platform==="win32",ku=/\.(?:com|exe)$/i,Au=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Nu(r){r.file=xs(r);let i=r.file&&_u(r.file);return i?(r.args.unshift(r.file),r.command=i,xs(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=gs.command(r.command),r.args=r.args.map(h=>gs.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)}vs.exports=Pu});var Ss=C((sp,bs)=>{"use strict";var ii=process.platform==="win32";function ri(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(!ii)return;let n=r.emit;r.emit=function(o,l){if(o==="exit"){let h=Es(l,i);if(h)return n.call(r,"error",h)}return n.apply(r,arguments)}}function Es(r,i){return ii&&r===1&&!i.file?ri(i.original,"spawn"):null}function Lu(r,i){return ii&&r===1&&!i.file?ri(i.original,"spawnSync"):null}bs.exports={hookChildProcess:Tu,verifyENOENT:Es,verifyENOENTSync:Lu,notFoundError:ri}});var _s=C((np,Te)=>{"use strict";var ws=require("child_process"),si=ys(),ni=Ss();function Cs(r,i,n){let o=si(r,i,n),l=ws.spawn(o.command,o.args,o.options);return ni.hookChildProcess(l,o),l}function Ou(r,i,n){let o=si(r,i,n),l=ws.spawnSync(o.command,o.args,o.options);return l.error=l.error||ni.verifyENOENTSync(l.status,o),l}Te.exports=Cs;Te.exports.spawn=Cs;Te.exports.sync=Ou;Te.exports._parse=si;Te.exports._enoent=ni});var Le=C((ap,Is)=>{"use strict";var Fu="2.0.0",Vu=Number.MAX_SAFE_INTEGER||9007199254740991,Du=16,$u=250,qu=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Is.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Du,MAX_SAFE_BUILD_LENGTH:$u,MAX_SAFE_INTEGER:Vu,RELEASE_TYPES:qu,SEMVER_SPEC_VERSION:Fu,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var We=C((op,ks)=>{"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):()=>{};ks.exports=ju});var Oe=C((ce,As)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ai,MAX_SAFE_BUILD_LENGTH:Bu,MAX_LENGTH:Uu}=Le(),Mu=We();ce=As.exports={};var Gu=ce.re=[],Hu=ce.safeRe=[],_=ce.src=[],Wu=ce.safeSrc=[],I=ce.t={},Xu=0,oi="[a-zA-Z0-9-]",zu=[["\\s",1],["\\d",Uu],[oi,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),I[r]=l,_[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-]${oi}*`);T("MAINVERSION",`(${_[I.NUMERICIDENTIFIER]})\\.(${_[I.NUMERICIDENTIFIER]})\\.(${_[I.NUMERICIDENTIFIER]})`);T("MAINVERSIONLOOSE",`(${_[I.NUMERICIDENTIFIERLOOSE]})\\.(${_[I.NUMERICIDENTIFIERLOOSE]})\\.(${_[I.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASEIDENTIFIER",`(?:${_[I.NONNUMERICIDENTIFIER]}|${_[I.NUMERICIDENTIFIER]})`);T("PRERELEASEIDENTIFIERLOOSE",`(?:${_[I.NONNUMERICIDENTIFIER]}|${_[I.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASE",`(?:-(${_[I.PRERELEASEIDENTIFIER]}(?:\\.${_[I.PRERELEASEIDENTIFIER]})*))`);T("PRERELEASELOOSE",`(?:-?(${_[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${_[I.PRERELEASEIDENTIFIERLOOSE]})*))`);T("BUILDIDENTIFIER",`${oi}+`);T("BUILD",`(?:\\+(${_[I.BUILDIDENTIFIER]}(?:\\.${_[I.BUILDIDENTIFIER]})*))`);T("FULLPLAIN",`v?${_[I.MAINVERSION]}${_[I.PRERELEASE]}?${_[I.BUILD]}?`);T("FULL",`^${_[I.FULLPLAIN]}$`);T("LOOSEPLAIN",`[v=\\s]*${_[I.MAINVERSIONLOOSE]}${_[I.PRERELEASELOOSE]}?${_[I.BUILD]}?`);T("LOOSE",`^${_[I.LOOSEPLAIN]}$`);T("GTLT","((?:<|>)?=?)");T("XRANGEIDENTIFIERLOOSE",`${_[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);T("XRANGEIDENTIFIER",`${_[I.NUMERICIDENTIFIER]}|x|X|\\*`);T("XRANGEPLAIN",`[v=\\s]*(${_[I.XRANGEIDENTIFIER]})(?:\\.(${_[I.XRANGEIDENTIFIER]})(?:\\.(${_[I.XRANGEIDENTIFIER]})(?:${_[I.PRERELEASE]})?${_[I.BUILD]}?)?)?`);T("XRANGEPLAINLOOSE",`[v=\\s]*(${_[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[I.XRANGEIDENTIFIERLOOSE]})(?:${_[I.PRERELEASELOOSE]})?${_[I.BUILD]}?)?)?`);T("XRANGE",`^${_[I.GTLT]}\\s*${_[I.XRANGEPLAIN]}$`);T("XRANGELOOSE",`^${_[I.GTLT]}\\s*${_[I.XRANGEPLAINLOOSE]}$`);T("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ai}})(?:\\.(\\d{1,${ai}}))?(?:\\.(\\d{1,${ai}}))?`);T("COERCE",`${_[I.COERCEPLAIN]}(?:$|[^\\d])`);T("COERCEFULL",_[I.COERCEPLAIN]+`(?:${_[I.PRERELEASE]})?(?:${_[I.BUILD]})?(?:$|[^\\d])`);T("COERCERTL",_[I.COERCE],!0);T("COERCERTLFULL",_[I.COERCEFULL],!0);T("LONETILDE","(?:~>?)");T("TILDETRIM",`(\\s*)${_[I.LONETILDE]}\\s+`,!0);ce.tildeTrimReplace="$1~";T("TILDE",`^${_[I.LONETILDE]}${_[I.XRANGEPLAIN]}$`);T("TILDELOOSE",`^${_[I.LONETILDE]}${_[I.XRANGEPLAINLOOSE]}$`);T("LONECARET","(?:\\^)");T("CARETTRIM",`(\\s*)${_[I.LONECARET]}\\s+`,!0);ce.caretTrimReplace="$1^";T("CARET",`^${_[I.LONECARET]}${_[I.XRANGEPLAIN]}$`);T("CARETLOOSE",`^${_[I.LONECARET]}${_[I.XRANGEPLAINLOOSE]}$`);T("COMPARATORLOOSE",`^${_[I.GTLT]}\\s*(${_[I.LOOSEPLAIN]})$|^$`);T("COMPARATOR",`^${_[I.GTLT]}\\s*(${_[I.FULLPLAIN]})$|^$`);T("COMPARATORTRIM",`(\\s*)${_[I.GTLT]}\\s*(${_[I.LOOSEPLAIN]}|${_[I.XRANGEPLAIN]})`,!0);ce.comparatorTrimReplace="$1$2$3";T("HYPHENRANGE",`^\\s*(${_[I.XRANGEPLAIN]})\\s+-\\s+(${_[I.XRANGEPLAIN]})\\s*$`);T("HYPHENRANGELOOSE",`^\\s*(${_[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${_[I.XRANGEPLAINLOOSE]})\\s*$`);T("STAR","(<|>)?=?\\s*\\*");T("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");T("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ft=C((up,Ns)=>{"use strict";var Yu=Object.freeze({loose:!0}),Ju=Object.freeze({}),Qu=r=>r?typeof r!="object"?Yu:r:Ju;Ns.exports=Qu});var ui=C((cp,Ts)=>{"use strict";var Rs=/^[0-9]+$/,Ps=(r,i)=>{if(typeof r=="number"&&typeof i=="number")return r===i?0:r<i?-1:1;let n=Rs.test(r),o=Rs.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)=>Ps(i,r);Ts.exports={compareIdentifiers:Ps,rcompareIdentifiers:Zu}});var G=C((hp,Os)=>{"use strict";var pt=We(),{MAX_LENGTH:Ls,MAX_SAFE_INTEGER:dt}=Le(),{safeRe:mt,t:xt}=Oe(),ec=ft(),{compareIdentifiers:ci}=ui(),tc=(r,i)=>{let n=i.split(".");if(n.length>r.length)return!1;for(let o=0;o<n.length;o++)if(ci(r[o],n[o])!==0)return!1;return!0},hi=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>Ls)throw new TypeError(`version is longer than ${Ls} characters`);pt("SemVer",i,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let o=i.trim().match(n.loose?mt[xt.LOOSE]:mt[xt.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>dt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>dt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>dt||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<dt)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(pt("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(pt("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 ci(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(pt("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 ci(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?mt[xt.PRERELEASELOOSE]:mt[xt.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}};Os.exports=hi});var ve=C((lp,Vs)=>{"use strict";var Fs=G(),ic=(r,i,n=!1)=>{if(r instanceof Fs)return r;try{return new Fs(r,i)}catch(o){if(!n)return null;throw o}};Vs.exports=ic});var $s=C((fp,Ds)=>{"use strict";var rc=ve(),sc=(r,i)=>{let n=rc(r,i);return n?n.version:null};Ds.exports=sc});var js=C((pp,qs)=>{"use strict";var nc=ve(),ac=(r,i)=>{let n=nc(r.trim().replace(/^[=v]+/,""),i);return n?n.version:null};qs.exports=ac});var Ms=C((dp,Us)=>{"use strict";var Bs=G(),oc=(r,i,n,o,l)=>{typeof n=="string"&&(l=o,o=n,n=void 0);try{return new Bs(r instanceof Bs?r.version:r,n).inc(i,o,l).version}catch{return null}};Us.exports=oc});var Ws=C((mp,Hs)=>{"use strict";var Gs=ve(),uc=(r,i)=>{let n=Gs(r,null,!0),o=Gs(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 w=y?"pre":"";return n.major!==o.major?w+"major":n.minor!==o.minor?w+"minor":n.patch!==o.patch?w+"patch":"prerelease"};Hs.exports=uc});var zs=C((xp,Xs)=>{"use strict";var cc=G(),hc=(r,i)=>new cc(r,i).major;Xs.exports=hc});var Ys=C((gp,Ks)=>{"use strict";var lc=G(),fc=(r,i)=>new lc(r,i).minor;Ks.exports=fc});var Qs=C((vp,Js)=>{"use strict";var pc=G(),dc=(r,i)=>new pc(r,i).patch;Js.exports=dc});var en=C((yp,Zs)=>{"use strict";var mc=ve(),xc=(r,i)=>{let n=mc(r,i);return n&&n.prerelease.length?n.prerelease:null};Zs.exports=xc});var re=C((Ep,rn)=>{"use strict";var tn=G(),gc=(r,i,n)=>new tn(r,n).compare(new tn(i,n));rn.exports=gc});var nn=C((bp,sn)=>{"use strict";var vc=re(),yc=(r,i,n)=>vc(i,r,n);sn.exports=yc});var on=C((Sp,an)=>{"use strict";var Ec=re(),bc=(r,i)=>Ec(r,i,!0);an.exports=bc});var gt=C((wp,cn)=>{"use strict";var un=G(),Sc=(r,i,n)=>{let o=new un(r,n),l=new un(i,n);return o.compare(l)||o.compareBuild(l)};cn.exports=Sc});var ln=C((Cp,hn)=>{"use strict";var wc=gt(),Cc=(r,i)=>r.sort((n,o)=>wc(n,o,i));hn.exports=Cc});var pn=C((_p,fn)=>{"use strict";var _c=gt(),Ic=(r,i)=>r.sort((n,o)=>_c(o,n,i));fn.exports=Ic});var Xe=C((Ip,dn)=>{"use strict";var kc=re(),Ac=(r,i,n)=>kc(r,i,n)>0;dn.exports=Ac});var vt=C((kp,mn)=>{"use strict";var Nc=re(),Rc=(r,i,n)=>Nc(r,i,n)<0;mn.exports=Rc});var li=C((Ap,xn)=>{"use strict";var Pc=re(),Tc=(r,i,n)=>Pc(r,i,n)===0;xn.exports=Tc});var fi=C((Np,gn)=>{"use strict";var Lc=re(),Oc=(r,i,n)=>Lc(r,i,n)!==0;gn.exports=Oc});var yt=C((Rp,vn)=>{"use strict";var Fc=re(),Vc=(r,i,n)=>Fc(r,i,n)>=0;vn.exports=Vc});var Et=C((Pp,yn)=>{"use strict";var Dc=re(),$c=(r,i,n)=>Dc(r,i,n)<=0;yn.exports=$c});var pi=C((Tp,En)=>{"use strict";var qc=li(),jc=fi(),Bc=Xe(),Uc=yt(),Mc=vt(),Gc=Et(),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}`)}};En.exports=Hc});var Sn=C((Lp,bn)=>{"use strict";var Wc=G(),Xc=ve(),{safeRe:bt,t:St}=Oe(),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?bt[St.COERCEFULL]:bt[St.COERCE]);else{let y=i.includePrerelease?bt[St.COERCERTLFULL]:bt[St.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)};bn.exports=zc});var Cn=C((Op,wn)=>{"use strict";var Kc=ve(),Yc=Le(),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");wn.exports=Qc});var In=C((Fp,_n)=>{"use strict";var di=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}};_n.exports=di});var se=C((Vp,Rn)=>{"use strict";var ih=/\s+/g,mi=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 xi)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=>!An(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=kn.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 xi(g,this.options));for(let g of x){if(An(g))return[g];y.set(g.value,g)}y.size>1&&y.has("")&&y.delete("");let w=[...y.values()];return kn.set(o,w),w}intersects(i,n){if(!(i instanceof r))throw new TypeError("a Range is required");return this.set.some(o=>Nn(o,n)&&i.set.some(l=>Nn(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}};Rn.exports=mi;var rh=In(),kn=new rh,sh=ft(),xi=ze(),$=We(),nh=G(),{safeRe:K,src:ah,t:H,comparatorTrimReplace:oh,tildeTrimReplace:uh,caretTrimReplace:ch}=Oe(),{FLAG_INCLUDE_PRERELEASE:hh,FLAG_LOOSE:lh}=Le(),fh=new RegExp(ah[H.BUILD],"g"),An=r=>r.value==="<0.0.0-0",ph=r=>r.value==="",Nn=(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),w=x||U(f),g=w||U(m),S=g;return l==="="&&S&&(l=""),y=i.includePrerelease?"-0":"",x?l===">"||l==="<"?o="<0.0.0-0":o="*":l&&S?(w&&(f=0),m=0,l===">"?(l=">=",w?(h=+h+1,f=0,m=0):(f=+f+1,m=0)):l==="<="&&(l="<",w?h=+h+1:f=+f+1),l==="<"&&(y="-0"),o=`${l+h}.${f}.${m}${y}`):w?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,w,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(w)?y=`<${+x+1}.0.0-0`:U(g)?y=`<${x}.${+w+1}.0-0`:S?y=`<=${x}.${w}.${g}-${S}`:r?y=`<${x}.${w}.${+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!==xi.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 ze=C((Dp,Vn)=>{"use strict";var Ke=Symbol("SemVer ANY"),yi=class r{static get ANY(){return Ke}constructor(i,n){if(n=Pn(n),i instanceof r){if(i.loose===!!n.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),vi("comparator",i,n),this.options=n,this.loose=!!n.loose,this.parse(i),this.semver===Ke?this.value="":this.value=this.operator+this.semver.version,vi("comp",this)}parse(i){let n=this.options.loose?Tn[Ln.COMPARATORLOOSE]:Tn[Ln.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 On(o[2],this.options.loose):this.semver=Ke}toString(){return this.value}test(i){if(vi("Comparator.test",i,this.options.loose),this.semver===Ke||i===Ke)return!0;if(typeof i=="string")try{i=new On(i,this.options)}catch{return!1}return gi(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 Fn(i.value,n).test(this.value):i.operator===""?i.value===""?!0:new Fn(this.value,n).test(i.semver):(n=Pn(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("=")||gi(this.semver,"<",i.semver,n)&&this.operator.startsWith(">")&&i.operator.startsWith("<")||gi(this.semver,">",i.semver,n)&&this.operator.startsWith("<")&&i.operator.startsWith(">")))}};Vn.exports=yi;var Pn=ft(),{safeRe:Tn,t:Ln}=Oe(),gi=pi(),vi=We(),On=G(),Fn=se()});var Ye=C(($p,Dn)=>{"use strict";var Ih=se(),kh=(r,i,n)=>{try{i=new Ih(i,n)}catch{return!1}return i.test(r)};Dn.exports=kh});var qn=C((qp,$n)=>{"use strict";var Ah=se(),Nh=(r,i)=>new Ah(r,i).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));$n.exports=Nh});var Bn=C((jp,jn)=>{"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};jn.exports=Th});var Mn=C((Bp,Un)=>{"use strict";var Lh=G(),Oh=se(),Fh=(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};Un.exports=Fh});var Wn=C((Up,Hn)=>{"use strict";var Ei=G(),Vh=se(),Gn=Xe(),Dh=(r,i)=>{r=new Vh(r,i);let n=new Ei("0.0.0");if(r.test(n)||(n=new Ei("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 Ei(f.semver.version);switch(f.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!h||Gn(m,h))&&(h=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${f.operator}`)}}),h&&(!n||Gn(n,h))&&(n=h)}return n&&r.test(n)?n:null};Hn.exports=Dh});var zn=C((Mp,Xn)=>{"use strict";var $h=se(),qh=(r,i)=>{try{return new $h(r,i).range||"*"}catch{return null}};Xn.exports=qh});var wt=C((Gp,Qn)=>{"use strict";var jh=G(),Jn=ze(),{ANY:Bh}=Jn,Uh=se(),Mh=Ye(),Kn=Xe(),Yn=vt(),Gh=Et(),Hh=yt(),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=Kn,h=Gh,f=Yn,m=">",y=">=";break;case"<":l=Yn,h=Hh,f=Kn,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 w=i.set[x],g=null,S=null;if(w.forEach(E=>{E.semver===Bh&&(E=new Jn(">=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};Qn.exports=Wh});var ea=C((Hp,Zn)=>{"use strict";var Xh=wt(),zh=(r,i,n)=>Xh(r,i,">",n);Zn.exports=zh});var ia=C((Wp,ta)=>{"use strict";var Kh=wt(),Yh=(r,i,n)=>Kh(r,i,"<",n);ta.exports=Yh});var na=C((Xp,sa)=>{"use strict";var ra=se(),Jh=(r,i,n)=>(r=new ra(r,n),i=new ra(i,n),r.intersects(i,n));sa.exports=Jh});var oa=C((zp,aa)=>{"use strict";var Qh=Ye(),Zh=re();aa.exports=(r,i,n)=>{let o=[],l=null,h=null,f=r.sort((w,g)=>Zh(w,g,n));for(let w of f)Qh(w,i,n)?(h=w,l||(l=w)):(h&&o.push([l,h]),h=null,l=null);l&&o.push([l,null]);let m=[];for(let[w,g]of o)w===g?m.push(w):!g&&w===f[0]?m.push("*"):g?w===f[0]?m.push(`<=${g}`):m.push(`${w} - ${g}`):m.push(`>=${w}`);let y=m.join(" || "),x=typeof i.raw=="string"?i.raw:String(i);return y.length<x.length?y:i}});var pa=C((Kp,fa)=>{"use strict";var ua=se(),wi=ze(),{ANY:bi}=wi,Si=Ye(),Ci=re(),el=(r,i,n={})=>{if(r===i)return!0;r=new ua(r,n),i=new ua(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 wi(">=0.0.0-0")],ca=[new wi(">=0.0.0")],il=(r,i,n)=>{if(r===i)return!0;if(r.length===1&&r[0].semver===bi){if(i.length===1&&i[0].semver===bi)return!0;n.includePrerelease?r=tl:r=ca}if(i.length===1&&i[0].semver===bi){if(n.includePrerelease)return!0;i=ca}let o=new Set,l,h;for(let E of r)E.operator===">"||E.operator===">="?l=ha(l,E,n):E.operator==="<"||E.operator==="<="?h=la(h,E,n):o.add(E.semver);if(o.size>1)return null;let f;if(l&&h){if(f=Ci(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&&!Si(E,String(l),n)||h&&!Si(E,String(h),n))return null;for(let k of i)if(!Si(E,String(k),n))return!1;return!0}let m,y,x,w,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(w=w||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=ha(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=la(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&&w&&!l&&f!==0||S||g)},ha=(r,i,n)=>{if(!r)return i;let o=Ci(r.semver,i.semver,n);return o>0?r:o<0||i.operator===">"&&r.operator===">="?i:r},la=(r,i,n)=>{if(!r)return i;let o=Ci(r.semver,i.semver,n);return o<0?r:o>0||i.operator==="<"&&r.operator==="<="?i:r};fa.exports=el});var ga=C((Yp,xa)=>{"use strict";var _i=Oe(),da=Le(),rl=G(),ma=ui(),sl=ve(),nl=$s(),al=js(),ol=Ms(),ul=Ws(),cl=zs(),hl=Ys(),ll=Qs(),fl=en(),pl=re(),dl=nn(),ml=on(),xl=gt(),gl=ln(),vl=pn(),yl=Xe(),El=vt(),bl=li(),Sl=fi(),wl=yt(),Cl=Et(),_l=pi(),Il=Sn(),kl=Cn(),Al=ze(),Nl=se(),Rl=Ye(),Pl=qn(),Tl=Bn(),Ll=Mn(),Ol=Wn(),Fl=zn(),Vl=wt(),Dl=ea(),$l=ia(),ql=na(),jl=oa(),Bl=pa();xa.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:Fl,outside:Vl,gtr:Dl,ltr:$l,intersects:ql,simplifyRange:jl,subset:Bl,SemVer:rl,re:_i.re,src:_i.src,tokens:_i.t,SEMVER_SPEC_VERSION:da.SEMVER_SPEC_VERSION,RELEASE_TYPES:da.RELEASE_TYPES,compareIdentifiers:ma.compareIdentifiers,rcompareIdentifiers:ma.rcompareIdentifiers}});var Ni=C((Jp,Aa)=>{var ye=require("fs"),ne=require("path"),ya=_s(),ae=ga(),{DEFAULT_API_URL:Ul}=Ge(),Ea=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function Ii(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 ki(r){let i=new Map;for(let n of r){let{name:o,version:l}=Ii(n),h=i.get(o);i.set(o,h&&l?ba(o,h,l):l||h)}return i}function ba(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 _t(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 Ct(r,i){let n=Ea.find(o=>Object.hasOwn(r[o]||{},i));return n?{section:n,existing:r[n][i]}:null}function Sa(r,i){let n=ki(i);if(n.size===0)return;let o=ne.join(r,"package.json"),l=JSON.parse(ye.readFileSync(o,"utf8"));for(let[h,f]of n){let m=Ct(l,h),y=m?.section||"dependencies";l[y]||={};let x=m?.existing;l[y][h]=x===void 0?f||"latest":f&&_t(x,f)==="lower"?f:x}ye.writeFileSync(o,`${JSON.stringify(l,null,2)}
|
|
3
3
|
`)}function It(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(ye.existsSync(o)){let l=JSON.parse(ye.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(ye.existsSync(ne.join(n,l)))return h;if(ne.dirname(n)===n)return"npm"}}var va={npm:"npx",pnpm:"pnpm exec",yarn:"yarn",bun:"bunx"};function wa(r,i=process.cwd()){let n;try{n=It(i)}catch{n="npm"}return`${va[n]||va.npm} frontfriend ${r}`}function Gl(r,i=process.cwd()){let n=null;try{n=r?new URL(r).origin:null}catch{n=null}return wa(n&&n!==new URL(Ul).origin?`login --api-url ${n}`:"login",i)}function Ca(r){return JSON.parse(ye.readFileSync(ne.join(r,"package.json"),"utf8"))}function Ai(r,i){let n=ki(i);if(n.size===0)return[];let o=Ca(r),l=[];for(let[h,f]of n){let m=Ct(o,h);m&&(!f||_t(m.existing,f)!=="lower")||l.push(f?`${h}@${f}`:h)}return l}function Hl(r,i){let n=i.filter(g=>g.required),o=ki(n.flatMap(g=>g.dependencies)),l=(g,S)=>S.filter(E=>E.dependencies.some(k=>Ii(k).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=Ca(r),m=[],y=[];for(let[g,S]of o){let E=Ct(f,g);if(!E){m.push(S?`${g}@${S}`:g);continue}if(!S)continue;let k=_t(E.existing,S);k==="lower"?m.push(`${g}@${S}`):k!=="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}=Ii(g);if(o.has(S)||Ct(f,S))continue;let k=x.get(S),B=E||k?.version;if(k?.version&&E&&k.version!==E)try{B=ba(S,k.version,E)}catch{B=k.version}x.set(S,{version:B})}let w=[...x].map(([g,{version:S}])=>({request:S?`${g}@${S}`:g,components:l(g,h)}));return{missing:m,kept:y,repair:w}}function _a(r,i){return[r==="npm"?"install":"add",...i]}function Wl(r){return/^[\w@/.:^~=+-]+$/.test(r)?r:`'${r.replace(/'/g,"'\\''")}'`}function Ia(r,i){let n=It(r);return[n,..._a(n,i)].map(Wl).join(" ")}function ka(r,i,{stdio:n="inherit"}={}){let o=Ai(r,i);if(o.length===0)return;let l=It(r),h=ya.sync(l,_a(l,o),{cwd:r,stdio:n});if(h.error||h.status!==0)throw Sa(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=Ai(r,i);if(h.length===0)return{missing:h,command:null,installed:!1};let f=Ia(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 ka(r,h,{stdio:o}),{missing:h,command:f,installed:!0}}catch(m){return l(`\u26A0\uFE0F Component dependencies were not installed: ${m.message}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontfriend/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"description": "Frontfriend SDK: design contracts, tokens, components, CLI and MCP integrations",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"semver": "^7.7.2",
|
|
165
165
|
"cross-spawn": "7.0.6",
|
|
166
166
|
"tw-animate-css": "^1.3.4",
|
|
167
|
-
"@frontfriend/design-brain": "0.17.
|
|
167
|
+
"@frontfriend/design-brain": "0.17.1"
|
|
168
168
|
},
|
|
169
169
|
"engines": {
|
|
170
170
|
"node": ">=20.19.0"
|