@master/css 2.0.0-beta.145 → 2.0.0-beta.147
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/dist/cjs/config/functions.js +1 -1
- package/dist/cjs/config/rules.js +1 -1
- package/dist/cjs/css.js +1 -1
- package/dist/esm/config/functions.mjs +1 -1
- package/dist/esm/config/rules.mjs +1 -1
- package/dist/esm/css.mjs +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var p=(e,n)=>{for(var a in n)m(e,a,{get:n[a],enumerable:!0})},N=(e,n,a,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of b(n))!k.call(e,s)&&s!==a&&m(e,s,{get:()=>n[s],enumerable:!(l=w(n,s))||l.enumerable});return e};var V=e=>N(m({},"__esModule",{value:!0}),e);var v={};p(v,{functions:()=>h});module.exports=V(v);var h={$:{name:"var",transform(e){return"--"+e}},calc:{transform(e){let n=this.values,a=this.css.globalValues,l="",s,i="",g=!1,c="",f=!0,u=(r,t="",o="")=>{if(s===2&&!g){let d=this.analyzeUnitValue(i,h.calc.unit);d&&(i=d.value+d.unit)}r!=="("?n&&i in n?i=n[i].toString():a&&i in a&&(i=a[i].toString()):c=i,r===")"&&(c=""),l+=i+t+r+o,s=null,g=!1,i=""};for(let r=0;r<e.length;r++){let t=e[r];if(t==="("||t===")"){u(t),f=!0;continue}else if(t===",")u(t,""," ");else if(t==="-"&&s!==1){let o=e[r-1];o==="("?l+=t:o===")"?u(t," "," "):isNaN(+e[r+1])?o==="-"?(u(t),s=1):u(t,f?"":" ",f?"":" "):u(t,i?" ":"",i?" ":"")}else if(t==="+"||t==="*"||t==="/"||c!=="var"&&t==="-")u(t," "," ");else{switch(s){case 1:break;case 2:t!=="."&&!/[0-9]/.test(t)&&(g=!0);break;default:s=isNaN(+t)?1:2}s?i+=t:l+=t}f=!1}return u(""),l}},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:""}};0&&(module.exports={functions});
|
package/dist/cjs/config/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var i in t)g(e,i,{get:t[i],enumerable:!0})},S=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of k(t))!C.call(e,n)&&n!==i&&g(e,n,{get:()=>t[n],enumerable:!(s=$(t,n))||s.enumerable});return e};var R=e=>S(g({},"__esModule",{value:!0}),e);var I={};w(I,{rules:()=>T});module.exports=R(I);var v=require("../constants/start-symbol"),x=require("../utils/css-escape"),B={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(o,r)=>{let a=r.indexOf(":");if(a!==-1){o in t||(t[o]={});let u=t[o],h=r.slice(0,a);h in u||(u[h]=r.slice(a+1))}},s=o=>{let r=(a,u)=>{let h=u.slice((0,x.cssEscape)(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)i(a,y)};if(this.theme){let a=o.natives.find(u=>u.theme===this.theme)??o.natives.find(u=>!u.theme);a&&r(this.theme,a.text)}else for(let a of o.natives)r(a.theme,a.text)},n=[],l="",d=()=>{l&&(n.push(l.replace(/ /g,"")),l="")},m=1;(function o(r){for(;m<e.length;m++){let a=e[m];if(!r){if(a===";"){d();continue}if(a==="}")break}if(l+=a,r===a){if(r==="'"||r==='"'){let u=0;for(let h=l.length-2;l[h]==="\\";h--)u++;if(u%2)continue}break}else a in v.START_SYMBOLS&&r!=="'"&&r!=='"'&&(m++,o(v.START_SYMBOLS[a]))}})(void 0),d();for(let o of n){let r=this.css.create(o);if(Array.isArray(r))for(let a of r)s(a);else r?s(r):i(this.theme??"",o)}let c={};for(let o in t)for(let[r,a]of Object.entries(t[o]))r in c?c[r][o]=a:c[r]={[o]:a};return c}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},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(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"}}}},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(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},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(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},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(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,height:i}}},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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"min-height":i}}},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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"max-height":i}}},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(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},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(e,t){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},overflowY:{native:!0,declare(e,t){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{native:!0,order:-1,declare(e,t){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},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:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},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},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:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return b.call(this,e)},delete(e){return p.call(this,e)},insert(){return f.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return b.call(this,e)},delete(e){return p.call(this,e)},insert(){return f.call(this)}},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(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},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(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},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(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},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(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},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(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},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(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},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(e){if(e.startsWith("gradient"))return["linear-"+e];let t=e.indexOf(":");return this.prefix=e.slice(0,t+1),[e.slice(t+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(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},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(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{match:"^grid-rows:.",declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",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(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},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:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},scrollPadding:{match:"^sp:.",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(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},T=B;function b(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function p(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let s=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(s),e.natives.splice(s,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function f(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:s}=this.css,n=i?.sheet;for(let l of this.keyframeNames)if(l in t)t[l].count++;else{let d={text:`@keyframes ${l}{`+Object.entries(e.keyframes[l]).map(([c,o])=>`${c}{${Object.entries(o).map(([r,a])=>r+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=s[0]).natives.push(d):s.splice(0,0,m={natives:[d],get text(){return this.natives.map(c=>c.text).join("")}}),n){let c;for(let o=0;o<n.cssRules.length;o++){let r=n.cssRules[o];if(r.constructor.name!=="CSSKeyframesRule")break;if(r.name===l){c=r;break}}if(c)d.cssRule=c;else{let o=m.natives.length-1;n.insertRule(d.text,o),d.cssRule=n.cssRules[o]}}t[l]={native:d,count:1}}}}0&&(module.exports={rules});
|
|
1
|
+
var g=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var i in t)g(e,i,{get:t[i],enumerable:!0})},S=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $(t))!C.call(e,n)&&n!==i&&g(e,n,{get:()=>t[n],enumerable:!(c=k(t,n))||c.enumerable});return e};var R=e=>S(g({},"__esModule",{value:!0}),e);var I={};w(I,{rules:()=>T});module.exports=R(I);var f=require("../constants/start-symbol"),x=require("../utils/css-escape"),B={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(r,o)=>{let a=o.indexOf(":");if(a!==-1){r in t||(t[r]={});let u=t[r],h=o.slice(0,a);h in u||(u[h]=o.slice(a+1))}},c=r=>{let o=(a,u)=>{let h=u.slice((0,x.cssEscape)(r.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)i(a,y)};if(this.theme){let a=r.natives.find(u=>u.theme===this.theme)??r.natives.find(u=>!u.theme);a&&o(this.theme,a.text)}else for(let a of r.natives)o(a.theme,a.text);if(r.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let a of r.keyframeNames)this.keyframeNames.includes(a)||this.keyframeNames.push(a)}},n=[],l="",d=()=>{l&&(n.push(l.replace(/ /g,"|")),l="")},m=1;(function r(o){for(;m<e.length;m++){let a=e[m];if(!o){if(a===";"){d();continue}if(a==="}")break}if(l+=a,o===a){if(o==="'"||o==='"'){let u=0;for(let h=l.length-2;l[h]==="\\";h--)u++;if(u%2)continue}break}else a in f.START_SYMBOLS&&o!=="'"&&o!=='"'&&(m++,r(f.START_SYMBOLS[a]))}})(void 0),d();for(let r of n){let o=this.css.create(r);if(Array.isArray(o))for(let a of o)c(a);else o?c(o):i(this.theme??"",r)}let s={};for(let r in t)for(let[o,a]of Object.entries(t[r]))o in s?s[o][r]=a:s[o]={[r]:a};return s},delete(){return v.call(this)},insert(){return b.call(this)}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},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(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"}}}},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(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},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(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},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(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,height:i}}},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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"min-height":i}}},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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"max-height":i}}},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(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},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(e,t){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},overflowY:{native:!0,declare(e,t){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{native:!0,order:-1,declare(e,t){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},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:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},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},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:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return p.call(this,e)},delete(){return v.call(this)},insert(){return b.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return p.call(this,e)},delete(){return v.call(this)},insert(){return b.call(this)}},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(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},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(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},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(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},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(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},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(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},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(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},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(e){if(e.startsWith("gradient"))return["linear-"+e];let t=e.indexOf(":");return this.prefix=e.slice(0,t+1),[e.slice(t+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(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},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(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{match:"^grid-rows:.",declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",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(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},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:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},scrollPadding:{match:"^sp:.",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(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},T=B;function p(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function v(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let c=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(c),e.natives.splice(c,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function b(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:c}=this.css,n=i?.sheet;for(let l of this.keyframeNames)if(l in t)t[l].count++;else{let d={text:`@keyframes ${l}{`+Object.entries(e.keyframes[l]).map(([s,r])=>`${s}{${Object.entries(r).map(([o,a])=>o+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=c[0]).natives.push(d):c.splice(0,0,m={natives:[d],get text(){return this.natives.map(s=>s.text).join("")}}),n){let s;for(let r=0;r<n.cssRules.length;r++){let o=n.cssRules[r];if(o.constructor.name!=="CSSKeyframesRule")break;if(o.name===l){s=o;break}}if(s)d.cssRule=s;else{let r=m.natives.length-1;n.insertRule(d.text,r),d.cssRule=n.cssRules[r]}}t[l]={native:d,count:1}}}}0&&(module.exports={rules});
|
package/dist/cjs/css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var N=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var U=(y,t,i)=>t in y?N(y,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):y[t]=i;var Y=(y,t)=>{for(var i in t)N(y,i,{get:t[i],enumerable:!0})},G=(y,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Z(t))!q.call(y,u)&&u!==i&&N(y,u,{get:()=>t[u],enumerable:!(n=_(t,u))||n.enumerable});return y};var J=y=>G(N({},"__esModule",{value:!0}),y);var T=(y,t,i)=>(U(y,typeof t!="symbol"?t+"":t,i),i);var P={};Y(P,{MasterCSS:()=>M});module.exports=J(P);function I(y){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&y instanceof t||y instanceof Date||y instanceof RegExp)}function $(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let t=Buffer.alloc(y.length);return y.copy(t),t}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function F(y){let t=[];return y.forEach(function(i,n){typeof i=="object"&&i!==null?Array.isArray(i)?t[n]=F(i):I(i)?t[n]=$(i):t[n]=O({},i):t[n]=i}),t}function W(y,t){return t==="__proto__"?void 0:y[t]}function O(...y){let t={},i,n;return y.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(v){if(n=W(t,v),i=W(u,v),i!==t)if(typeof i!="object"||i===null){t[v]=i;return}else if(Array.isArray(i)){t[v]=F(i);return}else if(I(i)){t[v]=$(i);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[v]=O({},i);return}else{t[v]=O(n,i);return}})}),t}var D=require("./rule"),j=require("./config"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var L=typeof window<"u",V=()=>{let y=document.createElement("style");return y.id="master",y},S=class{constructor(t=j.config){this.config=t;t?.override||(this.config=O(j.config,t),"keyframes"in t&&Object.assign(this.config.keyframes,t.keyframes)),this.cache(),L&&this.config.observe&&this.observe(document),S.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:t,classes:i,selectors:n,themes:u,colors:v,values:E,breakpoints:R,mediaQueries:p,rules:C}=this.config;function B(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(e,s,l="",c={}){let m=x=>x?(l?l+"-":"")+x:l,b=Object.entries(e),w=[],A=[];for(let x of b){let k=x[1];(typeof k=="object"&&!Array.isArray(k)?w:A).push(x)}for(let[x,k]of w)a(k,s,m(x),c);if(s&&l)A.length&&(c[l]=A.reduce((x,[k,z])=>(x[k]=z,x),{}));else for(let[x,k]of A)c[m(x)]=k;return c}if(t)for(let[e,s]of Object.entries(a(t,!0)))this.semantics.push([new RegExp("^"+B(e)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[e,s]]);if(n)for(let[e,s]of Object.entries(a(n,!1))){let l=new RegExp(B(e)+"(?![a-z-])");for(let c of Array.isArray(s)?s:[s]){let m=c.match(/^::-[a-z]+-/m)?.[0]??"",b=this.selectors[m];b||(b=this.selectors[m]=[]);let w=b.find(([A])=>A===l);w||(w=[l,[]],b.push(w)),w[1].push(c)}}E&&(this.globalValues=a(E,!1)),R&&(this.breakpoints=a(R,!1)),p&&(this.mediaQueries=a(p,!1));let d=i?a(i,!1):{},g=u&&!Array.isArray(u)?Object.entries(u).filter(([,{classes:e}])=>e).reduce((e,[s,{classes:l}])=>(e[s]=a(l,!1),e),{}):{},h=[...Object.keys(d),...Object.entries(g).flatMap(([e,s])=>Object.keys(s))],f=e=>{if(e in this.classes)return;let s=this.classes[e]=[],l=(c,m)=>{if(!m)return;let b=Array.isArray(m)?m:m.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let w of b){let A=x=>{x in this.themeAffectedClassesBy?c in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][c].push(e):this.themeAffectedClassesBy[x][c]=[e]:this.themeAffectedClassesBy[x]={[c]:[e]},s.includes(x)||s.push(x)};if(h.includes(w)){f(w);for(let x of this.classes[w])A(x)}else A(w)}};l("",d?.[e]);for(let[c,m]of Object.entries(g))l(c,m?.[e])};for(let e of h)f(e);for(let e in this.themeAffectedClassesBy){let s=this.classesBy[e]=[];for(let l of Object.values(this.themeAffectedClassesBy[e]))for(let c of l)s.includes(c)||s.push(c)}let o=(e,s)=>{if(!s)return;let l=a(s,!0);for(let[c,m]of Object.entries(l)){let b=typeof m=="string"?{"":m}:m;for(let[w,A]of Object.entries(b)){let x=c+(w?"-"+w:"");x in this.colorThemesMap?this.colorThemesMap[x][e]=A:this.colorThemesMap[x]={[e]:A}}}for(let c in s)this.colorNames.includes(c)||this.colorNames.push(c)};if(o("",v),u)if(Array.isArray(u))this.themeNames.push(...u);else for(let e in u){let s=u[e];o(e,s.colors),this.themeNames.push(e)}let r=e=>{for(let[s,l]of Object.entries(this.colorThemesMap))for(let[c,m]of Object.entries(l))m.startsWith("#")||e(s,l,c,m)};if(r((e,s,l,c)=>{let m=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(c);if(m){let b="#"+(0,H.rgbToHex)(+m[1],+m[2],+m[3]);m[4]&&(b+=Math.round(255*+m[4]).toString(16)),s[l]=b}}),r((e,s,l,c)=>{let[m,b]=c.split("/"),w=this.colorThemesMap[m];if(w){let A=(l?w[l]:void 0)??w[""];s[l]=b?A.slice(0,7)+Math.round(255*+b).toString(16):A}else console.warn(`\`${c}\` doesn't exist in the extended config \`.colors\``),delete s[l],Object.keys(s).length||delete this.colorThemesMap[e]}),C)for(let e in C){let s=C[e],{native:l,values:c,colored:m}=s,b=s.match;if(s.id=e,s.native=l===!0?e.replace(/(?!^)[A-Z]/g,w=>"-"+w).toLowerCase():void 0,c&&(this.values[e]=a(c,!1)),b){let w=Object.keys(this.values[e]??{});b.includes("$values")&&(b=w.length?b.replace(/\$values/,w.join("|")):b.replace(/(?:\|)?\$values/,"")),m&&b.includes("$colors")&&(b=this.colorNames.length?b.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):b.replace(/(?:\|)?\$colors/,"")),this.matches[e]=new RegExp(b)}}}observe(t,i={subtree:!0,childList:!0}){if(this.root!==t){if(L&&t){this.root=t;let n=t===document;n&&(S.root=this),this.host=n?document.documentElement:this.root.host;let u=n?document.head:t,v=n?document.styleSheets:t.styleSheets;for(let R of v){let{ownerNode:p}=R;if(p.id==="master"){this.style=p;break}}if(this.style)for(let R=0;R<this.style.sheet.cssRules.length;R++){let p=this.style.sheet.cssRules[R];if(p.constructor.name==="CSSKeyframesRule")continue;let C=a=>{if(a.selectorText){let g=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<g.length;h++){let f=g[h];if(f[0]==="."){let o=f.slice(1),r="";for(let e=0;e<o.length;e++){let s=o[e],l=o[e+1];if(s==="\\"){if(e++,l!=="\\"){r+=l;continue}}else if(Q.SELECTOR_SYMBOLS.includes(s))break;r+=s}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let d=0;d<a.cssRules.length;d++){let g=C(a.cssRules[d]);if(g)return g}},B=C(p);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[R+a];R+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=V(),u.append(this.style);let E=R=>{R.forEach(p=>{p in this.countBy?this.countBy[p]++:(this.countBy[p]=1,this.insert(p))})};E(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(R=>E(R.classList)),this.observer=new MutationObserver(R=>{let p={},C=[],B=[],a=[],d=(o,r)=>{r?o.classList.forEach(h):o.classList.forEach(g);let e=o.children;for(let s=0;s<e.length;s++){let l=e[s];l.classList&&(B.push(l),d(l,r))}},g=o=>{o in p?p[o]++:p[o]=1},h=o=>{o in p?p[o]--:o in this.countBy&&(p[o]=-1)},f=(o,r)=>{for(let e=0;e<o.length;e++){let s=o[e];s.classList&&!B.includes(s)&&!a.includes(s)&&(s.isConnected!==r?(B.push(s),d(s,r)):a.push(s))}};for(let o=0;o<R.length;o++){let r=R[o],{addedNodes:e,removedNodes:s,type:l,target:c}=r;if(l==="attributes"){if(C.find(m=>m.target===c))continue;C.push(r)}else f(e,!1),(!c.isConnected||!B.includes(c))&&f(s,!0)}if(!(!C.length&&!Object.keys(p).length)){for(let{oldValue:o,target:r}of C){let e=B.includes(r),s=r.classList,l=o?o.split(" "):[];if(e){if(r.isConnected)continue;for(let c of l)s.contains(c)||h(c)}else if(r.isConnected){s.forEach(c=>{l.includes(c)||g(c)});for(let c of l)s.contains(c)||h(c)}}for(let o in p){let r=p[o],e=(this.countBy[o]||0)+r;e===0?(delete this.countBy[o],this.delete(o)):(o in this.countBy||this.insert(o),this.countBy[o]=e)}}}),this.observer.observe(t,{...i,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 t=this.style?.sheet;if(t?.cssRules)for(let i=t.cssRules.length-1;i>=0;i--)t.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(t){for(let i in this.config.rules){let n=this.config.rules[i],u=this.matches[i],{symbol:v,native:E}=n;if(u&&u.test(t))return{origin:"match",config:n};if(v&&t.startsWith(v))return{origin:"symbol",config:n};if(E&&t.startsWith(E+":"))return{origin:"match",config:n}}for(let i of this.semantics)if(t.match(i[0]))return{origin:"semantics",value:i[1]}}create(t){let i=n=>{if(n in this.ruleBy)return this.ruleBy[n];let u=this.match(n);if(u)return new D.Rule(n,u,this)};return(t in this.classes?this.classes[t].map(n=>i(n)):[i(t)]).filter(n=>n&&n.text)}refresh(t){if(t?.override?this.config=t:this.config=O(j.config,t),this.cache(),!this.style)return;let i=V();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let n in this.countBy)this.insert(n)}destroy(){let t=S.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let i=this.style?.sheet,n=u=>{let v=this.ruleBy[u];if(!(!v||u in this.classesBy&&this.classesBy[u].some(E=>E in this.countBy))){if(i&&v.natives.length){let E=v.natives[0];for(let R=0;R<i.cssRules.length;R++)if(i.cssRules[R]===E.cssRule){for(let C=0;C<v.natives.length;C++)i.deleteRule(R);break}}this.rules.splice(this.rules.indexOf(v),1),delete this.ruleBy[u],v.config.delete&&v.config.delete.call(v,u)}};if(t in this.classes){for(let u of this.classes[t])u in this.countBy||n(u);delete this.ruleBy[t]}else n(t)}insert(t){let i=this.create(t);return i.length?(this.insertRules(i),!0):!1}insertRules(t){for(let i of t){if(this.ruleBy[i.className])continue;let n,u=Object.keys(this.keyframes).length,v=this.rules.length-1,{media:E,order:R,priority:p,hasWhere:C,className:B}=i,a=(h,f,o)=>{let r=h;for(;r<=v;r++){let e=this.rules[r];if(f?.(e))return o?-1:r-1;if(o?.(e))return r}return o?-1:r-1},d,g;if(E){let h=this.rules.findIndex(f=>f.media);if(h===-1)n=v+1;else{let{"max-width":f,"min-width":o}=E.features;if(f||o){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)n=v+1;else if(f&&o){if(p===-1?(d=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),g=a(r,e=>e.priority!==-1)):(d=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),g=v),d!==-1){let e=f.value-o.value,s=g,l=d;for(d=void 0;s>=l;s--){let{"max-width":c,"min-width":m}=this.rules[s].media.features,b=c.value-m.value;if(b<e)g=s-1;else if(b===e)d=s;else break}}if(d!==-1){let e=f.value-o.value;for(let s=g;s>=d;s--){let{"max-width":l,"min-width":c}=this.rules[s].media.features,m=l.value-c.value;if(m<e)g=s-1;else if(m>e){d=s+1;break}}}}else if(o){if(p===-1?(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),g=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),g=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=g;e>=d;e--){let s=this.rules[e].media.features["min-width"].value;if(s>o.value)g=e-1;else if(s<o.value){d=e+1;break}}}else if(p===-1?(d=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),g=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),g=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=g;e>=d;e--){let s=this.rules[e].media.features["max-width"].value;if(s<f.value)g=e-1;else if(s>f.value){d=e+1;break}}}else p===-1?(d=h,g=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(d=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),g=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=u?1:0;p===-1?(d=h,g=a(h,f=>f.media||f.priority!==-1)):(d=a(h,f=>f.media,f=>f.priority!==-1),g=a(h,f=>f.media))}if(n===void 0)if(d===-1)n=g+1;else{if(p===-1)for(let h=d;h<=g;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)&&(C&&!f.hasWhere||f.order>=R)){n=h;break}}else for(let h=d;h<=g;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)){if(C&&!f.hasWhere){n=h;break}if(f.priority<p){n=h;break}else if(f.priority===p){if(f.order>=R){n=h;break}}else n=h+1}}n===void 0&&(n=g+1)}if(this.rules.splice(n,0,i),this.ruleBy[B]=i,this.style){let h=this.style.sheet,f=0,o=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return o(r-1);let s=e.natives[e.natives.length-1].cssRule;for(let l=0;l<h.cssRules.length;l++)if(h.cssRules[l]===s){f=l+1;break}}};o(n-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(t=>t.text).join("")}},M=S;T(M,"root"),T(M,"config",j.config),T(M,"instances",[]),T(M,"refresh",t=>{for(let i of S.instances)i.refresh(t)});L&&(window.MasterCSS=M);0&&(module.exports={MasterCSS});
|
|
1
|
+
var N=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var U=(y,t,i)=>t in y?N(y,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):y[t]=i;var Y=(y,t)=>{for(var i in t)N(y,i,{get:t[i],enumerable:!0})},G=(y,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Z(t))!q.call(y,u)&&u!==i&&N(y,u,{get:()=>t[u],enumerable:!(n=_(t,u))||n.enumerable});return y};var J=y=>G(N({},"__esModule",{value:!0}),y);var T=(y,t,i)=>(U(y,typeof t!="symbol"?t+"":t,i),i);var P={};Y(P,{MasterCSS:()=>M});module.exports=J(P);function I(y){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&y instanceof t||y instanceof Date||y instanceof RegExp)}function $(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let t=Buffer.alloc(y.length);return y.copy(t),t}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function F(y){let t=[];return y.forEach(function(i,n){typeof i=="object"&&i!==null?Array.isArray(i)?t[n]=F(i):I(i)?t[n]=$(i):t[n]=O({},i):t[n]=i}),t}function W(y,t){return t==="__proto__"?void 0:y[t]}function O(...y){let t={},i,n;return y.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(v){if(n=W(t,v),i=W(u,v),i!==t)if(typeof i!="object"||i===null){t[v]=i;return}else if(Array.isArray(i)){t[v]=F(i);return}else if(I(i)){t[v]=$(i);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[v]=O({},i);return}else{t[v]=O(n,i);return}})}),t}var D=require("./rule"),j=require("./config"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var L=typeof window<"u",V=()=>{let y=document.createElement("style");return y.id="master",y},S=class{constructor(t=j.config){this.config=t;t?.override||(this.config=O(j.config,t),"keyframes"in t&&Object.assign(this.config.keyframes,t.keyframes)),this.cache(),L&&this.config.observe&&this.observe(document),S.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:t,classes:i,selectors:n,themes:u,colors:v,values:E,breakpoints:R,mediaQueries:g,rules:C}=this.config;function B(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(e,s,l="",c={}){let m=x=>x?(l?l+"-":"")+x:l,b=Object.entries(e),w=[],A=[];for(let x of b){let k=x[1];(typeof k=="object"&&!Array.isArray(k)?w:A).push(x)}for(let[x,k]of w)a(k,s,m(x),c);if(s&&l)A.length&&(c[l]=A.reduce((x,[k,z])=>(x[k]=z,x),{}));else for(let[x,k]of A)c[m(x)]=k;return c}if(t)for(let[e,s]of Object.entries(a(t,!0)))this.semantics.push([new RegExp("^"+B(e)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[e,s]]);if(n)for(let[e,s]of Object.entries(a(n,!1))){let l=new RegExp(B(e)+"(?![a-z-])");for(let c of Array.isArray(s)?s:[s]){let m=c.match(/^::-[a-z]+-/m)?.[0]??"",b=this.selectors[m];b||(b=this.selectors[m]=[]);let w=b.find(([A])=>A===l);w||(w=[l,[]],b.push(w)),w[1].push(c)}}E&&(this.globalValues=a(E,!1)),R&&(this.breakpoints=a(R,!1)),g&&(this.mediaQueries=a(g,!1));let d=i?a(i,!1):{},p=u&&!Array.isArray(u)?Object.entries(u).filter(([,{classes:e}])=>e).reduce((e,[s,{classes:l}])=>(e[s]=a(l,!1),e),{}):{},h=[...Object.keys(d),...Object.entries(p).flatMap(([e,s])=>Object.keys(s))],f=e=>{if(e in this.classes)return;let s=this.classes[e]=[],l=(c,m)=>{if(!m)return;let b=Array.isArray(m)?m:m.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let w of b){let A=x=>{x in this.themeAffectedClassesBy?c in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][c].push(e):this.themeAffectedClassesBy[x][c]=[e]:this.themeAffectedClassesBy[x]={[c]:[e]},s.includes(x)||s.push(x)};if(h.includes(w)){f(w);for(let x of this.classes[w])A(x)}else A(w)}};l("",d?.[e]);for(let[c,m]of Object.entries(p))l(c,m?.[e])};for(let e of h)f(e);for(let e in this.themeAffectedClassesBy){let s=this.classesBy[e]=[];for(let l of Object.values(this.themeAffectedClassesBy[e]))for(let c of l)s.includes(c)||s.push(c)}let o=(e,s)=>{if(!s)return;let l=a(s,!0);for(let[c,m]of Object.entries(l)){let b=typeof m=="string"?{"":m}:m;for(let[w,A]of Object.entries(b)){let x=c+(w?"-"+w:"");x in this.colorThemesMap?this.colorThemesMap[x][e]=A:this.colorThemesMap[x]={[e]:A}}}for(let c in s)this.colorNames.includes(c)||this.colorNames.push(c)};if(o("",v),u)if(Array.isArray(u))this.themeNames.push(...u);else for(let e in u){let s=u[e];o(e,s.colors),this.themeNames.push(e)}let r=e=>{for(let[s,l]of Object.entries(this.colorThemesMap))for(let[c,m]of Object.entries(l))m.startsWith("#")||e(s,l,c,m)};if(r((e,s,l,c)=>{let m=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(c);if(m){let b="#"+(0,H.rgbToHex)(+m[1],+m[2],+m[3]);m[4]&&(b+=Math.round(255*+m[4]).toString(16)),s[l]=b}}),r((e,s,l,c)=>{let[m,b]=c.split("/"),w=this.colorThemesMap[m];if(w){let A=(l?w[l]:void 0)??w[""];s[l]=b?A.slice(0,7)+Math.round(255*+b).toString(16):A}else console.warn(`\`${c}\` doesn't exist in the extended config \`.colors\``),delete s[l],Object.keys(s).length||delete this.colorThemesMap[e]}),C)for(let e in C){let s=C[e],{native:l,values:c,colored:m}=s,b=s.match;if(s.id=e,s.native=l===!0?e.replace(/(?!^)[A-Z]/g,w=>"-"+w).toLowerCase():void 0,c&&(this.values[e]=a(c,!1)),b){let w=Object.keys(this.values[e]??{});b.includes("$values")&&(b=w.length?b.replace(/\$values/,w.join("|")):b.replace(/(?:\|)?\$values/,"")),m&&b.includes("$colors")&&(b=this.colorNames.length?b.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):b.replace(/(?:\|)?\$colors/,"")),this.matches[e]=new RegExp(b)}}}observe(t,i={subtree:!0,childList:!0}){if(this.root!==t){if(L&&t){this.root=t;let n=t===document;n&&(S.root=this),this.host=n?document.documentElement:this.root.host;let u=n?document.head:t,v=n?document.styleSheets:t.styleSheets;for(let R of v){let{ownerNode:g}=R;if(g&&g.id==="master"){this.style=g;break}}if(this.style)for(let R=0;R<this.style.sheet.cssRules.length;R++){let g=this.style.sheet.cssRules[R];if(g.constructor.name==="CSSKeyframesRule")continue;let C=a=>{if(a.selectorText){let p=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<p.length;h++){let f=p[h];if(f[0]==="."){let o=f.slice(1),r="";for(let e=0;e<o.length;e++){let s=o[e],l=o[e+1];if(s==="\\"){if(e++,l!=="\\"){r+=l;continue}}else if(Q.SELECTOR_SYMBOLS.includes(s))break;r+=s}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let d=0;d<a.cssRules.length;d++){let p=C(a.cssRules[d]);if(p)return p}},B=C(g);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[R+a];R+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=V(),u.append(this.style);let E=R=>{R.forEach(g=>{g in this.countBy?this.countBy[g]++:(this.countBy[g]=1,this.insert(g))})};E(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(R=>E(R.classList)),this.observer=new MutationObserver(R=>{let g={},C=[],B=[],a=[],d=(o,r)=>{r?o.classList.forEach(h):o.classList.forEach(p);let e=o.children;for(let s=0;s<e.length;s++){let l=e[s];l.classList&&(B.push(l),d(l,r))}},p=o=>{o in g?g[o]++:g[o]=1},h=o=>{o in g?g[o]--:o in this.countBy&&(g[o]=-1)},f=(o,r)=>{for(let e=0;e<o.length;e++){let s=o[e];s.classList&&!B.includes(s)&&!a.includes(s)&&(s.isConnected!==r?(B.push(s),d(s,r)):a.push(s))}};for(let o=0;o<R.length;o++){let r=R[o],{addedNodes:e,removedNodes:s,type:l,target:c}=r;if(l==="attributes"){if(C.find(m=>m.target===c))continue;C.push(r)}else f(e,!1),(!c.isConnected||!B.includes(c))&&f(s,!0)}if(!(!C.length&&!Object.keys(g).length)){for(let{oldValue:o,target:r}of C){let e=B.includes(r),s=r.classList,l=o?o.split(" "):[];if(e){if(r.isConnected)continue;for(let c of l)s.contains(c)||h(c)}else if(r.isConnected){s.forEach(c=>{l.includes(c)||p(c)});for(let c of l)s.contains(c)||h(c)}}for(let o in g){let r=g[o],e=(this.countBy[o]||0)+r;e===0?(delete this.countBy[o],this.delete(o)):(o in this.countBy||this.insert(o),this.countBy[o]=e)}}}),this.observer.observe(t,{...i,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 t=this.style?.sheet;if(t?.cssRules)for(let i=t.cssRules.length-1;i>=0;i--)t.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(t){for(let i in this.config.rules){let n=this.config.rules[i],u=this.matches[i],{symbol:v,native:E}=n;if(u&&u.test(t))return{origin:"match",config:n};if(v&&t.startsWith(v))return{origin:"symbol",config:n};if(E&&t.startsWith(E+":"))return{origin:"match",config:n}}for(let i of this.semantics)if(t.match(i[0]))return{origin:"semantics",value:i[1]}}create(t){let i=n=>{if(n in this.ruleBy)return this.ruleBy[n];let u=this.match(n);if(u)return new D.Rule(n,u,this)};return(t in this.classes?this.classes[t].map(n=>i(n)):[i(t)]).filter(n=>n&&n.text)}refresh(t){if(t?.override?this.config=t:this.config=O(j.config,t),this.cache(),!this.style)return;let i=V();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let n in this.countBy)this.insert(n)}destroy(){let t=S.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let i=this.style?.sheet,n=u=>{let v=this.ruleBy[u];if(!(!v||u in this.classesBy&&this.classesBy[u].some(E=>E in this.countBy))){if(i&&v.natives.length){let E=v.natives[0];for(let R=0;R<i.cssRules.length;R++)if(i.cssRules[R]===E.cssRule){for(let C=0;C<v.natives.length;C++)i.deleteRule(R);break}}this.rules.splice(this.rules.indexOf(v),1),delete this.ruleBy[u],v.config.delete&&v.config.delete.call(v,u)}};if(t in this.classes){for(let u of this.classes[t])u in this.countBy||n(u);delete this.ruleBy[t]}else n(t)}insert(t){let i=this.create(t);return i.length?(this.insertRules(i),!0):!1}insertRules(t){for(let i of t){if(this.ruleBy[i.className])continue;let n,u=Object.keys(this.keyframes).length,v=this.rules.length-1,{media:E,order:R,priority:g,hasWhere:C,className:B}=i,a=(h,f,o)=>{let r=h;for(;r<=v;r++){let e=this.rules[r];if(f?.(e))return o?-1:r-1;if(o?.(e))return r}return o?-1:r-1},d,p;if(E){let h=this.rules.findIndex(f=>f.media);if(h===-1)n=v+1;else{let{"max-width":f,"min-width":o}=E.features;if(f||o){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)n=v+1;else if(f&&o){if(g===-1?(d=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.priority!==-1)):(d=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=v),d!==-1){let e=f.value-o.value,s=p,l=d;for(d=void 0;s>=l;s--){let{"max-width":c,"min-width":m}=this.rules[s].media.features,b=c.value-m.value;if(b<e)p=s-1;else if(b===e)d=s;else break}}if(d!==-1){let e=f.value-o.value;for(let s=p;s>=d;s--){let{"max-width":l,"min-width":c}=this.rules[s].media.features,m=l.value-c.value;if(m<e)p=s-1;else if(m>e){d=s+1;break}}}}else if(o){if(g===-1?(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=p;e>=d;e--){let s=this.rules[e].media.features["min-width"].value;if(s>o.value)p=e-1;else if(s<o.value){d=e+1;break}}}else if(g===-1?(d=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),p=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=p;e>=d;e--){let s=this.rules[e].media.features["max-width"].value;if(s<f.value)p=e-1;else if(s>f.value){d=e+1;break}}}else g===-1?(d=h,p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(d=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=u?1:0;g===-1?(d=h,p=a(h,f=>f.media||f.priority!==-1)):(d=a(h,f=>f.media,f=>f.priority!==-1),p=a(h,f=>f.media))}if(n===void 0)if(d===-1)n=p+1;else{if(g===-1)for(let h=d;h<=p;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)&&(C&&!f.hasWhere||f.order>=R)){n=h;break}}else for(let h=d;h<=p;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)){if(C&&!f.hasWhere){n=h;break}if(f.priority<g){n=h;break}else if(f.priority===g){if(f.order>=R){n=h;break}}else n=h+1}}n===void 0&&(n=p+1)}if(this.rules.splice(n,0,i),this.ruleBy[B]=i,this.style){let h=this.style.sheet,f=0,o=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return o(r-1);let s=e.natives[e.natives.length-1].cssRule;for(let l=0;l<h.cssRules.length;l++)if(h.cssRules[l]===s){f=l+1;break}}};o(n-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(t=>t.text).join("")}},M=S;T(M,"root"),T(M,"config",j.config),T(M,"instances",[]),T(M,"refresh",t=>{for(let i of S.instances)i.refresh(t)});L&&(window.MasterCSS=M);0&&(module.exports={MasterCSS});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m={$:{name:"var",transform(r){return"--"+r}},calc:{transform(r){let o=this.values,f=this.css.globalValues,u="",s,e="",g=!1,c="",l=!0,n=(i,t="",a="")=>{if(s===2&&!g){let d=this.analyzeUnitValue(e,m.calc.unit);d&&(e=d.value+d.unit)}i!=="("?o&&e in o?e=o[e].toString():f&&e in f&&(e=f[e].toString()):c=e,i===")"&&(c=""),u+=e+t+i+a,s=null,g=!1,e=""};for(let i=0;i<r.length;i++){let t=r[i];if(t==="("||t===")"){n(t),l=!0;continue}else if(t===",")n(t,""," ");else if(t==="-"&&s!==1){let a=r[i-1];a==="("?u+=t:a===")"?n(t," "," "):isNaN(+r[i+1])?a==="-"?(n(t),s=1):n(t,l?"":" ",l?"":" "):n(t,e?" ":"",e?" ":"")}else if(t==="+"||t==="*"||t==="/"||c!=="var"&&t==="-")n(t," "," ");else{switch(s){case 1:break;case 2:t!=="."&&!/[0-9]/.test(t)&&(g=!0);break;default:s=isNaN(+t)?1:2}s?e+=t:u+=t}l=!1}return n(""),u}},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:""}};export{m as functions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{START_SYMBOLS as g}from"../constants/start-symbol.mjs";import{cssEscape as x}from"../utils/css-escape.mjs";var y={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(o,r)=>{let a=r.indexOf(":");if(a!==-1){o in t||(t[o]={});let c=t[o],h=r.slice(0,a);h in c||(c[h]=r.slice(a+1))}},u=o=>{let r=(a,c)=>{let h=c.slice(x(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let f of h)i(a,f)};if(this.theme){let a=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);a&&r(this.theme,a.text)}else for(let a of o.natives)r(a.theme,a.text)},d=[],n="",s=()=>{n&&(d.push(n.replace(/ /g,"")),n="")},m=1;(function o(r){for(;m<e.length;m++){let a=e[m];if(!r){if(a===";"){s();continue}if(a==="}")break}if(n+=a,r===a){if(r==="'"||r==='"'){let c=0;for(let h=n.length-2;n[h]==="\\";h--)c++;if(c%2)continue}break}else a in g&&r!=="'"&&r!=='"'&&(m++,o(g[a]))}})(void 0),s();for(let o of d){let r=this.css.create(o);if(Array.isArray(r))for(let a of r)u(a);else r?u(r):i(this.theme??"",o)}let l={};for(let o in t)for(let[r,a]of Object.entries(t[o]))r in l?l[r][o]=a:l[r]={[o]:a};return l}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},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(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"}}}},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(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},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(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},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(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,height:i}}},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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"min-height":i}}},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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"max-height":i}}},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(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},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(e,t){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},overflowY:{native:!0,declare(e,t){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{native:!0,order:-1,declare(e,t){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},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:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},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},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:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return v.call(this,e)},delete(e){return b.call(this,e)},insert(){return p.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return v.call(this,e)},delete(e){return b.call(this,e)},insert(){return p.call(this)}},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(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},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(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},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(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},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(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},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(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},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(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},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(e){if(e.startsWith("gradient"))return["linear-"+e];let t=e.indexOf(":");return this.prefix=e.slice(0,t+1),[e.slice(t+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(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},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(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{match:"^grid-rows:.",declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",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(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},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:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},scrollPadding:{match:"^sp:.",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(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},C=y;function v(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function b(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let u=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(u),e.natives.splice(u,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function p(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:u}=this.css,d=i?.sheet;for(let n of this.keyframeNames)if(n in t)t[n].count++;else{let s={text:`@keyframes ${n}{`+Object.entries(e.keyframes[n]).map(([l,o])=>`${l}{${Object.entries(o).map(([r,a])=>r+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=u[0]).natives.push(s):u.splice(0,0,m={natives:[s],get text(){return this.natives.map(l=>l.text).join("")}}),d){let l;for(let o=0;o<d.cssRules.length;o++){let r=d.cssRules[o];if(r.constructor.name!=="CSSKeyframesRule")break;if(r.name===n){l=r;break}}if(l)s.cssRule=l;else{let o=m.natives.length-1;d.insertRule(s.text,o),s.cssRule=d.cssRules[o]}}t[n]={native:s,count:1}}}}export{C as rules};
|
|
1
|
+
import{START_SYMBOLS as b}from"../constants/start-symbol.mjs";import{cssEscape as x}from"../utils/css-escape.mjs";var y={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(r,o)=>{let a=o.indexOf(":");if(a!==-1){r in t||(t[r]={});let s=t[r],h=o.slice(0,a);h in s||(s[h]=o.slice(a+1))}},u=r=>{let o=(a,s)=>{let h=s.slice(x(r.className).length).match(/\{(.*)\}/)[1].split(";");for(let p of h)i(a,p)};if(this.theme){let a=r.natives.find(s=>s.theme===this.theme)??r.natives.find(s=>!s.theme);a&&o(this.theme,a.text)}else for(let a of r.natives)o(a.theme,a.text);if(r.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let a of r.keyframeNames)this.keyframeNames.includes(a)||this.keyframeNames.push(a)}},d=[],n="",c=()=>{n&&(d.push(n.replace(/ /g,"|")),n="")},m=1;(function r(o){for(;m<e.length;m++){let a=e[m];if(!o){if(a===";"){c();continue}if(a==="}")break}if(n+=a,o===a){if(o==="'"||o==='"'){let s=0;for(let h=n.length-2;n[h]==="\\";h--)s++;if(s%2)continue}break}else a in b&&o!=="'"&&o!=='"'&&(m++,r(b[a]))}})(void 0),c();for(let r of d){let o=this.css.create(r);if(Array.isArray(o))for(let a of o)u(a);else o?u(o):i(this.theme??"",r)}let l={};for(let r in t)for(let[o,a]of Object.entries(t[r]))o in l?l[o][r]=a:l[o]={[r]:a};return l},delete(){return g.call(this)},insert(){return v.call(this)}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},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(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"}}}},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(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},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(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},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(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,height:i}}},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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"min-height":i}}},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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"max-height":i}}},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(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},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(e,t){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},overflowY:{native:!0,declare(e,t){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{native:!0,order:-1,declare(e,t){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},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:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},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},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:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return f.call(this,e)},delete(){return g.call(this)},insert(){return v.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return f.call(this,e)},delete(){return g.call(this)},insert(){return v.call(this)}},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(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},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(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},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(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},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(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},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(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},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(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},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(e){if(e.startsWith("gradient"))return["linear-"+e];let t=e.indexOf(":");return this.prefix=e.slice(0,t+1),[e.slice(t+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(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},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(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{match:"^grid-rows:.",declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",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(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},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:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},scrollPadding:{match:"^sp:.",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(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},C=y;function f(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function g(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let u=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(u),e.natives.splice(u,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function v(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:u}=this.css,d=i?.sheet;for(let n of this.keyframeNames)if(n in t)t[n].count++;else{let c={text:`@keyframes ${n}{`+Object.entries(e.keyframes[n]).map(([l,r])=>`${l}{${Object.entries(r).map(([o,a])=>o+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=u[0]).natives.push(c):u.splice(0,0,m={natives:[c],get text(){return this.natives.map(l=>l.text).join("")}}),d){let l;for(let r=0;r<d.cssRules.length;r++){let o=d.cssRules[r];if(o.constructor.name!=="CSSKeyframesRule")break;if(o.name===n){l=o;break}}if(l)c.cssRule=l;else{let r=m.natives.length-1;d.insertRule(c.text,r),c.cssRule=d.cssRules[r]}}t[n]={native:c,count:1}}}}export{C as rules};
|
package/dist/esm/css.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty;var H=(v,t,i)=>t in v?D(v,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):v[t]=i;var S=(v,t,i)=>(H(v,typeof t!="symbol"?t+"":t,i),i);function W(v){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&v instanceof t||v instanceof Date||v instanceof RegExp)}function I(v){if(typeof Buffer<"u"&&Buffer&&v instanceof Buffer){let t=Buffer.alloc(v.length);return v.copy(t),t}else{if(v instanceof Date)return new Date(v.getTime());if(v instanceof RegExp)return new RegExp(v);throw new Error("Unexpected situation")}}function $(v){let t=[];return v.forEach(function(i,n){typeof i=="object"&&i!==null?Array.isArray(i)?t[n]=$(i):W(i)?t[n]=I(i):t[n]=M({},i):t[n]=i}),t}function L(v,t){return t==="__proto__"?void 0:v[t]}function M(...v){let t={},i,n;return v.forEach(function(y){typeof y!="object"||y===null||Array.isArray(y)||Object.keys(y).forEach(function(b){if(n=L(t,b),i=L(y,b),i!==t)if(typeof i!="object"||i===null){t[b]=i;return}else if(Array.isArray(i)){t[b]=$(i);return}else if(W(i)){t[b]=I(i);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[b]=M({},i);return}else{t[b]=M(n,i);return}})}),t}import{Rule as Q}from"./rule.mjs";import{config as T}from"./config/index.mjs";import{rgbToHex as z}from"./utils/rgb-to-hex.mjs";import{SELECTOR_SYMBOLS as _}from"./constants/selector-symbols.mjs";var N=typeof window<"u",F=()=>{let v=document.createElement("style");return v.id="master",v},O=class{constructor(t=T){this.config=t;t?.override||(this.config=M(T,t),"keyframes"in t&&Object.assign(this.config.keyframes,t.keyframes)),this.cache(),N&&this.config.observe&&this.observe(document),O.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:t,classes:i,selectors:n,themes:y,colors:b,values:E,breakpoints:R,mediaQueries:g,rules:C}=this.config;function B(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(e,s,l="",c={}){let d=x=>x?(l?l+"-":"")+x:l,p=Object.entries(e),w=[],A=[];for(let x of p){let j=x[1];(typeof j=="object"&&!Array.isArray(j)?w:A).push(x)}for(let[x,j]of w)a(j,s,d(x),c);if(s&&l)A.length&&(c[l]=A.reduce((x,[j,V])=>(x[j]=V,x),{}));else for(let[x,j]of A)c[d(x)]=j;return c}if(t)for(let[e,s]of Object.entries(a(t,!0)))this.semantics.push([new RegExp("^"+B(e)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[e,s]]);if(n)for(let[e,s]of Object.entries(a(n,!1))){let l=new RegExp(B(e)+"(?![a-z-])");for(let c of Array.isArray(s)?s:[s]){let d=c.match(/^::-[a-z]+-/m)?.[0]??"",p=this.selectors[d];p||(p=this.selectors[d]=[]);let w=p.find(([A])=>A===l);w||(w=[l,[]],p.push(w)),w[1].push(c)}}E&&(this.globalValues=a(E,!1)),R&&(this.breakpoints=a(R,!1)),g&&(this.mediaQueries=a(g,!1));let u=i?a(i,!1):{},m=y&&!Array.isArray(y)?Object.entries(y).filter(([,{classes:e}])=>e).reduce((e,[s,{classes:l}])=>(e[s]=a(l,!1),e),{}):{},h=[...Object.keys(u),...Object.entries(m).flatMap(([e,s])=>Object.keys(s))],f=e=>{if(e in this.classes)return;let s=this.classes[e]=[],l=(c,d)=>{if(!d)return;let p=Array.isArray(d)?d:d.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let w of p){let A=x=>{x in this.themeAffectedClassesBy?c in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][c].push(e):this.themeAffectedClassesBy[x][c]=[e]:this.themeAffectedClassesBy[x]={[c]:[e]},s.includes(x)||s.push(x)};if(h.includes(w)){f(w);for(let x of this.classes[w])A(x)}else A(w)}};l("",u?.[e]);for(let[c,d]of Object.entries(m))l(c,d?.[e])};for(let e of h)f(e);for(let e in this.themeAffectedClassesBy){let s=this.classesBy[e]=[];for(let l of Object.values(this.themeAffectedClassesBy[e]))for(let c of l)s.includes(c)||s.push(c)}let o=(e,s)=>{if(!s)return;let l=a(s,!0);for(let[c,d]of Object.entries(l)){let p=typeof d=="string"?{"":d}:d;for(let[w,A]of Object.entries(p)){let x=c+(w?"-"+w:"");x in this.colorThemesMap?this.colorThemesMap[x][e]=A:this.colorThemesMap[x]={[e]:A}}}for(let c in s)this.colorNames.includes(c)||this.colorNames.push(c)};if(o("",b),y)if(Array.isArray(y))this.themeNames.push(...y);else for(let e in y){let s=y[e];o(e,s.colors),this.themeNames.push(e)}let r=e=>{for(let[s,l]of Object.entries(this.colorThemesMap))for(let[c,d]of Object.entries(l))d.startsWith("#")||e(s,l,c,d)};if(r((e,s,l,c)=>{let d=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(c);if(d){let p="#"+z(+d[1],+d[2],+d[3]);d[4]&&(p+=Math.round(255*+d[4]).toString(16)),s[l]=p}}),r((e,s,l,c)=>{let[d,p]=c.split("/"),w=this.colorThemesMap[d];if(w){let A=(l?w[l]:void 0)??w[""];s[l]=p?A.slice(0,7)+Math.round(255*+p).toString(16):A}else console.warn(`\`${c}\` doesn't exist in the extended config \`.colors\``),delete s[l],Object.keys(s).length||delete this.colorThemesMap[e]}),C)for(let e in C){let s=C[e],{native:l,values:c,colored:d}=s,p=s.match;if(s.id=e,s.native=l===!0?e.replace(/(?!^)[A-Z]/g,w=>"-"+w).toLowerCase():void 0,c&&(this.values[e]=a(c,!1)),p){let w=Object.keys(this.values[e]??{});p.includes("$values")&&(p=w.length?p.replace(/\$values/,w.join("|")):p.replace(/(?:\|)?\$values/,"")),d&&p.includes("$colors")&&(p=this.colorNames.length?p.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):p.replace(/(?:\|)?\$colors/,"")),this.matches[e]=new RegExp(p)}}}observe(t,i={subtree:!0,childList:!0}){if(this.root!==t){if(N&&t){this.root=t;let n=t===document;n&&(O.root=this),this.host=n?document.documentElement:this.root.host;let y=n?document.head:t,b=n?document.styleSheets:t.styleSheets;for(let R of b){let{ownerNode:g}=R;if(g.id==="master"){this.style=g;break}}if(this.style)for(let R=0;R<this.style.sheet.cssRules.length;R++){let g=this.style.sheet.cssRules[R];if(g.constructor.name==="CSSKeyframesRule")continue;let C=a=>{if(a.selectorText){let m=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<m.length;h++){let f=m[h];if(f[0]==="."){let o=f.slice(1),r="";for(let e=0;e<o.length;e++){let s=o[e],l=o[e+1];if(s==="\\"){if(e++,l!=="\\"){r+=l;continue}}else if(_.includes(s))break;r+=s}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let u=0;u<a.cssRules.length;u++){let m=C(a.cssRules[u]);if(m)return m}},B=C(g);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[R+a];R+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=F(),y.append(this.style);let E=R=>{R.forEach(g=>{g in this.countBy?this.countBy[g]++:(this.countBy[g]=1,this.insert(g))})};E(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(R=>E(R.classList)),this.observer=new MutationObserver(R=>{let g={},C=[],B=[],a=[],u=(o,r)=>{r?o.classList.forEach(h):o.classList.forEach(m);let e=o.children;for(let s=0;s<e.length;s++){let l=e[s];l.classList&&(B.push(l),u(l,r))}},m=o=>{o in g?g[o]++:g[o]=1},h=o=>{o in g?g[o]--:o in this.countBy&&(g[o]=-1)},f=(o,r)=>{for(let e=0;e<o.length;e++){let s=o[e];s.classList&&!B.includes(s)&&!a.includes(s)&&(s.isConnected!==r?(B.push(s),u(s,r)):a.push(s))}};for(let o=0;o<R.length;o++){let r=R[o],{addedNodes:e,removedNodes:s,type:l,target:c}=r;if(l==="attributes"){if(C.find(d=>d.target===c))continue;C.push(r)}else f(e,!1),(!c.isConnected||!B.includes(c))&&f(s,!0)}if(!(!C.length&&!Object.keys(g).length)){for(let{oldValue:o,target:r}of C){let e=B.includes(r),s=r.classList,l=o?o.split(" "):[];if(e){if(r.isConnected)continue;for(let c of l)s.contains(c)||h(c)}else if(r.isConnected){s.forEach(c=>{l.includes(c)||m(c)});for(let c of l)s.contains(c)||h(c)}}for(let o in g){let r=g[o],e=(this.countBy[o]||0)+r;e===0?(delete this.countBy[o],this.delete(o)):(o in this.countBy||this.insert(o),this.countBy[o]=e)}}}),this.observer.observe(t,{...i,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 t=this.style?.sheet;if(t?.cssRules)for(let i=t.cssRules.length-1;i>=0;i--)t.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(t){for(let i in this.config.rules){let n=this.config.rules[i],y=this.matches[i],{symbol:b,native:E}=n;if(y&&y.test(t))return{origin:"match",config:n};if(b&&t.startsWith(b))return{origin:"symbol",config:n};if(E&&t.startsWith(E+":"))return{origin:"match",config:n}}for(let i of this.semantics)if(t.match(i[0]))return{origin:"semantics",value:i[1]}}create(t){let i=n=>{if(n in this.ruleBy)return this.ruleBy[n];let y=this.match(n);if(y)return new Q(n,y,this)};return(t in this.classes?this.classes[t].map(n=>i(n)):[i(t)]).filter(n=>n&&n.text)}refresh(t){if(t?.override?this.config=t:this.config=M(T,t),this.cache(),!this.style)return;let i=F();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let n in this.countBy)this.insert(n)}destroy(){let t=O.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let i=this.style?.sheet,n=y=>{let b=this.ruleBy[y];if(!(!b||y in this.classesBy&&this.classesBy[y].some(E=>E in this.countBy))){if(i&&b.natives.length){let E=b.natives[0];for(let R=0;R<i.cssRules.length;R++)if(i.cssRules[R]===E.cssRule){for(let C=0;C<b.natives.length;C++)i.deleteRule(R);break}}this.rules.splice(this.rules.indexOf(b),1),delete this.ruleBy[y],b.config.delete&&b.config.delete.call(b,y)}};if(t in this.classes){for(let y of this.classes[t])y in this.countBy||n(y);delete this.ruleBy[t]}else n(t)}insert(t){let i=this.create(t);return i.length?(this.insertRules(i),!0):!1}insertRules(t){for(let i of t){if(this.ruleBy[i.className])continue;let n,y=Object.keys(this.keyframes).length,b=this.rules.length-1,{media:E,order:R,priority:g,hasWhere:C,className:B}=i,a=(h,f,o)=>{let r=h;for(;r<=b;r++){let e=this.rules[r];if(f?.(e))return o?-1:r-1;if(o?.(e))return r}return o?-1:r-1},u,m;if(E){let h=this.rules.findIndex(f=>f.media);if(h===-1)n=b+1;else{let{"max-width":f,"min-width":o}=E.features;if(f||o){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)n=b+1;else if(f&&o){if(g===-1?(u=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),m=a(r,e=>e.priority!==-1)):(u=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),m=b),u!==-1){let e=f.value-o.value,s=m,l=u;for(u=void 0;s>=l;s--){let{"max-width":c,"min-width":d}=this.rules[s].media.features,p=c.value-d.value;if(p<e)m=s-1;else if(p===e)u=s;else break}}if(u!==-1){let e=f.value-o.value;for(let s=m;s>=u;s--){let{"max-width":l,"min-width":c}=this.rules[s].media.features,d=l.value-c.value;if(d<e)m=s-1;else if(d>e){u=s+1;break}}}}else if(o){if(g===-1?(u=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(u=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),u!==-1)for(let e=m;e>=u;e--){let s=this.rules[e].media.features["min-width"].value;if(s>o.value)m=e-1;else if(s<o.value){u=e+1;break}}}else if(g===-1?(u=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),m=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(u=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),m=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),u!==-1)for(let e=m;e>=u;e--){let s=this.rules[e].media.features["max-width"].value;if(s<f.value)m=e-1;else if(s>f.value){u=e+1;break}}}else g===-1?(u=h,m=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(u=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),m=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=y?1:0;g===-1?(u=h,m=a(h,f=>f.media||f.priority!==-1)):(u=a(h,f=>f.media,f=>f.priority!==-1),m=a(h,f=>f.media))}if(n===void 0)if(u===-1)n=m+1;else{if(g===-1)for(let h=u;h<=m;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)&&(C&&!f.hasWhere||f.order>=R)){n=h;break}}else for(let h=u;h<=m;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)){if(C&&!f.hasWhere){n=h;break}if(f.priority<g){n=h;break}else if(f.priority===g){if(f.order>=R){n=h;break}}else n=h+1}}n===void 0&&(n=m+1)}if(this.rules.splice(n,0,i),this.ruleBy[B]=i,this.style){let h=this.style.sheet,f=0,o=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return o(r-1);let s=e.natives[e.natives.length-1].cssRule;for(let l=0;l<h.cssRules.length;l++)if(h.cssRules[l]===s){f=l+1;break}}};o(n-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(t=>t.text).join("")}},k=O;S(k,"root"),S(k,"config",T),S(k,"instances",[]),S(k,"refresh",t=>{for(let i of O.instances)i.refresh(t)});N&&(window.MasterCSS=k);export{k as MasterCSS};
|
|
1
|
+
var D=Object.defineProperty;var H=(v,t,i)=>t in v?D(v,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):v[t]=i;var S=(v,t,i)=>(H(v,typeof t!="symbol"?t+"":t,i),i);function W(v){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&v instanceof t||v instanceof Date||v instanceof RegExp)}function I(v){if(typeof Buffer<"u"&&Buffer&&v instanceof Buffer){let t=Buffer.alloc(v.length);return v.copy(t),t}else{if(v instanceof Date)return new Date(v.getTime());if(v instanceof RegExp)return new RegExp(v);throw new Error("Unexpected situation")}}function $(v){let t=[];return v.forEach(function(i,n){typeof i=="object"&&i!==null?Array.isArray(i)?t[n]=$(i):W(i)?t[n]=I(i):t[n]=M({},i):t[n]=i}),t}function L(v,t){return t==="__proto__"?void 0:v[t]}function M(...v){let t={},i,n;return v.forEach(function(g){typeof g!="object"||g===null||Array.isArray(g)||Object.keys(g).forEach(function(b){if(n=L(t,b),i=L(g,b),i!==t)if(typeof i!="object"||i===null){t[b]=i;return}else if(Array.isArray(i)){t[b]=$(i);return}else if(W(i)){t[b]=I(i);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[b]=M({},i);return}else{t[b]=M(n,i);return}})}),t}import{Rule as Q}from"./rule.mjs";import{config as T}from"./config/index.mjs";import{rgbToHex as z}from"./utils/rgb-to-hex.mjs";import{SELECTOR_SYMBOLS as _}from"./constants/selector-symbols.mjs";var N=typeof window<"u",F=()=>{let v=document.createElement("style");return v.id="master",v},O=class{constructor(t=T){this.config=t;t?.override||(this.config=M(T,t),"keyframes"in t&&Object.assign(this.config.keyframes,t.keyframes)),this.cache(),N&&this.config.observe&&this.observe(document),O.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:t,classes:i,selectors:n,themes:g,colors:b,values:E,breakpoints:R,mediaQueries:m,rules:C}=this.config;function B(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(e,s,l="",c={}){let d=x=>x?(l?l+"-":"")+x:l,p=Object.entries(e),w=[],A=[];for(let x of p){let j=x[1];(typeof j=="object"&&!Array.isArray(j)?w:A).push(x)}for(let[x,j]of w)a(j,s,d(x),c);if(s&&l)A.length&&(c[l]=A.reduce((x,[j,V])=>(x[j]=V,x),{}));else for(let[x,j]of A)c[d(x)]=j;return c}if(t)for(let[e,s]of Object.entries(a(t,!0)))this.semantics.push([new RegExp("^"+B(e)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[e,s]]);if(n)for(let[e,s]of Object.entries(a(n,!1))){let l=new RegExp(B(e)+"(?![a-z-])");for(let c of Array.isArray(s)?s:[s]){let d=c.match(/^::-[a-z]+-/m)?.[0]??"",p=this.selectors[d];p||(p=this.selectors[d]=[]);let w=p.find(([A])=>A===l);w||(w=[l,[]],p.push(w)),w[1].push(c)}}E&&(this.globalValues=a(E,!1)),R&&(this.breakpoints=a(R,!1)),m&&(this.mediaQueries=a(m,!1));let u=i?a(i,!1):{},y=g&&!Array.isArray(g)?Object.entries(g).filter(([,{classes:e}])=>e).reduce((e,[s,{classes:l}])=>(e[s]=a(l,!1),e),{}):{},h=[...Object.keys(u),...Object.entries(y).flatMap(([e,s])=>Object.keys(s))],f=e=>{if(e in this.classes)return;let s=this.classes[e]=[],l=(c,d)=>{if(!d)return;let p=Array.isArray(d)?d:d.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let w of p){let A=x=>{x in this.themeAffectedClassesBy?c in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][c].push(e):this.themeAffectedClassesBy[x][c]=[e]:this.themeAffectedClassesBy[x]={[c]:[e]},s.includes(x)||s.push(x)};if(h.includes(w)){f(w);for(let x of this.classes[w])A(x)}else A(w)}};l("",u?.[e]);for(let[c,d]of Object.entries(y))l(c,d?.[e])};for(let e of h)f(e);for(let e in this.themeAffectedClassesBy){let s=this.classesBy[e]=[];for(let l of Object.values(this.themeAffectedClassesBy[e]))for(let c of l)s.includes(c)||s.push(c)}let o=(e,s)=>{if(!s)return;let l=a(s,!0);for(let[c,d]of Object.entries(l)){let p=typeof d=="string"?{"":d}:d;for(let[w,A]of Object.entries(p)){let x=c+(w?"-"+w:"");x in this.colorThemesMap?this.colorThemesMap[x][e]=A:this.colorThemesMap[x]={[e]:A}}}for(let c in s)this.colorNames.includes(c)||this.colorNames.push(c)};if(o("",b),g)if(Array.isArray(g))this.themeNames.push(...g);else for(let e in g){let s=g[e];o(e,s.colors),this.themeNames.push(e)}let r=e=>{for(let[s,l]of Object.entries(this.colorThemesMap))for(let[c,d]of Object.entries(l))d.startsWith("#")||e(s,l,c,d)};if(r((e,s,l,c)=>{let d=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(c);if(d){let p="#"+z(+d[1],+d[2],+d[3]);d[4]&&(p+=Math.round(255*+d[4]).toString(16)),s[l]=p}}),r((e,s,l,c)=>{let[d,p]=c.split("/"),w=this.colorThemesMap[d];if(w){let A=(l?w[l]:void 0)??w[""];s[l]=p?A.slice(0,7)+Math.round(255*+p).toString(16):A}else console.warn(`\`${c}\` doesn't exist in the extended config \`.colors\``),delete s[l],Object.keys(s).length||delete this.colorThemesMap[e]}),C)for(let e in C){let s=C[e],{native:l,values:c,colored:d}=s,p=s.match;if(s.id=e,s.native=l===!0?e.replace(/(?!^)[A-Z]/g,w=>"-"+w).toLowerCase():void 0,c&&(this.values[e]=a(c,!1)),p){let w=Object.keys(this.values[e]??{});p.includes("$values")&&(p=w.length?p.replace(/\$values/,w.join("|")):p.replace(/(?:\|)?\$values/,"")),d&&p.includes("$colors")&&(p=this.colorNames.length?p.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):p.replace(/(?:\|)?\$colors/,"")),this.matches[e]=new RegExp(p)}}}observe(t,i={subtree:!0,childList:!0}){if(this.root!==t){if(N&&t){this.root=t;let n=t===document;n&&(O.root=this),this.host=n?document.documentElement:this.root.host;let g=n?document.head:t,b=n?document.styleSheets:t.styleSheets;for(let R of b){let{ownerNode:m}=R;if(m&&m.id==="master"){this.style=m;break}}if(this.style)for(let R=0;R<this.style.sheet.cssRules.length;R++){let m=this.style.sheet.cssRules[R];if(m.constructor.name==="CSSKeyframesRule")continue;let C=a=>{if(a.selectorText){let y=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<y.length;h++){let f=y[h];if(f[0]==="."){let o=f.slice(1),r="";for(let e=0;e<o.length;e++){let s=o[e],l=o[e+1];if(s==="\\"){if(e++,l!=="\\"){r+=l;continue}}else if(_.includes(s))break;r+=s}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let u=0;u<a.cssRules.length;u++){let y=C(a.cssRules[u]);if(y)return y}},B=C(m);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[R+a];R+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=F(),g.append(this.style);let E=R=>{R.forEach(m=>{m in this.countBy?this.countBy[m]++:(this.countBy[m]=1,this.insert(m))})};E(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(R=>E(R.classList)),this.observer=new MutationObserver(R=>{let m={},C=[],B=[],a=[],u=(o,r)=>{r?o.classList.forEach(h):o.classList.forEach(y);let e=o.children;for(let s=0;s<e.length;s++){let l=e[s];l.classList&&(B.push(l),u(l,r))}},y=o=>{o in m?m[o]++:m[o]=1},h=o=>{o in m?m[o]--:o in this.countBy&&(m[o]=-1)},f=(o,r)=>{for(let e=0;e<o.length;e++){let s=o[e];s.classList&&!B.includes(s)&&!a.includes(s)&&(s.isConnected!==r?(B.push(s),u(s,r)):a.push(s))}};for(let o=0;o<R.length;o++){let r=R[o],{addedNodes:e,removedNodes:s,type:l,target:c}=r;if(l==="attributes"){if(C.find(d=>d.target===c))continue;C.push(r)}else f(e,!1),(!c.isConnected||!B.includes(c))&&f(s,!0)}if(!(!C.length&&!Object.keys(m).length)){for(let{oldValue:o,target:r}of C){let e=B.includes(r),s=r.classList,l=o?o.split(" "):[];if(e){if(r.isConnected)continue;for(let c of l)s.contains(c)||h(c)}else if(r.isConnected){s.forEach(c=>{l.includes(c)||y(c)});for(let c of l)s.contains(c)||h(c)}}for(let o in m){let r=m[o],e=(this.countBy[o]||0)+r;e===0?(delete this.countBy[o],this.delete(o)):(o in this.countBy||this.insert(o),this.countBy[o]=e)}}}),this.observer.observe(t,{...i,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 t=this.style?.sheet;if(t?.cssRules)for(let i=t.cssRules.length-1;i>=0;i--)t.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(t){for(let i in this.config.rules){let n=this.config.rules[i],g=this.matches[i],{symbol:b,native:E}=n;if(g&&g.test(t))return{origin:"match",config:n};if(b&&t.startsWith(b))return{origin:"symbol",config:n};if(E&&t.startsWith(E+":"))return{origin:"match",config:n}}for(let i of this.semantics)if(t.match(i[0]))return{origin:"semantics",value:i[1]}}create(t){let i=n=>{if(n in this.ruleBy)return this.ruleBy[n];let g=this.match(n);if(g)return new Q(n,g,this)};return(t in this.classes?this.classes[t].map(n=>i(n)):[i(t)]).filter(n=>n&&n.text)}refresh(t){if(t?.override?this.config=t:this.config=M(T,t),this.cache(),!this.style)return;let i=F();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let n in this.countBy)this.insert(n)}destroy(){let t=O.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let i=this.style?.sheet,n=g=>{let b=this.ruleBy[g];if(!(!b||g in this.classesBy&&this.classesBy[g].some(E=>E in this.countBy))){if(i&&b.natives.length){let E=b.natives[0];for(let R=0;R<i.cssRules.length;R++)if(i.cssRules[R]===E.cssRule){for(let C=0;C<b.natives.length;C++)i.deleteRule(R);break}}this.rules.splice(this.rules.indexOf(b),1),delete this.ruleBy[g],b.config.delete&&b.config.delete.call(b,g)}};if(t in this.classes){for(let g of this.classes[t])g in this.countBy||n(g);delete this.ruleBy[t]}else n(t)}insert(t){let i=this.create(t);return i.length?(this.insertRules(i),!0):!1}insertRules(t){for(let i of t){if(this.ruleBy[i.className])continue;let n,g=Object.keys(this.keyframes).length,b=this.rules.length-1,{media:E,order:R,priority:m,hasWhere:C,className:B}=i,a=(h,f,o)=>{let r=h;for(;r<=b;r++){let e=this.rules[r];if(f?.(e))return o?-1:r-1;if(o?.(e))return r}return o?-1:r-1},u,y;if(E){let h=this.rules.findIndex(f=>f.media);if(h===-1)n=b+1;else{let{"max-width":f,"min-width":o}=E.features;if(f||o){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)n=b+1;else if(f&&o){if(m===-1?(u=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.priority!==-1)):(u=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=b),u!==-1){let e=f.value-o.value,s=y,l=u;for(u=void 0;s>=l;s--){let{"max-width":c,"min-width":d}=this.rules[s].media.features,p=c.value-d.value;if(p<e)y=s-1;else if(p===e)u=s;else break}}if(u!==-1){let e=f.value-o.value;for(let s=y;s>=u;s--){let{"max-width":l,"min-width":c}=this.rules[s].media.features,d=l.value-c.value;if(d<e)y=s-1;else if(d>e){u=s+1;break}}}}else if(o){if(m===-1?(u=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(u=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),u!==-1)for(let e=y;e>=u;e--){let s=this.rules[e].media.features["min-width"].value;if(s>o.value)y=e-1;else if(s<o.value){u=e+1;break}}}else if(m===-1?(u=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),y=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(u=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),u!==-1)for(let e=y;e>=u;e--){let s=this.rules[e].media.features["max-width"].value;if(s<f.value)y=e-1;else if(s>f.value){u=e+1;break}}}else m===-1?(u=h,y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(u=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=g?1:0;m===-1?(u=h,y=a(h,f=>f.media||f.priority!==-1)):(u=a(h,f=>f.media,f=>f.priority!==-1),y=a(h,f=>f.media))}if(n===void 0)if(u===-1)n=y+1;else{if(m===-1)for(let h=u;h<=y;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)&&(C&&!f.hasWhere||f.order>=R)){n=h;break}}else for(let h=u;h<=y;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)){if(C&&!f.hasWhere){n=h;break}if(f.priority<m){n=h;break}else if(f.priority===m){if(f.order>=R){n=h;break}}else n=h+1}}n===void 0&&(n=y+1)}if(this.rules.splice(n,0,i),this.ruleBy[B]=i,this.style){let h=this.style.sheet,f=0,o=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return o(r-1);let s=e.natives[e.natives.length-1].cssRule;for(let l=0;l<h.cssRules.length;l++)if(h.cssRules[l]===s){f=l+1;break}}};o(n-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(t=>t.text).join("")}},k=O;S(k,"root"),S(k,"config",T),S(k,"instances",[]),S(k,"refresh",t=>{for(let i of O.instances)i.refresh(t)});N&&(window.MasterCSS=k);export{k as MasterCSS};
|