@master/css 2.0.0-beta.159 → 2.0.0-beta.160
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 +30 -18
- package/dist/bin/index.bundle.js +45 -0
- package/dist/config/index.d.ts +4 -8
- package/dist/config/rules.d.ts +2 -2
- package/dist/constants/config-esm-text.d.ts +1 -1
- package/dist/constants/config-ts-text.d.ts +1 -0
- package/dist/core.d.ts +15 -6
- package/dist/functions/extract-classes-from-html.d.ts +5 -0
- package/dist/functions/fill-color-scale.d.ts +1 -0
- package/dist/functions/generate-from-classes.d.ts +8 -0
- package/dist/functions/generate-from-html.d.ts +8 -0
- package/dist/functions/init-runtime.d.ts +9 -0
- package/dist/functions/render-html.d.ts +8 -0
- package/dist/index.browser.bundle.js +1 -0
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.bundle.js +44 -0
- package/dist/index.bundle.mjs +44 -0
- package/dist/index.d.ts +11 -5
- package/dist/rule.d.ts +1 -3
- package/package.json +1 -1
- package/dist/cjs/bin/index.js +0 -2
- package/dist/cjs/config/breakpoints.js +0 -1
- package/dist/cjs/config/colors.js +0 -1
- package/dist/cjs/config/functions.js +0 -1
- package/dist/cjs/config/important.js +0 -1
- package/dist/cjs/config/index.js +0 -1
- package/dist/cjs/config/keyframes.js +0 -1
- package/dist/cjs/config/observe.js +0 -1
- package/dist/cjs/config/override.js +0 -1
- package/dist/cjs/config/root-size.js +0 -1
- package/dist/cjs/config/rules.js +0 -1
- package/dist/cjs/config/scope.js +0 -1
- package/dist/cjs/config/selectors.js +0 -1
- package/dist/cjs/config/semantics.js +0 -1
- package/dist/cjs/config/themeDriver.js +0 -1
- package/dist/cjs/config/themes.js +0 -1
- package/dist/cjs/constants/config-esm-text.js +0 -17
- package/dist/cjs/constants/config-text.js +0 -15
- package/dist/cjs/constants/index.js +0 -1
- package/dist/cjs/constants/selector-symbols.js +0 -1
- package/dist/cjs/constants/start-symbol.js +0 -1
- package/dist/cjs/core.js +0 -1
- package/dist/cjs/index.browser.js +0 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/methods/extract-classes-from-html.js +0 -1
- package/dist/cjs/methods/fill-color-scale.js +0 -1
- package/dist/cjs/methods/index.js +0 -1
- package/dist/cjs/methods/render-from-html.js +0 -1
- package/dist/cjs/methods/render-into-html.js +0 -1
- package/dist/cjs/methods/render-rules-from-html.js +0 -1
- package/dist/cjs/methods/render-rules.js +0 -1
- package/dist/cjs/methods/render.js +0 -1
- package/dist/cjs/polyfills/css-escape.js +0 -1
- package/dist/cjs/rule.js +0 -1
- package/dist/cjs/utils/concat-arrays.js +0 -1
- package/dist/cjs/utils/css-escape.js +0 -1
- package/dist/cjs/utils/delay.js +0 -1
- package/dist/cjs/utils/get-type.js +0 -1
- package/dist/cjs/utils/hex-to-rgb.js +0 -1
- package/dist/cjs/utils/is-plain-object.js +0 -1
- package/dist/cjs/utils/is-symbol.js +0 -1
- package/dist/cjs/utils/parse-rule-value.js +0 -1
- package/dist/cjs/utils/rgb-to-hex.js +0 -1
- package/dist/config/observe.d.ts +0 -1
- package/dist/config/themes.d.ts +0 -1
- package/dist/constants/index.d.ts +0 -4
- package/dist/esm/bin/index.mjs +0 -2
- package/dist/esm/config/breakpoints.mjs +0 -1
- package/dist/esm/config/colors.mjs +0 -1
- package/dist/esm/config/functions.mjs +0 -1
- package/dist/esm/config/important.mjs +0 -1
- package/dist/esm/config/index.mjs +0 -1
- package/dist/esm/config/keyframes.mjs +0 -1
- package/dist/esm/config/observe.mjs +0 -1
- package/dist/esm/config/override.mjs +0 -1
- package/dist/esm/config/root-size.mjs +0 -1
- package/dist/esm/config/rules.mjs +0 -1
- package/dist/esm/config/scope.mjs +0 -1
- package/dist/esm/config/selectors.mjs +0 -1
- package/dist/esm/config/semantics.mjs +0 -1
- package/dist/esm/config/themeDriver.mjs +0 -1
- package/dist/esm/config/themes.mjs +0 -1
- package/dist/esm/constants/config-esm-text.mjs +0 -17
- package/dist/esm/constants/config-text.mjs +0 -15
- package/dist/esm/constants/index.mjs +0 -1
- package/dist/esm/constants/selector-symbols.mjs +0 -1
- package/dist/esm/constants/start-symbol.mjs +0 -1
- package/dist/esm/core.mjs +0 -1
- package/dist/esm/index.browser.mjs +0 -1
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/methods/extract-classes-from-html.mjs +0 -1
- package/dist/esm/methods/fill-color-scale.mjs +0 -1
- package/dist/esm/methods/index.mjs +0 -1
- package/dist/esm/methods/render-from-html.mjs +0 -1
- package/dist/esm/methods/render-into-html.mjs +0 -1
- package/dist/esm/methods/render-rules-from-html.mjs +0 -1
- package/dist/esm/methods/render-rules.mjs +0 -1
- package/dist/esm/methods/render.mjs +0 -1
- package/dist/esm/polyfills/css-escape.mjs +0 -1
- package/dist/esm/rule.mjs +0 -1
- package/dist/esm/utils/concat-arrays.mjs +0 -1
- package/dist/esm/utils/css-escape.mjs +0 -1
- package/dist/esm/utils/delay.mjs +0 -1
- package/dist/esm/utils/get-type.mjs +0 -1
- package/dist/esm/utils/hex-to-rgb.mjs +0 -1
- package/dist/esm/utils/is-plain-object.mjs +0 -1
- package/dist/esm/utils/is-symbol.mjs +0 -1
- package/dist/esm/utils/parse-rule-value.mjs +0 -1
- package/dist/esm/utils/rgb-to-hex.mjs +0 -1
- package/dist/index.browser.js +0 -1
- package/dist/index.js +0 -31
- package/dist/index.mjs +0 -31
- package/dist/methods/extract-classes-from-html.d.ts +0 -1
- package/dist/methods/fill-color-scale.d.ts +0 -1
- package/dist/methods/index.d.ts +0 -7
- package/dist/methods/render-from-html.d.ts +0 -2
- package/dist/methods/render-into-html.d.ts +0 -2
- package/dist/methods/render-rules-from-html.d.ts +0 -3
- package/dist/methods/render-rules.d.ts +0 -3
- package/dist/methods/render.d.ts +0 -2
- package/dist/utils/css-escape.d.ts +0 -1
- package/dist/utils/delay.d.ts +0 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</picture>
|
|
11
11
|
</a>
|
|
12
12
|
</p>
|
|
13
|
-
<p align="center"
|
|
13
|
+
<p align="center">A markup-driven CSS language with enhanced syntax</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
|
|
@@ -68,30 +68,42 @@ Check out the [official guides](https://beta.css.master.co/docs) to get started
|
|
|
68
68
|
## Compilation Modes
|
|
69
69
|
Master CSS provides various [compilation modes](https://beta.css.master.co/docs/compilation), allowing you to choose according to the characteristics and needs of different projects.
|
|
70
70
|
|
|
71
|
-
- [Progressive Rendering](https://beta.css.master.co/docs/compilation/progressive-rendering) - Scan the requested HTML on the server side, generate CSS rules, and enable
|
|
72
|
-
- [
|
|
73
|
-
- [
|
|
71
|
+
- [Progressive Rendering](https://beta.css.master.co/docs/compilation/progressive-rendering) - Scan the requested HTML on the server side, generate CSS rules, and enable runtime-rendering compilation on the browser side
|
|
72
|
+
- [Runtime Rendering](https://beta.css.master.co/docs/compilation/runtime-rendering) - Observe the DOM tree, manipulate CSS rules according to the changed class name, and synchronize to the running style sheet at runtime
|
|
73
|
+
- [Static Extraction](https://beta.css.master.co/docs/compilation/static-extraction) - Scan source files for class names at build time, extract class names, and generate CSS files/virtual modules, then import them in the entry file
|
|
74
74
|
|
|
75
75
|
## Ecosystem
|
|
76
|
-
We've built various
|
|
76
|
+
We've built various Master CSS core functionality/integration packages:
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- [Vite Plugin](https://github.com/master-co/css/tree/beta/packages/vite) - A vite plugin for integrating Master CSS AOT compilation
|
|
81
|
-
- [Webpack Plugin](https://github.com/master-co/css/tree/beta/packages/webpack) - A webpack plugin for integrating Master CSS AOT compilation
|
|
82
|
-
- [Compiler](https://github.com/master-co/css/tree/beta/packages/compiler) - The ahead-of-time compiler of Master CSS
|
|
78
|
+
- [CSS](https://github.com/master-co/css/tree/beta/packages/css) - The core of Master CSS, including the runtime engine
|
|
83
79
|
|
|
84
80
|
##### Frameworks
|
|
85
|
-
- [React](https://github.com/master-co/css/tree/beta/packages/react) -
|
|
86
|
-
- [
|
|
81
|
+
- [React](https://github.com/master-co/css/tree/beta/packages/react) - Integrate Master CSS the React way
|
|
82
|
+
- [Svelte](https://github.com/master-co/css/tree/beta/packages/svelte) - Integrate Master CSS the Svelte way
|
|
83
|
+
- [Vue](https://github.com/master-co/css/tree/beta/packages/vue) - Integrate Master CSS the Vue.js way
|
|
87
84
|
|
|
88
|
-
#####
|
|
85
|
+
##### Progressive Rendering
|
|
86
|
+
- [Renderer](https://github.com/master-co/css/tree/beta/packages/renderer) - Pre-renders and injects HTML-required CSS
|
|
87
|
+
- [Nitro Server](https://github.com/master-co/css/tree/beta/packages/server.nitro) - Integrate Master CSS Pre-rendering the Nitro way
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
- [
|
|
89
|
+
##### Static Extraction
|
|
90
|
+
- [Extractor](https://github.com/master-co/css/tree/beta/packages/extractor) - Master CSS static extractor for various raw text extraction.
|
|
91
|
+
- [Vite](https://github.com/master-co/css/tree/beta/packages/extractor.vite) - Integrate Master CSS Static Extraction in Vite way
|
|
92
|
+
- [Webpack](https://github.com/master-co/css/tree/beta/packages/extractor.webpack) - Integrate Master CSS Static Extraction in Webpack way
|
|
93
|
+
|
|
94
|
+
##### Validation
|
|
95
|
+
- [Validator](https://github.com/master-co/css/tree/beta/packages/validator) for Master CSS class syntax
|
|
92
96
|
|
|
93
|
-
#####
|
|
94
|
-
- [
|
|
97
|
+
##### Language
|
|
98
|
+
- [Server](https://github.com/master-co/css/tree/beta/packages/language-server) - The core of the Master CSS language server
|
|
99
|
+
- [Service](https://github.com/master-co/css/tree/beta/packages/language-service) - The core of the Master CSS language service
|
|
100
|
+
- [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=masterco.master-css-language-service) - Master CSS Language Service for Visual Studio Code Extension
|
|
101
|
+
|
|
102
|
+
##### Others
|
|
103
|
+
- [Normal CSS](https://github.com/master-co/css/tree/beta/packages/normal.css) - Normalize the browser's styles
|
|
104
|
+
- [Theme Service](https://github.com/master-co/css/tree/beta/packages/theme-service) - A CSS theme-switching service for Master CSS
|
|
105
|
+
- [🚧 Class Variant](https://github.com/master-co/css/tree/beta/packages/class-variant) - Create reusable, extensible, and customizable style class variants
|
|
106
|
+
- 🚧 Resolve Class - Conditionally apply classes and trim it to a non-wrap string
|
|
95
107
|
|
|
96
108
|
## Community
|
|
97
109
|
The Master CSS community can be found here:
|
|
@@ -102,7 +114,7 @@ The Master CSS community can be found here:
|
|
|
102
114
|
<sub>Our [《 Code of Conduct 》](https://github.com/master-co/css/blob/main/CODE_OF_CONDUCT.md) applies to all Master CSS community channels.</sub>
|
|
103
115
|
|
|
104
116
|
## Contributing
|
|
105
|
-
Please see our [CONTRIBUTING
|
|
117
|
+
Please see our [CONTRIBUTING](https://github.com/master-co/css/blob/beta/.github/CONTRIBUTING.md) for workflow.
|
|
106
118
|
|
|
107
119
|
## Inspiration
|
|
108
120
|
Some of the core concepts and designs are inspired by these giants.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var T=Object.create;var d=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var O=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _(t))!E.call(e,o)&&o!==s&&d(e,o,{get:()=>t[o],enumerable:!(i=C(t,o))||i.enumerable});return e};var p=(e,t,s)=>(s=e!=null?T(x(e)):{},O(t||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e));var h=require("commander"),m=p(require("path")),c=p(require("fs"));var S=`/** @type {import('@master/css').Config} */
|
|
3
|
+
export default {
|
|
4
|
+
classes: {},
|
|
5
|
+
colors: {},
|
|
6
|
+
themes: {},
|
|
7
|
+
rules: {},
|
|
8
|
+
values: {},
|
|
9
|
+
semantics: {},
|
|
10
|
+
breakpoints: {},
|
|
11
|
+
mediaQueries: {},
|
|
12
|
+
keyframes: {},
|
|
13
|
+
selectors: {},
|
|
14
|
+
functions: {}
|
|
15
|
+
}
|
|
16
|
+
`;var g=`/** @type {import('@master/css').Config} */
|
|
17
|
+
module.exports = {
|
|
18
|
+
classes: {},
|
|
19
|
+
colors: {},
|
|
20
|
+
themes: {},
|
|
21
|
+
rules: {},
|
|
22
|
+
values: {},
|
|
23
|
+
semantics: {},
|
|
24
|
+
breakpoints: {},
|
|
25
|
+
mediaQueries: {},
|
|
26
|
+
keyframes: {},
|
|
27
|
+
selectors: {},
|
|
28
|
+
functions: {}
|
|
29
|
+
}
|
|
30
|
+
`;var y=`import type { Config } from '@master/css'
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
classes: {},
|
|
34
|
+
colors: {},
|
|
35
|
+
themes: {},
|
|
36
|
+
rules: {},
|
|
37
|
+
values: {},
|
|
38
|
+
semantics: {},
|
|
39
|
+
breakpoints: {},
|
|
40
|
+
mediaQueries: {},
|
|
41
|
+
keyframes: {},
|
|
42
|
+
selectors: {},
|
|
43
|
+
functions: {}
|
|
44
|
+
} as Config
|
|
45
|
+
`;var n=p(require("@techor/log")),l=require("@techor/fs"),{version:v,name:j,description:F}=(0,l.readJSONFileSync)(m.default.resolve(__dirname,"../../package.json")),a=new h.Command;a.name(j).description(F).version(v||"0.0.0");a.command("init").description("Initialize definition files for Master CSS").option("-o, --override","Override existing definition file").option("--esm","ES Module .mjs").option("--ts","TypeScript .ts").option("--cjs","CommonJS .js").action(async function(e){let{esm:t,ts:s,cjs:i}=e;if(!t&&!s&&!i)if(c.default.existsSync("tsconfig.json"))s=!0;else{let{type:r}=(0,l.readJSONFileSync)("./package.json")||{};r==="module"?t=!0:i=!0}let o=(r,f)=>{let u=c.default.existsSync(m.default.join(process.cwd(),r));u?u&&e.override?(c.default.writeFileSync(r,f),n.default.ok`**${r}** file is overridden`):n.default.x`**${r}** file already exists`:(c.default.writeFileSync(r,f),n.default.ok`**${r}** file is created`)};t&&o("master.css.mjs",S),s&&o("master.css.ts",y),i&&o("master.css.js",g)});a.command("render").description("Scans HTML and injects generated CSS rules").argument("<source paths>","The path in glob patterns of the source of the HTML file").option("-c --config","The source path of the Master CSS configuration","master.css.*").option("-a --analyze","Analyze injected CSS and HTML size ( brotli ) without writing to file").action(async function(e,t){try{await require("@master/css-renderer/actions/main")(e,t)}catch(s){s.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-renderer** first`:console.error(s)}});a.command("extract").argument("[source paths]","The glob pattern path to extract sources").option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your CSS file output path").option("-v, --verbose","Verbose logging 0~N","1").option("--options <path>","Specify your extractor options sources","master.css-extractor.*").action(async function(e,t){try{await require("@master/css-extractor/actions/main")(e,t)}catch(s){s.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@master/css-extractor** first`:console.error(s)}});a.parse();
|
package/dist/config/index.d.ts
CHANGED
|
@@ -4,16 +4,14 @@ import { rootSize } from './root-size';
|
|
|
4
4
|
import { scope } from './scope';
|
|
5
5
|
import { selectors } from './selectors';
|
|
6
6
|
import { semantics } from './semantics';
|
|
7
|
-
import { themes } from './themes';
|
|
8
7
|
import { rules } from './rules';
|
|
9
8
|
import { override } from './override';
|
|
10
|
-
import { observe } from './observe';
|
|
11
9
|
import { important } from './important';
|
|
12
10
|
import { keyframes } from './keyframes';
|
|
13
11
|
import { functions, FunctionConfig } from './functions';
|
|
14
12
|
import { themeDriver } from './themeDriver';
|
|
15
13
|
declare const config: Config;
|
|
16
|
-
export { config, breakpoints, colors, rootSize, scope, selectors, semantics,
|
|
14
|
+
export { config, breakpoints, colors, rootSize, scope, selectors, semantics, rules, override, important, functions, keyframes, themeDriver };
|
|
17
15
|
import type { RuleConfig } from '../rule';
|
|
18
16
|
type Classes = {
|
|
19
17
|
[key: string]: string | Classes;
|
|
@@ -40,6 +38,9 @@ export type Values = {
|
|
|
40
38
|
[key: string]: string | number | Values;
|
|
41
39
|
};
|
|
42
40
|
export interface Config {
|
|
41
|
+
extends?: (Config | {
|
|
42
|
+
config: Config;
|
|
43
|
+
})[];
|
|
43
44
|
classes?: Classes;
|
|
44
45
|
colors?: Colors;
|
|
45
46
|
breakpoints?: Breakpoints;
|
|
@@ -48,15 +49,10 @@ export interface Config {
|
|
|
48
49
|
semantics?: Semantics;
|
|
49
50
|
values?: Values;
|
|
50
51
|
rules?: Record<string, RuleConfig>;
|
|
51
|
-
themes?: Record<string, {
|
|
52
|
-
classes?: Classes;
|
|
53
|
-
colors?: Colors;
|
|
54
|
-
}> | string[];
|
|
55
52
|
rootSize?: number;
|
|
56
53
|
scope?: string;
|
|
57
54
|
important?: boolean;
|
|
58
55
|
override?: boolean;
|
|
59
|
-
observe?: boolean;
|
|
60
56
|
functions?: Record<string, FunctionConfig>;
|
|
61
57
|
keyframes?: Record<string, Record<string, Record<string, string | number>>>;
|
|
62
58
|
precedence?: 'highest' | 'higher' | 'lowest';
|
package/dist/config/rules.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { RuleConfig } from '../rule';
|
|
2
2
|
export declare const rules: {
|
|
3
|
-
filter: RuleConfig;
|
|
4
|
-
fill: RuleConfig;
|
|
5
3
|
flex: RuleConfig;
|
|
6
4
|
grid: RuleConfig;
|
|
7
5
|
group: RuleConfig;
|
|
@@ -178,6 +176,8 @@ export declare const rules: {
|
|
|
178
176
|
background: RuleConfig;
|
|
179
177
|
mixBlendMode: RuleConfig;
|
|
180
178
|
backdropFilter: RuleConfig;
|
|
179
|
+
filter: RuleConfig;
|
|
180
|
+
fill: RuleConfig;
|
|
181
181
|
strokeDasharray: RuleConfig;
|
|
182
182
|
strokeDashoffset: RuleConfig;
|
|
183
183
|
strokeWidth: RuleConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CONFIG_ESM_TEXT = "/** @type {import('@master/css').Config} */\
|
|
1
|
+
export declare const CONFIG_ESM_TEXT = "/** @type {import('@master/css').Config} */\nexport default {\n classes: {},\n colors: {},\n themes: {},\n rules: {},\n values: {},\n semantics: {},\n breakpoints: {},\n mediaQueries: {},\n keyframes: {},\n selectors: {},\n functions: {}\n}\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CONFIG_TS_TEXT = "import type { Config } from '@master/css'\n\nexport default {\n classes: {},\n colors: {},\n themes: {},\n rules: {},\n values: {},\n semantics: {},\n breakpoints: {},\n mediaQueries: {},\n keyframes: {},\n selectors: {},\n functions: {}\n} as Config\n";
|
package/dist/core.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export interface MasterCSS {
|
|
|
9
9
|
colorThemesMap: Record<string, Record<string, string>>;
|
|
10
10
|
colorNames: string[];
|
|
11
11
|
themeNames: string[];
|
|
12
|
-
themeAffectedClassesBy: Record<string, Record<string, string[]>>;
|
|
13
12
|
classesBy: Record<string, string[]>;
|
|
14
13
|
selectors: Record<string, [RegExp, string[]][]>;
|
|
15
14
|
values: Record<string, Record<string, string | number>>;
|
|
@@ -35,16 +34,26 @@ export declare class MasterCSS {
|
|
|
35
34
|
observer: MutationObserver;
|
|
36
35
|
constructor(config?: Config);
|
|
37
36
|
cache(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Observe the DOM for changes and update the running stylesheet. (browser only)
|
|
39
|
+
* @param targetRoot root element to observe. default: document
|
|
40
|
+
* @param options mutation observer options
|
|
41
|
+
* @returns this
|
|
42
|
+
*/
|
|
38
43
|
observe(targetRoot: Document | ShadowRoot | null, options?: MutationObserverInit): this;
|
|
39
44
|
disconnect(): void;
|
|
40
45
|
/**
|
|
41
|
-
*
|
|
46
|
+
* Match check if Master CSS class syntax
|
|
47
|
+
* @param syntax class syntax
|
|
48
|
+
* @returns css text
|
|
42
49
|
*/
|
|
43
|
-
match(
|
|
50
|
+
match(syntax: string): RuleMeta;
|
|
44
51
|
/**
|
|
45
|
-
*
|
|
52
|
+
* Create rules from class syntax
|
|
53
|
+
* @param syntax class syntax
|
|
54
|
+
* @returns Rule[]
|
|
46
55
|
*/
|
|
47
|
-
create(
|
|
56
|
+
create(syntax: string): Rule[];
|
|
48
57
|
/**
|
|
49
58
|
* 根據蒐集到的所有 DOM class 重新 create
|
|
50
59
|
*/
|
|
@@ -57,7 +66,7 @@ export declare class MasterCSS {
|
|
|
57
66
|
/**
|
|
58
67
|
* 依類名插入規則
|
|
59
68
|
*/
|
|
60
|
-
insert(
|
|
69
|
+
insert(syntax: string): boolean;
|
|
61
70
|
/**
|
|
62
71
|
* 加工插入規則
|
|
63
72
|
* 1. where
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function fillColorScale(data: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MasterCSS } from '../core';
|
|
2
|
+
import type { Config } from '../config';
|
|
3
|
+
/**
|
|
4
|
+
* Initialize a new MasterCSS instance and observe the target root
|
|
5
|
+
* @param config master css config
|
|
6
|
+
* @param targetRoot target root to observe
|
|
7
|
+
* @returns master css instance
|
|
8
|
+
*/
|
|
9
|
+
export default function initRuntime(config?: Config, targetRoot?: Document | ShadowRoot | null): MasterCSS;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Config } from '../config';
|
|
2
|
+
/**
|
|
3
|
+
* Renders the page-required and sorted CSS text from HTML and injected it back into HTML
|
|
4
|
+
* @param html
|
|
5
|
+
* @param config
|
|
6
|
+
* @returns html text
|
|
7
|
+
*/
|
|
8
|
+
export default function renderHTML(html: string, config?: Config): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{function pe(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function be(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function ve(t){let e=[];return t.forEach(function(n,a){typeof n=="object"&&n!==null?Array.isArray(n)?e[a]=ve(n):pe(n)?e[a]=be(n):e[a]=G({},n):e[a]=n}),e}function ge(t,e){return e==="__proto__"?void 0:t[e]}function G(...t){let e={},n,a;return t.forEach(function(h){typeof h!="object"||h===null||Array.isArray(h)||Object.keys(h).forEach(function(o){if(a=ge(e,o),n=ge(h,o),n!==e)if(typeof n!="object"||n===null){e[o]=n;return}else if(Array.isArray(n)){e[o]=ve(n);return}else if(pe(n)){e[o]=be(n);return}else if(typeof a!="object"||a===null||Array.isArray(a)){e[o]=G({},n);return}else{e[o]=G(a,n);return}})}),e}var te={"(":")","'":"'",'"':'"',"{":"}"};function re(t){if(typeof CSS<"u")return CSS.escape(t);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let e=String(t),n=e.length,a=-1,h="",o,S=e.charCodeAt(0);if(n==1&&S==45)return"\\"+e;for(;++a<n;){if(o=e.charCodeAt(a),o==0){h+="\uFFFD";continue}if(o>=1&&o<=31||o==127||a==0&&o>=48&&o<=57||a==1&&o>=48&&o<=57&&S==45){h+="\\"+o.toString(16)+" ";continue}if(o>=128||o==45||o==95||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){h+=e.charAt(a);continue}h+="\\"+e.charAt(a)}return h}var je={unit:"",order:0,separators:[","]},Te=/^(media|supports|page|font-face|keyframes|counter-style|font-feature-values|property|layer)(?=\||{|\(|$)/,ae=class{constructor(e,n={},a){this.className=e;this.meta=n;this.css=a;this.config=G(je,n.config);let{unit:h,order:o,colored:S,native:f,analyze:w,transform:b,declare:g,create:l}=this.config,{scope:u,important:d,functions:m,themeDriver:p,keyframes:c}=a.config,{themeNames:i,colorNames:r,colorThemesMap:s,selectors:v,breakpoints:k,mediaQueries:$,classesBy:T,globalValues:V}=a,H=T[e];l&&l.call(this,e);let U,se,ce,ee,Q;if(n.origin==="semantics"){let[L,I]=n.value;ee=e.slice(L.length),U=I}else{let L;if(w)[L,ce]=w.call(this,e);else{let j=e.indexOf(":");this.prefix=e.slice(0,j+1),L=e.slice(j+1)}Q=[];let I=this,E=this.values,D=[","];this.config.separators.length&&D.push(...this.config.separators);let C="",x=0;(function j(R,y,B,M=void 0,O=[],X=[],W){let A=M===void 0,Y,J=N=>N==="'"||N==='"',K=()=>Y=C.length,q=()=>{if(C){let N=C,z=A?N:C.slice(Y);if(C="",_="",E&&z in E&&!O.includes(z)){let F=x;x=0,j(E[z].toString(),y,void 0,M,[...O,z],X,W),x=F,A||(C=C.slice(0,Y)+C)}else if(V&&z in V&&!X.includes(z)){let F=x;x=0,j(V[z].toString(),y,void 0,M,O,[...X,z],W),x=F,A||(C=C.slice(0,Y)+C)}else if(A){let F=!W&&I.analyzeUnitValue(z,y);Q.push({value:F?.value??z,unit:F?.unit})}else{let F=!W&&I.analyzeUnitValue(z,y);C=F?N.slice(0,Y)+F.value+F.unit:N}K()}},Z=J(B);K();let _="";for(;x<R.length;x++){let N=R[x];if(N===B){if(Z){C+=N;let z=0;for(let F=C.length-2;C[F]==="\\";F--)z++;if(z%2)continue}else q(),C+=N;return}else if(!Z&&N in te){let z=N==="("&&_&&m?.[_];z?.name&&(C=C.slice(0,C.length-_.length)+z.name,_=z.name),C+=N,x++;let F=te[N];j(R,z?.unit??y,F,_||M||"",O,X,W||!!z?.transform),z?.transform&&(C=C.slice(0,Y+_.length+1)+z.transform.call(I,C.slice(Y+_.length+1,-1))+C.slice(-1)),A&&(J(F)?(Q.push(C),C=""):q()),_=""}else if((N==="|"||N===" ")&&B!=="}"&&(!Z||M==="path"))q(),A||(C+=" ",Y++);else{if(!Z){if(N==="."){if(isNaN(+R[x+1]))break;R[x-1]==="-"&&(C+="0")}else if(D.includes(N)){q(),A?Q.push(N):(C+=N,Y++);continue}else if(A&&(N==="#"&&(C||Q.length&&R[x-1]!=="|"&&Q[x-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(N)))break;_+=N}C+=N}}M===void 0&&q()})(L,h),ee=L.slice(x)}this.order=typeof o=="function"?o.call(this,this.prefix):o,ee[0]==="!"&&(this.important=!0,ee=ee.slice(1));let he=L=>{let I=L.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((x,j)=>j%3?x:x.replace(/(^|[^_])_(?!_)/g,"$1 ")).join(""),E=[],D="",C=0;for(let x=0;x<I.length;x++){let j=I[x];if(j==="\\"){D+=j+I[++x];continue}!C&&j===","?(E.push(D),D=""):(D+=j,C&&j===")"?C--:j==="("&&C++)}return D&&E.push(D),E};this.prefixSelectors=ce?he(ce):[""];let ue=ee.split("@"),de=ue[0];if(de){this.vendorSuffixSelectors={};let L=(x,j,R,y)=>{for(let[B,M]of j)if(B.test(x)){for(let O of M)L(x.replace(B,O),j,R,!0);return}y&&R.push(x)},I=[];""in v?L(de,v[""],I,!0):I.push(de);let E={};for(let[x,j]of Object.entries(v)){if(!x)continue;let R=[];for(let y of I)L(y,j,R,!1);R.length&&(E[x]=R)}let D=(x,j)=>{let R=j.reduce((y,B)=>(y.push(...he(B)),y),[]);x in this.vendorSuffixSelectors?this.vendorSuffixSelectors[x].push(...R):this.vendorSuffixSelectors[x]=R},C=Object.keys(E);if(C.length)for(let x of C)D(x,E[x]);else D("",I);for(let x of Object.values(this.vendorSuffixSelectors))for(let j of x){this.hasWhere!==!1&&(this.hasWhere=j.includes(":where("));let R=[":disabled",":active",":focus",":hover"];for(let y=0;y<R.length;y++)if(j.includes(R[y])){(this.priority===-1||this.priority>y)&&(this.priority=y);break}}}else this.vendorSuffixSelectors={"":[""]};for(let L=1;L<ue.length;L++){let I=ue[L];if(I)if(I==="rtl"||I==="ltr")this.direction=I;else{let E,D,C=Te.exec(I);if(C)E=C[1],D=I.slice(E.length);else{this.media={token:I,features:{}};let x=[],j=y=>{if(y==="all"||y==="print"||y==="screen"||y==="speech")this.media.type=y;else if(y==="\u{1F5A8}")this.media.type="print";else if(y==="landscape"||y==="portrait")x.push("(orientation:"+y+")");else if(y==="motion"||y==="reduced-motion")x.push("(prefers-reduced-motion:"+(y==="motion"?"no-preference":"reduce")+")");else if($&&y in $)x.push($[y]);else{let B={token:y},M="",O="",X=0;y.startsWith("<=")?(O="<=",M="max-width"):y.startsWith(">=")||k[y]?(O=">=",M="min-width"):y.startsWith(">")?(O=">",M="min-width",X=.02):y.startsWith("<")&&(O="<",M="max-width",X=-.02);let W=O?y.replace(O,""):y,A=k[W];switch(M){case"max-width":case"min-width":A?Object.assign(B,this.analyzeUnitValue(A.toString(),"px")):Object.assign(B,this.analyzeUnitValue(W,"px")),B.unit==="px"&&(B.value+=X),this.media.features[M]=B,x.push("("+M+":"+(B.value+B.unit)+")");break}}},R=I.includes("&");if(R){let y=I.split("&");for(let B of y)j(B)}else j(I);if(this.media.type&&(D=this.media.type),x.length&&(D=x.join(" and ")),D)E="media";else if(!R){this.theme=I;continue}}D&&(this.at[E]=(E in this.at?this.at[E]+" and ":"")+D.replace(/\|/g," "))}}let fe=(L,I)=>{let E,D=(j,R,y)=>{let B="";this.direction&&(B+="[dir="+this.direction+"] ");let M=this.prefixSelectors.map(W=>W+B),O=(W,A)=>M.map(Y=>(W&&p!=="media"?p==="host"?`:host(.${W}) `:`.${W} `:"")+(u?u+" ":"")+Y).reduce((Y,J)=>(Y.push(y.reduce((K,q)=>(K.push(J+"."+re(A)+q),K),[]).join(",")),Y),[]).join(","),X=O(R,e)+(H&&(this.theme||!S||!R)?H.reduce((W,A)=>W+","+O(this.theme??(S||se?R:""),A),""):"")+"{"+j+"}";for(let W of Object.keys(this.at).sort((A,Y)=>Y==="supports"?-1:1))X="@"+W+(W.includes(" ")?"":" ")+this.at[W]+"{"+X+"}";return R&&p==="media"&&(X=`@media(prefers-color-scheme:${R}){`+X+"}"),X},C=[];if(Q){let j=[this.theme??L,""],R,y=!1;for(let B of Q)if(typeof B=="string")C.push(B);else{let M=B.value;if(B.unit)M+=B.unit;else if(S&&s&&r){let O=!1;M=M.replace(new RegExp(`(^|,| |\\()((?:${r.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(X,W,A,Y)=>{let J=s[A];if(J){let K,q;for(let Z of j)if(K=J[Z]){q=Z;break}if(K){O=!I||q===L,R||(R=O);let Z=K;if(Y){let _=Y.endsWith("%")?parseFloat(Y)/100:+Y;_=isNaN(_)?1:Math.min(Math.max(_,0),1),Z+=Math.round(_*255).toString(16).toUpperCase().padStart(2,"0")}return W+Z}else y=!0}return X})}C.push(M)}if(I&&(y||(R===void 0?L:!R)))return;if(E=C.reduce((B,M,O)=>B+M+(M===","||Q[O+1]===","||O===Q.length-1?"":" "),""),b&&(E=b.call(this,E,this.css.config)),S&&E==="current"&&(E="currentColor"),g){let B,M;if(Q.length===1){let O=Q[0];typeof O=="object"&&(B=O.value,M=O.unit)}U=g.call(this,M?B:E,M||"")}else U={[f]:E}}let x={};for(let j in U){let R=(M,O)=>{if(c&&(O.startsWith("animation")||O.startsWith("animation-name"))){let W=O.split(":")[1].split("!important")[0].split(" ").filter(A=>A in this.css.config.keyframes&&(!this.keyframeNames||!this.keyframeNames.includes(A)));W.length&&(this.keyframeNames||(this.keyframeNames=[]),this.keyframeNames.push(...W))}let X=O+((this.important||d)&&!O.endsWith("!important")?"!important":"");M in x?x[M].push(X):x[M]=[X]},y=j+":",B=U[j];if(typeof B=="object")if(Array.isArray(B))for(let M of B)R(L,y+M.toString());else{se=!0;for(let M in B)R(M,y+B[M])}else R(L,y+B.toString())}for(let j of Object.values(this.vendorSuffixSelectors))for(let R in x)this.natives.push({text:D(x[R].join(";"),R,j),theme:R})};if(this.theme)fe(this.theme,!1);else if(S)for(let L of i)fe(L,!0);else fe("",!1)}at={};priority=-1;natives=[];keyframeNames;config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(e=>e.text).join("")}resolveValue(e,n){return Number.isNaN(+e)?e:e/(n==="rem"||n==="em"?this.css.config.rootSize:1)+n}analyzeUnitValue(e,n){let a=n??this.config.unit;if(a){let h="",o=e.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(o)if(e.includes("/")){let[S,f]=e.split("/");return{value:+S/+f*100+"%",unit:h}}else{let S=+o[1];return h=o[3]||"",h||((a==="rem"||a==="em")&&(S=S/this.css.config.rootSize),h=a||""),{value:S,unit:h}}}}};var xe={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560};function ie(t){t.startsWith("#")&&(t=t.slice(1));let e=t.match(/.{1,2}/g);return[parseInt(e[0],16),parseInt(e[1],16),parseInt(e[2],16)]}function le(t,e,n){return((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)}function P(t){typeof t=="string"&&(t={"":t});let e=""in t,n=!1;for(let a in t)if(a&&+a>=100){n=!0;break}if(!n&&(!e||Object.keys(t).length>1)){let a=0,h="0"in t?ie(t[0]):[0,0,0],o,S,f=[],w=()=>{let b=o-a,g=S.map((l,u)=>(l-h[u])/b);for(let l of f){let u=l-a,d=h.map((m,p)=>Math.round(m+g[p]*u));t[l]="#"+le.call(this,...d)}};for(let b=1;b<100;b++)b in t?(f.length?(o=b,S=ie(t[b]),w(),f.length=0,h=S):h=ie(t[b]),a=b):f.push(b);f.length&&(o=100,S="100"in t?ie(t[100]):[255,255,255],w())}return e||(t[""]=t[n?"500":"50"]),t}var ye={black:"#000000",white:"#ffffff",slate:P({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:P({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:P({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:P({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:P({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:P({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:P({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:P({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:P({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:P({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:P({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:P({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:P({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:P({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:P({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:P({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:P({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:P({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:P({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:P({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};var we="";var Se={"::scrollbar":"::-webkit-scrollbar","::scrollbar-button":"::-webkit-scrollbar-button","::scrollbar-thumb":"::-webkit-scrollbar-thumb","::scrollbar-track":"::-webkit-scrollbar-track","::scrollbar-track-piece":"::-webkit-scrollbar-track-piece","::scrollbar-corner":"::-webkit-scrollbar-corner","::slider-thumb":["::-webkit-slider-thumb","::-moz-range-thumb"],"::slider-runnable-track":["::-webkit-slider-runnable-track","::-moz-range-track"],"::meter":"::-webkit-meter","::resizer":"::-webkit-resizer","::progress":"::-webkit-progress",":first":":first-child",":last":":last-child",":even":":nth-child(2n)",":odd":":nth-child(odd)",":nth(":":nth-child("};var ke={square:{"aspect-ratio":"1/1"},video:{"aspect-ratio":"16/9"},rounded:{"border-radius":"1e9em"},round:{"border-radius":"50%"},hidden:{display:"none"},hide:{display:"none"},block:{display:"block"},table:{display:"table"},flex:{display:"flex"},grid:{display:"grid"},contents:{display:"contents"},inline:{display:"inline"},"inline-block":{display:"inline-block"},"inline-flex":{display:"inline-flex"},"inline-grid":{display:"inline-grid"},"inline-table":{display:"inline-table"},"table-cell":{display:"table-cell"},"table-caption":{display:"table-caption"},"flow-root":{display:"flow-root"},"list-item":{display:"list-item"},"table-row":{display:"table-row"},"table-column":{display:"table-column"},"table-row-group":{display:"table-row-group"},"table-column-group":{display:"table-column-group"},"table-header-group":{display:"table-header-group"},"table-footer-group":{display:"table-footer-group"},italic:{"font-style":"italic"},oblique:{"font-style":"oblique"},isolate:{isolation:"isolate"},overflowed:{overflow:"visible"},untouchable:{"pointer-events":"none"},static:{position:"static"},fixed:{position:"fixed"},abs:{position:"absolute"},rel:{position:"relative"},sticky:{position:"sticky"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},visible:{visibility:"visible"},invisible:{visibility:"hidden"},vw:{width:"100vw"},vh:{height:"100vh"},"max-vw":{"max-width":"100vw"},"max-vh":{"max-height":"100vh"},"min-vw":{"min-width":"100vw"},"min-vh":{"min-height":"100vh"},"center-content":{"justify-content":"center","align-items":"center"},"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap","border-width":"0"},full:{width:"100%",height:"100%"},center:{left:0,right:0,"margin-left":"auto","margin-right":"auto"},middle:{top:0,bottom:0,"margin-top":"auto","margin-bottom":"auto"},"break-spaces":{"white-space":"break-spaces"},"break-word":{"overflow-wrap":"break-word",overflow:"hidden"},"gradient-text":{"-webkit-text-fill-color":"transparent","-webkit-background-clip":"text","background-clip":"text"}};var Oe={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(t){let e=0;for(;e<t.length&&!(t[e]==="{"&&t[e-1]!=="\\");e++);return[t.slice(e),t.slice(0,e)]},declare(t){let e={},n=(b,g)=>{let l=g.indexOf(":");if(l!==-1){b in e||(e[b]={});let u=e[b],d=g.slice(0,l);d in u||(u[d]=g.slice(l+1))}},a=b=>{let g=(l,u)=>{let d=u.slice(re(b.className).length).match(/\{(.*)\}/)[1].split(";");for(let m of d)n(l,m)};if(this.theme){let l=b.natives.find(u=>u.theme===this.theme)??b.natives.find(u=>!u.theme);l&&g(this.theme,l.text)}else for(let l of b.natives)g(l.theme,l.text);if(b.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let l of b.keyframeNames)this.keyframeNames.includes(l)||this.keyframeNames.push(l)}},h=[],o="",S=()=>{o&&(h.push(o.replace(/ /g,"|")),o="")},f=1;(function b(g){for(;f<t.length;f++){let l=t[f];if(!g){if(l===";"){S();continue}if(l==="}")break}if(o+=l,g===l){if(g==="'"||g==='"'){let u=0;for(let d=o.length-2;o[d]==="\\";d--)u++;if(u%2)continue}break}else l in te&&g!=="'"&&g!=='"'&&(f++,b(te[l]))}})(void 0),S();for(let b of h){let g=this.css.create(b);if(Array.isArray(g))if(g.length)for(let l of g)a(l);else n(this.theme??"",b);else a(g)}let w={};for(let b in e)for(let[g,l]of Object.entries(e[b]))g in w?w[g][b]=l:w[g]={[b]:l};return w}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(t){return{["--"+this.prefix.slice(1,-1)]:t}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(t){switch(t){case"subpixel-antialiased":return{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"};case"antialiased":return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"}}}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},marginLeft:{match:"^ml:.",native:!0,unit:"rem"},marginRight:{match:"^mr:.",native:!0,unit:"rem"},marginTop:{match:"^mt:.",native:!0,unit:"rem"},marginBottom:{match:"^mb:.",native:!0,unit:"rem"},marginX:{match:"^(?:mx|margin-x):.",unit:"rem",order:-.5,declare(t,e){return{"margin-left":t+e,"margin-right":t+e}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(t,e){return{"margin-top":t+e,"margin-bottom":t+e}}},margin:{match:"^m:.",native:!0,unit:"rem",order:-1},paddingLeft:{match:"^pl:.",native:!0,unit:"rem"},paddingRight:{match:"^pr:.",native:!0,unit:"rem"},paddingTop:{match:"^pt:.",native:!0,unit:"rem"},paddingBottom:{match:"^pb:.",native:!0,unit:"rem"},paddingX:{match:"^(?:px|padding-x):.",unit:"rem",order:-.5,declare(t,e){return{"padding-left":t+e,"padding-right":t+e}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(t,e){return{"padding-top":t+e,"padding-bottom":t+e}}},padding:{match:"^p:.",native:!0,unit:"rem",order:-1},flexBasis:{values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},height:{match:"^h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t]},declare(t){let[e,n]=t.split(" x ");return{width:e,height:n}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,n]=t.split(" x ");return{"min-width":e,"min-height":n}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,n]=t.split(" x ");return{"max-width":e,"max-height":n}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},top:{native:!0,unit:"rem"},bottom:{native:!0,unit:"rem"},left:{native:!0,unit:"rem"},right:{native:!0,unit:"rem"},inset:{native:!0,unit:"rem",order:-1},lines:{match:"^lines:.",declare(t,e){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":t+e}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflowX:{native:!0,declare(t,e){return t==="overlay"?{"overflow-x":["auto",t]}:{"overflow-x":t}}},overflowY:{native:!0,declare(t,e){return t==="overlay"?{"overflow-y":["auto",t]}:{"overflow-y":t}}},overflow:{native:!0,order:-1,declare(t,e){return t==="overlay"?{overflow:["auto",t]}:{overflow:t}}},overscrollBehaviorX:{native:!0},overscrollBehaviorY:{native:!0},overscrollBehavior:{native:!0,order:-1},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{native:!0,declare(t,e){return{"user-drag":t+e,"-webkit-user-drag":t+e}}},userSelect:{native:!0,declare(t,e){return{"user-select":t+e,"-webkit-user-select":t+e}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(t,e){return{"font-size":t+e,"line-height":e==="em"?t+.875+e:`calc(${t}${e} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-fill-color":t+e}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(t,e){return{"-webkit-text-stroke-width":t+e}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-stroke-color":t+e}}},textStroke:{unit:"rem",native:!0,declare(t,e){return{"-webkit-text-stroke":t+e}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0,analyze(t){return[t.startsWith("transform")?t.slice(10):t]}},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{match:"^~[^!*>+~:[@_]+\\|",native:!0,analyze(t){if(t.startsWith("~"))return[t.slice(1)];{let e=t.indexOf(":");return this.prefix=t.slice(0,e+1),[t.slice(e+1)]}},order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0,values:{alt:"alternate","alt-reverse":"alternate-reverse"}},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill:.",native:!0},animationIterationCount:{match:"^@iteration:.",native:!0},animationName:{match:"^@name:.",native:!0},animationPlayState:{match:"^@play:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{match:"^@[^!*>+~:[@_]+\\|",native:!0,order:-1,analyze(t){if(t.startsWith("@"))return[t.slice(1)];{let e=t.indexOf(":");return this.prefix=t.slice(0,e+1),[t.slice(e+1)]}}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderTopColor:{match:"^b(?:t|order-top(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderBottomColor:{match:"^b(?:b|order-bottom(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderLeftColor:{match:"^b(?:l|order-left(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderRightColor:{match:"^b(?:r|order-right(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderXColor:{match:"^b(?:x|order-x(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(t,e){return{"border-left-color":t+e,"border-right-color":t+e}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(t,e){return{"border-top-color":t+e,"border-bottom-color":t+e}}},borderColor:{match:"^b(?:order)?(?:-color)?:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,order:-1,colored:!0,values:{current:"currentColor"}},borderTopLeftRadius:{match:"^r(?:tl|lt):.",unit:"rem",native:!0},borderTopRightRadius:{match:"^r(?:tr|rt):.",unit:"rem",native:!0},borderBottomLeftRadius:{match:"^r(?:bl|lb):.",unit:"rem",native:!0},borderBottomRightRadius:{match:"^r(?:br|rb):.",unit:"rem",native:!0},borderTopRadius:{match:"^rt:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-left-radius":t+e,"border-top-right-radius":t+e}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(t,e){return{"border-bottom-left-radius":t+e,"border-bottom-right-radius":t+e}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-left-radius":t+e,"border-bottom-left-radius":t+e}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-right-radius":t+e,"border-bottom-right-radius":t+e}}},borderRadius:{match:"^r:.",unit:"rem",native:!0,order:-1},borderTopStyle:{match:"^b(?:t|order-top(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderBottomStyle:{match:"^b(?:b|order-bottom(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderLeftStyle:{match:"^b(?:l|order-left(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderRightStyle:{match:"^b(?:r|order-right(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderXStyle:{match:"^b(?:x|order-x(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(t,e){return{"border-left-style":t+e,"border-right-style":t+e}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(t,e){return{"border-top-style":t+e,"border-bottom-style":t+e}}},borderStyle:{match:"^b(?:order)?(?:-style)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0,order:-1},borderTopWidth:{match:"^b(?:t|order-top(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderBottomWidth:{match:"^b(?:b|order-bottom(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderLeftWidth:{match:"^b(?:l|order-left(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderRightWidth:{match:"^b(?:r|order-right(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderXWidth:{match:"^b(?:x|order-x(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(t,e){return{"border-left-width":t+e,"border-right-width":t+e}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(t,e){return{"border-top-width":t+e,"border-bottom-width":t+e}}},borderWidth:{match:"^b(?:order)?(?:-width)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0,order:-1},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0,order:-1},borderTop:{match:"^bt:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderBottom:{match:"^bb:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderLeft:{match:"^bl:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderRight:{match:"^br:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderX:{match:"^(?:bx|border-x):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(t){return{"border-left":t,"border-right":t}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(t){return{"border-top":t,"border-bottom":t}}},border:{match:"^b:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"},order:-2},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(t,e){return{"-webkit-background-clip":t+e,"background-clip":t+e}},values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)|gradient\\(.*\\))(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"},analyze(t){if(t.startsWith("gradient"))return["linear-"+t];let e=t.indexOf(":");return this.prefix=t.slice(0,e+1),[t.slice(e+1)]}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"backdrop-filter":t+e,"-webkit-backdrop-filter":t+e}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridColumns:{match:"^grid-cols:.",declare(t,e){return{display:"grid","grid-template-columns":"repeat("+t+e+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridRows:{match:"^grid-rows:.",declare(t,e){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+t+e+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:{min:"min-content",max:"max-content"}},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:{min:"min-content",max:"max-content"},native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplateRows:{native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},columnGap:{match:"^gap-x:.",unit:"rem",native:!0},rowGap:{match:"^gap-y:.",unit:"rem",native:!0},gap:{unit:"rem",native:!0,order:-1},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(t,e){return{"box-decoration-break":t+e,"-webkit-box-decoration-break":t+e}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMarginLeft:{match:"^scroll-ml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^scroll-mr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^scroll-mt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^scroll-mb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:scroll-margin-x|scroll-mx):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-margin-left":t+e,"scroll-margin-right":t+e}}},scrollMarginY:{match:"^(?:scroll-margin-y|scroll-my):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-margin-top":t+e,"scroll-margin-bottom":t+e}}},scrollMargin:{match:"^scroll-m:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^scroll-pl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^scroll-pr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^scroll-pt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^scroll-pb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:scroll-padding-x|scroll-px):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-padding-left":t+e,"scroll-padding-right":t+e}}},scrollPaddingY:{match:"^(?:scroll-padding-y|scroll-py):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-padding-top":t+e,"scroll-padding-bottom":t+e}}},scrollPadding:{match:"^scroll-p:.",native:!0,unit:"rem",order:-1},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(t,e){return{"mask-image":t+e,"-webkit-mask-image":t+e}}}},Ce=Oe;var Re={fade:{"0%":{opacity:0},to:{opacity:1}},flash:{"0%,50%,to":{opacity:1},"25%,75%":{opacity:0}},float:{"0%":{transform:"none"},"50%":{transform:"translateY(-1.25rem)"},to:{transform:"none"}},heart:{"0%":{transform:"scale(1)"},"14%":{transform:"scale(1.3)"},"28%":{transform:"scale(1)"},"42%":{transform:"scale(1.3)"},"70%":{transform:"scale(1)"}},jump:{"0%,to":{transform:"translateY(-25%)","animation-timing-function":"cubic-bezier(.8,0,1,1)"},"50%":{transform:"translateY(0)","animation-timing-function":"cubic-bezier(0,0,.2,1)"}},ping:{"75%,to":{transform:"scale(2)",opacity:0}},pulse:{"0%":{transform:"none"},"50%":{transform:"scale(1.05)"},to:{transform:"none"}},rotate:{"0%":{transform:"rotate(-360deg)"},to:{transform:"none"}},shake:{"0%":{transform:"none"},"6.5%":{transform:"translateX(-6px) rotateY(-9deg)"},"18.5%":{transform:"translateX(5px) rotateY(7deg)"},"31.5%":{transform:"translateX(-3px) rotateY(-5deg)"},"43.5%":{transform:"translateX(2px) rotateY(3deg)"},"50%":{transform:"none"}},zoom:{"0%":{transform:"scale(0)"},to:{transform:"none"}}};var $e={$:{name:"var",transform(t){return"--"+t}},calc:{transform(t){let e=this.values,n=this.css.globalValues,a=this.css.config.functions,h=this,o=0,S="",f="";return function w(b,g){let l=!1,u=(d,m=!1,p=!1)=>{if(d!=="("&&(e&&f in e?f=e[f].toString():n&&f in n&&(f=n[f].toString())),f&&!l&&!g){let c=h.analyzeUnitValue(f,a.calc.unit);c&&(f=c.value+c.unit)}S+=f+(m&&t[o-1]!==" "?" ":"")+d+(p&&t[o+1]!==" "?" ":""),f="",l=!1};for(;o<t.length;o++){let d=t[o];if(d==="("){let m=f,p=l,c=S.length;if(u(d),o++,w(m,p||g),m!=="calc"){let i=a[m];if(i){let r=S.slice(c+2,S.length-1);S=S.slice(0,c-m.length+1)+(i.name??m)+"("+(i.transform?.(r)??r)+")"}}}else if(d===")"){u(d);break}else if(d===",")u(d,!1,!0);else if(d===" ")u(d);else{let m=t[o-1];switch(d){case"+":!f&&m!==")"?f+=d:u(d,!0,!0);break;case"-":b==="var"||!f&&m!==")"?f+=d:u(d,!0,!0);break;case"*":u(d,!0,!0);break;case"/":u(d,!0,!0),l=!0;break;default:f+=d;break}}}o>=t.length-1&&u("")}("",!1),S}},translate:{unit:"rem"},translateX:{unit:"rem"},translateY:{unit:"rem"},translateZ:{unit:"rem"},translate3d:{unit:"rem"},skew:{unit:"deg"},skewX:{unit:"deg"},skewY:{unit:"deg"},skewZ:{unit:"deg"},skew3d:{unit:"deg"},rotate:{unit:"deg"},rotateX:{unit:"deg"},rotateY:{unit:"deg"},rotateZ:{unit:"deg"},rotate3d:{unit:"deg"},blur:{unit:"rem"},"drop-shadow":{unit:"rem"},"hue-rotate":{unit:"deg"},rgb:{unit:""},rgba:{unit:""},hsl:{unit:""},hsla:{unit:""},repeat:{unit:""}};var Be="class";var ne={breakpoints:xe,colors:ye,rootSize:16,scope:we,selectors:Se,semantics:ke,rules:Ce,override:!1,important:!1,functions:$e,keyframes:Re,themeDriver:Be};var Me=[",",".","#","[","!","*",">","+","~",":","@"];var oe=class t{constructor(e=ne){this.config=e;if(!e?.override){let n=(a,h)=>{let o=h.extends?.length?G({},h,...h.extends.map(f=>n(h,"config"in f?f.config:f))):h,S=G(a,o);return Object.prototype.hasOwnProperty.call(o,"keyframes")&&Object.assign(S.keyframes,o.keyframes),S};this.config=n(ne,e)}this.cache(),t.instances.push(this)}static root;static config=ne;static instances=[];static refresh=e=>{for(let n of this.instances)n.refresh(e)};rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.classesBy={},this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:e,classes:n,selectors:a,colors:h,values:o,breakpoints:S,mediaQueries:f,rules:w}=this.config;function b(i){return i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function g(i,r,s="",v={}){let k=H=>H?(s?s+"-":"")+H:s,$=Object.entries(i),T=[],V=[];for(let H of $){let U=H[1];(typeof U=="object"&&!Array.isArray(U)?T:V).push(H)}for(let[H,U]of T)g(U,r,k(H),v);if(r&&s)V.length&&(v[s]=V.reduce((H,[U,se])=>(H[U]=se,H),{}));else for(let[H,U]of V)v[k(H)]=U;return v}function l(i){for(let[r,s]of Object.entries(i))/^[0-9]+x$/.test(r)&&typeof s=="number"&&(i["-"+r]=s*-1);return i}if(e)for(let[i,r]of Object.entries(g(e,!0)))this.semantics.push([new RegExp("^"+b(i)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[i,r]]);if(a)for(let[i,r]of Object.entries(g(a,!1))){let s=new RegExp(b(i)+"(?![a-z-])");for(let v of Array.isArray(r)?r:[r]){let k=v.match(/^::-[a-z]+-/m)?.[0]??"",$=this.selectors[k];$||($=this.selectors[k]=[]);let T=$.find(([V])=>V===s);T||(T=[s,[]],$.push(T)),T[1].push(v)}}o&&(this.globalValues=l(g(o,!1))),S&&(this.breakpoints=g(S,!1)),f&&(this.mediaQueries=g(f,!1));let u=n?g(n,!1):{},d=Object.keys(u),m=i=>{if(Object.prototype.hasOwnProperty.call(this.classes,i))return;let r=this.classes[i]=[],s=u[i];if(!s)return;let v=s.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let k of v){let $=T=>{if(Object.prototype.hasOwnProperty.call(this.classesBy,T)){let V=this.classesBy[T];V.includes(i)||V.push(i)}else this.classesBy[T]=[i];r.includes(T)||r.push(T)};if(d.includes(k)){m(k);for(let T of this.classes[k])$(T)}else $(k)}};for(let i of d)m(i);let p=h?g(h,!0):{};for(let[i,r]of Object.entries(p)){let s=typeof r=="string"?{"":r}:r;for(let[v,k]of Object.entries(s)){let $=(T,V)=>{Object.prototype.hasOwnProperty.call(this.colorThemesMap,V)?this.colorThemesMap[V][T]=k:this.colorThemesMap[V]={[T]:k}};if(v.startsWith("@")){let T=v.slice(1);$(T,i),this.themeNames.includes(T)||this.themeNames.push(T)}else $("",i+(v?"-"+v:""))}}this.colorNames=h?Object.keys(h):[];let c=i=>{for(let[r,s]of Object.entries(this.colorThemesMap))for(let[v,k]of Object.entries(s))k.startsWith("#")||i(r,s,v,k)};if(c((i,r,s,v)=>{let k=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(v);if(k){let $="#"+le(+k[1],+k[2],+k[3]);k[4]&&($+=Math.round(255*+k[4]).toString(16)),r[s]=$}}),c((i,r,s,v)=>{let[k,$]=v.split("/"),T=this.colorThemesMap[k];if(T){let V=(s?T[s]:void 0)??T[""];r[s]=$?V.slice(0,7)+Math.round(255*+$).toString(16):V}else console.warn(`\`${v}\` doesn't exist in the extended config \`.colors\``),delete r[s],Object.keys(r).length||delete this.colorThemesMap[i]}),w)for(let i in w){let r=w[i],{native:s,values:v,colored:k}=r,$=r.match;if(r.id=i,r.native=s===!0?i.replace(/(?!^)[A-Z]/g,T=>"-"+T).toLowerCase():void 0,v&&(this.values[i]=l(g(v,!1))),$){let T=Object.keys(this.values[i]??{});$.includes("$values")&&($=T.length?$.replace(/\$values/,T.join("|")):$.replace(/(?:\|)?\$values/,"")),k&&$.includes("$colors")&&($=this.colorNames.length?$.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):$.replace(/(?:\|)?\$colors/,"")),this.matches[i]=new RegExp($)}}}observe(e,n={subtree:!0,childList:!0}){if(typeof window<"u"){if(e||(e=document),this.root===e)return this;this.root=e;let a=e===document;a&&(t.root=this),this.host=a?document.documentElement:this.root.host;let h=a?document.head:e,o=a?document.styleSheets:e.styleSheets;for(let f of o){let{ownerNode:w}=f;if(w&&w.id==="master"){this.style=w;break}}if(this.style)for(let f=0;f<this.style.sheet.cssRules.length;f++){let w=this.style.sheet.cssRules[f];if(w.constructor.name==="CSSKeyframesRule")continue;let b=l=>{if(l.selectorText){let d=l.selectorText.split(", ")[0].split(" ");for(let m=0;m<d.length;m++){let p=d[m];if(p[0]==="."){let c=p.slice(1),i="";for(let r=0;r<c.length;r++){let s=c[r],v=c[r+1];if(s==="\\"){if(r++,v!=="\\"){i+=v;continue}}else if(Me.includes(s))break;i+=s}if(!Object.prototype.hasOwnProperty.call(this.ruleBy,i)&&!Object.prototype.hasOwnProperty.call(this.classes,i)){let r=this.create(i)[0];if(r)return r}}}}else if(l.cssRules)for(let u=0;u<l.cssRules.length;u++){let d=b(l.cssRules[u]);if(d)return d}},g=b(w);if(g){this.rules.push(g),this.ruleBy[g.className]=g;for(let l=0;l<g.natives.length;l++)g.natives[l].cssRule=this.style.sheet.cssRules[f+l];f+=g.natives.length-1,g.config.insert?.call(g)}}else this.style=document.createElement("style"),this.style.id="master",h.append(this.style);let S=f=>{f.forEach(w=>{Object.prototype.hasOwnProperty.call(this.countBy,w)?this.countBy[w]++:(this.countBy[w]=1,this.insert(w))})};S(this.host.classList),n.subtree&&this.host.querySelectorAll("[class]").forEach(f=>S(f.classList)),this.observer=new MutationObserver(f=>{let w={},b=[],g=[],l=[],u=(c,i)=>{i?c.classList.forEach(m):c.classList.forEach(d);let r=c.children;for(let s=0;s<r.length;s++){let v=r[s];v.classList&&(g.push(v),u(v,i))}},d=c=>{Object.prototype.hasOwnProperty.call(w,c)?w[c]++:w[c]=1},m=c=>{Object.prototype.hasOwnProperty.call(w,c)?w[c]--:Object.prototype.hasOwnProperty.call(this.countBy,c)&&(w[c]=-1)},p=(c,i)=>{for(let r=0;r<c.length;r++){let s=c[r];s.classList&&!g.includes(s)&&!l.includes(s)&&(s.isConnected!==i?(g.push(s),u(s,i)):l.push(s))}};for(let c=0;c<f.length;c++){let i=f[c],{addedNodes:r,removedNodes:s,type:v,target:k}=i;if(v==="attributes"){if(b.find($=>$.target===k))continue;b.push(i)}else p(r,!1),(!k.isConnected||!g.includes(k))&&p(s,!0)}if(!(!b.length&&!Object.keys(w).length)){for(let{oldValue:c,target:i}of b){let r=g.includes(i),s=i.classList,v=c?c.split(" "):[];if(r){if(i.isConnected)continue;for(let k of v)s.contains(k)||m(k)}else if(i.isConnected){s.forEach(k=>{v.includes(k)||d(k)});for(let k of v)s.contains(k)||m(k)}}for(let c in w){let i=w[c],r=(this.countBy[c]||0)+i;r===0?(delete this.countBy[c],this.delete(c)):(Object.prototype.hasOwnProperty.call(this.countBy,c)||this.insert(c),this.countBy[c]=r)}}}),this.observer.observe(e,{...n,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style?.sheet;if(e?.cssRules)for(let n=e.cssRules.length-1;n>=0;n--)e.deleteRule(n);this.style?.remove(),this.style=null,this.root=null}match(e){for(let n in this.config.rules){let a=this.config.rules[n],h=this.matches[n],{native:o}=a;if(h&&h.test(e))return{origin:"match",config:a};if(o&&e.startsWith(o+":"))return{origin:"match",config:a}}for(let n of this.semantics)if(e.match(n[0]))return{origin:"semantics",value:n[1]}}create(e){let n=a=>{if(Object.prototype.hasOwnProperty.call(this.ruleBy,a))return this.ruleBy[a];let h=this.match(a);if(h)return new ae(a,h,this)};return(Object.prototype.hasOwnProperty.call(this.classes,e)?this.classes[e].map(a=>n(a)):[n(e)]).filter(a=>a&&a.text)}refresh(e){if(e?.override?this.config=e:this.config=G(ne,e),this.cache(),!this.style)return;let n=document.createElement("style");n.id="master",this.style.replaceWith(n),this.style=n,this.rules.length=0,this.ruleBy={};for(let a in this.countBy)this.insert(a)}destroy(){let e=t.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let n=this.style?.sheet,a=h=>{let o=this.ruleBy[h];if(!(!o||Object.prototype.hasOwnProperty.call(this.classesBy,h)&&this.classesBy[h].some(S=>Object.prototype.hasOwnProperty.call(this.countBy,S)))){if(n&&o.natives.length){let S=o.natives[0];for(let f=0;f<n.cssRules.length;f++)if(n.cssRules[f]===S.cssRule){for(let b=0;b<o.natives.length;b++)n.deleteRule(f);break}}if(this.rules.splice(this.rules.indexOf(o),1),delete this.ruleBy[h],o.keyframeNames){let S=this.rules[0];for(let f of o.keyframeNames){let w=this.keyframes[f];if(!--w.count){let b=S.natives.indexOf(w.native);this.style.sheet.deleteRule(b),S.natives.splice(b,1),delete this.keyframes[f]}}S.natives.length||this.rules.splice(0,1)}o.config.delete?.call(o,h)}};if(Object.prototype.hasOwnProperty.call(this.classes,e)){for(let h of this.classes[e])Object.prototype.hasOwnProperty.call(this.countBy,h)||a(h);delete this.ruleBy[e]}else a(e)}insert(e){let n=this.create(e);return n.length?(this.insertRules(n),!0):!1}insertRules(e){for(let n of e){if(this.ruleBy[n.className])continue;let a,h=Object.keys(this.keyframes).length,o=this.rules.length-1,{media:S,order:f,priority:w,hasWhere:b,className:g}=n,l=(m,p,c)=>{let i=m;for(;i<=o;i++){let r=this.rules[i];if(p?.(r))return c?-1:i-1;if(c?.(r))return i}return c?-1:i-1},u,d;if(S){let m=this.rules.findIndex(p=>p.media);if(m===-1)a=o+1;else{let{"max-width":p,"min-width":c}=S.features;if(p||c){let i=this.rules.findIndex(r=>r.media?.features["max-width"]||r.media?.features["min-width"]);if(i===-1)a=o+1;else if(p&&c){if(w===-1?(u=l(i,r=>r.priority!==-1,r=>r.media.features["max-width"]&&r.media.features["min-width"]),d=l(i,r=>r.priority!==-1)):(u=l(i,void 0,r=>r.media.features["max-width"]&&r.media.features["min-width"]&&r.priority!==-1),d=o),u!==-1){let r=p.value-c.value,s=d,v=u;for(u=void 0;s>=v;s--){let{"max-width":k,"min-width":$}=this.rules[s].media.features,T=k.value-$.value;if(T<r)d=s-1;else if(T===r)u=s;else break}}if(u!==-1){let r=p.value-c.value;for(let s=d;s>=u;s--){let{"max-width":v,"min-width":k}=this.rules[s].media.features,$=v.value-k.value;if($<r)d=s-1;else if($>r){u=s+1;break}}}}else if(c){if(w===-1?(u=l(i,r=>r.media.features["max-width"]&&r.media.features["min-width"]||r.priority!==-1,r=>!r.media.features["max-width"]&&r.media.features["min-width"]),d=l(i,r=>r.media.features["max-width"]&&r.media.features["min-width"]||r.priority!==-1)):(u=l(i,r=>r.media.features["max-width"]&&r.media.features["min-width"]&&r.priority!==-1,r=>!r.media.features["max-width"]&&r.media.features["min-width"]&&r.priority!==-1),d=l(i,r=>r.media.features["max-width"]&&r.media.features["min-width"]&&r.priority!==-1)),u!==-1)for(let r=d;r>=u;r--){let s=this.rules[r].media.features["min-width"].value;if(s>c.value)d=r-1;else if(s<c.value){u=r+1;break}}}else if(w===-1?(u=l(i,r=>r.media.features["min-width"]||r.priority!==-1,r=>r.media.features["max-width"]),d=l(i,r=>r.media.features["min-width"]||r.priority!==-1)):(u=l(i,r=>r.media.features["min-width"]&&r.priority!==-1,r=>r.media.features["max-width"]&&r.priority!==-1),d=l(i,r=>r.media.features["min-width"]&&r.priority!==-1)),u!==-1)for(let r=d;r>=u;r--){let s=this.rules[r].media.features["max-width"].value;if(s<p.value)d=r-1;else if(s>p.value){u=r+1;break}}}else w===-1?(u=m,d=l(m,i=>i.media?.features["max-width"]||i.media?.features["min-width"]||i.priority!==-1)):(u=l(m,i=>i.media?.features["max-width"]||i.media?.features["min-width"],i=>i.priority!==-1),d=l(m,i=>i.media?.features["max-width"]||i.media?.features["min-width"]))}}else{let m=h?1:0;w===-1?(u=m,d=l(m,p=>p.media||p.priority!==-1)):(u=l(m,p=>p.media,p=>p.priority!==-1),d=l(m,p=>p.media))}if(a===void 0)if(u===-1)a=d+1;else{if(w===-1)for(let m=u;m<=d;m++){let p=this.rules[m];if(!(!b&&p.hasWhere)&&(b&&!p.hasWhere||p.order>=f)){a=m;break}}else for(let m=u;m<=d;m++){let p=this.rules[m];if(!(!b&&p.hasWhere)){if(b&&!p.hasWhere){a=m;break}if(p.priority<w){a=m;break}else if(p.priority===w){if(p.order>=f){a=m;break}}else a=m+1}}a===void 0&&(a=d+1)}if(this.rules.splice(a,0,n),this.ruleBy[g]=n,this.style){let m=this.style.sheet,p=0,c=i=>{let r=this.rules[i];if(r){if(!r.natives.length)return c(i-1);let s=r.natives[r.natives.length-1].cssRule;for(let v=0;v<m.cssRules.length;v++)if(m.cssRules[v]===s){p=v+1;break}}};c(a-1);for(let i=0;i<n.natives.length;)try{let r=n.natives[i];m.insertRule(r.text,p),r.cssRule=m.cssRules[p++],i++}catch(r){console.error(r),n.natives.splice(i,1)}}if(n.keyframeNames){let m=this.style?.sheet;for(let p of n.keyframeNames)if(Object.prototype.hasOwnProperty.call(this.keyframes,p))this.keyframes[p].count++;else{let c={text:`@keyframes ${p}{`+Object.entries(this.config.keyframes[p]).map(([r,s])=>`${r}{${Object.entries(s).map(([v,k])=>v+":"+k).join(";")}}`).join("")+"}",theme:""},i;if(Object.keys(this.keyframes).length?(i=this.rules[0]).natives.push(c):this.rules.splice(0,0,i={natives:[c],get text(){return this.natives.map(r=>r.text).join("")}}),m){let r;for(let s=0;s<m.cssRules.length;s++){let v=m.cssRules[s];if(v.constructor.name!=="CSSKeyframesRule")break;if(v.name===p){r=v;break}}if(r)c.cssRule=r;else{let s=i.natives.length-1;m.insertRule(c.text,s),c.cssRule=m.cssRules[s]}}this.keyframes[p]={native:c,count:1}}}n.config.insert?.call(n)}}get text(){return this.rules.map(e=>e.text).join("")}};typeof window<"u"&&(window.MasterCSS=oe);function me(t,e){return new oe(t).observe(e)}me(window.masterCSSConfig);})();
|
package/dist/index.browser.d.ts
CHANGED