@master/css 2.0.0-beta.130 → 2.0.0-beta.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/config/index.js +1 -1
- package/dist/cjs/config/keyframes.js +1 -0
- package/dist/cjs/config/precedence.js +1 -0
- package/dist/cjs/config/rules.js +1 -1
- package/dist/cjs/css.js +1 -1
- package/dist/cjs/methods/render-into-html.js +1 -1
- package/dist/cjs/rule.js +1 -1
- package/dist/config/index.d.ts +5 -1
- package/dist/config/keyframes.d.ts +109 -0
- package/dist/config/precedence.d.ts +1 -0
- package/dist/config/rules.d.ts +1 -1
- package/dist/css.d.ts +7 -2
- package/dist/esm/config/index.mjs +1 -1
- package/dist/esm/config/keyframes.mjs +1 -0
- package/dist/esm/config/precedence.mjs +1 -0
- package/dist/esm/config/rules.mjs +1 -1
- package/dist/esm/css.mjs +1 -1
- package/dist/esm/methods/render-into-html.mjs +1 -1
- package/dist/esm/rule.mjs +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +9 -9
- package/dist/rule.d.ts +8 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{START_SYMBOL as f}from"../constants/start-symbol.mjs";import{BOX_UNDERNEATH as v}from"../constants/box-underneath.mjs";import{CONTENT_EXTREMA as p}from"../constants/content-extrema.mjs";import{SIZING_VALUES as g}from"../constants/sizing-values.mjs";import{cssEscape as $}from"../utils/css-escape.mjs";var T={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},r=(o,i)=>{let a=i.indexOf(":");if(a!==-1){o in t||(t[o]={});let c=t[o],h=i.slice(0,a);h in c||(c[h]=i.slice(a+1))}},l=o=>{let i=(a,c)=>{let h=c.slice($(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)r(a,y)};if(this.theme){let a=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);a&&i(this.theme,a.text)}else for(let a of o.natives)i(a.theme,a.text)},s=[],n="",u=()=>{n&&(s.push(n.replace(/ /g,"")),n="")},d=1;(function o(i){for(;d<e.length;d++){let a=e[d];if(!i){if(a===";"){u();continue}if(a==="}")break}if(n+=a,i===a){if(i==="'"||i==='"'){let c=0;for(let h=n.length-2;n[h]==="\\";h--)c++;if(c%2)continue}break}else a in f&&i!=="'"&&i!=='"'&&(d++,o(f[a]))}})(void 0),u();for(let o of s){let i=this.css.create(o);if(Array.isArray(i))for(let a of i)l(a);else i?l(i):r(this.theme??"",o)}let m={};for(let o in t)for(let[i,a]of Object.entries(t[o]))i in m?m[i][o]=a:m[i]={[o]:a};return console.log(m),m}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(e){let t={};switch(e){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]="auto";break;case"antialiased":t["-webkit-font-smoothing"]="antialiased",t["-moz-osx-font-smoothing"]="grayscale";break}return t}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return x.call(this,e+t)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return x.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:g,unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:g},height:{match:"^h:.",unit:"rem",native:!0,values:g},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:g},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:g},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e]},declare(e){let[t,r]=e.split(" x ");return{width:t,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"min-width":t,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"max-width":t,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(e,t){return{[this.prefix.slice(0,-1)]:e+t}}},lines:{match:"^lines:.",declare(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:g},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:g},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(e,t){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e+t};case"y":return{"overflow-y":e+t}}return{overflow:e+t}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(e,t){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e+t};case"y":return{"overscroll-behavior-y":e+t};default:return{"overscroll-behavior":e+t}}}},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{...v,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(e,t){if(this.prefix){let l="",s=this.prefix.split("-");if(s.length>1)for(let n=1;n<s.length-1;n++)l+=s[n][0];else l=this.prefix.slice(1,-1);switch(l){case"t":return{"border-top-left-radius":e+t,"border-top-right-radius":e+t};case"tl":case"lt":return{"border-top-left-radius":e+t};case"rt":case"tr":return{"border-top-right-radius":e+t};case"b":return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t};case"bl":case"lb":return{"border-bottom-left-radius":e+t};case"br":case"rb":return{"border-bottom-right-radius":e+t};case"l":return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t};case"r":return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t};default:return{"border-radius":e+t}}}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+t}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(e,t){return b(this.prefix,e+t,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(e,t){return b(this.prefix,e+t,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},values:v},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:v},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:p},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:p,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,values:p},gridTemplateRows:{native:!0,values:p},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(e,t){switch(this.prefix[4]){case"x":return{"column-gap":e+t};case"y":return{"row-gap":e+t};default:return{gap:e+t}}}},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e+t,"scroll-margin-right":e+t};case"y":return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t};case"l":return{"scroll-margin-left":e+t};case"r":return{"scroll-margin-right":e+t};case"t":return{"scroll-margin-top":e+t};case"b":return{"scroll-margin-bottom":e+t}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e+t,"scroll-padding-right":e+t};case"y":return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t};case"l":return{"scroll-padding-left":e+t};case"r":return{"scroll-padding-right":e+t};case"t":return{"scroll-padding-top":e+t};case"b":return{"scroll-padding-bottom":e+t}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{...v,margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{...v,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}};function x(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",l=r+"-left",s=r+"-right",n=r+"-top",u=r+"-bottom";switch(this.prefix[1]){case"x":return{[l]:e,[s]:e};case"y":return{[n]:e,[u]:e};case"l":return{[l]:e};case"r":return{[s]:e};case"t":return{[n]:e};case"b":return{[u]:e};default:return{[r]:e}}}function b(e,t,r=""){let l="border-";r&&(r="-"+r);let s=/^b(order)?-?(.)?/.exec(e)[2],n=l+"left"+r,u=l+"right"+r,d=l+"top"+r,m=l+"bottom"+r;switch(s){case"x":return{[n]:t,[u]:t};case"y":return{[d]:t,[m]:t};case"l":return{[n]:t};case"r":return{[u]:t};case"t":return{[d]:t};case"b":return{[m]:t};default:return{["border"+r]:t}}}export{T as rules};
|
|
1
|
+
import{START_SYMBOL as b}from"../constants/start-symbol.mjs";import{BOX_UNDERNEATH as v}from"../constants/box-underneath.mjs";import{CONTENT_EXTREMA as p}from"../constants/content-extrema.mjs";import{SIZING_VALUES as g}from"../constants/sizing-values.mjs";import{cssEscape as C}from"../utils/css-escape.mjs";var A={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},r=(i,a)=>{let n=a.indexOf(":");if(n!==-1){i in t||(t[i]={});let d=t[i],h=a.slice(0,n);h in d||(d[h]=a.slice(n+1))}},s=i=>{let a=(n,d)=>{let h=d.slice(C(i.className).length).match(/\{(.*)\}/)[1].split(";");for(let w of h)r(n,w)};if(this.theme){let n=i.natives.find(d=>d.theme===this.theme)??i.natives.find(d=>!d.theme);n&&a(this.theme,n.text)}else for(let n of i.natives)a(n.theme,n.text)},l=[],o="",c=()=>{o&&(l.push(o.replace(/ /g,"")),o="")},m=1;(function i(a){for(;m<e.length;m++){let n=e[m];if(!a){if(n===";"){c();continue}if(n==="}")break}if(o+=n,a===n){if(a==="'"||a==='"'){let d=0;for(let h=o.length-2;o[h]==="\\";h--)d++;if(d%2)continue}break}else n in b&&a!=="'"&&a!=='"'&&(m++,i(b[n]))}})(void 0),c();for(let i of l){let a=this.css.create(i);if(Array.isArray(a))for(let n of a)s(n);else a?s(a):r(this.theme??"",i)}let u={};for(let i in t)for(let[a,n]of Object.entries(t[i]))a in u?u[a][i]=n:u[a]={[i]:n};return u}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(e){let t={};switch(e){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]="auto";break;case"antialiased":t["-webkit-font-smoothing"]="antialiased",t["-moz-osx-font-smoothing"]="grayscale";break}return t}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return $.call(this,e+t)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return $.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:g,unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:g},height:{match:"^h:.",unit:"rem",native:!0,values:g},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:g},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:g},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e]},declare(e){let[t,r]=e.split(" x ");return{width:t,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"min-width":t,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"max-width":t,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(e,t){return{[this.prefix.slice(0,-1)]:e+t}}},lines:{match:"^lines:.",declare(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:g},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:g},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(e,t){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e+t};case"y":return{"overflow-y":e+t}}return{overflow:e+t}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(e,t){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e+t};case"y":return{"overscroll-behavior-y":e+t};default:return{"overscroll-behavior":e+t}}}},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{...v,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return x.call(this,e)},delete(e){return y.call(this,e)},insert(){return k.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return x.call(this,e)},delete(e){return y.call(this,e)},insert(){return k.call(this)}},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return f(this.prefix,e+t,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(e,t){if(this.prefix){let s="",l=this.prefix.split("-");if(l.length>1)for(let o=1;o<l.length-1;o++)s+=l[o][0];else s=this.prefix.slice(1,-1);switch(s){case"t":return{"border-top-left-radius":e+t,"border-top-right-radius":e+t};case"tl":case"lt":return{"border-top-left-radius":e+t};case"rt":case"tr":return{"border-top-right-radius":e+t};case"b":return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t};case"bl":case"lb":return{"border-bottom-left-radius":e+t};case"br":case"rb":return{"border-bottom-right-radius":e+t};case"l":return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t};case"r":return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t};default:return{"border-radius":e+t}}}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+t}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(e,t){return f(this.prefix,e+t,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(e,t){return f(this.prefix,e+t,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(e,t){return f(this.prefix,e+t)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},values:v},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:v},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:p},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:p,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:p},gridTemplateRows:{native:!0,unit:"rem",values:p},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(e,t){switch(this.prefix[4]){case"x":return{"column-gap":e+t};case"y":return{"row-gap":e+t};default:return{gap:e+t}}}},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e+t,"scroll-margin-right":e+t};case"y":return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t};case"l":return{"scroll-margin-left":e+t};case"r":return{"scroll-margin-right":e+t};case"t":return{"scroll-margin-top":e+t};case"b":return{"scroll-margin-bottom":e+t}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e+t,"scroll-padding-right":e+t};case"y":return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t};case"l":return{"scroll-padding-left":e+t};case"r":return{"scroll-padding-right":e+t};case"t":return{"scroll-padding-top":e+t};case"b":return{"scroll-padding-bottom":e+t}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{...v,margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{...v,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}};function x(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(r=>r in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function y(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let r=this.css.keyframes[t];if(!--r.count){let s=e.natives.indexOf(r.native);this.css.style.sheet.deleteRule(s),e.natives.splice(s,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function k(){if(this.keyframeNames){let{config:e,keyframes:t,style:r,rules:s}=this.css,l=r?.sheet;for(let o of this.keyframeNames)if(o in t)t[o].count++;else{let c={text:`@keyframes ${o} {`+Object.entries(e.keyframes[o]).map(([u,i])=>`${u} {${Object.entries(i).map(([a,n])=>a+": "+n).join(";")}}`).join(",")+"}",theme:""},m;if(Object.keys(t).length?(m=s[0]).natives.push(c):s.splice(0,0,m={natives:[c],get text(){return this.natives.map(u=>u.text).join("")}}),l){let u;for(let i=0;i<l.cssRules.length;i++){let a=l.cssRules[i];if(a.constructor.name!=="CSSKeyframesRule")break;if(a.name===o){u=a;break}}if(u)c.cssRule=u;else{let i=m.natives.length-1;l.insertRule(c.text,i),c.cssRule=l.cssRules[i]}}t[o]={native:c,count:1}}}}function $(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",s=r+"-left",l=r+"-right",o=r+"-top",c=r+"-bottom";switch(this.prefix[1]){case"x":return{[s]:e,[l]:e};case"y":return{[o]:e,[c]:e};case"l":return{[s]:e};case"r":return{[l]:e};case"t":return{[o]:e};case"b":return{[c]:e};default:return{[r]:e}}}function f(e,t,r=""){let s="border-";r&&(r="-"+r);let l=/^b(order)?-?(.)?/.exec(e)[2],o=s+"left"+r,c=s+"right"+r,m=s+"top"+r,u=s+"bottom"+r;switch(l){case"x":return{[o]:t,[c]:t};case"y":return{[m]:t,[u]:t};case"l":return{[o]:t};case"r":return{[c]:t};case"t":return{[m]:t};case"b":return{[u]:t};default:return{["border"+r]:t}}}export{A as rules};
|
package/dist/esm/css.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var V=Object.defineProperty;var D=(C,e,t)=>e in C?V(C,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):C[e]=t;var T=(C,e,t)=>(D(C,typeof e!="symbol"?e+"":e,t),t);function N(C){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&C instanceof e||C instanceof Date||C instanceof RegExp)}function L(C){if(typeof Buffer<"u"&&Buffer&&C instanceof Buffer){let e=Buffer.alloc(C.length);return C.copy(e),e}else{if(C instanceof Date)return new Date(C.getTime());if(C instanceof RegExp)return new RegExp(C);throw new Error("Unexpected situation")}}function I(C){let e=[];return C.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=I(t):N(t)?e[s]=L(t):e[s]=j({},t):e[s]=t}),e}function F(C,e){return e==="__proto__"?void 0:C[e]}function j(...C){let e={},t,s;return C.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(b){if(s=F(e,b),t=F(u,b),t!==e)if(typeof t!="object"||t===null){e[b]=t;return}else if(Array.isArray(t)){e[b]=I(t);return}else if(N(t)){e[b]=L(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[b]=j({},t);return}else{e[b]=j(s,t);return}})}),e}import{Rule as Q}from"./rule.mjs";import{config as S}from"./config/index.mjs";import{rgbToHex as z}from"./utils/rgb-to-hex.mjs";import{SELECTOR_SYMBOLS as H}from"./constants/selector-symbols.mjs";var O=typeof window<"u",A=class{constructor(e){this.config=e;this.config?.override||(this.config=j(S,e)),this.cache(),O&&this.config.observe&&this.observe(document),A.instances.push(this)}rules=[];ruleBy={};countBy={};e=O?new MutationObserver(e=>{let t={},s=[],u=[],b=[],M=(l,i)=>{i?l.classList.forEach(x):l.classList.forEach(y);let c=l.children;for(let m=0;m<c.length;m++){let d=c[m];d.classList&&(u.push(d),M(d,i))}},y=l=>{l in t?t[l]++:t[l]=1},x=l=>{l in t?t[l]--:l in this.countBy&&(t[l]=-1)},B=(l,i)=>{for(let c=0;c<l.length;c++){let m=l[c];m.classList&&!u.includes(m)&&!b.includes(m)&&(m.isConnected!==i?(u.push(m),M(m,i)):b.push(m))}};for(let l=0;l<e.length;l++){let i=e[l],{addedNodes:c,removedNodes:m,type:d,target:h}=i;if(d==="attributes"){if(s.find(v=>v.target===h))continue;s.push(i)}else B(c,!1),(!h.isConnected||!u.includes(h))&&B(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:l,target:i}of s){let c=u.includes(i),m=i.classList,d=l?l.split(" "):[];if(c){if(i.isConnected)continue;for(let h of d)m.contains(h)||x(h)}else if(i.isConnected){m.forEach(h=>{d.includes(h)||y(h)});for(let h of d)m.contains(h)||x(h)}}for(let l in t){let i=t[l],c=(this.countBy[l]||0)+i;c===0?(delete this.countBy[l],this.delete(l)):(l in this.countBy||this.insert(l),this.countBy[l]=c)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:e,classes:t,selectors:s,themes:u,colors:b,values:M,breakpoints:y,mediaQueries:x,rules:B}=this.config;function l(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function i(r,o,n="",f={}){let a=R=>R?(n?n+"-":"")+R:n,g=Object.entries(r),p=[],E=[];for(let R of g){let W=R[1];(typeof W=="object"&&!Array.isArray(W)?p:E).push(R)}for(let[R,W]of p)i(W,o,a(R),f);if(o&&n)E.length&&(f[n]=E.reduce((R,[W,$])=>(R[W]=$,R),{}));else for(let[R,W]of E)f[a(R)]=W;return f}if(e)for(let[r,o]of Object.entries(i(e,!0)))this.semantics.push([new RegExp("^"+l(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,o]]);if(s)for(let[r,o]of Object.entries(i(s,!1))){let n=new RegExp(l(r)+"(?![a-z-])");for(let f of Array.isArray(o)?o:[o]){let a=f.match(/^::-[a-z]+-/m)?.[0]??"",g=this.selectors[a];g||(g=this.selectors[a]=[]);let p=g.find(([E])=>E===n);p||(p=[n,[]],g.push(p)),p[1].push(f)}}M&&(this.globalValues=i(M,!1)),y&&(this.breakpoints=i(y,!1)),x&&(this.mediaQueries=i(x,!1));let c=t?i(t,!1):{},m=u&&!Array.isArray(u)?Object.entries(u).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:n}])=>(r[o]=i(n,!1),r),{}):{},d=[...Object.keys(c),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],h=r=>{if(r in this.classes)return;let o=this.classes[r]=[],n=(f,a)=>{if(!a)return;let g=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of g){let E=R=>{R in this.themeAffectedClassesBy?f in this.themeAffectedClassesBy[R]?this.themeAffectedClassesBy[R][f].push(r):this.themeAffectedClassesBy[R][f]=[r]:this.themeAffectedClassesBy[R]={[f]:[r]},o.includes(R)||o.push(R)};if(d.includes(p)){h(p);for(let R of this.classes[p])E(R)}else E(p)}};n("",c?.[r]);for(let[f,a]of Object.entries(m))n(f,a?.[r])};for(let r of d)h(r);for(let r in this.themeAffectedClassesBy){let o=this.classesBy[r]=[];for(let n of Object.values(this.themeAffectedClassesBy[r]))for(let f of n)o.includes(f)||o.push(f)}let v=(r,o)=>{if(!o)return;let n=i(o,!0);for(let[f,a]of Object.entries(n)){let g=typeof a=="string"?{"":a}:a;for(let[p,E]of Object.entries(g)){let R=f+(p?"-"+p:"");R in this.colorThemesMap?this.colorThemesMap[R][r]=E:this.colorThemesMap[R]={[r]:E}}}for(let f in o)this.colorNames.includes(f)||this.colorNames.push(f)};if(v("",b),u)if(Array.isArray(u))this.themeNames.push(...u);else for(let r in u){let o=u[r];v(r,o.colors),this.themeNames.push(r)}let w=r=>{for(let[o,n]of Object.entries(this.colorThemesMap))for(let[f,a]of Object.entries(n))a.startsWith("#")||r(o,n,f,a)};if(w((r,o,n,f)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(f);if(a){let g="#"+z(+a[1],+a[2],+a[3]);a[4]&&(g+=Math.round(255*+a[4]).toString(16)),o[n]=g}}),w((r,o,n,f)=>{let[a,g]=f.split("/"),p=this.colorThemesMap[a];if(p){let E=(n?p[n]:void 0)??p[""];o[n]=g?E.slice(0,7)+Math.round(255*+g).toString(16):E}else console.warn(`\`${f}\` doesn't exist in the extended config \`.colors\``),delete o[n],Object.keys(o).length||delete this.colorThemesMap[r]}),B)for(let r in B){let o=B[r],{native:n,values:f,colored:a}=o,g=o.match;if(o.id=r,o.native=n===!0?r.replace(/(?!^)[A-Z]/g,p=>"-"+p).toLowerCase():void 0,f&&(this.values[r]=i(f,!1)),g){let p=Object.keys(this.values[r]??{});g.includes("$values")&&(g=p.length?g.replace(/\$values/,p.join("|")):g.replace(/(?:\|)?\$values/,"")),a&&g.includes("$colors")&&(g=this.colorNames.length?g.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):g.replace(/(?:\|)?\$colors/,"")),this.matches[r]=new RegExp(g)}}}observe(e,t={subtree:!0,childList:!0}){if(O&&e){this.root=e;let s=e===document;s&&(A.root=this),this.host=s?document.documentElement:root.host;let u=s?document.head:e,b=s?document.styleSheets:e.styleSheets;for(let y of b){let{title:x,href:B,ownerNode:l}=y;(x==="master"||B&&B.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(B))&&(this.style=l)}if(this.style)for(let y=0;y<this.style.sheet.cssRules.length;y++){let x=l=>{if(l.selectorText){let c=l.selectorText.split(", ")[0].split(" ");for(let m=0;m<c.length;m++){let d=c[m];if(d[0]==="."){let h=d.slice(1),v="";for(let w=0;w<h.length;w++){let r=h[w],o=h[w+1];if(r==="\\"){if(w++,o!=="\\"){v+=o;continue}}else if(H.includes(r))break;v+=r}if(!(v in this.ruleBy)&&!(v in this.classes)){let w=this.create(v)[0];if(w)return w}}}}else if(l.cssRules)for(let i=0;i<l.cssRules.length;i++){let c=x(l.cssRules[i]);if(c)return c}},B=x(this.style.sheet.cssRules[y]);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let l=0;l<B.natives.length;l++)B.natives[l].cssRule=this.style.sheet.cssRules[y+l];y+=B.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let y=u.querySelector('link[rel="styleSheet"], style');y?y.before(this.style):u.append(this.style)}let M=y=>{y.forEach(x=>{x in this.countBy?this.countBy[x]++:(this.countBy[x]=1,this.insert(x))})};M(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(y=>M(y.classList)),this.e.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleBy={},this.countBy={},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}match(e){for(let t in this.config.rules){let s=this.config.rules[t],u=this.matches[t],{symbol:b,native:M}=s;if(u&&u.test(e))return{origin:"match",config:s};if(b&&e.startsWith(b))return{origin:"symbol",config:s};if(M&&e.startsWith(M+":"))return{origin:"match",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.ruleBy)return this.ruleBy[s];let u=this.match(s);if(u)return new Q(s,u,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=j(S,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.ruleBy={};for(let s in this.countBy)this.insert(s)}destroy(){let e=A.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style.sheet,s=u=>{let b=this.ruleBy[u];if(!(!b||u in this.classesBy&&this.classesBy[u].some(M=>M in this.countBy))){if(b.natives.length){let M=b.natives[0];for(let y=0;y<t.cssRules.length;y++)if(t.cssRules[y]===M.cssRule){for(let B=0;B<b.natives.length;B++)t.deleteRule(y);this.rules.splice(this.rules.indexOf(b),1);break}}delete this.ruleBy[u],b.config.delete&&b.config.delete.call(this,u)}};if(e in this.classes){for(let u of this.classes[e])u in this.countBy||s(u);delete this.ruleBy[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.ruleBy[t.className])continue;let s,u=this.rules.length-1,{media:b,order:M,priority:y,hasWhere:x,className:B}=t,l=(i,c,m,d)=>{let h=0,v;c&&(h=i.findIndex(c)),m&&(v=i.findIndex(m)),h===-1&&(h=i.length),(v===void 0||v===-1)&&(v=i.length);let w=i.slice(h,v);for(let r=0;r<w.length;r++){let o=w[r];if(!(o.priority===-1||d&&d(o))&&(o.priority<y||o.priority===y&&(x&&!o.hasWhere||o.order>=M)))return h+r}return h+w.length};if(b){let i=this.rules.findIndex(c=>c.media);if(i!==-1){let c=b.features["max-width"],m=b.features["min-width"];if(c&&m){let d=c.value-m.value;for(let h=u;h>=i;h--){s=h;let v=this.rules[h],w=v.media,r=w.features["max-width"],o=w.features["min-width"];if(!r||!o){s++;break}let n=r.value-o.value;if(n===d){if(x!==v.hasWhere)continue;if(y!==-1){let f=[this.rules[h]];for(let a=h-1;a>=i;a--){let g=this.rules[a];if(g.hasWhere!==x)break;let p=g.media,E=p.features["max-width"],R=p.features["min-width"];if(!E||!R||E.value-R.value!==n)break;f.unshift(this.rules[a])}s=l(this.rules,a=>a.media&&a.priority!==-1&&a.media.features["min-width"]&&a.media.features["max-width"])}break}else if(n>d)break}}else if(m)for(let d=i;d<=u;d++){s=d;let h=this.rules[d],v=h.media,w=v.features["max-width"],r=v.features["min-width"];if(w){if(r)break;continue}let o=r?.value;if(o===m.value){if(!x&&h.hasWhere){s++;continue}if(y!==-1)s=l(this.rules,n=>n.media,n=>n.media&&n.priority!==-1&&n.media.features["min-width"]&&n.media.features["max-width"],n=>!n.media.features["min-width"]&&!n.media.features["max-width"]);else for(let n=d;n<=u;n++){let f=this.rules[n],a=f.media,g=a.features["min-width"];if(!a.features["max-width"]){if(f.hasWhere!==x||g.value!==o||f.order>=M)break;s=n+1}}break}else{if(o>m.value)break;s++}}else if(c)for(let d=u;d>=i;d--){s=d;let h=this.rules[d],v=h.media,w=v.features["max-width"];if(v.features["min-width"])continue;let o=w?.value;if(!o||o>c.value){s++;break}else if(o===c.value){if(x&&!h.hasWhere)continue;if(y!==-1)s=l(this.rules,n=>n.media,n=>n.media&&n.priority!==-1&&n.media.features["min-width"]&&n.media.features["max-width"],n=>!n.media.features["min-width"]&&!n.media.features["max-width"]);else{let n=[this.rules[d]];for(let f=d-1;f>=i;f--){let a=this.rules[f],g=a.media,p=g.features["min-width"],E=g.features["max-width"];if(!p&&(!E||E.value!==o||a.hasWhere!==x))break;n.unshift(a)}for(let f=0;f<n.length;f++){let a=n[f];if(!a.media.features["min-width"]){if(a.order>=M)break;s=d-n.length+2+f}}}break}}}if(s===void 0)if(i===-1)s=u+1;else if(y!==-1)s=i+l(this.rules.slice(i),void 0,c=>c.media.features["max-width"]||c.media.features["min-width"]);else if(x){let c=i;for(;c<this.rules.length;c++){let m=this.rules[c];if(m.priority!==-1||!m.hasWhere||m.order>=M){s=c;break}}s===void 0&&(s=c)}else for(let c=i;c<=u;c++){s=c;let m=this.rules[c],d=m.media;if(m.priority!==-1||d.features["max-width"]||d.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=M)break}}else if(y===-1)if(x)s=this.rules.findIndex(i=>!i.hasWhere||i.media||i.priority!==-1||i.order>=M),s===-1&&(s=u+1);else{let i=0;for(;i<this.rules.length;i++){let c=this.rules[i];if(c.media||!c.hasWhere&&(c.order>=M||c.priority!==-1)){s=i;break}}s===void 0&&(s=i)}else s=l(this.rules,void 0,i=>i.media);if(this.rules.splice(s,0,t),this.ruleBy[B]=t,this.style){let i=this.style.sheet,c=0,m=d=>{let h=this.rules[d];if(h){if(!h.natives.length)return m(d-1);let v=h.natives[h.natives.length-1].cssRule;for(let w=0;w<i.cssRules.length;w++)if(i.cssRules[w]===v){c=w+1;break}}};m(s-1);for(let d=0;d<t.natives.length;)try{let h=t.natives[d];i.insertRule(h.text,c),h.cssRule=i.cssRules[c++],d++}catch(h){console.error(h),t.natives.splice(d,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},k=A;T(k,"root"),T(k,"config",S),T(k,"instances",[]),T(k,"refresh",e=>{for(let t of A.instances)t.refresh(e)});O&&(window.MasterCSS=k);export{k as MasterCSS};
|
|
1
|
+
var D=Object.defineProperty;var H=(x,e,t)=>e in x?D(x,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):x[e]=t;var S=(x,e,t)=>(H(x,typeof e!="symbol"?e+"":e,t),t);function L(x){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&x instanceof e||x instanceof Date||x instanceof RegExp)}function F(x){if(typeof Buffer<"u"&&Buffer&&x instanceof Buffer){let e=Buffer.alloc(x.length);return x.copy(e),e}else{if(x instanceof Date)return new Date(x.getTime());if(x instanceof RegExp)return new RegExp(x);throw new Error("Unexpected situation")}}function I(x){let e=[];return x.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=I(t):L(t)?e[s]=F(t):e[s]=j({},t):e[s]=t}),e}function N(x,e){return e==="__proto__"?void 0:x[e]}function j(...x){let e={},t,s;return x.forEach(function(f){typeof f!="object"||f===null||Array.isArray(f)||Object.keys(f).forEach(function(p){if(s=N(e,p),t=N(f,p),t!==e)if(typeof t!="object"||t===null){e[p]=t;return}else if(Array.isArray(t)){e[p]=I(t);return}else if(L(t)){e[p]=F(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[p]=j({},t);return}else{e[p]=j(s,t);return}})}),e}import{Rule as Q}from"./rule.mjs";import{config as O}from"./config/index.mjs";import{rgbToHex as z}from"./utils/rgb-to-hex.mjs";import{SELECTOR_SYMBOLS as _}from"./constants/selector-symbols.mjs";var T=typeof window<"u",$=()=>{let x=document.createElement("style");return x.id="master",x.setAttribute("blocking","render"),x},A=class{constructor(e){this.config=e;this.config?.override||(this.config=j(O,e)),this.cache(),T&&this.config.observe&&this.observe(document),A.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer=T?new MutationObserver(e=>{let t={},s=[],f=[],p=[],C=(a,i)=>{i?a.classList.forEach(R):a.classList.forEach(y);let c=a.children;for(let u=0;u<c.length;u++){let d=c[u];d.classList&&(f.push(d),C(d,i))}},y=a=>{a in t?t[a]++:t[a]=1},R=a=>{a in t?t[a]--:a in this.countBy&&(t[a]=-1)},k=(a,i)=>{for(let c=0;c<a.length;c++){let u=a[c];u.classList&&!f.includes(u)&&!p.includes(u)&&(u.isConnected!==i?(f.push(u),C(u,i)):p.push(u))}};for(let a=0;a<e.length;a++){let i=e[a],{addedNodes:c,removedNodes:u,type:d,target:h}=i;if(d==="attributes"){if(s.find(w=>w.target===h))continue;s.push(i)}else k(c,!1),(!h.isConnected||!f.includes(h))&&k(u,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:a,target:i}of s){let c=f.includes(i),u=i.classList,d=a?a.split(" "):[];if(c){if(i.isConnected)continue;for(let h of d)u.contains(h)||R(h)}else if(i.isConnected){u.forEach(h=>{d.includes(h)||y(h)});for(let h of d)u.contains(h)||R(h)}}for(let a in t){let i=t[a],c=(this.countBy[a]||0)+i;c===0?(delete this.countBy[a],this.delete(a)):(a in this.countBy||this.insert(a),this.countBy[a]=c)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:e,classes:t,selectors:s,themes:f,colors:p,values:C,breakpoints:y,mediaQueries:R,rules:k}=this.config;function a(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function i(n,o,r="",m={}){let l=v=>v?(r?r+"-":"")+v:r,g=Object.entries(n),b=[],B=[];for(let v of g){let E=v[1];(typeof E=="object"&&!Array.isArray(E)?b:B).push(v)}for(let[v,E]of b)i(E,o,l(v),m);if(o&&r)B.length&&(m[r]=B.reduce((v,[E,V])=>(v[E]=V,v),{}));else for(let[v,E]of B)m[l(v)]=E;return m}if(e)for(let[n,o]of Object.entries(i(e,!0)))this.semantics.push([new RegExp("^"+a(n)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[n,o]]);if(s)for(let[n,o]of Object.entries(i(s,!1))){let r=new RegExp(a(n)+"(?![a-z-])");for(let m of Array.isArray(o)?o:[o]){let l=m.match(/^::-[a-z]+-/m)?.[0]??"",g=this.selectors[l];g||(g=this.selectors[l]=[]);let b=g.find(([B])=>B===r);b||(b=[r,[]],g.push(b)),b[1].push(m)}}C&&(this.globalValues=i(C,!1)),y&&(this.breakpoints=i(y,!1)),R&&(this.mediaQueries=i(R,!1));let c=t?i(t,!1):{},u=f&&!Array.isArray(f)?Object.entries(f).filter(([,{classes:n}])=>n).reduce((n,[o,{classes:r}])=>(n[o]=i(r,!1),n),{}):{},d=[...Object.keys(c),...Object.entries(u).flatMap(([n,o])=>Object.keys(o))],h=n=>{if(n in this.classes)return;let o=this.classes[n]=[],r=(m,l)=>{if(!l)return;let g=Array.isArray(l)?l:l.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let b of g){let B=v=>{v in this.themeAffectedClassesBy?m in this.themeAffectedClassesBy[v]?this.themeAffectedClassesBy[v][m].push(n):this.themeAffectedClassesBy[v][m]=[n]:this.themeAffectedClassesBy[v]={[m]:[n]},o.includes(v)||o.push(v)};if(d.includes(b)){h(b);for(let v of this.classes[b])B(v)}else B(b)}};r("",c?.[n]);for(let[m,l]of Object.entries(u))r(m,l?.[n])};for(let n of d)h(n);for(let n in this.themeAffectedClassesBy){let o=this.classesBy[n]=[];for(let r of Object.values(this.themeAffectedClassesBy[n]))for(let m of r)o.includes(m)||o.push(m)}let w=(n,o)=>{if(!o)return;let r=i(o,!0);for(let[m,l]of Object.entries(r)){let g=typeof l=="string"?{"":l}:l;for(let[b,B]of Object.entries(g)){let v=m+(b?"-"+b:"");v in this.colorThemesMap?this.colorThemesMap[v][n]=B:this.colorThemesMap[v]={[n]:B}}}for(let m in o)this.colorNames.includes(m)||this.colorNames.push(m)};if(w("",p),f)if(Array.isArray(f))this.themeNames.push(...f);else for(let n in f){let o=f[n];w(n,o.colors),this.themeNames.push(n)}let M=n=>{for(let[o,r]of Object.entries(this.colorThemesMap))for(let[m,l]of Object.entries(r))l.startsWith("#")||n(o,r,m,l)};if(M((n,o,r,m)=>{let l=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(m);if(l){let g="#"+z(+l[1],+l[2],+l[3]);l[4]&&(g+=Math.round(255*+l[4]).toString(16)),o[r]=g}}),M((n,o,r,m)=>{let[l,g]=m.split("/"),b=this.colorThemesMap[l];if(b){let B=(r?b[r]:void 0)??b[""];o[r]=g?B.slice(0,7)+Math.round(255*+g).toString(16):B}else console.warn(`\`${m}\` doesn't exist in the extended config \`.colors\``),delete o[r],Object.keys(o).length||delete this.colorThemesMap[n]}),k)for(let n in k){let o=k[n],{native:r,values:m,colored:l}=o,g=o.match;if(o.id=n,o.native=r===!0?n.replace(/(?!^)[A-Z]/g,b=>"-"+b).toLowerCase():void 0,m&&(this.values[n]=i(m,!1)),g){let b=Object.keys(this.values[n]??{});g.includes("$values")&&(g=b.length?g.replace(/\$values/,b.join("|")):g.replace(/(?:\|)?\$values/,"")),l&&g.includes("$colors")&&(g=this.colorNames.length?g.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):g.replace(/(?:\|)?\$colors/,"")),this.matches[n]=new RegExp(g)}}}observe(e,t={subtree:!0,childList:!0}){if(this.root!==e){if(T&&e){this.root=e;let s=e===document;s&&(A.root=this),this.host=s?document.documentElement:root.host;let f=s?document.head:e,p=s?document.styleSheets:e.styleSheets;for(let y of p){let{href:R,ownerNode:k}=y;(k.id==="master"||R&&R.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(R))&&(this.style=k)}if(this.style)for(let y=0;y<this.style.sheet.cssRules.length;y++){let R=this.style.sheet.cssRules[y];if(R.constructor.name==="CSSKeyframesRule")continue;let k=i=>{if(i.selectorText){let u=i.selectorText.split(", ")[0].split(" ");for(let d=0;d<u.length;d++){let h=u[d];if(h[0]==="."){let w=h.slice(1),M="";for(let n=0;n<w.length;n++){let o=w[n],r=w[n+1];if(o==="\\"){if(n++,r!=="\\"){M+=r;continue}}else if(_.includes(o))break;M+=o}if(!(M in this.ruleBy)&&!(M in this.classes)){let n=this.create(M)[0];if(n)return n}}}}else if(i.cssRules)for(let c=0;c<i.cssRules.length;c++){let u=k(i.cssRules[c]);if(u)return u}},a=k(R);if(a){this.rules.push(a),this.ruleBy[a.className]=a;for(let i=0;i<a.natives.length;i++)a.natives[i].cssRule=this.style.sheet.cssRules[y+i];y+=a.natives.length-1,a.config.insert?.call(a)}}else switch(this.style=$(),this.config.precedence){case"highest":console.log(s?document.body:e),(s?document.body:e).append(this.style);break;case"higher":f.append(this.style);break;default:let y=f.querySelector('link[rel="styleSheet"], style');y?y.before(this.style):f.append(this.style);break}let C=y=>{y.forEach(R=>{R in this.countBy?this.countBy[R]++:(this.countBy[R]=1,this.insert(R))})};C(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(y=>C(y.classList)),this.observer.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer?.disconnect?.(),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style?.sheet;if(e?.cssRules)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style?.remove(),this.style=null,this.root=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],f=this.matches[t],{symbol:p,native:C}=s;if(f&&f.test(e))return{origin:"match",config:s};if(p&&e.startsWith(p))return{origin:"symbol",config:s};if(C&&e.startsWith(C+":"))return{origin:"match",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.ruleBy)return this.ruleBy[s];let f=this.match(s);if(f)return new Q(s,f,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=j(O,e),this.cache(),!this.style)return;let t=$();this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleBy={};for(let s in this.countBy)this.insert(s)}destroy(){let e=A.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style?.sheet,s=f=>{let p=this.ruleBy[f];if(!(!p||f in this.classesBy&&this.classesBy[f].some(C=>C in this.countBy))){if(t&&p.natives.length){let C=p.natives[0];for(let y=0;y<t.cssRules.length;y++)if(t.cssRules[y]===C.cssRule){for(let k=0;k<p.natives.length;k++)t.deleteRule(y);break}}this.rules.splice(this.rules.indexOf(p),1),delete this.ruleBy[f],p.config.delete&&p.config.delete.call(p,f)}};if(e in this.classes){for(let f of this.classes[e])f in this.countBy||s(f);delete this.ruleBy[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.ruleBy[t.className])continue;let s,f=this.rules.length-1,{media:p,order:C,priority:y,hasWhere:R,className:k}=t,a=(i,c,u,d)=>{let h=0,w;c&&(h=i.findIndex(c)),u&&(w=i.findIndex(u)),h===-1&&(h=i.length),(w===void 0||w===-1)&&(w=i.length);let M=i.slice(h,w);for(let n=0;n<M.length;n++){let o=M[n];if(!(o.priority===-1||d&&d(o))&&(o.priority<y||o.priority===y&&(R&&!o.hasWhere||o.order>=C)))return h+n}return h+M.length};if(p){let i=this.rules.findIndex(c=>c.media);if(i!==-1){let c=p.features["max-width"],u=p.features["min-width"];if(c&&u){let d=c.value-u.value;for(let h=f;h>=i;h--){s=h;let w=this.rules[h],M=w.media,n=M.features["max-width"],o=M.features["min-width"];if(!n||!o){s++;break}let r=n.value-o.value;if(r===d){if(R!==w.hasWhere)continue;if(y!==-1){let m=[this.rules[h]];for(let l=h-1;l>=i;l--){let g=this.rules[l];if(g.hasWhere!==R)break;let b=g.media,B=b.features["max-width"],v=b.features["min-width"];if(!B||!v||B.value-v.value!==r)break;m.unshift(this.rules[l])}s=a(this.rules,l=>l.media&&l.priority!==-1&&l.media.features["min-width"]&&l.media.features["max-width"])}break}else if(r>d)break}}else if(u)for(let d=i;d<=f;d++){s=d;let h=this.rules[d],w=h.media,M=w.features["max-width"],n=w.features["min-width"];if(M){if(n)break;continue}let o=n?.value;if(o===u.value){if(!R&&h.hasWhere){s++;continue}if(y!==-1)s=a(this.rules,r=>r.media,r=>r.media&&r.priority!==-1&&r.media.features["min-width"]&&r.media.features["max-width"],r=>!r.media.features["min-width"]&&!r.media.features["max-width"]);else for(let r=d;r<=f;r++){let m=this.rules[r],l=m.media,g=l.features["min-width"];if(!l.features["max-width"]){if(m.hasWhere!==R||g.value!==o||m.order>=C)break;s=r+1}}break}else{if(o>u.value)break;s++}}else if(c)for(let d=f;d>=i;d--){s=d;let h=this.rules[d],w=h.media,M=w.features["max-width"];if(w.features["min-width"])continue;let o=M?.value;if(!o||o>c.value){s++;break}else if(o===c.value){if(R&&!h.hasWhere)continue;if(y!==-1)s=a(this.rules,r=>r.media,r=>r.media&&r.priority!==-1&&r.media.features["min-width"]&&r.media.features["max-width"],r=>!r.media.features["min-width"]&&!r.media.features["max-width"]);else{let r=[this.rules[d]];for(let m=d-1;m>=i;m--){let l=this.rules[m],g=l.media,b=g.features["min-width"],B=g.features["max-width"];if(!b&&(!B||B.value!==o||l.hasWhere!==R))break;r.unshift(l)}for(let m=0;m<r.length;m++){let l=r[m];if(!l.media.features["min-width"]){if(l.order>=C)break;s=d-r.length+2+m}}}break}}}if(s===void 0)if(i===-1)s=f+1;else if(y!==-1)s=i+a(this.rules.slice(i),void 0,c=>c.media.features["max-width"]||c.media.features["min-width"]);else if(R){let c=i;for(;c<this.rules.length;c++){let u=this.rules[c];if(u.priority!==-1||!u.hasWhere||u.order>=C){s=c;break}}s===void 0&&(s=c)}else for(let c=i;c<=f;c++){s=c;let u=this.rules[c],d=u.media;if(u.priority!==-1||d.features["max-width"]||d.features["min-width"])break;if(u.hasWhere)s++;else if(u.order>=C)break}}else if(y===-1){if(R)s=this.rules.findIndex(i=>!i.hasWhere||i.media||i.priority!==-1||i.order>=C),s===-1&&(s=f+1);else{let i=0;for(;i<this.rules.length;i++){let c=this.rules[i];if(c.media||!c.hasWhere&&(c.order>=C||c.priority!==-1)){s=i;break}}s===void 0&&(s=i)}!s&&Object.keys(this.keyframes).length&&s++}else s=a(this.rules,void 0,i=>i.media);if(this.rules.splice(s,0,t),this.ruleBy[k]=t,this.style){let i=this.style.sheet,c=0,u=d=>{let h=this.rules[d];if(h){if(!h.natives.length)return u(d-1);let w=h.natives[h.natives.length-1].cssRule;for(let M=0;M<i.cssRules.length;M++)if(i.cssRules[M]===w){c=M+1;break}}};u(s-1);for(let d=0;d<t.natives.length;)try{let h=t.natives[d];i.insertRule(h.text,c),h.cssRule=i.cssRules[c++],d++}catch(h){console.error(h),t.natives.splice(d,1)}}t.config.insert?.call(t)}}get text(){return this.rules.map(e=>e.text).join("")}},W=A;S(W,"root"),S(W,"config",O),S(W,"instances",[]),S(W,"refresh",e=>{for(let t of A.instances)t.refresh(e)});T&&(window.MasterCSS=W);export{W as MasterCSS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderFromHTML as
|
|
1
|
+
import{renderFromHTML as n}from"./render-from-html.mjs";function i(e,t){if(!e)return;let r=`<style id="master">${n(e,t)}</style>`;switch(t?.precedence??"highest"){case"highest":return e.replace(/<\/body>/,`${r}$&`);case"higher":return e.replace(/<\/head>/,`${r}$&`);default:return e.replace(/(<link[^>]*?rel="styleSheet".*?>|<style.*?>|<\/head>)/,`${r}$1`)}}export{i as renderIntoHTML};
|
package/dist/esm/rule.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SORTED_SELECTORS as re}from"./constants/sorted-selectors.mjs";import{START_SYMBOL as oe}from"./constants/start-symbol.mjs";import{cssEscape as ue}from"./utils/css-escape.mjs";function ie(y){let n=typeof Buffer<"u"?Buffer:null;return!!(n&&y instanceof n||y instanceof Date||y instanceof RegExp)}function ne(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let n=Buffer.alloc(y.length);return y.copy(n),n}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function se(y){let n=[];return y.forEach(function(l,S){typeof l=="object"&&l!==null?Array.isArray(l)?n[S]=se(l):ie(l)?n[S]=ne(l):n[S]=A({},l):n[S]=l}),n}function te(y,n){return n==="__proto__"?void 0:y[n]}function A(...y){let n={},l,S;return y.forEach(function(T){typeof T!="object"||T===null||Array.isArray(T)||Object.keys(T).forEach(function(j){if(S=te(n,j),l=te(T,j),l!==n)if(typeof l!="object"||l===null){n[j]=l;return}else if(Array.isArray(l)){n[j]=se(l);return}else if(ie(l)){n[j]=ne(l);return}else if(typeof S!="object"||S===null||Array.isArray(S)){n[j]=A({},l);return}else{n[j]=A(S,l);return}})}),n}var he={unit:"",order:0,separators:[","]},le=class{constructor(n,l={},S){this.className=n;this.meta=l;this.css=S;this.config=A(he,l.config);let{unit:T,order:j,colored:C,native:
|
|
1
|
+
import{SORTED_SELECTORS as re}from"./constants/sorted-selectors.mjs";import{START_SYMBOL as oe}from"./constants/start-symbol.mjs";import{cssEscape as ue}from"./utils/css-escape.mjs";function ie(y){let n=typeof Buffer<"u"?Buffer:null;return!!(n&&y instanceof n||y instanceof Date||y instanceof RegExp)}function ne(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let n=Buffer.alloc(y.length);return y.copy(n),n}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function se(y){let n=[];return y.forEach(function(l,S){typeof l=="object"&&l!==null?Array.isArray(l)?n[S]=se(l):ie(l)?n[S]=ne(l):n[S]=A({},l):n[S]=l}),n}function te(y,n){return n==="__proto__"?void 0:y[n]}function A(...y){let n={},l,S;return y.forEach(function(T){typeof T!="object"||T===null||Array.isArray(T)||Object.keys(T).forEach(function(j){if(S=te(n,j),l=te(T,j),l!==n)if(typeof l!="object"||l===null){n[j]=l;return}else if(Array.isArray(l)){n[j]=se(l);return}else if(ie(l)){n[j]=ne(l);return}else if(typeof S!="object"||S===null||Array.isArray(S)){n[j]=A({},l);return}else{n[j]=A(S,l);return}})}),n}var he={unit:"",order:0,separators:[","]},le=class{constructor(n,l={},S){this.className=n;this.meta=l;this.css=S;this.config=A(he,l.config);let{unit:T,order:j,colored:C,native:N,analyze:Q,transform:q,declare:$,create:F}=this.config,{scope:Y,important:fe,functions:ce}=S.config,{themeNames:Z,colorNames:H,colorThemesMap:J,selectors:W,breakpoints:K,mediaQueries:z,themeAffectedClassesBy:ae,globalValues:D}=S,X=ae[n];this.order=j,F&&F.call(this,n);let _,G,I,B,w;if(l.origin==="semantics"){let[h,f]=l.value;B=n.slice(h.length),_=f}else{let h;if(Q)[h,I]=Q.call(this,n);else if(l.origin==="match"){let s=n.indexOf(":");this.prefix=n.slice(0,s+1),this.prefix.includes("(")?(this.prefix=void 0,h=n):h=n.slice(s+1)}else l.origin==="symbol"&&(this.symbol=n[0],h=n.slice(1));w=[];let f=this,a=this.values,p=[","];this.config.separators.length&&p.push(...this.config.separators);let i="",t=0;(function s(e,c,o,r=void 0,u=[],v=[],g){let R=r===void 0,x,M=d=>d==="'"||d==='"',V=()=>x=i.length,O=()=>{if(i){let d=i,m=R?d:i.slice(x);if(i="",k="",a&&m in a&&!u.includes(m)){let b=t;t=0,s(a[m].toString(),c,void 0,r,[...u,m],v,g),t=b,R||(i=i.slice(0,x)+i)}else if(D&&m in D&&!v.includes(m)){let b=t;t=0,s(D[m].toString(),c,void 0,r,u,[...v,m],g),t=b,R||(i=i.slice(0,x)+i)}else if(R){let b=!g&&f.analyzeUnitValue(m,c);w.push({value:b?.value??m,unit:b?.unit})}else{let b=!g&&f.analyzeUnitValue(m,c);i=b?d.slice(0,x)+b.value+b.unit:d}V()}},E=M(o);V();let k="";for(;t<e.length;t++){let d=e[t];if(d===o){if(E){i+=d;let m=0;for(let b=i.length-2;i[b]==="\\";b--)m++;if(m%2)continue}else O(),i+=d;return}else if(!E&&d in oe){let m=d==="("&&k&&ce?.[k];m?.name&&(i=i.slice(0,i.length-k.length)+m.name,k=m.name),i+=d,t++;let b=oe[d];s(e,m?.unit??c,b,k||r||"",u,v,g||!!m?.transform),m?.transform&&(i=i.slice(0,x+k.length+1)+m.transform.call(f,i.slice(x+k.length+1,-1))+i.slice(-1)),R&&(M(b)?(w.push(i),i=""):O()),k=""}else if((d==="|"||d===" ")&&o!=="}"&&(!E||r==="path"))O(),R||(i+=" ",x++);else{if(!E){if(d==="."){if(isNaN(+e[t+1]))break;e[t-1]==="-"&&(i+="0")}else if(p.includes(d)){O(),R?w.push(d):(i+=d,x++);continue}else if(R&&(d==="#"&&(i||w.length&&e[t-1]!=="|"&&w[t-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(d)))break;k+=d}i+=d}}r===void 0&&O()})(h,T),B=h.slice(t)}B[0]==="!"&&(this.important=!0,B=B.slice(1));let ee=h=>{let f=h.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,s)=>s%3?t:t.replace(/_/g," ")).join(""),a=[],p="",i=0;for(let t=0;t<f.length;t++){let s=f[t];if(s==="\\"){p+=s+f[++t];continue}!i&&s===","?(a.push(p),p=""):(p+=s,i&&s===")"?i--:s==="("&&i++)}return p&&a.push(p),a};this.prefixSelectors=I?ee(I):[""];let P=B.split("@"),U=P[0];if(U){this.vendorSuffixSelectors={};let h=(t,s,e,c)=>{for(let[o,r]of s)if(o.test(t)){for(let u of r)h(t.replace(o,u),s,e,!0);return}c&&e.push(t)},f=[];""in W?h(U,W[""],f,!0):f.push(U);let a={};for(let[t,s]of Object.entries(W)){if(!t)continue;let e=[];for(let c of f)h(c,s,e,!1);e.length&&(a[t]=e)}let p=(t,s)=>{let e=s.reduce((c,o)=>(c.push(...ee(o)),c),[]);t in this.vendorSuffixSelectors?this.vendorSuffixSelectors[t].push(...e):this.vendorSuffixSelectors[t]=e},i=Object.keys(a);if(i.length)for(let t of i)p(t,a[t]);else p("",f);for(let t of Object.values(this.vendorSuffixSelectors))for(let s of t){this.hasWhere!==!1&&(this.hasWhere=s.includes(":where("));for(let e=0;e<re.length;e++)if(s.includes(re[e])){(this.priority===-1||this.priority>e)&&(this.priority=e);break}}}else this.vendorSuffixSelectors={"":[""]};for(let h=1;h<P.length;h++){let f=P[h];if(f)if(Z.includes(f))this.theme=f;else if(f==="rtl"||f==="ltr")this.direction=f;else{let a,p,i=f.indexOf("_");if(i!==-1)a=f.slice(0,i),p=f.slice(i);else{let t=f.indexOf("(");t!==-1&&(a=f.slice(0,t),p=f.slice(t))}if(!a){a="media";let t=[];this.media={token:f,features:{}};let s=f.split("&");for(let e of s)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(z&&e in z)t.push(z[e]);else{let c={token:e},o="",r="",u=0;e.startsWith("<=")?(r="<=",o="max-width"):e.startsWith(">=")||K[e]?(r=">=",o="min-width"):e.startsWith(">")?(r=">",o="min-width",u=.02):e.startsWith("<")&&(r="<",o="max-width",u=-.02);let v=r?e.replace(r,""):e,g=K[v];switch(o){case"max-width":case"min-width":g?Object.assign(c,this.analyzeUnitValue(g.toString(),"px")):Object.assign(c,this.analyzeUnitValue(v,"px")),c.unit==="px"&&(c.value+=u),this.media.features[o]=c,t.push("("+o+":"+(c.value+c.unit)+")");break}}p="",this.media.type&&(p=this.media.type),t.length&&(p+=(p?" and ":"")+t.join(" and "))}p&&(this.at[a]=(a in this.at?this.at[a]+" and ":"")+p.replace(/_/g," "))}}let L=(h,f)=>{let a,p=(s,e,c)=>{let o="";this.direction&&(o+="[dir="+this.direction+"] ");let r=this.prefixSelectors.map(g=>g+o),u=(g,R)=>r.map(x=>(g?"."+g+" ":"")+(Y?Y+" ":"")+x).reduce((x,M)=>(x.push(c.reduce((V,O)=>(V.push(M+"."+ue(R)+O),V),[]).join(",")),x),[]).join(","),v=u(e,n)+(X?Object.entries(X).filter(([g])=>this.theme||!C||!e||!g||g===e).map(([g,R])=>R.reduce((x,M)=>x+","+u(this.theme??((C||G)&&e||g),M),"")).join(""):"")+"{"+s+"}";for(let g of Object.keys(this.at).sort((R,x)=>x==="supports"?-1:1))v="@"+g+" "+this.at[g]+"{"+v+"}";return v},i=[];if(w){let s=this.theme?[this.theme,""]:[h],e,c;for(let o of w)if(typeof o=="string")i.push(o);else{let r=o.value;if(o.unit)r+=o.unit;else if(C&&J&&H){let u=!1,v=!1;r=r.replace(new RegExp(`(^|,| |\\()((?:${H.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(g,R,x,M)=>{v=!0;let V=J[x];if(V){let O;for(let E of s)if(O=V[E])break;if(O){u=!0;let E=O;if(M){let k=M.endsWith("%")?parseFloat(M)/100:+M;k=isNaN(k)?1:Math.min(Math.max(k,0),1),E+=Math.round(k*255).toString(16).toUpperCase().padStart(2,"0")}return R+E}}return g}),v&&(c=u)}c!==void 0&&!e&&(e=c),i.push(r)}if(f&&(e===void 0?h:!e))return;if(a=i.reduce((o,r,u)=>o+r+(r===","||w[u+1]===","||u===w.length-1?"":" "),""),q&&(a=q.call(this,a,this.css.config)),C&&a==="current"&&(a="currentColor"),$){let o,r;if(w.length===1){let u=w[0];typeof u=="object"&&(o=u.value,r=u.unit)}_=$.call(this,r?o:a,r||"")}else _={[N]:a}}let t={};for(let s in _){let e=(r,u)=>{let v=u+((this.important||fe)&&!u.endsWith("!important")?"!important":"");r in t?t[r].push(v):t[r]=[v]},c=s+":",o=_[s];if(typeof o=="object"){G=!0;for(let r in o)e(r,c+o[r])}else e(h,c+o.toString())}for(let s of Object.values(this.vendorSuffixSelectors))for(let e in t)this.natives.push({text:p(t[e].join(";"),e,s),theme:e})};if(this.theme)L(this.theme,!1);else if(C)for(let h of Z)L(h,!0);else L("",!1)}at={};priority=-1;natives=[];keyframeNames;config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(n=>n.text).join("")}resolveValue(n,l){return Number.isNaN(+n)?n:n/(l==="rem"||l==="em"?this.css.config.rootSize:1)+l}analyzeUnitValue(n,l){let S=l??this.config.unit;if(S){let T="",j=n.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(j)if(n.includes("/")){let[C,N]=n.split("/");return{value:+C/+N*100+"%",unit:T}}else{let C=+j[1];return T=j[3]||"",T||((S==="rem"||S==="em")&&(C=C/this.css.config.rootSize),T=S||""),{value:C,unit:T}}}}};export{le as Rule};
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var Le=Object.defineProperty;var ze=(t,e,r)=>e in t?Le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var oe=(t,e,r)=>(ze(t,typeof e!="symbol"?e+"":e,r),r);function Re(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function Ce(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Te(t){let e=[];return t.forEach(function(r,i){typeof r=="object"&&r!==null?Array.isArray(r)?e[i]=Te(r):Re(r)?e[i]=Ce(r):e[i]=J({},r):e[i]=r}),e}function Se(t,e){return e==="__proto__"?void 0:t[e]}function J(...t){let e={},r,i;return t.forEach(function(n){typeof n!="object"||n===null||Array.isArray(n)||Object.keys(n).forEach(function(a){if(i=Se(e,a),r=Se(n,a),r!==e)if(typeof r!="object"||r===null){e[a]=r;return}else if(Array.isArray(r)){e[a]=Te(r);return}else if(Re(r)){e[a]=Ce(r);return}else if(typeof i!="object"||i===null||Array.isArray(i)){e[a]=J({},r);return}else{e[a]=J(i,r);return}})}),e}var ye=[":disabled",":active",":focus",":hover"];var ie={"(":")","'":"'",'"':'"',"{":"}"};function ue(t){if(typeof CSS<"u")return CSS.escape(t);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let e=String(t),r=e.length,i=-1,n="",a,g=e.charCodeAt(0);if(r==1&&g==45)return"\\"+e;for(;++i<r;){if(a=e.charCodeAt(i),a==0){n+="\uFFFD";continue}if(a>=1&&a<=31||a==127||i==0&&a>=48&&a<=57||i==1&&a>=48&&a<=57&&g==45){n+="\\"+a.toString(16)+" ";continue}if(a>=128||a==45||a==95||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122){n+=e.charAt(i);continue}n+="\\"+e.charAt(i)}return n}var De={unit:"",order:0,separators:[","]},fe=class{constructor(e,r={},i){this.className=e;this.meta=r;this.css=i;this.config=J(De,r.config);let{unit:n,order:a,colored:g,native:p,analyze:y,transform:c,declare:o,create:s}=this.config,{scope:l,important:m,functions:w}=i.config,{themeNames:v,colorNames:O,colorThemesMap:j,selectors:f,breakpoints:h,mediaQueries:u,themeAffectedClassesBy:k,globalValues:x}=i,R=k[e];this.order=a,s&&s.call(this,e);let C,N,E,Q,Y;if(r.origin==="semantics"){let[L,B]=r.value;Q=e.slice(L.length),C=B}else{let L;if(y)[L,E]=y.call(this,e);else if(r.origin==="match"){let T=e.indexOf(":");this.prefix=e.slice(0,T+1),this.prefix.includes("(")?(this.prefix=void 0,L=e):L=e.slice(T+1)}else r.origin==="symbol"&&(this.symbol=e[0],L=e.slice(1));Y=[];let B=this,I=this.values,F=[","];this.config.separators.length&&F.push(...this.config.separators);let S="",b=0;(function T(d,A,M,$=void 0,W=[],U=[],z){let Z=$===void 0,P,G=D=>D==="'"||D==='"',re=()=>P=S.length,X=()=>{if(S){let D=S,V=Z?D:S.slice(P);if(S="",q="",I&&V in I&&!W.includes(V)){let H=b;b=0,T(I[V].toString(),A,void 0,$,[...W,V],U,z),b=H,Z||(S=S.slice(0,P)+S)}else if(x&&V in x&&!U.includes(V)){let H=b;b=0,T(x[V].toString(),A,void 0,$,W,[...U,V],z),b=H,Z||(S=S.slice(0,P)+S)}else if(Z){let H=!z&&B.analyzeUnitValue(V,A);Y.push({value:H?.value??V,unit:H?.unit})}else{let H=!z&&B.analyzeUnitValue(V,A);S=H?D.slice(0,P)+H.value+H.unit:D}re()}},K=G(M);re();let q="";for(;b<d.length;b++){let D=d[b];if(D===M){if(K){S+=D;let V=0;for(let H=S.length-2;S[H]==="\\";H--)V++;if(V%2)continue}else X(),S+=D;return}else if(!K&&D in ie){let V=D==="("&&q&&w?.[q];V?.name&&(S=S.slice(0,S.length-q.length)+V.name,q=V.name),S+=D,b++;let H=ie[D];T(d,V?.unit??A,H,q||$||"",W,U,z||!!V?.transform),V?.transform&&(S=S.slice(0,P+q.length+1)+V.transform.call(B,S.slice(P+q.length+1,-1))+S.slice(-1)),Z&&(G(H)?(Y.push(S),S=""):X()),q=""}else if((D==="|"||D===" ")&&M!=="}"&&(!K||$==="path"))X(),Z||(S+=" ",P++);else{if(!K){if(D==="."){if(isNaN(+d[b+1]))break;d[b-1]==="-"&&(S+="0")}else if(F.includes(D)){X(),Z?Y.push(D):(S+=D,P++);continue}else if(Z&&(D==="#"&&(S||Y.length&&d[b-1]!=="|"&&Y[b-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(D)))break;q+=D}S+=D}}$===void 0&&X()})(L,n),Q=L.slice(b)}Q[0]==="!"&&(this.important=!0,Q=Q.slice(1));let ke=L=>{let B=L.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((b,T)=>T%3?b:b.replace(/_/g," ")).join(""),I=[],F="",S=0;for(let b=0;b<B.length;b++){let T=B[b];if(T==="\\"){F+=T+B[++b];continue}!S&&T===","?(I.push(F),F=""):(F+=T,S&&T===")"?S--:T==="("&&S++)}return F&&I.push(F),I};this.prefixSelectors=E?ke(E):[""];let be=Q.split("@"),ve=be[0];if(ve){this.vendorSuffixSelectors={};let L=(b,T,d,A)=>{for(let[M,$]of T)if(M.test(b)){for(let W of $)L(b.replace(M,W),T,d,!0);return}A&&d.push(b)},B=[];""in f?L(ve,f[""],B,!0):B.push(ve);let I={};for(let[b,T]of Object.entries(f)){if(!b)continue;let d=[];for(let A of B)L(A,T,d,!1);d.length&&(I[b]=d)}let F=(b,T)=>{let d=T.reduce((A,M)=>(A.push(...ke(M)),A),[]);b in this.vendorSuffixSelectors?this.vendorSuffixSelectors[b].push(...d):this.vendorSuffixSelectors[b]=d},S=Object.keys(I);if(S.length)for(let b of S)F(b,I[b]);else F("",B);for(let b of Object.values(this.vendorSuffixSelectors))for(let T of b){this.hasWhere!==!1&&(this.hasWhere=T.includes(":where("));for(let d=0;d<ye.length;d++)if(T.includes(ye[d])){(this.priority===-1||this.priority>d)&&(this.priority=d);break}}}else this.vendorSuffixSelectors={"":[""]};for(let L=1;L<be.length;L++){let B=be[L];if(B)if(v.includes(B))this.theme=B;else if(B==="rtl"||B==="ltr")this.direction=B;else{let I,F,S=B.indexOf("_");if(S!==-1)I=B.slice(0,S),F=B.slice(S);else{let b=B.indexOf("(");b!==-1&&(I=B.slice(0,b),F=B.slice(b))}if(!I){I="media";let b=[];this.media={token:B,features:{}};let T=B.split("&");for(let d of T)if(d==="all"||d==="print"||d==="screen"||d==="speech")this.media.type=d;else if(d==="\u{1F5A8}")this.media.type="print";else if(d==="landscape"||d==="portrait")b.push("(orientation:"+d+")");else if(d==="motion"||d==="reduced-motion")b.push("(prefers-reduced-motion:"+(d==="motion"?"no-preference":"reduce")+")");else if(u&&d in u)b.push(u[d]);else{let A={token:d},M="",$="",W=0;d.startsWith("<=")?($="<=",M="max-width"):d.startsWith(">=")||h[d]?($=">=",M="min-width"):d.startsWith(">")?($=">",M="min-width",W=.02):d.startsWith("<")&&($="<",M="max-width",W=-.02);let U=$?d.replace($,""):d,z=h[U];switch(M){case"max-width":case"min-width":z?Object.assign(A,this.analyzeUnitValue(z.toString(),"px")):Object.assign(A,this.analyzeUnitValue(U,"px")),A.unit==="px"&&(A.value+=W),this.media.features[M]=A,b.push("("+M+":"+(A.value+A.unit)+")");break}}F="",this.media.type&&(F=this.media.type),b.length&&(F+=(F?" and ":"")+b.join(" and "))}F&&(this.at[I]=(I in this.at?this.at[I]+" and ":"")+F.replace(/_/g," "))}}let xe=(L,B)=>{let I,F=(T,d,A)=>{let M="";this.direction&&(M+="[dir="+this.direction+"] ");let $=this.prefixSelectors.map(z=>z+M),W=(z,Z)=>$.map(P=>(z?"."+z+" ":"")+(l?l+" ":"")+P).reduce((P,G)=>(P.push(A.reduce((re,X)=>(re.push(G+"."+ue(Z)+X),re),[]).join(",")),P),[]).join(","),U=W(d,e)+(R?Object.entries(R).filter(([z])=>this.theme||!g||!d||!z||z===d).map(([z,Z])=>Z.reduce((P,G)=>P+","+W(this.theme??((g||N)&&d||z),G),"")).join(""):"")+"{"+T+"}";for(let z of Object.keys(this.at).sort((Z,P)=>P==="supports"?-1:1))U="@"+z+" "+this.at[z]+"{"+U+"}";return U},S=[];if(Y){let T=this.theme?[this.theme,""]:[L],d,A;for(let M of Y)if(typeof M=="string")S.push(M);else{let $=M.value;if(M.unit)$+=M.unit;else if(g&&j&&O){let W=!1,U=!1;$=$.replace(new RegExp(`(^|,| |\\()((?:${O.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(z,Z,P,G)=>{U=!0;let re=j[P];if(re){let X;for(let K of T)if(X=re[K])break;if(X){W=!0;let K=X;if(G){let q=G.endsWith("%")?parseFloat(G)/100:+G;q=isNaN(q)?1:Math.min(Math.max(q,0),1),K+=Math.round(q*255).toString(16).toUpperCase().padStart(2,"0")}return Z+K}}return z}),U&&(A=W)}A!==void 0&&!d&&(d=A),S.push($)}if(B&&(d===void 0?L:!d))return;if(I=S.reduce((M,$,W)=>M+$+($===","||Y[W+1]===","||W===Y.length-1?"":" "),""),c&&(I=c.call(this,I,this.css.config)),g&&I==="current"&&(I="currentColor"),o){let M,$;if(Y.length===1){let W=Y[0];typeof W=="object"&&(M=W.value,$=W.unit)}C=o.call(this,$?M:I,$||"")}else C={[p]:I}}let b={};for(let T in C){let d=($,W)=>{let U=W+((this.important||m)&&!W.endsWith("!important")?"!important":"");$ in b?b[$].push(U):b[$]=[U]},A=T+":",M=C[T];if(typeof M=="object"){N=!0;for(let $ in M)d($,A+M[$])}else d(L,A+M.toString())}for(let T of Object.values(this.vendorSuffixSelectors))for(let d in b)this.natives.push({text:F(b[d].join(";"),d,T),theme:d})};if(this.theme)xe(this.theme,!1);else if(g)for(let L of v)xe(L,!0);else xe("",!1)}at={};priority=-1;natives=[];config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(e=>e.text).join("")}resolveValue(e,r){return Number.isNaN(+e)?e:e/(r==="rem"||r==="em"?this.css.config.rootSize:1)+r}analyzeUnitValue(e,r){let i=r??this.config.unit;if(i){let n="",a=e.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(a)if(e.includes("/")){let[g,p]=e.split("/");return{value:+g/+p*100+"%",unit:n}}else{let g=+a[1];return n=a[3]||"",n||((i==="rem"||i==="em")&&(g=g/this.css.config.rootSize),n=i||""),{value:g,unit:n}}}}};var ae={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560};function le(t){t.startsWith("#")&&(t=t.slice(1));let e=t.match(/.{1,2}/g);return[parseInt(e[0],16),parseInt(e[1],16),parseInt(e[2],16)]}function he(t,e,r){return((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}function _(t){typeof t=="string"&&(t={"":t});let e=""in t,r=!1;for(let i in t)if(i&&+i>=100){r=!0;break}if(!r&&(!e||Object.keys(t).length>1)){let i=0,n="0"in t?le(t[0]):[0,0,0],a,g,p=[],y=()=>{let c=a-i,o=g.map((s,l)=>(s-n[l])/c);for(let s of p){let l=s-i,m=n.map((w,v)=>Math.round(w+o[v]*l));t[s]="#"+he.call(this,...m)}};for(let c=1;c<100;c++)c in t?(p.length?(a=c,g=le(t[c]),y(),p.length=0,n=g):n=le(t[c]),i=c):p.push(c);p.length&&(a=100,g="100"in t?le(t[100]):[255,255,255],y())}return e||(t[""]=t[r?"500":"50"]),t}var $e={black:"#000000",white:"#ffffff",slate:_({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:_({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:_({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:_({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:_({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:_({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:_({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:_({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:_({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:_({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:_({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:_({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:_({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:_({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:_({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:_({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:_({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:_({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:_({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:_({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};var Me="";var Ee={"::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 Be={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 Oe=["dark","light"];var se={content:"content-box",border:"border-box",padding:"padding-box"};var ce={min:"min-content",max:"max-content"};var ee={full:"100%",fit:"fit-content",max:"max-content",min:"min-content"};for(let t in ae)ee[t]=ae[t]/16+"rem";var Ae={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(t){let e=0;for(;e<t.length&&!(t[e]==="{"&&t[e-1]!=="\\");e++);return[t.slice(e),t.slice(0,e)]},declare(t){let e={},r=(c,o)=>{let s=o.indexOf(":");if(s!==-1){c in e||(e[c]={});let l=e[c],m=o.slice(0,s);m in l||(l[m]=o.slice(s+1))}},i=c=>{let o=(s,l)=>{let m=l.slice(ue(c.className).length).match(/\{(.*)\}/)[1].split(";");for(let w of m)r(s,w)};if(this.theme){let s=c.natives.find(l=>l.theme===this.theme)??c.natives.find(l=>!l.theme);s&&o(this.theme,s.text)}else for(let s of c.natives)o(s.theme,s.text)},n=[],a="",g=()=>{a&&(n.push(a.replace(/ /g,"")),a="")},p=1;(function c(o){for(;p<t.length;p++){let s=t[p];if(!o){if(s===";"){g();continue}if(s==="}")break}if(a+=s,o===s){if(o==="'"||o==='"'){let l=0;for(let m=a.length-2;a[m]==="\\";m--)l++;if(l%2)continue}break}else s in ie&&o!=="'"&&o!=='"'&&(p++,c(ie[s]))}})(void 0),g();for(let c of n){let o=this.css.create(c);if(Array.isArray(o))for(let s of o)i(s);else o?i(o):r(this.theme??"",c)}let y={};for(let c in e)for(let[o,s]of Object.entries(e[c]))o in y?y[o][c]=s:y[o]={[c]:s};return console.log(y),y}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(t){return{["--"+this.prefix.slice(1,-1)]:t}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(t){let e={};switch(t){case"subpixel-antialiased":e["-webkit-font-smoothing"]=e["-moz-osx-font-smoothing"]="auto";break;case"antialiased":e["-webkit-font-smoothing"]="antialiased",e["-moz-osx-font-smoothing"]="grayscale";break}return e}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(t,e){return je.call(this,t+e)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(t,e){return je.call(this,t+e)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:ee,unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:ee},height:{match:"^h:.",unit:"rem",native:!0,values:ee},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:ee},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:ee},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t]},declare(t){let[e,r]=t.split(" x ");return{width:e,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,r]=t.split(" x ");return{"min-width":e,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,r]=t.split(" x ");return{"max-width":e,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(t,e){return{[this.prefix.slice(0,-1)]:t+e}}},lines:{match:"^lines:.",declare(t,e){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":t+e}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:ee},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:ee},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(t,e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":t+e};case"y":return{"overflow-y":t+e}}return{overflow:t+e}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(t,e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":t+e};case"y":return{"overscroll-behavior-y":t+e};default:return{"overscroll-behavior":t+e}}}},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(t,e){return{"user-drag":t+e,"-webkit-user-drag":t+e}}},userSelect:{native:!0,declare(t,e){return{"user-select":t+e,"-webkit-user-select":t+e}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(t,e){return{"font-size":t+e,"line-height":e==="em"?t+.875+e:`calc(${t}${e} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-fill-color":t+e}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(t,e){return{"-webkit-text-stroke-width":t+e}}},textStrokeColor:{match:"^text-stroke:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-stroke-color":t+e}}},textStroke:{unit:"rem",native:!0,declare(t,e){return{"-webkit-text-stroke":t+e}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{...se,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(t,e){return de(this.prefix,t+e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(t,e){if(this.prefix){let i="",n=this.prefix.split("-");if(n.length>1)for(let a=1;a<n.length-1;a++)i+=n[a][0];else i=this.prefix.slice(1,-1);switch(i){case"t":return{"border-top-left-radius":t+e,"border-top-right-radius":t+e};case"tl":case"lt":return{"border-top-left-radius":t+e};case"rt":case"tr":return{"border-top-right-radius":t+e};case"b":return{"border-bottom-left-radius":t+e,"border-bottom-right-radius":t+e};case"bl":case"lb":return{"border-bottom-left-radius":t+e};case"br":case"rb":return{"border-bottom-right-radius":t+e};case"l":return{"border-top-left-radius":t+e,"border-bottom-left-radius":t+e};case"r":return{"border-top-right-radius":t+e,"border-bottom-right-radius":t+e};default:return{"border-radius":t+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"]:t+e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(t,e){return de(this.prefix,t+e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(t,e){return de(this.prefix,t+e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(t,e){return de(this.prefix,t+e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(t,e){return{"-webkit-background-clip":t+e,"background-clip":t+e}},values:se},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:se},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"backdrop-filter":t+e,"-webkit-backdrop-filter":t+e}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridColumns:{match:"^grid-cols:.",declare(t,e){return{display:"grid","grid-template-columns":"repeat("+t+e+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridRows:{declare(t,e){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+t+e+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:ce},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:ce,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,values:ce},gridTemplateRows:{native:!0,values:ce},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(t,e){switch(this.prefix[4]){case"x":return{"column-gap":t+e};case"y":return{"row-gap":t+e};default:return{gap:t+e}}}},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(t,e){return{"box-decoration-break":t+e,"-webkit-box-decoration-break":t+e}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(t,e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":t+e,"scroll-margin-right":t+e};case"y":return{"scroll-margin-top":t+e,"scroll-margin-bottom":t+e};case"l":return{"scroll-margin-left":t+e};case"r":return{"scroll-margin-right":t+e};case"t":return{"scroll-margin-top":t+e};case"b":return{"scroll-margin-bottom":t+e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:t+e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(t,e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":t+e,"scroll-padding-right":t+e};case"y":return{"scroll-padding-top":t+e,"scroll-padding-bottom":t+e};case"l":return{"scroll-padding-left":t+e};case"r":return{"scroll-padding-right":t+e};case"t":return{"scroll-padding-top":t+e};case"b":return{"scroll-padding-bottom":t+e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:t+e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{...se,margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{...se,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(t,e){return{"mask-image":t+e,"-webkit-mask-image":t+e}}}};function je(t){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:t};let r=this.prefix[0]==="m"?"margin":"padding",i=r+"-left",n=r+"-right",a=r+"-top",g=r+"-bottom";switch(this.prefix[1]){case"x":return{[i]:t,[n]:t};case"y":return{[a]:t,[g]:t};case"l":return{[i]:t};case"r":return{[n]:t};case"t":return{[a]:t};case"b":return{[g]:t};default:return{[r]:t}}}function de(t,e,r=""){let i="border-";r&&(r="-"+r);let n=/^b(order)?-?(.)?/.exec(t)[2],a=i+"left"+r,g=i+"right"+r,p=i+"top"+r,y=i+"bottom"+r;switch(n){case"x":return{[a]:e,[g]:e};case"y":return{[p]:e,[y]:e};case"l":return{[a]:e};case"r":return{[g]:e};case"t":return{[p]:e};case"b":return{[y]:e};default:return{["border"+r]:e}}}var we={$:{name:"var",transform(t){return"--"+t}},calc:{transform(t){let e=y=>y==="+"||y==="-"||y==="*"||y==="/",r="",i,n="",a=!1,g=!1,p=(y,c="",o="")=>{if(i===2&&!g){let s=this.analyzeUnitValue(n,we.calc.unit);s&&(n=s.value+s.unit)}r+=n+c+y+o,i=null,g=!1,n=""};for(let y=0;y<t.length;y++){let c=t[y];if(c==="("||c===")")a=c===")",p(c);else if(c===",")p(c,""," ");else{switch(i){case 1:break;case 2:if(e(c)){p(c," "," ");continue}else/[0-9]/.test(c)||(g=!0);break;default:a&&(r+=" "),isNaN(+c)?e(c)||(i=1):i=2;break}i?n+=c:r+=c}}return p(""),r}},translate:{unit:"rem"},translateX:{unit:"rem"},translateY:{unit:"rem"},translateZ:{unit:"rem"},translate3d:{unit:"rem"},skew:{unit:"deg"},skewX:{unit:"deg"},skewY:{unit:"deg"},skewZ:{unit:"deg"},skew3d:{unit:"deg"},rotate:{unit:"deg"},rotateX:{unit:"deg"},rotateY:{unit:"deg"},rotateZ:{unit:"deg"},rotate3d:{unit:"deg"},blur:{unit:"rem"},"drop-shadow":{unit:"rem"},"hue-rotate":{unit:"deg"},rgb:{unit:""},rgba:{unit:""},hsl:{unit:""},hsla:{unit:""}};var me={breakpoints:ae,colors:$e,rootSize:16,scope:Me,selectors:Ee,semantics:Be,themes:Oe,rules:Ae,override:!1,observe:!0,important:!1,functions:we};var Ie=[",",".","#","[","!","*",">","+","~",":","@"];var ge=typeof window<"u",ne=class{constructor(e){this.config=e;this.config?.override||(this.config=J(me,e)),this.cache(),ge&&this.config.observe&&this.observe(document),ne.instances.push(this)}rules=[];ruleBy={};countBy={};r=ge?new MutationObserver(e=>{let r={},i=[],n=[],a=[],g=(o,s)=>{s?o.classList.forEach(y):o.classList.forEach(p);let l=o.children;for(let m=0;m<l.length;m++){let w=l[m];w.classList&&(n.push(w),g(w,s))}},p=o=>{o in r?r[o]++:r[o]=1},y=o=>{o in r?r[o]--:o in this.countBy&&(r[o]=-1)},c=(o,s)=>{for(let l=0;l<o.length;l++){let m=o[l];m.classList&&!n.includes(m)&&!a.includes(m)&&(m.isConnected!==s?(n.push(m),g(m,s)):a.push(m))}};for(let o=0;o<e.length;o++){let s=e[o],{addedNodes:l,removedNodes:m,type:w,target:v}=s;if(w==="attributes"){if(i.find(O=>O.target===v))continue;i.push(s)}else c(l,!1),(!v.isConnected||!n.includes(v))&&c(m,!0)}if(!(!i.length&&!Object.keys(r).length)){for(let{oldValue:o,target:s}of i){let l=n.includes(s),m=s.classList,w=o?o.split(" "):[];if(l){if(s.isConnected)continue;for(let v of w)m.contains(v)||y(v)}else if(s.isConnected){m.forEach(v=>{w.includes(v)||p(v)});for(let v of w)m.contains(v)||y(v)}}for(let o in r){let s=r[o],l=(this.countBy[o]||0)+s;l===0?(delete this.countBy[o],this.delete(o)):(o in this.countBy||this.insert(o),this.countBy[o]=l)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={};let{semantics:e,classes:r,selectors:i,themes:n,colors:a,values:g,breakpoints:p,mediaQueries:y,rules:c}=this.config;function o(f){return f.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function s(f,h,u="",k={}){let x=E=>E?(u?u+"-":"")+E:u,R=Object.entries(f),C=[],N=[];for(let E of R){let Q=E[1];(typeof Q=="object"&&!Array.isArray(Q)?C:N).push(E)}for(let[E,Q]of C)s(Q,h,x(E),k);if(h&&u)N.length&&(k[u]=N.reduce((E,[Q,Y])=>(E[Q]=Y,E),{}));else for(let[E,Q]of N)k[x(E)]=Q;return k}if(e)for(let[f,h]of Object.entries(s(e,!0)))this.semantics.push([new RegExp("^"+o(f)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[f,h]]);if(i)for(let[f,h]of Object.entries(s(i,!1))){let u=new RegExp(o(f)+"(?![a-z-])");for(let k of Array.isArray(h)?h:[h]){let x=k.match(/^::-[a-z]+-/m)?.[0]??"",R=this.selectors[x];R||(R=this.selectors[x]=[]);let C=R.find(([N])=>N===u);C||(C=[u,[]],R.push(C)),C[1].push(k)}}g&&(this.globalValues=s(g,!1)),p&&(this.breakpoints=s(p,!1)),y&&(this.mediaQueries=s(y,!1));let l=r?s(r,!1):{},m=n&&!Array.isArray(n)?Object.entries(n).filter(([,{classes:f}])=>f).reduce((f,[h,{classes:u}])=>(f[h]=s(u,!1),f),{}):{},w=[...Object.keys(l),...Object.entries(m).flatMap(([f,h])=>Object.keys(h))],v=f=>{if(f in this.classes)return;let h=this.classes[f]=[],u=(k,x)=>{if(!x)return;let R=Array.isArray(x)?x:x.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let C of R){let N=E=>{E in this.themeAffectedClassesBy?k in this.themeAffectedClassesBy[E]?this.themeAffectedClassesBy[E][k].push(f):this.themeAffectedClassesBy[E][k]=[f]:this.themeAffectedClassesBy[E]={[k]:[f]},h.includes(E)||h.push(E)};if(w.includes(C)){v(C);for(let E of this.classes[C])N(E)}else N(C)}};u("",l?.[f]);for(let[k,x]of Object.entries(m))u(k,x?.[f])};for(let f of w)v(f);for(let f in this.themeAffectedClassesBy){let h=this.classesBy[f]=[];for(let u of Object.values(this.themeAffectedClassesBy[f]))for(let k of u)h.includes(k)||h.push(k)}let O=(f,h)=>{if(!h)return;let u=s(h,!0);for(let[k,x]of Object.entries(u)){let R=typeof x=="string"?{"":x}:x;for(let[C,N]of Object.entries(R)){let E=k+(C?"-"+C:"");E in this.colorThemesMap?this.colorThemesMap[E][f]=N:this.colorThemesMap[E]={[f]:N}}}for(let k in h)this.colorNames.includes(k)||this.colorNames.push(k)};if(O("",a),n)if(Array.isArray(n))this.themeNames.push(...n);else for(let f in n){let h=n[f];O(f,h.colors),this.themeNames.push(f)}let j=f=>{for(let[h,u]of Object.entries(this.colorThemesMap))for(let[k,x]of Object.entries(u))x.startsWith("#")||f(h,u,k,x)};if(j((f,h,u,k)=>{let x=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(k);if(x){let R="#"+he(+x[1],+x[2],+x[3]);x[4]&&(R+=Math.round(255*+x[4]).toString(16)),h[u]=R}}),j((f,h,u,k)=>{let[x,R]=k.split("/"),C=this.colorThemesMap[x];if(C){let N=(u?C[u]:void 0)??C[""];h[u]=R?N.slice(0,7)+Math.round(255*+R).toString(16):N}else console.warn(`\`${k}\` doesn't exist in the extended config \`.colors\``),delete h[u],Object.keys(h).length||delete this.colorThemesMap[f]}),c)for(let f in c){let h=c[f],{native:u,values:k,colored:x}=h,R=h.match;if(h.id=f,h.native=u===!0?f.replace(/(?!^)[A-Z]/g,C=>"-"+C).toLowerCase():void 0,k&&(this.values[f]=s(k,!1)),R){let C=Object.keys(this.values[f]??{});R.includes("$values")&&(R=C.length?R.replace(/\$values/,C.join("|")):R.replace(/(?:\|)?\$values/,"")),x&&R.includes("$colors")&&(R=this.colorNames.length?R.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):R.replace(/(?:\|)?\$colors/,"")),this.matches[f]=new RegExp(R)}}}observe(e,r={subtree:!0,childList:!0}){if(ge&&e){this.root=e;let i=e===document;i&&(ne.root=this),this.host=i?document.documentElement:root.host;let n=i?document.head:e,a=i?document.styleSheets:e.styleSheets;for(let p of a){let{title:y,href:c,ownerNode:o}=p;(y==="master"||c&&c.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(c))&&(this.style=o)}if(this.style)for(let p=0;p<this.style.sheet.cssRules.length;p++){let y=o=>{if(o.selectorText){let l=o.selectorText.split(", ")[0].split(" ");for(let m=0;m<l.length;m++){let w=l[m];if(w[0]==="."){let v=w.slice(1),O="";for(let j=0;j<v.length;j++){let f=v[j],h=v[j+1];if(f==="\\"){if(j++,h!=="\\"){O+=h;continue}}else if(Ie.includes(f))break;O+=f}if(!(O in this.ruleBy)&&!(O in this.classes)){let j=this.create(O)[0];if(j)return j}}}}else if(o.cssRules)for(let s=0;s<o.cssRules.length;s++){let l=y(o.cssRules[s]);if(l)return l}},c=y(this.style.sheet.cssRules[p]);if(c){this.rules.push(c),this.ruleBy[c.className]=c;for(let o=0;o<c.natives.length;o++)c.natives[o].cssRule=this.style.sheet.cssRules[p+o];p+=c.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let p=n.querySelector('link[rel="styleSheet"], style');p?p.before(this.style):n.append(this.style)}let g=p=>{p.forEach(y=>{y in this.countBy?this.countBy[y]++:(this.countBy[y]=1,this.insert(y))})};g(this.host.classList),r.subtree&&this.host.querySelectorAll("[class]").forEach(p=>g(p.classList)),this.r.observe(e,{...r,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.r.disconnect(),this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style.sheet;if(e)for(let r=e.cssRules.length-1;r>=0;r--)e.deleteRule(r);this.style.remove(),this.style=null}match(e){for(let r in this.config.rules){let i=this.config.rules[r],n=this.matches[r],{symbol:a,native:g}=i;if(n&&n.test(e))return{origin:"match",config:i};if(a&&e.startsWith(a))return{origin:"symbol",config:i};if(g&&e.startsWith(g+":"))return{origin:"match",config:i}}for(let r of this.semantics)if(e.match(r[0]))return{origin:"semantics",value:r[1]}}create(e){let r=i=>{if(i in this.ruleBy)return this.ruleBy[i];let n=this.match(i);if(n)return new fe(i,n,this)};return(e in this.classes?this.classes[e].map(i=>r(i)):[r(e)]).filter(i=>i&&i.text)}refresh(e){if(e?.override?this.config=e:this.config=J(me,e),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.ruleBy={};for(let i in this.countBy)this.insert(i)}destroy(){let e=ne.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let r=this.style.sheet,i=n=>{let a=this.ruleBy[n];if(!(!a||n in this.classesBy&&this.classesBy[n].some(g=>g in this.countBy))){if(a.natives.length){let g=a.natives[0];for(let p=0;p<r.cssRules.length;p++)if(r.cssRules[p]===g.cssRule){for(let c=0;c<a.natives.length;c++)r.deleteRule(p);this.rules.splice(this.rules.indexOf(a),1);break}}delete this.ruleBy[n],a.config.delete&&a.config.delete.call(this,n)}};if(e in this.classes){for(let n of this.classes[e])n in this.countBy||i(n);delete this.ruleBy[e]}else i(e)}insert(e){let r=this.create(e);return r.length?(this.insertRules(r),!0):!1}insertRules(e){for(let r of e){if(this.ruleBy[r.className])continue;let i,n=this.rules.length-1,{media:a,order:g,priority:p,hasWhere:y,className:c}=r,o=(s,l,m,w)=>{let v=0,O;l&&(v=s.findIndex(l)),m&&(O=s.findIndex(m)),v===-1&&(v=s.length),(O===void 0||O===-1)&&(O=s.length);let j=s.slice(v,O);for(let f=0;f<j.length;f++){let h=j[f];if(!(h.priority===-1||w&&w(h))&&(h.priority<p||h.priority===p&&(y&&!h.hasWhere||h.order>=g)))return v+f}return v+j.length};if(a){let s=this.rules.findIndex(l=>l.media);if(s!==-1){let l=a.features["max-width"],m=a.features["min-width"];if(l&&m){let w=l.value-m.value;for(let v=n;v>=s;v--){i=v;let O=this.rules[v],j=O.media,f=j.features["max-width"],h=j.features["min-width"];if(!f||!h){i++;break}let u=f.value-h.value;if(u===w){if(y!==O.hasWhere)continue;if(p!==-1){let k=[this.rules[v]];for(let x=v-1;x>=s;x--){let R=this.rules[x];if(R.hasWhere!==y)break;let C=R.media,N=C.features["max-width"],E=C.features["min-width"];if(!N||!E||N.value-E.value!==u)break;k.unshift(this.rules[x])}i=o(this.rules,x=>x.media&&x.priority!==-1&&x.media.features["min-width"]&&x.media.features["max-width"])}break}else if(u>w)break}}else if(m)for(let w=s;w<=n;w++){i=w;let v=this.rules[w],O=v.media,j=O.features["max-width"],f=O.features["min-width"];if(j){if(f)break;continue}let h=f?.value;if(h===m.value){if(!y&&v.hasWhere){i++;continue}if(p!==-1)i=o(this.rules,u=>u.media,u=>u.media&&u.priority!==-1&&u.media.features["min-width"]&&u.media.features["max-width"],u=>!u.media.features["min-width"]&&!u.media.features["max-width"]);else for(let u=w;u<=n;u++){let k=this.rules[u],x=k.media,R=x.features["min-width"];if(!x.features["max-width"]){if(k.hasWhere!==y||R.value!==h||k.order>=g)break;i=u+1}}break}else{if(h>m.value)break;i++}}else if(l)for(let w=n;w>=s;w--){i=w;let v=this.rules[w],O=v.media,j=O.features["max-width"];if(O.features["min-width"])continue;let h=j?.value;if(!h||h>l.value){i++;break}else if(h===l.value){if(y&&!v.hasWhere)continue;if(p!==-1)i=o(this.rules,u=>u.media,u=>u.media&&u.priority!==-1&&u.media.features["min-width"]&&u.media.features["max-width"],u=>!u.media.features["min-width"]&&!u.media.features["max-width"]);else{let u=[this.rules[w]];for(let k=w-1;k>=s;k--){let x=this.rules[k],R=x.media,C=R.features["min-width"],N=R.features["max-width"];if(!C&&(!N||N.value!==h||x.hasWhere!==y))break;u.unshift(x)}for(let k=0;k<u.length;k++){let x=u[k];if(!x.media.features["min-width"]){if(x.order>=g)break;i=w-u.length+2+k}}}break}}}if(i===void 0)if(s===-1)i=n+1;else if(p!==-1)i=s+o(this.rules.slice(s),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(y){let l=s;for(;l<this.rules.length;l++){let m=this.rules[l];if(m.priority!==-1||!m.hasWhere||m.order>=g){i=l;break}}i===void 0&&(i=l)}else for(let l=s;l<=n;l++){i=l;let m=this.rules[l],w=m.media;if(m.priority!==-1||w.features["max-width"]||w.features["min-width"])break;if(m.hasWhere)i++;else if(m.order>=g)break}}else if(p===-1)if(y)i=this.rules.findIndex(s=>!s.hasWhere||s.media||s.priority!==-1||s.order>=g),i===-1&&(i=n+1);else{let s=0;for(;s<this.rules.length;s++){let l=this.rules[s];if(l.media||!l.hasWhere&&(l.order>=g||l.priority!==-1)){i=s;break}}i===void 0&&(i=s)}else i=o(this.rules,void 0,s=>s.media);if(this.rules.splice(i,0,r),this.ruleBy[c]=r,this.style){let s=this.style.sheet,l=0,m=w=>{let v=this.rules[w];if(v){if(!v.natives.length)return m(w-1);let O=v.natives[v.natives.length-1].cssRule;for(let j=0;j<s.cssRules.length;j++)if(s.cssRules[j]===O){l=j+1;break}}};m(i-1);for(let w=0;w<r.natives.length;)try{let v=r.natives[w];s.insertRule(v.text,l),v.cssRule=s.cssRules[l++],w++}catch(v){console.error(v),r.natives.splice(w,1)}}}}get text(){return this.rules.map(e=>e.text).join("")}},te=ne;oe(te,"root"),oe(te,"config",me),oe(te,"instances",[]),oe(te,"refresh",e=>{for(let r of ne.instances)r.refresh(e)});ge&&(window.MasterCSS=te);var We={store:"theme",init:!0},Fe=typeof document<"u",Ne=typeof localStorage<"u",pe=class{constructor(e,r=Fe?document.documentElement:null){this.settings=e;this.host=r;this.settings=e?J(We,e):We,this.settings.init&&this.init()}e=typeof matchMedia<"u"?matchMedia?.("(prefers-color-scheme:dark)"):void 0;i;t;init(){let e=this.settings.default,r=this.storage;r&&(e=r),this.value=e}get storage(){let{store:e}=this.settings;if(Ne&&e)return localStorage.getItem(e)}get systemValue(){return this.e.matches?"dark":"light"}set value(e){this.i=e,e==="system"?(this.e?.addEventListener?.("change",this.s),this.current=this.systemValue):(this.n(),this.current=e)}get value(){return this.i}set current(e){let r=this.t;this.t=e,this.host&&(r&&this.host.classList.remove(r),this.host.classList.contains(e)||(this.host.classList.add(e),this.host.style&&(this.host.style.colorScheme=e)))}get current(){return this.t}switch(e,r={store:!0,emit:!0}){e&&e!==this.value&&(this.value=e,Ne&&this.storage!==e&&this.settings.store&&localStorage.setItem(this.settings.store,e),r.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this})))}n(){this.e?.removeEventListener("change",this.s)}s=e=>{this.current=e.matches?"dark":"light"};destroy(){this.n()}};new te(window.masterCSSConfig);new pe(window.masterCSSThemeSettings);})();
|
|
1
|
+
(()=>{var Pe=Object.defineProperty;var Ue=(t,e,r)=>e in t?Pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var oe=(t,e,r)=>(Ue(t,typeof e!="symbol"?e+"":e,r),r);function Re(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function Ce(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Te(t){let e=[];return t.forEach(function(r,i){typeof r=="object"&&r!==null?Array.isArray(r)?e[i]=Te(r):Re(r)?e[i]=Ce(r):e[i]=K({},r):e[i]=r}),e}function Se(t,e){return e==="__proto__"?void 0:t[e]}function K(...t){let e={},r,i;return t.forEach(function(n){typeof n!="object"||n===null||Array.isArray(n)||Object.keys(n).forEach(function(o){if(i=Se(e,o),r=Se(n,o),r!==e)if(typeof r!="object"||r===null){e[o]=r;return}else if(Array.isArray(r)){e[o]=Te(r);return}else if(Re(r)){e[o]=Ce(r);return}else if(typeof i!="object"||i===null||Array.isArray(i)){e[o]=K({},r);return}else{e[o]=K(i,r);return}})}),e}var ye=[":disabled",":active",":focus",":hover"];var ie={"(":")","'":"'",'"':'"',"{":"}"};function ue(t){if(typeof CSS<"u")return CSS.escape(t);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let e=String(t),r=e.length,i=-1,n="",o,h=e.charCodeAt(0);if(r==1&&h==45)return"\\"+e;for(;++i<r;){if(o=e.charCodeAt(i),o==0){n+="\uFFFD";continue}if(o>=1&&o<=31||o==127||i==0&&o>=48&&o<=57||i==1&&o>=48&&o<=57&&h==45){n+="\\"+o.toString(16)+" ";continue}if(o>=128||o==45||o==95||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){n+=e.charAt(i);continue}n+="\\"+e.charAt(i)}return n}var He={unit:"",order:0,separators:[","]},fe=class{constructor(e,r={},i){this.className=e;this.meta=r;this.css=i;this.config=K(He,r.config);let{unit:n,order:o,colored:h,native:p,analyze:m,transform:l,declare:a,create:s}=this.config,{scope:c,important:b,functions:y}=i.config,{themeNames:k,colorNames:j,colorThemesMap:A,selectors:u,breakpoints:d,mediaQueries:f,themeAffectedClassesBy:w,globalValues:x}=i,R=w[e];this.order=o,s&&s.call(this,e);let C,W,E,Y,Z;if(r.origin==="semantics"){let[L,O]=r.value;Y=e.slice(L.length),C=O}else{let L;if(m)[L,E]=m.call(this,e);else if(r.origin==="match"){let T=e.indexOf(":");this.prefix=e.slice(0,T+1),this.prefix.includes("(")?(this.prefix=void 0,L=e):L=e.slice(T+1)}else r.origin==="symbol"&&(this.symbol=e[0],L=e.slice(1));Z=[];let O=this,N=this.values,F=[","];this.config.separators.length&&F.push(...this.config.separators);let S="",v=0;(function T(g,B,M,$=void 0,I=[],U=[],z){let Q=$===void 0,P,q=D=>D==="'"||D==='"',re=()=>P=S.length,G=()=>{if(S){let D=S,V=Q?D:S.slice(P);if(S="",X="",N&&V in N&&!I.includes(V)){let H=v;v=0,T(N[V].toString(),B,void 0,$,[...I,V],U,z),v=H,Q||(S=S.slice(0,P)+S)}else if(x&&V in x&&!U.includes(V)){let H=v;v=0,T(x[V].toString(),B,void 0,$,I,[...U,V],z),v=H,Q||(S=S.slice(0,P)+S)}else if(Q){let H=!z&&O.analyzeUnitValue(V,B);Z.push({value:H?.value??V,unit:H?.unit})}else{let H=!z&&O.analyzeUnitValue(V,B);S=H?D.slice(0,P)+H.value+H.unit:D}re()}},J=q(M);re();let X="";for(;v<g.length;v++){let D=g[v];if(D===M){if(J){S+=D;let V=0;for(let H=S.length-2;S[H]==="\\";H--)V++;if(V%2)continue}else G(),S+=D;return}else if(!J&&D in ie){let V=D==="("&&X&&y?.[X];V?.name&&(S=S.slice(0,S.length-X.length)+V.name,X=V.name),S+=D,v++;let H=ie[D];T(g,V?.unit??B,H,X||$||"",I,U,z||!!V?.transform),V?.transform&&(S=S.slice(0,P+X.length+1)+V.transform.call(O,S.slice(P+X.length+1,-1))+S.slice(-1)),Q&&(q(H)?(Z.push(S),S=""):G()),X=""}else if((D==="|"||D===" ")&&M!=="}"&&(!J||$==="path"))G(),Q||(S+=" ",P++);else{if(!J){if(D==="."){if(isNaN(+g[v+1]))break;g[v-1]==="-"&&(S+="0")}else if(F.includes(D)){G(),Q?Z.push(D):(S+=D,P++);continue}else if(Q&&(D==="#"&&(S||Z.length&&g[v-1]!=="|"&&Z[v-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(D)))break;X+=D}S+=D}}$===void 0&&G()})(L,n),Y=L.slice(v)}Y[0]==="!"&&(this.important=!0,Y=Y.slice(1));let we=L=>{let O=L.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((v,T)=>T%3?v:v.replace(/_/g," ")).join(""),N=[],F="",S=0;for(let v=0;v<O.length;v++){let T=O[v];if(T==="\\"){F+=T+O[++v];continue}!S&&T===","?(N.push(F),F=""):(F+=T,S&&T===")"?S--:T==="("&&S++)}return F&&N.push(F),N};this.prefixSelectors=E?we(E):[""];let be=Y.split("@"),ve=be[0];if(ve){this.vendorSuffixSelectors={};let L=(v,T,g,B)=>{for(let[M,$]of T)if(M.test(v)){for(let I of $)L(v.replace(M,I),T,g,!0);return}B&&g.push(v)},O=[];""in u?L(ve,u[""],O,!0):O.push(ve);let N={};for(let[v,T]of Object.entries(u)){if(!v)continue;let g=[];for(let B of O)L(B,T,g,!1);g.length&&(N[v]=g)}let F=(v,T)=>{let g=T.reduce((B,M)=>(B.push(...we(M)),B),[]);v in this.vendorSuffixSelectors?this.vendorSuffixSelectors[v].push(...g):this.vendorSuffixSelectors[v]=g},S=Object.keys(N);if(S.length)for(let v of S)F(v,N[v]);else F("",O);for(let v of Object.values(this.vendorSuffixSelectors))for(let T of v){this.hasWhere!==!1&&(this.hasWhere=T.includes(":where("));for(let g=0;g<ye.length;g++)if(T.includes(ye[g])){(this.priority===-1||this.priority>g)&&(this.priority=g);break}}}else this.vendorSuffixSelectors={"":[""]};for(let L=1;L<be.length;L++){let O=be[L];if(O)if(k.includes(O))this.theme=O;else if(O==="rtl"||O==="ltr")this.direction=O;else{let N,F,S=O.indexOf("_");if(S!==-1)N=O.slice(0,S),F=O.slice(S);else{let v=O.indexOf("(");v!==-1&&(N=O.slice(0,v),F=O.slice(v))}if(!N){N="media";let v=[];this.media={token:O,features:{}};let T=O.split("&");for(let g of T)if(g==="all"||g==="print"||g==="screen"||g==="speech")this.media.type=g;else if(g==="\u{1F5A8}")this.media.type="print";else if(g==="landscape"||g==="portrait")v.push("(orientation:"+g+")");else if(g==="motion"||g==="reduced-motion")v.push("(prefers-reduced-motion:"+(g==="motion"?"no-preference":"reduce")+")");else if(f&&g in f)v.push(f[g]);else{let B={token:g},M="",$="",I=0;g.startsWith("<=")?($="<=",M="max-width"):g.startsWith(">=")||d[g]?($=">=",M="min-width"):g.startsWith(">")?($=">",M="min-width",I=.02):g.startsWith("<")&&($="<",M="max-width",I=-.02);let U=$?g.replace($,""):g,z=d[U];switch(M){case"max-width":case"min-width":z?Object.assign(B,this.analyzeUnitValue(z.toString(),"px")):Object.assign(B,this.analyzeUnitValue(U,"px")),B.unit==="px"&&(B.value+=I),this.media.features[M]=B,v.push("("+M+":"+(B.value+B.unit)+")");break}}F="",this.media.type&&(F=this.media.type),v.length&&(F+=(F?" and ":"")+v.join(" and "))}F&&(this.at[N]=(N in this.at?this.at[N]+" and ":"")+F.replace(/_/g," "))}}let xe=(L,O)=>{let N,F=(T,g,B)=>{let M="";this.direction&&(M+="[dir="+this.direction+"] ");let $=this.prefixSelectors.map(z=>z+M),I=(z,Q)=>$.map(P=>(z?"."+z+" ":"")+(c?c+" ":"")+P).reduce((P,q)=>(P.push(B.reduce((re,G)=>(re.push(q+"."+ue(Q)+G),re),[]).join(",")),P),[]).join(","),U=I(g,e)+(R?Object.entries(R).filter(([z])=>this.theme||!h||!g||!z||z===g).map(([z,Q])=>Q.reduce((P,q)=>P+","+I(this.theme??((h||W)&&g||z),q),"")).join(""):"")+"{"+T+"}";for(let z of Object.keys(this.at).sort((Q,P)=>P==="supports"?-1:1))U="@"+z+" "+this.at[z]+"{"+U+"}";return U},S=[];if(Z){let T=this.theme?[this.theme,""]:[L],g,B;for(let M of Z)if(typeof M=="string")S.push(M);else{let $=M.value;if(M.unit)$+=M.unit;else if(h&&A&&j){let I=!1,U=!1;$=$.replace(new RegExp(`(^|,| |\\()((?:${j.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(z,Q,P,q)=>{U=!0;let re=A[P];if(re){let G;for(let J of T)if(G=re[J])break;if(G){I=!0;let J=G;if(q){let X=q.endsWith("%")?parseFloat(q)/100:+q;X=isNaN(X)?1:Math.min(Math.max(X,0),1),J+=Math.round(X*255).toString(16).toUpperCase().padStart(2,"0")}return Q+J}}return z}),U&&(B=I)}B!==void 0&&!g&&(g=B),S.push($)}if(O&&(g===void 0?L:!g))return;if(N=S.reduce((M,$,I)=>M+$+($===","||Z[I+1]===","||I===Z.length-1?"":" "),""),l&&(N=l.call(this,N,this.css.config)),h&&N==="current"&&(N="currentColor"),a){let M,$;if(Z.length===1){let I=Z[0];typeof I=="object"&&(M=I.value,$=I.unit)}C=a.call(this,$?M:N,$||"")}else C={[p]:N}}let v={};for(let T in C){let g=($,I)=>{let U=I+((this.important||b)&&!I.endsWith("!important")?"!important":"");$ in v?v[$].push(U):v[$]=[U]},B=T+":",M=C[T];if(typeof M=="object"){W=!0;for(let $ in M)g($,B+M[$])}else g(L,B+M.toString())}for(let T of Object.values(this.vendorSuffixSelectors))for(let g in v)this.natives.push({text:F(v[g].join(";"),g,T),theme:g})};if(this.theme)xe(this.theme,!1);else if(h)for(let L of k)xe(L,!0);else xe("",!1)}at={};priority=-1;natives=[];keyframeNames;config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(e=>e.text).join("")}resolveValue(e,r){return Number.isNaN(+e)?e:e/(r==="rem"||r==="em"?this.css.config.rootSize:1)+r}analyzeUnitValue(e,r){let i=r??this.config.unit;if(i){let n="",o=e.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(o)if(e.includes("/")){let[h,p]=e.split("/");return{value:+h/+p*100+"%",unit:n}}else{let h=+o[1];return n=o[3]||"",n||((i==="rem"||i==="em")&&(h=h/this.css.config.rootSize),n=i||""),{value:h,unit:n}}}}};var ae={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560};function le(t){t.startsWith("#")&&(t=t.slice(1));let e=t.match(/.{1,2}/g);return[parseInt(e[0],16),parseInt(e[1],16),parseInt(e[2],16)]}function he(t,e,r){return((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}function _(t){typeof t=="string"&&(t={"":t});let e=""in t,r=!1;for(let i in t)if(i&&+i>=100){r=!0;break}if(!r&&(!e||Object.keys(t).length>1)){let i=0,n="0"in t?le(t[0]):[0,0,0],o,h,p=[],m=()=>{let l=o-i,a=h.map((s,c)=>(s-n[c])/l);for(let s of p){let c=s-i,b=n.map((y,k)=>Math.round(y+a[k]*c));t[s]="#"+he.call(this,...b)}};for(let l=1;l<100;l++)l in t?(p.length?(o=l,h=le(t[l]),m(),p.length=0,n=h):n=le(t[l]),i=l):p.push(l);p.length&&(o=100,h="100"in t?le(t[100]):[255,255,255],m())}return e||(t[""]=t[r?"500":"50"]),t}var $e={black:"#000000",white:"#ffffff",slate:_({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:_({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:_({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:_({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:_({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:_({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:_({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:_({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:_({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:_({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:_({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:_({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:_({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:_({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:_({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:_({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:_({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:_({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:_({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:_({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};var Me="";var Ee={"::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 Oe={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 Be=["dark","light"];var se={content:"content-box",border:"border-box",padding:"padding-box"};var ce={min:"min-content",max:"max-content"};var ee={full:"100%",fit:"fit-content",max:"max-content",min:"min-content"};for(let t in ae)ee[t]=ae[t]/16+"rem";var We={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(t){let e=0;for(;e<t.length&&!(t[e]==="{"&&t[e-1]!=="\\");e++);return[t.slice(e),t.slice(0,e)]},declare(t){let e={},r=(l,a)=>{let s=a.indexOf(":");if(s!==-1){l in e||(e[l]={});let c=e[l],b=a.slice(0,s);b in c||(c[b]=a.slice(s+1))}},i=l=>{let a=(s,c)=>{let b=c.slice(ue(l.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of b)r(s,y)};if(this.theme){let s=l.natives.find(c=>c.theme===this.theme)??l.natives.find(c=>!c.theme);s&&a(this.theme,s.text)}else for(let s of l.natives)a(s.theme,s.text)},n=[],o="",h=()=>{o&&(n.push(o.replace(/ /g,"")),o="")},p=1;(function l(a){for(;p<t.length;p++){let s=t[p];if(!a){if(s===";"){h();continue}if(s==="}")break}if(o+=s,a===s){if(a==="'"||a==='"'){let c=0;for(let b=o.length-2;o[b]==="\\";b--)c++;if(c%2)continue}break}else s in ie&&a!=="'"&&a!=='"'&&(p++,l(ie[s]))}})(void 0),h();for(let l of n){let a=this.css.create(l);if(Array.isArray(a))for(let s of a)i(s);else a?i(a):r(this.theme??"",l)}let m={};for(let l in e)for(let[a,s]of Object.entries(e[l]))a in m?m[a][l]=s:m[a]={[l]:s};return m}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(t){return{["--"+this.prefix.slice(1,-1)]:t}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(t){let e={};switch(t){case"subpixel-antialiased":e["-webkit-font-smoothing"]=e["-moz-osx-font-smoothing"]="auto";break;case"antialiased":e["-webkit-font-smoothing"]="antialiased",e["-moz-osx-font-smoothing"]="grayscale";break}return e}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(t,e){return Ie.call(this,t+e)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(t,e){return Ie.call(this,t+e)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:ee,unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:ee},height:{match:"^h:.",unit:"rem",native:!0,values:ee},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:ee},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:ee},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t]},declare(t){let[e,r]=t.split(" x ");return{width:e,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,r]=t.split(" x ");return{"min-width":e,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,r]=t.split(" x ");return{"max-width":e,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(t,e){return{[this.prefix.slice(0,-1)]:t+e}}},lines:{match:"^lines:.",declare(t,e){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":t+e}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:ee},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:ee},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(t,e){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":t+e};case"y":return{"overflow-y":t+e}}return{overflow:t+e}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(t,e){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":t+e};case"y":return{"overscroll-behavior-y":t+e};default:return{"overscroll-behavior":t+e}}}},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(t,e){return{"user-drag":t+e,"-webkit-user-drag":t+e}}},userSelect:{native:!0,declare(t,e){return{"user-select":t+e,"-webkit-user-select":t+e}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(t,e){return{"font-size":t+e,"line-height":e==="em"?t+.875+e:`calc(${t}${e} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-fill-color":t+e}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(t,e){return{"-webkit-text-stroke-width":t+e}}},textStrokeColor:{match:"^text-stroke:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-stroke-color":t+e}}},textStroke:{unit:"rem",native:!0,declare(t,e){return{"-webkit-text-stroke":t+e}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{...se,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(t){return je.call(this,t)},delete(t){return Ae.call(this,t)},insert(){return Ne.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(t){return je.call(this,t)},delete(t){return Ae.call(this,t)},insert(){return Ne.call(this)}},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(t,e){return de(this.prefix,t+e,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(t,e){if(this.prefix){let i="",n=this.prefix.split("-");if(n.length>1)for(let o=1;o<n.length-1;o++)i+=n[o][0];else i=this.prefix.slice(1,-1);switch(i){case"t":return{"border-top-left-radius":t+e,"border-top-right-radius":t+e};case"tl":case"lt":return{"border-top-left-radius":t+e};case"rt":case"tr":return{"border-top-right-radius":t+e};case"b":return{"border-bottom-left-radius":t+e,"border-bottom-right-radius":t+e};case"bl":case"lb":return{"border-bottom-left-radius":t+e};case"br":case"rb":return{"border-bottom-right-radius":t+e};case"l":return{"border-top-left-radius":t+e,"border-bottom-left-radius":t+e};case"r":return{"border-top-right-radius":t+e,"border-bottom-right-radius":t+e};default:return{"border-radius":t+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"]:t+e}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(t,e){return de(this.prefix,t+e,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(t,e){return de(this.prefix,t+e,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(t,e){return de(this.prefix,t+e)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(t,e){return{"-webkit-background-clip":t+e,"background-clip":t+e}},values:se},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:se},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"backdrop-filter":t+e,"-webkit-backdrop-filter":t+e}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridColumns:{match:"^grid-cols:.",declare(t,e){return{display:"grid","grid-template-columns":"repeat("+t+e+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridRows:{declare(t,e){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+t+e+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:ce},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:ce,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:ce},gridTemplateRows:{native:!0,unit:"rem",values:ce},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(t,e){switch(this.prefix[4]){case"x":return{"column-gap":t+e};case"y":return{"row-gap":t+e};default:return{gap:t+e}}}},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(t,e){return{"box-decoration-break":t+e,"-webkit-box-decoration-break":t+e}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(t,e){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":t+e,"scroll-margin-right":t+e};case"y":return{"scroll-margin-top":t+e,"scroll-margin-bottom":t+e};case"l":return{"scroll-margin-left":t+e};case"r":return{"scroll-margin-right":t+e};case"t":return{"scroll-margin-top":t+e};case"b":return{"scroll-margin-bottom":t+e}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:t+e}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(t,e){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":t+e,"scroll-padding-right":t+e};case"y":return{"scroll-padding-top":t+e,"scroll-padding-bottom":t+e};case"l":return{"scroll-padding-left":t+e};case"r":return{"scroll-padding-right":t+e};case"t":return{"scroll-padding-top":t+e};case"b":return{"scroll-padding-bottom":t+e}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:t+e}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{...se,margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{...se,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(t,e){return{"mask-image":t+e,"-webkit-mask-image":t+e}}}};function je(t){if(!this.css.config.keyframes)return;let e=(this.meta.origin==="symbol"?t.slice(this.meta.config.symbol.length):t.slice(t.indexOf(":")+1)).split("|").filter(r=>r in this.css.config.keyframes);e?.length&&(this.keyframeNames=e)}function Ae(){if(this.keyframeNames?.length){let t=this.css.rules[0];for(let e of this.keyframeNames){let r=this.css.keyframes[e];if(!--r.count){let i=t.natives.indexOf(r.native);this.css.style.sheet.deleteRule(i),t.natives.splice(i,1),delete this.css.keyframes[e]}}t.natives.length||this.css.rules.splice(0,1)}}function Ne(){if(this.keyframeNames){let{config:t,keyframes:e,style:r,rules:i}=this.css,n=r?.sheet;for(let o of this.keyframeNames)if(o in e)e[o].count++;else{let h={text:`@keyframes ${o} {`+Object.entries(t.keyframes[o]).map(([m,l])=>`${m} {${Object.entries(l).map(([a,s])=>a+": "+s).join(";")}}`).join(",")+"}",theme:""},p;if(Object.keys(e).length?(p=i[0]).natives.push(h):i.splice(0,0,p={natives:[h],get text(){return this.natives.map(m=>m.text).join("")}}),n){let m;for(let l=0;l<n.cssRules.length;l++){let a=n.cssRules[l];if(a.constructor.name!=="CSSKeyframesRule")break;if(a.name===o){m=a;break}}if(m)h.cssRule=m;else{let l=p.natives.length-1;n.insertRule(h.text,l),h.cssRule=n.cssRules[l]}}e[o]={native:h,count:1}}}}function Ie(t){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:t};let r=this.prefix[0]==="m"?"margin":"padding",i=r+"-left",n=r+"-right",o=r+"-top",h=r+"-bottom";switch(this.prefix[1]){case"x":return{[i]:t,[n]:t};case"y":return{[o]:t,[h]:t};case"l":return{[i]:t};case"r":return{[n]:t};case"t":return{[o]:t};case"b":return{[h]:t};default:return{[r]:t}}}function de(t,e,r=""){let i="border-";r&&(r="-"+r);let n=/^b(order)?-?(.)?/.exec(t)[2],o=i+"left"+r,h=i+"right"+r,p=i+"top"+r,m=i+"bottom"+r;switch(n){case"x":return{[o]:e,[h]:e};case"y":return{[p]:e,[m]:e};case"l":return{[o]:e};case"r":return{[h]:e};case"t":return{[p]:e};case"b":return{[m]:e};default:return{["border"+r]:e}}}var Le={fade:{from:{opacity:0},to:{opacity:0}},flash:{"from,50%,to":{opacity:1},"25%,75%":{opacity:0}},float:{"0%":{transform:"none"},"50%":{transform:"translateY(-1.25rem)"},"100%":{transform:"none"}},heart:{"0%":{transform:"scale(1)"},"14%":{transform:"scale(1.3)"},"28%":{transform:"scale(1)"},"42%":{transform:"scale(1.3)"},"70%":{transform:"scale(1)"}},jump:{"0%,100%":{transform:"translateY(-25%)","animation-timing-function":"cubic-bezier(0.8, 0, 1, 1)"},"50%":{transform:"translateY(0)","animation-timing-function":"cubic-bezier(0, 0, 0.2, 1)"}},ping:{"75%,100%":{transform:"scale(2)",opacity:0}},pulse:{"0%":{transform:"none"},"50%":{transform:"scale(1.05)"},"100%":{transform:"none"}},rotate:{from:{transform:"rotate(-360deg)"},to:{transform:"none"}},shake:{"0%":{transform:"none"},"6.5%":{transform:"translateX(-6px) rotateY(-9deg)"},"18.5%":{transform:"translateX(5px) rotateY(7deg)"},"31.5%":{transform:"translateX(-3px) rotateY(-5deg)"},"43.5%":{transform:"translateX(2px) rotateY(3deg)"},"50%":{transform:"none"}},zoom:{from:{transform:"scale(0)"},"100%":{transform:"none"}}};var ke={$:{name:"var",transform(t){return"--"+t}},calc:{transform(t){let e=m=>m==="+"||m==="-"||m==="*"||m==="/",r="",i,n="",o=!1,h=!1,p=(m,l="",a="")=>{if(i===2&&!h){let s=this.analyzeUnitValue(n,ke.calc.unit);s&&(n=s.value+s.unit)}r+=n+l+m+a,i=null,h=!1,n=""};for(let m=0;m<t.length;m++){let l=t[m];if(l==="("||l===")")o=l===")",p(l);else if(l===",")p(l,""," ");else{switch(i){case 1:break;case 2:if(e(l)){p(l," "," ");continue}else/[0-9]/.test(l)||(h=!0);break;default:o&&(r+=" "),isNaN(+l)?e(l)||(i=1):i=2;break}i?n+=l:r+=l}}return p(""),r}},translate:{unit:"rem"},translateX:{unit:"rem"},translateY:{unit:"rem"},translateZ:{unit:"rem"},translate3d:{unit:"rem"},skew:{unit:"deg"},skewX:{unit:"deg"},skewY:{unit:"deg"},skewZ:{unit:"deg"},skew3d:{unit:"deg"},rotate:{unit:"deg"},rotateX:{unit:"deg"},rotateY:{unit:"deg"},rotateZ:{unit:"deg"},rotate3d:{unit:"deg"},blur:{unit:"rem"},"drop-shadow":{unit:"rem"},"hue-rotate":{unit:"deg"},rgb:{unit:""},rgba:{unit:""},hsl:{unit:""},hsla:{unit:""}};var ze="highest";var me={breakpoints:ae,colors:$e,rootSize:16,scope:Me,selectors:Ee,semantics:Oe,themes:Be,rules:We,override:!1,observe:!0,important:!1,functions:ke,keyframes:Le,precedence:ze};var De=[",",".","#","[","!","*",">","+","~",":","@"];var ge=typeof window<"u",Fe=()=>{let t=document.createElement("style");return t.id="master",t.setAttribute("blocking","render"),t},ne=class{constructor(e){this.config=e;this.config?.override||(this.config=K(me,e)),this.cache(),ge&&this.config.observe&&this.observe(document),ne.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer=ge?new MutationObserver(e=>{let r={},i=[],n=[],o=[],h=(a,s)=>{s?a.classList.forEach(m):a.classList.forEach(p);let c=a.children;for(let b=0;b<c.length;b++){let y=c[b];y.classList&&(n.push(y),h(y,s))}},p=a=>{a in r?r[a]++:r[a]=1},m=a=>{a in r?r[a]--:a in this.countBy&&(r[a]=-1)},l=(a,s)=>{for(let c=0;c<a.length;c++){let b=a[c];b.classList&&!n.includes(b)&&!o.includes(b)&&(b.isConnected!==s?(n.push(b),h(b,s)):o.push(b))}};for(let a=0;a<e.length;a++){let s=e[a],{addedNodes:c,removedNodes:b,type:y,target:k}=s;if(y==="attributes"){if(i.find(j=>j.target===k))continue;i.push(s)}else l(c,!1),(!k.isConnected||!n.includes(k))&&l(b,!0)}if(!(!i.length&&!Object.keys(r).length)){for(let{oldValue:a,target:s}of i){let c=n.includes(s),b=s.classList,y=a?a.split(" "):[];if(c){if(s.isConnected)continue;for(let k of y)b.contains(k)||m(k)}else if(s.isConnected){b.forEach(k=>{y.includes(k)||p(k)});for(let k of y)b.contains(k)||m(k)}}for(let a in r){let s=r[a],c=(this.countBy[a]||0)+s;c===0?(delete this.countBy[a],this.delete(a)):(a in this.countBy||this.insert(a),this.countBy[a]=c)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:e,classes:r,selectors:i,themes:n,colors:o,values:h,breakpoints:p,mediaQueries:m,rules:l}=this.config;function a(u){return u.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function s(u,d,f="",w={}){let x=E=>E?(f?f+"-":"")+E:f,R=Object.entries(u),C=[],W=[];for(let E of R){let Y=E[1];(typeof Y=="object"&&!Array.isArray(Y)?C:W).push(E)}for(let[E,Y]of C)s(Y,d,x(E),w);if(d&&f)W.length&&(w[f]=W.reduce((E,[Y,Z])=>(E[Y]=Z,E),{}));else for(let[E,Y]of W)w[x(E)]=Y;return w}if(e)for(let[u,d]of Object.entries(s(e,!0)))this.semantics.push([new RegExp("^"+a(u)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[u,d]]);if(i)for(let[u,d]of Object.entries(s(i,!1))){let f=new RegExp(a(u)+"(?![a-z-])");for(let w of Array.isArray(d)?d:[d]){let x=w.match(/^::-[a-z]+-/m)?.[0]??"",R=this.selectors[x];R||(R=this.selectors[x]=[]);let C=R.find(([W])=>W===f);C||(C=[f,[]],R.push(C)),C[1].push(w)}}h&&(this.globalValues=s(h,!1)),p&&(this.breakpoints=s(p,!1)),m&&(this.mediaQueries=s(m,!1));let c=r?s(r,!1):{},b=n&&!Array.isArray(n)?Object.entries(n).filter(([,{classes:u}])=>u).reduce((u,[d,{classes:f}])=>(u[d]=s(f,!1),u),{}):{},y=[...Object.keys(c),...Object.entries(b).flatMap(([u,d])=>Object.keys(d))],k=u=>{if(u in this.classes)return;let d=this.classes[u]=[],f=(w,x)=>{if(!x)return;let R=Array.isArray(x)?x:x.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let C of R){let W=E=>{E in this.themeAffectedClassesBy?w in this.themeAffectedClassesBy[E]?this.themeAffectedClassesBy[E][w].push(u):this.themeAffectedClassesBy[E][w]=[u]:this.themeAffectedClassesBy[E]={[w]:[u]},d.includes(E)||d.push(E)};if(y.includes(C)){k(C);for(let E of this.classes[C])W(E)}else W(C)}};f("",c?.[u]);for(let[w,x]of Object.entries(b))f(w,x?.[u])};for(let u of y)k(u);for(let u in this.themeAffectedClassesBy){let d=this.classesBy[u]=[];for(let f of Object.values(this.themeAffectedClassesBy[u]))for(let w of f)d.includes(w)||d.push(w)}let j=(u,d)=>{if(!d)return;let f=s(d,!0);for(let[w,x]of Object.entries(f)){let R=typeof x=="string"?{"":x}:x;for(let[C,W]of Object.entries(R)){let E=w+(C?"-"+C:"");E in this.colorThemesMap?this.colorThemesMap[E][u]=W:this.colorThemesMap[E]={[u]:W}}}for(let w in d)this.colorNames.includes(w)||this.colorNames.push(w)};if(j("",o),n)if(Array.isArray(n))this.themeNames.push(...n);else for(let u in n){let d=n[u];j(u,d.colors),this.themeNames.push(u)}let A=u=>{for(let[d,f]of Object.entries(this.colorThemesMap))for(let[w,x]of Object.entries(f))x.startsWith("#")||u(d,f,w,x)};if(A((u,d,f,w)=>{let x=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(w);if(x){let R="#"+he(+x[1],+x[2],+x[3]);x[4]&&(R+=Math.round(255*+x[4]).toString(16)),d[f]=R}}),A((u,d,f,w)=>{let[x,R]=w.split("/"),C=this.colorThemesMap[x];if(C){let W=(f?C[f]:void 0)??C[""];d[f]=R?W.slice(0,7)+Math.round(255*+R).toString(16):W}else console.warn(`\`${w}\` doesn't exist in the extended config \`.colors\``),delete d[f],Object.keys(d).length||delete this.colorThemesMap[u]}),l)for(let u in l){let d=l[u],{native:f,values:w,colored:x}=d,R=d.match;if(d.id=u,d.native=f===!0?u.replace(/(?!^)[A-Z]/g,C=>"-"+C).toLowerCase():void 0,w&&(this.values[u]=s(w,!1)),R){let C=Object.keys(this.values[u]??{});R.includes("$values")&&(R=C.length?R.replace(/\$values/,C.join("|")):R.replace(/(?:\|)?\$values/,"")),x&&R.includes("$colors")&&(R=this.colorNames.length?R.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):R.replace(/(?:\|)?\$colors/,"")),this.matches[u]=new RegExp(R)}}}observe(e,r={subtree:!0,childList:!0}){if(this.root!==e){if(ge&&e){this.root=e;let i=e===document;i&&(ne.root=this),this.host=i?document.documentElement:root.host;let n=i?document.head:e,o=i?document.styleSheets:e.styleSheets;for(let p of o){let{href:m,ownerNode:l}=p;(l.id==="master"||m&&m.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(m))&&(this.style=l)}if(this.style)for(let p=0;p<this.style.sheet.cssRules.length;p++){let m=this.style.sheet.cssRules[p];if(m.constructor.name==="CSSKeyframesRule")continue;let l=s=>{if(s.selectorText){let b=s.selectorText.split(", ")[0].split(" ");for(let y=0;y<b.length;y++){let k=b[y];if(k[0]==="."){let j=k.slice(1),A="";for(let u=0;u<j.length;u++){let d=j[u],f=j[u+1];if(d==="\\"){if(u++,f!=="\\"){A+=f;continue}}else if(De.includes(d))break;A+=d}if(!(A in this.ruleBy)&&!(A in this.classes)){let u=this.create(A)[0];if(u)return u}}}}else if(s.cssRules)for(let c=0;c<s.cssRules.length;c++){let b=l(s.cssRules[c]);if(b)return b}},a=l(m);if(a){this.rules.push(a),this.ruleBy[a.className]=a;for(let s=0;s<a.natives.length;s++)a.natives[s].cssRule=this.style.sheet.cssRules[p+s];p+=a.natives.length-1,a.config.insert?.call(a)}}else switch(this.style=Fe(),this.config.precedence){case"highest":console.log(i?document.body:e),(i?document.body:e).append(this.style);break;case"higher":n.append(this.style);break;default:let p=n.querySelector('link[rel="styleSheet"], style');p?p.before(this.style):n.append(this.style);break}let h=p=>{p.forEach(m=>{m in this.countBy?this.countBy[m]++:(this.countBy[m]=1,this.insert(m))})};h(this.host.classList),r.subtree&&this.host.querySelectorAll("[class]").forEach(p=>h(p.classList)),this.observer.observe(e,{...r,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer?.disconnect?.(),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style?.sheet;if(e?.cssRules)for(let r=e.cssRules.length-1;r>=0;r--)e.deleteRule(r);this.style?.remove(),this.style=null,this.root=null}match(e){for(let r in this.config.rules){let i=this.config.rules[r],n=this.matches[r],{symbol:o,native:h}=i;if(n&&n.test(e))return{origin:"match",config:i};if(o&&e.startsWith(o))return{origin:"symbol",config:i};if(h&&e.startsWith(h+":"))return{origin:"match",config:i}}for(let r of this.semantics)if(e.match(r[0]))return{origin:"semantics",value:r[1]}}create(e){let r=i=>{if(i in this.ruleBy)return this.ruleBy[i];let n=this.match(i);if(n)return new fe(i,n,this)};return(e in this.classes?this.classes[e].map(i=>r(i)):[r(e)]).filter(i=>i&&i.text)}refresh(e){if(e?.override?this.config=e:this.config=K(me,e),this.cache(),!this.style)return;let r=Fe();this.style.replaceWith(r),this.style=r,this.rules.length=0,this.ruleBy={};for(let i in this.countBy)this.insert(i)}destroy(){let e=ne.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let r=this.style?.sheet,i=n=>{let o=this.ruleBy[n];if(!(!o||n in this.classesBy&&this.classesBy[n].some(h=>h in this.countBy))){if(r&&o.natives.length){let h=o.natives[0];for(let p=0;p<r.cssRules.length;p++)if(r.cssRules[p]===h.cssRule){for(let l=0;l<o.natives.length;l++)r.deleteRule(p);break}}this.rules.splice(this.rules.indexOf(o),1),delete this.ruleBy[n],o.config.delete&&o.config.delete.call(o,n)}};if(e in this.classes){for(let n of this.classes[e])n in this.countBy||i(n);delete this.ruleBy[e]}else i(e)}insert(e){let r=this.create(e);return r.length?(this.insertRules(r),!0):!1}insertRules(e){for(let r of e){if(this.ruleBy[r.className])continue;let i,n=this.rules.length-1,{media:o,order:h,priority:p,hasWhere:m,className:l}=r,a=(s,c,b,y)=>{let k=0,j;c&&(k=s.findIndex(c)),b&&(j=s.findIndex(b)),k===-1&&(k=s.length),(j===void 0||j===-1)&&(j=s.length);let A=s.slice(k,j);for(let u=0;u<A.length;u++){let d=A[u];if(!(d.priority===-1||y&&y(d))&&(d.priority<p||d.priority===p&&(m&&!d.hasWhere||d.order>=h)))return k+u}return k+A.length};if(o){let s=this.rules.findIndex(c=>c.media);if(s!==-1){let c=o.features["max-width"],b=o.features["min-width"];if(c&&b){let y=c.value-b.value;for(let k=n;k>=s;k--){i=k;let j=this.rules[k],A=j.media,u=A.features["max-width"],d=A.features["min-width"];if(!u||!d){i++;break}let f=u.value-d.value;if(f===y){if(m!==j.hasWhere)continue;if(p!==-1){let w=[this.rules[k]];for(let x=k-1;x>=s;x--){let R=this.rules[x];if(R.hasWhere!==m)break;let C=R.media,W=C.features["max-width"],E=C.features["min-width"];if(!W||!E||W.value-E.value!==f)break;w.unshift(this.rules[x])}i=a(this.rules,x=>x.media&&x.priority!==-1&&x.media.features["min-width"]&&x.media.features["max-width"])}break}else if(f>y)break}}else if(b)for(let y=s;y<=n;y++){i=y;let k=this.rules[y],j=k.media,A=j.features["max-width"],u=j.features["min-width"];if(A){if(u)break;continue}let d=u?.value;if(d===b.value){if(!m&&k.hasWhere){i++;continue}if(p!==-1)i=a(this.rules,f=>f.media,f=>f.media&&f.priority!==-1&&f.media.features["min-width"]&&f.media.features["max-width"],f=>!f.media.features["min-width"]&&!f.media.features["max-width"]);else for(let f=y;f<=n;f++){let w=this.rules[f],x=w.media,R=x.features["min-width"];if(!x.features["max-width"]){if(w.hasWhere!==m||R.value!==d||w.order>=h)break;i=f+1}}break}else{if(d>b.value)break;i++}}else if(c)for(let y=n;y>=s;y--){i=y;let k=this.rules[y],j=k.media,A=j.features["max-width"];if(j.features["min-width"])continue;let d=A?.value;if(!d||d>c.value){i++;break}else if(d===c.value){if(m&&!k.hasWhere)continue;if(p!==-1)i=a(this.rules,f=>f.media,f=>f.media&&f.priority!==-1&&f.media.features["min-width"]&&f.media.features["max-width"],f=>!f.media.features["min-width"]&&!f.media.features["max-width"]);else{let f=[this.rules[y]];for(let w=y-1;w>=s;w--){let x=this.rules[w],R=x.media,C=R.features["min-width"],W=R.features["max-width"];if(!C&&(!W||W.value!==d||x.hasWhere!==m))break;f.unshift(x)}for(let w=0;w<f.length;w++){let x=f[w];if(!x.media.features["min-width"]){if(x.order>=h)break;i=y-f.length+2+w}}}break}}}if(i===void 0)if(s===-1)i=n+1;else if(p!==-1)i=s+a(this.rules.slice(s),void 0,c=>c.media.features["max-width"]||c.media.features["min-width"]);else if(m){let c=s;for(;c<this.rules.length;c++){let b=this.rules[c];if(b.priority!==-1||!b.hasWhere||b.order>=h){i=c;break}}i===void 0&&(i=c)}else for(let c=s;c<=n;c++){i=c;let b=this.rules[c],y=b.media;if(b.priority!==-1||y.features["max-width"]||y.features["min-width"])break;if(b.hasWhere)i++;else if(b.order>=h)break}}else if(p===-1){if(m)i=this.rules.findIndex(s=>!s.hasWhere||s.media||s.priority!==-1||s.order>=h),i===-1&&(i=n+1);else{let s=0;for(;s<this.rules.length;s++){let c=this.rules[s];if(c.media||!c.hasWhere&&(c.order>=h||c.priority!==-1)){i=s;break}}i===void 0&&(i=s)}!i&&Object.keys(this.keyframes).length&&i++}else i=a(this.rules,void 0,s=>s.media);if(this.rules.splice(i,0,r),this.ruleBy[l]=r,this.style){let s=this.style.sheet,c=0,b=y=>{let k=this.rules[y];if(k){if(!k.natives.length)return b(y-1);let j=k.natives[k.natives.length-1].cssRule;for(let A=0;A<s.cssRules.length;A++)if(s.cssRules[A]===j){c=A+1;break}}};b(i-1);for(let y=0;y<r.natives.length;)try{let k=r.natives[y];s.insertRule(k.text,c),k.cssRule=s.cssRules[c++],y++}catch(k){console.error(k),r.natives.splice(y,1)}}r.config.insert?.call(r)}}get text(){return this.rules.map(e=>e.text).join("")}},te=ne;oe(te,"root"),oe(te,"config",me),oe(te,"instances",[]),oe(te,"refresh",e=>{for(let r of ne.instances)r.refresh(e)});ge&&(window.MasterCSS=te);var Ve={store:"theme",init:!0},Ye=typeof document<"u",_e=typeof localStorage<"u",pe=class{constructor(e,r=Ye?document.documentElement:null){this.settings=e;this.host=r;this.settings=e?K(Ve,e):Ve,this.settings.init&&this.init()}e=typeof matchMedia<"u"?matchMedia?.("(prefers-color-scheme:dark)"):void 0;r;t;init(){let e=this.settings.default,r=this.storage;r&&(e=r),this.value=e}get storage(){let{store:e}=this.settings;if(_e&&e)return localStorage.getItem(e)}get systemValue(){return this.e.matches?"dark":"light"}set value(e){this.r=e,e==="system"?(this.e?.addEventListener?.("change",this.i),this.current=this.systemValue):(this.s(),this.current=e)}get value(){return this.r}set current(e){let r=this.t;this.t=e,this.host&&(r&&this.host.classList.remove(r),this.host.classList.contains(e)||(this.host.classList.add(e),this.host.style&&(this.host.style.colorScheme=e)))}get current(){return this.t}switch(e,r={store:!0,emit:!0}){e&&e!==this.value&&(this.value=e,_e&&this.storage!==e&&this.settings.store&&localStorage.setItem(this.settings.store,e),r.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this})))}s(){this.e?.removeEventListener("change",this.i)}i=e=>{this.current=e.matches?"dark":"light"};destroy(){this.s()}};new te(window.masterCSSConfig);new pe(window.masterCSSThemeSettings);})();
|