@master/css 2.0.0-beta.120 → 2.0.0-beta.122
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/index.js +1 -1
- package/dist/cjs/config/rules.js +1 -1
- package/dist/cjs/css.js +1 -1
- package/dist/cjs/methods/index.js +1 -1
- package/dist/cjs/rule.js +1 -1
- package/dist/config/index.d.ts +2 -128
- package/dist/esm/config/index.js +1 -1
- package/dist/esm/config/rules.js +1 -1
- package/dist/esm/css.js +1 -1
- package/dist/esm/methods/index.js +1 -1
- package/dist/esm/rule.js +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/methods/index.d.ts +1 -0
- package/dist/rule.d.ts +2 -1
- package/package.json +1 -1
- package/dist/cjs/config/values.js +0 -1
- package/dist/config/values.d.ts +0 -125
- package/dist/esm/config/values.js +0 -1
package/dist/cjs/config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=Object.defineProperty;var
|
|
1
|
+
var t=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var h=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},B=(r,e,o,C)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of S(e))!d.call(r,s)&&s!==o&&t(r,s,{get:()=>e[s],enumerable:!(C=b(e,s))||C.enumerable});return r};var v=r=>B(t({},"__esModule",{value:!0}),r);var R={};h(R,{breakpoints:()=>i.breakpoints,colors:()=>m.colors,config:()=>Q,important:()=>k.important,observe:()=>u.observe,override:()=>y.override,rootSize:()=>n.rootSize,rules:()=>f.rules,scope:()=>p.scope,selectors:()=>a.selectors,semantics:()=>l.semantics,theme:()=>c.theme,themes:()=>g.themes});module.exports=v(R);var i=require("./breakpoints"),m=require("./colors"),n=require("./root-size"),p=require("./scope"),a=require("./selectors"),l=require("./semantics"),g=require("./themes"),c=require("./theme"),f=require("./rules"),y=require("./override"),u=require("./observe"),k=require("./important"),Q={breakpoints:i.breakpoints,colors:m.colors,rootSize:n.rootSize,scope:p.scope,selectors:a.selectors,semantics:l.semantics,themes:g.themes,theme:c.theme,rules:f.rules,override:y.override,observe:u.observe,important:k.important};0&&(module.exports={breakpoints,colors,config,important,observe,override,rootSize,rules,scope,selectors,semantics,theme,themes});
|
package/dist/cjs/config/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},R=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of w(t))!$.call(e,n)&&n!==r&&f(e,n,{get:()=>t[n],enumerable:!(s=k(t,n))||s.enumerable});return e};var C=e=>R(f({},"__esModule",{value:!0}),e);var A={};S(A,{rules:()=>z});module.exports=C(A);var p=require("../utils/analyze-value-token"),d=require("../utils/get-border-props"),b=require("../utils/parse-value-unit"),x=require("../constants/start-symbol"),I=require("../polyfills/css-escape"),y=require("../utils/css-escape"),z={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,t,r){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...(0,p.analyzeValueToken)(e.slice(s),t,r)]},getThemeProps(e,t){let r={},s=(o,a)=>{let i=a.indexOf(":");if(i!==-1){o in r||(r[o]={});let c=r[o],g=a.slice(0,i);g in c||(c[g]=a.slice(i+1))}},n=o=>{let a=(i,c)=>{let g=c.slice((0,y.cssEscape)(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let v of g)s(i,v)};if(this.theme){let i=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);i&&a(this.theme,i.text)}else for(let i of o.natives)a(i.theme,i.text)},u=[],l="",h=()=>{l&&(u.push(l.replace(/ /g,"")),l="")},m=1;(function o(a){for(;m<e.value.length;m++){let i=e.value[m];if(!a){if(i===";"){h();continue}if(i==="}")break}if(l+=i,a===i){if(a==="'"||a==='"'){let c=0;for(let g=l.length-2;l[g]==="\\";g--)c++;if(c%2)continue}break}else i in x.START_SYMBOL&&a!=="'"&&a!=='"'&&(m++,o(x.START_SYMBOL[i]))}})(void 0),h();for(let o of u){let a=t.create(o);if(Array.isArray(a))for(let i of a)n(i);else a?n(a):s(this.theme??"",o)}return r}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:""},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)"},fontSmoothing:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let t={};switch(e.value){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":t["-webkit-font-smoothing"]={...e,value:"antialiased"},t["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return t}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},spacing:{matches:"^[pm][xytblr]?:.",prop:!1,get(e){let r=this.prefix[0]==="m"?"margin":"padding",s=r+"-left",n=r+"-right",u=r+"-top",l=r+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[n]:e};case"y":return{[u]:e,[l]:e};case"l":return{[s]:e};case"r":return{[n]:e};case"t":return{[u]:e};case"b":return{[l]:e};default:return{[r]:e}}},get order(){return this.prefix==="p:"||this.prefix==="m:"?-1:0}},margin:{matches:"^margin(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="margin:"?-1:0}},padding:{matches:"^padding(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="padding:"?-1:0}},flexBasis:{},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)"},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:."},height:{matches:"^h:."},minWidth:{matches:"^min-w:."},minHeight:{matches:"^min-h:."},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,p.analyzeValueToken)(e,t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{width:{...e,value:t},height:{...e,value:r}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,p.analyzeValueToken)(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"min-width":{...e,value:t},"min-height":{...e,value:r}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,p.analyzeValueToken)(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"max-width":{...e,value:t},"max-height":{...e,value:r}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:."},maxWidth:{matches:"^max-w:."},boxSizing:{matches:"^box:(?:$values)(?!\\|)"},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":case"y":return 0}return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:t,value:r}=e,s=.75;return{"font-size":e,"line-height":{...e,value:t==="em"?r+s+t:`calc(${r}${t} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)"},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:t}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(r,s,n,u)=>{let l,h;switch(s){case"translate":l="rem";break;case"skew":l="deg";break;case"rotate":n==="3d"&&(h=!0),l="deg";break;default:return r}let m=u.split(",");return r.replace(u,m.map((o,a)=>!h||m.length-1===a?Number.isNaN(+o)?o:o/(l==="rem"?t:1)+l:o).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return(0,d.getBorderProps)(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let r="",s=this.prefix.split("-");if(s.length>1)for(let n=1;n<s.length-1;n++)r+=s[n][0];else r=this.prefix.slice(1,-1);switch(r){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let t=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(t)?t:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return(0,d.getBorderProps)(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return(0,d.getBorderProps)(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return(0,d.getBorderProps)(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}}},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)"},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,t){return(0,b.parseValueUnit)(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,t){return(0,b.parseValueUnit)(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:."},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:."},gridTemplateRows:{},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:""},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)"},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:."},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};0&&(module.exports={rules});
|
|
1
|
+
var y=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var A=(e,t)=>{for(var r in t)y(e,r,{get:t[r],enumerable:!0})},T=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of C(t))!R.call(e,n)&&n!==r&&y(e,n,{get:()=>t[n],enumerable:!(s=$(t,n))||s.enumerable});return e};var I=e=>T(y({},"__esModule",{value:!0}),e);var z={};A(z,{rules:()=>N});module.exports=I(z);var f=require("../utils/analyze-value-token"),b=require("../utils/get-border-props"),v=require("../utils/parse-value-unit"),k=require("../constants/start-symbol"),p=require("../constants/box-underneath"),x=require("../constants/content-extrema"),m=require("../constants/sizing-values"),j=require("../polyfills/css-escape"),w=require("../utils/css-escape"),N={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,t,r){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...(0,f.analyzeValueToken)(e.slice(s),t,r)]},getThemeProps(e,t){let r={},s=(o,a)=>{let i=a.indexOf(":");if(i!==-1){o in r||(r[o]={});let c=r[o],h=a.slice(0,i);h in c||(c[h]=a.slice(i+1))}},n=o=>{let a=(i,c)=>{let h=c.slice((0,w.cssEscape)(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let S of h)s(i,S)};if(this.theme){let i=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);i&&a(this.theme,i.text)}else for(let i of o.natives)a(i.theme,i.text)},u=[],l="",d=()=>{l&&(u.push(l.replace(/ /g,"")),l="")},g=1;(function o(a){for(;g<e.value.length;g++){let i=e.value[g];if(!a){if(i===";"){d();continue}if(i==="}")break}if(l+=i,a===i){if(a==="'"||a==='"'){let c=0;for(let h=l.length-2;l[h]==="\\";h--)c++;if(c%2)continue}break}else i in k.START_SYMBOL&&a!=="'"&&a!=='"'&&(g++,o(k.START_SYMBOL[i]))}})(void 0),d();for(let o of u){let a=t.create(o);if(Array.isArray(a))for(let i of a)n(i);else a?n(a):s(this.theme??"",o)}return r}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:"",values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)",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:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let t={};switch(e.value){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":t["-webkit-font-smoothing"]={...e,value:"antialiased"},t["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return t}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},spacing:{matches:"^[pm][xytblr]?:.",prop:!1,get(e){let r=this.prefix[0]==="m"?"margin":"padding",s=r+"-left",n=r+"-right",u=r+"-top",l=r+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[n]:e};case"y":return{[u]:e,[l]:e};case"l":return{[s]:e};case"r":return{[n]:e};case"t":return{[u]:e};case"b":return{[l]:e};default:return{[r]:e}}},get order(){return this.prefix==="p:"||this.prefix==="m:"?-1:0}},margin:{matches:"^margin(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="margin:"?-1:0}},padding:{matches:"^padding(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="padding:"?-1:0}},flexBasis:{values:m.SIZING_VALUES},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",values:{col:"column","col-reverse":"column-reverse"}},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:.",values:m.SIZING_VALUES},height:{matches:"^h:.",values:m.SIZING_VALUES},minWidth:{matches:"^min-w:.",values:m.SIZING_VALUES},minHeight:{matches:"^min-h:.",values:m.SIZING_VALUES},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e,t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{width:{...e,value:t},height:{...e,value:r}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"min-width":{...e,value:t},"min-height":{...e,value:r}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...(0,f.analyzeValueToken)(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"max-width":{...e,value:t},"max-height":{...e,value:r}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:.",values:m.SIZING_VALUES},maxWidth:{matches:"^max-w:.",values:m.SIZING_VALUES},boxSizing:{matches:"^box:(?:$values)(?!\\|)",values:{content:"content-box",border:"border-box"}},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{values:{abs:"absolute",rel:"relative"}},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:t,value:r}=e,s=.75;return{"font-size":e,"line-height":{...e,value:t==="em"?r+s+t:`calc(${r}${t} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)",values:{...p.BOX_UNDERNEATH,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:t}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(r,s,n,u)=>{let l,d;switch(s){case"translate":l="rem";break;case"skew":l="deg";break;case"rotate":n==="3d"&&(d=!0),l="deg";break;default:return r}let g=u.split(",");return r.replace(u,g.map((o,a)=>!d||g.length-1===a?Number.isNaN(+o)?o:o/(l==="rem"?t:1)+l:o).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let r="",s=this.prefix.split("-");if(s.length>1)for(let n=1;n<s.length-1;n++)r+=s[n][0];else r=this.prefix.slice(1,-1);switch(r){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let t=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(t)?t:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return(0,b.getBorderProps)(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}},values:p.BOX_UNDERNEATH},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)",values:p.BOX_UNDERNEATH},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,t){return(0,v.parseValueUnit)(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,t){return(0,v.parseValueUnit)(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:.",values:x.CONTENT_EXTREMA},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{values:x.CONTENT_EXTREMA},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:.",values:x.CONTENT_EXTREMA},gridTemplateRows:{values:x.CONTENT_EXTREMA},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:"",values:{first:-999999,last:999999}},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",values:{...p.BOX_UNDERNEATH,margin:"margin-box"}},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:.",values:{...p.BOX_UNDERNEATH,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};0&&(module.exports={rules});
|
package/dist/cjs/css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var S=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Z=Object.prototype.hasOwnProperty;var P=(y,e,t)=>e in y?S(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t;var U=(y,e)=>{for(var t in e)S(y,t,{get:e[t],enumerable:!0})},Y=(y,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let h of q(e))!Z.call(y,h)&&h!==t&&S(y,h,{get:()=>e[h],enumerable:!(s=_(e,h))||s.enumerable});return y};var G=y=>Y(S({},"__esModule",{value:!0}),y);var A=(y,e,t)=>(P(y,typeof e!="symbol"?e+"":e,t),t);var J={};U(J,{MasterCSS:()=>W});module.exports=G(J);function I(y){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&y instanceof e||y instanceof Date||y instanceof RegExp)}function B(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let e=Buffer.alloc(y.length);return y.copy(e),e}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function V(y){let e=[];return y.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=V(t):I(t)?e[s]=B(t):e[s]=k({},t):e[s]=t}),e}function N(y,e){return e==="__proto__"?void 0:y[e]}function k(...y){let e={},t,s;return y.forEach(function(h){typeof h!="object"||h===null||Array.isArray(h)||Object.keys(h).forEach(function(x){if(s=N(e,x),t=N(h,x),t!==e)if(typeof t!="object"||t===null){e[x]=t;return}else if(Array.isArray(t)){e[x]=V(t);return}else if(I(t)){e[x]=B(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[x]=k({},t);return}else{e[x]=k(s,t);return}})}),e}var $=require("./rule"),L=require("./config"),D=require("./theme"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var F=typeof window<"u",j=class{constructor(e){this.config=e;this.config?.override||(this.config=k(L.config,e)),this.cache(),F&&this.config.observe&&this.observe(document),j.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=F?new MutationObserver(e=>{let t={},s=[],h=[],x=[],w=(c,n)=>{n?c.classList.forEach(b):c.classList.forEach(g);let l=c.children;for(let m=0;m<l.length;m++){let u=l[m];u.classList&&(h.push(u),w(u,n))}},g=c=>{c in t?t[c]++:t[c]=1},b=c=>{c in t?t[c]--:c in this.countOfClass&&(t[c]=-1)},M=(c,n)=>{for(let l=0;l<c.length;l++){let m=c[l];m.classList&&!h.includes(m)&&!x.includes(m)&&(m.isConnected!==n?(h.push(m),w(m,n)):x.push(m))}};for(let c=0;c<e.length;c++){let n=e[c],{addedNodes:l,removedNodes:m,type:u,target:f}=n;if(u==="attributes"){if(s.find(C=>C.target===f))continue;s.push(n)}else M(l,!1),(!f.isConnected||!h.includes(f))&&M(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:c,target:n}of s){let l=h.includes(n),m=n.classList,u=c?c.split(" "):[];if(l){if(n.isConnected)continue;for(let f of u)m.contains(f)||b(f)}else if(n.isConnected){m.forEach(f=>{u.includes(f)||g(f)});for(let f of u)m.contains(f)||b(f)}}for(let c in t){let n=t[c],l=(this.countOfClass[c]||0)+n;l===0?(delete this.countOfClass[c],this.delete(c)):(c in this.countOfClass||this.insert(c),this.countOfClass[c]=l)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.relationThemesMap={},this.relations={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:e,classes:t,selectors:s,themes:h,colors:x,values:w,breakpoints:g,mediaQueries:b,rules:M}=this.config;function c(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i="",d={}){let a=R=>R?(i?i+"-":"")+R:i,p=Object.entries(r),O=[],T=[];for(let R of p){let E=R[1];(typeof E=="object"&&!Array.isArray(E)?O:T).push(R)}for(let[R,E]of O)n(E,o,a(R),d);if(o&&i)T.length&&(d[i]=T.reduce((R,[E,z])=>(R[E]=z,R),{}));else for(let[R,E]of T)d[a(R)]=E;return d}if(e)for(let[r,o]of Object.entries(n(e,!0)))this.semantics.push([new RegExp("^"+c(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,o]]);if(s)for(let[r,o]of Object.entries(n(s,!1))){let i=new RegExp(c(r)+"(?![a-z-])");for(let d of Array.isArray(o)?o:[o]){let a=d.match(/^::-[a-z]+-/m)?.[0]??"",p=this.selectors[a];p||(p=this.selectors[a]=[]);let O=p.find(([T])=>T===i);O||(O=[i,[]],p.push(O)),O[1].push(d)}}if(w)for(let[r,o]of Object.entries(w))typeof o=="object"?this.values[r]=n(o,!1):this.globalValues[r]=o;g&&(this.breakpoints=n(g,!1)),b&&(this.mediaQueries=n(b,!1));let l=t?n(t,!1):{},m=h&&!Array.isArray(h)?Object.entries(h).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:i}])=>(r[o]=n(i,!1),r),{}):{},u=[...Object.keys(l),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],f=r=>{if(r in this.classes)return;let o=this.classes[r]=[],i=(d,a)=>{if(!a)return;let p=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let O of p){let T=R=>{R in this.relationThemesMap?d in this.relationThemesMap[R]?this.relationThemesMap[R][d].push(r):this.relationThemesMap[R][d]=[r]:this.relationThemesMap[R]={[d]:[r]},o.includes(R)||o.push(R)};if(u.includes(O)){f(O);for(let R of this.classes[O])T(R)}else T(O)}};i("",l?.[r]);for(let[d,a]of Object.entries(m))i(d,a?.[r])};for(let r of u)f(r);for(let r in this.relationThemesMap){let o=this.relations[r]=[];for(let i of Object.values(this.relationThemesMap[r]))for(let d of i)o.includes(d)||o.push(d)}let C=(r,o)=>{if(!o)return;let i=n(o,!0);for(let[d,a]of Object.entries(i)){let p=typeof a=="string"?{"":a}:a;for(let[O,T]of Object.entries(p)){let R=d+(O?"-"+O:"");R in this.colorThemesMap?this.colorThemesMap[R][r]=T:this.colorThemesMap[R]={[r]:T}}}for(let d in o)this.colorNames.includes(d)||this.colorNames.push(d)};if(C("",x),h)if(Array.isArray(h))this.themeNames.push(...h);else for(let r in h){let o=h[r];C(r,o.colors),this.themeNames.push(r)}let v=r=>{for(let[o,i]of Object.entries(this.colorThemesMap))for(let[d,a]of Object.entries(i))a.startsWith("#")||r(o,i,d,a)};if(v((r,o,i,d)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(d);if(a){let p="#"+(0,H.rgbToHex)(+a[1],+a[2],+a[3]);a[4]&&(p+=Math.round(255*+a[4]).toString(16)),o[i]=p}}),v((r,o,i,d)=>{let[a,p]=d.split("/"),O=this.colorThemesMap[a];if(O){let T=(i?O[i]:void 0)??O[""];o[i]=p?T.slice(0,7)+Math.round(255*+p).toString(16):T}else console.warn(`\`${d}\` doesn't exist in the extended config \`.colors\``),delete o[i],Object.keys(o).length||delete this.colorThemesMap[r]}),M)for(let r in M){let o=M[r],{matches:i,prop:d}=o;if(o.id=r,o.prop=d===!1?"":r.replace(/(?!^)[A-Z]/g,a=>"-"+a).toLowerCase(),i){let a=Object.keys(this.values[r]??{}),p=i.indexOf("$values");this.matches[r]=new RegExp(p===-1?i:a.length?i.slice(0,p)+a.join("|")+i.slice(p+7):i.slice(0,p-(i[p-1]==="|"?1:0))+i.slice(p+7+(i[p+7]==="|"?1:0)))}}}observe(e,t={subtree:!0,childList:!0}){if(F&&e){this.root=e;let s=e===document;s&&(j.root=this),this.host=s?document.documentElement:root.host,this.theme=new D.Theme(this.host,this.config.theme);let h=s?document.head:e,x=s?document.styleSheets:e.styleSheets;for(let g of x){let{title:b,href:M,ownerNode:c}=g;(b==="master"||M&&M.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(M))&&(this.style=c)}if(this.style)for(let g=0;g<this.style.sheet.cssRules.length;g++){let b=c=>{if(c.selectorText){let l=c.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let u=l[m];if(u[0]==="."){let f=u.slice(1),C="";for(let v=0;v<f.length;v++){let r=f[v],o=f[v+1];if(r==="\\"){if(v++,o!=="\\"){C+=o;continue}}else if(Q.SELECTOR_SYMBOLS.includes(r))break;C+=r}if(!(C in this.ruleOfClass)&&!(C in this.classes)){let v=this.create(C)[0];if(v)return v}}}}else if(c.cssRules)for(let n=0;n<c.cssRules.length;n++){let l=b(c.cssRules[n]);if(l)return l}},M=b(this.style.sheet.cssRules[g]);if(M){this.rules.push(M),this.ruleOfClass[M.className]=M;for(let c=0;c<M.natives.length;c++)M.natives[c].cssRule=this.style.sheet.cssRules[g+c];g+=M.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let g=h.querySelector('link[rel="styleSheet"], style');g?g.before(this.style):h.append(this.style)}let w=g=>{g.forEach(b=>{b in this.countOfClass?this.countOfClass[b]++:(this.countOfClass[b]=1,this.insert(b))})};w(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(g=>w(g.classList)),this.e.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleOfClass={},this.countOfClass={},this.rules.length=0;let e=this.style.sheet;if(e)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style.remove(),this.style=null,this.theme?.destroy(),this.theme=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],h=this.matches[t],{colorStarts:x,symbol:w,prop:g}=s,{colorNames:b,colorThemesMap:M}=this;if(h&&h.test(e))return{origin:"matches",config:s};if(x){if(e.match("^"+x+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(b.length&&e.indexOf("|")===-1){let c=e.match("^"+x+"((?:"+b.join("|")+")[0-9a-zA-Z-]*)");if(c&&c[1]in M)return{origin:"matches",config:s}}}if(w&&e.startsWith(w))return{origin:"symbol",config:s};if(g&&e.startsWith(g+":"))return{origin:"matches",config:s}}for(let t of this.semantics)if(e.match(t[0]))return{origin:"semantics",value:t[1]}}create(e){let t=s=>{if(s in this.ruleOfClass)return this.ruleOfClass[s];let h=this.match(s);if(h)return new $.Rule(s,h,this)};return(e in this.classes?this.classes[e].map(s=>t(s)):[t(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=k(L.config,e),this.cache(),!this.style)return;let t=document.createElement("style");t.title="master",this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleOfClass={};for(let s in this.countOfClass)this.insert(s)}destroy(){let e=j.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style.sheet,s=h=>{let x=this.ruleOfClass[h];if(!(!x||h in this.relations&&this.relations[h].some(w=>w in this.countOfClass))){if(x.natives.length){let w=x.natives[0];for(let g=0;g<t.cssRules.length;g++)if(t.cssRules[g]===w.cssRule){for(let M=0;M<x.natives.length;M++)t.deleteRule(g);this.rules.splice(this.rules.indexOf(x),1);break}}delete this.ruleOfClass[h]}};if(e in this.classes){for(let h of this.classes[e])h in this.countOfClass||s(h);delete this.ruleOfClass[e]}else s(e)}insert(e){let t=this.create(e);return t.length?(this.insertRules(t),!0):!1}insertRules(e){for(let t of e){if(this.ruleOfClass[t.className])continue;let s,h=this.rules.length-1,{media:x,order:w,priority:g,hasWhere:b,className:M}=t,c=(n,l,m,u)=>{let f=0,C;l&&(f=n.findIndex(l)),m&&(C=n.findIndex(m)),f===-1&&(f=n.length),(C===void 0||C===-1)&&(C=n.length);let v=n.slice(f,C);for(let r=0;r<v.length;r++){let o=v[r];if(!(o.priority===-1||u&&u(o))&&(o.priority<g||o.priority===g&&(b&&!o.hasWhere||o.order>=w)))return f+r}return f+v.length};if(x){let n=this.rules.findIndex(l=>l.media);if(n!==-1){let l=x.features["max-width"],m=x.features["min-width"];if(l&&m){let u=l.value-m.value;for(let f=h;f>=n;f--){s=f;let C=this.rules[f],v=C.media,r=v.features["max-width"],o=v.features["min-width"];if(!r||!o){s++;break}let i=r.value-o.value;if(i===u){if(b!==C.hasWhere)continue;if(g!==-1){let d=[this.rules[f]];for(let a=f-1;a>=n;a--){let p=this.rules[a];if(p.hasWhere!==b)break;let O=p.media,T=O.features["max-width"],R=O.features["min-width"];if(!T||!R||T.value-R.value!==i)break;d.unshift(this.rules[a])}s=c(this.rules,a=>a.media&&a.priority!==-1&&a.media.features["min-width"]&&a.media.features["max-width"])}break}else if(i>u)break}}else if(m)for(let u=n;u<=h;u++){s=u;let f=this.rules[u],C=f.media,v=C.features["max-width"],r=C.features["min-width"];if(v){if(r)break;continue}let o=r?.value;if(o===m.value){if(!b&&f.hasWhere){s++;continue}if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else for(let i=u;i<=h;i++){let d=this.rules[i],a=d.media,p=a.features["min-width"];if(!a.features["max-width"]){if(d.hasWhere!==b||p.value!==o||d.order>=w)break;s=i+1}}break}else{if(o>m.value)break;s++}}else if(l)for(let u=h;u>=n;u--){s=u;let f=this.rules[u],C=f.media,v=C.features["max-width"];if(C.features["min-width"])continue;let o=v?.value;if(!o||o>l.value){s++;break}else if(o===l.value){if(b&&!f.hasWhere)continue;if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else{let i=[this.rules[u]];for(let d=u-1;d>=n;d--){let a=this.rules[d],p=a.media,O=p.features["min-width"],T=p.features["max-width"];if(!O&&(!T||T.value!==o||a.hasWhere!==b))break;i.unshift(a)}for(let d=0;d<i.length;d++){let a=i[d];if(!a.media.features["min-width"]){if(a.order>=w)break;s=u-i.length+2+d}}}break}}}if(s===void 0)if(n===-1)s=h+1;else if(g!==-1)s=n+c(this.rules.slice(n),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(b){let l=n;for(;l<this.rules.length;l++){let m=this.rules[l];if(m.priority!==-1||!m.hasWhere||m.order>=w){s=l;break}}s===void 0&&(s=l)}else for(let l=n;l<=h;l++){s=l;let m=this.rules[l],u=m.media;if(m.priority!==-1||u.features["max-width"]||u.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=w)break}}else if(g===-1)if(b)s=this.rules.findIndex(n=>!n.hasWhere||n.media||n.priority!==-1||n.order>=w),s===-1&&(s=h+1);else{let n=0;for(;n<this.rules.length;n++){let l=this.rules[n];if(l.media||!l.hasWhere&&(l.order>=w||l.priority!==-1)){s=n;break}}s===void 0&&(s=n)}else s=c(this.rules,void 0,n=>n.media);if(this.rules.splice(s,0,t),this.ruleOfClass[M]=t,this.style){let n=this.style.sheet,l=0,m=u=>{let f=this.rules[u];if(f){if(!f.natives.length)return m(u-1);let C=f.natives[f.natives.length-1].cssRule;for(let v=0;v<n.cssRules.length;v++)if(n.cssRules[v]===C){l=v+1;break}}};m(s-1);for(let u=0;u<t.natives.length;)try{let f=t.natives[u];n.insertRule(f.text,l),f.cssRule=n.cssRules[l++],u++}catch(f){console.error(f),t.natives.splice(u,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},W=j;A(W,"root"),A(W,"instances",[]),A(W,"refresh",e=>{for(let t of j.instances)t.refresh(e)});F&&(window.MasterCSS=W);0&&(module.exports={MasterCSS});
|
|
1
|
+
var S=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Z=Object.prototype.hasOwnProperty;var P=(y,e,t)=>e in y?S(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t;var U=(y,e)=>{for(var t in e)S(y,t,{get:e[t],enumerable:!0})},Y=(y,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of q(e))!Z.call(y,a)&&a!==t&&S(y,a,{get:()=>e[a],enumerable:!(s=_(e,a))||s.enumerable});return y};var G=y=>Y(S({},"__esModule",{value:!0}),y);var A=(y,e,t)=>(P(y,typeof e!="symbol"?e+"":e,t),t);var J={};U(J,{MasterCSS:()=>W});module.exports=G(J);function I(y){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&y instanceof e||y instanceof Date||y instanceof RegExp)}function B(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let e=Buffer.alloc(y.length);return y.copy(e),e}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function V(y){let e=[];return y.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=V(t):I(t)?e[s]=B(t):e[s]=k({},t):e[s]=t}),e}function N(y,e){return e==="__proto__"?void 0:y[e]}function k(...y){let e={},t,s;return y.forEach(function(a){typeof a!="object"||a===null||Array.isArray(a)||Object.keys(a).forEach(function(C){if(s=N(e,C),t=N(a,C),t!==e)if(typeof t!="object"||t===null){e[C]=t;return}else if(Array.isArray(t)){e[C]=V(t);return}else if(I(t)){e[C]=B(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[C]=k({},t);return}else{e[C]=k(s,t);return}})}),e}var $=require("./rule"),L=require("./config"),D=require("./theme"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var F=typeof window<"u",j=class{constructor(e){this.config=e;this.config?.override||(this.config=k(L.config,e)),this.cache(),F&&this.config.observe&&this.observe(document),j.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=F?new MutationObserver(e=>{let t={},s=[],a=[],C=[],w=(c,n)=>{n?c.classList.forEach(b):c.classList.forEach(g);let l=c.children;for(let m=0;m<l.length;m++){let u=l[m];u.classList&&(a.push(u),w(u,n))}},g=c=>{c in t?t[c]++:t[c]=1},b=c=>{c in t?t[c]--:c in this.countOfClass&&(t[c]=-1)},O=(c,n)=>{for(let l=0;l<c.length;l++){let m=c[l];m.classList&&!a.includes(m)&&!C.includes(m)&&(m.isConnected!==n?(a.push(m),w(m,n)):C.push(m))}};for(let c=0;c<e.length;c++){let n=e[c],{addedNodes:l,removedNodes:m,type:u,target:f}=n;if(u==="attributes"){if(s.find(v=>v.target===f))continue;s.push(n)}else O(l,!1),(!f.isConnected||!a.includes(f))&&O(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:c,target:n}of s){let l=a.includes(n),m=n.classList,u=c?c.split(" "):[];if(l){if(n.isConnected)continue;for(let f of u)m.contains(f)||b(f)}else if(n.isConnected){m.forEach(f=>{u.includes(f)||g(f)});for(let f of u)m.contains(f)||b(f)}}for(let c in t){let n=t[c],l=(this.countOfClass[c]||0)+n;l===0?(delete this.countOfClass[c],this.delete(c)):(c in this.countOfClass||this.insert(c),this.countOfClass[c]=l)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.relationThemesMap={},this.relations={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:e,classes:t,selectors:s,themes:a,colors:C,values:w,breakpoints:g,mediaQueries:b,rules:O}=this.config;function c(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i="",d={}){let h=x=>x?(i?i+"-":"")+x:i,R=Object.entries(r),p=[],T=[];for(let x of R){let E=x[1];(typeof E=="object"&&!Array.isArray(E)?p:T).push(x)}for(let[x,E]of p)n(E,o,h(x),d);if(o&&i)T.length&&(d[i]=T.reduce((x,[E,z])=>(x[E]=z,x),{}));else for(let[x,E]of T)d[h(x)]=E;return d}if(e)for(let[r,o]of Object.entries(n(e,!0)))this.semantics.push([new RegExp("^"+c(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,o]]);if(s)for(let[r,o]of Object.entries(n(s,!1))){let i=new RegExp(c(r)+"(?![a-z-])");for(let d of Array.isArray(o)?o:[o]){let h=d.match(/^::-[a-z]+-/m)?.[0]??"",R=this.selectors[h];R||(R=this.selectors[h]=[]);let p=R.find(([T])=>T===i);p||(p=[i,[]],R.push(p)),p[1].push(d)}}w&&(this.globalValues=n(w,!1)),g&&(this.breakpoints=n(g,!1)),b&&(this.mediaQueries=n(b,!1));let l=t?n(t,!1):{},m=a&&!Array.isArray(a)?Object.entries(a).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:i}])=>(r[o]=n(i,!1),r),{}):{},u=[...Object.keys(l),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],f=r=>{if(r in this.classes)return;let o=this.classes[r]=[],i=(d,h)=>{if(!h)return;let R=Array.isArray(h)?h:h.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of R){let T=x=>{x in this.relationThemesMap?d in this.relationThemesMap[x]?this.relationThemesMap[x][d].push(r):this.relationThemesMap[x][d]=[r]:this.relationThemesMap[x]={[d]:[r]},o.includes(x)||o.push(x)};if(u.includes(p)){f(p);for(let x of this.classes[p])T(x)}else T(p)}};i("",l?.[r]);for(let[d,h]of Object.entries(m))i(d,h?.[r])};for(let r of u)f(r);for(let r in this.relationThemesMap){let o=this.relations[r]=[];for(let i of Object.values(this.relationThemesMap[r]))for(let d of i)o.includes(d)||o.push(d)}let v=(r,o)=>{if(!o)return;let i=n(o,!0);for(let[d,h]of Object.entries(i)){let R=typeof h=="string"?{"":h}:h;for(let[p,T]of Object.entries(R)){let x=d+(p?"-"+p:"");x in this.colorThemesMap?this.colorThemesMap[x][r]=T:this.colorThemesMap[x]={[r]:T}}}for(let d in o)this.colorNames.includes(d)||this.colorNames.push(d)};if(v("",C),a)if(Array.isArray(a))this.themeNames.push(...a);else for(let r in a){let o=a[r];v(r,o.colors),this.themeNames.push(r)}let M=r=>{for(let[o,i]of Object.entries(this.colorThemesMap))for(let[d,h]of Object.entries(i))h.startsWith("#")||r(o,i,d,h)};if(M((r,o,i,d)=>{let h=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(d);if(h){let R="#"+(0,H.rgbToHex)(+h[1],+h[2],+h[3]);h[4]&&(R+=Math.round(255*+h[4]).toString(16)),o[i]=R}}),M((r,o,i,d)=>{let[h,R]=d.split("/"),p=this.colorThemesMap[h];if(p){let T=(i?p[i]:void 0)??p[""];o[i]=R?T.slice(0,7)+Math.round(255*+R).toString(16):T}else console.warn(`\`${d}\` doesn't exist in the extended config \`.colors\``),delete o[i],Object.keys(o).length||delete this.colorThemesMap[r]}),O)for(let r in O){let o=O[r],{matches:i,prop:d,values:h}=o;if(o.id=r,o.prop=d===!1?"":r.replace(/(?!^)[A-Z]/g,R=>"-"+R).toLowerCase(),h&&(this.values[r]=n(h,!1)),i){let R=Object.keys(this.values[r]??{}),p=i.indexOf("$values");this.matches[r]=new RegExp(p===-1?i:R.length?i.slice(0,p)+R.join("|")+i.slice(p+7):i.slice(0,p-(i[p-1]==="|"?1:0))+i.slice(p+7+(i[p+7]==="|"?1:0)))}}}observe(e,t={subtree:!0,childList:!0}){if(F&&e){this.root=e;let s=e===document;s&&(j.root=this),this.host=s?document.documentElement:root.host,this.theme=new D.Theme(this.host,this.config.theme);let a=s?document.head:e,C=s?document.styleSheets:e.styleSheets;for(let g of C){let{title:b,href:O,ownerNode:c}=g;(b==="master"||O&&O.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(O))&&(this.style=c)}if(this.style)for(let g=0;g<this.style.sheet.cssRules.length;g++){let b=c=>{if(c.selectorText){let l=c.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let u=l[m];if(u[0]==="."){let f=u.slice(1),v="";for(let M=0;M<f.length;M++){let r=f[M],o=f[M+1];if(r==="\\"){if(M++,o!=="\\"){v+=o;continue}}else if(Q.SELECTOR_SYMBOLS.includes(r))break;v+=r}if(!(v in this.ruleOfClass)&&!(v in this.classes)){let M=this.create(v)[0];if(M)return M}}}}else if(c.cssRules)for(let n=0;n<c.cssRules.length;n++){let l=b(c.cssRules[n]);if(l)return l}},O=b(this.style.sheet.cssRules[g]);if(O){this.rules.push(O),this.ruleOfClass[O.className]=O;for(let c=0;c<O.natives.length;c++)O.natives[c].cssRule=this.style.sheet.cssRules[g+c];g+=O.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let g=a.querySelector('link[rel="styleSheet"], style');g?g.before(this.style):a.append(this.style)}let w=g=>{g.forEach(b=>{b in this.countOfClass?this.countOfClass[b]++:(this.countOfClass[b]=1,this.insert(b))})};w(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(g=>w(g.classList)),this.e.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleOfClass={},this.countOfClass={},this.rules.length=0;let e=this.style.sheet;if(e)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style.remove(),this.style=null,this.theme?.destroy(),this.theme=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],a=this.matches[t],{colorStarts:C,symbol:w,prop:g}=s,{colorNames:b,colorThemesMap:O}=this;if(a&&a.test(e))return{origin:"matches",config:s};if(C){if(e.match("^"+C+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(b.length&&e.indexOf("|")===-1){let c=e.match("^"+C+"((?:"+b.join("|")+")[0-9a-zA-Z-]*)");if(c&&c[1]in O)return{origin:"matches",config:s}}}if(w&&e.startsWith(w))return{origin:"symbol",config:s};if(g&&e.startsWith(g+":"))return{origin:"matches",config:s}}for(let t of this.semantics)if(e.match(t[0]))return{origin:"semantics",value:t[1]}}create(e){let t=s=>{if(s in this.ruleOfClass)return this.ruleOfClass[s];let a=this.match(s);if(a)return new $.Rule(s,a,this)};return(e in this.classes?this.classes[e].map(s=>t(s)):[t(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=k(L.config,e),this.cache(),!this.style)return;let t=document.createElement("style");t.title="master",this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleOfClass={};for(let s in this.countOfClass)this.insert(s)}destroy(){let e=j.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style.sheet,s=a=>{let C=this.ruleOfClass[a];if(!(!C||a in this.relations&&this.relations[a].some(w=>w in this.countOfClass))){if(C.natives.length){let w=C.natives[0];for(let g=0;g<t.cssRules.length;g++)if(t.cssRules[g]===w.cssRule){for(let O=0;O<C.natives.length;O++)t.deleteRule(g);this.rules.splice(this.rules.indexOf(C),1);break}}delete this.ruleOfClass[a]}};if(e in this.classes){for(let a of this.classes[e])a in this.countOfClass||s(a);delete this.ruleOfClass[e]}else s(e)}insert(e){let t=this.create(e);return t.length?(this.insertRules(t),!0):!1}insertRules(e){for(let t of e){if(this.ruleOfClass[t.className])continue;let s,a=this.rules.length-1,{media:C,order:w,priority:g,hasWhere:b,className:O}=t,c=(n,l,m,u)=>{let f=0,v;l&&(f=n.findIndex(l)),m&&(v=n.findIndex(m)),f===-1&&(f=n.length),(v===void 0||v===-1)&&(v=n.length);let M=n.slice(f,v);for(let r=0;r<M.length;r++){let o=M[r];if(!(o.priority===-1||u&&u(o))&&(o.priority<g||o.priority===g&&(b&&!o.hasWhere||o.order>=w)))return f+r}return f+M.length};if(C){let n=this.rules.findIndex(l=>l.media);if(n!==-1){let l=C.features["max-width"],m=C.features["min-width"];if(l&&m){let u=l.value-m.value;for(let f=a;f>=n;f--){s=f;let v=this.rules[f],M=v.media,r=M.features["max-width"],o=M.features["min-width"];if(!r||!o){s++;break}let i=r.value-o.value;if(i===u){if(b!==v.hasWhere)continue;if(g!==-1){let d=[this.rules[f]];for(let h=f-1;h>=n;h--){let R=this.rules[h];if(R.hasWhere!==b)break;let p=R.media,T=p.features["max-width"],x=p.features["min-width"];if(!T||!x||T.value-x.value!==i)break;d.unshift(this.rules[h])}s=c(this.rules,h=>h.media&&h.priority!==-1&&h.media.features["min-width"]&&h.media.features["max-width"])}break}else if(i>u)break}}else if(m)for(let u=n;u<=a;u++){s=u;let f=this.rules[u],v=f.media,M=v.features["max-width"],r=v.features["min-width"];if(M){if(r)break;continue}let o=r?.value;if(o===m.value){if(!b&&f.hasWhere){s++;continue}if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else for(let i=u;i<=a;i++){let d=this.rules[i],h=d.media,R=h.features["min-width"];if(!h.features["max-width"]){if(d.hasWhere!==b||R.value!==o||d.order>=w)break;s=i+1}}break}else{if(o>m.value)break;s++}}else if(l)for(let u=a;u>=n;u--){s=u;let f=this.rules[u],v=f.media,M=v.features["max-width"];if(v.features["min-width"])continue;let o=M?.value;if(!o||o>l.value){s++;break}else if(o===l.value){if(b&&!f.hasWhere)continue;if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else{let i=[this.rules[u]];for(let d=u-1;d>=n;d--){let h=this.rules[d],R=h.media,p=R.features["min-width"],T=R.features["max-width"];if(!p&&(!T||T.value!==o||h.hasWhere!==b))break;i.unshift(h)}for(let d=0;d<i.length;d++){let h=i[d];if(!h.media.features["min-width"]){if(h.order>=w)break;s=u-i.length+2+d}}}break}}}if(s===void 0)if(n===-1)s=a+1;else if(g!==-1)s=n+c(this.rules.slice(n),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(b){let l=n;for(;l<this.rules.length;l++){let m=this.rules[l];if(m.priority!==-1||!m.hasWhere||m.order>=w){s=l;break}}s===void 0&&(s=l)}else for(let l=n;l<=a;l++){s=l;let m=this.rules[l],u=m.media;if(m.priority!==-1||u.features["max-width"]||u.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=w)break}}else if(g===-1)if(b)s=this.rules.findIndex(n=>!n.hasWhere||n.media||n.priority!==-1||n.order>=w),s===-1&&(s=a+1);else{let n=0;for(;n<this.rules.length;n++){let l=this.rules[n];if(l.media||!l.hasWhere&&(l.order>=w||l.priority!==-1)){s=n;break}}s===void 0&&(s=n)}else s=c(this.rules,void 0,n=>n.media);if(this.rules.splice(s,0,t),this.ruleOfClass[O]=t,this.style){let n=this.style.sheet,l=0,m=u=>{let f=this.rules[u];if(f){if(!f.natives.length)return m(u-1);let v=f.natives[f.natives.length-1].cssRule;for(let M=0;M<n.cssRules.length;M++)if(n.cssRules[M]===v){l=M+1;break}}};m(s-1);for(let u=0;u<t.natives.length;)try{let f=t.natives[u];n.insertRule(f.text,l),f.cssRule=n.cssRules[l++],u++}catch(f){console.error(f),t.natives.splice(u,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},W=j;A(W,"root"),A(W,"instances",[]),A(W,"refresh",e=>{for(let t of j.instances)t.refresh(e)});F&&(window.MasterCSS=W);0&&(module.exports={MasterCSS});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./render"),module.exports);r(o,require("./render-from-html"),module.exports);r(o,require("./render-into-html"),module.exports);r(o,require("./fill-color-scale"),module.exports);r(o,require("./define-content"),module.exports);
|
|
1
|
+
var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./render"),module.exports);r(o,require("./render-from-html"),module.exports);r(o,require("./render-into-html"),module.exports);r(o,require("./fill-color-scale"),module.exports);r(o,require("./define-content"),module.exports);r(o,require("./get-sync-with-stored-theme-script"),module.exports);
|
package/dist/cjs/rule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var F=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ae=Object.prototype.hasOwnProperty;var ce=(d,u)=>{for(var h in u)F(d,h,{get:u[h],enumerable:!0})},fe=(d,u,h,m)=>{if(u&&typeof u=="object"||typeof u=="function")for(let
|
|
1
|
+
var F=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ae=Object.prototype.hasOwnProperty;var ce=(d,u)=>{for(var h in u)F(d,h,{get:u[h],enumerable:!0})},fe=(d,u,h,m)=>{if(u&&typeof u=="object"||typeof u=="function")for(let v of le(u))!ae.call(d,v)&&v!==h&&F(d,v,{get:()=>u[v],enumerable:!(m=oe(u,v))||m.enumerable});return d};var ue=d=>fe(F({},"__esModule",{value:!0}),d);var ge={};ce(ge,{Rule:()=>_});module.exports=ue(ge);var M=require("./utils/get-css-property-text"),Y=require("./utils/analyze-value-token"),C=require("./utils/parse-rule-value"),P=require("./constants/sorted-selectors"),Z=require("./utils/css-escape"),_=class{constructor(u,h,m){this.className=u;this.meta=h;this.css=m;let{id:v,unit:$="rem",order:ee=0,colorful:T,prop:te,analyzeToken:Q,getThemeProps:R,parseValue:q,get:I}=h.config||{},{rootSize:ie,scope:U,important:w}=m.config,{themeNames:A,colorNames:se,colorThemesMap:re,selectors:V,globalValues:B,breakpoints:L,mediaQueries:W}=m,G=m.values[v],H=m.relationThemesMap[u],x=u;this.order=ee;let J,N,b,k;if(h.origin==="semantics"){let[l,r]=h.value;b=x.slice(l.length),J=r}else if(Q)[N,k,b]=Q.call(this,x,G,B);else{let l;if(h.origin==="matches"){let r=x.indexOf(":");this.prefix=x.slice(0,r+1),this.prefix.includes("(")?(this.prefix=void 0,l=x):l=x.slice(r+1)}else h.origin==="symbol"&&(this.symbol=x[0],l=x.slice(1));[k,b]=(0,Y.analyzeValueToken)(l,G,B)}b[0]==="!"&&(this.important=!0,b=b.slice(1));let K=l=>{let r=l.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,i)=>i%3?t:t.replace(/_/g," ")).join(""),s=[],o="",g=0;for(let t=0;t<r.length;t++){let i=r[t];if(i==="\\"){o+=i+r[++t];continue}!g&&i===","?(s.push(o),o=""):(o+=i,g&&i===")"?g--:i==="("&&g++)}return o&&s.push(o),s};this.prefixSelectors=N?K(N):[""];let E=b.split("@"),z=E[0];if(z){this.vendorSuffixSelectors={};let l=(t,i,e,n)=>{for(let[a,f]of i)if(a.test(t)){for(let p of f)l(t.replace(a,p),i,e,!0);return}n&&e.push(t)},r=[];""in V?l(z,V[""],r,!0):r.push(z);let s={};for(let[t,i]of Object.entries(V)){if(!t)continue;let e=[];for(let n of r)l(n,i,e,!1);e.length&&(s[t]=e)}let o=(t,i)=>{let e=i.reduce((n,a)=>(n.push(...K(a)),n),[]);t in this.vendorSuffixSelectors?this.vendorSuffixSelectors[t].push(...e):this.vendorSuffixSelectors[t]=e},g=Object.keys(s);if(g.length)for(let t of g)o(t,s[t]);else o("",r);for(let t of Object.values(this.vendorSuffixSelectors))for(let i of t){this.hasWhere!==!1&&(this.hasWhere=i.includes(":where("));for(let e=0;e<P.SORTED_SELECTORS.length;e++)if(i.includes(P.SORTED_SELECTORS[e])){(this.priority===-1||this.priority>e)&&(this.priority=e);break}}}else this.vendorSuffixSelectors={"":[""]};for(let l=1;l<E.length;l++){let r=E[l];if(r)if(A.includes(r))this.theme=r;else if(r==="rtl"||r==="ltr")this.direction=r;else{let s,o,g=r.indexOf("_");if(g!==-1)s=r.slice(0,g),o=r.slice(g);else{let t=r.indexOf("(");t!==-1&&(s=r.slice(0,t),o=r.slice(t))}if(!s){s="media";let t=[];this.media={token:r,features:{}};let i=r.split("&");for(let e of i)if(e==="all"||e==="print"||e==="screen"||e==="speech")this.media.type=e;else if(e==="\u{1F5A8}")this.media.type="print";else if(e==="landscape"||e==="portrait")t.push("(orientation:"+e+")");else if(e==="motion"||e==="reduced-motion")t.push("(prefers-reduced-motion:"+(e==="motion"?"no-preference":"reduce")+")");else if(W&&e in W)t.push(W[e]);else{let n={token:e},a="",f="",p=0;e.startsWith("<=")?(f="<=",a="max-width"):e.startsWith(">=")||L[e]?(f=">=",a="min-width"):e.startsWith(">")?(f=">",a="min-width",p=.02):e.startsWith("<")&&(f="<",a="max-width",p=-.02);let S=f?e.replace(f,""):e,c=L[S];switch(a){case"max-width":case"min-width":c?Object.assign(n,(0,C.parseRuleValue)(c,"px")):Object.assign(n,(0,C.parseRuleValue)(S,"px")),n.unit==="px"&&(n.value+=p),this.media.features[a]=n,t.push("("+a+":"+(n.value+n.unit)+")");break}}o="",this.media.type&&(o=this.media.type),t.length&&(o+=(o?" and ":"")+t.join(" and "))}o&&(this.at[s]=(s in this.at?this.at[s]+" and ":"")+o.replace(/_/g," "))}}let j=(l,r)=>{let s,o,g=(i,e,n)=>{let a="";this.direction&&(a+="[dir="+this.direction+"] ");let f=this.prefixSelectors.map(c=>c+a),p=(c,O)=>f.map(y=>(c?"."+c+" ":"")+(U?U+" ":"")+y).reduce((y,D)=>(y.push(n.reduce((X,ne)=>(X.push(D+"."+(0,Z.cssEscape)(O)+ne),X),[]).join(",")),y),[]).join(","),S=p(e,u)+(H?Object.entries(H).filter(([c])=>this.theme||!T||!e||!c||c===e).map(([c,O])=>O.reduce((y,D)=>y+","+p(this.theme??((T||R)&&e||c),D),"")).join(""):"")+"{"+i+"}";for(let c of Object.keys(this.at).sort((O,y)=>y==="supports"?-1:1))S="@"+c+" "+this.at[c]+"{"+S+"}";return S},t=[];if(k){let i,e;for(let n of k)typeof n=="string"?t.push(n):(i=(0,C.parseRuleValue)(n.value,$,T&&se,T&&re,ie,this.theme?[this.theme,""]:[l]),i.colorMatched!==void 0&&e!==!0&&(e=i.colorMatched),t.push(i.value+i.unit));if(r&&(e===void 0?l:!e))return;if(t.length===1?i?(s=i.value,o=i.unit):s=t[0]:s=t.reduce((n,a,f)=>n+a+(a===","||k[f+1]===","||f===k.length-1?"":" "),""),typeof s!="object"){q&&(s=q.call(this,s,this.css.config)),T&&s==="current"&&(s="currentColor");let n={unit:o,value:s,important:this.important};if(R){let a=R.call(this,n,m);for(let f in a)for(let p of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:o,value:s,text:g(Object.entries(a[f]).map(([S,c])=>(0,M.getCssPropertyText)(S,{important:(this.important||w)&&!c.endsWith("!important"),unit:"",value:c})).join(";"),f,p),theme:f});return}else I&&(s=I.call(this,n))}}else s=J;for(let i of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:o,value:s,text:g(typeof s=="object"?Object.entries(s).map(([e,n])=>(0,M.getCssPropertyText)(e,{...typeof n=="object"?n:{unit:"",value:n},important:this.important||w})).join(";"):(0,M.getCssPropertyText)(te,{unit:o,value:s,important:this.important||w}),l,i),theme:l})};if(R)j(void 0,!1);else if(this.theme)j(this.theme,!1);else if(T)for(let l of A)j(l,!0);else j("",!1)}at={};priority=-1;natives=[];get text(){return this.natives.map(u=>u.text).join("")}};0&&(module.exports={Rule});
|
package/dist/config/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { selectors } from './selectors';
|
|
|
6
6
|
import { semantics } from './semantics';
|
|
7
7
|
import { themes } from './themes';
|
|
8
8
|
import { theme } from './theme';
|
|
9
|
-
import { values } from './values';
|
|
10
9
|
import { rules } from './rules';
|
|
11
10
|
import { override } from './override';
|
|
12
11
|
import { observe } from './observe';
|
|
@@ -251,137 +250,12 @@ declare const config: {
|
|
|
251
250
|
};
|
|
252
251
|
themes: string[];
|
|
253
252
|
theme: ThemeConfig;
|
|
254
|
-
values: {
|
|
255
|
-
backgroundClip: {
|
|
256
|
-
content: string;
|
|
257
|
-
border: string;
|
|
258
|
-
padding: string;
|
|
259
|
-
};
|
|
260
|
-
backgroundOrigin: {
|
|
261
|
-
content: string;
|
|
262
|
-
border: string;
|
|
263
|
-
padding: string;
|
|
264
|
-
};
|
|
265
|
-
boxSizing: {
|
|
266
|
-
content: string;
|
|
267
|
-
border: string;
|
|
268
|
-
};
|
|
269
|
-
clipPath: {
|
|
270
|
-
margin: string;
|
|
271
|
-
fill: string;
|
|
272
|
-
stroke: string;
|
|
273
|
-
view: string;
|
|
274
|
-
content: string;
|
|
275
|
-
border: string;
|
|
276
|
-
padding: string;
|
|
277
|
-
};
|
|
278
|
-
flexDirection: {
|
|
279
|
-
col: string;
|
|
280
|
-
'col-reverse': string;
|
|
281
|
-
};
|
|
282
|
-
fontFamily: {
|
|
283
|
-
mono: string;
|
|
284
|
-
sans: string;
|
|
285
|
-
serif: string;
|
|
286
|
-
};
|
|
287
|
-
fontWeight: {
|
|
288
|
-
thin: number;
|
|
289
|
-
extralight: number;
|
|
290
|
-
light: number;
|
|
291
|
-
regular: number;
|
|
292
|
-
medium: number;
|
|
293
|
-
semibold: number;
|
|
294
|
-
bold: number;
|
|
295
|
-
extrabold: number;
|
|
296
|
-
heavy: number;
|
|
297
|
-
};
|
|
298
|
-
gridAutoColumns: {
|
|
299
|
-
min: string;
|
|
300
|
-
max: string;
|
|
301
|
-
};
|
|
302
|
-
gridAutoRows: {
|
|
303
|
-
min: string;
|
|
304
|
-
max: string;
|
|
305
|
-
};
|
|
306
|
-
gridTemplateColumns: {
|
|
307
|
-
min: string;
|
|
308
|
-
max: string;
|
|
309
|
-
};
|
|
310
|
-
gridTemplateRows: {
|
|
311
|
-
min: string;
|
|
312
|
-
max: string;
|
|
313
|
-
};
|
|
314
|
-
order: {
|
|
315
|
-
first: number;
|
|
316
|
-
last: number;
|
|
317
|
-
};
|
|
318
|
-
position: {
|
|
319
|
-
abs: string;
|
|
320
|
-
rel: string;
|
|
321
|
-
};
|
|
322
|
-
shapeOutside: {
|
|
323
|
-
margin: string;
|
|
324
|
-
content: string;
|
|
325
|
-
border: string;
|
|
326
|
-
padding: string;
|
|
327
|
-
};
|
|
328
|
-
transformBox: {
|
|
329
|
-
fill: string;
|
|
330
|
-
stroke: string;
|
|
331
|
-
view: string;
|
|
332
|
-
content: string;
|
|
333
|
-
border: string;
|
|
334
|
-
padding: string;
|
|
335
|
-
};
|
|
336
|
-
width: {
|
|
337
|
-
full: string;
|
|
338
|
-
fit: string;
|
|
339
|
-
max: string;
|
|
340
|
-
min: string;
|
|
341
|
-
};
|
|
342
|
-
minWidth: {
|
|
343
|
-
full: string;
|
|
344
|
-
fit: string;
|
|
345
|
-
max: string;
|
|
346
|
-
min: string;
|
|
347
|
-
};
|
|
348
|
-
minHeight: {
|
|
349
|
-
full: string;
|
|
350
|
-
fit: string;
|
|
351
|
-
max: string;
|
|
352
|
-
min: string;
|
|
353
|
-
};
|
|
354
|
-
maxWidth: {
|
|
355
|
-
full: string;
|
|
356
|
-
fit: string;
|
|
357
|
-
max: string;
|
|
358
|
-
min: string;
|
|
359
|
-
};
|
|
360
|
-
maxHeight: {
|
|
361
|
-
full: string;
|
|
362
|
-
fit: string;
|
|
363
|
-
max: string;
|
|
364
|
-
min: string;
|
|
365
|
-
};
|
|
366
|
-
height: {
|
|
367
|
-
full: string;
|
|
368
|
-
fit: string;
|
|
369
|
-
max: string;
|
|
370
|
-
min: string;
|
|
371
|
-
};
|
|
372
|
-
flexBasis: {
|
|
373
|
-
full: string;
|
|
374
|
-
fit: string;
|
|
375
|
-
max: string;
|
|
376
|
-
min: string;
|
|
377
|
-
};
|
|
378
|
-
};
|
|
379
253
|
rules: Record<string, RuleConfig>;
|
|
380
254
|
override: boolean;
|
|
381
255
|
observe: boolean;
|
|
382
256
|
important: boolean;
|
|
383
257
|
};
|
|
384
|
-
export { config, breakpoints, colors, rootSize, scope, selectors, semantics, themes, theme,
|
|
258
|
+
export { config, breakpoints, colors, rootSize, scope, selectors, semantics, themes, theme, rules, override, observe, important };
|
|
385
259
|
import type { RuleConfig } from '../rule';
|
|
386
260
|
import type { ThemeConfig } from '../theme';
|
|
387
261
|
type Classes = {
|
|
@@ -405,7 +279,7 @@ type SemanticsBase = {
|
|
|
405
279
|
type Semantics = {
|
|
406
280
|
[key: string]: SemanticsBase;
|
|
407
281
|
};
|
|
408
|
-
type Values = {
|
|
282
|
+
export type Values = {
|
|
409
283
|
[key: string]: string | number | Values;
|
|
410
284
|
};
|
|
411
285
|
export interface Config {
|
package/dist/esm/config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{breakpoints as e}from"./breakpoints";import{colors as r}from"./colors";import{rootSize as s}from"./root-size";import{scope as o}from"./scope";import{selectors as t}from"./selectors";import{semantics as i}from"./semantics";import{themes as m}from"./themes";import{theme as n}from"./theme";import{
|
|
1
|
+
import{breakpoints as e}from"./breakpoints";import{colors as r}from"./colors";import{rootSize as s}from"./root-size";import{scope as o}from"./scope";import{selectors as t}from"./selectors";import{semantics as i}from"./semantics";import{themes as m}from"./themes";import{theme as n}from"./theme";import{rules as p}from"./rules";import{override as a}from"./override";import{observe as l}from"./observe";import{important as g}from"./important";var Q={breakpoints:e,colors:r,rootSize:s,scope:o,selectors:t,semantics:i,themes:m,theme:n,rules:p,override:a,observe:l,important:g};export{e as breakpoints,r as colors,Q as config,g as important,l as observe,a as override,s as rootSize,p as rules,o as scope,t as selectors,i as semantics,n as theme,m as themes};
|
package/dist/esm/config/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{analyzeValueToken as p}from"../utils/analyze-value-token";import{getBorderProps as d}from"../utils/get-border-props";import{parseValueUnit as f}from"../utils/parse-value-unit";import{START_SYMBOL as b}from"../constants/start-symbol";import"../polyfills/css-escape";import{cssEscape as y}from"../utils/css-escape";var C={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,r,t){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...p(e.slice(s),r,t)]},getThemeProps(e,r){let t={},s=(o,a)=>{let i=a.indexOf(":");if(i!==-1){o in t||(t[o]={});let c=t[o],g=a.slice(0,i);g in c||(c[g]=a.slice(i+1))}},l=o=>{let a=(i,c)=>{let g=c.slice(y(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let x of g)s(i,x)};if(this.theme){let i=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);i&&a(this.theme,i.text)}else for(let i of o.natives)a(i.theme,i.text)},u=[],n="",h=()=>{n&&(u.push(n.replace(/ /g,"")),n="")},m=1;(function o(a){for(;m<e.value.length;m++){let i=e.value[m];if(!a){if(i===";"){h();continue}if(i==="}")break}if(n+=i,a===i){if(a==="'"||a==='"'){let c=0;for(let g=n.length-2;n[g]==="\\";g--)c++;if(c%2)continue}break}else i in b&&a!=="'"&&a!=='"'&&(m++,o(b[i]))}})(void 0),h();for(let o of u){let a=r.create(o);if(Array.isArray(a))for(let i of a)l(i);else a?l(a):s(this.theme??"",o)}return t}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:""},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)"},fontSmoothing:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let r={};switch(e.value){case"subpixel-antialiased":r["-webkit-font-smoothing"]=r["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":r["-webkit-font-smoothing"]={...e,value:"antialiased"},r["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return r}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},spacing:{matches:"^[pm][xytblr]?:.",prop:!1,get(e){let t=this.prefix[0]==="m"?"margin":"padding",s=t+"-left",l=t+"-right",u=t+"-top",n=t+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[l]:e};case"y":return{[u]:e,[n]:e};case"l":return{[s]:e};case"r":return{[l]:e};case"t":return{[u]:e};case"b":return{[n]:e};default:return{[t]:e}}},get order(){return this.prefix==="p:"||this.prefix==="m:"?-1:0}},margin:{matches:"^margin(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="margin:"?-1:0}},padding:{matches:"^padding(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="padding:"?-1:0}},flexBasis:{},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)"},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:."},height:{matches:"^h:."},minWidth:{matches:"^min-w:."},minHeight:{matches:"^min-h:."},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...p(e,r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{width:{...e,value:r},height:{...e,value:t}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...p(e.slice(4),r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{"min-width":{...e,value:r},"min-height":{...e,value:t}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...p(e.slice(4),r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{"max-width":{...e,value:r},"max-height":{...e,value:t}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:."},maxWidth:{matches:"^max-w:."},boxSizing:{matches:"^box:(?:$values)(?!\\|)"},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":case"y":return 0}return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:r,value:t}=e,s=.75;return{"font-size":e,"line-height":{...e,value:r==="em"?t+s+r:`calc(${t}${r} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)"},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:r}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(t,s,l,u)=>{let n,h;switch(s){case"translate":n="rem";break;case"skew":n="deg";break;case"rotate":l==="3d"&&(h=!0),n="deg";break;default:return t}let m=u.split(",");return t.replace(u,m.map((o,a)=>!h||m.length-1===a?Number.isNaN(+o)?o:o/(n==="rem"?r:1)+n:o).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return d(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let t="",s=this.prefix.split("-");if(s.length>1)for(let l=1;l<s.length-1;l++)t+=s[l][0];else t=this.prefix.slice(1,-1);switch(t){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return d(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return d(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return d(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}}},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)"},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,r){return f(e,t=>{switch(t){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},r)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,r){return f(e,t=>{switch(t){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},r)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:."},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:."},gridTemplateRows:{},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:""},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)"},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:."},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};export{C as rules};
|
|
1
|
+
import{analyzeValueToken as f}from"../utils/analyze-value-token";import{getBorderProps as b}from"../utils/get-border-props";import{parseValueUnit as y}from"../utils/parse-value-unit";import{START_SYMBOL as v}from"../constants/start-symbol";import{BOX_UNDERNEATH as d}from"../constants/box-underneath";import{CONTENT_EXTREMA as x}from"../constants/content-extrema";import{SIZING_VALUES as h}from"../constants/sizing-values";import"../polyfills/css-escape";import{cssEscape as w}from"../utils/css-escape";var P={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,r,t){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...f(e.slice(s),r,t)]},getThemeProps(e,r){let t={},s=(o,a)=>{let i=a.indexOf(":");if(i!==-1){o in t||(t[o]={});let c=t[o],g=a.slice(0,i);g in c||(c[g]=a.slice(i+1))}},l=o=>{let a=(i,c)=>{let g=c.slice(w(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let k of g)s(i,k)};if(this.theme){let i=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);i&&a(this.theme,i.text)}else for(let i of o.natives)a(i.theme,i.text)},u=[],n="",p=()=>{n&&(u.push(n.replace(/ /g,"")),n="")},m=1;(function o(a){for(;m<e.value.length;m++){let i=e.value[m];if(!a){if(i===";"){p();continue}if(i==="}")break}if(n+=i,a===i){if(a==="'"||a==='"'){let c=0;for(let g=n.length-2;n[g]==="\\";g--)c++;if(c%2)continue}break}else i in v&&a!=="'"&&a!=='"'&&(m++,o(v[i]))}})(void 0),p();for(let o of u){let a=r.create(o);if(Array.isArray(a))for(let i of a)l(i);else a?l(a):s(this.theme??"",o)}return t}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:"",values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)",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:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let r={};switch(e.value){case"subpixel-antialiased":r["-webkit-font-smoothing"]=r["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":r["-webkit-font-smoothing"]={...e,value:"antialiased"},r["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return r}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},spacing:{matches:"^[pm][xytblr]?:.",prop:!1,get(e){let t=this.prefix[0]==="m"?"margin":"padding",s=t+"-left",l=t+"-right",u=t+"-top",n=t+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[l]:e};case"y":return{[u]:e,[n]:e};case"l":return{[s]:e};case"r":return{[l]:e};case"t":return{[u]:e};case"b":return{[n]:e};default:return{[t]:e}}},get order(){return this.prefix==="p:"||this.prefix==="m:"?-1:0}},margin:{matches:"^margin(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="margin:"?-1:0}},padding:{matches:"^padding(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="padding:"?-1:0}},flexBasis:{values:h},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",values:{col:"column","col-reverse":"column-reverse"}},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:.",values:h},height:{matches:"^h:.",values:h},minWidth:{matches:"^min-w:.",values:h},minHeight:{matches:"^min-h:.",values:h},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e,r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{width:{...e,value:r},height:{...e,value:t}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e.slice(4),r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{"min-width":{...e,value:r},"min-height":{...e,value:t}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,r,t){return["",...f(e.slice(4),r,t,["x"])]},get(e){let[r,t]=e.value.split(" x ");return{"max-width":{...e,value:r},"max-height":{...e,value:t}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:.",values:h},maxWidth:{matches:"^max-w:.",values:h},boxSizing:{matches:"^box:(?:$values)(?!\\|)",values:{content:"content-box",border:"border-box"}},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{values:{abs:"absolute",rel:"relative"}},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:r,value:t}=e,s=.75;return{"font-size":e,"line-height":{...e,value:r==="em"?t+s+r:`calc(${t}${r} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)",values:{...d,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:r}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(t,s,l,u)=>{let n,p;switch(s){case"translate":n="rem";break;case"skew":n="deg";break;case"rotate":l==="3d"&&(p=!0),n="deg";break;default:return t}let m=u.split(",");return t.replace(u,m.map((o,a)=>!p||m.length-1===a?Number.isNaN(+o)?o:o/(n==="rem"?r:1)+n:o).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return b(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let t="",s=this.prefix.split("-");if(s.length>1)for(let l=1;l<s.length-1;l++)t+=s[l][0];else t=this.prefix.slice(1,-1);switch(t){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return b(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return b(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return b(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}},values:d},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)",values:d},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,r){return y(e,t=>{switch(t){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},r)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,r){return y(e,t=>{switch(t){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},r)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:.",values:x},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{values:x},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:.",values:x},gridTemplateRows:{values:x},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:"",values:{first:-999999,last:999999}},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",values:{...d,margin:"margin-box"}},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:.",values:{...d,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};export{P as rules};
|
package/dist/esm/css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var $=Object.defineProperty;var D=(O,e,t)=>e in O?$(O,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):O[e]=t;var S=(O,e,t)=>(D(O,typeof e!="symbol"?e+"":e,t),t);function L(O){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&O instanceof e||O instanceof Date||O instanceof RegExp)}function N(O){if(typeof Buffer<"u"&&Buffer&&O instanceof Buffer){let e=Buffer.alloc(O.length);return O.copy(e),e}else{if(O instanceof Date)return new Date(O.getTime());if(O instanceof RegExp)return new RegExp(O);throw new Error("Unexpected situation")}}function I(O){let e=[];return O.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=I(t):L(t)?e[s]=N(t):e[s]=W({},t):e[s]=t}),e}function F(O,e){return e==="__proto__"?void 0:O[e]}function W(...O){let e={},t,s;return O.forEach(function(d){typeof d!="object"||d===null||Array.isArray(d)||Object.keys(d).forEach(function(R){if(s=F(e,R),t=F(d,R),t!==e)if(typeof t!="object"||t===null){e[R]=t;return}else if(Array.isArray(t)){e[R]=I(t);return}else if(L(t)){e[R]=N(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[R]=W({},t);return}else{e[R]=W(s,t);return}})}),e}import{Rule as H}from"./rule";import{config as B}from"./config";import{Theme as Q}from"./theme";import{rgbToHex as z}from"./utils/rgb-to-hex";import{SELECTOR_SYMBOLS as _}from"./constants/selector-symbols";var A=typeof window<"u",j=class{constructor(e){this.config=e;this.config?.override||(this.config=W(B,e)),this.cache(),A&&this.config.observe&&this.observe(document),j.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=A?new MutationObserver(e=>{let t={},s=[],d=[],R=[],w=(c,n)=>{n?c.classList.forEach(y):c.classList.forEach(g);let l=c.children;for(let m=0;m<l.length;m++){let f=l[m];f.classList&&(d.push(f),w(f,n))}},g=c=>{c in t?t[c]++:t[c]=1},y=c=>{c in t?t[c]--:c in this.countOfClass&&(t[c]=-1)},v=(c,n)=>{for(let l=0;l<c.length;l++){let m=c[l];m.classList&&!d.includes(m)&&!R.includes(m)&&(m.isConnected!==n?(d.push(m),w(m,n)):R.push(m))}};for(let c=0;c<e.length;c++){let n=e[c],{addedNodes:l,removedNodes:m,type:f,target:h}=n;if(f==="attributes"){if(s.find(x=>x.target===h))continue;s.push(n)}else v(l,!1),(!h.isConnected||!d.includes(h))&&v(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:c,target:n}of s){let l=d.includes(n),m=n.classList,f=c?c.split(" "):[];if(l){if(n.isConnected)continue;for(let h of f)m.contains(h)||y(h)}else if(n.isConnected){m.forEach(h=>{f.includes(h)||g(h)});for(let h of f)m.contains(h)||y(h)}}for(let c in t){let n=t[c],l=(this.countOfClass[c]||0)+n;l===0?(delete this.countOfClass[c],this.delete(c)):(c in this.countOfClass||this.insert(c),this.countOfClass[c]=l)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.relationThemesMap={},this.relations={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:e,classes:t,selectors:s,themes:d,colors:R,values:w,breakpoints:g,mediaQueries:y,rules:v}=this.config;function c(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i="",u={}){let a=b=>b?(i?i+"-":"")+b:i,p=Object.entries(r),M=[],T=[];for(let b of p){let E=b[1];(typeof E=="object"&&!Array.isArray(E)?M:T).push(b)}for(let[b,E]of M)n(E,o,a(b),u);if(o&&i)T.length&&(u[i]=T.reduce((b,[E,V])=>(b[E]=V,b),{}));else for(let[b,E]of T)u[a(b)]=E;return u}if(e)for(let[r,o]of Object.entries(n(e,!0)))this.semantics.push([new RegExp("^"+c(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,o]]);if(s)for(let[r,o]of Object.entries(n(s,!1))){let i=new RegExp(c(r)+"(?![a-z-])");for(let u of Array.isArray(o)?o:[o]){let a=u.match(/^::-[a-z]+-/m)?.[0]??"",p=this.selectors[a];p||(p=this.selectors[a]=[]);let M=p.find(([T])=>T===i);M||(M=[i,[]],p.push(M)),M[1].push(u)}}if(w)for(let[r,o]of Object.entries(w))typeof o=="object"?this.values[r]=n(o,!1):this.globalValues[r]=o;g&&(this.breakpoints=n(g,!1)),y&&(this.mediaQueries=n(y,!1));let l=t?n(t,!1):{},m=d&&!Array.isArray(d)?Object.entries(d).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:i}])=>(r[o]=n(i,!1),r),{}):{},f=[...Object.keys(l),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],h=r=>{if(r in this.classes)return;let o=this.classes[r]=[],i=(u,a)=>{if(!a)return;let p=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let M of p){let T=b=>{b in this.relationThemesMap?u in this.relationThemesMap[b]?this.relationThemesMap[b][u].push(r):this.relationThemesMap[b][u]=[r]:this.relationThemesMap[b]={[u]:[r]},o.includes(b)||o.push(b)};if(f.includes(M)){h(M);for(let b of this.classes[M])T(b)}else T(M)}};i("",l?.[r]);for(let[u,a]of Object.entries(m))i(u,a?.[r])};for(let r of f)h(r);for(let r in this.relationThemesMap){let o=this.relations[r]=[];for(let i of Object.values(this.relationThemesMap[r]))for(let u of i)o.includes(u)||o.push(u)}let x=(r,o)=>{if(!o)return;let i=n(o,!0);for(let[u,a]of Object.entries(i)){let p=typeof a=="string"?{"":a}:a;for(let[M,T]of Object.entries(p)){let b=u+(M?"-"+M:"");b in this.colorThemesMap?this.colorThemesMap[b][r]=T:this.colorThemesMap[b]={[r]:T}}}for(let u in o)this.colorNames.includes(u)||this.colorNames.push(u)};if(x("",R),d)if(Array.isArray(d))this.themeNames.push(...d);else for(let r in d){let o=d[r];x(r,o.colors),this.themeNames.push(r)}let C=r=>{for(let[o,i]of Object.entries(this.colorThemesMap))for(let[u,a]of Object.entries(i))a.startsWith("#")||r(o,i,u,a)};if(C((r,o,i,u)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(u);if(a){let p="#"+z(+a[1],+a[2],+a[3]);a[4]&&(p+=Math.round(255*+a[4]).toString(16)),o[i]=p}}),C((r,o,i,u)=>{let[a,p]=u.split("/"),M=this.colorThemesMap[a];if(M){let T=(i?M[i]:void 0)??M[""];o[i]=p?T.slice(0,7)+Math.round(255*+p).toString(16):T}else console.warn(`\`${u}\` doesn't exist in the extended config \`.colors\``),delete o[i],Object.keys(o).length||delete this.colorThemesMap[r]}),v)for(let r in v){let o=v[r],{matches:i,prop:u}=o;if(o.id=r,o.prop=u===!1?"":r.replace(/(?!^)[A-Z]/g,a=>"-"+a).toLowerCase(),i){let a=Object.keys(this.values[r]??{}),p=i.indexOf("$values");this.matches[r]=new RegExp(p===-1?i:a.length?i.slice(0,p)+a.join("|")+i.slice(p+7):i.slice(0,p-(i[p-1]==="|"?1:0))+i.slice(p+7+(i[p+7]==="|"?1:0)))}}}observe(e,t={subtree:!0,childList:!0}){if(A&&e){this.root=e;let s=e===document;s&&(j.root=this),this.host=s?document.documentElement:root.host,this.theme=new Q(this.host,this.config.theme);let d=s?document.head:e,R=s?document.styleSheets:e.styleSheets;for(let g of R){let{title:y,href:v,ownerNode:c}=g;(y==="master"||v&&v.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(v))&&(this.style=c)}if(this.style)for(let g=0;g<this.style.sheet.cssRules.length;g++){let y=c=>{if(c.selectorText){let l=c.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let f=l[m];if(f[0]==="."){let h=f.slice(1),x="";for(let C=0;C<h.length;C++){let r=h[C],o=h[C+1];if(r==="\\"){if(C++,o!=="\\"){x+=o;continue}}else if(_.includes(r))break;x+=r}if(!(x in this.ruleOfClass)&&!(x in this.classes)){let C=this.create(x)[0];if(C)return C}}}}else if(c.cssRules)for(let n=0;n<c.cssRules.length;n++){let l=y(c.cssRules[n]);if(l)return l}},v=y(this.style.sheet.cssRules[g]);if(v){this.rules.push(v),this.ruleOfClass[v.className]=v;for(let c=0;c<v.natives.length;c++)v.natives[c].cssRule=this.style.sheet.cssRules[g+c];g+=v.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let g=d.querySelector('link[rel="styleSheet"], style');g?g.before(this.style):d.append(this.style)}let w=g=>{g.forEach(y=>{y in this.countOfClass?this.countOfClass[y]++:(this.countOfClass[y]=1,this.insert(y))})};w(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(g=>w(g.classList)),this.e.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleOfClass={},this.countOfClass={},this.rules.length=0;let e=this.style.sheet;if(e)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style.remove(),this.style=null,this.theme?.destroy(),this.theme=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],d=this.matches[t],{colorStarts:R,symbol:w,prop:g}=s,{colorNames:y,colorThemesMap:v}=this;if(d&&d.test(e))return{origin:"matches",config:s};if(R){if(e.match("^"+R+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(y.length&&e.indexOf("|")===-1){let c=e.match("^"+R+"((?:"+y.join("|")+")[0-9a-zA-Z-]*)");if(c&&c[1]in v)return{origin:"matches",config:s}}}if(w&&e.startsWith(w))return{origin:"symbol",config:s};if(g&&e.startsWith(g+":"))return{origin:"matches",config:s}}for(let t of this.semantics)if(e.match(t[0]))return{origin:"semantics",value:t[1]}}create(e){let t=s=>{if(s in this.ruleOfClass)return this.ruleOfClass[s];let d=this.match(s);if(d)return new H(s,d,this)};return(e in this.classes?this.classes[e].map(s=>t(s)):[t(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=W(B,e),this.cache(),!this.style)return;let t=document.createElement("style");t.title="master",this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleOfClass={};for(let s in this.countOfClass)this.insert(s)}destroy(){let e=j.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style.sheet,s=d=>{let R=this.ruleOfClass[d];if(!(!R||d in this.relations&&this.relations[d].some(w=>w in this.countOfClass))){if(R.natives.length){let w=R.natives[0];for(let g=0;g<t.cssRules.length;g++)if(t.cssRules[g]===w.cssRule){for(let v=0;v<R.natives.length;v++)t.deleteRule(g);this.rules.splice(this.rules.indexOf(R),1);break}}delete this.ruleOfClass[d]}};if(e in this.classes){for(let d of this.classes[e])d in this.countOfClass||s(d);delete this.ruleOfClass[e]}else s(e)}insert(e){let t=this.create(e);return t.length?(this.insertRules(t),!0):!1}insertRules(e){for(let t of e){if(this.ruleOfClass[t.className])continue;let s,d=this.rules.length-1,{media:R,order:w,priority:g,hasWhere:y,className:v}=t,c=(n,l,m,f)=>{let h=0,x;l&&(h=n.findIndex(l)),m&&(x=n.findIndex(m)),h===-1&&(h=n.length),(x===void 0||x===-1)&&(x=n.length);let C=n.slice(h,x);for(let r=0;r<C.length;r++){let o=C[r];if(!(o.priority===-1||f&&f(o))&&(o.priority<g||o.priority===g&&(y&&!o.hasWhere||o.order>=w)))return h+r}return h+C.length};if(R){let n=this.rules.findIndex(l=>l.media);if(n!==-1){let l=R.features["max-width"],m=R.features["min-width"];if(l&&m){let f=l.value-m.value;for(let h=d;h>=n;h--){s=h;let x=this.rules[h],C=x.media,r=C.features["max-width"],o=C.features["min-width"];if(!r||!o){s++;break}let i=r.value-o.value;if(i===f){if(y!==x.hasWhere)continue;if(g!==-1){let u=[this.rules[h]];for(let a=h-1;a>=n;a--){let p=this.rules[a];if(p.hasWhere!==y)break;let M=p.media,T=M.features["max-width"],b=M.features["min-width"];if(!T||!b||T.value-b.value!==i)break;u.unshift(this.rules[a])}s=c(this.rules,a=>a.media&&a.priority!==-1&&a.media.features["min-width"]&&a.media.features["max-width"])}break}else if(i>f)break}}else if(m)for(let f=n;f<=d;f++){s=f;let h=this.rules[f],x=h.media,C=x.features["max-width"],r=x.features["min-width"];if(C){if(r)break;continue}let o=r?.value;if(o===m.value){if(!y&&h.hasWhere){s++;continue}if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else for(let i=f;i<=d;i++){let u=this.rules[i],a=u.media,p=a.features["min-width"];if(!a.features["max-width"]){if(u.hasWhere!==y||p.value!==o||u.order>=w)break;s=i+1}}break}else{if(o>m.value)break;s++}}else if(l)for(let f=d;f>=n;f--){s=f;let h=this.rules[f],x=h.media,C=x.features["max-width"];if(x.features["min-width"])continue;let o=C?.value;if(!o||o>l.value){s++;break}else if(o===l.value){if(y&&!h.hasWhere)continue;if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else{let i=[this.rules[f]];for(let u=f-1;u>=n;u--){let a=this.rules[u],p=a.media,M=p.features["min-width"],T=p.features["max-width"];if(!M&&(!T||T.value!==o||a.hasWhere!==y))break;i.unshift(a)}for(let u=0;u<i.length;u++){let a=i[u];if(!a.media.features["min-width"]){if(a.order>=w)break;s=f-i.length+2+u}}}break}}}if(s===void 0)if(n===-1)s=d+1;else if(g!==-1)s=n+c(this.rules.slice(n),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(y){let l=n;for(;l<this.rules.length;l++){let m=this.rules[l];if(m.priority!==-1||!m.hasWhere||m.order>=w){s=l;break}}s===void 0&&(s=l)}else for(let l=n;l<=d;l++){s=l;let m=this.rules[l],f=m.media;if(m.priority!==-1||f.features["max-width"]||f.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=w)break}}else if(g===-1)if(y)s=this.rules.findIndex(n=>!n.hasWhere||n.media||n.priority!==-1||n.order>=w),s===-1&&(s=d+1);else{let n=0;for(;n<this.rules.length;n++){let l=this.rules[n];if(l.media||!l.hasWhere&&(l.order>=w||l.priority!==-1)){s=n;break}}s===void 0&&(s=n)}else s=c(this.rules,void 0,n=>n.media);if(this.rules.splice(s,0,t),this.ruleOfClass[v]=t,this.style){let n=this.style.sheet,l=0,m=f=>{let h=this.rules[f];if(h){if(!h.natives.length)return m(f-1);let x=h.natives[h.natives.length-1].cssRule;for(let C=0;C<n.cssRules.length;C++)if(n.cssRules[C]===x){l=C+1;break}}};m(s-1);for(let f=0;f<t.natives.length;)try{let h=t.natives[f];n.insertRule(h.text,l),h.cssRule=n.cssRules[l++],f++}catch(h){console.error(h),t.natives.splice(f,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},k=j;S(k,"root"),S(k,"instances",[]),S(k,"refresh",e=>{for(let t of j.instances)t.refresh(e)});A&&(window.MasterCSS=k);export{k as MasterCSS};
|
|
1
|
+
var $=Object.defineProperty;var D=(O,e,t)=>e in O?$(O,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):O[e]=t;var S=(O,e,t)=>(D(O,typeof e!="symbol"?e+"":e,t),t);function L(O){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&O instanceof e||O instanceof Date||O instanceof RegExp)}function N(O){if(typeof Buffer<"u"&&Buffer&&O instanceof Buffer){let e=Buffer.alloc(O.length);return O.copy(e),e}else{if(O instanceof Date)return new Date(O.getTime());if(O instanceof RegExp)return new RegExp(O);throw new Error("Unexpected situation")}}function I(O){let e=[];return O.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=I(t):L(t)?e[s]=N(t):e[s]=W({},t):e[s]=t}),e}function F(O,e){return e==="__proto__"?void 0:O[e]}function W(...O){let e={},t,s;return O.forEach(function(d){typeof d!="object"||d===null||Array.isArray(d)||Object.keys(d).forEach(function(x){if(s=F(e,x),t=F(d,x),t!==e)if(typeof t!="object"||t===null){e[x]=t;return}else if(Array.isArray(t)){e[x]=I(t);return}else if(L(t)){e[x]=N(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[x]=W({},t);return}else{e[x]=W(s,t);return}})}),e}import{Rule as H}from"./rule";import{config as B}from"./config";import{Theme as Q}from"./theme";import{rgbToHex as z}from"./utils/rgb-to-hex";import{SELECTOR_SYMBOLS as _}from"./constants/selector-symbols";var A=typeof window<"u",j=class{constructor(e){this.config=e;this.config?.override||(this.config=W(B,e)),this.cache(),A&&this.config.observe&&this.observe(document),j.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=A?new MutationObserver(e=>{let t={},s=[],d=[],x=[],w=(c,n)=>{n?c.classList.forEach(y):c.classList.forEach(g);let l=c.children;for(let m=0;m<l.length;m++){let f=l[m];f.classList&&(d.push(f),w(f,n))}},g=c=>{c in t?t[c]++:t[c]=1},y=c=>{c in t?t[c]--:c in this.countOfClass&&(t[c]=-1)},M=(c,n)=>{for(let l=0;l<c.length;l++){let m=c[l];m.classList&&!d.includes(m)&&!x.includes(m)&&(m.isConnected!==n?(d.push(m),w(m,n)):x.push(m))}};for(let c=0;c<e.length;c++){let n=e[c],{addedNodes:l,removedNodes:m,type:f,target:h}=n;if(f==="attributes"){if(s.find(C=>C.target===h))continue;s.push(n)}else M(l,!1),(!h.isConnected||!d.includes(h))&&M(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:c,target:n}of s){let l=d.includes(n),m=n.classList,f=c?c.split(" "):[];if(l){if(n.isConnected)continue;for(let h of f)m.contains(h)||y(h)}else if(n.isConnected){m.forEach(h=>{f.includes(h)||g(h)});for(let h of f)m.contains(h)||y(h)}}for(let c in t){let n=t[c],l=(this.countOfClass[c]||0)+n;l===0?(delete this.countOfClass[c],this.delete(c)):(c in this.countOfClass||this.insert(c),this.countOfClass[c]=l)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.relationThemesMap={},this.relations={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:e,classes:t,selectors:s,themes:d,colors:x,values:w,breakpoints:g,mediaQueries:y,rules:M}=this.config;function c(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i="",u={}){let a=R=>R?(i?i+"-":"")+R:i,b=Object.entries(r),p=[],T=[];for(let R of b){let E=R[1];(typeof E=="object"&&!Array.isArray(E)?p:T).push(R)}for(let[R,E]of p)n(E,o,a(R),u);if(o&&i)T.length&&(u[i]=T.reduce((R,[E,V])=>(R[E]=V,R),{}));else for(let[R,E]of T)u[a(R)]=E;return u}if(e)for(let[r,o]of Object.entries(n(e,!0)))this.semantics.push([new RegExp("^"+c(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,o]]);if(s)for(let[r,o]of Object.entries(n(s,!1))){let i=new RegExp(c(r)+"(?![a-z-])");for(let u of Array.isArray(o)?o:[o]){let a=u.match(/^::-[a-z]+-/m)?.[0]??"",b=this.selectors[a];b||(b=this.selectors[a]=[]);let p=b.find(([T])=>T===i);p||(p=[i,[]],b.push(p)),p[1].push(u)}}w&&(this.globalValues=n(w,!1)),g&&(this.breakpoints=n(g,!1)),y&&(this.mediaQueries=n(y,!1));let l=t?n(t,!1):{},m=d&&!Array.isArray(d)?Object.entries(d).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:i}])=>(r[o]=n(i,!1),r),{}):{},f=[...Object.keys(l),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],h=r=>{if(r in this.classes)return;let o=this.classes[r]=[],i=(u,a)=>{if(!a)return;let b=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of b){let T=R=>{R in this.relationThemesMap?u in this.relationThemesMap[R]?this.relationThemesMap[R][u].push(r):this.relationThemesMap[R][u]=[r]:this.relationThemesMap[R]={[u]:[r]},o.includes(R)||o.push(R)};if(f.includes(p)){h(p);for(let R of this.classes[p])T(R)}else T(p)}};i("",l?.[r]);for(let[u,a]of Object.entries(m))i(u,a?.[r])};for(let r of f)h(r);for(let r in this.relationThemesMap){let o=this.relations[r]=[];for(let i of Object.values(this.relationThemesMap[r]))for(let u of i)o.includes(u)||o.push(u)}let C=(r,o)=>{if(!o)return;let i=n(o,!0);for(let[u,a]of Object.entries(i)){let b=typeof a=="string"?{"":a}:a;for(let[p,T]of Object.entries(b)){let R=u+(p?"-"+p:"");R in this.colorThemesMap?this.colorThemesMap[R][r]=T:this.colorThemesMap[R]={[r]:T}}}for(let u in o)this.colorNames.includes(u)||this.colorNames.push(u)};if(C("",x),d)if(Array.isArray(d))this.themeNames.push(...d);else for(let r in d){let o=d[r];C(r,o.colors),this.themeNames.push(r)}let v=r=>{for(let[o,i]of Object.entries(this.colorThemesMap))for(let[u,a]of Object.entries(i))a.startsWith("#")||r(o,i,u,a)};if(v((r,o,i,u)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(u);if(a){let b="#"+z(+a[1],+a[2],+a[3]);a[4]&&(b+=Math.round(255*+a[4]).toString(16)),o[i]=b}}),v((r,o,i,u)=>{let[a,b]=u.split("/"),p=this.colorThemesMap[a];if(p){let T=(i?p[i]:void 0)??p[""];o[i]=b?T.slice(0,7)+Math.round(255*+b).toString(16):T}else console.warn(`\`${u}\` doesn't exist in the extended config \`.colors\``),delete o[i],Object.keys(o).length||delete this.colorThemesMap[r]}),M)for(let r in M){let o=M[r],{matches:i,prop:u,values:a}=o;if(o.id=r,o.prop=u===!1?"":r.replace(/(?!^)[A-Z]/g,b=>"-"+b).toLowerCase(),a&&(this.values[r]=n(a,!1)),i){let b=Object.keys(this.values[r]??{}),p=i.indexOf("$values");this.matches[r]=new RegExp(p===-1?i:b.length?i.slice(0,p)+b.join("|")+i.slice(p+7):i.slice(0,p-(i[p-1]==="|"?1:0))+i.slice(p+7+(i[p+7]==="|"?1:0)))}}}observe(e,t={subtree:!0,childList:!0}){if(A&&e){this.root=e;let s=e===document;s&&(j.root=this),this.host=s?document.documentElement:root.host,this.theme=new Q(this.host,this.config.theme);let d=s?document.head:e,x=s?document.styleSheets:e.styleSheets;for(let g of x){let{title:y,href:M,ownerNode:c}=g;(y==="master"||M&&M.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(M))&&(this.style=c)}if(this.style)for(let g=0;g<this.style.sheet.cssRules.length;g++){let y=c=>{if(c.selectorText){let l=c.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let f=l[m];if(f[0]==="."){let h=f.slice(1),C="";for(let v=0;v<h.length;v++){let r=h[v],o=h[v+1];if(r==="\\"){if(v++,o!=="\\"){C+=o;continue}}else if(_.includes(r))break;C+=r}if(!(C in this.ruleOfClass)&&!(C in this.classes)){let v=this.create(C)[0];if(v)return v}}}}else if(c.cssRules)for(let n=0;n<c.cssRules.length;n++){let l=y(c.cssRules[n]);if(l)return l}},M=y(this.style.sheet.cssRules[g]);if(M){this.rules.push(M),this.ruleOfClass[M.className]=M;for(let c=0;c<M.natives.length;c++)M.natives[c].cssRule=this.style.sheet.cssRules[g+c];g+=M.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let g=d.querySelector('link[rel="styleSheet"], style');g?g.before(this.style):d.append(this.style)}let w=g=>{g.forEach(y=>{y in this.countOfClass?this.countOfClass[y]++:(this.countOfClass[y]=1,this.insert(y))})};w(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(g=>w(g.classList)),this.e.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleOfClass={},this.countOfClass={},this.rules.length=0;let e=this.style.sheet;if(e)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style.remove(),this.style=null,this.theme?.destroy(),this.theme=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],d=this.matches[t],{colorStarts:x,symbol:w,prop:g}=s,{colorNames:y,colorThemesMap:M}=this;if(d&&d.test(e))return{origin:"matches",config:s};if(x){if(e.match("^"+x+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(y.length&&e.indexOf("|")===-1){let c=e.match("^"+x+"((?:"+y.join("|")+")[0-9a-zA-Z-]*)");if(c&&c[1]in M)return{origin:"matches",config:s}}}if(w&&e.startsWith(w))return{origin:"symbol",config:s};if(g&&e.startsWith(g+":"))return{origin:"matches",config:s}}for(let t of this.semantics)if(e.match(t[0]))return{origin:"semantics",value:t[1]}}create(e){let t=s=>{if(s in this.ruleOfClass)return this.ruleOfClass[s];let d=this.match(s);if(d)return new H(s,d,this)};return(e in this.classes?this.classes[e].map(s=>t(s)):[t(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=W(B,e),this.cache(),!this.style)return;let t=document.createElement("style");t.title="master",this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleOfClass={};for(let s in this.countOfClass)this.insert(s)}destroy(){let e=j.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style.sheet,s=d=>{let x=this.ruleOfClass[d];if(!(!x||d in this.relations&&this.relations[d].some(w=>w in this.countOfClass))){if(x.natives.length){let w=x.natives[0];for(let g=0;g<t.cssRules.length;g++)if(t.cssRules[g]===w.cssRule){for(let M=0;M<x.natives.length;M++)t.deleteRule(g);this.rules.splice(this.rules.indexOf(x),1);break}}delete this.ruleOfClass[d]}};if(e in this.classes){for(let d of this.classes[e])d in this.countOfClass||s(d);delete this.ruleOfClass[e]}else s(e)}insert(e){let t=this.create(e);return t.length?(this.insertRules(t),!0):!1}insertRules(e){for(let t of e){if(this.ruleOfClass[t.className])continue;let s,d=this.rules.length-1,{media:x,order:w,priority:g,hasWhere:y,className:M}=t,c=(n,l,m,f)=>{let h=0,C;l&&(h=n.findIndex(l)),m&&(C=n.findIndex(m)),h===-1&&(h=n.length),(C===void 0||C===-1)&&(C=n.length);let v=n.slice(h,C);for(let r=0;r<v.length;r++){let o=v[r];if(!(o.priority===-1||f&&f(o))&&(o.priority<g||o.priority===g&&(y&&!o.hasWhere||o.order>=w)))return h+r}return h+v.length};if(x){let n=this.rules.findIndex(l=>l.media);if(n!==-1){let l=x.features["max-width"],m=x.features["min-width"];if(l&&m){let f=l.value-m.value;for(let h=d;h>=n;h--){s=h;let C=this.rules[h],v=C.media,r=v.features["max-width"],o=v.features["min-width"];if(!r||!o){s++;break}let i=r.value-o.value;if(i===f){if(y!==C.hasWhere)continue;if(g!==-1){let u=[this.rules[h]];for(let a=h-1;a>=n;a--){let b=this.rules[a];if(b.hasWhere!==y)break;let p=b.media,T=p.features["max-width"],R=p.features["min-width"];if(!T||!R||T.value-R.value!==i)break;u.unshift(this.rules[a])}s=c(this.rules,a=>a.media&&a.priority!==-1&&a.media.features["min-width"]&&a.media.features["max-width"])}break}else if(i>f)break}}else if(m)for(let f=n;f<=d;f++){s=f;let h=this.rules[f],C=h.media,v=C.features["max-width"],r=C.features["min-width"];if(v){if(r)break;continue}let o=r?.value;if(o===m.value){if(!y&&h.hasWhere){s++;continue}if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else for(let i=f;i<=d;i++){let u=this.rules[i],a=u.media,b=a.features["min-width"];if(!a.features["max-width"]){if(u.hasWhere!==y||b.value!==o||u.order>=w)break;s=i+1}}break}else{if(o>m.value)break;s++}}else if(l)for(let f=d;f>=n;f--){s=f;let h=this.rules[f],C=h.media,v=C.features["max-width"];if(C.features["min-width"])continue;let o=v?.value;if(!o||o>l.value){s++;break}else if(o===l.value){if(y&&!h.hasWhere)continue;if(g!==-1)s=c(this.rules,i=>i.media,i=>i.media&&i.priority!==-1&&i.media.features["min-width"]&&i.media.features["max-width"],i=>!i.media.features["min-width"]&&!i.media.features["max-width"]);else{let i=[this.rules[f]];for(let u=f-1;u>=n;u--){let a=this.rules[u],b=a.media,p=b.features["min-width"],T=b.features["max-width"];if(!p&&(!T||T.value!==o||a.hasWhere!==y))break;i.unshift(a)}for(let u=0;u<i.length;u++){let a=i[u];if(!a.media.features["min-width"]){if(a.order>=w)break;s=f-i.length+2+u}}}break}}}if(s===void 0)if(n===-1)s=d+1;else if(g!==-1)s=n+c(this.rules.slice(n),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(y){let l=n;for(;l<this.rules.length;l++){let m=this.rules[l];if(m.priority!==-1||!m.hasWhere||m.order>=w){s=l;break}}s===void 0&&(s=l)}else for(let l=n;l<=d;l++){s=l;let m=this.rules[l],f=m.media;if(m.priority!==-1||f.features["max-width"]||f.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=w)break}}else if(g===-1)if(y)s=this.rules.findIndex(n=>!n.hasWhere||n.media||n.priority!==-1||n.order>=w),s===-1&&(s=d+1);else{let n=0;for(;n<this.rules.length;n++){let l=this.rules[n];if(l.media||!l.hasWhere&&(l.order>=w||l.priority!==-1)){s=n;break}}s===void 0&&(s=n)}else s=c(this.rules,void 0,n=>n.media);if(this.rules.splice(s,0,t),this.ruleOfClass[M]=t,this.style){let n=this.style.sheet,l=0,m=f=>{let h=this.rules[f];if(h){if(!h.natives.length)return m(f-1);let C=h.natives[h.natives.length-1].cssRule;for(let v=0;v<n.cssRules.length;v++)if(n.cssRules[v]===C){l=v+1;break}}};m(s-1);for(let f=0;f<t.natives.length;)try{let h=t.natives[f];n.insertRule(h.text,l),h.cssRule=n.cssRules[l++],f++}catch(h){console.error(h),t.natives.splice(f,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},k=j;S(k,"root"),S(k,"instances",[]),S(k,"refresh",e=>{for(let t of j.instances)t.refresh(e)});A&&(window.MasterCSS=k);export{k as MasterCSS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./render";export*from"./render-from-html";export*from"./render-into-html";export*from"./fill-color-scale";export*from"./define-content";
|
|
1
|
+
export*from"./render";export*from"./render-from-html";export*from"./render-into-html";export*from"./fill-color-scale";export*from"./define-content";export*from"./get-sync-with-stored-theme-script";
|
package/dist/esm/rule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCssPropertyText as N}from"./utils/get-css-property-text";import{analyzeValueToken as ie}from"./utils/analyze-value-token";import{parseRuleValue as E}from"./utils/parse-rule-value";import{SORTED_SELECTORS as G}from"./constants/sorted-selectors";import{cssEscape as se}from"./utils/css-escape";var H=class{constructor(y,b
|
|
1
|
+
import{getCssPropertyText as N}from"./utils/get-css-property-text";import{analyzeValueToken as ie}from"./utils/analyze-value-token";import{parseRuleValue as E}from"./utils/parse-rule-value";import{SORTED_SELECTORS as G}from"./constants/sorted-selectors";import{cssEscape as se}from"./utils/css-escape";var H=class{constructor(y,v,b){this.className=y;this.meta=v;this.css=b;let{id:J,unit:K="rem",order:X=0,colorful:x,prop:Y,analyzeToken:z,getThemeProps:T,parseValue:D,get:F}=v.config||{},{rootSize:Z,scope:P,important:j}=b.config,{themeNames:_,colorNames:$,colorThemesMap:ee,selectors:O,globalValues:Q,breakpoints:q,mediaQueries:M}=b,I=b.values[J],U=b.relationThemesMap[y],h=y;this.order=X;let A,C,m,S;if(v.origin==="semantics"){let[l,r]=v.value;m=h.slice(l.length),A=r}else if(z)[C,S,m]=z.call(this,h,I,Q);else{let l;if(v.origin==="matches"){let r=h.indexOf(":");this.prefix=h.slice(0,r+1),this.prefix.includes("(")?(this.prefix=void 0,l=h):l=h.slice(r+1)}else v.origin==="symbol"&&(this.symbol=h[0],l=h.slice(1));[S,m]=ie(l,I,Q)}m[0]==="!"&&(this.important=!0,m=m.slice(1));let B=l=>{let r=l.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,i)=>i%3?t:t.replace(/_/g," ")).join(""),s=[],o="",u=0;for(let t=0;t<r.length;t++){let i=r[t];if(i==="\\"){o+=i+r[++t];continue}!u&&i===","?(s.push(o),o=""):(o+=i,u&&i===")"?u--:i==="("&&u++)}return o&&s.push(o),s};this.prefixSelectors=C?B(C):[""];let w=m.split("@"),V=w[0];if(V){this.vendorSuffixSelectors={};let l=(t,i,e,n)=>{for(let[a,f]of i)if(a.test(t)){for(let g of f)l(t.replace(a,g),i,e,!0);return}n&&e.push(t)},r=[];""in O?l(V,O[""],r,!0):r.push(V);let s={};for(let[t,i]of Object.entries(O)){if(!t)continue;let e=[];for(let n of r)l(n,i,e,!1);e.length&&(s[t]=e)}let o=(t,i)=>{let e=i.reduce((n,a)=>(n.push(...B(a)),n),[]);t in this.vendorSuffixSelectors?this.vendorSuffixSelectors[t].push(...e):this.vendorSuffixSelectors[t]=e},u=Object.keys(s);if(u.length)for(let t of u)o(t,s[t]);else o("",r);for(let t of Object.values(this.vendorSuffixSelectors))for(let i of t){this.hasWhere!==!1&&(this.hasWhere=i.includes(":where("));for(let e=0;e<G.length;e++)if(i.includes(G[e])){(this.priority===-1||this.priority>e)&&(this.priority=e);break}}}else this.vendorSuffixSelectors={"":[""]};for(let l=1;l<w.length;l++){let r=w[l];if(r)if(_.includes(r))this.theme=r;else if(r==="rtl"||r==="ltr")this.direction=r;else{let s,o,u=r.indexOf("_");if(u!==-1)s=r.slice(0,u),o=r.slice(u);else{let t=r.indexOf("(");t!==-1&&(s=r.slice(0,t),o=r.slice(t))}if(!s){s="media";let t=[];this.media={token:r,features:{}};let i=r.split("&");for(let e of i)if(e==="all"||e==="print"||e==="screen"||e==="speech")this.media.type=e;else if(e==="\u{1F5A8}")this.media.type="print";else if(e==="landscape"||e==="portrait")t.push("(orientation:"+e+")");else if(e==="motion"||e==="reduced-motion")t.push("(prefers-reduced-motion:"+(e==="motion"?"no-preference":"reduce")+")");else if(M&&e in M)t.push(M[e]);else{let n={token:e},a="",f="",g=0;e.startsWith("<=")?(f="<=",a="max-width"):e.startsWith(">=")||q[e]?(f=">=",a="min-width"):e.startsWith(">")?(f=">",a="min-width",g=.02):e.startsWith("<")&&(f="<",a="max-width",g=-.02);let p=f?e.replace(f,""):e,c=q[p];switch(a){case"max-width":case"min-width":c?Object.assign(n,E(c,"px")):Object.assign(n,E(p,"px")),n.unit==="px"&&(n.value+=g),this.media.features[a]=n,t.push("("+a+":"+(n.value+n.unit)+")");break}}o="",this.media.type&&(o=this.media.type),t.length&&(o+=(o?" and ":"")+t.join(" and "))}o&&(this.at[s]=(s in this.at?this.at[s]+" and ":"")+o.replace(/_/g," "))}}let k=(l,r)=>{let s,o,u=(i,e,n)=>{let a="";this.direction&&(a+="[dir="+this.direction+"] ");let f=this.prefixSelectors.map(c=>c+a),g=(c,R)=>f.map(d=>(c?"."+c+" ":"")+(P?P+" ":"")+d).reduce((d,W)=>(d.push(n.reduce((L,te)=>(L.push(W+"."+se(R)+te),L),[]).join(",")),d),[]).join(","),p=g(e,y)+(U?Object.entries(U).filter(([c])=>this.theme||!x||!e||!c||c===e).map(([c,R])=>R.reduce((d,W)=>d+","+g(this.theme??((x||T)&&e||c),W),"")).join(""):"")+"{"+i+"}";for(let c of Object.keys(this.at).sort((R,d)=>d==="supports"?-1:1))p="@"+c+" "+this.at[c]+"{"+p+"}";return p},t=[];if(S){let i,e;for(let n of S)typeof n=="string"?t.push(n):(i=E(n.value,K,x&&$,x&&ee,Z,this.theme?[this.theme,""]:[l]),i.colorMatched!==void 0&&e!==!0&&(e=i.colorMatched),t.push(i.value+i.unit));if(r&&(e===void 0?l:!e))return;if(t.length===1?i?(s=i.value,o=i.unit):s=t[0]:s=t.reduce((n,a,f)=>n+a+(a===","||S[f+1]===","||f===S.length-1?"":" "),""),typeof s!="object"){D&&(s=D.call(this,s,this.css.config)),x&&s==="current"&&(s="currentColor");let n={unit:o,value:s,important:this.important};if(T){let a=T.call(this,n,b);for(let f in a)for(let g of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:o,value:s,text:u(Object.entries(a[f]).map(([p,c])=>N(p,{important:(this.important||j)&&!c.endsWith("!important"),unit:"",value:c})).join(";"),f,g),theme:f});return}else F&&(s=F.call(this,n))}}else s=A;for(let i of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:o,value:s,text:u(typeof s=="object"?Object.entries(s).map(([e,n])=>N(e,{...typeof n=="object"?n:{unit:"",value:n},important:this.important||j})).join(";"):N(Y,{unit:o,value:s,important:this.important||j}),l,i),theme:l})};if(T)k(void 0,!1);else if(this.theme)k(this.theme,!1);else if(x)for(let l of _)k(l,!0);else k("",!1)}at={};priority=-1;natives=[];get text(){return this.natives.map(y=>y.text).join("")}};export{H as Rule};
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var ze=Object.defineProperty;var De=(e,t,r)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ne=(e,t,r)=>(De(e,typeof t!="symbol"?t+"":t,r),r);function Re(e){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&e instanceof t||e instanceof Date||e instanceof RegExp)}function Ce(e){if(typeof Buffer<"u"&&Buffer&&e instanceof Buffer){let t=Buffer.alloc(e.length);return e.copy(t),t}else{if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}}function Te(e){let t=[];return e.forEach(function(r,s){typeof r=="object"&&r!==null?Array.isArray(r)?t[s]=Te(r):Re(r)?t[s]=Ce(r):t[s]=U({},r):t[s]=r}),t}function Se(e,t){return t==="__proto__"?void 0:e[t]}function U(...e){let t={},r,s;return e.forEach(function(l){typeof l!="object"||l===null||Array.isArray(l)||Object.keys(l).forEach(function(a){if(s=Se(t,a),r=Se(l,a),r!==t)if(typeof r!="object"||r===null){t[a]=r;return}else if(Array.isArray(r)){t[a]=Te(r);return}else if(Re(r)){t[a]=Ce(r);return}else if(typeof s!="object"||s===null||Array.isArray(s)){t[a]=U({},r);return}else{t[a]=U(s,r);return}})}),t}function oe(e,t){return(e?e+":":"")+(t.unit?t.value+t.unit:t.value)+(t.important?"!important":"")}var Y={"(":")","'":"'",'"':'"',"{":"}"};function Z(e,t,r,s=[]){let l=[",",...s],a=[],c="",o=0;return function g(d,n,i,u="",p=[],x=[]){let b,S=!1;n&&(n===")"&&c.slice(-1)==="$"?b=c.length-1:(n==="'"||n==='"')&&(S=!0),c+=d[o++]);let R=()=>{let f=c;if(c="",t&&f in t&&!p.includes(f)){let h=o;o=0,g(t[f].toString(),void 0,void 0,void 0,[...p,f],x),o=h}else if(r&&f in r&&!x.includes(f)){let h=o;o=0,g(r[f].toString(),void 0,void 0,void 0,p,[...x,f]),o=h}else a.push({value:f})};for(;o<d.length;o++){let f=d[o];if(f===n){if(c+=f,S){let h=0;for(let m=c.length-2;c[m]==="\\";m--)h++;if(h%2)continue}b!==void 0&&(c=c.slice(0,b)+c.slice(b).replace(/\$\((.*)\)/,"var(--$1)")),i||(S?a.push(c):R(),u="",c="");break}else if(!S&&f in Y)g(d,Y[f],i===void 0?0:i+1,u,p,x);else if((f==="|"||f===" ")&&n!=="}"&&(!S||u==="path"))n?c+=" ":R();else{if(!n){if(f==="."){if(isNaN(+d[o+1]))break;d[o-1]==="-"&&(c+="0")}else if(l.includes(f)){c&&R(),a.push(f);continue}else if(f==="#"&&(c||a.length&&d[o-1]!=="|"&&a[o-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(f))break;u+=f}c+=f}}i===void 0&&c&&R()}(e),[a,e.slice(o)]}function ae(e,t,r){if(r){let s="",l=e.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(l)if(e.includes("/")){let[a,c]=e.split("/");return{value:+a/+c*100+"%",unit:s}}else{let a=+l[1];return s=l[3]||"",s||((r==="rem"||r==="em")&&(a=a/t),s=r||""),{value:a,unit:s}}}}function Me(e,t,r){let s=n=>n==="+"||n==="-"||n==="*"||n==="/",l="",a,c="",o=!1,g=!1;function d(n,i="",u=""){if(a===2&&!g){let p=ae(c,t,r);p&&(c=p.value+p.unit)}l+=c+i+n+u,a=null,g=!1,c=""}for(let n=0;n<e.length;n++){let i=e[n];if(i==="("||i===")")o=i===")",d(i);else if(i===",")d(i,""," ");else{switch(a){case 1:break;case 2:if(s(i)){d(i," "," ");continue}else/[0-9]/.test(i)||(g=!0);break;default:o&&(l+=" "),isNaN(+i)?s(i)||(a=1):a=2;break}a?c+=i:l+=i}}return c&&(l+=c),l}function le(e,t,r,s,l,a){let c="",o="",g;if(typeof e=="number")c=e,o=t||"";else{if(s){let n=!1,i=!1;e=e.replace(new RegExp(`(^|,| |\\()((?:${r.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(u,p,x,b)=>{i=!0;let S=s[x];if(S){let R;for(let f of a)if(R=S[f])break;if(R){n=!0;let f=R;if(b){let h=b.endsWith("%")?parseFloat(b)/100:+b;h=isNaN(h)?1:Math.min(Math.max(h,0),1),f+=Math.round(h*255).toString(16).toUpperCase().padStart(2,"0")}return p+f}}return u}),i&&(g=n)}let d=ae(e,l,t);if(d)return d;c=(e.indexOf("calc(")===-1?e:Me(e,l,t)).replace(/\$\(((\w|-)+)\)/g,"var(--$1)")}return{value:c,unit:o,colorMatched:g}}var xe=[":disabled",":active",":focus",":hover"];function ce(e){if(typeof CSS<"u")return CSS.escape(e);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let t=String(e),r=t.length,s=-1,l="",a,c=t.charCodeAt(0);if(r==1&&c==45)return"\\"+t;for(;++s<r;){if(a=t.charCodeAt(s),a==0){l+="\uFFFD";continue}if(a>=1&&a<=31||a==127||s==0&&a>=48&&a<=57||s==1&&a>=48&&a<=57&&c==45){l+="\\"+a.toString(16)+" ";continue}if(a>=128||a==45||a==95||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122){l+=t.charAt(s);continue}l+="\\"+t.charAt(s)}return l}var fe=class{constructor(t,r,s){this.className=t;this.meta=r;this.css=s;let{id:l,unit:a="rem",order:c=0,colorful:o,prop:g,analyzeToken:d,getThemeProps:n,parseValue:i,get:u}=r.config||{},{rootSize:p,scope:x,important:b}=s.config,{themeNames:S,colorNames:R,colorThemesMap:f,selectors:h,globalValues:m,breakpoints:k,mediaQueries:y}=s,C=s.values[l],j=s.relationThemesMap[t],E=t;this.order=c;let M,B,P,G;if(r.origin==="semantics"){let[W,$]=r.value;P=E.slice(W.length),M=$}else if(d)[B,G,P]=d.call(this,E,C,m);else{let W;if(r.origin==="matches"){let $=E.indexOf(":");this.prefix=E.slice(0,$+1),this.prefix.includes("(")?(this.prefix=void 0,W=E):W=E.slice($+1)}else r.origin==="symbol"&&(this.symbol=E[0],W=E.slice(1));[G,P]=Z(W,C,m)}P[0]==="!"&&(this.important=!0,P=P.slice(1));let ke=W=>{let $=W.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((w,T)=>T%3?w:w.replace(/_/g," ")).join(""),O=[],N="",F=0;for(let w=0;w<$.length;w++){let T=$[w];if(T==="\\"){N+=T+$[++w];continue}!F&&T===","?(O.push(N),N=""):(N+=T,F&&T===")"?F--:T==="("&&F++)}return N&&O.push(N),O};this.prefixSelectors=B?ke(B):[""];let ge=P.split("@"),pe=ge[0];if(pe){this.vendorSuffixSelectors={};let W=(w,T,v,A)=>{for(let[L,D]of T)if(L.test(w)){for(let V of D)W(w.replace(L,V),T,v,!0);return}A&&v.push(w)},$=[];""in h?W(pe,h[""],$,!0):$.push(pe);let O={};for(let[w,T]of Object.entries(h)){if(!w)continue;let v=[];for(let A of $)W(A,T,v,!1);v.length&&(O[w]=v)}let N=(w,T)=>{let v=T.reduce((A,L)=>(A.push(...ke(L)),A),[]);w in this.vendorSuffixSelectors?this.vendorSuffixSelectors[w].push(...v):this.vendorSuffixSelectors[w]=v},F=Object.keys(O);if(F.length)for(let w of F)N(w,O[w]);else N("",$);for(let w of Object.values(this.vendorSuffixSelectors))for(let T of w){this.hasWhere!==!1&&(this.hasWhere=T.includes(":where("));for(let v=0;v<xe.length;v++)if(T.includes(xe[v])){(this.priority===-1||this.priority>v)&&(this.priority=v);break}}}else this.vendorSuffixSelectors={"":[""]};for(let W=1;W<ge.length;W++){let $=ge[W];if($)if(S.includes($))this.theme=$;else if($==="rtl"||$==="ltr")this.direction=$;else{let O,N,F=$.indexOf("_");if(F!==-1)O=$.slice(0,F),N=$.slice(F);else{let w=$.indexOf("(");w!==-1&&(O=$.slice(0,w),N=$.slice(w))}if(!O){O="media";let w=[];this.media={token:$,features:{}};let T=$.split("&");for(let v of T)if(v==="all"||v==="print"||v==="screen"||v==="speech")this.media.type=v;else if(v==="\u{1F5A8}")this.media.type="print";else if(v==="landscape"||v==="portrait")w.push("(orientation:"+v+")");else if(v==="motion"||v==="reduced-motion")w.push("(prefers-reduced-motion:"+(v==="motion"?"no-preference":"reduce")+")");else if(y&&v in y)w.push(y[v]);else{let A={token:v},L="",D="",V=0;v.startsWith("<=")?(D="<=",L="max-width"):v.startsWith(">=")||k[v]?(D=">=",L="min-width"):v.startsWith(">")?(D=">",L="min-width",V=.02):v.startsWith("<")&&(D="<",L="max-width",V=-.02);let H=D?v.replace(D,""):v,z=k[H];switch(L){case"max-width":case"min-width":z?Object.assign(A,le(z,"px")):Object.assign(A,le(H,"px")),A.unit==="px"&&(A.value+=V),this.media.features[L]=A,w.push("("+L+":"+(A.value+A.unit)+")");break}}N="",this.media.type&&(N=this.media.type),w.length&&(N+=(N?" and ":"")+w.join(" and "))}N&&(this.at[O]=(O in this.at?this.at[O]+" and ":"")+N.replace(/_/g," "))}}let se=(W,$)=>{let O,N,F=(T,v,A)=>{let L="";this.direction&&(L+="[dir="+this.direction+"] ");let D=this.prefixSelectors.map(z=>z+L),V=(z,ie)=>D.map(Q=>(z?"."+z+" ":"")+(x?x+" ":"")+Q).reduce((Q,be)=>(Q.push(A.reduce((we,Ie)=>(we.push(be+"."+ce(ie)+Ie),we),[]).join(",")),Q),[]).join(","),H=V(v,t)+(j?Object.entries(j).filter(([z])=>this.theme||!o||!v||!z||z===v).map(([z,ie])=>ie.reduce((Q,be)=>Q+","+V(this.theme??((o||n)&&v||z),be),"")).join(""):"")+"{"+T+"}";for(let z of Object.keys(this.at).sort((ie,Q)=>Q==="supports"?-1:1))H="@"+z+" "+this.at[z]+"{"+H+"}";return H},w=[];if(G){let T,v;for(let A of G)typeof A=="string"?w.push(A):(T=le(A.value,a,o&&R,o&&f,p,this.theme?[this.theme,""]:[W]),T.colorMatched!==void 0&&v!==!0&&(v=T.colorMatched),w.push(T.value+T.unit));if($&&(v===void 0?W:!v))return;if(w.length===1?T?(O=T.value,N=T.unit):O=w[0]:O=w.reduce((A,L,D)=>A+L+(L===","||G[D+1]===","||D===G.length-1?"":" "),""),typeof O!="object"){i&&(O=i.call(this,O,this.css.config)),o&&O==="current"&&(O="currentColor");let A={unit:N,value:O,important:this.important};if(n){let L=n.call(this,A,s);for(let D in L)for(let V of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:N,value:O,text:F(Object.entries(L[D]).map(([H,z])=>oe(H,{important:(this.important||b)&&!z.endsWith("!important"),unit:"",value:z})).join(";"),D,V),theme:D});return}else u&&(O=u.call(this,A))}}else O=M;for(let T of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:N,value:O,text:F(typeof O=="object"?Object.entries(O).map(([v,A])=>oe(v,{...typeof A=="object"?A:{unit:"",value:A},important:this.important||b})).join(";"):oe(g,{unit:N,value:O,important:this.important||b}),W,T),theme:W})};if(n)se(void 0,!1);else if(this.theme)se(this.theme,!1);else if(o)for(let W of S)se(W,!0);else se("",!1)}at={};priority=-1;natives=[];get text(){return this.natives.map(t=>t.text).join("")}};var K={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560};function ee(e){e.startsWith("#")&&(e=e.slice(1));let t=e.match(/.{1,2}/g);return[parseInt(t[0],16),parseInt(t[1],16),parseInt(t[2],16)]}function ue(e,t,r){return((1<<24)+(e<<16)+(t<<8)+r).toString(16).slice(1)}function I(e){typeof e=="string"&&(e={"":e});let t=""in e,r=!1;for(let s in e)if(s&&+s>=100){r=!0;break}if(!r&&(!t||Object.keys(e).length>1)){let s=0,l="0"in e?ee(e[0]):[0,0,0],a,c,o=[],g=()=>{let d=a-s,n=c.map((i,u)=>(i-l[u])/d);for(let i of o){let u=i-s,p=l.map((x,b)=>Math.round(x+n[b]*u));e[i]="#"+ue.call(this,...p)}};for(let d=1;d<100;d++)d in e?(o.length?(a=d,c=ee(e[d]),g(),o.length=0,l=c):l=ee(e[d]),s=d):o.push(d);o.length&&(a=100,c="100"in e?ee(e[100]):[255,255,255],g())}return t||(e[""]=e[r?"500":"50"]),e}var Oe={black:"#000000",white:"#ffffff",slate:I({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:I({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:I({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:I({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:I({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:I({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:I({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:I({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:I({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:I({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:I({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:I({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:I({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:I({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:I({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:I({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:I({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:I({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:I({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:I({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};var Ee="";var $e={"::scrollbar":"::-webkit-scrollbar","::scrollbar-button":"::-webkit-scrollbar-button","::scrollbar-thumb":"::-webkit-scrollbar-thumb","::scrollbar-track":"::-webkit-scrollbar-track","::scrollbar-track-piece":"::-webkit-scrollbar-track-piece","::scrollbar-corner":"::-webkit-scrollbar-corner","::slider-thumb":["::-webkit-slider-thumb","::-moz-range-thumb"],"::slider-runnable-track":["::-webkit-slider-runnable-track","::-moz-range-track"],"::meter":"::-webkit-meter","::resizer":"::-webkit-resizer","::progress":"::-webkit-progress",":first":":first-child",":last":":last-child",":even":":nth-child(2n)",":odd":":nth-child(odd)",":nth(":":nth-child("};var Ae={square:{"aspect-ratio":"1/1"},video:{"aspect-ratio":"16/9"},rounded:{"border-radius":"1e9em"},round:{"border-radius":"50%"},hidden:{display:"none"},hide:{display:"none"},block:{display:"block"},table:{display:"table"},flex:{display:"flex"},grid:{display:"grid"},contents:{display:"contents"},inline:{display:"inline"},"inline-block":{display:"inline-block"},"inline-flex":{display:"inline-flex"},"inline-grid":{display:"inline-grid"},"inline-table":{display:"inline-table"},"table-cell":{display:"table-cell"},"table-caption":{display:"table-caption"},"flow-root":{display:"flow-root"},"list-item":{display:"list-item"},"table-row":{display:"table-row"},"table-column":{display:"table-column"},"table-row-group":{display:"table-row-group"},"table-column-group":{display:"table-column-group"},"table-header-group":{display:"table-header-group"},"table-footer-group":{display:"table-footer-group"},italic:{"font-style":"italic"},oblique:{"font-style":"oblique"},isolate:{isolation:"isolate"},overflow:{overflow:"visible"},untouchable:{"pointer-events":"none"},static:{position:"static"},fixed:{position:"fixed"},abs:{position:"absolute"},rel:{position:"relative"},sticky:{position:"sticky"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},visible:{visibility:"visible"},invisible:{visibility:"hidden"},vw:{width:"100vw"},vh:{height:"100vh"},"max-vw":{"max-width":"100vw"},"max-vh":{"max-height":"100vh"},"min-vw":{"min-width":"100vw"},"min-vh":{"min-height":"100vh"},"center-content":{"justify-content":"center","align-items":"center"},"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap","border-width":"0"},full:{width:"100%",height:"100%"},center:{left:0,right:0,"margin-left":"auto","margin-right":"auto"},middle:{top:0,bottom:0,"margin-top":"auto","margin-bottom":"auto"},"break-spaces":{"white-space":"break-spaces"},"break-word":{"overflow-wrap":"break-word",overflow:"hidden"}};var je=["dark","light"];var he={store:"theme"};var X={content:"content-box",border:"border-box",padding:"padding-box"};var te={min:"min-content",max:"max-content"};var _={full:"100%",fit:"fit-content",max:"max-content",min:"min-content"};for(let e in K)_[e]=K[e]/16+"rem";var Ne={backgroundClip:X,backgroundOrigin:X,boxSizing:{content:"content-box",border:"border-box"},clipPath:{...X,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"},flexDirection:{col:"column","col-reverse":"column-reverse"},fontFamily:{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"},fontWeight:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900},gridAutoColumns:te,gridAutoRows:te,gridTemplateColumns:te,gridTemplateRows:te,order:{first:-999999,last:999999},position:{abs:"absolute",rel:"relative"},shapeOutside:{...X,margin:"margin-box"},transformBox:{...X,fill:"fill-box",stroke:"stroke-box",view:"view-box"},width:_,minWidth:_,minHeight:_,maxWidth:_,maxHeight:_,height:_,flexBasis:_};function re(e,t,r=""){let s="border-";r&&(r="-"+r);let l=/^b(order)?-?(.)?/.exec(e)[2],a=s+"left"+r,c=s+"right"+r,o=s+"top"+r,g=s+"bottom"+r;switch(l){case"x":return{[a]:t,[c]:t};case"y":return{[o]:t,[g]:t};case"l":return{[a]:t};case"r":return{[c]:t};case"t":return{[o]:t};case"b":return{[g]:t};default:return{["border"+r]:t}}}function ye(e,t,{rootSize:r}){let s="",l=0;return function a(c,o){let g="",d=o?t(o):"",n=()=>{g&&(s+=!d||Number.isNaN(+g)?g:+g/(d==="rem"?r:1)+d,g="")};for(;l<e.length;l++){let i=e[l];if(i===c&&(c!=="'"||e[l+1]===")")){n(),s+=i;break}else i===","||i===" "?(n(),s+=i):!g&&i==="'"?(s+=i,l++,a(i),g=""):g&&i==="("?(s+=g+i,l++,a(")",g),g=""):g+=i}n()}(),s}(()=>{let e=typeof global<"u"?global:window;if(!e.CSS&&!e.CSS?.escape){let t=function(r){if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let s=String(r),l=s.length,a=-1,c="",o,g=s.charCodeAt(0);if(l==1&&g==45)return"\\"+s;for(;++a<l;){if(o=s.charCodeAt(a),o==0){c+="\uFFFD";continue}if(o>=1&&o<=31||o==127||a==0&&o>=48&&o<=57||a==1&&o>=48&&o<=57&&g==45){c+="\\"+o.toString(16)+" ";continue}if(o>=128||o==45||o==95||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){c+=s.charAt(a);continue}c+="\\"+s.charAt(a)}return c};e.CSS||(e.CSS={}),e.CSS.escape=t,globalThis.CSS.escape=t}})();var We={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,t,r){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...Z(e.slice(s),t,r)]},getThemeProps(e,t){let r={},s=(d,n)=>{let i=n.indexOf(":");if(i!==-1){d in r||(r[d]={});let u=r[d],p=n.slice(0,i);p in u||(u[p]=n.slice(i+1))}},l=d=>{let n=(i,u)=>{let p=u.slice(ce(d.className).length).match(/\{(.*)\}/)[1].split(";");for(let x of p)s(i,x)};if(this.theme){let i=d.natives.find(u=>u.theme===this.theme)??d.natives.find(u=>!u.theme);i&&n(this.theme,i.text)}else for(let i of d.natives)n(i.theme,i.text)},a=[],c="",o=()=>{c&&(a.push(c.replace(/ /g,"")),c="")},g=1;(function d(n){for(;g<e.value.length;g++){let i=e.value[g];if(!n){if(i===";"){o();continue}if(i==="}")break}if(c+=i,n===i){if(n==="'"||n==='"'){let u=0;for(let p=c.length-2;c[p]==="\\";p--)u++;if(u%2)continue}break}else i in Y&&n!=="'"&&n!=='"'&&(g++,d(Y[i]))}})(void 0),o();for(let d of a){let n=t.create(d);if(Array.isArray(n))for(let i of n)l(i);else n?l(n):s(this.theme??"",d)}return r}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:""},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)"},fontSmoothing:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let t={};switch(e.value){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":t["-webkit-font-smoothing"]={...e,value:"antialiased"},t["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return t}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},spacing:{matches:"^[pm][xytblr]?:.",prop:!1,get(e){let r=this.prefix[0]==="m"?"margin":"padding",s=r+"-left",l=r+"-right",a=r+"-top",c=r+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[l]:e};case"y":return{[a]:e,[c]:e};case"l":return{[s]:e};case"r":return{[l]:e};case"t":return{[a]:e};case"b":return{[c]:e};default:return{[r]:e}}},get order(){return this.prefix==="p:"||this.prefix==="m:"?-1:0}},margin:{matches:"^margin(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="margin:"?-1:0}},padding:{matches:"^padding(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="padding:"?-1:0}},flexBasis:{},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)"},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:."},height:{matches:"^h:."},minWidth:{matches:"^min-w:."},minHeight:{matches:"^min-h:."},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...Z(e,t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{width:{...e,value:t},height:{...e,value:r}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...Z(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"min-width":{...e,value:t},"min-height":{...e,value:r}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...Z(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"max-width":{...e,value:t},"max-height":{...e,value:r}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:."},maxWidth:{matches:"^max-w:."},boxSizing:{matches:"^box:(?:$values)(?!\\|)"},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":case"y":return 0}return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:t,value:r}=e,s=.75;return{"font-size":e,"line-height":{...e,value:t==="em"?r+s+t:`calc(${r}${t} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)"},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:t}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(r,s,l,a)=>{let c,o;switch(s){case"translate":c="rem";break;case"skew":c="deg";break;case"rotate":l==="3d"&&(o=!0),c="deg";break;default:return r}let g=a.split(",");return r.replace(a,g.map((d,n)=>!o||g.length-1===n?Number.isNaN(+d)?d:d/(c==="rem"?t:1)+c:d).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return re(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let r="",s=this.prefix.split("-");if(s.length>1)for(let l=1;l<s.length-1;l++)r+=s[l][0];else r=this.prefix.slice(1,-1);switch(r){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let t=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(t)?t:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return re(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return re(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return re(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}}},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)"},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,t){return ye(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,t){return ye(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:."},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:."},gridTemplateRows:{},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:""},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)"},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:."},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};var ve={breakpoints:K,colors:Oe,rootSize:16,scope:Ee,selectors:$e,semantics:Ae,themes:je,theme:he,values:Ne,rules:We,override:!1,observe:!0,important:!1};var de=class{constructor(t=typeof document<"u"?document.documentElement:null,r){this.host=t;this.options=r;this.options=U(he,r),this.options.store&&this.storage?this.syncWithStorage():this.options.default&&this.set(this.options.default,{emit:!1,store:!1})}darkMQL=typeof window<"u"?window.matchMedia?.("(prefers-color-scheme:dark)"):void 0;get storage(){let{store:t}=this.options;if(t)return localStorage.getItem(t)}current;value;set(t,r={store:!0,emit:!0}){if(t!==this.value){let s;t==="system"?(this.darkMQL?.addEventListener?.("change",this.onThemeChange),s=this.darkMQL?.matches?"dark":"light"):(this.removeDarkMQLListener(),s=t),s&&(this.host.classList.remove(this.current),this.host.classList.add(s),this.host.style&&(this.host.style.colorScheme=s)),this.current=s,this.value=t,r.store,this.storage,this.options.store&&localStorage.setItem(this.options.store,t),r.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this}))}}syncWithStorage(){if(typeof window<"u"&&this.options.store){let t=this.storage;(t==="system"&&(t=this.darkMQL?.matches?"dark":"light")||t)&&(this.host.classList.add(t),this.host.style.colorScheme=t,this.set(t,{emit:!1,store:!1}))}}removeDarkMQLListener(){this.darkMQL?.removeEventListener("change",this.onThemeChange)}onThemeChange=t=>{this.set(t.matches?"dark":"light")};destroy(){this.darkMQL?.removeEventListener("change",this.onThemeChange)}};var Le=[",",".","#","[","!","*",">","+","~",":","@"];var me=typeof window<"u",J=class{constructor(t){this.config=t;this.config?.override||(this.config=U(ve,t)),this.cache(),me&&this.config.observe&&this.observe(document),J.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=me?new MutationObserver(t=>{let r={},s=[],l=[],a=[],c=(n,i)=>{i?n.classList.forEach(g):n.classList.forEach(o);let u=n.children;for(let p=0;p<u.length;p++){let x=u[p];x.classList&&(l.push(x),c(x,i))}},o=n=>{n in r?r[n]++:r[n]=1},g=n=>{n in r?r[n]--:n in this.countOfClass&&(r[n]=-1)},d=(n,i)=>{for(let u=0;u<n.length;u++){let p=n[u];p.classList&&!l.includes(p)&&!a.includes(p)&&(p.isConnected!==i?(l.push(p),c(p,i)):a.push(p))}};for(let n=0;n<t.length;n++){let i=t[n],{addedNodes:u,removedNodes:p,type:x,target:b}=i;if(x==="attributes"){if(s.find(S=>S.target===b))continue;s.push(i)}else d(u,!1),(!b.isConnected||!l.includes(b))&&d(p,!0)}if(!(!s.length&&!Object.keys(r).length)){for(let{oldValue:n,target:i}of s){let u=l.includes(i),p=i.classList,x=n?n.split(" "):[];if(u){if(i.isConnected)continue;for(let b of x)p.contains(b)||g(b)}else if(i.isConnected){p.forEach(b=>{x.includes(b)||o(b)});for(let b of x)p.contains(b)||g(b)}}for(let n in r){let i=r[n],u=(this.countOfClass[n]||0)+i;u===0?(delete this.countOfClass[n],this.delete(n)):(n in this.countOfClass||this.insert(n),this.countOfClass[n]=u)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.relationThemesMap={},this.relations={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:t,classes:r,selectors:s,themes:l,colors:a,values:c,breakpoints:o,mediaQueries:g,rules:d}=this.config;function n(f){return f.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function i(f,h,m="",k={}){let y=M=>M?(m?m+"-":"")+M:m,C=Object.entries(f),j=[],E=[];for(let M of C){let B=M[1];(typeof B=="object"&&!Array.isArray(B)?j:E).push(M)}for(let[M,B]of j)i(B,h,y(M),k);if(h&&m)E.length&&(k[m]=E.reduce((M,[B,P])=>(M[B]=P,M),{}));else for(let[M,B]of E)k[y(M)]=B;return k}if(t)for(let[f,h]of Object.entries(i(t,!0)))this.semantics.push([new RegExp("^"+n(f)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[f,h]]);if(s)for(let[f,h]of Object.entries(i(s,!1))){let m=new RegExp(n(f)+"(?![a-z-])");for(let k of Array.isArray(h)?h:[h]){let y=k.match(/^::-[a-z]+-/m)?.[0]??"",C=this.selectors[y];C||(C=this.selectors[y]=[]);let j=C.find(([E])=>E===m);j||(j=[m,[]],C.push(j)),j[1].push(k)}}if(c)for(let[f,h]of Object.entries(c))typeof h=="object"?this.values[f]=i(h,!1):this.globalValues[f]=h;o&&(this.breakpoints=i(o,!1)),g&&(this.mediaQueries=i(g,!1));let u=r?i(r,!1):{},p=l&&!Array.isArray(l)?Object.entries(l).filter(([,{classes:f}])=>f).reduce((f,[h,{classes:m}])=>(f[h]=i(m,!1),f),{}):{},x=[...Object.keys(u),...Object.entries(p).flatMap(([f,h])=>Object.keys(h))],b=f=>{if(f in this.classes)return;let h=this.classes[f]=[],m=(k,y)=>{if(!y)return;let C=Array.isArray(y)?y:y.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let j of C){let E=M=>{M in this.relationThemesMap?k in this.relationThemesMap[M]?this.relationThemesMap[M][k].push(f):this.relationThemesMap[M][k]=[f]:this.relationThemesMap[M]={[k]:[f]},h.includes(M)||h.push(M)};if(x.includes(j)){b(j);for(let M of this.classes[j])E(M)}else E(j)}};m("",u?.[f]);for(let[k,y]of Object.entries(p))m(k,y?.[f])};for(let f of x)b(f);for(let f in this.relationThemesMap){let h=this.relations[f]=[];for(let m of Object.values(this.relationThemesMap[f]))for(let k of m)h.includes(k)||h.push(k)}let S=(f,h)=>{if(!h)return;let m=i(h,!0);for(let[k,y]of Object.entries(m)){let C=typeof y=="string"?{"":y}:y;for(let[j,E]of Object.entries(C)){let M=k+(j?"-"+j:"");M in this.colorThemesMap?this.colorThemesMap[M][f]=E:this.colorThemesMap[M]={[f]:E}}}for(let k in h)this.colorNames.includes(k)||this.colorNames.push(k)};if(S("",a),l)if(Array.isArray(l))this.themeNames.push(...l);else for(let f in l){let h=l[f];S(f,h.colors),this.themeNames.push(f)}let R=f=>{for(let[h,m]of Object.entries(this.colorThemesMap))for(let[k,y]of Object.entries(m))y.startsWith("#")||f(h,m,k,y)};if(R((f,h,m,k)=>{let y=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(k);if(y){let C="#"+ue(+y[1],+y[2],+y[3]);y[4]&&(C+=Math.round(255*+y[4]).toString(16)),h[m]=C}}),R((f,h,m,k)=>{let[y,C]=k.split("/"),j=this.colorThemesMap[y];if(j){let E=(m?j[m]:void 0)??j[""];h[m]=C?E.slice(0,7)+Math.round(255*+C).toString(16):E}else console.warn(`\`${k}\` doesn't exist in the extended config \`.colors\``),delete h[m],Object.keys(h).length||delete this.colorThemesMap[f]}),d)for(let f in d){let h=d[f],{matches:m,prop:k}=h;if(h.id=f,h.prop=k===!1?"":f.replace(/(?!^)[A-Z]/g,y=>"-"+y).toLowerCase(),m){let y=Object.keys(this.values[f]??{}),C=m.indexOf("$values");this.matches[f]=new RegExp(C===-1?m:y.length?m.slice(0,C)+y.join("|")+m.slice(C+7):m.slice(0,C-(m[C-1]==="|"?1:0))+m.slice(C+7+(m[C+7]==="|"?1:0)))}}}observe(t,r={subtree:!0,childList:!0}){if(me&&t){this.root=t;let s=t===document;s&&(J.root=this),this.host=s?document.documentElement:root.host,this.theme=new de(this.host,this.config.theme);let l=s?document.head:t,a=s?document.styleSheets:t.styleSheets;for(let o of a){let{title:g,href:d,ownerNode:n}=o;(g==="master"||d&&d.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(d))&&(this.style=n)}if(this.style)for(let o=0;o<this.style.sheet.cssRules.length;o++){let g=n=>{if(n.selectorText){let u=n.selectorText.split(", ")[0].split(" ");for(let p=0;p<u.length;p++){let x=u[p];if(x[0]==="."){let b=x.slice(1),S="";for(let R=0;R<b.length;R++){let f=b[R],h=b[R+1];if(f==="\\"){if(R++,h!=="\\"){S+=h;continue}}else if(Le.includes(f))break;S+=f}if(!(S in this.ruleOfClass)&&!(S in this.classes)){let R=this.create(S)[0];if(R)return R}}}}else if(n.cssRules)for(let i=0;i<n.cssRules.length;i++){let u=g(n.cssRules[i]);if(u)return u}},d=g(this.style.sheet.cssRules[o]);if(d){this.rules.push(d),this.ruleOfClass[d.className]=d;for(let n=0;n<d.natives.length;n++)d.natives[n].cssRule=this.style.sheet.cssRules[o+n];o+=d.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let o=l.querySelector('link[rel="styleSheet"], style');o?o.before(this.style):l.append(this.style)}let c=o=>{o.forEach(g=>{g in this.countOfClass?this.countOfClass[g]++:(this.countOfClass[g]=1,this.insert(g))})};c(this.host.classList),r.subtree&&this.host.querySelectorAll("[class]").forEach(o=>c(o.classList)),this.e.observe(t,{...r,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleOfClass={},this.countOfClass={},this.rules.length=0;let t=this.style.sheet;if(t)for(let r=t.cssRules.length-1;r>=0;r--)t.deleteRule(r);this.style.remove(),this.style=null,this.theme?.destroy(),this.theme=null}match(t){for(let r in this.config.rules){let s=this.config.rules[r],l=this.matches[r],{colorStarts:a,symbol:c,prop:o}=s,{colorNames:g,colorThemesMap:d}=this;if(l&&l.test(t))return{origin:"matches",config:s};if(a){if(t.match("^"+a+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(g.length&&t.indexOf("|")===-1){let n=t.match("^"+a+"((?:"+g.join("|")+")[0-9a-zA-Z-]*)");if(n&&n[1]in d)return{origin:"matches",config:s}}}if(c&&t.startsWith(c))return{origin:"symbol",config:s};if(o&&t.startsWith(o+":"))return{origin:"matches",config:s}}for(let r of this.semantics)if(t.match(r[0]))return{origin:"semantics",value:r[1]}}create(t){let r=s=>{if(s in this.ruleOfClass)return this.ruleOfClass[s];let l=this.match(s);if(l)return new fe(s,l,this)};return(t in this.classes?this.classes[t].map(s=>r(s)):[r(t)]).filter(s=>s&&s.text)}refresh(t){if(t?.override?this.config=t:this.config=U(ve,t),this.cache(),!this.style)return;let r=document.createElement("style");r.title="master",this.style.replaceWith(r),this.style=r,this.rules.length=0,this.ruleOfClass={};for(let s in this.countOfClass)this.insert(s)}destroy(){let t=J.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let r=this.style.sheet,s=l=>{let a=this.ruleOfClass[l];if(!(!a||l in this.relations&&this.relations[l].some(c=>c in this.countOfClass))){if(a.natives.length){let c=a.natives[0];for(let o=0;o<r.cssRules.length;o++)if(r.cssRules[o]===c.cssRule){for(let d=0;d<a.natives.length;d++)r.deleteRule(o);this.rules.splice(this.rules.indexOf(a),1);break}}delete this.ruleOfClass[l]}};if(t in this.classes){for(let l of this.classes[t])l in this.countOfClass||s(l);delete this.ruleOfClass[t]}else s(t)}insert(t){let r=this.create(t);return r.length?(this.insertRules(r),!0):!1}insertRules(t){for(let r of t){if(this.ruleOfClass[r.className])continue;let s,l=this.rules.length-1,{media:a,order:c,priority:o,hasWhere:g,className:d}=r,n=(i,u,p,x)=>{let b=0,S;u&&(b=i.findIndex(u)),p&&(S=i.findIndex(p)),b===-1&&(b=i.length),(S===void 0||S===-1)&&(S=i.length);let R=i.slice(b,S);for(let f=0;f<R.length;f++){let h=R[f];if(!(h.priority===-1||x&&x(h))&&(h.priority<o||h.priority===o&&(g&&!h.hasWhere||h.order>=c)))return b+f}return b+R.length};if(a){let i=this.rules.findIndex(u=>u.media);if(i!==-1){let u=a.features["max-width"],p=a.features["min-width"];if(u&&p){let x=u.value-p.value;for(let b=l;b>=i;b--){s=b;let S=this.rules[b],R=S.media,f=R.features["max-width"],h=R.features["min-width"];if(!f||!h){s++;break}let m=f.value-h.value;if(m===x){if(g!==S.hasWhere)continue;if(o!==-1){let k=[this.rules[b]];for(let y=b-1;y>=i;y--){let C=this.rules[y];if(C.hasWhere!==g)break;let j=C.media,E=j.features["max-width"],M=j.features["min-width"];if(!E||!M||E.value-M.value!==m)break;k.unshift(this.rules[y])}s=n(this.rules,y=>y.media&&y.priority!==-1&&y.media.features["min-width"]&&y.media.features["max-width"])}break}else if(m>x)break}}else if(p)for(let x=i;x<=l;x++){s=x;let b=this.rules[x],S=b.media,R=S.features["max-width"],f=S.features["min-width"];if(R){if(f)break;continue}let h=f?.value;if(h===p.value){if(!g&&b.hasWhere){s++;continue}if(o!==-1)s=n(this.rules,m=>m.media,m=>m.media&&m.priority!==-1&&m.media.features["min-width"]&&m.media.features["max-width"],m=>!m.media.features["min-width"]&&!m.media.features["max-width"]);else for(let m=x;m<=l;m++){let k=this.rules[m],y=k.media,C=y.features["min-width"];if(!y.features["max-width"]){if(k.hasWhere!==g||C.value!==h||k.order>=c)break;s=m+1}}break}else{if(h>p.value)break;s++}}else if(u)for(let x=l;x>=i;x--){s=x;let b=this.rules[x],S=b.media,R=S.features["max-width"];if(S.features["min-width"])continue;let h=R?.value;if(!h||h>u.value){s++;break}else if(h===u.value){if(g&&!b.hasWhere)continue;if(o!==-1)s=n(this.rules,m=>m.media,m=>m.media&&m.priority!==-1&&m.media.features["min-width"]&&m.media.features["max-width"],m=>!m.media.features["min-width"]&&!m.media.features["max-width"]);else{let m=[this.rules[x]];for(let k=x-1;k>=i;k--){let y=this.rules[k],C=y.media,j=C.features["min-width"],E=C.features["max-width"];if(!j&&(!E||E.value!==h||y.hasWhere!==g))break;m.unshift(y)}for(let k=0;k<m.length;k++){let y=m[k];if(!y.media.features["min-width"]){if(y.order>=c)break;s=x-m.length+2+k}}}break}}}if(s===void 0)if(i===-1)s=l+1;else if(o!==-1)s=i+n(this.rules.slice(i),void 0,u=>u.media.features["max-width"]||u.media.features["min-width"]);else if(g){let u=i;for(;u<this.rules.length;u++){let p=this.rules[u];if(p.priority!==-1||!p.hasWhere||p.order>=c){s=u;break}}s===void 0&&(s=u)}else for(let u=i;u<=l;u++){s=u;let p=this.rules[u],x=p.media;if(p.priority!==-1||x.features["max-width"]||x.features["min-width"])break;if(p.hasWhere)s++;else if(p.order>=c)break}}else if(o===-1)if(g)s=this.rules.findIndex(i=>!i.hasWhere||i.media||i.priority!==-1||i.order>=c),s===-1&&(s=l+1);else{let i=0;for(;i<this.rules.length;i++){let u=this.rules[i];if(u.media||!u.hasWhere&&(u.order>=c||u.priority!==-1)){s=i;break}}s===void 0&&(s=i)}else s=n(this.rules,void 0,i=>i.media);if(this.rules.splice(s,0,r),this.ruleOfClass[d]=r,this.style){let i=this.style.sheet,u=0,p=x=>{let b=this.rules[x];if(b){if(!b.natives.length)return p(x-1);let S=b.natives[b.natives.length-1].cssRule;for(let R=0;R<i.cssRules.length;R++)if(i.cssRules[R]===S){u=R+1;break}}};p(s-1);for(let x=0;x<r.natives.length;)try{let b=r.natives[x];i.insertRule(b.text,u),b.cssRule=i.cssRules[u++],x++}catch(b){console.error(b),r.natives.splice(x,1)}}}}get text(){return this.rules.map(t=>t.text).join("")}},q=J;ne(q,"root"),ne(q,"instances",[]),ne(q,"refresh",t=>{for(let r of J.instances)r.refresh(t)});me&&(window.MasterCSS=q);new q(window.masterCSSConfig);})();
|
|
1
|
+
(()=>{var Ie=Object.defineProperty;var ze=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ne=(e,t,r)=>(ze(e,typeof t!="symbol"?t+"":t,r),r);function Re(e){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&e instanceof t||e instanceof Date||e instanceof RegExp)}function Ce(e){if(typeof Buffer<"u"&&Buffer&&e instanceof Buffer){let t=Buffer.alloc(e.length);return e.copy(t),t}else{if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}}function Te(e){let t=[];return e.forEach(function(r,s){typeof r=="object"&&r!==null?Array.isArray(r)?t[s]=Te(r):Re(r)?t[s]=Ce(r):t[s]=U({},r):t[s]=r}),t}function Se(e,t){return t==="__proto__"?void 0:e[t]}function U(...e){let t={},r,s;return e.forEach(function(l){typeof l!="object"||l===null||Array.isArray(l)||Object.keys(l).forEach(function(a){if(s=Se(t,a),r=Se(l,a),r!==t)if(typeof r!="object"||r===null){t[a]=r;return}else if(Array.isArray(r)){t[a]=Te(r);return}else if(Re(r)){t[a]=Ce(r);return}else if(typeof s!="object"||s===null||Array.isArray(s)){t[a]=U({},r);return}else{t[a]=U(s,r);return}})}),t}function oe(e,t){return(e?e+":":"")+(t.unit?t.value+t.unit:t.value)+(t.important?"!important":"")}var Y={"(":")","'":"'",'"':'"',"{":"}"};function Z(e,t,r,s=[]){let l=[",",...s],a=[],c="",o=0;return function g(h,n,i,f="",p=[],x=[]){let b,S=!1;n&&(n===")"&&c.slice(-1)==="$"?b=c.length-1:(n==="'"||n==='"')&&(S=!0),c+=h[o++]);let R=()=>{let u=c;if(c="",t&&u in t&&!p.includes(u)){let m=o;o=0,g(t[u].toString(),void 0,void 0,void 0,[...p,u],x),o=m}else if(r&&u in r&&!x.includes(u)){let m=o;o=0,g(r[u].toString(),void 0,void 0,void 0,p,[...x,u]),o=m}else a.push({value:u})};for(;o<h.length;o++){let u=h[o];if(u===n){if(c+=u,S){let m=0;for(let d=c.length-2;c[d]==="\\";d--)m++;if(m%2)continue}b!==void 0&&(c=c.slice(0,b)+c.slice(b).replace(/\$\((.*)\)/,"var(--$1)")),i||(S?a.push(c):R(),f="",c="");break}else if(!S&&u in Y)g(h,Y[u],i===void 0?0:i+1,f,p,x);else if((u==="|"||u===" ")&&n!=="}"&&(!S||f==="path"))n?c+=" ":R();else{if(!n){if(u==="."){if(isNaN(+h[o+1]))break;h[o-1]==="-"&&(c+="0")}else if(l.includes(u)){c&&R(),a.push(u);continue}else if(u==="#"&&(c||a.length&&h[o-1]!=="|"&&a[o-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(u))break;f+=u}c+=u}}i===void 0&&c&&R()}(e),[a,e.slice(o)]}function ae(e,t,r){if(r){let s="",l=e.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(l)if(e.includes("/")){let[a,c]=e.split("/");return{value:+a/+c*100+"%",unit:s}}else{let a=+l[1];return s=l[3]||"",s||((r==="rem"||r==="em")&&(a=a/t),s=r||""),{value:a,unit:s}}}}function Me(e,t,r){let s=n=>n==="+"||n==="-"||n==="*"||n==="/",l="",a,c="",o=!1,g=!1;function h(n,i="",f=""){if(a===2&&!g){let p=ae(c,t,r);p&&(c=p.value+p.unit)}l+=c+i+n+f,a=null,g=!1,c=""}for(let n=0;n<e.length;n++){let i=e[n];if(i==="("||i===")")o=i===")",h(i);else if(i===",")h(i,""," ");else{switch(a){case 1:break;case 2:if(s(i)){h(i," "," ");continue}else/[0-9]/.test(i)||(g=!0);break;default:o&&(l+=" "),isNaN(+i)?s(i)||(a=1):a=2;break}a?c+=i:l+=i}}return c&&(l+=c),l}function le(e,t,r,s,l,a){let c="",o="",g;if(typeof e=="number")c=e,o=t||"";else{if(s){let n=!1,i=!1;e=e.replace(new RegExp(`(^|,| |\\()((?:${r.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(f,p,x,b)=>{i=!0;let S=s[x];if(S){let R;for(let u of a)if(R=S[u])break;if(R){n=!0;let u=R;if(b){let m=b.endsWith("%")?parseFloat(b)/100:+b;m=isNaN(m)?1:Math.min(Math.max(m,0),1),u+=Math.round(m*255).toString(16).toUpperCase().padStart(2,"0")}return p+u}}return f}),i&&(g=n)}let h=ae(e,l,t);if(h)return h;c=(e.indexOf("calc(")===-1?e:Me(e,l,t)).replace(/\$\(((\w|-)+)\)/g,"var(--$1)")}return{value:c,unit:o,colorMatched:g}}var xe=[":disabled",":active",":focus",":hover"];function ce(e){if(typeof CSS<"u")return CSS.escape(e);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let t=String(e),r=t.length,s=-1,l="",a,c=t.charCodeAt(0);if(r==1&&c==45)return"\\"+t;for(;++s<r;){if(a=t.charCodeAt(s),a==0){l+="\uFFFD";continue}if(a>=1&&a<=31||a==127||s==0&&a>=48&&a<=57||s==1&&a>=48&&a<=57&&c==45){l+="\\"+a.toString(16)+" ";continue}if(a>=128||a==45||a==95||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122){l+=t.charAt(s);continue}l+="\\"+t.charAt(s)}return l}var ue=class{constructor(t,r,s){this.className=t;this.meta=r;this.css=s;let{id:l,unit:a="rem",order:c=0,colorful:o,prop:g,analyzeToken:h,getThemeProps:n,parseValue:i,get:f}=r.config||{},{rootSize:p,scope:x,important:b}=s.config,{themeNames:S,colorNames:R,colorThemesMap:u,selectors:m,globalValues:d,breakpoints:k,mediaQueries:y}=s,M=s.values[l],C=s.relationThemesMap[t],$=t;this.order=c;let O,B,P,G;if(r.origin==="semantics"){let[W,A]=r.value;P=$.slice(W.length),O=A}else if(h)[B,G,P]=h.call(this,$,M,d);else{let W;if(r.origin==="matches"){let A=$.indexOf(":");this.prefix=$.slice(0,A+1),this.prefix.includes("(")?(this.prefix=void 0,W=$):W=$.slice(A+1)}else r.origin==="symbol"&&(this.symbol=$[0],W=$.slice(1));[G,P]=Z(W,M,d)}P[0]==="!"&&(this.important=!0,P=P.slice(1));let ke=W=>{let A=W.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((w,T)=>T%3?w:w.replace(/_/g," ")).join(""),E=[],N="",F=0;for(let w=0;w<A.length;w++){let T=A[w];if(T==="\\"){N+=T+A[++w];continue}!F&&T===","?(E.push(N),N=""):(N+=T,F&&T===")"?F--:T==="("&&F++)}return N&&E.push(N),E};this.prefixSelectors=B?ke(B):[""];let ge=P.split("@"),pe=ge[0];if(pe){this.vendorSuffixSelectors={};let W=(w,T,v,j)=>{for(let[L,D]of T)if(L.test(w)){for(let V of D)W(w.replace(L,V),T,v,!0);return}j&&v.push(w)},A=[];""in m?W(pe,m[""],A,!0):A.push(pe);let E={};for(let[w,T]of Object.entries(m)){if(!w)continue;let v=[];for(let j of A)W(j,T,v,!1);v.length&&(E[w]=v)}let N=(w,T)=>{let v=T.reduce((j,L)=>(j.push(...ke(L)),j),[]);w in this.vendorSuffixSelectors?this.vendorSuffixSelectors[w].push(...v):this.vendorSuffixSelectors[w]=v},F=Object.keys(E);if(F.length)for(let w of F)N(w,E[w]);else N("",A);for(let w of Object.values(this.vendorSuffixSelectors))for(let T of w){this.hasWhere!==!1&&(this.hasWhere=T.includes(":where("));for(let v=0;v<xe.length;v++)if(T.includes(xe[v])){(this.priority===-1||this.priority>v)&&(this.priority=v);break}}}else this.vendorSuffixSelectors={"":[""]};for(let W=1;W<ge.length;W++){let A=ge[W];if(A)if(S.includes(A))this.theme=A;else if(A==="rtl"||A==="ltr")this.direction=A;else{let E,N,F=A.indexOf("_");if(F!==-1)E=A.slice(0,F),N=A.slice(F);else{let w=A.indexOf("(");w!==-1&&(E=A.slice(0,w),N=A.slice(w))}if(!E){E="media";let w=[];this.media={token:A,features:{}};let T=A.split("&");for(let v of T)if(v==="all"||v==="print"||v==="screen"||v==="speech")this.media.type=v;else if(v==="\u{1F5A8}")this.media.type="print";else if(v==="landscape"||v==="portrait")w.push("(orientation:"+v+")");else if(v==="motion"||v==="reduced-motion")w.push("(prefers-reduced-motion:"+(v==="motion"?"no-preference":"reduce")+")");else if(y&&v in y)w.push(y[v]);else{let j={token:v},L="",D="",V=0;v.startsWith("<=")?(D="<=",L="max-width"):v.startsWith(">=")||k[v]?(D=">=",L="min-width"):v.startsWith(">")?(D=">",L="min-width",V=.02):v.startsWith("<")&&(D="<",L="max-width",V=-.02);let Q=D?v.replace(D,""):v,z=k[Q];switch(L){case"max-width":case"min-width":z?Object.assign(j,le(z,"px")):Object.assign(j,le(Q,"px")),j.unit==="px"&&(j.value+=V),this.media.features[L]=j,w.push("("+L+":"+(j.value+j.unit)+")");break}}N="",this.media.type&&(N=this.media.type),w.length&&(N+=(N?" and ":"")+w.join(" and "))}N&&(this.at[E]=(E in this.at?this.at[E]+" and ":"")+N.replace(/_/g," "))}}let se=(W,A)=>{let E,N,F=(T,v,j)=>{let L="";this.direction&&(L+="[dir="+this.direction+"] ");let D=this.prefixSelectors.map(z=>z+L),V=(z,ie)=>D.map(H=>(z?"."+z+" ":"")+(x?x+" ":"")+H).reduce((H,be)=>(H.push(j.reduce((we,Le)=>(we.push(be+"."+ce(ie)+Le),we),[]).join(",")),H),[]).join(","),Q=V(v,t)+(C?Object.entries(C).filter(([z])=>this.theme||!o||!v||!z||z===v).map(([z,ie])=>ie.reduce((H,be)=>H+","+V(this.theme??((o||n)&&v||z),be),"")).join(""):"")+"{"+T+"}";for(let z of Object.keys(this.at).sort((ie,H)=>H==="supports"?-1:1))Q="@"+z+" "+this.at[z]+"{"+Q+"}";return Q},w=[];if(G){let T,v;for(let j of G)typeof j=="string"?w.push(j):(T=le(j.value,a,o&&R,o&&u,p,this.theme?[this.theme,""]:[W]),T.colorMatched!==void 0&&v!==!0&&(v=T.colorMatched),w.push(T.value+T.unit));if(A&&(v===void 0?W:!v))return;if(w.length===1?T?(E=T.value,N=T.unit):E=w[0]:E=w.reduce((j,L,D)=>j+L+(L===","||G[D+1]===","||D===G.length-1?"":" "),""),typeof E!="object"){i&&(E=i.call(this,E,this.css.config)),o&&E==="current"&&(E="currentColor");let j={unit:N,value:E,important:this.important};if(n){let L=n.call(this,j,s);for(let D in L)for(let V of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:N,value:E,text:F(Object.entries(L[D]).map(([Q,z])=>oe(Q,{important:(this.important||b)&&!z.endsWith("!important"),unit:"",value:z})).join(";"),D,V),theme:D});return}else f&&(E=f.call(this,j))}}else E=O;for(let T of Object.values(this.vendorSuffixSelectors))this.natives.push({unit:N,value:E,text:F(typeof E=="object"?Object.entries(E).map(([v,j])=>oe(v,{...typeof j=="object"?j:{unit:"",value:j},important:this.important||b})).join(";"):oe(g,{unit:N,value:E,important:this.important||b}),W,T),theme:W})};if(n)se(void 0,!1);else if(this.theme)se(this.theme,!1);else if(o)for(let W of S)se(W,!0);else se("",!1)}at={};priority=-1;natives=[];get text(){return this.natives.map(t=>t.text).join("")}};var K={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560};function ee(e){e.startsWith("#")&&(e=e.slice(1));let t=e.match(/.{1,2}/g);return[parseInt(t[0],16),parseInt(t[1],16),parseInt(t[2],16)]}function fe(e,t,r){return((1<<24)+(e<<16)+(t<<8)+r).toString(16).slice(1)}function I(e){typeof e=="string"&&(e={"":e});let t=""in e,r=!1;for(let s in e)if(s&&+s>=100){r=!0;break}if(!r&&(!t||Object.keys(e).length>1)){let s=0,l="0"in e?ee(e[0]):[0,0,0],a,c,o=[],g=()=>{let h=a-s,n=c.map((i,f)=>(i-l[f])/h);for(let i of o){let f=i-s,p=l.map((x,b)=>Math.round(x+n[b]*f));e[i]="#"+fe.call(this,...p)}};for(let h=1;h<100;h++)h in e?(o.length?(a=h,c=ee(e[h]),g(),o.length=0,l=c):l=ee(e[h]),s=h):o.push(h);o.length&&(a=100,c="100"in e?ee(e[100]):[255,255,255],g())}return t||(e[""]=e[r?"500":"50"]),e}var Oe={black:"#000000",white:"#ffffff",slate:I({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:I({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:I({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:I({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:I({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:I({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:I({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:I({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:I({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:I({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:I({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:I({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:I({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:I({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:I({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:I({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:I({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:I({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:I({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:I({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};var Ee="";var $e={"::scrollbar":"::-webkit-scrollbar","::scrollbar-button":"::-webkit-scrollbar-button","::scrollbar-thumb":"::-webkit-scrollbar-thumb","::scrollbar-track":"::-webkit-scrollbar-track","::scrollbar-track-piece":"::-webkit-scrollbar-track-piece","::scrollbar-corner":"::-webkit-scrollbar-corner","::slider-thumb":["::-webkit-slider-thumb","::-moz-range-thumb"],"::slider-runnable-track":["::-webkit-slider-runnable-track","::-moz-range-track"],"::meter":"::-webkit-meter","::resizer":"::-webkit-resizer","::progress":"::-webkit-progress",":first":":first-child",":last":":last-child",":even":":nth-child(2n)",":odd":":nth-child(odd)",":nth(":":nth-child("};var Ae={square:{"aspect-ratio":"1/1"},video:{"aspect-ratio":"16/9"},rounded:{"border-radius":"1e9em"},round:{"border-radius":"50%"},hidden:{display:"none"},hide:{display:"none"},block:{display:"block"},table:{display:"table"},flex:{display:"flex"},grid:{display:"grid"},contents:{display:"contents"},inline:{display:"inline"},"inline-block":{display:"inline-block"},"inline-flex":{display:"inline-flex"},"inline-grid":{display:"inline-grid"},"inline-table":{display:"inline-table"},"table-cell":{display:"table-cell"},"table-caption":{display:"table-caption"},"flow-root":{display:"flow-root"},"list-item":{display:"list-item"},"table-row":{display:"table-row"},"table-column":{display:"table-column"},"table-row-group":{display:"table-row-group"},"table-column-group":{display:"table-column-group"},"table-header-group":{display:"table-header-group"},"table-footer-group":{display:"table-footer-group"},italic:{"font-style":"italic"},oblique:{"font-style":"oblique"},isolate:{isolation:"isolate"},overflow:{overflow:"visible"},untouchable:{"pointer-events":"none"},static:{position:"static"},fixed:{position:"fixed"},abs:{position:"absolute"},rel:{position:"relative"},sticky:{position:"sticky"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},visible:{visibility:"visible"},invisible:{visibility:"hidden"},vw:{width:"100vw"},vh:{height:"100vh"},"max-vw":{"max-width":"100vw"},"max-vh":{"max-height":"100vh"},"min-vw":{"min-width":"100vw"},"min-vh":{"min-height":"100vh"},"center-content":{"justify-content":"center","align-items":"center"},"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap","border-width":"0"},full:{width:"100%",height:"100%"},center:{left:0,right:0,"margin-left":"auto","margin-right":"auto"},middle:{top:0,bottom:0,"margin-top":"auto","margin-bottom":"auto"},"break-spaces":{"white-space":"break-spaces"},"break-word":{"overflow-wrap":"break-word",overflow:"hidden"}};var je=["dark","light"];var he={store:"theme"};function te(e,t,r=""){let s="border-";r&&(r="-"+r);let l=/^b(order)?-?(.)?/.exec(e)[2],a=s+"left"+r,c=s+"right"+r,o=s+"top"+r,g=s+"bottom"+r;switch(l){case"x":return{[a]:t,[c]:t};case"y":return{[o]:t,[g]:t};case"l":return{[a]:t};case"r":return{[c]:t};case"t":return{[o]:t};case"b":return{[g]:t};default:return{["border"+r]:t}}}function ye(e,t,{rootSize:r}){let s="",l=0;return function a(c,o){let g="",h=o?t(o):"",n=()=>{g&&(s+=!h||Number.isNaN(+g)?g:+g/(h==="rem"?r:1)+h,g="")};for(;l<e.length;l++){let i=e[l];if(i===c&&(c!=="'"||e[l+1]===")")){n(),s+=i;break}else i===","||i===" "?(n(),s+=i):!g&&i==="'"?(s+=i,l++,a(i),g=""):g&&i==="("?(s+=g+i,l++,a(")",g),g=""):g+=i}n()}(),s}var X={content:"content-box",border:"border-box",padding:"padding-box"};var re={min:"min-content",max:"max-content"};var _={full:"100%",fit:"fit-content",max:"max-content",min:"min-content"};for(let e in K)_[e]=K[e]/16+"rem";(()=>{let e=typeof global<"u"?global:window;if(!e.CSS&&!e.CSS?.escape){let t=function(r){if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let s=String(r),l=s.length,a=-1,c="",o,g=s.charCodeAt(0);if(l==1&&g==45)return"\\"+s;for(;++a<l;){if(o=s.charCodeAt(a),o==0){c+="\uFFFD";continue}if(o>=1&&o<=31||o==127||a==0&&o>=48&&o<=57||a==1&&o>=48&&o<=57&&g==45){c+="\\"+o.toString(16)+" ";continue}if(o>=128||o==45||o==95||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){c+=s.charAt(a);continue}c+="\\"+s.charAt(a)}return c};e.CSS||(e.CSS={}),e.CSS.escape=t,globalThis.CSS.escape=t}})();var Ne={group:{matches:"^(?:.+?[*_>~+])?\\{.+?\\}",unit:"",prop:!1,analyzeToken(e,t,r){let s=0;for(;s<e.length&&!(e[s]==="{"&&e[s-1]!=="\\");s++);return[e.slice(0,s),...Z(e.slice(s),t,r)]},getThemeProps(e,t){let r={},s=(h,n)=>{let i=n.indexOf(":");if(i!==-1){h in r||(r[h]={});let f=r[h],p=n.slice(0,i);p in f||(f[p]=n.slice(i+1))}},l=h=>{let n=(i,f)=>{let p=f.slice(ce(h.className).length).match(/\{(.*)\}/)[1].split(";");for(let x of p)s(i,x)};if(this.theme){let i=h.natives.find(f=>f.theme===this.theme)??h.natives.find(f=>!f.theme);i&&n(this.theme,i.text)}else for(let i of h.natives)n(i.theme,i.text)},a=[],c="",o=()=>{c&&(a.push(c.replace(/ /g,"")),c="")},g=1;(function h(n){for(;g<e.value.length;g++){let i=e.value[g];if(!n){if(i===";"){o();continue}if(i==="}")break}if(c+=i,n===i){if(n==="'"||n==='"'){let f=0;for(let p=c.length-2;c[p]==="\\";p--)f++;if(f%2)continue}break}else i in Y&&n!=="'"&&n!=='"'&&(g++,h(Y[i]))}})(void 0),o();for(let h of a){let n=t.create(h);if(Array.isArray(n))for(let i of n)l(i);else n?l(n):s(this.theme??"",h)}return r}},variable:{matches:"^\\$[^ (){}A-Z]+:[^ ]",unit:"",prop:!1,get(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{matches:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},fontWeight:{matches:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",unit:"",values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{matches:"^f(?:ont)?:(?:$values)(?!\\|)",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:{matches:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",unit:"",prop:!1,get(e){let t={};switch(e.value){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]={...e,value:"auto"};break;case"antialiased":t["-webkit-font-smoothing"]={...e,value:"antialiased"},t["-moz-osx-font-smoothing"]={...e,value:"grayscale"};break}return t}},fontStyle:{matches:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",unit:"deg"},fontVariantNumeric:{matches:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)"},fontFeatureSettings:{matches:"^font-feature:."},font:{matches:"^f:.",unit:"",order:-1},color:{matches:"^(?:color|fg|foreground):.",colorful:!0,unit:""},spacing:{matches:"^[pm][xytblr]?:.",prop:!1,get(e){let r=this.prefix[0]==="m"?"margin":"padding",s=r+"-left",l=r+"-right",a=r+"-top",c=r+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[l]:e};case"y":return{[a]:e,[c]:e};case"l":return{[s]:e};case"r":return{[l]:e};case"t":return{[a]:e};case"b":return{[c]:e};default:return{[r]:e}}},get order(){return this.prefix==="p:"||this.prefix==="m:"?-1:0}},margin:{matches:"^margin(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="margin:"?-1:0}},padding:{matches:"^padding(?:-(?:left|right|top|bottom))?:.",prop:!1,get(e){return{[this.prefix.slice(0,-1)]:e}},get order(){return this.prefix==="padding:"?-1:0}},flexBasis:{values:_},flexWrap:{matches:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)"},flexGrow:{unit:""},flexShrink:{unit:""},flexDirection:{matches:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",values:{col:"column","col-reverse":"column-reverse"}},flex:{unit:"",order:-1},display:{matches:"^d:."},width:{matches:"^w:.",values:_},height:{matches:"^h:.",values:_},minWidth:{matches:"^min-w:.",values:_},minHeight:{matches:"^min-h:.",values:_},wH:{matches:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...Z(e,t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{width:{...e,value:t},height:{...e,value:r}}}},minWH:{matches:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...Z(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"min-width":{...e,value:t},"min-height":{...e,value:r}}}},maxWH:{matches:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",prop:!1,analyzeToken(e,t,r){return["",...Z(e.slice(4),t,r,["x"])]},get(e){let[t,r]=e.value.split(" x ");return{"max-width":{...e,value:t},"max-height":{...e,value:r}}}},contain:{},content:{},counterIncrement:{unit:""},counterReset:{unit:""},letterSpacing:{matches:"^ls:.",unit:"em"},lineHeight:{matches:"^lh:.",unit:""},objectFit:{matches:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)"},objectPosition:{matches:"^(?:object|obj):(?:top|bottom|right|left|center|$values)"},textAlign:{matches:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)"},textDecorationColor:{colorStarts:"text-decoration:",colorful:!0},textDecorationStyle:{matches:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)"},textDecorationThickness:{matches:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",unit:"em"},textDecorationLine:{matches:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)"},textDecoration:{matches:"^t(?:ext)?:(?:underline|line-through|overline|$values)",colorful:!0,order:-1},textUnderlineOffset:{},textOverflow:{matches:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))"},textOrientation:{matches:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)"},textTransform:{matches:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)"},textRendering:{matches:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)"},textIndent:{},verticalAlign:{matches:"^(?:v|vertical):."},columns:{matches:"^(?:columns|cols):.",unit:"",order:-1},whiteSpace:{unit:""},inset:{matches:"^(?:top|bottom|left|right):.",get(e){return{[this.prefix.slice(0,-1)]:e}}},lines:{matches:"^lines:.",unit:"",prop:!1,get(e){return{overflow:{...e,value:"hidden"},display:{...e,value:"-webkit-box"},"overflow-wrap":{...e,value:"break-word"},"text-overflow":{...e,value:"ellipsis"},"-webkit-box-orient":{...e,value:"vertical"},"-webkit-line-clamp":e}}},maxHeight:{matches:"^max-h:.",values:_},maxWidth:{matches:"^max-w:.",values:_},boxSizing:{matches:"^box:(?:$values)(?!\\|)",values:{content:"content-box",border:"border-box"}},opacity:{unit:""},visibility:{},clear:{},float:{},isolation:{},overflow:{matches:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",prop:!1,get(e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e};case"y":return{"overflow-y":e}}return{overflow:e}},get order(){return-1}},overscrollBehavior:{matches:"^overscroll-behavior(?:-[xy])?:",prop:!1,get(e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e};case"y":return{"overscroll-behavior-y":e};default:return{"overscroll-behavior":e}}}},zIndex:{matches:"^z:.",unit:""},position:{values:{abs:"absolute",rel:"relative"}},cursor:{},pointerEvents:{},resize:{},touchAction:{},wordBreak:{unit:""},wordSpacing:{unit:"em"},userDrag:{get(e){return{"user-drag":e,"-webkit-user-drag":e}}},userSelect:{get(e){return{"user-select":e,"-webkit-user-select":e}}},textShadow:{colorful:!0},textSize:{matches:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",prop:!1,get(e){let{unit:t,value:r}=e,s=.75;return{"font-size":e,"line-height":{...e,value:t==="em"?r+s+t:`calc(${r}${t} + ${s}em)`,unit:""}}}},textFillColor:{matches:"^text-fill-color:.",colorStarts:"(?:text-fill|text|t):",colorful:!0,prop:!1,get(e){return{"-webkit-text-fill-color":e}}},textStrokeWidth:{matches:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",prop:!1,get(e){return{"-webkit-text-stroke-width":e}}},textStrokeColor:{matches:"^text-stroke-color:.",colorStarts:"text-stroke:",colorful:!0,prop:!1,get(e){return{"-webkit-text-stroke-color":e}}},textStroke:{matches:"^text-stroke:.",prop:!1,get(e){return{"-webkit-text-stroke":e}}},boxShadow:{matches:"^s(?:hadow)?:.",colorful:!0},tableLayout:{},transformBox:{matches:"^transform:(?:$values)(?!\\|)",values:{...X,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{matches:"^transform:(?:flat|preserve-3d|$values)(?!\\|)"},transformOrigin:{matches:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",unit:"px"},transform:{matches:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",unit:"",parseValue(e,{rootSize:t}){return e.replace(/(translate|scale|skew|rotate|perspective|matrix)(3d|[XYZ])?\((.*?)\)/g,(r,s,l,a)=>{let c,o;switch(s){case"translate":c="rem";break;case"skew":c="deg";break;case"rotate":l==="3d"&&(o=!0),c="deg";break;default:return r}let g=a.split(",");return r.replace(a,g.map((h,n)=>!o||g.length-1===n?Number.isNaN(+h)?h:h/(c==="rem"?t:1)+c:h).join(","))})}},transitionProperty:{matches:"^~property:."},transitionTimingFunction:{matches:"^~easing:."},transitionDuration:{matches:"^~duration:.",unit:"ms"},transitionDelay:{matches:"^~delay:.",unit:"ms"},transition:{symbol:"~",order:-1},animationDelay:{matches:"^@delay:.",unit:"ms"},animationDirection:{matches:"^@direction:."},animationDuration:{matches:"^@duration:.",unit:"ms"},animationFillMode:{matches:"^@fill-mode:."},animationIterationCount:{matches:"^@iteration-count:.",unit:""},animationName:{matches:"^@name:."},animationPlayState:{matches:"^@play-state:."},animationTimingFunction:{matches:"^@easing:."},animation:{symbol:"@",unit:"",order:-1},borderColor:{matches:"^border(?:-(?:left|right|top|bottom))?-color:.",colorStarts:"b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?:",colorful:!0,prop:!1,get(e){return te(this.prefix,e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{matches:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",prop:!1,get(e){if(this.prefix){let r="",s=this.prefix.split("-");if(s.length>1)for(let l=1;l<s.length-1;l++)r+=s[l][0];else r=this.prefix.slice(1,-1);switch(r){case"t":return{"border-top-left-radius":e,"border-top-right-radius":e};case"tl":case"lt":return{"border-top-left-radius":e};case"rt":case"tr":return{"border-top-right-radius":e};case"b":return{"border-bottom-left-radius":e,"border-bottom-right-radius":e};case"bl":case"lb":return{"border-bottom-left-radius":e};case"br":case"rb":return{"border-bottom-right-radius":e};case"l":return{"border-top-left-radius":e,"border-bottom-left-radius":e};case"r":return{"border-top-right-radius":e,"border-bottom-right-radius":e};default:return{"border-radius":e}}}let t=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(t)?t:"border-radius"]:e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",prop:!1,get(e){return te(this.prefix,e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{matches:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",prop:!1,get(e){return te(this.prefix,e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{matches:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)"},borderSpacing:{},borderImageOutset:{},borderImageRepeat:{matches:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)"},borderImageSlice:{unit:""},borderImageSource:{matches:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},borderImageWidth:{matches:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},borderImage:{unit:""},border:{matches:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",colorful:!0,prop:!1,get(e){return te(this.prefix,e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{matches:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)"},backgroundBlendMode:{},backgroundColor:{colorStarts:"(?:bg|background):",unit:"",colorful:!0},backgroundClip:{matches:"^(?:bg|background):(?:text|$values)(?!\\|)",get(e){return{"-webkit-background-clip":e,"background-clip":e}},values:X},backgroundOrigin:{matches:"^(?:bg|background):(?:$values)(?!\\|)",values:X},backgroundPosition:{matches:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",unit:"px"},backgroundRepeat:{matches:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])"},backgroundSize:{matches:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)"},backgroundImage:{matches:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",colorful:!0},background:{matches:"^bg:.",colorful:!0,order:-1},mixBlendMode:{matches:"^blend:."},backdropFilter:{matches:"^bd:.",colorful:!0,get(e){return{"backdrop-filter":e,"-webkit-backdrop-filter":e}},parseValue(e,t){return ye(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},filter:{matches:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",colorful:!0,parseValue(e,t){return ye(e,r=>{switch(r){case"blur":case"drop-shadow":return"rem";case"hue-rotate":return"deg"}return""},t)}},fill:{colorStarts:"fill:",colorful:!0},strokeDasharray:{},strokeDashoffset:{},strokeWidth:{matches:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},stroke:{colorful:!0},x:{unit:""},y:{unit:""},cx:{unit:""},cy:{unit:""},rx:{unit:""},ry:{unit:""},gridColumnStart:{matches:"^grid-col-start:.",unit:""},gridColumnEnd:{matches:"^grid-col-end:.",unit:""},gridColumn:{matches:"^grid-col(?:umn)?(?:-span)?:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{matches:"^grid-cols:.",unit:"",get(e){return{display:{...e,value:"grid"},"grid-template-columns":{...this,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridRowStart:{unit:""},gridRowEnd:{unit:""},gridRow:{matches:"^grid-row-span:.",unit:"",order:-1,parseValue(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{unit:"",get(e){return{display:{...e,value:"grid"},"grid-auto-flow":{...e,value:"column"},"grid-template-rows":{...e,value:"repeat("+e.value+",minmax("+0+","+1+"fr))"}}}},gridAutoColumns:{matches:"^grid-auto-cols:.",values:re},gridAutoFlow:{matches:"^grid-flow:."},gridAutoRows:{values:re},gridTemplateAreas:{},gridTemplateColumns:{matches:"^grid-template-cols:.",values:re},gridTemplateRows:{values:re},gridTemplate:{order:-1},gridArea:{unit:"",order:-1},grid:{order:-1},gap:{matches:"^gap(?:-x|-y)?:.",order:-1,prop:!1,get(e){switch(this.prefix[4]){case"x":return{"column-gap":e};case"y":return{"row-gap":e};default:return{gap:e}}}},order:{matches:"^o:.",unit:"",values:{first:-999999,last:999999}},breakInside:{},breakBefore:{},breakAfter:{},boxDecorationBreak:{matches:"^box:(?:slice|clone|$values)(?!\\|)",get(e){return{"box-decoration-break":e,"-webkit-box-decoration-break":e}}},aspectRatio:{matches:"^aspect:.",unit:""},columnSpan:{matches:"^col-span:."},alignContent:{matches:"^ac:."},alignItems:{matches:"^ai:."},alignSelf:{matches:"^as:"},justifyContent:{matches:"^jc:."},justifyItems:{matches:"^ji:."},justifySelf:{matches:"^js:."},placeContent:{order:-1},placeItems:{order:-1},placeSelf:{order:-1},listStylePosition:{matches:"^list-style:(?:inside|outside|$values)(?!\\|)"},listStyleType:{matches:"^list-style:(?:disc|decimal|$values)(?!\\|)"},listStyleImage:{matches:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)"},listStyle:{order:-1},outlineColor:{colorStarts:"outline:",colorful:!0},outlineOffset:{},outlineStyle:{matches:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)"},outlineWidth:{matches:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},outline:{order:-1,colorful:!0},accentColor:{colorStarts:"accent:",colorful:!0},appearance:{},caretColor:{colorStarts:"caret:",colorful:!0},scrollBehavior:{},scrollMargin:{matches:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e,"scroll-margin-right":e};case"y":return{"scroll-margin-top":e,"scroll-margin-bottom":e};case"l":return{"scroll-margin-left":e};case"r":return{"scroll-margin-right":e};case"t":return{"scroll-margin-top":e};case"b":return{"scroll-margin-bottom":e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{matches:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",prop:!1,get(e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e,"scroll-padding-right":e};case"y":return{"scroll-padding-top":e,"scroll-padding-bottom":e};case"l":return{"scroll-padding-left":e};case"r":return{"scroll-padding-right":e};case"t":return{"scroll-padding-top":e};case"b":return{"scroll-padding-bottom":e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{matches:"^scroll-snap:(?:start|end|center|$values)"},scrollSnapStop:{matches:"^scroll-snap:(?:normal|always|$values)(?!\\|)"},scrollSnapType:{matches:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)"},willChange:{},writingMode:{matches:"^writing:."},direction:{},shapeOutside:{matches:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",values:{...X,margin:"margin-box"}},shapeMargin:{matches:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$"},shapeImageThreshold:{unit:""},clipPath:{matches:"^clip:.",values:{...X,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{},maskImage:{get(e){return{"mask-image":e,"-webkit-mask-image":e}}}};var ve={breakpoints:K,colors:Oe,rootSize:16,scope:Ee,selectors:$e,semantics:Ae,themes:je,theme:he,rules:Ne,override:!1,observe:!0,important:!1};var de=class{constructor(t=typeof document<"u"?document.documentElement:null,r){this.host=t;this.options=r;this.options=U(he,r),this.options.store&&this.storage?this.syncWithStorage():this.options.default&&this.set(this.options.default,{emit:!1,store:!1})}darkMQL=typeof window<"u"?window.matchMedia?.("(prefers-color-scheme:dark)"):void 0;get storage(){let{store:t}=this.options;if(t)return localStorage.getItem(t)}current;value;set(t,r={store:!0,emit:!0}){if(t!==this.value){let s;t==="system"?(this.darkMQL?.addEventListener?.("change",this.onThemeChange),s=this.darkMQL?.matches?"dark":"light"):(this.removeDarkMQLListener(),s=t),s&&(this.host.classList.remove(this.current),this.host.classList.add(s),this.host.style&&(this.host.style.colorScheme=s)),this.current=s,this.value=t,r.store,this.storage,this.options.store&&localStorage.setItem(this.options.store,t),r.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this}))}}syncWithStorage(){if(typeof window<"u"&&this.options.store){let t=this.storage;(t==="system"&&(t=this.darkMQL?.matches?"dark":"light")||t)&&(this.host.classList.add(t),this.host.style.colorScheme=t,this.set(t,{emit:!1,store:!1}))}}removeDarkMQLListener(){this.darkMQL?.removeEventListener("change",this.onThemeChange)}onThemeChange=t=>{this.set(t.matches?"dark":"light")};destroy(){this.darkMQL?.removeEventListener("change",this.onThemeChange)}};var We=[",",".","#","[","!","*",">","+","~",":","@"];var me=typeof window<"u",J=class{constructor(t){this.config=t;this.config?.override||(this.config=U(ve,t)),this.cache(),me&&this.config.observe&&this.observe(document),J.instances.push(this),this.ready=!0}rules=[];ruleOfClass={};countOfClass={};ready=!1;e=me?new MutationObserver(t=>{let r={},s=[],l=[],a=[],c=(n,i)=>{i?n.classList.forEach(g):n.classList.forEach(o);let f=n.children;for(let p=0;p<f.length;p++){let x=f[p];x.classList&&(l.push(x),c(x,i))}},o=n=>{n in r?r[n]++:r[n]=1},g=n=>{n in r?r[n]--:n in this.countOfClass&&(r[n]=-1)},h=(n,i)=>{for(let f=0;f<n.length;f++){let p=n[f];p.classList&&!l.includes(p)&&!a.includes(p)&&(p.isConnected!==i?(l.push(p),c(p,i)):a.push(p))}};for(let n=0;n<t.length;n++){let i=t[n],{addedNodes:f,removedNodes:p,type:x,target:b}=i;if(x==="attributes"){if(s.find(S=>S.target===b))continue;s.push(i)}else h(f,!1),(!b.isConnected||!l.includes(b))&&h(p,!0)}if(!(!s.length&&!Object.keys(r).length)){for(let{oldValue:n,target:i}of s){let f=l.includes(i),p=i.classList,x=n?n.split(" "):[];if(f){if(i.isConnected)continue;for(let b of x)p.contains(b)||g(b)}else if(i.isConnected){p.forEach(b=>{x.includes(b)||o(b)});for(let b of x)p.contains(b)||g(b)}}for(let n in r){let i=r[n],f=(this.countOfClass[n]||0)+i;f===0?(delete this.countOfClass[n],this.delete(n)):(n in this.countOfClass||this.insert(n),this.countOfClass[n]=f)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.relationThemesMap={},this.relations={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:t,classes:r,selectors:s,themes:l,colors:a,values:c,breakpoints:o,mediaQueries:g,rules:h}=this.config;function n(u){return u.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function i(u,m,d="",k={}){let y=O=>O?(d?d+"-":"")+O:d,M=Object.entries(u),C=[],$=[];for(let O of M){let B=O[1];(typeof B=="object"&&!Array.isArray(B)?C:$).push(O)}for(let[O,B]of C)i(B,m,y(O),k);if(m&&d)$.length&&(k[d]=$.reduce((O,[B,P])=>(O[B]=P,O),{}));else for(let[O,B]of $)k[y(O)]=B;return k}if(t)for(let[u,m]of Object.entries(i(t,!0)))this.semantics.push([new RegExp("^"+n(u)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[u,m]]);if(s)for(let[u,m]of Object.entries(i(s,!1))){let d=new RegExp(n(u)+"(?![a-z-])");for(let k of Array.isArray(m)?m:[m]){let y=k.match(/^::-[a-z]+-/m)?.[0]??"",M=this.selectors[y];M||(M=this.selectors[y]=[]);let C=M.find(([$])=>$===d);C||(C=[d,[]],M.push(C)),C[1].push(k)}}c&&(this.globalValues=i(c,!1)),o&&(this.breakpoints=i(o,!1)),g&&(this.mediaQueries=i(g,!1));let f=r?i(r,!1):{},p=l&&!Array.isArray(l)?Object.entries(l).filter(([,{classes:u}])=>u).reduce((u,[m,{classes:d}])=>(u[m]=i(d,!1),u),{}):{},x=[...Object.keys(f),...Object.entries(p).flatMap(([u,m])=>Object.keys(m))],b=u=>{if(u in this.classes)return;let m=this.classes[u]=[],d=(k,y)=>{if(!y)return;let M=Array.isArray(y)?y:y.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let C of M){let $=O=>{O in this.relationThemesMap?k in this.relationThemesMap[O]?this.relationThemesMap[O][k].push(u):this.relationThemesMap[O][k]=[u]:this.relationThemesMap[O]={[k]:[u]},m.includes(O)||m.push(O)};if(x.includes(C)){b(C);for(let O of this.classes[C])$(O)}else $(C)}};d("",f?.[u]);for(let[k,y]of Object.entries(p))d(k,y?.[u])};for(let u of x)b(u);for(let u in this.relationThemesMap){let m=this.relations[u]=[];for(let d of Object.values(this.relationThemesMap[u]))for(let k of d)m.includes(k)||m.push(k)}let S=(u,m)=>{if(!m)return;let d=i(m,!0);for(let[k,y]of Object.entries(d)){let M=typeof y=="string"?{"":y}:y;for(let[C,$]of Object.entries(M)){let O=k+(C?"-"+C:"");O in this.colorThemesMap?this.colorThemesMap[O][u]=$:this.colorThemesMap[O]={[u]:$}}}for(let k in m)this.colorNames.includes(k)||this.colorNames.push(k)};if(S("",a),l)if(Array.isArray(l))this.themeNames.push(...l);else for(let u in l){let m=l[u];S(u,m.colors),this.themeNames.push(u)}let R=u=>{for(let[m,d]of Object.entries(this.colorThemesMap))for(let[k,y]of Object.entries(d))y.startsWith("#")||u(m,d,k,y)};if(R((u,m,d,k)=>{let y=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(k);if(y){let M="#"+fe(+y[1],+y[2],+y[3]);y[4]&&(M+=Math.round(255*+y[4]).toString(16)),m[d]=M}}),R((u,m,d,k)=>{let[y,M]=k.split("/"),C=this.colorThemesMap[y];if(C){let $=(d?C[d]:void 0)??C[""];m[d]=M?$.slice(0,7)+Math.round(255*+M).toString(16):$}else console.warn(`\`${k}\` doesn't exist in the extended config \`.colors\``),delete m[d],Object.keys(m).length||delete this.colorThemesMap[u]}),h)for(let u in h){let m=h[u],{matches:d,prop:k,values:y}=m;if(m.id=u,m.prop=k===!1?"":u.replace(/(?!^)[A-Z]/g,M=>"-"+M).toLowerCase(),y&&(this.values[u]=i(y,!1)),d){let M=Object.keys(this.values[u]??{}),C=d.indexOf("$values");this.matches[u]=new RegExp(C===-1?d:M.length?d.slice(0,C)+M.join("|")+d.slice(C+7):d.slice(0,C-(d[C-1]==="|"?1:0))+d.slice(C+7+(d[C+7]==="|"?1:0)))}}}observe(t,r={subtree:!0,childList:!0}){if(me&&t){this.root=t;let s=t===document;s&&(J.root=this),this.host=s?document.documentElement:root.host,this.theme=new de(this.host,this.config.theme);let l=s?document.head:t,a=s?document.styleSheets:t.styleSheets;for(let o of a){let{title:g,href:h,ownerNode:n}=o;(g==="master"||h&&h.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(h))&&(this.style=n)}if(this.style)for(let o=0;o<this.style.sheet.cssRules.length;o++){let g=n=>{if(n.selectorText){let f=n.selectorText.split(", ")[0].split(" ");for(let p=0;p<f.length;p++){let x=f[p];if(x[0]==="."){let b=x.slice(1),S="";for(let R=0;R<b.length;R++){let u=b[R],m=b[R+1];if(u==="\\"){if(R++,m!=="\\"){S+=m;continue}}else if(We.includes(u))break;S+=u}if(!(S in this.ruleOfClass)&&!(S in this.classes)){let R=this.create(S)[0];if(R)return R}}}}else if(n.cssRules)for(let i=0;i<n.cssRules.length;i++){let f=g(n.cssRules[i]);if(f)return f}},h=g(this.style.sheet.cssRules[o]);if(h){this.rules.push(h),this.ruleOfClass[h.className]=h;for(let n=0;n<h.natives.length;n++)h.natives[n].cssRule=this.style.sheet.cssRules[o+n];o+=h.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let o=l.querySelector('link[rel="styleSheet"], style');o?o.before(this.style):l.append(this.style)}let c=o=>{o.forEach(g=>{g in this.countOfClass?this.countOfClass[g]++:(this.countOfClass[g]=1,this.insert(g))})};c(this.host.classList),r.subtree&&this.host.querySelectorAll("[class]").forEach(o=>c(o.classList)),this.e.observe(t,{...r,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleOfClass={},this.countOfClass={},this.rules.length=0;let t=this.style.sheet;if(t)for(let r=t.cssRules.length-1;r>=0;r--)t.deleteRule(r);this.style.remove(),this.style=null,this.theme?.destroy(),this.theme=null}match(t){for(let r in this.config.rules){let s=this.config.rules[r],l=this.matches[r],{colorStarts:a,symbol:c,prop:o}=s,{colorNames:g,colorThemesMap:h}=this;if(l&&l.test(t))return{origin:"matches",config:s};if(a){if(t.match("^"+a+"(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|current|inherit))"))return{origin:"matches",config:s};if(g.length&&t.indexOf("|")===-1){let n=t.match("^"+a+"((?:"+g.join("|")+")[0-9a-zA-Z-]*)");if(n&&n[1]in h)return{origin:"matches",config:s}}}if(c&&t.startsWith(c))return{origin:"symbol",config:s};if(o&&t.startsWith(o+":"))return{origin:"matches",config:s}}for(let r of this.semantics)if(t.match(r[0]))return{origin:"semantics",value:r[1]}}create(t){let r=s=>{if(s in this.ruleOfClass)return this.ruleOfClass[s];let l=this.match(s);if(l)return new ue(s,l,this)};return(t in this.classes?this.classes[t].map(s=>r(s)):[r(t)]).filter(s=>s&&s.text)}refresh(t){if(t?.override?this.config=t:this.config=U(ve,t),this.cache(),!this.style)return;let r=document.createElement("style");r.title="master",this.style.replaceWith(r),this.style=r,this.rules.length=0,this.ruleOfClass={};for(let s in this.countOfClass)this.insert(s)}destroy(){let t=J.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let r=this.style.sheet,s=l=>{let a=this.ruleOfClass[l];if(!(!a||l in this.relations&&this.relations[l].some(c=>c in this.countOfClass))){if(a.natives.length){let c=a.natives[0];for(let o=0;o<r.cssRules.length;o++)if(r.cssRules[o]===c.cssRule){for(let h=0;h<a.natives.length;h++)r.deleteRule(o);this.rules.splice(this.rules.indexOf(a),1);break}}delete this.ruleOfClass[l]}};if(t in this.classes){for(let l of this.classes[t])l in this.countOfClass||s(l);delete this.ruleOfClass[t]}else s(t)}insert(t){let r=this.create(t);return r.length?(this.insertRules(r),!0):!1}insertRules(t){for(let r of t){if(this.ruleOfClass[r.className])continue;let s,l=this.rules.length-1,{media:a,order:c,priority:o,hasWhere:g,className:h}=r,n=(i,f,p,x)=>{let b=0,S;f&&(b=i.findIndex(f)),p&&(S=i.findIndex(p)),b===-1&&(b=i.length),(S===void 0||S===-1)&&(S=i.length);let R=i.slice(b,S);for(let u=0;u<R.length;u++){let m=R[u];if(!(m.priority===-1||x&&x(m))&&(m.priority<o||m.priority===o&&(g&&!m.hasWhere||m.order>=c)))return b+u}return b+R.length};if(a){let i=this.rules.findIndex(f=>f.media);if(i!==-1){let f=a.features["max-width"],p=a.features["min-width"];if(f&&p){let x=f.value-p.value;for(let b=l;b>=i;b--){s=b;let S=this.rules[b],R=S.media,u=R.features["max-width"],m=R.features["min-width"];if(!u||!m){s++;break}let d=u.value-m.value;if(d===x){if(g!==S.hasWhere)continue;if(o!==-1){let k=[this.rules[b]];for(let y=b-1;y>=i;y--){let M=this.rules[y];if(M.hasWhere!==g)break;let C=M.media,$=C.features["max-width"],O=C.features["min-width"];if(!$||!O||$.value-O.value!==d)break;k.unshift(this.rules[y])}s=n(this.rules,y=>y.media&&y.priority!==-1&&y.media.features["min-width"]&&y.media.features["max-width"])}break}else if(d>x)break}}else if(p)for(let x=i;x<=l;x++){s=x;let b=this.rules[x],S=b.media,R=S.features["max-width"],u=S.features["min-width"];if(R){if(u)break;continue}let m=u?.value;if(m===p.value){if(!g&&b.hasWhere){s++;continue}if(o!==-1)s=n(this.rules,d=>d.media,d=>d.media&&d.priority!==-1&&d.media.features["min-width"]&&d.media.features["max-width"],d=>!d.media.features["min-width"]&&!d.media.features["max-width"]);else for(let d=x;d<=l;d++){let k=this.rules[d],y=k.media,M=y.features["min-width"];if(!y.features["max-width"]){if(k.hasWhere!==g||M.value!==m||k.order>=c)break;s=d+1}}break}else{if(m>p.value)break;s++}}else if(f)for(let x=l;x>=i;x--){s=x;let b=this.rules[x],S=b.media,R=S.features["max-width"];if(S.features["min-width"])continue;let m=R?.value;if(!m||m>f.value){s++;break}else if(m===f.value){if(g&&!b.hasWhere)continue;if(o!==-1)s=n(this.rules,d=>d.media,d=>d.media&&d.priority!==-1&&d.media.features["min-width"]&&d.media.features["max-width"],d=>!d.media.features["min-width"]&&!d.media.features["max-width"]);else{let d=[this.rules[x]];for(let k=x-1;k>=i;k--){let y=this.rules[k],M=y.media,C=M.features["min-width"],$=M.features["max-width"];if(!C&&(!$||$.value!==m||y.hasWhere!==g))break;d.unshift(y)}for(let k=0;k<d.length;k++){let y=d[k];if(!y.media.features["min-width"]){if(y.order>=c)break;s=x-d.length+2+k}}}break}}}if(s===void 0)if(i===-1)s=l+1;else if(o!==-1)s=i+n(this.rules.slice(i),void 0,f=>f.media.features["max-width"]||f.media.features["min-width"]);else if(g){let f=i;for(;f<this.rules.length;f++){let p=this.rules[f];if(p.priority!==-1||!p.hasWhere||p.order>=c){s=f;break}}s===void 0&&(s=f)}else for(let f=i;f<=l;f++){s=f;let p=this.rules[f],x=p.media;if(p.priority!==-1||x.features["max-width"]||x.features["min-width"])break;if(p.hasWhere)s++;else if(p.order>=c)break}}else if(o===-1)if(g)s=this.rules.findIndex(i=>!i.hasWhere||i.media||i.priority!==-1||i.order>=c),s===-1&&(s=l+1);else{let i=0;for(;i<this.rules.length;i++){let f=this.rules[i];if(f.media||!f.hasWhere&&(f.order>=c||f.priority!==-1)){s=i;break}}s===void 0&&(s=i)}else s=n(this.rules,void 0,i=>i.media);if(this.rules.splice(s,0,r),this.ruleOfClass[h]=r,this.style){let i=this.style.sheet,f=0,p=x=>{let b=this.rules[x];if(b){if(!b.natives.length)return p(x-1);let S=b.natives[b.natives.length-1].cssRule;for(let R=0;R<i.cssRules.length;R++)if(i.cssRules[R]===S){f=R+1;break}}};p(s-1);for(let x=0;x<r.natives.length;)try{let b=r.natives[x];i.insertRule(b.text,f),b.cssRule=i.cssRules[f++],x++}catch(b){console.error(b),r.natives.splice(x,1)}}}}get text(){return this.rules.map(t=>t.text).join("")}},q=J;ne(q,"root"),ne(q,"instances",[]),ne(q,"refresh",t=>{for(let r of J.instances)r.refresh(t)});me&&(window.MasterCSS=q);new q(window.masterCSSConfig);})();
|
package/dist/methods/index.d.ts
CHANGED
package/dist/rule.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from './config';
|
|
1
|
+
import type { Config, Values } from './config';
|
|
2
2
|
import type { MasterCSS } from './css';
|
|
3
3
|
export declare class Rule {
|
|
4
4
|
readonly className: string;
|
|
@@ -66,6 +66,7 @@ export interface RuleConfig {
|
|
|
66
66
|
unit?: any;
|
|
67
67
|
prop?: string | false;
|
|
68
68
|
order?: number;
|
|
69
|
+
values?: Values;
|
|
69
70
|
analyzeToken?(token: string, values: Record<string, string | number>, globalValues: Record<string, string | number>): [
|
|
70
71
|
string,
|
|
71
72
|
Array<string | {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@master/css","scripts":{"build":"aron pack --extra-external @master/css-compiler","dev":"npm run build -- --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"A Virtual CSS language with enhanced syntax ~13KB","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/css"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":["./dist/polyfills/*","./src/polyfills/*","./polyfills/css-escape","./polyfills/*"],"main":"./dist/cjs/index.js","jsnext:main":"./dist/esm/index.js","browser":"./dist/index.browser.js","esnext":"./dist/esm/index.js","module":"./dist/esm/index.js","types":"./dist/index.d.ts","exports":{".":{"node":{"require":"./dist/cjs/index.node.js","import":"./dist/esm/index.node.js","types":"./dist/index.node.d.ts"},"require":"./dist/cjs/index.js","import":"./dist/esm/index.js","types":"./dist/index.d.ts"}},"files":["dist"],"bin":{"mcss":"./dist/cjs/bin/index.js","mastercss":"./dist/cjs/bin/index.js"},"publishConfig":{"access":"public"},"dependencies":{"@master/keyframes.css":"^2.0.0-beta.
|
|
1
|
+
{"name":"@master/css","scripts":{"build":"aron pack --extra-external @master/css-compiler","dev":"npm run build -- --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"A Virtual CSS language with enhanced syntax ~13KB","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/css"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":["./dist/polyfills/*","./src/polyfills/*","./polyfills/css-escape","./polyfills/*"],"main":"./dist/cjs/index.js","jsnext:main":"./dist/esm/index.js","browser":"./dist/index.browser.js","esnext":"./dist/esm/index.js","module":"./dist/esm/index.js","types":"./dist/index.d.ts","exports":{".":{"node":{"require":"./dist/cjs/index.node.js","import":"./dist/esm/index.node.js","types":"./dist/index.node.d.ts"},"require":"./dist/cjs/index.js","import":"./dist/esm/index.js","types":"./dist/index.d.ts"}},"files":["dist"],"bin":{"mcss":"./dist/cjs/bin/index.js","mastercss":"./dist/cjs/bin/index.js"},"publishConfig":{"access":"public"},"dependencies":{"@master/keyframes.css":"^2.0.0-beta.122","@master/normal.css":"^2.0.0-beta.122","@techor/log":"^1.1.0","chokidar":"^3.5.3","commander":"^10.0.0","esbuild":"^0.16.17","fast-glob":"^3.2.12","fs-extra":"^11.1.0"},"devDependencies":{"to-extend":"^1.5.2","ts-dedent":"^2.2.0"},"version":"2.0.0-beta.122"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var u=(i,o)=>{for(var l in o)a(i,l,{get:o[l],enumerable:!0})},x=(i,o,l,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of b(o))!g.call(i,t)&&t!==l&&a(i,t,{get:()=>o[t],enumerable:!(n=m(o,t))||n.enumerable});return i};var f=i=>x(a({},"__esModule",{value:!0}),i);var c={};u(c,{values:()=>d});module.exports=f(c);var r=require("../constants/box-underneath"),s=require("../constants/content-extrema"),e=require("../constants/sizing-values"),d={backgroundClip:r.BOX_UNDERNEATH,backgroundOrigin:r.BOX_UNDERNEATH,boxSizing:{content:"content-box",border:"border-box"},clipPath:{...r.BOX_UNDERNEATH,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"},flexDirection:{col:"column","col-reverse":"column-reverse"},fontFamily:{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"},fontWeight:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900},gridAutoColumns:s.CONTENT_EXTREMA,gridAutoRows:s.CONTENT_EXTREMA,gridTemplateColumns:s.CONTENT_EXTREMA,gridTemplateRows:s.CONTENT_EXTREMA,order:{first:-999999,last:999999},position:{abs:"absolute",rel:"relative"},shapeOutside:{...r.BOX_UNDERNEATH,margin:"margin-box"},transformBox:{...r.BOX_UNDERNEATH,fill:"fill-box",stroke:"stroke-box",view:"view-box"},width:e.SIZING_VALUES,minWidth:e.SIZING_VALUES,minHeight:e.SIZING_VALUES,maxWidth:e.SIZING_VALUES,maxHeight:e.SIZING_VALUES,height:e.SIZING_VALUES,flexBasis:e.SIZING_VALUES};0&&(module.exports={values});
|
package/dist/config/values.d.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
export declare const values: {
|
|
2
|
-
backgroundClip: {
|
|
3
|
-
content: string;
|
|
4
|
-
border: string;
|
|
5
|
-
padding: string;
|
|
6
|
-
};
|
|
7
|
-
backgroundOrigin: {
|
|
8
|
-
content: string;
|
|
9
|
-
border: string;
|
|
10
|
-
padding: string;
|
|
11
|
-
};
|
|
12
|
-
boxSizing: {
|
|
13
|
-
content: string;
|
|
14
|
-
border: string;
|
|
15
|
-
};
|
|
16
|
-
clipPath: {
|
|
17
|
-
margin: string;
|
|
18
|
-
fill: string;
|
|
19
|
-
stroke: string;
|
|
20
|
-
view: string;
|
|
21
|
-
content: string;
|
|
22
|
-
border: string;
|
|
23
|
-
padding: string;
|
|
24
|
-
};
|
|
25
|
-
flexDirection: {
|
|
26
|
-
col: string;
|
|
27
|
-
'col-reverse': string;
|
|
28
|
-
};
|
|
29
|
-
fontFamily: {
|
|
30
|
-
mono: string;
|
|
31
|
-
sans: string;
|
|
32
|
-
serif: string;
|
|
33
|
-
};
|
|
34
|
-
fontWeight: {
|
|
35
|
-
thin: number;
|
|
36
|
-
extralight: number;
|
|
37
|
-
light: number;
|
|
38
|
-
regular: number;
|
|
39
|
-
medium: number;
|
|
40
|
-
semibold: number;
|
|
41
|
-
bold: number;
|
|
42
|
-
extrabold: number;
|
|
43
|
-
heavy: number;
|
|
44
|
-
};
|
|
45
|
-
gridAutoColumns: {
|
|
46
|
-
min: string;
|
|
47
|
-
max: string;
|
|
48
|
-
};
|
|
49
|
-
gridAutoRows: {
|
|
50
|
-
min: string;
|
|
51
|
-
max: string;
|
|
52
|
-
};
|
|
53
|
-
gridTemplateColumns: {
|
|
54
|
-
min: string;
|
|
55
|
-
max: string;
|
|
56
|
-
};
|
|
57
|
-
gridTemplateRows: {
|
|
58
|
-
min: string;
|
|
59
|
-
max: string;
|
|
60
|
-
};
|
|
61
|
-
order: {
|
|
62
|
-
first: number;
|
|
63
|
-
last: number;
|
|
64
|
-
};
|
|
65
|
-
position: {
|
|
66
|
-
abs: string;
|
|
67
|
-
rel: string;
|
|
68
|
-
};
|
|
69
|
-
shapeOutside: {
|
|
70
|
-
margin: string;
|
|
71
|
-
content: string;
|
|
72
|
-
border: string;
|
|
73
|
-
padding: string;
|
|
74
|
-
};
|
|
75
|
-
transformBox: {
|
|
76
|
-
fill: string;
|
|
77
|
-
stroke: string;
|
|
78
|
-
view: string;
|
|
79
|
-
content: string;
|
|
80
|
-
border: string;
|
|
81
|
-
padding: string;
|
|
82
|
-
};
|
|
83
|
-
width: {
|
|
84
|
-
full: string;
|
|
85
|
-
fit: string;
|
|
86
|
-
max: string;
|
|
87
|
-
min: string;
|
|
88
|
-
};
|
|
89
|
-
minWidth: {
|
|
90
|
-
full: string;
|
|
91
|
-
fit: string;
|
|
92
|
-
max: string;
|
|
93
|
-
min: string;
|
|
94
|
-
};
|
|
95
|
-
minHeight: {
|
|
96
|
-
full: string;
|
|
97
|
-
fit: string;
|
|
98
|
-
max: string;
|
|
99
|
-
min: string;
|
|
100
|
-
};
|
|
101
|
-
maxWidth: {
|
|
102
|
-
full: string;
|
|
103
|
-
fit: string;
|
|
104
|
-
max: string;
|
|
105
|
-
min: string;
|
|
106
|
-
};
|
|
107
|
-
maxHeight: {
|
|
108
|
-
full: string;
|
|
109
|
-
fit: string;
|
|
110
|
-
max: string;
|
|
111
|
-
min: string;
|
|
112
|
-
};
|
|
113
|
-
height: {
|
|
114
|
-
full: string;
|
|
115
|
-
fit: string;
|
|
116
|
-
max: string;
|
|
117
|
-
min: string;
|
|
118
|
-
};
|
|
119
|
-
flexBasis: {
|
|
120
|
-
full: string;
|
|
121
|
-
fit: string;
|
|
122
|
-
max: string;
|
|
123
|
-
min: string;
|
|
124
|
-
};
|
|
125
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{BOX_UNDERNEATH as e}from"../constants/box-underneath";import{CONTENT_EXTREMA as i}from"../constants/content-extrema";import{SIZING_VALUES as o}from"../constants/sizing-values";var l={backgroundClip:e,backgroundOrigin:e,boxSizing:{content:"content-box",border:"border-box"},clipPath:{...e,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"},flexDirection:{col:"column","col-reverse":"column-reverse"},fontFamily:{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"},fontWeight:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900},gridAutoColumns:i,gridAutoRows:i,gridTemplateColumns:i,gridTemplateRows:i,order:{first:-999999,last:999999},position:{abs:"absolute",rel:"relative"},shapeOutside:{...e,margin:"margin-box"},transformBox:{...e,fill:"fill-box",stroke:"stroke-box",view:"view-box"},width:o,minWidth:o,minHeight:o,maxWidth:o,maxHeight:o,height:o,flexBasis:o};export{l as values};
|