@master/css-compiler 2.0.0-beta.130 → 2.0.0-beta.132
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 +1 -158
- package/dist/cjs/compiler.js +10 -9
- package/dist/esm/compiler.mjs +10 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,158 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<div align="center">
|
|
3
|
-
|
|
4
|
-
<p align="center">
|
|
5
|
-
<a href="https://css.master.co">
|
|
6
|
-
<picture>
|
|
7
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg">
|
|
8
|
-
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg">
|
|
9
|
-
<img alt="Master CSS" src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg" width="100%">
|
|
10
|
-
</picture>
|
|
11
|
-
</a>
|
|
12
|
-
</p>
|
|
13
|
-
<p align="center">The ahead-of-time compiler of Master CSS</p>
|
|
14
|
-
|
|
15
|
-
<p align="center">
|
|
16
|
-
<a aria-label="overview" href="https://github.com/master-co/css/tree/beta">
|
|
17
|
-
<picture>
|
|
18
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=212022&style=for-the-badge">
|
|
19
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=f6f7f8&style=for-the-badge">
|
|
20
|
-
<img alt="NPM Version" src="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=f6f7f8&style=for-the-badge">
|
|
21
|
-
</picture>
|
|
22
|
-
</a>
|
|
23
|
-
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
|
|
24
|
-
<picture>
|
|
25
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
|
|
26
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
|
|
27
|
-
<img alt="NPM Version" src="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
|
|
28
|
-
</picture>
|
|
29
|
-
</a>
|
|
30
|
-
<a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/css-compiler">
|
|
31
|
-
<picture>
|
|
32
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/css-compiler?color=212022&label=%20&logo=npm&style=for-the-badge">
|
|
33
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/css-compiler?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
34
|
-
<img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/css-compiler?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
35
|
-
</picture>
|
|
36
|
-
</a>
|
|
37
|
-
<a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6">
|
|
38
|
-
<picture>
|
|
39
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge">
|
|
40
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
41
|
-
<img alt="Discord online" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
42
|
-
</picture>
|
|
43
|
-
</a>
|
|
44
|
-
<a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg">
|
|
45
|
-
<picture>
|
|
46
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
|
|
47
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
48
|
-
<img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
49
|
-
</picture>
|
|
50
|
-
</a>
|
|
51
|
-
<a aria-label="Github Actions" href="https://github.com/1aron/repo/actions/workflows/release.yml">
|
|
52
|
-
<picture>
|
|
53
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
|
|
54
|
-
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
55
|
-
<img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/release.yml?branch=beta&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
56
|
-
</picture>
|
|
57
|
-
</a>
|
|
58
|
-
</p>
|
|
59
|
-
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
## Usage
|
|
63
|
-
```bash
|
|
64
|
-
npm install @master/css-compiler
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
```ts
|
|
68
|
-
const compiler = await new MasterCSSCompiler()
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Options
|
|
72
|
-
```ts
|
|
73
|
-
{
|
|
74
|
-
// specify virtual CSS module id (e.g. virtual:master.css)
|
|
75
|
-
module: 'master.css',
|
|
76
|
-
// specify config file path or set `Config`
|
|
77
|
-
config: 'master.css.*',
|
|
78
|
-
// forcibly specify sources for scanning, not excluded by `options.exclude`
|
|
79
|
-
sources: [],
|
|
80
|
-
// specify sources for scanning
|
|
81
|
-
include: ['**/*.{html,js,jsx,ts,tsx,svelte,astro,vue,md,mdx,pug,php}'],
|
|
82
|
-
// specify sources to exclude
|
|
83
|
-
exclude: [
|
|
84
|
-
'**/node_modules/**',
|
|
85
|
-
'**/*.d.ts',
|
|
86
|
-
'**/*.test.*',
|
|
87
|
-
'node_modules',
|
|
88
|
-
'master.css.{js,ts,mjs,cjs}',
|
|
89
|
-
'dist',
|
|
90
|
-
'out',
|
|
91
|
-
'README.md'
|
|
92
|
-
],
|
|
93
|
-
classes: {
|
|
94
|
-
// whitelist of class names for unpredictable dynamics
|
|
95
|
-
fixed: [],
|
|
96
|
-
// blacklist of class names to exclude accidentally captured
|
|
97
|
-
ignored: [] // or RegExp[]
|
|
98
|
-
},
|
|
99
|
-
cwd: process.cwd()
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Methods
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
// Reload the compiler and MasterCSS
|
|
107
|
-
refresh(): this
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
```ts
|
|
111
|
-
// Scan sources, extract class names, and generate CSS rules
|
|
112
|
-
compile()
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
```ts
|
|
116
|
-
// Extract potential class names from the given file content
|
|
117
|
-
extract(name: string, content: string): string[]
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
```ts
|
|
121
|
-
// `extract(name, content)`, insert extractions, and generate CSS rules
|
|
122
|
-
insert(name: string, content: string): boolean
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
```ts
|
|
126
|
-
// Read file source paths by `options.include` and `options.exclude`
|
|
127
|
-
get sources(): string[]
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
```ts
|
|
131
|
-
// Check source file path by `options.include` and `options.exclude`
|
|
132
|
-
checkSourcePath(name: string): boolean
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
// Read user config file by `options.config`
|
|
137
|
-
readConfig(): Config
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
```ts
|
|
141
|
-
// Get user config path
|
|
142
|
-
get configPath(): string
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
// Get resolved user config path
|
|
147
|
-
get resolvedConfigPath(): string
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## Properties
|
|
151
|
-
|
|
152
|
-
```ts
|
|
153
|
-
export default class MasterCSSCompiler {
|
|
154
|
-
css: MasterCSS
|
|
155
|
-
extractions = new Set<string>()
|
|
156
|
-
...
|
|
157
|
-
}
|
|
158
|
-
```
|
|
1
|
+
Check out the [official documentation](https://beta.css.master.co/docs/compiler).
|
package/dist/cjs/compiler.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
var me=Object.create;var C=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Oe=(r,t)=>{for(var e in t)C(r,e,{get:t[e],enumerable:!0})},U=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ve(t))!$e.call(r,n)&&n!==e&&C(r,n,{get:()=>t[n],enumerable:!(o=be(t,n))||o.enumerable});return r};var d=(r,t,e)=>(e=r!=null?me(ye(r)):{},U(t||!r||!r.__esModule?C(e,"default",{value:r,enumerable:!0}):e,r)),we=r=>U(C({},"__esModule",{value:!0}),r);var it={};Oe(it,{MasterCSSCompiler:()=>V});module.exports=we(it);var _=d(require("upath")),L=d(require("./options")),Y=d(require("@master/css")),G=require("perf_hooks"),ge=d(require("./extract")),he=d(require("fs")),D=d(require("fast-glob")),B=d(require("minimatch")),fe=d(require("techor"));var k=d(require("node:process"),1),se=d(require("node:os"),1),P=d(require("node:tty"),1),xe=Object.create,ie=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Te=Object.getOwnPropertyNames,Ce=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty,Ne=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ke=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Te(t))!Ee.call(r,n)&&n!==e&&ie(r,n,{get:()=>t[n],enumerable:!(o=Re(t,n))||o.enumerable});return r},Be=(r,t,e)=>(e=r!=null?xe(Ce(r)):{},ke(t||!r||!r.r?ie(e,"default",{value:r,enumerable:!0}):e,r)),je=Ne((r,t)=>{"use strict";function e(o){var n=void 0;typeof o=="string"?n=[o]:n=o.raw;for(var l="",s=0;s<n.length;s++)l+=n[s].replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`"),s<(arguments.length<=1?0:arguments.length-1)&&(l+=arguments.length<=s+1?void 0:arguments[s+1]);var h=l.split(`
|
|
2
|
-
`),c=null;return h.forEach(function(a){var p=a.match(/^(\s+)\S+/);if(p){var O=p[1].length;c?c=Math.min(c,O):c=O}}),c!==null&&(l=h.map(function(a){return a[0]===" "?a.slice(c):a}).join(`
|
|
3
|
-
`)),l=l.trim(),l.replace(/\\n/g,`
|
|
4
|
-
`)}typeof t<"u"&&(t.exports=e)}),b=(r,t)=>{if(!r)throw new Error(t)},Ae=r=>{let t={joined:!0,spacerNoNeighbour:" ",spacerNeighbour:"\u2502 ",keyNoNeighbour:"\u2514\u2500 ",keyNeighbour:"\u251C\u2500 ",separator:": ",renderFn:e=>["boolean","string","number"].includes(typeof e)?e:void 0,sortFn:null,breakCircularWith:" (circular ref.)",...r};return b(Object.keys(t).length===9,"Unexpected Option(s) provided"),b(typeof t.joined=="boolean",'Option "joined" has invalid format'),b(typeof t.spacerNoNeighbour=="string",'Option "spacerNoNeighbour" has invalid format'),b(typeof t.spacerNeighbour=="string",'Option "spacerNeighbour" has invalid format'),b(typeof t.keyNoNeighbour=="string",'Option "keyNoNeighbour" has invalid format'),b(typeof t.keyNeighbour=="string",'Option "keyNeighbour" has invalid format'),b(typeof t.separator=="string",'Option "separator" has invalid format'),b(typeof t.renderFn=="function",'Option "renderFn" has invalid format'),b(typeof t.sortFn=="function"||t.sortFn===null,'Option "sortFn" has invalid format'),b(typeof t.breakCircularWith=="string"||t.breakCircularWith===null,'Option "breakCircularWith" has invalid format'),t},le=(r,t={})=>{let e=Ae(t),o=[],n=e.renderFn(r);n!==void 0&&o.push(String(n));let l=a=>e.sortFn===null?a.reverse():a.sort((p,O)=>e.sortFn(O,p)),s=[],h=l(Object.keys(r)).map(a=>[a]),c=[r];for(;h.length!==0;){let a=h.pop(),p=c[a.length-1][a[a.length-1]],O=e.breakCircularWith!==null&&c.includes(p);s[a.length-1]=h.length!==0&&h[h.length-1].length===a.length;let pe=e.renderFn(p);o.push([s.slice(0,a.length-1).map(j=>j?e.spacerNeighbour:e.spacerNoNeighbour).join(""),s[a.length-1]?e.keyNeighbour:e.keyNoNeighbour,a[a.length-1],pe===void 0?"":`${e.separator}${p}`,O?e.breakCircularWith:""].join("")),p instanceof Object&&!Array.isArray(p)&&!O&&(h.push(...l(Object.keys(p)).map(j=>a.concat(j))),c[a.length]=p)}return e.joined===!0?o.join(`
|
|
5
|
-
`):o},z=(r=0)=>t=>`\x1B[${t+r}m`,J=(r=0)=>t=>`\x1B[${38+r};5;${t}m`,K=(r=0)=>(t,e,o)=>`\x1B[${38+r};2;${t};${e};${o}m`,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},st=Object.keys(u.modifier),Me=Object.keys(u.color),Pe=Object.keys(u.bgColor),at=[...Me,...Pe];function Fe(){let r=new Map;for(let[t,e]of Object.entries(u)){for(let[o,n]of Object.entries(e))u[o]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},e[o]=u[o],r.set(n[0],n[1]);Object.defineProperty(u,t,{value:e,enumerable:!1})}return Object.defineProperty(u,"codes",{value:r,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=z(),u.color.ansi256=J(),u.color.ansi16m=K(),u.bgColor.ansi=z(10),u.bgColor.ansi256=J(10),u.bgColor.ansi16m=K(10),Object.defineProperties(u,{rgbToAnsi256:{value(t,e,o){return t===e&&e===o?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(t){let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[o]=e;o.length===3&&(o=[...o].map(l=>l+l).join(""));let n=Number.parseInt(o,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:t=>u.rgbToAnsi256(...u.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let e,o,n;if(t>=232)e=((t-232)*10+8)/255,o=e,n=e;else{t-=16;let h=t%36;e=Math.floor(t/36)/5,o=Math.floor(h/6)/5,n=h%6/5}let l=Math.max(e,o,n)*2;if(l===0)return 30;let s=30+(Math.round(n)<<2|Math.round(o)<<1|Math.round(e));return l===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,e,o)=>u.ansi256ToAnsi(u.rgbToAnsi256(t,e,o)),enumerable:!1},hexToAnsi:{value:t=>u.ansi256ToAnsi(u.hexToAnsi256(t)),enumerable:!1}}),u}var Ie=Fe(),v=Ie;function m(r,t=globalThis.Deno?globalThis.Deno.args:k.default.argv){let e=r.startsWith("-")?"":r.length===1?"-":"--",o=t.indexOf(e+r),n=t.indexOf("--");return o!==-1&&(n===-1||o<n)}var{env:g}=k.default,E;m("no-color")||m("no-colors")||m("color=false")||m("color=never")?E=0:(m("color")||m("colors")||m("color=true")||m("color=always"))&&(E=1);function Se(){if("FORCE_COLOR"in g)return g.FORCE_COLOR==="true"?1:g.FORCE_COLOR==="false"?0:g.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(g.FORCE_COLOR,10),3)}function _e(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Le(r,{streamIsTTY:t,sniffFlags:e=!0}={}){let o=Se();o!==void 0&&(E=o);let n=e?E:o;if(n===0)return 0;if(e){if(m("color=16m")||m("color=full")||m("color=truecolor"))return 3;if(m("color=256"))return 2}if("TF_BUILD"in g&&"AGENT_NAME"in g)return 1;if(r&&!t&&n===void 0)return 0;let l=n||0;if(g.TERM==="dumb")return l;if(k.default.platform==="win32"){let s=se.default.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in g)return"GITHUB_ACTIONS"in g?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in g)||g.CI_NAME==="codeship"?1:l;if("TEAMCITY_VERSION"in g)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION)?1:0;if(g.COLORTERM==="truecolor"||g.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in g){let s=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:l}function Z(r,t={}){let e=Le(r,{streamIsTTY:r&&r.isTTY,...t});return _e(e)}var Ye={stdout:Z({isTTY:P.default.isatty(1)}),stderr:Z({isTTY:P.default.isatty(2)})},Ge=Ye;function De(r,t,e){let o=r.indexOf(t);if(o===-1)return r;let n=t.length,l=0,s="";do s+=r.slice(l,o)+t+e,l=o+n,o=r.indexOf(t,l);while(o!==-1);return s+=r.slice(l),s}function We(r,t,e,o){let n=0,l="";do{let s=r[o-1]==="\r";l+=r.slice(n,s?o-1:o)+t+(s?`\r
|
|
1
|
+
var be=Object.create;var T=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var ke=(h,u)=>{for(var a in u)T(h,a,{get:u[a],enumerable:!0})},Z=(h,u,a,f)=>{if(u&&typeof u=="object"||typeof u=="function")for(let s of ve(u))!we.call(h,s)&&s!==a&&T(h,s,{get:()=>u[s],enumerable:!(f=me(u,s))||f.enumerable});return h};var R=(h,u,a)=>(a=h!=null?be(ye(h)):{},Z(u||!h||!h.__esModule?T(a,"default",{value:h,enumerable:!0}):a,h)),Oe=h=>Z(T({},"__esModule",{value:!0}),h);var at={};ke(at,{MasterCSSCompiler:()=>K});module.exports=Oe(at);var D=R(require("upath")),Y=R(require("./options")),V=R(require("@master/css")),U=require("perf_hooks"),ge=R(require("./extract")),fe=R(require("fs")),H=R(require("fast-glob")),_=R(require("minimatch")),de=R(require("techor"));var xe=Object.create,ae=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,Me=Object.getOwnPropertyNames,Ce=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty,Q=(h=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(h,{get:(u,a)=>(typeof require<"u"?require:u)[a]}):h)(function(h){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+h+'" is not supported')}),E=(h,u)=>()=>(u||h((u={exports:{}}).exports,u),u.exports),Ee=(h,u,a,f)=>{if(u&&typeof u=="object"||typeof u=="function")for(let s of Me(u))!je.call(h,s)&&s!==a&&ae(h,s,{get:()=>u[s],enumerable:!(f=$e(u,s))||f.enumerable});return h},x=(h,u,a)=>(a=h!=null?xe(Ce(h)):{},Ee(u||!h||!h.s?ae(a,"default",{value:h,enumerable:!0}):a,h)),Be=E((h,u)=>{"use strict";u.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),ie=E((h,u)=>{var a=Be(),f={};for(let t of Object.keys(a))f[a[t]]=t;var s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};u.exports=s;for(let t of Object.keys(s)){if(!("channels"in s[t]))throw new Error("missing channels property: "+t);if(!("labels"in s[t]))throw new Error("missing channel labels property: "+t);if(s[t].labels.length!==s[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:l,labels:e}=s[t];delete s[t].channels,delete s[t].labels,Object.defineProperty(s[t],"channels",{value:l}),Object.defineProperty(s[t],"labels",{value:e})}s.rgb.hsl=function(t){let l=t[0]/255,e=t[1]/255,r=t[2]/255,n=Math.min(l,e,r),o=Math.max(l,e,r),i=o-n,c,g;o===n?c=0:l===o?c=(e-r)/i:e===o?c=2+(r-l)/i:r===o&&(c=4+(l-e)/i),c=Math.min(c*60,360),c<0&&(c+=360);let p=(n+o)/2;return o===n?g=0:p<=.5?g=i/(o+n):g=i/(2-o-n),[c,g*100,p*100]},s.rgb.hsv=function(t){let l,e,r,n,o,i=t[0]/255,c=t[1]/255,g=t[2]/255,p=Math.max(i,c,g),m=p-Math.min(i,c,g),k=function(j){return(p-j)/6/m+1/2};return m===0?(n=0,o=0):(o=m/p,l=k(i),e=k(c),r=k(g),i===p?n=r-e:c===p?n=1/3+l-r:g===p&&(n=2/3+e-l),n<0?n+=1:n>1&&(n-=1)),[n*360,o*100,p*100]},s.rgb.hwb=function(t){let l=t[0],e=t[1],r=t[2],n=s.rgb.hsl(t)[0],o=1/255*Math.min(l,Math.min(e,r));return r=1-1/255*Math.max(l,Math.max(e,r)),[n,o*100,r*100]},s.rgb.cmyk=function(t){let l=t[0]/255,e=t[1]/255,r=t[2]/255,n=Math.min(1-l,1-e,1-r),o=(1-l-n)/(1-n)||0,i=(1-e-n)/(1-n)||0,c=(1-r-n)/(1-n)||0;return[o*100,i*100,c*100,n*100]};function d(t,l){return(t[0]-l[0])**2+(t[1]-l[1])**2+(t[2]-l[2])**2}s.rgb.keyword=function(t){let l=f[t];if(l)return l;let e=1/0,r;for(let n of Object.keys(a)){let o=a[n],i=d(t,o);i<e&&(e=i,r=n)}return r},s.keyword.rgb=function(t){return a[t]},s.rgb.xyz=function(t){let l=t[0]/255,e=t[1]/255,r=t[2]/255;l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let n=l*.4124+e*.3576+r*.1805,o=l*.2126+e*.7152+r*.0722,i=l*.0193+e*.1192+r*.9505;return[n*100,o*100,i*100]},s.rgb.lab=function(t){let l=s.rgb.xyz(t),e=l[0],r=l[1],n=l[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let o=116*r-16,i=500*(e-r),c=200*(r-n);return[o,i,c]},s.hsl.rgb=function(t){let l=t[0]/360,e=t[1]/100,r=t[2]/100,n,o,i;if(e===0)return i=r*255,[i,i,i];r<.5?n=r*(1+e):n=r+e-r*e;let c=2*r-n,g=[0,0,0];for(let p=0;p<3;p++)o=l+1/3*-(p-1),o<0&&o++,o>1&&o--,6*o<1?i=c+(n-c)*6*o:2*o<1?i=n:3*o<2?i=c+(n-c)*(2/3-o)*6:i=c,g[p]=i*255;return g},s.hsl.hsv=function(t){let l=t[0],e=t[1]/100,r=t[2]/100,n=e,o=Math.max(r,.01);r*=2,e*=r<=1?r:2-r,n*=o<=1?o:2-o;let i=(r+e)/2,c=r===0?2*n/(o+n):2*e/(r+e);return[l,c*100,i*100]},s.hsv.rgb=function(t){let l=t[0]/60,e=t[1]/100,r=t[2]/100,n=Math.floor(l)%6,o=l-Math.floor(l),i=255*r*(1-e),c=255*r*(1-e*o),g=255*r*(1-e*(1-o));switch(r*=255,n){case 0:return[r,g,i];case 1:return[c,r,i];case 2:return[i,r,g];case 3:return[i,c,r];case 4:return[g,i,r];case 5:return[r,i,c]}},s.hsv.hsl=function(t){let l=t[0],e=t[1]/100,r=t[2]/100,n=Math.max(r,.01),o,i;i=(2-e)*r;let c=(2-e)*n;return o=e*n,o/=c<=1?c:2-c,o=o||0,i/=2,[l,o*100,i*100]},s.hwb.rgb=function(t){let l=t[0]/360,e=t[1]/100,r=t[2]/100,n=e+r,o;n>1&&(e/=n,r/=n);let i=Math.floor(6*l),c=1-r;o=6*l-i,i&1&&(o=1-o);let g=e+o*(c-e),p,m,k;switch(i){default:case 6:case 0:p=c,m=g,k=e;break;case 1:p=g,m=c,k=e;break;case 2:p=e,m=c,k=g;break;case 3:p=e,m=g,k=c;break;case 4:p=g,m=e,k=c;break;case 5:p=c,m=e,k=g;break}return[p*255,m*255,k*255]},s.cmyk.rgb=function(t){let l=t[0]/100,e=t[1]/100,r=t[2]/100,n=t[3]/100,o=1-Math.min(1,l*(1-n)+n),i=1-Math.min(1,e*(1-n)+n),c=1-Math.min(1,r*(1-n)+n);return[o*255,i*255,c*255]},s.xyz.rgb=function(t){let l=t[0]/100,e=t[1]/100,r=t[2]/100,n,o,i;return n=l*3.2406+e*-1.5372+r*-.4986,o=l*-.9689+e*1.8758+r*.0415,i=l*.0557+e*-.204+r*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),[n*255,o*255,i*255]},s.xyz.lab=function(t){let l=t[0],e=t[1],r=t[2];l/=95.047,e/=100,r/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let n=116*e-16,o=500*(l-e),i=200*(e-r);return[n,o,i]},s.lab.xyz=function(t){let l=t[0],e=t[1],r=t[2],n,o,i;o=(l+16)/116,n=e/500+o,i=o-r/200;let c=o**3,g=n**3,p=i**3;return o=c>.008856?c:(o-16/116)/7.787,n=g>.008856?g:(n-16/116)/7.787,i=p>.008856?p:(i-16/116)/7.787,n*=95.047,o*=100,i*=108.883,[n,o,i]},s.lab.lch=function(t){let l=t[0],e=t[1],r=t[2],n;n=Math.atan2(r,e)*360/2/Math.PI,n<0&&(n+=360);let o=Math.sqrt(e*e+r*r);return[l,o,n]},s.lch.lab=function(t){let l=t[0],e=t[1],r=t[2]/360*2*Math.PI,n=e*Math.cos(r),o=e*Math.sin(r);return[l,n,o]},s.rgb.ansi16=function(t,l=null){let[e,r,n]=t,o=l===null?s.rgb.hsv(t)[2]:l;if(o=Math.round(o/50),o===0)return 30;let i=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return o===2&&(i+=60),i},s.hsv.ansi16=function(t){return s.rgb.ansi16(s.hsv.rgb(t),t[2])},s.rgb.ansi256=function(t){let l=t[0],e=t[1],r=t[2];return l===e&&e===r?l<8?16:l>248?231:Math.round((l-8)/247*24)+232:16+36*Math.round(l/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5)},s.ansi16.rgb=function(t){let l=t%10;if(l===0||l===7)return t>50&&(l+=3.5),l=l/10.5*255,[l,l,l];let e=(~~(t>50)+1)*.5,r=(l&1)*e*255,n=(l>>1&1)*e*255,o=(l>>2&1)*e*255;return[r,n,o]},s.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let l,e=Math.floor(t/36)/5*255,r=Math.floor((l=t%36)/6)/5*255,n=l%6/5*255;return[e,r,n]},s.rgb.hex=function(t){let l=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(l.length)+l},s.hex.rgb=function(t){let l=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!l)return[0,0,0];let e=l[0];l[0].length===3&&(e=e.split("").map(c=>c+c).join(""));let r=parseInt(e,16),n=r>>16&255,o=r>>8&255,i=r&255;return[n,o,i]},s.rgb.hcg=function(t){let l=t[0]/255,e=t[1]/255,r=t[2]/255,n=Math.max(Math.max(l,e),r),o=Math.min(Math.min(l,e),r),i=n-o,c,g;return i<1?c=o/(1-i):c=0,i<=0?g=0:n===l?g=(e-r)/i%6:n===e?g=2+(r-l)/i:g=4+(l-e)/i,g/=6,g%=1,[g*360,i*100,c*100]},s.hsl.hcg=function(t){let l=t[1]/100,e=t[2]/100,r=e<.5?2*l*e:2*l*(1-e),n=0;return r<1&&(n=(e-.5*r)/(1-r)),[t[0],r*100,n*100]},s.hsv.hcg=function(t){let l=t[1]/100,e=t[2]/100,r=l*e,n=0;return r<1&&(n=(e-r)/(1-r)),[t[0],r*100,n*100]},s.hcg.rgb=function(t){let l=t[0]/360,e=t[1]/100,r=t[2]/100;if(e===0)return[r*255,r*255,r*255];let n=[0,0,0],o=l%1*6,i=o%1,c=1-i,g=0;switch(Math.floor(o)){case 0:n[0]=1,n[1]=i,n[2]=0;break;case 1:n[0]=c,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=i;break;case 3:n[0]=0,n[1]=c,n[2]=1;break;case 4:n[0]=i,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=c}return g=(1-e)*r,[(e*n[0]+g)*255,(e*n[1]+g)*255,(e*n[2]+g)*255]},s.hcg.hsv=function(t){let l=t[1]/100,e=t[2]/100,r=l+e*(1-l),n=0;return r>0&&(n=l/r),[t[0],n*100,r*100]},s.hcg.hsl=function(t){let l=t[1]/100,e=t[2]/100*(1-l)+.5*l,r=0;return e>0&&e<.5?r=l/(2*e):e>=.5&&e<1&&(r=l/(2*(1-e))),[t[0],r*100,e*100]},s.hcg.hwb=function(t){let l=t[1]/100,e=t[2]/100,r=l+e*(1-l);return[t[0],(r-l)*100,(1-r)*100]},s.hwb.hcg=function(t){let l=t[1]/100,e=1-t[2]/100,r=e-l,n=0;return r<1&&(n=(e-r)/(1-r)),[t[0],r*100,n*100]},s.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},s.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},s.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},s.gray.hsl=function(t){return[0,0,t[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(t){return[0,100,t[0]]},s.gray.cmyk=function(t){return[0,0,0,t[0]]},s.gray.lab=function(t){return[t[0],0,0]},s.gray.hex=function(t){let l=Math.round(t[0]/100*255)&255,e=((l<<16)+(l<<8)+l).toString(16).toUpperCase();return"000000".substring(e.length)+e},s.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}),Re=E((h,u)=>{var a=ie();function f(){let l={},e=Object.keys(a);for(let r=e.length,n=0;n<r;n++)l[e[n]]={distance:-1,parent:null};return l}function s(l){let e=f(),r=[l];for(e[l].distance=0;r.length;){let n=r.pop(),o=Object.keys(a[n]);for(let i=o.length,c=0;c<i;c++){let g=o[c],p=e[g];p.distance===-1&&(p.distance=e[n].distance+1,p.parent=n,r.unshift(g))}}return e}function d(l,e){return function(r){return e(l(r))}}function t(l,e){let r=[e[l].parent,l],n=a[e[l].parent][l],o=e[l].parent;for(;e[o].parent;)r.unshift(e[o].parent),n=d(a[e[o].parent][o],n),o=e[o].parent;return n.conversion=r,n}u.exports=function(l){let e=s(l),r={},n=Object.keys(e);for(let o=n.length,i=0;i<o;i++){let c=n[i];e[c].parent!==null&&(r[c]=t(c,e))}return r}}),Ne=E((h,u)=>{var a=ie(),f=Re(),s={},d=Object.keys(a);function t(e){let r=function(...n){let o=n[0];return o==null?o:(o.length>1&&(n=o),e(n))};return"conversion"in e&&(r.conversion=e.conversion),r}function l(e){let r=function(...n){let o=n[0];if(o==null)return o;o.length>1&&(n=o);let i=e(n);if(typeof i=="object")for(let c=i.length,g=0;g<c;g++)i[g]=Math.round(i[g]);return i};return"conversion"in e&&(r.conversion=e.conversion),r}d.forEach(e=>{s[e]={},Object.defineProperty(s[e],"channels",{value:a[e].channels}),Object.defineProperty(s[e],"labels",{value:a[e].labels});let r=f(e);Object.keys(r).forEach(n=>{let o=r[n];s[e][n]=l(o),s[e][n].raw=t(o)})}),u.exports=s}),Pe=E((h,u)=>{"use strict";var a=(o,i)=>(...c)=>`\x1B[${o(...c)+i}m`,f=(o,i)=>(...c)=>{let g=o(...c);return`\x1B[${38+i};5;${g}m`},s=(o,i)=>(...c)=>{let g=o(...c);return`\x1B[${38+i};2;${g[0]};${g[1]};${g[2]}m`},d=o=>o,t=(o,i,c)=>[o,i,c],l=(o,i,c)=>{Object.defineProperty(o,i,{get:()=>{let g=c();return Object.defineProperty(o,i,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})},e,r=(o,i,c,g)=>{e===void 0&&(e=Ne());let p=g?10:0,m={};for(let[k,j]of Object.entries(e)){let B=k==="ansi16"?"ansi":k;k===i?m[B]=o(c,p):typeof j=="object"&&(m[B]=o(j[i],p))}return m};function n(){let o=new Map,i={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};i.color.gray=i.color.blackBright,i.bgColor.bgGray=i.bgColor.bgBlackBright,i.color.grey=i.color.blackBright,i.bgColor.bgGrey=i.bgColor.bgBlackBright;for(let[c,g]of Object.entries(i)){for(let[p,m]of Object.entries(g))i[p]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},g[p]=i[p],o.set(m[0],m[1]);Object.defineProperty(i,c,{value:g,enumerable:!1})}return Object.defineProperty(i,"codes",{value:o,enumerable:!1}),i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",l(i.color,"ansi",()=>r(a,"ansi16",d,!1)),l(i.color,"ansi256",()=>r(f,"ansi256",d,!1)),l(i.color,"ansi16m",()=>r(s,"rgb",t,!1)),l(i.bgColor,"ansi",()=>r(a,"ansi16",d,!0)),l(i.bgColor,"ansi256",()=>r(f,"ansi256",d,!0)),l(i.bgColor,"ansi16m",()=>r(s,"rgb",t,!0)),i}Object.defineProperty(u,"exports",{enumerable:!0,get:n})}),Ae=E((h,u)=>{"use strict";u.exports=(a,f=process.argv)=>{let s=a.startsWith("-")?"":a.length===1?"-":"--",d=f.indexOf(s+a),t=f.indexOf("--");return d!==-1&&(t===-1||d<t)}}),Fe=E((h,u)=>{"use strict";var a=Q("os"),f=Q("tty"),s=Ae(),{env:d}=process,t;s("no-color")||s("no-colors")||s("color=false")||s("color=never")?t=0:(s("color")||s("colors")||s("color=true")||s("color=always"))&&(t=1),"FORCE_COLOR"in d&&(d.FORCE_COLOR==="true"?t=1:d.FORCE_COLOR==="false"?t=0:t=d.FORCE_COLOR.length===0?1:Math.min(parseInt(d.FORCE_COLOR,10),3));function l(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function e(n,o){if(t===0)return 0;if(s("color=16m")||s("color=full")||s("color=truecolor"))return 3;if(s("color=256"))return 2;if(n&&!o&&t===void 0)return 0;let i=t||0;if(d.TERM==="dumb")return i;if(process.platform==="win32"){let c=a.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in d)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(c=>c in d)||d.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in d)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d.TEAMCITY_VERSION)?1:0;if(d.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in d){let c=parseInt((d.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(d.TERM_PROGRAM){case"iTerm.app":return c>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(d.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(d.TERM)||"COLORTERM"in d?1:i}function r(n){let o=e(n,n&&n.isTTY);return l(o)}u.exports={supportsColor:r,stdout:l(e(!0,f.isatty(1))),stderr:l(e(!0,f.isatty(2)))}}),Ie=E((h,u)=>{"use strict";var a=(s,d,t)=>{let l=s.indexOf(d);if(l===-1)return s;let e=d.length,r=0,n="";do n+=s.substr(r,l-r)+d+t,r=l+e,l=s.indexOf(d,r);while(l!==-1);return n+=s.substr(r),n},f=(s,d,t,l)=>{let e=0,r="";do{let n=s[l-1]==="\r";r+=s.substr(e,(n?l-1:l)-e)+d+(n?`\r
|
|
6
2
|
`:`
|
|
7
|
-
`)+e
|
|
8
|
-
`,
|
|
9
|
-
`
|
|
10
|
-
`)
|
|
3
|
+
`)+t,e=l+1,l=s.indexOf(`
|
|
4
|
+
`,e)}while(l!==-1);return r+=s.substr(e),r};u.exports={stringReplaceAll:a,stringEncaseCRLFWithFirstIndex:f}}),Se=E((h,u)=>{"use strict";var a=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,f=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,d=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,t=new Map([["n",`
|
|
5
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function l(o){let i=o[0]==="u",c=o[1]==="{";return i&&!c&&o.length===5||o[0]==="x"&&o.length===3?String.fromCharCode(parseInt(o.slice(1),16)):i&&c?String.fromCodePoint(parseInt(o.slice(2,-1),16)):t.get(o)||o}function e(o,i){let c=[],g=i.trim().split(/\s*,\s*/g),p;for(let m of g){let k=Number(m);if(!Number.isNaN(k))c.push(k);else if(p=m.match(s))c.push(p[2].replace(d,(j,B,A)=>B?l(B):A));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${o}')`)}return c}function r(o){f.lastIndex=0;let i=[],c;for(;(c=f.exec(o))!==null;){let g=c[1];if(c[2]){let p=e(g,c[2]);i.push([g].concat(p))}else i.push([g])}return i}function n(o,i){let c={};for(let p of i)for(let m of p.styles)c[m[0]]=p.inverse?null:m.slice(1);let g=o;for(let[p,m]of Object.entries(c))if(Array.isArray(m)){if(!(p in g))throw new Error(`Unknown Chalk style: ${p}`);g=m.length>0?g[p](...m):g[p]}return g}u.exports=(o,i)=>{let c=[],g=[],p=[];if(i.replace(a,(m,k,j,B,A,v)=>{if(k)p.push(l(k));else if(B){let b=p.join("");p=[],g.push(c.length===0?b:n(o,c)(b)),c.push({inverse:j,styles:r(B)})}else if(A){if(c.length===0)throw new Error("Found extraneous } in Chalk template literal");g.push(n(o,c)(p.join(""))),p=[],c.pop()}else p.push(v)}),g.push(p.join("")),c.length>0){let m=`Chalk template literal is missing ${c.length} closing bracket${c.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return g.join("")}}),$=E((h,u)=>{"use strict";var a=Pe(),{stdout:f,stderr:s}=Fe(),{stringReplaceAll:d,stringEncaseCRLFWithFirstIndex:t}=Ie(),l=["ansi","ansi","ansi256","ansi16m"],e=Object.create(null),r=(v,b={})=>{if(b.level&&!(Number.isInteger(b.level)&&b.level>=0&&b.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let y=f?f.level:0;v.level=b.level===void 0?y:b.level},n=class{constructor(v){return o(v)}},o=v=>{let b={};return r(b,v),b.template=(...y)=>B(b.template,...y),Object.setPrototypeOf(b,i.prototype),Object.setPrototypeOf(b.template,b),b.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},b.template.Instance=n,b.template};function i(v){return o(v)}for(let[v,b]of Object.entries(a))e[v]={get(){let y=m(this,p(b.open,b.close,this.r),this.n);return Object.defineProperty(this,v,{value:y}),y}};e.visible={get(){let v=m(this,this.r,!0);return Object.defineProperty(this,"visible",{value:v}),v}};var c=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let v of c)e[v]={get(){let{level:b}=this;return function(...y){let O=p(a.color[l[b]][v](...y),a.color.close,this.r);return m(this,O,this.n)}}};for(let v of c){let b="bg"+v[0].toUpperCase()+v.slice(1);e[b]={get(){let{level:y}=this;return function(...O){let M=p(a.bgColor[l[y]][v](...O),a.bgColor.close,this.r);return m(this,M,this.n)}}}}var g=Object.defineProperties(()=>{},{...e,level:{enumerable:!0,get(){return this.l.level},set(v){this.l.level=v}}}),p=(v,b,y)=>{let O,M;return y===void 0?(O=v,M=b):(O=y.openAll+v,M=b+y.closeAll),{open:v,close:b,openAll:O,closeAll:M,parent:y}},m=(v,b,y)=>{let O=(...M)=>k(O,M.length===1?""+M[0]:M.join(" "));return Object.setPrototypeOf(O,g),O.l=v,O.r=b,O.n=y,O},k=(v,b)=>{if(v.level<=0||!b)return v.n?"":b;let y=v.r;if(y===void 0)return b;let{openAll:O,closeAll:M}=y;if(b.indexOf("\x1B")!==-1)for(;y!==void 0;)b=d(b,y.close,y.open),y=y.parent;let I=b.indexOf(`
|
|
6
|
+
`);return I!==-1&&(b=t(b,M,O,I)),O+b+M},j,B=(v,...b)=>{let[y]=b;if(!Array.isArray(y))return b.join(" ");let O=b.slice(1),M=[y.raw[0]];for(let I=1;I<y.length;I++)M.push(String(O[I-1]).replace(/[{}\\]/g,"\\$&"),String(y.raw[I]));return j===void 0&&(j=Se()),j(v,M.join(""))};Object.defineProperties(i.prototype,e);var A=i();A.supportsColor=f,A.stderr=i({level:s?s.level:0}),A.stderr.supportsColor=s,u.exports=A}),Te=E((h,u)=>{"use strict";function a(f){var s=void 0;typeof f=="string"?s=[f]:s=f.raw;for(var d="",t=0;t<s.length;t++)d+=s[t].replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`"),t<(arguments.length<=1?0:arguments.length-1)&&(d+=arguments.length<=t+1?void 0:arguments[t+1]);var l=d.split(`
|
|
7
|
+
`),e=null;return l.forEach(function(r){var n=r.match(/^(\s+)\S+/);if(n){var o=n[1].length;e?e=Math.min(e,o):e=o}}),e!==null&&(d=l.map(function(r){return r[0]===" "?r.slice(e):r}).join(`
|
|
8
|
+
`)),d=d.trim(),d.replace(/\\n/g,`
|
|
9
|
+
`)}typeof u<"u"&&(u.exports=a)}),N=(h,u)=>{if(!h)throw new Error(u)},_e=h=>{let u={joined:!0,spacerNoNeighbour:" ",spacerNeighbour:"\u2502 ",keyNoNeighbour:"\u2514\u2500 ",keyNeighbour:"\u251C\u2500 ",separator:": ",renderFn:a=>["boolean","string","number"].includes(typeof a)?a:void 0,sortFn:null,breakCircularWith:" (circular ref.)",...h};return N(Object.keys(u).length===9,"Unexpected Option(s) provided"),N(typeof u.joined=="boolean",'Option "joined" has invalid format'),N(typeof u.spacerNoNeighbour=="string",'Option "spacerNoNeighbour" has invalid format'),N(typeof u.spacerNeighbour=="string",'Option "spacerNeighbour" has invalid format'),N(typeof u.keyNoNeighbour=="string",'Option "keyNoNeighbour" has invalid format'),N(typeof u.keyNeighbour=="string",'Option "keyNeighbour" has invalid format'),N(typeof u.separator=="string",'Option "separator" has invalid format'),N(typeof u.renderFn=="function",'Option "renderFn" has invalid format'),N(typeof u.sortFn=="function"||u.sortFn===null,'Option "sortFn" has invalid format'),N(typeof u.breakCircularWith=="string"||u.breakCircularWith===null,'Option "breakCircularWith" has invalid format'),u},se=(h,u={})=>{let a=_e(u),f=[],s=a.renderFn(h);s!==void 0&&f.push(String(s));let d=r=>a.sortFn===null?r.reverse():r.sort((n,o)=>a.sortFn(o,n)),t=[],l=d(Object.keys(h)).map(r=>[r]),e=[h];for(;l.length!==0;){let r=l.pop(),n=e[r.length-1][r[r.length-1]],o=a.breakCircularWith!==null&&e.includes(n);t[r.length-1]=l.length!==0&&l[l.length-1].length===r.length;let i=a.renderFn(n);f.push([t.slice(0,r.length-1).map(c=>c?a.spacerNeighbour:a.spacerNoNeighbour).join(""),t[r.length-1]?a.keyNeighbour:a.keyNoNeighbour,r[r.length-1],i===void 0?"":`${a.separator}${n}`,o?a.breakCircularWith:""].join("")),n instanceof Object&&!Array.isArray(n)&&!o&&(l.push(...d(Object.keys(n)).map(c=>r.concat(c))),e[r.length]=n)}return a.joined===!0?f.join(`
|
|
10
|
+
`):f},qe=x($()),q=x($()),w=x($());function P(h){return h.split(" ").map(u=>u.replace(/^(\d*\.?\d*)$/g,`${w.default.blue("$1")}`).replace(/^(\d*\.?\d*)(YB|ZB|EB|PB|TB|GB|MB|KB|B|mb|kb|kB|bit|zs|as|fs|ps|ns|µs|ms|s|m|h|d|m|y)$/g,`${w.default.cyan("$1")}${w.default.magenta("$2")}`).replace(/^((?:[0-1]?[0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9] (?:AM|PM)?)$/g,`${w.default.dim("$1")}`).replace(/^\[(.*?)\]$/g,`${w.default.dim("[")}${w.default.magenta("$1")}${w.default.dim("]")}`).replace(/^`(.*?)`$/g,`${w.default.dim("`")}$1${w.default.dim("`")}`).replace(/^\((.*?)\)$/g,`${w.default.dim("(")}$1${w.default.dim(")")}`).replace(/^<(.*?)>$/g,`${w.default.dim("<")}${w.default.gray("$1")}${w.default.dim(">")}`).replace(/->/g,w.default.dim("\u2192")).replace(/<-/g,w.default.dim("\u2190")).replace(/^\$t$/g,`${w.default.dim(new Date().toLocaleTimeString())}`).replace(/^\*\*(.*?)\*\*$/g,`${w.default.bold.white("$1")}`).replace(/^~~(.*?)~~$/g,`${w.default.strikethrough("$1")}`).replace(/^__(.*?)__$/g,`${w.default.underline("$1")}`).replace(/^\.\.(.*?)\.\.$/g,`${w.default.dim("$1")}`).replace(/^!!(.*?)!!$/g,`${w.default.yellow("$1")}`).replace(/^\*(.*?)\*$/g,`${w.default.italic("$1")}`).replace(/^_(.*?)_$/g,`${w.default.italic("$1")}`).replace(/^\+(.*?)\+$/g,`${w.default.green("$1")}`).replace(/^-(.*?)-$/g,`${w.default.red("$1")}`)).join(" ")}function C(h,u){let a="";if(Array.isArray(h))for(let f=0;f<h.length;f++)a+=L(h[f])+L(u[f]);else a=[h,...u].map(f=>L(f)).join(" ");return P(a)}var L=h=>h?Array.isArray(h)?h.map(u=>{switch(typeof u){case"string":return`'${q.default.yellow(u)}'`;case"number":case"boolean":return q.default.blue(u);default:return u}}).join(q.default.gray(", ")):h:"",X=(h,...u)=>{let a=qe.default.green("+")+" "+C(h,u);return console.log(a),a},Le=x($()),ee=(h,...u)=>{let a=Le.default.bgRed.bold.white(" \u{1D5EB} ERROR ")+" "+C(h,u);return console.log(a),a},te=x($()),ze=(h,...u)=>{let a=te.default.bgYellow.bold.white(" \u26A0\uFE0F CONFLICT ")+" "+te.default.yellow(C(h,u));return console.log(a),a},Ge=x($()),We=(h,...u)=>{let a=Ge.default.green("\u2713 ")+C(h,u);return console.log(a),a},De=x($()),z=(h,...u)=>{let a=De.default.red("-")+" "+C(h,u);return console.log(a),a},Ye=x($()),re=(h,...u)=>{let a=Ye.default.green("\u25CB ")+C(h,u);return console.log(a),a},Ve=x($()),ne=(h,...u)=>{let a=Ve.default.red("\u2717 ")+C(h,u);return console.log(a),a},Ue=x($()),le=(h,...u)=>{let a=Ue.default.cyan("\u{1D4F2}")+" "+C(h,u);return console.log(a),a},He=x($()),Je=(h,...u)=>{let a=He.default.green("\u23FA Success ")+C(h,u);return console.log(a),a},Ke=x($()),Ze=(h,...u)=>{let a=Ke.default.yellow("\u23FA Warn ")+C(h,u);return console.log(a),a},Qe=x($()),Xe=(h,...u)=>{let a=Qe.default.bgGreen.bold.white(" \u2713 PASS ")+" "+C(h,u);return console.log(a),a},et=h=>{let u=se(ce(ue(JSON.parse(JSON.stringify(h)))),{spacerNeighbour:P("..\u2502..")+" ",keyNoNeighbour:P("..\u2514\u2500..")+" ",keyNeighbour:P("..\u251C\u2500..")+" ",separator:P("..:..")+" "});return console.log(u),u};function ue(h){for(let u in h){let a=h[u];typeof a=="object"?a!==null&&!Object.keys(a).length?delete h[u]:h[u]=ue(a):a===void 0&&delete h[u]}return h}function ce(h){for(let u in h){let a=h[u];Array.isArray(a)?h[u]=a.map(f=>P(`**${f}**`)).join(P("..,..")):typeof a=="object"?ce(a):h[u]=P(`**${a}**`)}return h}var tt=x($()),rt=(h,...u)=>{let a=tt.default.red("\u23FA Fail ")+C(h,u);return console.log(a),a},oe=(h,...u)=>{let a=P("$t ")+C(h,u);return console.log(a),a},nt=x(Te()),G=x($());function lt(h){let{message:u,stack:a}=typeof h=="string"?new Error(h):h,f={};return(0,nt.default)(a.replace(u,"").replace(/^Error: /,"")).split(`
|
|
11
|
+
`).forEach(s=>{f[s.split(" ").map(d=>d.replace(/^\((.+)\)$/,`${G.default.cyan("$1")}`).replace(/\./g,`${G.default.dim(".")}`).replace(/^at$/,t=>G.default.dim(t))).join(" ")]=null}),{message:u.trim().replace(/Error: /g,""),stackTree:f}}var S=x($()),he=(h,...u)=>{if(h instanceof Error){let{message:a,stackTree:f}=lt(h);return console.log(""),console.log(S.default.bgRed.bold.white(" \u{1D5EB} ERROR ")+" "+S.default.bold.red(a)),console.log(se(f,{spacerNeighbour:S.default.redBright.dim("\u2502\u2000\u2000"),keyNoNeighbour:S.default.redBright.dim("\u2514\u2500\u2000"),keyNeighbour:S.default.redBright.dim("\u251C\u2500 "),separator:S.default.redBright.dim(":\u2000")})),console.log(""),a}else{let a=C(h,u);return console.log(a),a}};Object.assign(he,{a:X,add:X,d:z,del:z,delete:z,o:re,valid:re,x:ne,invalid:ne,i:le,info:le,e:ee,error:ee,t:oe,timestamp:oe,success:Je,fail:rt,warn:Ze,pass:Xe,conflict:ze,ok:We,tree:et,paint:P});var ot=x($()),F=he,W=ot.default;var pe=R(require("stylelint")),J=R(require("to-extend")),K=class extends de.default{constructor(a){super(Y.default,a);this.customOptions=a;let f=this.readConfig(null);this.options=(0,J.default)(this.options,f?.compilerOptions,a),this.css=f?.css??new V.default(f?.config)}css;extractions=new Set;validExtractions=new Set;invalidExtractions=new Set;logConfigFound=a=>F.ok`**${a}** definition file found`;logConfigNotFound=a=>F.i`No **${a}** definition file found`;get resolvedModuleId(){return"\0"+this.options.module}get moduleHMREvent(){return`HMR:${this.options.module}`}async refresh(){this.extractions.clear(),this.validExtractions.clear(),this.invalidExtractions.clear(),console.log("");let a=this.readConfig(null);return this.css=new V.default(a?.config),this.options=(0,J.default)({cwd:this.options.cwd},Y.default,a?.compilerOptions,this.customOptions),await this.compile(),this}async compile(){if(this.options.classes?.fixed?.length)for(let a of this.options.classes.fixed)this.css.insert(a);return await Promise.all(this.sources.map(async a=>{let f=fe.default.readFileSync(D.default.resolve(this.options.cwd,a),{encoding:"utf-8"}).toString();await this.insert(a,f)})),this}extract(a,f){if(!a||!f||!this.checkSourcePath(a))return[];let s=[];for(let d of(0,ge.default)({content:f,name:a},this.css))this.extractions.has(d)||(this.extractions.add(d),s.push(d));return s}async insert(a,f){let s=this.extract(a,f);if(!s.length)return!1;this.invalidExtractions.size&&(s=s.filter(e=>!this.invalidExtractions.has(e))),this.validExtractions.size&&(s=s.filter(e=>!this.validExtractions.has(e))),this.options.classes?.ignored?.length&&(s=s.filter(e=>{for(let r of this.options.classes.ignored)if(typeof r=="string"){if(r===e)return!1}else if(r.test(e))return!1;return!0}));let d=U.performance.now(),t=[];await Promise.all(s.map(async e=>{let r=await this.createRules(e);r.length?(this.css.insertRules(r),t.push(e),this.validExtractions.add(e)):this.invalidExtractions.add(e)}));let l=Math.round((U.performance.now()-d)*100)/100;if(s.length&&(console.log(""),F`**${D.default.relative(this.options.cwd,a)}**`,F`[extract] ${s.length} potential`),this.css.rules.length){let e=t.filter(r=>!s.includes(r));e.length&&F`[exclude] ${e.length} unknown ${e}`,F`[compile] +${t.length}+ valid inserted ${W.gray("in")} ${l}ms ${t}`,F`[virtual] ${this.css.rules.length} total ${W.gray("in")} ${this.options.module}`}return!0}async createRules(a){return(await Promise.all(this.css.create(a).map(async s=>(await pe.default.lint({code:s.text,cache:!1,config:{rules:{"color-no-invalid-hex":!0,"named-grid-areas-no-invalid":!0,"at-rule-no-unknown":!0,"function-no-unknown":!0,"media-feature-name-no-unknown":!0,"property-no-unknown":!0,"selector-pseudo-class-no-unknown":!0,"selector-pseudo-element-no-unknown":!0,"selector-type-no-unknown":!0,"unit-no-unknown":!0}}})).errored?null:s))).filter(s=>s)}get sources(){let{include:a,exclude:f,sources:s}=this.options,d=H.default.sync(a,{cwd:this.options.cwd,ignore:f});return s?.length&&d.push(...H.default.sync(s,{cwd:this.options.cwd})),d}checkSourcePath(a){let{include:f,exclude:s,sources:d}=this.options;for(let t of d)if((0,_.default)(a,t))return!0;for(let t of f)if(!(0,_.default)(a,t))return!1;for(let t of s)if((0,_.default)(a,t))return!1;return!0}get config(){return this.css.config}};0&&(module.exports={MasterCSSCompiler});
|
package/dist/esm/compiler.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import ee from"upath";import{default as te}from"./options/index.mjs";import re from"@master/css";import{performance as oe}from"perf_hooks";import Ue from"./extract.mjs";import ze from"fs";import ne from"fast-glob";import P from"minimatch";import Je from"techor";import M from"node:process";import we from"node:os";import _ from"node:tty";var ae=Object.create,Z=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyNames,ge=Object.getPrototypeOf,he=Object.prototype.hasOwnProperty,fe=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),de=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ue(t))!he.call(r,n)&&n!==e&&Z(r,n,{get:()=>t[n],enumerable:!(o=ce(t,n))||o.enumerable});return r},pe=(r,t,e)=>(e=r!=null?ae(ge(r)):{},de(t||!r||!r.r?Z(e,"default",{value:r,enumerable:!0}):e,r)),me=fe((r,t)=>{"use strict";function e(o){var n=void 0;typeof o=="string"?n=[o]:n=o.raw;for(var l="",s=0;s<n.length;s++)l+=n[s].replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`"),s<(arguments.length<=1?0:arguments.length-1)&&(l+=arguments.length<=s+1?void 0:arguments[s+1]);var h=l.split(`
|
|
2
|
-
`),c=null;return h.forEach(function(a){var d=a.match(/^(\s+)\S+/);if(d){var $=d[1].length;c?c=Math.min(c,$):c=$}}),c!==null&&(l=h.map(function(a){return a[0]===" "?a.slice(c):a}).join(`
|
|
3
|
-
`)),l=l.trim(),l.replace(/\\n/g,`
|
|
4
|
-
`)}typeof t<"u"&&(t.exports=e)}),m=(r,t)=>{if(!r)throw new Error(t)},be=r=>{let t={joined:!0,spacerNoNeighbour:" ",spacerNeighbour:"\u2502 ",keyNoNeighbour:"\u2514\u2500 ",keyNeighbour:"\u251C\u2500 ",separator:": ",renderFn:e=>["boolean","string","number"].includes(typeof e)?e:void 0,sortFn:null,breakCircularWith:" (circular ref.)",...r};return m(Object.keys(t).length===9,"Unexpected Option(s) provided"),m(typeof t.joined=="boolean",'Option "joined" has invalid format'),m(typeof t.spacerNoNeighbour=="string",'Option "spacerNoNeighbour" has invalid format'),m(typeof t.spacerNeighbour=="string",'Option "spacerNeighbour" has invalid format'),m(typeof t.keyNoNeighbour=="string",'Option "keyNoNeighbour" has invalid format'),m(typeof t.keyNeighbour=="string",'Option "keyNeighbour" has invalid format'),m(typeof t.separator=="string",'Option "separator" has invalid format'),m(typeof t.renderFn=="function",'Option "renderFn" has invalid format'),m(typeof t.sortFn=="function"||t.sortFn===null,'Option "sortFn" has invalid format'),m(typeof t.breakCircularWith=="string"||t.breakCircularWith===null,'Option "breakCircularWith" has invalid format'),t},H=(r,t={})=>{let e=be(t),o=[],n=e.renderFn(r);n!==void 0&&o.push(String(n));let l=a=>e.sortFn===null?a.reverse():a.sort((d,$)=>e.sortFn($,d)),s=[],h=l(Object.keys(r)).map(a=>[a]),c=[r];for(;h.length!==0;){let a=h.pop(),d=c[a.length-1][a[a.length-1]],$=e.breakCircularWith!==null&&c.includes(d);s[a.length-1]=h.length!==0&&h[h.length-1].length===a.length;let se=e.renderFn(d);o.push([s.slice(0,a.length-1).map(E=>E?e.spacerNeighbour:e.spacerNoNeighbour).join(""),s[a.length-1]?e.keyNeighbour:e.keyNoNeighbour,a[a.length-1],se===void 0?"":`${e.separator}${d}`,$?e.breakCircularWith:""].join("")),d instanceof Object&&!Array.isArray(d)&&!$&&(h.push(...l(Object.keys(d)).map(E=>a.concat(E))),c[a.length]=d)}return e.joined===!0?o.join(`
|
|
5
|
-
`):o},F=(r=0)=>t=>`\x1B[${t+r}m`,I=(r=0)=>t=>`\x1B[${38+r};5;${t}m`,S=(r=0)=>(t,e,o)=>`\x1B[${38+r};2;${t};${e};${o}m`,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Ze=Object.keys(u.modifier),ve=Object.keys(u.color),ye=Object.keys(u.bgColor),He=[...ve,...ye];function $e(){let r=new Map;for(let[t,e]of Object.entries(u)){for(let[o,n]of Object.entries(e))u[o]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},e[o]=u[o],r.set(n[0],n[1]);Object.defineProperty(u,t,{value:e,enumerable:!1})}return Object.defineProperty(u,"codes",{value:r,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=F(),u.color.ansi256=I(),u.color.ansi16m=S(),u.bgColor.ansi=F(10),u.bgColor.ansi256=I(10),u.bgColor.ansi16m=S(10),Object.defineProperties(u,{rgbToAnsi256:{value(t,e,o){return t===e&&e===o?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(t){let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[o]=e;o.length===3&&(o=[...o].map(l=>l+l).join(""));let n=Number.parseInt(o,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:t=>u.rgbToAnsi256(...u.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let e,o,n;if(t>=232)e=((t-232)*10+8)/255,o=e,n=e;else{t-=16;let h=t%36;e=Math.floor(t/36)/5,o=Math.floor(h/6)/5,n=h%6/5}let l=Math.max(e,o,n)*2;if(l===0)return 30;let s=30+(Math.round(n)<<2|Math.round(o)<<1|Math.round(e));return l===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,e,o)=>u.ansi256ToAnsi(u.rgbToAnsi256(t,e,o)),enumerable:!1},hexToAnsi:{value:t=>u.ansi256ToAnsi(u.hexToAnsi256(t)),enumerable:!1}}),u}var Oe=$e(),b=Oe;function p(r,t=globalThis.Deno?globalThis.Deno.args:M.argv){let e=r.startsWith("-")?"":r.length===1?"-":"--",o=t.indexOf(e+r),n=t.indexOf("--");return o!==-1&&(n===-1||o<n)}var{env:g}=M,T;p("no-color")||p("no-colors")||p("color=false")||p("color=never")?T=0:(p("color")||p("colors")||p("color=true")||p("color=always"))&&(T=1);function xe(){if("FORCE_COLOR"in g)return g.FORCE_COLOR==="true"?1:g.FORCE_COLOR==="false"?0:g.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(g.FORCE_COLOR,10),3)}function Re(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Te(r,{streamIsTTY:t,sniffFlags:e=!0}={}){let o=xe();o!==void 0&&(T=o);let n=e?T:o;if(n===0)return 0;if(e){if(p("color=16m")||p("color=full")||p("color=truecolor"))return 3;if(p("color=256"))return 2}if("TF_BUILD"in g&&"AGENT_NAME"in g)return 1;if(r&&!t&&n===void 0)return 0;let l=n||0;if(g.TERM==="dumb")return l;if(M.platform==="win32"){let s=we.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in g)return"GITHUB_ACTIONS"in g?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in g)||g.CI_NAME==="codeship"?1:l;if("TEAMCITY_VERSION"in g)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION)?1:0;if(g.COLORTERM==="truecolor"||g.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in g){let s=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:l}function L(r,t={}){let e=Te(r,{streamIsTTY:r&&r.isTTY,...t});return Re(e)}var Ce={stdout:L({isTTY:_.isatty(1)}),stderr:L({isTTY:_.isatty(2)})},Ee=Ce;function Ne(r,t,e){let o=r.indexOf(t);if(o===-1)return r;let n=t.length,l=0,s="";do s+=r.slice(l,o)+t+e,l=o+n,o=r.indexOf(t,l);while(o!==-1);return s+=r.slice(l),s}function ke(r,t,e,o){let n=0,l="";do{let s=r[o-1]==="\r";l+=r.slice(n,s?o-1:o)+t+(s?`\r
|
|
1
|
+
var I=(h=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(h,{get:(c,i)=>(typeof require<"u"?require:c)[i]}):h)(function(h){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+h+'" is not supported')});import ne from"upath";import{default as le}from"./options/index.mjs";import oe from"@master/css";import{performance as ae}from"perf_hooks";import Ue from"./extract.mjs";import He from"fs";import ie from"fast-glob";import G from"minimatch";import Je from"techor";var ce=Object.create,Z=Object.defineProperty,he=Object.getOwnPropertyDescriptor,ge=Object.getOwnPropertyNames,fe=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty,W=(h=>typeof I<"u"?I:typeof Proxy<"u"?new Proxy(h,{get:(c,i)=>(typeof I<"u"?I:c)[i]}):h)(function(h){if(typeof I<"u")return I.apply(this,arguments);throw new Error('Dynamic require of "'+h+'" is not supported')}),E=(h,c)=>()=>(c||h((c={exports:{}}).exports,c),c.exports),pe=(h,c,i,d)=>{if(c&&typeof c=="object"||typeof c=="function")for(let s of ge(c))!de.call(h,s)&&s!==i&&Z(h,s,{get:()=>c[s],enumerable:!(d=he(c,s))||d.enumerable});return h},x=(h,c,i)=>(i=h!=null?ce(fe(h)):{},pe(c||!h||!h.s?Z(i,"default",{value:h,enumerable:!0}):i,h)),be=E((h,c)=>{"use strict";c.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),Q=E((h,c)=>{var i=be(),d={};for(let t of Object.keys(i))d[i[t]]=t;var s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};c.exports=s;for(let t of Object.keys(s)){if(!("channels"in s[t]))throw new Error("missing channels property: "+t);if(!("labels"in s[t]))throw new Error("missing channel labels property: "+t);if(s[t].labels.length!==s[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:l,labels:e}=s[t];delete s[t].channels,delete s[t].labels,Object.defineProperty(s[t],"channels",{value:l}),Object.defineProperty(s[t],"labels",{value:e})}s.rgb.hsl=function(t){let l=t[0]/255,e=t[1]/255,r=t[2]/255,n=Math.min(l,e,r),o=Math.max(l,e,r),a=o-n,u,g;o===n?u=0:l===o?u=(e-r)/a:e===o?u=2+(r-l)/a:r===o&&(u=4+(l-e)/a),u=Math.min(u*60,360),u<0&&(u+=360);let p=(n+o)/2;return o===n?g=0:p<=.5?g=a/(o+n):g=a/(2-o-n),[u,g*100,p*100]},s.rgb.hsv=function(t){let l,e,r,n,o,a=t[0]/255,u=t[1]/255,g=t[2]/255,p=Math.max(a,u,g),m=p-Math.min(a,u,g),k=function(j){return(p-j)/6/m+1/2};return m===0?(n=0,o=0):(o=m/p,l=k(a),e=k(u),r=k(g),a===p?n=r-e:u===p?n=1/3+l-r:g===p&&(n=2/3+e-l),n<0?n+=1:n>1&&(n-=1)),[n*360,o*100,p*100]},s.rgb.hwb=function(t){let l=t[0],e=t[1],r=t[2],n=s.rgb.hsl(t)[0],o=1/255*Math.min(l,Math.min(e,r));return r=1-1/255*Math.max(l,Math.max(e,r)),[n,o*100,r*100]},s.rgb.cmyk=function(t){let l=t[0]/255,e=t[1]/255,r=t[2]/255,n=Math.min(1-l,1-e,1-r),o=(1-l-n)/(1-n)||0,a=(1-e-n)/(1-n)||0,u=(1-r-n)/(1-n)||0;return[o*100,a*100,u*100,n*100]};function f(t,l){return(t[0]-l[0])**2+(t[1]-l[1])**2+(t[2]-l[2])**2}s.rgb.keyword=function(t){let l=d[t];if(l)return l;let e=1/0,r;for(let n of Object.keys(i)){let o=i[n],a=f(t,o);a<e&&(e=a,r=n)}return r},s.keyword.rgb=function(t){return i[t]},s.rgb.xyz=function(t){let l=t[0]/255,e=t[1]/255,r=t[2]/255;l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let n=l*.4124+e*.3576+r*.1805,o=l*.2126+e*.7152+r*.0722,a=l*.0193+e*.1192+r*.9505;return[n*100,o*100,a*100]},s.rgb.lab=function(t){let l=s.rgb.xyz(t),e=l[0],r=l[1],n=l[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let o=116*r-16,a=500*(e-r),u=200*(r-n);return[o,a,u]},s.hsl.rgb=function(t){let l=t[0]/360,e=t[1]/100,r=t[2]/100,n,o,a;if(e===0)return a=r*255,[a,a,a];r<.5?n=r*(1+e):n=r+e-r*e;let u=2*r-n,g=[0,0,0];for(let p=0;p<3;p++)o=l+1/3*-(p-1),o<0&&o++,o>1&&o--,6*o<1?a=u+(n-u)*6*o:2*o<1?a=n:3*o<2?a=u+(n-u)*(2/3-o)*6:a=u,g[p]=a*255;return g},s.hsl.hsv=function(t){let l=t[0],e=t[1]/100,r=t[2]/100,n=e,o=Math.max(r,.01);r*=2,e*=r<=1?r:2-r,n*=o<=1?o:2-o;let a=(r+e)/2,u=r===0?2*n/(o+n):2*e/(r+e);return[l,u*100,a*100]},s.hsv.rgb=function(t){let l=t[0]/60,e=t[1]/100,r=t[2]/100,n=Math.floor(l)%6,o=l-Math.floor(l),a=255*r*(1-e),u=255*r*(1-e*o),g=255*r*(1-e*(1-o));switch(r*=255,n){case 0:return[r,g,a];case 1:return[u,r,a];case 2:return[a,r,g];case 3:return[a,u,r];case 4:return[g,a,r];case 5:return[r,a,u]}},s.hsv.hsl=function(t){let l=t[0],e=t[1]/100,r=t[2]/100,n=Math.max(r,.01),o,a;a=(2-e)*r;let u=(2-e)*n;return o=e*n,o/=u<=1?u:2-u,o=o||0,a/=2,[l,o*100,a*100]},s.hwb.rgb=function(t){let l=t[0]/360,e=t[1]/100,r=t[2]/100,n=e+r,o;n>1&&(e/=n,r/=n);let a=Math.floor(6*l),u=1-r;o=6*l-a,a&1&&(o=1-o);let g=e+o*(u-e),p,m,k;switch(a){default:case 6:case 0:p=u,m=g,k=e;break;case 1:p=g,m=u,k=e;break;case 2:p=e,m=u,k=g;break;case 3:p=e,m=g,k=u;break;case 4:p=g,m=e,k=u;break;case 5:p=u,m=e,k=g;break}return[p*255,m*255,k*255]},s.cmyk.rgb=function(t){let l=t[0]/100,e=t[1]/100,r=t[2]/100,n=t[3]/100,o=1-Math.min(1,l*(1-n)+n),a=1-Math.min(1,e*(1-n)+n),u=1-Math.min(1,r*(1-n)+n);return[o*255,a*255,u*255]},s.xyz.rgb=function(t){let l=t[0]/100,e=t[1]/100,r=t[2]/100,n,o,a;return n=l*3.2406+e*-1.5372+r*-.4986,o=l*-.9689+e*1.8758+r*.0415,a=l*.0557+e*-.204+r*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[n*255,o*255,a*255]},s.xyz.lab=function(t){let l=t[0],e=t[1],r=t[2];l/=95.047,e/=100,r/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let n=116*e-16,o=500*(l-e),a=200*(e-r);return[n,o,a]},s.lab.xyz=function(t){let l=t[0],e=t[1],r=t[2],n,o,a;o=(l+16)/116,n=e/500+o,a=o-r/200;let u=o**3,g=n**3,p=a**3;return o=u>.008856?u:(o-16/116)/7.787,n=g>.008856?g:(n-16/116)/7.787,a=p>.008856?p:(a-16/116)/7.787,n*=95.047,o*=100,a*=108.883,[n,o,a]},s.lab.lch=function(t){let l=t[0],e=t[1],r=t[2],n;n=Math.atan2(r,e)*360/2/Math.PI,n<0&&(n+=360);let o=Math.sqrt(e*e+r*r);return[l,o,n]},s.lch.lab=function(t){let l=t[0],e=t[1],r=t[2]/360*2*Math.PI,n=e*Math.cos(r),o=e*Math.sin(r);return[l,n,o]},s.rgb.ansi16=function(t,l=null){let[e,r,n]=t,o=l===null?s.rgb.hsv(t)[2]:l;if(o=Math.round(o/50),o===0)return 30;let a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return o===2&&(a+=60),a},s.hsv.ansi16=function(t){return s.rgb.ansi16(s.hsv.rgb(t),t[2])},s.rgb.ansi256=function(t){let l=t[0],e=t[1],r=t[2];return l===e&&e===r?l<8?16:l>248?231:Math.round((l-8)/247*24)+232:16+36*Math.round(l/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5)},s.ansi16.rgb=function(t){let l=t%10;if(l===0||l===7)return t>50&&(l+=3.5),l=l/10.5*255,[l,l,l];let e=(~~(t>50)+1)*.5,r=(l&1)*e*255,n=(l>>1&1)*e*255,o=(l>>2&1)*e*255;return[r,n,o]},s.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let l,e=Math.floor(t/36)/5*255,r=Math.floor((l=t%36)/6)/5*255,n=l%6/5*255;return[e,r,n]},s.rgb.hex=function(t){let l=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(l.length)+l},s.hex.rgb=function(t){let l=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!l)return[0,0,0];let e=l[0];l[0].length===3&&(e=e.split("").map(u=>u+u).join(""));let r=parseInt(e,16),n=r>>16&255,o=r>>8&255,a=r&255;return[n,o,a]},s.rgb.hcg=function(t){let l=t[0]/255,e=t[1]/255,r=t[2]/255,n=Math.max(Math.max(l,e),r),o=Math.min(Math.min(l,e),r),a=n-o,u,g;return a<1?u=o/(1-a):u=0,a<=0?g=0:n===l?g=(e-r)/a%6:n===e?g=2+(r-l)/a:g=4+(l-e)/a,g/=6,g%=1,[g*360,a*100,u*100]},s.hsl.hcg=function(t){let l=t[1]/100,e=t[2]/100,r=e<.5?2*l*e:2*l*(1-e),n=0;return r<1&&(n=(e-.5*r)/(1-r)),[t[0],r*100,n*100]},s.hsv.hcg=function(t){let l=t[1]/100,e=t[2]/100,r=l*e,n=0;return r<1&&(n=(e-r)/(1-r)),[t[0],r*100,n*100]},s.hcg.rgb=function(t){let l=t[0]/360,e=t[1]/100,r=t[2]/100;if(e===0)return[r*255,r*255,r*255];let n=[0,0,0],o=l%1*6,a=o%1,u=1-a,g=0;switch(Math.floor(o)){case 0:n[0]=1,n[1]=a,n[2]=0;break;case 1:n[0]=u,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=a;break;case 3:n[0]=0,n[1]=u,n[2]=1;break;case 4:n[0]=a,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=u}return g=(1-e)*r,[(e*n[0]+g)*255,(e*n[1]+g)*255,(e*n[2]+g)*255]},s.hcg.hsv=function(t){let l=t[1]/100,e=t[2]/100,r=l+e*(1-l),n=0;return r>0&&(n=l/r),[t[0],n*100,r*100]},s.hcg.hsl=function(t){let l=t[1]/100,e=t[2]/100*(1-l)+.5*l,r=0;return e>0&&e<.5?r=l/(2*e):e>=.5&&e<1&&(r=l/(2*(1-e))),[t[0],r*100,e*100]},s.hcg.hwb=function(t){let l=t[1]/100,e=t[2]/100,r=l+e*(1-l);return[t[0],(r-l)*100,(1-r)*100]},s.hwb.hcg=function(t){let l=t[1]/100,e=1-t[2]/100,r=e-l,n=0;return r<1&&(n=(e-r)/(1-r)),[t[0],r*100,n*100]},s.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},s.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},s.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},s.gray.hsl=function(t){return[0,0,t[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(t){return[0,100,t[0]]},s.gray.cmyk=function(t){return[0,0,0,t[0]]},s.gray.lab=function(t){return[t[0],0,0]},s.gray.hex=function(t){let l=Math.round(t[0]/100*255)&255,e=((l<<16)+(l<<8)+l).toString(16).toUpperCase();return"000000".substring(e.length)+e},s.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}),me=E((h,c)=>{var i=Q();function d(){let l={},e=Object.keys(i);for(let r=e.length,n=0;n<r;n++)l[e[n]]={distance:-1,parent:null};return l}function s(l){let e=d(),r=[l];for(e[l].distance=0;r.length;){let n=r.pop(),o=Object.keys(i[n]);for(let a=o.length,u=0;u<a;u++){let g=o[u],p=e[g];p.distance===-1&&(p.distance=e[n].distance+1,p.parent=n,r.unshift(g))}}return e}function f(l,e){return function(r){return e(l(r))}}function t(l,e){let r=[e[l].parent,l],n=i[e[l].parent][l],o=e[l].parent;for(;e[o].parent;)r.unshift(e[o].parent),n=f(i[e[o].parent][o],n),o=e[o].parent;return n.conversion=r,n}c.exports=function(l){let e=s(l),r={},n=Object.keys(e);for(let o=n.length,a=0;a<o;a++){let u=n[a];e[u].parent!==null&&(r[u]=t(u,e))}return r}}),ve=E((h,c)=>{var i=Q(),d=me(),s={},f=Object.keys(i);function t(e){let r=function(...n){let o=n[0];return o==null?o:(o.length>1&&(n=o),e(n))};return"conversion"in e&&(r.conversion=e.conversion),r}function l(e){let r=function(...n){let o=n[0];if(o==null)return o;o.length>1&&(n=o);let a=e(n);if(typeof a=="object")for(let u=a.length,g=0;g<u;g++)a[g]=Math.round(a[g]);return a};return"conversion"in e&&(r.conversion=e.conversion),r}f.forEach(e=>{s[e]={},Object.defineProperty(s[e],"channels",{value:i[e].channels}),Object.defineProperty(s[e],"labels",{value:i[e].labels});let r=d(e);Object.keys(r).forEach(n=>{let o=r[n];s[e][n]=l(o),s[e][n].raw=t(o)})}),c.exports=s}),ye=E((h,c)=>{"use strict";var i=(o,a)=>(...u)=>`\x1B[${o(...u)+a}m`,d=(o,a)=>(...u)=>{let g=o(...u);return`\x1B[${38+a};5;${g}m`},s=(o,a)=>(...u)=>{let g=o(...u);return`\x1B[${38+a};2;${g[0]};${g[1]};${g[2]}m`},f=o=>o,t=(o,a,u)=>[o,a,u],l=(o,a,u)=>{Object.defineProperty(o,a,{get:()=>{let g=u();return Object.defineProperty(o,a,{value:g,enumerable:!0,configurable:!0}),g},enumerable:!0,configurable:!0})},e,r=(o,a,u,g)=>{e===void 0&&(e=ve());let p=g?10:0,m={};for(let[k,j]of Object.entries(e)){let B=k==="ansi16"?"ansi":k;k===a?m[B]=o(u,p):typeof j=="object"&&(m[B]=o(j[a],p))}return m};function n(){let o=new Map,a={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};a.color.gray=a.color.blackBright,a.bgColor.bgGray=a.bgColor.bgBlackBright,a.color.grey=a.color.blackBright,a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(let[u,g]of Object.entries(a)){for(let[p,m]of Object.entries(g))a[p]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},g[p]=a[p],o.set(m[0],m[1]);Object.defineProperty(a,u,{value:g,enumerable:!1})}return Object.defineProperty(a,"codes",{value:o,enumerable:!1}),a.color.close="\x1B[39m",a.bgColor.close="\x1B[49m",l(a.color,"ansi",()=>r(i,"ansi16",f,!1)),l(a.color,"ansi256",()=>r(d,"ansi256",f,!1)),l(a.color,"ansi16m",()=>r(s,"rgb",t,!1)),l(a.bgColor,"ansi",()=>r(i,"ansi16",f,!0)),l(a.bgColor,"ansi256",()=>r(d,"ansi256",f,!0)),l(a.bgColor,"ansi16m",()=>r(s,"rgb",t,!0)),a}Object.defineProperty(c,"exports",{enumerable:!0,get:n})}),we=E((h,c)=>{"use strict";c.exports=(i,d=process.argv)=>{let s=i.startsWith("-")?"":i.length===1?"-":"--",f=d.indexOf(s+i),t=d.indexOf("--");return f!==-1&&(t===-1||f<t)}}),ke=E((h,c)=>{"use strict";var i=W("os"),d=W("tty"),s=we(),{env:f}=process,t;s("no-color")||s("no-colors")||s("color=false")||s("color=never")?t=0:(s("color")||s("colors")||s("color=true")||s("color=always"))&&(t=1),"FORCE_COLOR"in f&&(f.FORCE_COLOR==="true"?t=1:f.FORCE_COLOR==="false"?t=0:t=f.FORCE_COLOR.length===0?1:Math.min(parseInt(f.FORCE_COLOR,10),3));function l(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function e(n,o){if(t===0)return 0;if(s("color=16m")||s("color=full")||s("color=truecolor"))return 3;if(s("color=256"))return 2;if(n&&!o&&t===void 0)return 0;let a=t||0;if(f.TERM==="dumb")return a;if(process.platform==="win32"){let u=i.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in f)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(u=>u in f)||f.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in f){let u=parseInt((f.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(f.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(f.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM)||"COLORTERM"in f?1:a}function r(n){let o=e(n,n&&n.isTTY);return l(o)}c.exports={supportsColor:r,stdout:l(e(!0,d.isatty(1))),stderr:l(e(!0,d.isatty(2)))}}),Oe=E((h,c)=>{"use strict";var i=(s,f,t)=>{let l=s.indexOf(f);if(l===-1)return s;let e=f.length,r=0,n="";do n+=s.substr(r,l-r)+f+t,r=l+e,l=s.indexOf(f,r);while(l!==-1);return n+=s.substr(r),n},d=(s,f,t,l)=>{let e=0,r="";do{let n=s[l-1]==="\r";r+=s.substr(e,(n?l-1:l)-e)+f+(n?`\r
|
|
6
2
|
`:`
|
|
7
|
-
`)+e
|
|
8
|
-
`,
|
|
9
|
-
`
|
|
10
|
-
`)
|
|
3
|
+
`)+t,e=l+1,l=s.indexOf(`
|
|
4
|
+
`,e)}while(l!==-1);return r+=s.substr(e),r};c.exports={stringReplaceAll:i,stringEncaseCRLFWithFirstIndex:d}}),xe=E((h,c)=>{"use strict";var i=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,d=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,f=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,t=new Map([["n",`
|
|
5
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function l(o){let a=o[0]==="u",u=o[1]==="{";return a&&!u&&o.length===5||o[0]==="x"&&o.length===3?String.fromCharCode(parseInt(o.slice(1),16)):a&&u?String.fromCodePoint(parseInt(o.slice(2,-1),16)):t.get(o)||o}function e(o,a){let u=[],g=a.trim().split(/\s*,\s*/g),p;for(let m of g){let k=Number(m);if(!Number.isNaN(k))u.push(k);else if(p=m.match(s))u.push(p[2].replace(f,(j,B,P)=>B?l(B):P));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${o}')`)}return u}function r(o){d.lastIndex=0;let a=[],u;for(;(u=d.exec(o))!==null;){let g=u[1];if(u[2]){let p=e(g,u[2]);a.push([g].concat(p))}else a.push([g])}return a}function n(o,a){let u={};for(let p of a)for(let m of p.styles)u[m[0]]=p.inverse?null:m.slice(1);let g=o;for(let[p,m]of Object.entries(u))if(Array.isArray(m)){if(!(p in g))throw new Error(`Unknown Chalk style: ${p}`);g=m.length>0?g[p](...m):g[p]}return g}c.exports=(o,a)=>{let u=[],g=[],p=[];if(a.replace(i,(m,k,j,B,P,v)=>{if(k)p.push(l(k));else if(B){let b=p.join("");p=[],g.push(u.length===0?b:n(o,u)(b)),u.push({inverse:j,styles:r(B)})}else if(P){if(u.length===0)throw new Error("Found extraneous } in Chalk template literal");g.push(n(o,u)(p.join(""))),p=[],u.pop()}else p.push(v)}),g.push(p.join("")),u.length>0){let m=`Chalk template literal is missing ${u.length} closing bracket${u.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return g.join("")}}),$=E((h,c)=>{"use strict";var i=ye(),{stdout:d,stderr:s}=ke(),{stringReplaceAll:f,stringEncaseCRLFWithFirstIndex:t}=Oe(),l=["ansi","ansi","ansi256","ansi16m"],e=Object.create(null),r=(v,b={})=>{if(b.level&&!(Number.isInteger(b.level)&&b.level>=0&&b.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let y=d?d.level:0;v.level=b.level===void 0?y:b.level},n=class{constructor(v){return o(v)}},o=v=>{let b={};return r(b,v),b.template=(...y)=>B(b.template,...y),Object.setPrototypeOf(b,a.prototype),Object.setPrototypeOf(b.template,b),b.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},b.template.Instance=n,b.template};function a(v){return o(v)}for(let[v,b]of Object.entries(i))e[v]={get(){let y=m(this,p(b.open,b.close,this.r),this.n);return Object.defineProperty(this,v,{value:y}),y}};e.visible={get(){let v=m(this,this.r,!0);return Object.defineProperty(this,"visible",{value:v}),v}};var u=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let v of u)e[v]={get(){let{level:b}=this;return function(...y){let O=p(i.color[l[b]][v](...y),i.color.close,this.r);return m(this,O,this.n)}}};for(let v of u){let b="bg"+v[0].toUpperCase()+v.slice(1);e[b]={get(){let{level:y}=this;return function(...O){let M=p(i.bgColor[l[y]][v](...O),i.bgColor.close,this.r);return m(this,M,this.n)}}}}var g=Object.defineProperties(()=>{},{...e,level:{enumerable:!0,get(){return this.l.level},set(v){this.l.level=v}}}),p=(v,b,y)=>{let O,M;return y===void 0?(O=v,M=b):(O=y.openAll+v,M=b+y.closeAll),{open:v,close:b,openAll:O,closeAll:M,parent:y}},m=(v,b,y)=>{let O=(...M)=>k(O,M.length===1?""+M[0]:M.join(" "));return Object.setPrototypeOf(O,g),O.l=v,O.r=b,O.n=y,O},k=(v,b)=>{if(v.level<=0||!b)return v.n?"":b;let y=v.r;if(y===void 0)return b;let{openAll:O,closeAll:M}=y;if(b.indexOf("\x1B")!==-1)for(;y!==void 0;)b=f(b,y.close,y.open),y=y.parent;let F=b.indexOf(`
|
|
6
|
+
`);return F!==-1&&(b=t(b,M,O,F)),O+b+M},j,B=(v,...b)=>{let[y]=b;if(!Array.isArray(y))return b.join(" ");let O=b.slice(1),M=[y.raw[0]];for(let F=1;F<y.length;F++)M.push(String(O[F-1]).replace(/[{}\\]/g,"\\$&"),String(y.raw[F]));return j===void 0&&(j=xe()),j(v,M.join(""))};Object.defineProperties(a.prototype,e);var P=a();P.supportsColor=d,P.stderr=a({level:s?s.level:0}),P.stderr.supportsColor=s,c.exports=P}),$e=E((h,c)=>{"use strict";function i(d){var s=void 0;typeof d=="string"?s=[d]:s=d.raw;for(var f="",t=0;t<s.length;t++)f+=s[t].replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`"),t<(arguments.length<=1?0:arguments.length-1)&&(f+=arguments.length<=t+1?void 0:arguments[t+1]);var l=f.split(`
|
|
7
|
+
`),e=null;return l.forEach(function(r){var n=r.match(/^(\s+)\S+/);if(n){var o=n[1].length;e?e=Math.min(e,o):e=o}}),e!==null&&(f=l.map(function(r){return r[0]===" "?r.slice(e):r}).join(`
|
|
8
|
+
`)),f=f.trim(),f.replace(/\\n/g,`
|
|
9
|
+
`)}typeof c<"u"&&(c.exports=i)}),R=(h,c)=>{if(!h)throw new Error(c)},Me=h=>{let c={joined:!0,spacerNoNeighbour:" ",spacerNeighbour:"\u2502 ",keyNoNeighbour:"\u2514\u2500 ",keyNeighbour:"\u251C\u2500 ",separator:": ",renderFn:i=>["boolean","string","number"].includes(typeof i)?i:void 0,sortFn:null,breakCircularWith:" (circular ref.)",...h};return R(Object.keys(c).length===9,"Unexpected Option(s) provided"),R(typeof c.joined=="boolean",'Option "joined" has invalid format'),R(typeof c.spacerNoNeighbour=="string",'Option "spacerNoNeighbour" has invalid format'),R(typeof c.spacerNeighbour=="string",'Option "spacerNeighbour" has invalid format'),R(typeof c.keyNoNeighbour=="string",'Option "keyNoNeighbour" has invalid format'),R(typeof c.keyNeighbour=="string",'Option "keyNeighbour" has invalid format'),R(typeof c.separator=="string",'Option "separator" has invalid format'),R(typeof c.renderFn=="function",'Option "renderFn" has invalid format'),R(typeof c.sortFn=="function"||c.sortFn===null,'Option "sortFn" has invalid format'),R(typeof c.breakCircularWith=="string"||c.breakCircularWith===null,'Option "breakCircularWith" has invalid format'),c},X=(h,c={})=>{let i=Me(c),d=[],s=i.renderFn(h);s!==void 0&&d.push(String(s));let f=r=>i.sortFn===null?r.reverse():r.sort((n,o)=>i.sortFn(o,n)),t=[],l=f(Object.keys(h)).map(r=>[r]),e=[h];for(;l.length!==0;){let r=l.pop(),n=e[r.length-1][r[r.length-1]],o=i.breakCircularWith!==null&&e.includes(n);t[r.length-1]=l.length!==0&&l[l.length-1].length===r.length;let a=i.renderFn(n);d.push([t.slice(0,r.length-1).map(u=>u?i.spacerNeighbour:i.spacerNoNeighbour).join(""),t[r.length-1]?i.keyNeighbour:i.keyNoNeighbour,r[r.length-1],a===void 0?"":`${i.separator}${n}`,o?i.breakCircularWith:""].join("")),n instanceof Object&&!Array.isArray(n)&&!o&&(l.push(...f(Object.keys(n)).map(u=>r.concat(u))),e[r.length]=n)}return i.joined===!0?d.join(`
|
|
10
|
+
`):d},Ce=x($()),T=x($()),w=x($());function N(h){return h.split(" ").map(c=>c.replace(/^(\d*\.?\d*)$/g,`${w.default.blue("$1")}`).replace(/^(\d*\.?\d*)(YB|ZB|EB|PB|TB|GB|MB|KB|B|mb|kb|kB|bit|zs|as|fs|ps|ns|µs|ms|s|m|h|d|m|y)$/g,`${w.default.cyan("$1")}${w.default.magenta("$2")}`).replace(/^((?:[0-1]?[0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9] (?:AM|PM)?)$/g,`${w.default.dim("$1")}`).replace(/^\[(.*?)\]$/g,`${w.default.dim("[")}${w.default.magenta("$1")}${w.default.dim("]")}`).replace(/^`(.*?)`$/g,`${w.default.dim("`")}$1${w.default.dim("`")}`).replace(/^\((.*?)\)$/g,`${w.default.dim("(")}$1${w.default.dim(")")}`).replace(/^<(.*?)>$/g,`${w.default.dim("<")}${w.default.gray("$1")}${w.default.dim(">")}`).replace(/->/g,w.default.dim("\u2192")).replace(/<-/g,w.default.dim("\u2190")).replace(/^\$t$/g,`${w.default.dim(new Date().toLocaleTimeString())}`).replace(/^\*\*(.*?)\*\*$/g,`${w.default.bold.white("$1")}`).replace(/^~~(.*?)~~$/g,`${w.default.strikethrough("$1")}`).replace(/^__(.*?)__$/g,`${w.default.underline("$1")}`).replace(/^\.\.(.*?)\.\.$/g,`${w.default.dim("$1")}`).replace(/^!!(.*?)!!$/g,`${w.default.yellow("$1")}`).replace(/^\*(.*?)\*$/g,`${w.default.italic("$1")}`).replace(/^_(.*?)_$/g,`${w.default.italic("$1")}`).replace(/^\+(.*?)\+$/g,`${w.default.green("$1")}`).replace(/^-(.*?)-$/g,`${w.default.red("$1")}`)).join(" ")}function C(h,c){let i="";if(Array.isArray(h))for(let d=0;d<h.length;d++)i+=_(h[d])+_(c[d]);else i=[h,...c].map(d=>_(d)).join(" ");return N(i)}var _=h=>h?Array.isArray(h)?h.map(c=>{switch(typeof c){case"string":return`'${T.default.yellow(c)}'`;case"number":case"boolean":return T.default.blue(c);default:return c}}).join(T.default.gray(", ")):h:"",D=(h,...c)=>{let i=Ce.default.green("+")+" "+C(h,c);return console.log(i),i},je=x($()),Y=(h,...c)=>{let i=je.default.bgRed.bold.white(" \u{1D5EB} ERROR ")+" "+C(h,c);return console.log(i),i},V=x($()),Ee=(h,...c)=>{let i=V.default.bgYellow.bold.white(" \u26A0\uFE0F CONFLICT ")+" "+V.default.yellow(C(h,c));return console.log(i),i},Be=x($()),Re=(h,...c)=>{let i=Be.default.green("\u2713 ")+C(h,c);return console.log(i),i},Ne=x($()),q=(h,...c)=>{let i=Ne.default.red("-")+" "+C(h,c);return console.log(i),i},Pe=x($()),U=(h,...c)=>{let i=Pe.default.green("\u25CB ")+C(h,c);return console.log(i),i},Ae=x($()),H=(h,...c)=>{let i=Ae.default.red("\u2717 ")+C(h,c);return console.log(i),i},Fe=x($()),J=(h,...c)=>{let i=Fe.default.cyan("\u{1D4F2}")+" "+C(h,c);return console.log(i),i},Ie=x($()),Se=(h,...c)=>{let i=Ie.default.green("\u23FA Success ")+C(h,c);return console.log(i),i},Te=x($()),_e=(h,...c)=>{let i=Te.default.yellow("\u23FA Warn ")+C(h,c);return console.log(i),i},qe=x($()),Le=(h,...c)=>{let i=qe.default.bgGreen.bold.white(" \u2713 PASS ")+" "+C(h,c);return console.log(i),i},ze=h=>{let c=X(te(ee(JSON.parse(JSON.stringify(h)))),{spacerNeighbour:N("..\u2502..")+" ",keyNoNeighbour:N("..\u2514\u2500..")+" ",keyNeighbour:N("..\u251C\u2500..")+" ",separator:N("..:..")+" "});return console.log(c),c};function ee(h){for(let c in h){let i=h[c];typeof i=="object"?i!==null&&!Object.keys(i).length?delete h[c]:h[c]=ee(i):i===void 0&&delete h[c]}return h}function te(h){for(let c in h){let i=h[c];Array.isArray(i)?h[c]=i.map(d=>N(`**${d}**`)).join(N("..,..")):typeof i=="object"?te(i):h[c]=N(`**${i}**`)}return h}var Ge=x($()),We=(h,...c)=>{let i=Ge.default.red("\u23FA Fail ")+C(h,c);return console.log(i),i},K=(h,...c)=>{let i=N("$t ")+C(h,c);return console.log(i),i},De=x($e()),L=x($());function Ye(h){let{message:c,stack:i}=typeof h=="string"?new Error(h):h,d={};return(0,De.default)(i.replace(c,"").replace(/^Error: /,"")).split(`
|
|
11
|
+
`).forEach(s=>{d[s.split(" ").map(f=>f.replace(/^\((.+)\)$/,`${L.default.cyan("$1")}`).replace(/\./g,`${L.default.dim(".")}`).replace(/^at$/,t=>L.default.dim(t))).join(" ")]=null}),{message:c.trim().replace(/Error: /g,""),stackTree:d}}var S=x($()),re=(h,...c)=>{if(h instanceof Error){let{message:i,stackTree:d}=Ye(h);return console.log(""),console.log(S.default.bgRed.bold.white(" \u{1D5EB} ERROR ")+" "+S.default.bold.red(i)),console.log(X(d,{spacerNeighbour:S.default.redBright.dim("\u2502\u2000\u2000"),keyNoNeighbour:S.default.redBright.dim("\u2514\u2500\u2000"),keyNeighbour:S.default.redBright.dim("\u251C\u2500 "),separator:S.default.redBright.dim(":\u2000")})),console.log(""),i}else{let i=C(h,c);return console.log(i),i}};Object.assign(re,{a:D,add:D,d:q,del:q,delete:q,o:U,valid:U,x:H,invalid:H,i:J,info:J,e:Y,error:Y,t:K,timestamp:K,success:Se,fail:We,warn:_e,pass:Le,conflict:Ee,ok:Re,tree:ze,paint:N});var Ve=x($()),A=re,z=Ve.default;import Ke from"stylelint";import se from"to-extend";var ue=class extends Je{constructor(i){super(le,i);this.customOptions=i;let d=this.readConfig(null);this.options=se(this.options,d?.compilerOptions,i),this.css=d?.css??new oe(d?.config)}css;extractions=new Set;validExtractions=new Set;invalidExtractions=new Set;logConfigFound=i=>A.ok`**${i}** definition file found`;logConfigNotFound=i=>A.i`No **${i}** definition file found`;get resolvedModuleId(){return"\0"+this.options.module}get moduleHMREvent(){return`HMR:${this.options.module}`}async refresh(){this.extractions.clear(),this.validExtractions.clear(),this.invalidExtractions.clear(),console.log("");let i=this.readConfig(null);return this.css=new oe(i?.config),this.options=se({cwd:this.options.cwd},le,i?.compilerOptions,this.customOptions),await this.compile(),this}async compile(){if(this.options.classes?.fixed?.length)for(let i of this.options.classes.fixed)this.css.insert(i);return await Promise.all(this.sources.map(async i=>{let d=He.readFileSync(ne.resolve(this.options.cwd,i),{encoding:"utf-8"}).toString();await this.insert(i,d)})),this}extract(i,d){if(!i||!d||!this.checkSourcePath(i))return[];let s=[];for(let f of Ue({content:d,name:i},this.css))this.extractions.has(f)||(this.extractions.add(f),s.push(f));return s}async insert(i,d){let s=this.extract(i,d);if(!s.length)return!1;this.invalidExtractions.size&&(s=s.filter(e=>!this.invalidExtractions.has(e))),this.validExtractions.size&&(s=s.filter(e=>!this.validExtractions.has(e))),this.options.classes?.ignored?.length&&(s=s.filter(e=>{for(let r of this.options.classes.ignored)if(typeof r=="string"){if(r===e)return!1}else if(r.test(e))return!1;return!0}));let f=ae.now(),t=[];await Promise.all(s.map(async e=>{let r=await this.createRules(e);r.length?(this.css.insertRules(r),t.push(e),this.validExtractions.add(e)):this.invalidExtractions.add(e)}));let l=Math.round((ae.now()-f)*100)/100;if(s.length&&(console.log(""),A`**${ne.relative(this.options.cwd,i)}**`,A`[extract] ${s.length} potential`),this.css.rules.length){let e=t.filter(r=>!s.includes(r));e.length&&A`[exclude] ${e.length} unknown ${e}`,A`[compile] +${t.length}+ valid inserted ${z.gray("in")} ${l}ms ${t}`,A`[virtual] ${this.css.rules.length} total ${z.gray("in")} ${this.options.module}`}return!0}async createRules(i){return(await Promise.all(this.css.create(i).map(async s=>(await Ke.lint({code:s.text,cache:!1,config:{rules:{"color-no-invalid-hex":!0,"named-grid-areas-no-invalid":!0,"at-rule-no-unknown":!0,"function-no-unknown":!0,"media-feature-name-no-unknown":!0,"property-no-unknown":!0,"selector-pseudo-class-no-unknown":!0,"selector-pseudo-element-no-unknown":!0,"selector-type-no-unknown":!0,"unit-no-unknown":!0}}})).errored?null:s))).filter(s=>s)}get sources(){let{include:i,exclude:d,sources:s}=this.options,f=ie.sync(i,{cwd:this.options.cwd,ignore:d});return s?.length&&f.push(...ie.sync(s,{cwd:this.options.cwd})),f}checkSourcePath(i){let{include:d,exclude:s,sources:f}=this.options;for(let t of f)if(G(i,t))return!0;for(let t of d)if(!G(i,t))return!1;for(let t of s)if(G(i,t))return!1;return!0}get config(){return this.css.config}};export{ue as MasterCSSCompiler};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@master/css-compiler","scripts":{"build":"
|
|
1
|
+
{"name":"@master/css-compiler","scripts":{"build":"techor pack --platform node --shakable","dev":"npm run build -- --watch","lint":"eslint ./src","test":"jest"},"license":"MIT","description":"The ahead-of-time compiler of Master CSS","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/compiler"},"keywords":["webpack","plugin","integration","vite","parcel","build tools","css","mastercss","vite-plugin"],"sideEffects":false,"main":"./dist/cjs/index.js","jsnext:main":"./dist/esm/index.mjs","esnext":"./dist/esm/index.mjs","module":"./dist/esm/index.mjs","types":"./dist/index.d.ts","exports":{".":{"node":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.mjs","types":"./dist/index.d.ts"},"require":"./dist/cjs/index.default.js","import":"./dist/esm/index.default.mjs","types":"./dist/index.default.d.ts"}},"files":["dist"],"publishConfig":{"access":"public"},"dependencies":{"@master/css":"^2.0.0-beta.132","fast-glob":"^3.2.12","minimatch":"^5.1.1","stylelint":"^15.2.0","techor":"^1.2.7","to-extend":"^1.5.2","upath":"^2.0.1"},"devDependencies":{"@swc-node/jest":"^1.6.2","ts-jest":"^29.0.5"},"version":"2.0.0-beta.132"}
|