@master/css-runtime 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/dist/core.d.ts +23 -0
- package/dist/iife.bundle.js +1 -0
- package/dist/iife.d.ts +1 -0
- package/dist/index.bundle.js +1 -0
- package/dist/index.bundle.mjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/init-css-runtime.d.ts +9 -0
- package/dist/types/global.d.ts +8 -0
- package/package.json +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<br>
|
|
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">Run the Master CSS right in the browser</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
|
|
17
|
+
<picture>
|
|
18
|
+
<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">
|
|
19
|
+
<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">
|
|
20
|
+
<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">
|
|
21
|
+
</picture>
|
|
22
|
+
</a>
|
|
23
|
+
<a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/css-runtime">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/css-runtime?color=212022&label=%20&logo=npm&style=for-the-badge">
|
|
26
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/css-runtime?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
27
|
+
<img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/css-runtime?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
28
|
+
</picture>
|
|
29
|
+
</a>
|
|
30
|
+
<a aria-label="JSDelivr" href="https://www.jsdelivr.com/package/npm/@master/css-runtime">
|
|
31
|
+
<picture>
|
|
32
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/jsdelivr/npm/hm/@master/css-runtime?color=212022&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
33
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/jsdelivr/npm/hm/@master/css-runtime?color=f6f7f8&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
34
|
+
<img alt="JSDelivr hits (npm scoped)" src="https://img.shields.io/jsdelivr/npm/hm/@master/css-runtime?color=f6f7f8&label=%20&logo=jsdelivr&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=rc&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=rc&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=rc&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
|
+
## Documentation
|
|
63
|
+
- [General Installation](https://rc.css.master.co/docs/installation/general)
|
|
64
|
+
- [Using CDNs](https://rc.css.master.co/docs/installation/cdn)
|
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MasterCSS } from '@master/css';
|
|
2
|
+
import type { Config } from '@master/css';
|
|
3
|
+
import './types/global';
|
|
4
|
+
export declare class CSSRuntime extends MasterCSS {
|
|
5
|
+
root: Document | ShadowRoot | undefined | null;
|
|
6
|
+
customConfig: Config;
|
|
7
|
+
readonly host: Element;
|
|
8
|
+
readonly observing = false;
|
|
9
|
+
readonly container: HTMLElement | ShadowRoot;
|
|
10
|
+
observer?: MutationObserver | null;
|
|
11
|
+
constructor(root?: Document | ShadowRoot | undefined | null, customConfig?: Config);
|
|
12
|
+
/**
|
|
13
|
+
* Observe the DOM for changes and update the running stylesheet. (browser only)
|
|
14
|
+
* @param options mutation observer options
|
|
15
|
+
* @returns this
|
|
16
|
+
*/
|
|
17
|
+
observe(options?: MutationObserverInit): this;
|
|
18
|
+
refresh(customConfig?: Config): this;
|
|
19
|
+
reset(): this;
|
|
20
|
+
disconnect(): this;
|
|
21
|
+
destroy(): this;
|
|
22
|
+
}
|
|
23
|
+
export declare const cssRuntimes: CSSRuntime[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var Y={"(":")","'":"'",'"':'"',"{":"}"};function se(e){if(typeof CSS<"u")return CSS.escape(e);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let a=String(e),i=a.length,n=-1,c="",r,o=a.charCodeAt(0);if(i==1&&o==45)return"\\"+a;for(;++n<i;){if(r=a.charCodeAt(n),r==0){c+="\uFFFD";continue}if(r>=1&&r<=31||r==127||n==0&&r>=48&&r<=57||n==1&&r>=48&&r<=57&&o==45){c+="\\"+r.toString(16)+" ";continue}if(r>=128||r==45||r==95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){c+=a.charAt(n);continue}c+="\\"+a.charAt(n)}return c}var me=(e=>(e[e.Semantic=-8]="Semantic",e[e.CoreNativeShorthand=-7]="CoreNativeShorthand",e[e.NativeShorthand=-6]="NativeShorthand",e[e.CoreShorthand=-5]="CoreShorthand",e[e.Shorthand=-4]="Shorthand",e[e.CoreNative=-3]="CoreNative",e[e.Native=-2]="Native",e[e.Core=-1]="Core",e[e.Normal=0]="Normal",e))(me||{}),oe=/^([+-]?(?:\d+(?:\.?\d+)?|\.\d+))x$/m,pe=/^(media|supports|page|font-face|keyframes|counter-style|font-feature-values|property|layer)(?=\||{|\(|$)/,ye=class{constructor(e,a,i){this.className=e,this.css=i,Object.assign(this,a);let{id:n,definition:c}=a,{analyze:r,transformValue:o,declare:f,transformValueComponents:y,create:u,layer:d,unit:g,colored:m}=c;this.layer=d,this.colored=!!m,c.unit||(c.unit=""),c.separators||(c.separators=[","]);let{scope:l,important:h,themeDriver:s}=i.config,{selectors:t,mediaQueries:p,stylesBy:v,animations:w}=i,R=v[e];u&&u.call(this,e),this.declarations=c.declarations;let b,S;if(d===-8)b=e.slice(n.length-1);else{let N;if(r)[N,S]=r.call(this,e);else{let C=e.indexOf(":");this.prefix=e.slice(0,C+1),N=e.slice(C+1)}this.valueComponents=[],b=N.slice(this.parseValue(this.valueComponents,0,N,g,"",void 0,!1,n==="animation"||n==="animation-name"?Object.keys(this.css.animations):[]))}b[0]==="!"&&(this.important=!0,b=b.slice(1)),this.stateToken=b;let k=(N,C)=>{let P=(x,V,O,z)=>{for(let[E,M]of V)if(E.test(x)){for(let B of M)P(x.replace(E,B),V,O,!0);return}z&&O.push(x)},T=x=>{let V=x.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((M,B)=>B%3?M:M.replace(/(^|[^_])_(?!_)/g,"$1 ")).join(""),O=[],z="",E=0;for(let M=0;M<V.length;M++){let B=V[M];if(B==="\\"){z+=B+V[++M];continue}!E&&B===","?(O.push(z),z=""):(z+=B,E&&B===")"?E--:B==="("&&E++)}return z&&O.push(z),O},A=[];""in t?P(N,t[""],A,!0):A.push(N);let W={};for(let[x,V]of Object.entries(t)){if(!x)continue;let O=[];for(let z of A)P(z,V,O,!1);O.length&&(W[x]=O)}let D=(x,V)=>{let O=V.reduce((z,E)=>(z.push(...T(E)),z),[]);x in C?C[x].push(...O):C[x]=O},U=Object.keys(W);if(U.length)for(let x of U)D(x,W[x]);else D("",A)};S?(this.vendorPrefixSelectors={},k(S,this.vendorPrefixSelectors)):this.vendorPrefixSelectors={"":[""]};let $=b.split("@"),j=$[0];if(j){this.vendorSuffixSelectors={},k(j,this.vendorSuffixSelectors);for(let N of Object.values(this.vendorSuffixSelectors))for(let C of N){this.hasWhere!==!1&&(this.hasWhere=C.includes(":where("));let P=[":disabled",":active",":focus",":hover"];for(let T=0;T<P.length;T++)if(C.includes(P[T])){(this.priority===-1||this.priority>T)&&(this.priority=T);break}}}else this.vendorSuffixSelectors={"":[""]};let _={},fe=Object.prototype.hasOwnProperty.call(this.vendorPrefixSelectors,""),ie=Object.prototype.hasOwnProperty.call(this.vendorSuffixSelectors,"");if(fe)_[""]=ie?[""]:Object.keys(this.vendorSuffixSelectors);else if(ie)for(let N in this.vendorPrefixSelectors)_[N]=[""];else for(let N in this.vendorPrefixSelectors){let C=_[N]=[];if(Object.prototype.hasOwnProperty.call(this.vendorSuffixSelectors,N))C.push(N);else for(let P in this.vendorSuffixSelectors)C.push(P)}for(let N=1;N<$.length;N++){let C=$[N];if(C)if(C==="rtl"||C==="ltr")this.direction=C;else{let P="",T,A=pe.exec(C);if(A)P=A[1],T=C.slice(P.length);else{this.media={token:C,features:{}};let W=[],D=x=>{if(x==="all"||x==="print"||x==="screen"||x==="speech")this.media.type=x;else if(x==="\u{1F5A8}")this.media.type="print";else if(x==="landscape"||x==="portrait")W.push("(orientation:"+x+")");else if(x==="motion"||x==="reduced-motion")W.push("(prefers-reduced-motion:"+(x==="motion"?"no-preference":"reduce")+")");else{let V=p[x];if(V&&typeof V=="string")W.push(V);else{let O="",z="",E=0;x.startsWith("<=")?(z="<=",O="max-width"):x.startsWith(">=")||V?(z=">=",O="min-width"):x.startsWith(">")?(z=">",O="min-width",E=.02):x.startsWith("<")&&(z="<",O="max-width",E=-.02);let M=z?x.replace(z,""):x,B=p[M];switch(O){case"max-width":case"min-width":let I={};typeof B=="number"?I={type:"number",value:B+E,unit:"px"}:(I=this.parseValueComponent(M,"px"),I.type==="number"&&I.unit==="px"&&(I.value+=E)),this.media.features[O]=I,I.type==="number"?W.push("("+O+":"+(I.value+I.unit)+")"):W.push("("+O+":"+I.value+")");break}}}},U=C.includes("&");if(U){let x=C.split("&");for(let V of x)D(V)}else D(C);if(this.media.type&&(T=this.media.type),W.length&&(T=W.join(" and ")),T)P="media";else if(!U){this.theme=C;continue}}T&&(this.at[P]=(P in this.at?this.at[P]+" and ":"")+T.replace(/\|/g," "))}}let Q;this.valueComponents&&(y&&(this.valueComponents=y.call(this,this.valueComponents)),Q=this.resolveValue(this.valueComponents,g,[],!1),o&&(Q=o.call(this,Q)),f?this.declarations=f.call(this,Q,this.valueComponents):n&&(this.declarations={[n]:Q}));let ee=[];for(let N in this.declarations){let C=A=>{if(w&&(A.startsWith("animation")||A.startsWith("animation-name"))){let W=A.split(":")[1].split("!important")[0].split(" ").filter(D=>D in this.css.animations&&(!this.animationNames||!this.animationNames.includes(D)));W.length&&(this.animationNames||(this.animationNames=[]),this.animationNames=W)}ee.push(A+((this.important||h)&&!A.endsWith("!important")?"!important":""))},P=N+":",T=this.declarations[N];if(Array.isArray(T))for(let A of T)C(P+String(A));else C(P+String(T))}if(ee.length)for(let N in _)for(let C of _[N]){let P="";this.direction&&(P+="[dir="+this.direction+"] ");let T=this.vendorPrefixSelectors[N],A=this.vendorSuffixSelectors[C],W=T.map(x=>x+P),D=x=>W.map(V=>(this.theme&&s!=="media"?s==="host"?`:host(.${this.theme}) `:`.${this.theme} `:"")+(l?l+" ":"")+V).reduce((V,O)=>(V.push(A.reduce((z,E)=>(z.push(O+"."+se(x)+E),z),[]).join(",")),V),[]).join(","),U=D(e)+(R?R.reduce((x,V)=>x+","+D(V),""):"")+"{"+ee.join(";")+"}";for(let x of Object.keys(this.at).sort((V,O)=>O==="supports"?-1:1))U="@"+x+(x.includes(" ")?"":" ")+this.at[x]+"{"+U+"}";this.theme&&s==="media"&&(U=`@media(prefers-color-scheme:${this.theme}){`+U+"}"),this.natives.push({text:U})}}at={};priority=-1;natives=[];order=0;layer=0;stateToken;declarations;animationNames;variableNames;resolveValue=(e,a,i,n)=>{let{functions:c}=this.css.config,r="";for(let o of e)switch(o.type){case"function":let f=c&&c[o.name];if(f?.transform&&!o.bypassTransform){let u=f.transform.call(this,this.resolveValue(o.children,f.unit??a,i,n||o.name==="calc"),i);r+=o.text=typeof u=="string"?u:this.resolveValue(u,f?.unit??a,i,n)}else r+=o.text=o.name+o.symbol+this.resolveValue(o.children,f?.unit??a,i,n)+Y[o.symbol];break;case"variable":let y=this.css.variables[o.name];if(y){let u=(d,g)=>{if(y.themes)if(this.theme){let m=y.themes[this.theme]??y;m?.value&&d(m)}else this.variableNames||(this.variableNames=[]),this.variableNames.includes(o.name)||this.variableNames.push(o.name),g();else d(y)};switch(y.type){case"string":u(g=>{let m=[];this.parseValue(m,0,g.value,a,"",void 0,n,[...i,o.name]),r+=o.text=this.resolveValue(m,a,[...i,o.name],n)},()=>{r+=o.text=`var(--${o.name})`});break;case"number":u(g=>{if(n)r+=o.text=g.value;else{let m=this.parseValueComponent(g.value,a);r+=o.text=m.value+(m.unit??"")}},()=>{r+=o.text=a?`calc(var(--${o.name}) / 16 * 1rem)`:`var(--${o.name})`});break;case"color":let d=o.alpha?"/"+o.alpha:"";u(g=>{r+=o.text=`${g.space}(${g.value}${d})`},()=>{r+=o.text=`${y.space}(var(--${o.name})${d})`});break}}else r+=o.text=`var(--${o.name}${o.fallback?","+o.fallback:""})`;break;case"separator":r+=o.text?o.text:o.text=o.value;break;case"number":r+=o.text=o.value+(o.unit||"");break;default:r+=o.text=o.value;break}return r};get text(){return this.natives.map(e=>e.text).join("")}parseValue=(e,a,i,n,c,r,o=!1,f=[])=>{let y=r===void 0,u=!y&&(r.endsWith("$")||r.endsWith("var")),d=(h=>h==="'"||h==='"')(c),g=[","];this.definition.separators?.length&&g.push(...this.definition.separators);let m="",l=()=>{if(m){let h=!1;if(!u||e.length){let s=(t,p)=>{let v=Object.prototype.hasOwnProperty.call(this.variables,t)?this.variables[t]:Object.prototype.hasOwnProperty.call(this.css.variables,t)?this.css.variables[t]:void 0;if(v){let w=v.name??t;if(!f.includes(w)){h=!0;let R={type:"variable",name:w,variable:this.css.variables[w]};p&&(R.alpha=p),e.push(R)}}};if(s(m),!h&&this.colored){let[t,p]=m.split("/");s(t,p)}}if(!h){if(!u){let s=oe.exec(m);s&&(m=String(+s[1]*(this.css.config.baseUnit??1)))}o?e.push({type:"string",value:m}):e.push(this.parseValueComponent(m,n))}m=""}};for(;a<i.length;a++){let h=i[a];if(h===c){if(d){let s=0;for(let t=m.length-1;m[t]==="\\";t--)s++;if(s%2){m+=h;continue}else l()}else l();return a}else if(!d&&h in Y){let s=m,t={type:"function",name:s,symbol:h,children:[]};e.push(t),m="";let p=h==="("?this.css.config.functions?.[s]:void 0;!this.colored&&p?.colored&&(this.colored=!0),a=this.parseValue(t.children,++a,i,p?.unit??n,Y[h],s||r||"",o||s==="calc")}else if((h==="|"||h===" ")&&c!=="}"&&(!d||r==="path"))l(),e.push({type:"separator",value:" "});else{if(!d){if(h===".")if(isNaN(+i[a+1])){if(y)break}else i[a-1]==="-"&&(m+="0");else if(g.includes(h)){l(),e.push({type:"separator",value:h,text:(h===","?"":" ")+h+(h===","?"":" ")});continue}else if(y&&(h==="#"&&(m||e.length&&e[e.length-1].type!=="separator")||["!","*",">","+","~",":","[","@","_"].includes(h)))break}m+=h}}return l(),a};parseValueComponent(e,a=this.definition.unit){let i=a??this.definition.unit,n="",c;if(typeof e=="number")return i&&!n?((i==="rem"||i==="em")&&(c=e/(this.css.config.rootSize||1)),n=i||""):c=e,{value:c,unit:n,type:"number"};if(i){if(/^\d+\/\d+/.test(e)){let[o,f]=e.split("/");return{value:+o/+f*100,unit:"%",type:"number"}}let r=e.match(/^([+-.]?\d+(\.?\d+)?)(%|cm|mm|q|in|pt|pc|px|em|rem|ex|rex|cap|rcap|ch|rch|ic|ric|lh|rlh|vw|svw|lvw|dvw|vh|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax|cqw|cqh|cqi|cqb|cqmin|cqmax|deg|grad|rad|turn|s|ms|hz|khz|dpi|dpcm|dppx|x|fr|db|st)?$/);if(r)return c=+r[1],n=r[3]||"",n||((i==="rem"||i==="em")&&(c=c/(this.css.config.rootSize||1)),n=i||""),{value:c,unit:n,type:"number"}}return{value:e,type:"string"}}},ne={"4xs":360,"3xs":480,"2xs":600,xs:768,sm:834,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},be={"::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(",":only":":only-child"},ge=be,ve={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"},fit:{width:"fit-content",height:"fit-content"}},xe=ve,we={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"}}},ke=we,Se={full:"100%",fit:"fit-content",max:"max-content",min:"min-content","font-family":{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"]},screen:ne,"font-weight":{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900},"flex-direction":{col:"column","col-reverse":"column-reverse"},"box-sizing":{content:"content-box",border:"border-box"},position:{abs:"absolute",rel:"relative"},"transform-box":{content:"content-box",border:"border-box",padding:"padding-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"},"animation-direction":{alt:"alternate","alt-reverse":"alternate-reverse"},"background-clip":{content:"content-box",border:"border-box",padding:"padding-box"},"background-origin":{content:"content-box",border:"border-box",padding:"padding-box"},order:{first:-999999,last:999999},"shape-outside":{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box"},"clip-path":{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box",black:"#000000"},current:"currentColor",text:{strong:{"@light":"$(slate-95)","@dark":"$(gray-10)"},neutral:{"@light":"$(slate-70)","@dark":"$(gray-30)"},lightest:{"@light":"$(slate-30)","@dark":"$(gray-60)"},lighter:{"@light":"$(slate-40)","@dark":"$(gray-50)"},light:{"@light":"$(slate-50)","@dark":"$(gray-40)"},gray:{"@light":"$(gray-60)","@dark":"$(gray-30)"},slate:{"@light":"$(slate-60)","@dark":"$(slate-30)"},brown:{"@light":"$(brown-60)","@dark":"$(brown-30)"},orange:{"@light":"$(orange-60)","@dark":"$(orange-30)"},amber:{"@light":"$(amber-60)","@dark":"$(amber-40)"},yellow:{"@light":"$(yellow-60)","@dark":"$(yellow-40)"},lime:{"@light":"$(lime-60)","@dark":"$(lime-40)"},green:{"@light":"$(green-60)","@dark":"$(green-40)"},beryl:{"@light":"$(beryl-60)","@dark":"$(beryl-40)"},teal:{"@light":"$(teal-60)","@dark":"$(teal-40)"},cyan:{"@light":"$(cyan-60)","@dark":"$(cyan-40)"},sky:{"@light":"$(sky-60)","@dark":"$(sky-30)"},blue:{"@light":"$(blue-60)","@dark":"$(blue-30)"},indigo:{"@light":"$(indigo-60)","@dark":"$(indigo-30)"},violet:{"@light":"$(violet-60)","@dark":"$(violet-30)"},purple:{"@light":"$(purple-60)","@dark":"$(purple-30)"},fuchsia:{"@light":"$(fuchsia-60)","@dark":"$(fuchsia-30)"},pink:{"@light":"$(pink-60)","@dark":"$(pink-30)"},crimson:{"@light":"$(crimson-60)","@dark":"$(crimson-30)"},red:{"@light":"$(red-60)","@dark":"$(red-30)"}},base:{"@light":"$(white)","@dark":"$(gray-95)"},canvas:{"@light":"$(slate-5)","@dark":"$(gray-90)"},surface:{"@light":"$(white)","@dark":"$(gray-80)"},white:"#ffffff",black:"#000000",frame:{"@light":"$(slate-60)","@dark":"$(gray-30)"},gray:{5:"#f6f5f7",10:"#efeef0",20:"#cdccce",30:"#a2a1a3",40:"#89888A",50:"#737274",60:"#585759",70:"#444345",80:"#323133",90:"#29282a",95:"#222123","":{"@light":"$(gray-30)","@dark":"$(gray-40)"}},slate:{5:"#f8f9fb",10:"#eff2f9",20:"#c8d0e3",30:"#9fabc6",40:"#7c8cab",50:"#5f7395",60:"#455572",70:"#37455d",80:"#283348",90:"#1d273a",95:"#182030","":{"@light":"$(slate-30)","@dark":"$(slate-40)"}},brown:{5:"#fff6f0",10:"#feefe3",20:"#f3bea4",30:"#e7976e",40:"#da7c4d",50:"#cc6633",60:"#b65325",70:"#9d4119",80:"#833111",90:"#692007",95:"#431304","":{"@light":"$(brown-40)","@dark":"$(brown-50)"}},orange:{5:"#fff5ea",10:"#fff5df",20:"#ffcb9e",30:"#ff9b47",40:"#ff8528",50:"#ff6c0a",60:"#e05200",70:"#bc3e00",80:"#992d00",90:"#701d00",95:"#471100","":{"@light":"$(orange-40)","@dark":"$(orange-50)"}},amber:{5:"#fff9eb",10:"#fff4db",20:"#ffe099",30:"#ffc133",40:"#ffb10a",50:"#f99e00",60:"#e57e00",70:"#c15d00",80:"#a34900",90:"#753200",95:"#4c1f00","":{"@light":"$(amber-40)","@dark":"$(amber-50)"}},yellow:{5:"#fffae5",10:"#fffed1",20:"#ffe993",30:"#ffd233",40:"#ffc300",50:"#efaf00",60:"#d69200",70:"#b77400",80:"#9e5c00",90:"#753c00",95:"#4c2600","":{"@light":"$(yellow-40)","@dark":"$(yellow-50)"}},lime:{5:"#f5ffe5",10:"#f5ffd6",20:"#d1fb8d",30:"#acec46",40:"#91d91a",50:"#77c012",60:"#61a60c",70:"#4c8d07",80:"#367604",90:"#256000",95:"#1b3d00","":{"@light":"$(lime-40)","@dark":"$(lime-50)"}},green:{5:"#e7fdea",10:"#dbfee4",20:"#a5f7b8",30:"#35ed66",40:"#00d655",50:"#00c147",60:"#00ad3f",70:"#008e34",80:"#007a2c",90:"#006023",95:"#003d16","":{"@light":"$(green-40)","@dark":"$(green-50)"}},beryl:{5:"#e0fef2",10:"#d2fff7",20:"#6cffd4",30:"#0fefa4",40:"#04e09e",50:"#04cb8f",60:"#00b277",70:"#009360",80:"#007f50",90:"#00663e",95:"#003d24","":{"@light":"$(beryl-40)","@dark":"$(beryl-50)"}},teal:{5:"#dbfefd",10:"#cfffff",20:"#7ffff6",30:"#00f4e4",40:"#00e4d4",50:"#00ccc8",60:"#00aeb7",70:"#0092a3",80:"#00798e",90:"#005d75",95:"#003747","":{"@light":"$(teal-40)","@dark":"$(teal-50)"}},cyan:{5:"#e0ffff",10:"#d1ffff",20:"#7ff6ff",30:"#1ee1ff",40:"#00ccf9",50:"#00b3ea",60:"#0099d6",70:"#007dbc",80:"#0067a8",90:"#005089",95:"#003156","":{"@light":"$(cyan-40)","@dark":"$(cyan-50)"}},sky:{5:"#e5f5ff",10:"#d9f8ff",20:"#a3deff",30:"#6bc6ff",40:"#34b2fd",50:"#059fff",60:"#008df9",70:"#0073e0",80:"#005cc6",90:"#0041a3",95:"#002566","":{"@light":"$(sky-60)","@dark":"$(sky-50)"}},blue:{5:"#e5f3fe",10:"#dbf2fe",20:"#add7ff",30:"#70b0ff",40:"#4c93fd",50:"#3a7cff",60:"#2563fd",70:"#1b53ec",80:"#1947d1",90:"#1735a2",95:"#102069","":{"@light":"$(blue-60)","@dark":"$(blue-50)"}},indigo:{5:"#f0f1fe",10:"#e9ecfe",20:"#c8cdfe",30:"#939eff",40:"#7e81fe",50:"#7068ff",60:"#5b4cfd",70:"#4e39ed",80:"#4732d2",90:"#3623a3",95:"#26176c","":{"@light":"$(indigo-60)","@dark":"$(indigo-50)"}},violet:{5:"#f2efff",10:"#efe8ff",20:"#d7c5ff",30:"#b198fe",40:"#9a70ff",50:"#8e56fe",60:"#812fff",70:"#7407f2",80:"#6405d1",90:"#4f05a3",95:"#35036e","":{"@light":"$(violet-60)","@dark":"$(violet-50)"}},purple:{5:"#f6f0ff",10:"#f6e8fe",20:"#e2bffe",30:"#c492fd",40:"#b266ff",50:"#a849fe",60:"#9514ff",70:"#8200e5",80:"#7100c1",90:"#58008e",95:"#3e0060","":{"@light":"$(purple-60)","@dark":"$(purple-50)"}},fuchsia:{5:"#faf0ff",10:"#fde8fe",20:"#f0baff",30:"#dd89fe",40:"#d760fe",50:"#cf33ff",60:"#b700e5",70:"#a200c6",80:"#8700a3",90:"#660175",95:"#480051","":{"@light":"$(fuchsia-60)","@dark":"$(fuchsia-50)"}},pink:{5:"#fef1f9",10:"#fee9f8",20:"#ffb8df",30:"#f986c1",40:"#fa65b2",50:"#f747a2",60:"#ef2188",70:"#d61673",80:"#b80c5c",90:"#8f0543",95:"#64032f","":{"@light":"$(pink-60)","@dark":"$(pink-50)"}},crimson:{5:"#ffeff2",10:"#ffe8ec",20:"#ffbac7",30:"#ff849d",40:"#ff6684",50:"#fc4065",60:"#ed2a51",70:"#d7173e",80:"#bb1536",90:"#8f132c",95:"#620e1f","":{"@light":"$(crimson-60)","@dark":"$(crimson-50)"}},red:{5:"#ffefef",10:"#fee8e8",20:"#ffbcbc",30:"#ff8787",40:"#fd5f5f",50:"#f73f3f",60:"#e52e2e",70:"#d01b1b",80:"#b81919",90:"#921515",95:"#650f0f","":{"@light":"$(red-60)","@dark":"$(red-50)"}}},$e=Se,L=["none","auto","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"],q=function(e){return e.length<2||e.find(a=>a.type==="string"&&L.includes(a.value)||a.type==="variable"&&L.includes(a.variable?.value))||e.push({type:"separator",value:" "},{type:"string",value:"solid"}),e},Re={group:{match:/^(?:.+?[*_>~+])?\{.+?\}/,layer:-1,analyze(e){let a=0;for(;a<e.length&&!(e[a]==="{"&&e[a-1]!=="\\");a++);return[e.slice(a),e.slice(0,a)]},declare(e){let a={},i=y=>{let u=y.indexOf(":");if(u!==-1){let d=y.slice(0,u);a[d]=y.slice(u+1)}},n=y=>{let u=d=>{let g=d.slice(se(y.className).length).match(/\{(.*)\}/)?.[1].split(";");if(g)for(let m of g)i(m)};for(let d of y.natives)u(d.text);if(y.animationNames){this.animationNames||(this.animationNames=[]);for(let d of y.animationNames)this.animationNames.includes(d)||this.animationNames.push(d)}if(y.variableNames){this.variableNames||(this.variableNames=[]);for(let d of y.variableNames)this.variableNames.includes(d)||this.variableNames.push(d)}},c=[],r="",o=()=>{r&&(c.push(r.replace(/ /g,"|")),r="")},f=1;(function y(u){for(;f<e.length;f++){let d=e[f];if(!u){if(d===";"){o();continue}if(d==="}")break}if(r+=d,u===d){if(u==="'"||u==='"'){let g=0;for(let m=r.length-2;r[m]==="\\";m--)g++;if(g%2)continue}break}else d in Y&&u!=="'"&&u!=='"'&&(f++,y(Y[d]))}})(""),o();for(let y of c){let u=this.css.generate(y);if(u.length)for(let d of u)n(d);else i(y)}return a}},variable:{match:/^\$[\w-]+:/,colored:!0,layer:-1,declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},"font-size":{match:["f(?:ont)?"],numeric:!0,unit:"rem",layer:-3},"font-weight":{match:["f(?:ont)?",["bolder"]],layer:-3},"font-family":{match:["f(?:ont)?"],layer:-3},"font-smoothing":{match:["f(?:ont)?",["antialiased","subpixel-antialiased"]],layer:-3,declare(e){switch(e){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"}}}},"font-style":{match:["f(?:ont)?",["normal","italic","oblique"]],layer:-3,unit:"deg"},"font-variant-numeric":{match:["f(?:ont)?",["ordinal","slashed-zero","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions"]],layer:-3},"font-variant":{layer:-7},"font-feature-settings":{match:/^font-feature:/,layer:-3},font:{match:/^f:/,layer:-7,variables:["font-family","font-variant","font-weight","font-size","font-style","line-height"]},color:{match:/^(?:color|fg):/,layer:-3,colored:!0,variables:["text"]},"margin-left":{match:/^ml:/,layer:-3,unit:"rem",variables:["spacing"]},"margin-right":{match:/^mr:/,layer:-3,unit:"rem",variables:["spacing"]},"margin-top":{match:/^mt:/,layer:-3,unit:"rem",variables:["spacing"]},"margin-bottom":{match:/^mb:/,layer:-3,unit:"rem",variables:["spacing"]},"margin-x":{match:/^(?:mx|margin-x):/,unit:"rem",layer:-5,declare(e){return{"margin-left":e,"margin-right":e}},variables:["spacing"]},"margin-y":{match:/^(?:my|margin-y):/,unit:"rem",layer:-5,declare(e){return{"margin-top":e,"margin-bottom":e}},variables:["spacing"]},margin:{match:/^m:/,unit:"rem",layer:-7,variables:["spacing"]},"margin-inline-start":{match:/^mis:/,layer:-3,unit:"rem",variables:["spacing"]},"margin-inline-end":{match:/^mie:/,layer:-3,unit:"rem",variables:["spacing"]},"margin-inline":{match:/^mi:/,unit:"rem",layer:-7,variables:["spacing"]},"padding-left":{match:/^pl:/,layer:-3,unit:"rem",variables:["spacing"]},"padding-right":{match:/^pr:/,layer:-3,unit:"rem",variables:["spacing"]},"padding-top":{match:/^pt:/,layer:-3,unit:"rem",variables:["spacing"]},"padding-bottom":{match:/^pb:/,layer:-3,unit:"rem",variables:["spacing"]},"padding-x":{match:/^(?:px|padding-x):/,unit:"rem",layer:-5,declare(e){return{"padding-left":e,"padding-right":e}},variables:["spacing"]},"padding-y":{match:/^(?:py|padding-y):/,unit:"rem",layer:-5,declare(e){return{"padding-top":e,"padding-bottom":e}},variables:["spacing"]},padding:{match:/^p:/,unit:"rem",layer:-7,variables:["spacing"]},"padding-inline-start":{match:/^pis:/,layer:-3,unit:"rem",variables:["spacing"]},"padding-inline-end":{match:/^pie:/,layer:-3,unit:"rem",variables:["spacing"]},"padding-inline":{match:/^pi:/,unit:"rem",layer:-7,variables:["spacing"]},"flex-basis":{unit:"rem",layer:-3},"flex-wrap":{match:["flex",["wrap","nowrap","wrap-reverse"]],layer:-3},"flex-grow":{layer:-3},"flex-shrink":{layer:-3},"flex-direction":{match:["flex",["row","row-reverse","column","column-reverse"]],layer:-3},flex:{layer:-7},display:{match:/^d:/,layer:-3},width:{match:/^w:/,unit:"rem",layer:-3},height:{match:/^h:/,unit:"rem",layer:-3},"min-width":{match:/^min-w:/,unit:"rem",layer:-3},"min-height":{match:/^min-h:/,unit:"rem",layer:-3},size:{match:/^size:/,layer:-5,unit:"rem",declare(e,a){let i=a.length;return{width:a[0].text,height:i===1?a[0].text:a[2].text}}},"min-size":{match:/^min:/,layer:-5,unit:"rem",declare(e,a){let i=a.length;return{"min-width":a[0].text,"min-height":i===1?a[0].text:a[2].text}}},"max-size":{match:/^max:/,layer:-5,unit:"rem",declare(e,a){let i=a.length;return{"max-width":a[0].text,"max-height":i===1?a[0].text:a[2].text}}},"box-sizing":{match:/^box:/,layer:-3},"box-decoration-break":{match:["box-decoration",["slice","clone"]],layer:-3,declare(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},contain:{layer:-3},content:{layer:-3},"counter-increment":{layer:-3},"counter-reset":{layer:-3},"letter-spacing":{match:/^ls:/,layer:-3,unit:"em"},"line-height":{match:/^lh:/,layer:-3},"object-fit":{match:["(?:object|obj)",["contain","cover","fill","scale-down"]],layer:-3},"object-position":{match:["(?:object|obj)",["top","bottom","right","left","center"]],layer:-3},"text-align":{match:["t(?:ext)?",["justify","center","left","right","start","end"]],layer:-3},"text-decoration-color":{match:["text-decoration"],layer:-3,colored:!0,variables:["text"]},"text-decoration-style":{match:["t(?:ext)?",["solid","double","dotted","dashed","wavy"]],layer:-3},"text-decoration-thickness":{match:["text-decoration",["from-font"]],numeric:!0,layer:-3,unit:"em"},"text-decoration-line":{match:["t(?:ext)?",["none","underline","overline","line-through"]],layer:-3},"text-decoration":{match:["t(?:ext)?",["underline","overline","line-through"]],unit:"rem",colored:!0,layer:-7,variables:["text"]},"text-underline-offset":{unit:"rem",layer:-3,variables:["spacing"]},"text-overflow":{match:["t(?:ext)?",["ellipsis","clip"]],layer:-3},"text-orientation":{match:["t(?:ext)?",["mixed","upright","sideways-right","sideways","use-glyph-orientation"]],layer:-3},"text-transform":{match:["t(?:ext)?",["uppercase","lowercase","capitalize"]],layer:-3},"text-rendering":{match:["t(?:ext)?",["optimizeSpeed","optimizeLegibility","geometricPrecision"]],layer:-3},"text-indent":{unit:"rem",layer:-3},"vertical-align":{match:/^(?:v|vertical):/,layer:-3},columns:{match:/^(?:columns|cols):/,layer:-7},"white-space":{layer:-3},top:{layer:-3,unit:"rem",variables:["spacing"]},bottom:{layer:-3,unit:"rem",variables:["spacing"]},left:{layer:-3,unit:"rem",variables:["spacing"]},right:{layer:-3,unit:"rem",variables:["spacing"]},inset:{unit:"rem",layer:-7,variables:["spacing"]},lines:{match:/^lines:/,declare(e){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e}}},"max-height":{match:/^max-h:/,unit:"rem",layer:-3},"max-width":{match:/^max-w:/,unit:"rem",layer:-3},opacity:{layer:-3},visibility:{layer:-3},clear:{layer:-3},float:{layer:-3},isolation:{layer:-3},"overflow-x":{layer:-3,declare(e){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},"overflow-y":{layer:-3,declare(e){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{layer:-7,declare(e){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},"overscroll-behavior-x":{layer:-3},"overscroll-behavior-y":{layer:-3},"overscroll-behavior":{layer:-7},"z-index":{match:/^z:/,layer:-3},position:{layer:-3},cursor:{layer:-3},"pointer-events":{layer:-3},resize:{layer:-3},"touch-action":{layer:-3},"word-break":{layer:-3},"word-spacing":{layer:-3,unit:"em"},"user-drag":{layer:-3,declare(e){return{"user-drag":e,"-webkit-user-drag":e}}},"user-select":{layer:-3,declare(e){return{"user-select":e,"-webkit-user-select":e}}},"text-shadow":{unit:"rem",layer:-3,colored:!0},"text-size":{match:["t(?:ext)?"],numeric:!0,unit:"rem",declare(e){return{"font-size":e,"line-height":`calc(${e} + ${.875}em)`}}},"text-fill-color":{match:["(?:text-fill|text|t)"],layer:-3,colored:!0,variables:["text"],declare(e){return{"-webkit-text-fill-color":e}}},"text-stroke-width":{match:["text-stroke",["thin","medium","thick"]],numeric:!0,unit:"rem",layer:-3,declare(e){return{"-webkit-text-stroke-width":e}}},"text-stroke-color":{match:["text-stroke"],layer:-3,colored:!0,variables:["text"],declare(e){return{"-webkit-text-stroke-color":e}}},"text-stroke":{unit:"rem",layer:-3,declare(e){return{"-webkit-text-stroke":e}}},"box-shadow":{match:/^s(?:hadow)?:/,unit:"rem",layer:-3,colored:!0},"table-layout":{layer:-3},"transform-box":{match:["transform"],layer:-3},"transform-style":{match:["transform",["flat","preserve-3d"]],layer:-3},"transform-origin":{match:["transform",["top","bottom","right","left","center"]],numeric:!0,unit:"px",layer:-3},transform:{match:/^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\(/,layer:-3,analyze(e){return[e.startsWith("transform")?e.slice(10):e]},variables:["spacing"]},"transition-property":{match:/^~property:/,layer:-3},"transition-timing-function":{match:/^~easing:/,layer:-3},"transition-duration":{match:/^~duration:/,layer:-3,unit:"ms"},"transition-delay":{match:/^~delay:/,layer:-3,unit:"ms"},transition:{match:/^~[^!*>+~:[@_]+\|/,analyze(e){if(e.startsWith("~"))return[e.slice(1)];{let a=e.indexOf(":");return this.prefix=e.slice(0,a+1),[e.slice(a+1)]}},layer:-7},"animation-delay":{match:/^@delay:/,layer:-3,unit:"ms"},"animation-direction":{match:/^@direction:/,layer:-3},"animation-duration":{match:/^@duration:/,layer:-3,unit:"ms"},"animation-fill-mode":{match:/^@fill:/,layer:-3},"animation-iteration-count":{match:/^@iteration:/,layer:-3},"animation-name":{match:/^@name:/,layer:-3},"animation-play-state":{match:/^@play:/,layer:-3},"animation-timing-function":{match:/^@easing:/,layer:-3},animation:{match:/^@[^!*>+~:[@_]+\|/,layer:-7,analyze(e){if(e.startsWith("@"))return[e.slice(1)];{let a=e.indexOf(":");return this.prefix=e.slice(0,a+1),[e.slice(a+1)]}}},"border-collapse":{match:["b(?:order)?",["collapse","separate"]],layer:-3},"border-spacing":{unit:"rem",layer:-3},"border-top-color":{match:["b(?:t|order-top(?:-color)?)"],layer:-3,colored:!0},"border-bottom-color":{match:["b(?:b|order-bottom(?:-color)?)"],layer:-3,colored:!0},"border-left-color":{match:["b(?:l|order-left(?:-color)?)"],layer:-3,colored:!0},"border-right-color":{match:["b(?:r|order-right(?:-color)?)"],layer:-3,colored:!0},"border-x-color":{match:["b(?:x|order-x(?:-color)?)"],layer:-5,colored:!0,declare(e){return{"border-left-color":e,"border-right-color":e}}},"border-y-color":{match:["b(?:y|order-y(?:-color)?)"],layer:-5,colored:!0,declare(e){return{"border-top-color":e,"border-bottom-color":e}}},"border-color":{match:["b(?:order)?(?:-color)?"],layer:-7,colored:!0},"border-top-left-radius":{match:/^r(?:tl|lt):/,unit:"rem",layer:-3},"border-top-right-radius":{match:/^r(?:tr|rt):/,unit:"rem",layer:-3},"border-bottom-left-radius":{match:/^r(?:bl|lb):/,unit:"rem",layer:-3},"border-bottom-right-radius":{match:/^r(?:br|rb):/,unit:"rem",layer:-3},"border-top-radius":{match:/^rt:/,unit:"rem",layer:-5,declare(e){return{"border-top-left-radius":e,"border-top-right-radius":e}}},"border-bottom-radius":{match:/^rb:/,unit:"rem",layer:-5,declare(e){return{"border-bottom-left-radius":e,"border-bottom-right-radius":e}}},"border-left-radius":{match:/^rl:/,unit:"rem",layer:-5,declare(e){return{"border-top-left-radius":e,"border-bottom-left-radius":e}}},"border-right-radius":{match:/^rr:/,unit:"rem",layer:-5,declare(e){return{"border-top-right-radius":e,"border-bottom-right-radius":e}}},"border-radius":{match:/^r:/,unit:"rem",layer:-7},"border-top-style":{match:["b(?:t|order-top(?:-style)?)",L],layer:-3},"border-bottom-style":{match:["b(?:b|order-bottom(?:-style)?)",L],layer:-3},"border-left-style":{match:["b(?:l|order-left(?:-style)?)",L],layer:-3},"border-right-style":{match:["b(?:r|order-right(?:-style)?)",L],layer:-3},"border-x-style":{match:["b(?:x|order-x(?:-style)?)",L],layer:-5,declare(e){return{"border-left-style":e,"border-right-style":e}}},"border-y-style":{match:["b(?:y|order-y(?:-style)?)",L],layer:-5,declare(e){return{"border-top-style":e,"border-bottom-style":e}}},"border-style":{match:["b(?:order)?(?:-style)?",L],layer:-7},"border-top-width":{match:["b(?:t|order-top(?:-width)?)"],numeric:!0,unit:"rem",layer:-3},"border-bottom-width":{match:["b(?:b|order-bottom(?:-width)?)"],numeric:!0,unit:"rem",layer:-3},"border-left-width":{match:["b(?:l|order-left(?:-width)?)"],numeric:!0,unit:"rem",layer:-3},"border-right-width":{match:["b(?:r|order-right(?:-width)?)"],numeric:!0,unit:"rem",layer:-3},"border-x-width":{match:["b(?:x|order-x(?:-width)?)"],numeric:!0,unit:"rem",layer:-5,declare(e){return{"border-left-width":e,"border-right-width":e}}},"border-y-width":{match:["b(?:y|order-y(?:-width)?)"],numeric:!0,unit:"rem",layer:-5,declare(e){return{"border-top-width":e,"border-bottom-width":e}}},"border-width":{match:["b(?:order)?(?:-width)?"],numeric:!0,unit:"rem",layer:-7},"border-image-outset":{unit:"rem",layer:-3},"border-image-repeat":{match:["border-image",["stretch","repeat","round","space"]],layer:-3},"border-image-slice":{layer:-3},"border-image-source":{match:["border-image",["url","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","conic-gradient"]],layer:-3},"border-image-width":{match:["border-image",["auto"]],numeric:!0,unit:"rem",layer:-3},"border-image":{layer:-7},"border-top":{match:/^bt:/,layer:-7,unit:"rem",colored:!0,transformValueComponents:q},"border-bottom":{match:/^bb:/,layer:-7,unit:"rem",colored:!0,transformValueComponents:q},"border-left":{match:/^bl:/,layer:-7,unit:"rem",colored:!0,transformValueComponents:q},"border-right":{match:/^br:/,layer:-7,unit:"rem",colored:!0,transformValueComponents:q},"border-x":{match:/^(?:bx|border-x):/,unit:"rem",colored:!0,layer:-5,transformValueComponents:q,declare(e){return{"border-left":e,"border-right":e}}},"border-y":{match:/^(?:by|border-y):/,unit:"rem",colored:!0,layer:-5,transformValueComponents:q,declare(e){return{"border-top":e,"border-bottom":e}}},border:{match:/^b:/,unit:"rem",colored:!0,layer:-7,transformValueComponents:q},"background-attachment":{match:["(?:bg|background)",["fixed","local","scroll"]],layer:-3},"background-blend-mode":{layer:-3},"background-color":{match:["(?:bg|background)"],layer:-3,colored:!0},"background-clip":{match:["(?:bg|background)",["text"]],layer:-3,declare(e){return{"-webkit-background-clip":e,"background-clip":e}}},"background-origin":{match:["(?:bg|background)"],layer:-3},"background-position":{match:["(?:bg|background)",["top","bottom","right","left","center"]],layer:-3,unit:"px"},"background-repeat":{match:["(?:bg|background)",["space","round","repeat","no-repeat","repeat-x","repeat-y"]],layer:-3},"background-size":{match:["(?:bg|background)",["auto","cover","contain"]],numeric:!0,unit:"rem",layer:-3},"background-image":{match:["(?:bg|background)",["(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)"]],layer:-3},background:{match:/^bg:/,colored:!0,layer:-7},gradient:{match:/^gradient\(/,layer:-3,colored:!0,declare(e){return{"background-image":"linear-"+e}}},"mix-blend-mode":{match:/^blend:/,layer:-3},"backdrop-filter":{match:/^bd:/,layer:-3,colored:!0,declare(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}}},filter:{match:/^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(/,layer:-3,colored:!0},fill:{match:/^fill:/,layer:-3,colored:!0},"stroke-dasharray":{layer:-3},"stroke-dashoffset":{layer:-3,variables:["spacing"]},"stroke-width":{match:["stroke(?:-width)?"],numeric:!0,layer:-3},stroke:{match:["stroke"],layer:-3,colored:!0},x:{layer:-3,variables:["spacing"]},y:{layer:-3,variables:["spacing"]},cx:{layer:-3,variables:["spacing"]},cy:{layer:-3,variables:["spacing"]},rx:{layer:-3},ry:{layer:-3},"grid-column-start":{match:/^grid-col(?:umn)?-start:/,layer:-3},"grid-column-end":{match:/^grid-col(?:umn)?-end:/,layer:-3},"grid-column":{match:/^grid-col(?:umn)?(?:-span)?:/,layer:-7,transformValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},"grid-columns":{match:/^grid-col(?:umn)?s:/,declare(e){return{display:"grid","grid-template-columns":"repeat("+e+",minmax(0,1fr))"}},layer:-1},"grid-row-start":{layer:-3},"grid-row-end":{layer:-3},"grid-row":{match:/^grid-row-span:/,layer:-7,transformValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},"grid-rows":{match:/^grid-rows:/,declare(e){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+",minmax(0,1fr))"}},layer:-1},"grid-auto-columns":{match:/^grid-auto-cols:/,layer:-3},"grid-auto-flow":{match:/^grid-flow:/,layer:-3},"grid-auto-rows":{layer:-3},"grid-template-areas":{layer:-3},"grid-template-columns":{match:/^grid-template-cols:/,layer:-3,unit:"rem"},"grid-template-rows":{layer:-3,unit:"rem"},"grid-template":{layer:-7},"grid-area":{layer:-7},grid:{layer:-7},"column-gap":{match:/^gap-x:/,unit:"rem",layer:-3,variables:["spacing"]},"row-gap":{match:/^gap-y:/,unit:"rem",layer:-3,variables:["spacing"]},gap:{unit:"rem",layer:-7,variables:["spacing"]},order:{match:/^o:/,layer:-3},"break-inside":{layer:-3},"break-before":{layer:-3},"break-after":{layer:-3},"aspect-ratio":{match:/^aspect:/,layer:-3},"column-span":{match:/^col-span:/,layer:-3},"align-content":{match:/^ac:/,layer:-3},"align-items":{match:/^ai:/,layer:-3},"align-self":{match:/^as:/,layer:-3},"justify-content":{match:/^jc:/,layer:-3},"justify-items":{match:/^ji:/,layer:-3},"justify-self":{match:/^js:/,layer:-3},"place-content":{layer:-7},"place-items":{layer:-7},"place-self":{layer:-7},"list-style-position":{match:["list-style",["inside","outside"]],layer:-3},"list-style-type":{match:["list-style",["disc","decimal"]],layer:-3},"list-style-image":{match:["list-style",["(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)"]],layer:-3},"list-style":{layer:-7},"outline-color":{match:["outline"],layer:-3,colored:!0},"outline-offset":{unit:"rem",layer:-3,variables:["spacing"]},"outline-style":{match:["outline",L],layer:-3},"outline-width":{match:["outline",["medium","thick","thin"]],numeric:!0,unit:"rem",layer:-3},outline:{unit:"rem",layer:-7,colored:!0,variables:["outline-width","outline-style","outline-offset","outline-color"],transformValueComponents:q},"accent-color":{match:/^accent:/,layer:-3,colored:!0},appearance:{layer:-3},"caret-color":{match:/^caret:/,layer:-3,colored:!0,variables:["text"]},"scroll-behavior":{layer:-3},"scroll-margin-left":{match:/^scroll-ml:/,layer:-3,unit:"rem",variables:["spacing"]},"scroll-margin-right":{match:/^scroll-mr:/,layer:-3,unit:"rem",variables:["spacing"]},"scroll-margin-top":{match:/^scroll-mt:/,layer:-3,unit:"rem",variables:["spacing"]},"scroll-margin-bottom":{match:/^scroll-mb:/,layer:-3,unit:"rem",variables:["spacing"]},"scroll-margin-x":{match:/^(?:scroll-margin-x|scroll-mx):/,unit:"rem",layer:-5,declare(e){return{"scroll-margin-left":e,"scroll-margin-right":e}},variables:["spacing"]},"scroll-margin-y":{match:/^(?:scroll-margin-y|scroll-my):/,unit:"rem",layer:-5,declare(e){return{"scroll-margin-top":e,"scroll-margin-bottom":e}},variables:["spacing"]},"scroll-margin":{match:/^scroll-m:/,unit:"rem",layer:-7,variables:["spacing"]},"scroll-padding-left":{match:/^scroll-pl:/,layer:-3,unit:"rem",variables:["spacing"]},"scroll-padding-right":{match:/^scroll-pr:/,layer:-3,unit:"rem",variables:["spacing"]},"scroll-padding-top":{match:/^scroll-pt:/,layer:-3,unit:"rem",variables:["spacing"]},"scroll-padding-bottom":{match:/^scroll-pb:/,layer:-3,unit:"rem",variables:["spacing"]},"scroll-padding-x":{match:/^(?:scroll-padding-x|scroll-px):/,unit:"rem",layer:-5,declare(e){return{"scroll-padding-left":e,"scroll-padding-right":e}},variables:["spacing"]},"scroll-padding-y":{match:/^(?:scroll-padding-y|scroll-py):/,unit:"rem",layer:-5,declare(e){return{"scroll-padding-top":e,"scroll-padding-bottom":e}},variables:["spacing"]},"scroll-padding":{match:/^scroll-p:/,unit:"rem",layer:-7,variables:["spacing"]},"scroll-snap-align":{match:["scroll-snap",["start","end","center"]],layer:-3},"scroll-snap-stop":{match:["scroll-snap",["normal","always"]],layer:-3},"scroll-snap-type":{match:["scroll-snap",["x","y","block","inline","both"]],layer:-3},"will-change":{layer:-3},"writing-mode":{match:/^writing:/,layer:-3},direction:{layer:-3},"shape-outside":{match:["shape",["(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)"]],layer:-3},"shape-margin":{match:["shape"],numeric:!0,unit:"rem",layer:-3,variables:["spacing"]},"shape-image-threshold":{layer:-3},"clip-path":{match:/^clip:/,layer:-3},quotes:{layer:-3},"mask-image":{layer:-3,declare(e){return{"mask-image":e,"-webkit-mask-image":e}}}},Ce=Re,te={$:{colored:!0,transform(e){let a,i,n=e.indexOf(",");return n!==-1?(a=e.slice(0,n),i=e.slice(n+1)):a=e,[{type:"variable",name:a,fallback:i}]}},calc:{transform(e,a){let i=[],n=0,c=(r,o,f,y,u)=>{let d=i!==r,g=[],m=!1,l=!1,h=!1,s=!1,t,p="",v=(b,S="",k="")=>{if(t===!1&&b!==" "&&this.definition.unit&&(t=void 0,s||w()),p){if(!u){let $=oe.exec(p);$&&(p=(+$[1]*(this.css.config.baseUnit??1)).toString())}if(!m&&!f){let $=this.parseValueComponent(p);if(!l&&isNaN(+p)&&$.type==="number"&&(l=!0),s)isNaN(+p)?$.type==="number"?(r.push($),h=!0):r.push($):r.push({type:"number",value:+p});else if(d){let j={type:"string",value:p};g.push(j),r.push(j)}else r.push($)}else r.push({type:"string",value:p});p=""}b&&((b==="+"||b==="-")&&R(),S&&e[n-1]===" "&&(S=""),k&&e[n+1]===" "&&(k=""),o?r.push({type:"separator",value:b,text:b}):r.push({type:"separator",value:b,text:S+b+k})),m=!1},w=()=>{(this.definition.unit==="rem"||this.definition.unit==="em")&&r.push({type:"separator",value:"/",text:" / "},{type:"number",value:this.css.config.rootSize}),r.push({type:"separator",value:"*",text:" * "},{type:"number",value:1,unit:this.definition.unit})},R=()=>{s&&!h&&!y&&(!d||l)&&w(),s=!1,h=!1};for(;n<e.length;n++){let b=e[n];if(b==="("){let S=/^([+-])/.exec(p);S&&r.push({type:"string",value:S[1]});let k=S?p.slice(1):p,$={type:"function",name:k,symbol:b,children:[],bypassTransform:k==="calc"};r.push($),p="",n++;let j=k==="$"||k==="var";if(t=c($.children,k!==""&&k!=="calc"&&(j||Object.prototype.hasOwnProperty.call(te,k)),m||j||s&&h,s,j)||k==="var",!t&&k==="$"){let _=this.css.variables[$.children[0].value]?.type;t=!_||_==="string"}t&&(l=!0,h=!0)}else if(b===")"){if(v(""),l)for(let S of g)Object.assign(S,this.parseValueComponent(S.value));return l}else if(b===",")v(b,""," ");else if(b===" ")v(b);else{let S=e[n-1];switch(b){case"+":!p&&S!==")"?p+=b:v(b," "," ");break;case"-":!p&&S!==")"?p+=b:v(b," "," ");break;case"*":this.definition.unit&&(s=!0),v(b," "," ");break;case"/":this.definition.unit&&(s=!0),v(b," "," "),m=!0;break;default:p+=b;break}}}v(""),R()};return c(i,!1,!1,!1,!1),"calc("+this.resolveValue(i,te.calc.unit??this.definition.unit,a,!0)+")"}},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:""},color:{unit:"",colored:!0},"color-contrast":{unit:"",colored:!0},"color-mix":{unit:"",colored:!0},hwb:{unit:""},lab:{unit:""},lch:{unit:""},oklab:{unit:""},oklch:{unit:""},clamp:{unit:""},repeat:{unit:""},"linear-gradient":{colored:!0},"radial-gradient":{colored:!0},"conic-gradient":{colored:!0},"repeating-linear-gradient":{colored:!0},"repeating-radial-gradient":{colored:!0},"repeating-conic-gradient":{colored:!0}},je=te,F={mediaQueries:ne,selectors:ge,semantics:xe,rules:Ce,functions:je,animations:ke,variables:$e,scope:"",rootSize:16,baseUnit:4,override:!1,important:!1,themeDriver:"class"};function Oe(e){e.startsWith("#")&&(e=e.slice(1));let a,i,n,c;return e.length===3||e.length===4?(a=parseInt(e[0]+e[0],16),i=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),c=e.length===4?Math.round(parseInt(e[3]+e[3],16)/255*100)/100:1):(e.length===6||e.length===8)&&(a=parseInt(e.slice(0,2),16),i=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),c=e.length===8?Math.round(parseInt(e.slice(6,8),16)/255*100)/100:1),[a,i,n,c]}function G(e,a=""){return Object.entries(e).reduce((i,[n,c])=>{let r=a?`${a}${n?"-"+n:""}`:n;return typeof c=="object"&&!Array.isArray(c)?Object.assign(i,G(c,r)):i[r]=c,i},{})}function ce(e){let a=typeof Buffer<"u"?Buffer:null;return!!(a&&e instanceof a||e instanceof Date||e instanceof RegExp)}function he(e){if(typeof Buffer<"u"&&Buffer&&e instanceof Buffer){let a=Buffer.alloc(e.length);return e.copy(a),a}else{if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}}function de(e){let a=[];return e.forEach(function(i,n){typeof i=="object"&&i!==null?Array.isArray(i)?a[n]=de(i):ce(i)?a[n]=he(i):a[n]=X({},i):a[n]=i}),a}function le(e,a){return a==="__proto__"?void 0:e[a]}function X(...e){let a={},i,n;return e.forEach(function(c){typeof c!="object"||c===null||Array.isArray(c)||Object.keys(c).forEach(function(r){if(n=le(a,r),i=le(c,r),i!==a)if(typeof i!="object"||i===null){a[r]=i;return}else if(Array.isArray(i)){a[r]=de(i);return}else if(ce(i)){a[r]=he(i);return}else if(typeof n!="object"||n===null||Array.isArray(n)){a[r]=X({},i);return}else{a[r]=X(n,i);return}})}),a}function H(...e){let a=c=>{let r=X({},c),o=f=>{for(let y in f){let u=f[y];typeof u=="object"&&!Array.isArray(u)?o(u):y&&!y.startsWith("@")&&(f[y]={"":u})}};return r.styles?o(r.styles):r.styles={},r.mediaQueries?o(r.mediaQueries):r.mediaQueries={},r.variables?o(r.variables):r.variables={},r},i=[];for(let c of e)(function r(o){if(o.extends?.length)for(let f of o.extends)r("config"in f?f.config:f);i.push(a(o))})(c);let n=i[0];for(let c=1;c<i.length;c++){let r=i[c];n=X(n,r),Object.prototype.hasOwnProperty.call(r,"animations")&&n.animations&&Object.assign(n.animations,r.animations)}return n}var re=class ue{constructor(a=F){this.customConfig=a,a?.override?this.config=H(a):this.config=H(F,a),this.resolve(),this.constructor===ue&&J.push(this)}static config=F;rules=[];ruleBy={};classesUsage={};config;RegisteredSemanticRules=[];RegisteredRules=[];resolve(){this.styles={},this.stylesBy={},this.selectors={},this.variables={},this.mediaQueries={},this.animations={},this.RegisteredRules.length=0,this.RegisteredSemanticRules.length=0,this.variablesNativeRules={},this.hasKeyframesRule=!1;let a={current:void 0,currentColor:void 0,transparent:void 0},{styles:i,selectors:n,variables:c,semantics:r,mediaQueries:o,rules:f,animations:y}=this.config;function u(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}if(n){let l=G(n);for(let h in l){let s=l[h],t=new RegExp(u(h)+"(?![a-z-])");for(let p of Array.isArray(s)?s:[s]){let v=p.match(/^::-[a-z]+-/m)?.[0]??"",w=this.selectors[v];w||(w=this.selectors[v]=[]);let R=w.find(([b])=>b===t);R||(R=[t,[]],w.push(R)),R[1].push(p)}}}if(c){let l={},h=(s,t,p)=>{if(!s)return;let v=(R,b,S,k)=>{if(b===void 0)return;if(b.type==="color"){if(k){let j=b.value.indexOf("/");b={...b,value:j===-1?b.value+" / "+(k.startsWith("0.")?k.slice(1):k):b.value.slice(0,j+2)+String(+b.value.slice(j+2)*+k).slice(1)}}a[R]=void 0}let $=S??p;if($!==void 0)if(Object.prototype.hasOwnProperty.call(this.variables,R)){let j=this.variables[R];$?(j.themes||(j.themes={}),j.themes[$]=b):(j.value=b.value,b.type==="color"&&(j.space=b.space))}else if($){let j={type:b.type,themes:{[$]:b}};b.type==="color"&&(j.space=b.space),this.variables[R]=j}else this.variables[R]=b;else this.variables[R]=b},w=typeof s;if(w==="object")if(Array.isArray(s))v(t,{type:"string",value:s.join(",")});else{let R=Object.keys(s);for(let b of R)b===""||b.startsWith("@")?h(s[b],t,b||R.some(S=>S.startsWith("@"))?b.slice(1):void 0):h(s[b],t+"-"+b,void 0)}else if(w==="number")v(t,{type:"number",value:s}),v("-"+t,{type:"number",value:s*-1});else if(w==="string"){let R=/^\$\((.*?)\)(?: ?\/ ?(.+?))?$/.exec(s);if(R)Object.prototype.hasOwnProperty.call(l,t)||(l[t]={}),l[t][p]=()=>{delete l[t][p];let[b,S]=R[1].split("@");if(b){if(Object.prototype.hasOwnProperty.call(l,b))for(let $ of Object.keys(l[b]))l[b][$]?.();let k=this.variables[b];if(k)if(S===void 0&&k.themes){v(t,{type:k.type,value:k.value,space:k.space},"",R[2]);for(let $ in k.themes)v(t,k.themes[$],$,R[2])}else{let $=S!==void 0?k.themes?.[S]:k;if($){let j={type:$.type,value:$.value};$.type==="color"&&(j.space=$.space),v(t,j,void 0,R[2])}}}};else{let b=/^#([A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.exec(s);if(b){let[S,k,$,j]=Oe(b[1]);v(t,{type:"color",value:`${S} ${k} ${$}${j===1?"":" / "+j}`,space:"rgb"})}else{let S=/^rgb\( *([0-9]{1,3})(?: *, *| +)([0-9]{1,3})(?: *, *| +)([0-9]{1,3}) *(?:(?:,|\/) *(.*?) *)?\)$/.exec(s);if(S)v(t,{type:"color",value:S[1]+" "+S[2]+" "+S[3]+(S[4]?" / "+(S[4].startsWith("0.")?S[4].slice(1):S[4]):""),space:"rgb"});else{let k=/^hsl\((.*?)\)$/.exec(s);k?v(t,{type:"color",value:k[1],space:"hsl"}):v(t,{type:"string",value:s})}}}}};for(let s in c)h(c[s],s);for(let s of Object.keys(l))for(let t of Object.keys(l[s]))l[s][t]?.()}if(o&&(this.mediaQueries=G(o)),y)for(let l in y){let h=this.animations[l]={},s=y[l];for(let t in s){let p=h[t]={},v=s[t];for(let w in v)p[w]=v[w]}}let d=i?G(i):{},g=Object.keys(d),m=l=>{if(Object.prototype.hasOwnProperty.call(this.styles,l))return;let h=this.styles[l]=[],s=d[l];if(!s)return;let t=s.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of t){let v=w=>{if(Object.prototype.hasOwnProperty.call(this.stylesBy,w)){let R=this.stylesBy[w];R.includes(l)||R.push(l)}else this.stylesBy[w]=[l];h.includes(w)||h.push(w)};if(g.includes(p)){m(p);for(let w of this.styles[p])v(w)}else v(p)}};for(let l of g)m(l);if(r&&Object.entries(r).sort((l,h)=>l[0].localeCompare(h[0])).forEach(([l,h],s)=>{this.RegisteredSemanticRules.push({id:"."+l,match:new RegExp("^"+u(l)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),order:s,definition:{declarations:h,layer:-8}})}),f){let l=Object.entries(f).sort((t,p)=>t[1].layer!==p[1].layer?(p[1].layer||0)-(t[1].layer||0):p[0].localeCompare(t[0])),h=l.length,s=Object.keys(a);l.forEach(([t,p],v)=>{let w={id:t,variables:{},order:this.RegisteredSemanticRules.length+h-1-v,definition:p};this.RegisteredRules.push(w);let R=p.match,b=S=>{for(let k in this.variables)if(k.startsWith(S+"-")||k.startsWith("-"+S+"-")){let $=k.slice(S.length+(S.startsWith("-")?0:1));w.variables[$]={...this.variables[k],name:k}}};if(p.variables)for(let S of p.variables)b(S);if(b(t),R)if(Array.isArray(R)){let[S,k=[]]=R,$=[];k.length&&$.push(`(?:${k.join("|")})(?![a-zA-Z0-9-])`),Object.keys(w.variables).length&&$.push(`(?:${Object.keys(w.variables).join("|")})(?![a-zA-Z0-9-])`),p.colored&&$.push("#","(?:color|color-contrast|color-mix|hwb|lab|lch|oklab|oklch|rgb|rgba|hsl|hsla)\\(.*\\)",`(?:${s.join("|")})(?![a-zA-Z0-9-])`),p.numeric&&$.push("[\\d\\.]","(?:max|min|calc|clamp)\\(.*\\)"),$.length&&(w.match=new RegExp(`^${S}:(?:${$.join("|")})[^|]*?(?:@|$)`))}else w.match=R})}}match(a){for(let i of this.RegisteredRules)if(i.match?.test(a)||(i.definition.layer===-2||i.definition.layer===-6||i.definition.layer===-3||i.definition.layer===-7)&&a.startsWith(i.id+":"))return i;for(let i of this.RegisteredSemanticRules)if(i.match?.test(a))return i}generate(a){return(Object.prototype.hasOwnProperty.call(this.styles,a)?this.styles[a].map(i=>this.create(i)):[this.create(a)]).filter(i=>i&&i.text)}create(a){if(Object.prototype.hasOwnProperty.call(this.ruleBy,a))return this.ruleBy[a];let i=this.match(a);if(i)return new ye(a,i,this)}refresh(a=this.customConfig){a?.override?this.config=H(a):this.config=H(F,a),this.resolve(),this.rules.length=0,this.ruleBy={};for(let i in this.classesUsage)this.add(i);return this}reset(){this.ruleBy={},this.classesUsage={},this.rules.length=0,this.hasKeyframesRule=!1,this.variablesNativeRules={};for(let a in this.animations){let i=this.animations[a];i.usage=0,i.native=void 0}for(let a in this.variables){let i=this.variables[a];i.usage=0}return this}destroy(){return this.reset(),J.splice(J.indexOf(this),1),this}add(...a){for(let i of a){let n=this.generate(i);if(n.length)for(let c of n)this.insert(c)}return this}delete(...a){let i=this.style?.sheet,n=c=>{let r=this.ruleBy[c];if(!(!r||Object.prototype.hasOwnProperty.call(this.stylesBy,c)&&this.stylesBy[c].some(o=>Object.prototype.hasOwnProperty.call(this.classesUsage,o)))){if(i&&r.natives.length){let o=r.natives[0];for(let f=0;f<i.cssRules.length;f++)if(i.cssRules[f]===o.cssRule){for(let y=0;y<r.natives.length;y++)i.deleteRule(f);break}}if(this.rules.splice(this.rules.indexOf(r),1),delete this.ruleBy[c],r.variableNames)for(let o of r.variableNames){let f=this.variables[o];if(f.usage||(f.usage=0),!--f.usage){let y=u=>{let d=this.variablesNativeRules[u];if(d.cssRule.style.removeProperty("--"+o),!d.cssRule.style.length){let g=this.rules[0],m=g.natives.indexOf(d);i?.deleteRule(m),g.natives.splice(m,1),delete this.variablesNativeRules[u],g.natives.length||(this.rules.splice(0,1),this.variablesNativeRules={})}};if(f.value&&y(""),f.themes)for(let u in f.themes)y(u)}}if(r.animationNames){let o=Object.keys(this.variablesNativeRules).length?1:0,f=this.rules[o];for(let y of r.animationNames){let u=this.animations[y];if(u.usage||(u.usage=0),!--u.usage&&u.native){let d=f.natives.indexOf(u.native);this.style.sheet?.deleteRule(Object.keys(this.variablesNativeRules).length+d),f.natives.splice(d,1),u.native=void 0}}f.natives.length||(this.rules.splice(o,1),this.hasKeyframesRule=!1)}r.definition.delete?.call(r,c)}};for(let c of a)if(Object.prototype.hasOwnProperty.call(this.styles,c)){for(let r of this.styles[c])Object.prototype.hasOwnProperty.call(this.classesUsage,r)||n(r);delete this.ruleBy[c]}else n(c)}insert(a){if(this.ruleBy[a.className])return;let i,n=this.rules.length-1,{media:c,order:r,priority:o,hasWhere:f,className:y}=a,u=(m,l,h)=>{let s=m;for(;s<=n;s++){let t=this.rules[s];if(l?.(t))return h?-1:s-1;if(h?.(t))return s}return h?-1:s-1},d,g;if(c){let m=this.rules.findIndex(l=>l.media);if(m===-1)i=n+1;else{let{"max-width":l,"min-width":h}=c.features;if(l||h){let s=this.rules.findIndex(t=>t.media?.features["max-width"]||t.media?.features["min-width"]);if(s===-1)i=n+1;else if(l&&h){if(o===-1?(d=u(s,t=>t.priority!==-1,t=>t.media.features["max-width"]&&t.media.features["min-width"]),g=u(s,t=>t.priority!==-1)):(d=u(s,void 0,t=>t.media.features["max-width"]&&t.media.features["min-width"]&&t.priority!==-1),g=n),d!==-1){let t=l.value-h.value,p=g,v=d;for(d=void 0;p>=v;p--){let{"max-width":w,"min-width":R}=this.rules[p].media.features,b=w.value-R.value;if(b<t)g=p-1;else if(b===t)d=p;else break}}if(d!==-1&&d!==void 0){let t=l.value-h.value;for(let p=g;p>=d;p--){let{"max-width":v,"min-width":w}=this.rules[p].media.features,R=v.value-w.value;if(R<t)g=p-1;else if(R>t){d=p+1;break}}}}else if(h){if(o===-1?(d=u(s,t=>t.media.features["max-width"]&&t.media.features["min-width"]||t.priority!==-1,t=>!t.media.features["max-width"]&&t.media.features["min-width"]),g=u(s,t=>t.media.features["max-width"]&&t.media.features["min-width"]||t.priority!==-1)):(d=u(s,t=>t.media.features["max-width"]&&t.media.features["min-width"]&&t.priority!==-1,t=>!t.media.features["max-width"]&&t.media.features["min-width"]&&t.priority!==-1),g=u(s,t=>t.media.features["max-width"]&&t.media.features["min-width"]&&t.priority!==-1)),d!==-1)for(let t=g;t>=d;t--){let p=this.rules[t].media.features["min-width"].value;if(p>h.value)g=t-1;else if(p<h.value){d=t+1;break}}}else if(o===-1?(d=u(s,t=>t.media.features["min-width"]||t.priority!==-1,t=>t.media.features["max-width"]),g=u(s,t=>t.media.features["min-width"]||t.priority!==-1)):(d=u(s,t=>t.media.features["min-width"]&&t.priority!==-1,t=>t.media.features["max-width"]&&t.priority!==-1),g=u(s,t=>t.media.features["min-width"]&&t.priority!==-1)),d!==-1)for(let t=g;t>=d;t--){let p=this.rules[t].media.features["max-width"].value;if(p<l.value)g=t-1;else if(p>l.value){d=t+1;break}}}else o===-1?(d=m,g=u(m,s=>s.media?.features["max-width"]||s.media?.features["min-width"]||s.priority!==-1)):(d=u(m,s=>s.media?.features["max-width"]||s.media?.features["min-width"],s=>s.priority!==-1),g=u(m,s=>s.media?.features["max-width"]||s.media?.features["min-width"]))}}else{let m=Object.keys(this.variablesNativeRules).length?this.hasKeyframesRule?2:1:this.hasKeyframesRule?1:0;o===-1?(d=m,g=u(m,l=>l.media||l.priority!==-1)):(d=u(m,l=>l.media,l=>l.priority!==-1),g=u(m,l=>l.media))}if(i===void 0&&g!==void 0&&d!==void 0)if(d===-1)i=g+1;else{if(o===-1)for(let m=d;m<=g;m++){let l=this.rules[m];if(!(!f&&l.hasWhere)&&(f&&!l.hasWhere||l.order>=r)){i=m;break}}else for(let m=d;m<=g;m++){let l=this.rules[m];if(!(!f&&l.hasWhere)){if(f&&!l.hasWhere){i=m;break}if(l.priority<o){i=m;break}else if(l.priority===o){if(l.order>=r){i=m;break}}else i=m+1}}i===void 0&&(i=g+1)}if(this.rules.splice(i,0,a),this.ruleBy[y]=a,this.style){let m=this.style.sheet,l=0,h=s=>{let t=this.rules[s];if(t){if(!t.natives.length)return h(s-1);let p=t.natives[t.natives.length-1],v=p.cssRule?.parentRule??p.cssRule;if(m){for(let w=0;w<m.cssRules.length;w++)if(m.cssRules[w]===v){l=w+1;break}}}};h(i-1);for(let s=0;s<a.natives.length;)try{let t=a.natives[s];m?.insertRule(t.text,l),t.cssRule=m?.cssRules[l++],s++}catch(t){console.error(t),a.natives.splice(s,1)}}this.handleRuleWithVariableNames(a),this.handleRuleWithAnimationNames(a),a.definition.insert?.call(a)}get text(){return this.rules.map(a=>a.text).join("")}handleRuleWithAnimationNames(a,i=!1){if(a.animationNames){let n=this.style?.sheet;for(let c of a.animationNames){let r=this.animations[c];if(r.usage)r.usage++;else{let o={text:`@keyframes ${c}{`+Object.entries(r).filter(([u])=>u!=="usage"&&u!=="native").map(([u,d])=>`${u}{${Object.entries(d).map(([g,m])=>g+":"+m).join(";")}}`).join("")+"}"},f=Object.keys(this.variablesNativeRules).length?1:0,y;if(this.hasKeyframesRule?(y=this.rules[f]).natives.push(o):(this.rules.splice(f,0,y={natives:[o],get text(){return this.natives.map(u=>u.text).join("")}}),this.hasKeyframesRule=!0),n){let u;if(i)for(let d=0;d<n.cssRules.length;d++){let g=n.cssRules[d];if(g.constructor.name==="CSSKeyframesRule"&&g.name===c){u=g;break}}if(u)o.cssRule=u;else{let d=Object.keys(this.variablesNativeRules).length+y.natives.length-1;n.insertRule(o.text,d),o.cssRule=n.cssRules[d]}}r.usage=1,r.native=o}}}}handleRuleWithVariableNames(a,i=!1){if(a.variableNames){let n=this.style?.sheet;for(let c of a.variableNames){let r=this.variables[c];if(r.usage)r.usage++;else{let o=(f,y)=>{let u=this.variablesNativeRules[f];if(!u){let g,m,l;if(f)switch(this.config.themeDriver){case"media":m=`@media(prefers-color-scheme:${f})`,l=":root";break;case"host":l=`:host(.${f})`;break;default:l=`.${f}`;break}else l=":root";if(n){let h=Object.keys(this.variablesNativeRules).length?this.rules[0].natives.length:0;n.insertRule((m?m+"{":"")+l+"{}"+(m?m+"}":""),h),g=m?n.cssRules[h].cssRules[0]:n.cssRules[h]}else{let h=new Map,s=Object.defineProperties({},{getPropertyValue:{value:t=>h.get(t)},removeProperty:{value:t=>{h.delete(t);for(let p=0;p<s.length;p++)s[p]===t&&delete s[p]}},setProperty:{value:(t,p)=>{s[s.length]=t,h.set(t,p)}},length:{get(){return Object.keys(s).length}}});g={selectorText:l,style:s,styleMap:h},m&&(g.parentRule={conditionText:m})}u=this.pushVariableNativeRule(f,g)}let d="--"+c;(!i||!u.cssRule.style.getPropertyValue(d))&&u.cssRule.style.setProperty(d,String(y.value))};if(r.value&&o("",r),r.themes)for(let f in r.themes)o(f,r.themes[f]);r.usage=1}}}}pushVariableNativeRule(a,i){if(!Object.keys(this.variablesNativeRules).length){this.variablesNativeRules={};let o={natives:[],get text(){return this.natives.map(f=>f.text).join("")}};this.rules.splice(0,0,o)}let n="",c="}";i.parentRule&&(n+=i.parentRule.conditionText.replace(/ /g,"")+"{",c+="}"),n+=i.selectorText+"{";let r={cssRule:i,get text(){let o=[];for(let f=0;f<i.style.length;f++){let y=i.style[f];o.push(y+":"+i.style.getPropertyValue(y))}return n+o.join(";")+c}};return this.rules[0].natives.push(this.variablesNativeRules[a]=r),r}},J=[];globalThis.MasterCSS=re,globalThis.masterCSSs=J;var Z=class extends re{constructor(i=document,n=F){super(n);this.root=i;this.customConfig=n;i||(this.root=document),this.root===document?(globalThis.cssRuntime=this,this.container=document.head,this.host=document.documentElement):(this.container=this.root,this.host=this.root.host),K.push(this)}host;observing=!1;container;observer;observe(i={subtree:!0,childList:!0}){if(this.observing||!this.root)return this;if(K.find(c=>c!==this&&c.root===this.root))return console.warn("Cannot observe the same root element repeatedly."),this;if(this.root?.styleSheets)for(let c of this.root.styleSheets){let{ownerNode:r}=c;if(r&&r.id==="master"){this.style=r;break}}if(this.style?.sheet){let c=0;for(;c<this.style.sheet.cssRules.length;c++){let r=this.style.sheet.cssRules[c];switch(r.constructor.name){case"CSSKeyframesRule":continue;case"CSSMeidaRule":if(this.config.themeDriver==="media"){let f=/\(prefers-color-scheme: (.*?)\)/.exec(r.conditionText);if(f){let y=r.cssRules[0];if(y?.constructor.name==="CSSStyleRule"&&y.selectorText===":root"){this.pushVariableNativeRule(f[1],y);continue}}}break;case"CSSStyleRule":let o=r.selectorText;if(r.style.length){let f=!0;for(let y=0;y<r.style.length;y++)if(!r.style[y]?.startsWith("--")){f=!1;break}if(f){if(o===":root"){this.pushVariableNativeRule("",r);continue}else if(this.config.themeDriver==="host"){let y=/:host(.*?)/.exec(o);if(y){this.pushVariableNativeRule(y[1],r);continue}}else if(!o.startsWith(".\\$")){this.pushVariableNativeRule(o.slice(1),r);continue}}}break}break}for(;c<this.style.sheet.cssRules.length;c++){let r=f=>{if(f.selectorText){let u=f.selectorText.split(", ")[0].split(" ");for(let d=0;d<u.length;d++){let g=u[d];if(g[0]==="."){let m=g.slice(1),l="";for(let h=0;h<m.length;h++){let s=m[h],t=m[h+1];if(s==="\\"){if(h++,t!=="\\"){l+=t;continue}}else if([",",".","#","[","!","*",">","+","~",":","@"].includes(s))break;l+=s}if(!Object.prototype.hasOwnProperty.call(this.ruleBy,l)&&!Object.prototype.hasOwnProperty.call(this.styles,l)){let h=this.generate(l)[0];if(h)return h}}}}else if(f.cssRules)for(let y=0;y<f.cssRules.length;y++){let u=r(f.cssRules[y]);if(u)return u}},o=r(this.style.sheet.cssRules[c]);if(o){this.rules.push(o),this.ruleBy[o.className]=o;for(let f=0;f<o.natives.length;f++)o.natives[f].cssRule=this.style.sheet.cssRules[c+f];c+=o.natives.length-1,this.handleRuleWithVariableNames(o,!0),this.handleRuleWithAnimationNames(o,!0),o.definition.insert?.call(o)}}}else this.style=document.createElement("style"),this.style.id="master",this.container.append(this.style);let n=c=>{c.forEach(r=>{Object.prototype.hasOwnProperty.call(this.classesUsage,r)?this.classesUsage[r]++:(this.classesUsage[r]=1,this.add(r))})};return n(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(c=>n(c.classList)),this.observer=new MutationObserver(c=>{let r={},o=[],f=[],y=[],u=(l,h)=>{h?l.classList.forEach(g):l.classList.forEach(d);let s=l.children;for(let t=0;t<s.length;t++){let p=s[t];p.classList&&(f.push(p),u(p,h))}},d=l=>{Object.prototype.hasOwnProperty.call(r,l)?r[l]++:r[l]=1},g=l=>{Object.prototype.hasOwnProperty.call(r,l)?r[l]--:Object.prototype.hasOwnProperty.call(this.classesUsage,l)&&(r[l]=-1)},m=(l,h)=>{for(let s=0;s<l.length;s++){let t=l[s];t.classList&&!f.includes(t)&&!y.includes(t)&&(t.isConnected!==h?(f.push(t),u(t,h)):y.push(t))}};for(let l=0;l<c.length;l++){let h=c[l],{addedNodes:s,removedNodes:t,type:p,target:v}=h;if(p==="attributes"){if(o.find(w=>w.target===v))continue;o.push(h)}else m(s,!1),(!v.isConnected||!f.includes(v))&&m(t,!0)}if(!(!o.length&&!Object.keys(r).length)){for(let{oldValue:l,target:h}of o){let s=f.includes(h),t=h.classList,p=l?l.split(" "):[];if(s){if(h.isConnected)continue;for(let v of p)t.contains(v)||g(v)}else if(h.isConnected){t.forEach(v=>{p.includes(v)||d(v)});for(let v of p)t.contains(v)||g(v)}}for(let l in r){let h=r[l],s=(this.classesUsage[l]||0)+h;s===0?(delete this.classesUsage[l],this.delete(l)):(Object.prototype.hasOwnProperty.call(this.classesUsage,l)||this.add(l),this.classesUsage[l]=s)}}}),this.observer.observe(this.root,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.removeProperty("display"),this.observing=!0,this}refresh(i=this.customConfig){let n=document.createElement("style");return n.id="master",this.style.replaceWith(n),this.style=n,super.refresh(i),this}reset(){super.reset();let i=this.style?.sheet;if(i?.cssRules)for(let n=i.cssRules.length-1;n>=0;n--)i.deleteRule(n);return this.style?.remove(),this.style=null,this}disconnect(){return this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.reset(),this}destroy(){return this.disconnect(),K.splice(K.indexOf(this),1),this}},K=[];globalThis.CSSRuntime=Z,globalThis.cssRuntimes=K;function ae(e){return new Z(document,e).observe()}ae(window.masterCSSConfig);})();
|
package/dist/iife.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var v=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var N=(f,d)=>{for(var c in d)v(f,c,{get:d[c],enumerable:!0})},L=(f,d,c,h)=>{if(d&&typeof d=="object"||typeof d=="function")for(let s of T(d))!w.call(f,s)&&s!==c&&v(f,s,{get:()=>d[s],enumerable:!(h=E(d,s))||h.enumerable});return f};var M=f=>L(v({},"__esModule",{value:!0}),f);var j={};N(j,{CSSRuntime:()=>m,default:()=>m,initCSSRuntime:()=>O});module.exports=M(j);var g=require("@master/css");var m=class extends g.MasterCSS{constructor(c=document,h=g.config){super(h);this.root=c;this.customConfig=h;c||(this.root=document),this.root===document?(globalThis.cssRuntime=this,this.container=document.head,this.host=document.documentElement):(this.container=this.root,this.host=this.root.host),C.push(this)}host;observing=!1;container;observer;observe(c={subtree:!0,childList:!0}){if(this.observing||!this.root)return this;if(C.find(s=>s!==this&&s.root===this.root))return console.warn("Cannot observe the same root element repeatedly."),this;if(this.root?.styleSheets)for(let s of this.root.styleSheets){let{ownerNode:t}=s;if(t&&t.id==="master"){this.style=t;break}}if(this.style?.sheet){let s=0;for(;s<this.style.sheet.cssRules.length;s++){let t=this.style.sheet.cssRules[s];switch(t.constructor.name){case"CSSKeyframesRule":continue;case"CSSMeidaRule":if(this.config.themeDriver==="media"){let o=/\(prefers-color-scheme: (.*?)\)/.exec(t.conditionText);if(o){let r=t.cssRules[0];if(r?.constructor.name==="CSSStyleRule"&&r.selectorText===":root"){this.pushVariableNativeRule(o[1],r);continue}}}break;case"CSSStyleRule":let l=t.selectorText;if(t.style.length){let o=!0;for(let r=0;r<t.style.length;r++)if(!t.style[r]?.startsWith("--")){o=!1;break}if(o){if(l===":root"){this.pushVariableNativeRule("",t);continue}else if(this.config.themeDriver==="host"){let r=/:host(.*?)/.exec(l);if(r){this.pushVariableNativeRule(r[1],t);continue}}else if(!l.startsWith(".\\$")){this.pushVariableNativeRule(l.slice(1),t);continue}}}break}break}for(;s<this.style.sheet.cssRules.length;s++){let t=o=>{if(o.selectorText){let S=o.selectorText.split(", ")[0].split(" ");for(let p=0;p<S.length;p++){let R=S[p];if(R[0]==="."){let b=R.slice(1),e="";for(let i=0;i<b.length;i++){let a=b[i],n=b[i+1];if(a==="\\"){if(i++,n!=="\\"){e+=n;continue}}else if([",",".","#","[","!","*",">","+","~",":","@"].includes(a))break;e+=a}if(!Object.prototype.hasOwnProperty.call(this.ruleBy,e)&&!Object.prototype.hasOwnProperty.call(this.styles,e)){let i=this.generate(e)[0];if(i)return i}}}}else if(o.cssRules)for(let r=0;r<o.cssRules.length;r++){let S=t(o.cssRules[r]);if(S)return S}},l=t(this.style.sheet.cssRules[s]);if(l){this.rules.push(l),this.ruleBy[l.className]=l;for(let o=0;o<l.natives.length;o++)l.natives[o].cssRule=this.style.sheet.cssRules[s+o];s+=l.natives.length-1,this.handleRuleWithVariableNames(l,!0),this.handleRuleWithAnimationNames(l,!0),l.definition.insert?.call(l)}}}else this.style=document.createElement("style"),this.style.id="master",this.container.append(this.style);let h=s=>{s.forEach(t=>{Object.prototype.hasOwnProperty.call(this.classesUsage,t)?this.classesUsage[t]++:(this.classesUsage[t]=1,this.add(t))})};return h(this.host.classList),c.subtree&&this.host.querySelectorAll("[class]").forEach(s=>h(s.classList)),this.observer=new MutationObserver(s=>{let t={},l=[],o=[],r=[],S=(e,i)=>{i?e.classList.forEach(R):e.classList.forEach(p);let a=e.children;for(let n=0;n<a.length;n++){let y=a[n];y.classList&&(o.push(y),S(y,i))}},p=e=>{Object.prototype.hasOwnProperty.call(t,e)?t[e]++:t[e]=1},R=e=>{Object.prototype.hasOwnProperty.call(t,e)?t[e]--:Object.prototype.hasOwnProperty.call(this.classesUsage,e)&&(t[e]=-1)},b=(e,i)=>{for(let a=0;a<e.length;a++){let n=e[a];n.classList&&!o.includes(n)&&!r.includes(n)&&(n.isConnected!==i?(o.push(n),S(n,i)):r.push(n))}};for(let e=0;e<s.length;e++){let i=s[e],{addedNodes:a,removedNodes:n,type:y,target:u}=i;if(y==="attributes"){if(l.find(x=>x.target===u))continue;l.push(i)}else b(a,!1),(!u.isConnected||!o.includes(u))&&b(n,!0)}if(!(!l.length&&!Object.keys(t).length)){for(let{oldValue:e,target:i}of l){let a=o.includes(i),n=i.classList,y=e?e.split(" "):[];if(a){if(i.isConnected)continue;for(let u of y)n.contains(u)||R(u)}else if(i.isConnected){n.forEach(u=>{y.includes(u)||p(u)});for(let u of y)n.contains(u)||R(u)}}for(let e in t){let i=t[e],a=(this.classesUsage[e]||0)+i;a===0?(delete this.classesUsage[e],this.delete(e)):(Object.prototype.hasOwnProperty.call(this.classesUsage,e)||this.add(e),this.classesUsage[e]=a)}}}),this.observer.observe(this.root,{...c,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.removeProperty("display"),this.observing=!0,this}refresh(c=this.customConfig){let h=document.createElement("style");return h.id="master",this.style.replaceWith(h),this.style=h,super.refresh(c),this}reset(){super.reset();let c=this.style?.sheet;if(c?.cssRules)for(let h=c.cssRules.length-1;h>=0;h--)c.deleteRule(h);return this.style?.remove(),this.style=null,this}disconnect(){return this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.reset(),this}destroy(){return this.disconnect(),C.splice(C.indexOf(this),1),this}},C=[];globalThis.CSSRuntime=m,globalThis.cssRuntimes=C;function O(f){return new m(document,f).observe()}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MasterCSS as v,config as O}from"@master/css";var y=class extends v{constructor(u=document,c=O){super(c);this.root=u;this.customConfig=c;u||(this.root=document),this.root===document?(globalThis.cssRuntime=this,this.container=document.head,this.host=document.documentElement):(this.container=this.root,this.host=this.root.host),R.push(this)}host;observing=!1;container;observer;observe(u={subtree:!0,childList:!0}){if(this.observing||!this.root)return this;if(R.find(l=>l!==this&&l.root===this.root))return console.warn("Cannot observe the same root element repeatedly."),this;if(this.root?.styleSheets)for(let l of this.root.styleSheets){let{ownerNode:t}=l;if(t&&t.id==="master"){this.style=t;break}}if(this.style?.sheet){let l=0;for(;l<this.style.sheet.cssRules.length;l++){let t=this.style.sheet.cssRules[l];switch(t.constructor.name){case"CSSKeyframesRule":continue;case"CSSMeidaRule":if(this.config.themeDriver==="media"){let i=/\(prefers-color-scheme: (.*?)\)/.exec(t.conditionText);if(i){let r=t.cssRules[0];if(r?.constructor.name==="CSSStyleRule"&&r.selectorText===":root"){this.pushVariableNativeRule(i[1],r);continue}}}break;case"CSSStyleRule":let o=t.selectorText;if(t.style.length){let i=!0;for(let r=0;r<t.style.length;r++)if(!t.style[r]?.startsWith("--")){i=!1;break}if(i){if(o===":root"){this.pushVariableNativeRule("",t);continue}else if(this.config.themeDriver==="host"){let r=/:host(.*?)/.exec(o);if(r){this.pushVariableNativeRule(r[1],t);continue}}else if(!o.startsWith(".\\$")){this.pushVariableNativeRule(o.slice(1),t);continue}}}break}break}for(;l<this.style.sheet.cssRules.length;l++){let t=i=>{if(i.selectorText){let d=i.selectorText.split(", ")[0].split(" ");for(let S=0;S<d.length;S++){let m=d[S];if(m[0]==="."){let p=m.slice(1),e="";for(let s=0;s<p.length;s++){let a=p[s],n=p[s+1];if(a==="\\"){if(s++,n!=="\\"){e+=n;continue}}else if([",",".","#","[","!","*",">","+","~",":","@"].includes(a))break;e+=a}if(!Object.prototype.hasOwnProperty.call(this.ruleBy,e)&&!Object.prototype.hasOwnProperty.call(this.styles,e)){let s=this.generate(e)[0];if(s)return s}}}}else if(i.cssRules)for(let r=0;r<i.cssRules.length;r++){let d=t(i.cssRules[r]);if(d)return d}},o=t(this.style.sheet.cssRules[l]);if(o){this.rules.push(o),this.ruleBy[o.className]=o;for(let i=0;i<o.natives.length;i++)o.natives[i].cssRule=this.style.sheet.cssRules[l+i];l+=o.natives.length-1,this.handleRuleWithVariableNames(o,!0),this.handleRuleWithAnimationNames(o,!0),o.definition.insert?.call(o)}}}else this.style=document.createElement("style"),this.style.id="master",this.container.append(this.style);let c=l=>{l.forEach(t=>{Object.prototype.hasOwnProperty.call(this.classesUsage,t)?this.classesUsage[t]++:(this.classesUsage[t]=1,this.add(t))})};return c(this.host.classList),u.subtree&&this.host.querySelectorAll("[class]").forEach(l=>c(l.classList)),this.observer=new MutationObserver(l=>{let t={},o=[],i=[],r=[],d=(e,s)=>{s?e.classList.forEach(m):e.classList.forEach(S);let a=e.children;for(let n=0;n<a.length;n++){let f=a[n];f.classList&&(i.push(f),d(f,s))}},S=e=>{Object.prototype.hasOwnProperty.call(t,e)?t[e]++:t[e]=1},m=e=>{Object.prototype.hasOwnProperty.call(t,e)?t[e]--:Object.prototype.hasOwnProperty.call(this.classesUsage,e)&&(t[e]=-1)},p=(e,s)=>{for(let a=0;a<e.length;a++){let n=e[a];n.classList&&!i.includes(n)&&!r.includes(n)&&(n.isConnected!==s?(i.push(n),d(n,s)):r.push(n))}};for(let e=0;e<l.length;e++){let s=l[e],{addedNodes:a,removedNodes:n,type:f,target:h}=s;if(f==="attributes"){if(o.find(g=>g.target===h))continue;o.push(s)}else p(a,!1),(!h.isConnected||!i.includes(h))&&p(n,!0)}if(!(!o.length&&!Object.keys(t).length)){for(let{oldValue:e,target:s}of o){let a=i.includes(s),n=s.classList,f=e?e.split(" "):[];if(a){if(s.isConnected)continue;for(let h of f)n.contains(h)||m(h)}else if(s.isConnected){n.forEach(h=>{f.includes(h)||S(h)});for(let h of f)n.contains(h)||m(h)}}for(let e in t){let s=t[e],a=(this.classesUsage[e]||0)+s;a===0?(delete this.classesUsage[e],this.delete(e)):(Object.prototype.hasOwnProperty.call(this.classesUsage,e)||this.add(e),this.classesUsage[e]=a)}}}),this.observer.observe(this.root,{...u,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.removeProperty("display"),this.observing=!0,this}refresh(u=this.customConfig){let c=document.createElement("style");return c.id="master",this.style.replaceWith(c),this.style=c,super.refresh(u),this}reset(){super.reset();let u=this.style?.sheet;if(u?.cssRules)for(let c=u.cssRules.length-1;c>=0;c--)u.deleteRule(c);return this.style?.remove(),this.style=null,this}disconnect(){return this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.reset(),this}destroy(){return this.disconnect(),R.splice(R.indexOf(this),1),this}},R=[];globalThis.CSSRuntime=y,globalThis.cssRuntimes=R;function C(b){return new y(document,b).observe()}export{y as CSSRuntime,y as default,C as initCSSRuntime};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSRuntime } from './core';
|
|
2
|
+
import type { Config } from '@master/css';
|
|
3
|
+
/**
|
|
4
|
+
* Initialize a new CSSRuntime 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 initCSSRuntime(config?: Config): CSSRuntime;
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@master/css-runtime","scripts":{"build":"techor pack --declare","dev":"pnpm run build --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"Run the Master CSS right in the browser","author":"Aoyue Design LLC.","funding":"https://css.master.co/docs/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/runtime"},"keywords":["utility","css","lightweight","mastercss","master","runtime","cdn"],"sideEffects":false,"main":"./dist/index.bundle.js","jsnext:main":"./dist/index.bundle.mjs","esnext":"./dist/index.bundle.mjs","module":"./dist/index.bundle.mjs","browser":"./dist/iife.bundle.js","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.bundle.js","import":"./dist/index.bundle.mjs","types":"./dist/index.d.ts"}},"files":["dist"],"publishConfig":{"access":"public"},"dependencies":{"@master/css":"^2.0.0-rc.1"},"version":"2.0.0-rc.1"}
|