You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
144 KiB
JavaScript
23 lines
144 KiB
JavaScript
5 months ago
|
import{a as We,b as O,c as I,d as S,e as Ne,f as oe,g as ke,h as Je}from"./chunk-V2K3XTS4.mjs";import{a as qe}from"./chunk-AZANAYY2.mjs";import{a as Q,b as ne,c as we,d as ze,e as z,f as ce,g as q,h as M,i as Me,j as F,k as D,l as B,m as o,n as Le,o as Z,p as _,q as P,r as Be,s as ee,t as J}from"./chunk-ZH25KTLC.mjs";var Ge="4.0.8";function H(r){if(r.indexOf("(")===-1)return le(r);let t=M(r);return Se(t),r=q(t),r=We(r),r}function le(r,t=!1){let n="";for(let e=0;e<r.length;e++){let l=r[e];l==="\\"&&r[e+1]==="_"?(n+="_",e+=1):l==="_"&&!t?n+=" ":n+=l}return n}function Se(r){for(let t of r)switch(t.kind){case"function":{if(t.value==="url"||t.value.endsWith("_url")){t.value=le(t.value);break}if(t.value==="var"||t.value.endsWith("_var")||t.value==="theme"||t.value.endsWith("_theme")){t.value=le(t.value);for(let n=0;n<t.nodes.length;n++){if(n==0&&t.nodes[n].kind==="word"){t.nodes[n].value=le(t.nodes[n].value,!0);continue}Se([t.nodes[n]])}break}t.value=le(t.value),Se(t.nodes);break}case"separator":case"word":{t.value=le(t.value);break}default:Yt(t)}}function Yt(r){throw new Error(`Unexpected value: ${r}`)}var Zt=58,Ye=45,Ze=97,He=122;function*Xe(r,t){let n=O(r,":");if(t.theme.prefix){if(n.length===1||n[0]!==t.theme.prefix)return null;n.shift()}let e=n.pop(),l=[];for(let h=n.length-1;h>=0;--h){let g=t.parseVariant(n[h]);if(g===null)return;l.push(g)}let f=!1;e[e.length-1]==="!"?(f=!0,e=e.slice(0,-1)):e[0]==="!"&&(f=!0,e=e.slice(1)),t.utilities.has(e,"static")&&!e.includes("[")&&(yield{kind:"static",root:e,variants:l,important:f,raw:r});let[s,p=null,m]=O(e,"/");if(m)return;let c=p===null?null:Ke(p);if(p!==null&&c===null)return;if(s[0]==="["){if(s[s.length-1]!=="]")return;let h=s.charCodeAt(1);if(h!==Ye&&!(h>=Ze&&h<=He))return;s=s.slice(1,-1);let g=s.indexOf(":");if(g===-1||g===0||g===s.length-1)return;let y=s.slice(0,g),v=H(s.slice(g+1));yield{kind:"arbitrary",property:y,value:v,modifier:c,variants:l,important:f,raw:r};return}let d;if(s[s.length-1]==="]"){let h=s.indexOf("-[");if(h===-1)return;let g=s.slice(0,h);if(!t.utilities.has(g,"functional"))return;let y=s.slice(h+1);d=[[g,y]]}else if(s[s.length-1]===")"){let h=s.indexOf("-(");if(h===-1)return;let g=s.slice(0,h);if(!t.utilities.has(g,"functional"))return;let y=s.slice(h+2,-1),v=O(y,":"),b=null;if(v.length===2&&(b=v[0],y=v[1]),y[0]!=="-"&&y[1]!=="-")return;d=[[g,b===null?`[var(${y})]`:`[${b}:var(${y})]`]]}else d=et(s,h=>t.utilities.has(h,"functional"));for(let[h,g]of d){let y={kind:"functional",root:h,modifier:c,value:null,variants:l,important:f,raw:r};if(g===null){yield y;continue}{let v=g.indexOf("[");if(v!==-1){if(g[g.length-1]!=="]")return;let A=H(g.slice(v+1,-1)),T="";for(let N=0;N<A.length;N++){let R=A.charCodeAt(N);if(R===Zt){T=A.slice(0,N),A=A.slice(N+1);break}if(!(R===Ye||R>=Ze&&R<=He))break}if(A.length===0||A.trim().length===0)continue;y.value={kind:"arbitrary",dataType:T||null,value:A}}else{let A=p===null||y.modifier?.kind==="arbitrary"?null:`${g}/${p}`;y.value={kind:"named",value:g,fraction:A}}}yield y}}function Ke(r){if(r[0]==="["&&r[r.length-1]==="]"){let t=H(r.slice(1,-1));return t.length===0||t.trim().length===0?null:{kind:"arbitrary",value:t}}if(r[0]==="("&&r[r.length-1]===")"){let t=H(r.slice(1,-1));return t.length===0||t.trim().length===0||t[0]!=="-"&&t[1]!=="-"?null:{kind:"arbitrary",value:`var(${t})`}}return{kind:"named",value:r}}function Qe(r,t){if(r[0]==="["&&r[r.length-1]==="]"){if(r[1]==="@"&&r.includes("&"))return null;let n=H(r.slice(1,-1));if(n.length===0||n.trim().length===0)return null;let e=n[0]===">"||n[0]==="+"||n[0]==="~";return!e&&n[0]!=="@"&&!n.includes("&")&&(n=`&:is(${n})`),{kind:"arbitrary",selector:n,relative:e}}{let[n,e=null,l]=O(r,"/");if(l)return null;let f=et(n,s=>t.variants.has(s));for(let[s,p]of f)switch(t.variants.kind(s)){case"static":return p!==null||e!==null?null:{kind:"static",root:s};case"functional":{let m=e===null?null:Ke(e);if(e!==null&&m===null)return null;if(p===null)return{kind:"functional",root:s,modifier:m,value:null};if(p[p.length-1]==="]"){if(p[0]!=="[")continue;let c=H(p.slice(1,-1));return c.length===0||c.trim().
|
||
|
|
||
|
${J([h])}
|
||
|
Relies on:
|
||
|
|
||
|
${J([y])}`)}c.add(h);for(let y of f.get(h))for(let v of s.get(y))g.push(h),d(v,g),g.pop();p.add(h),c.delete(h),m.push(h)}}for(let h of l)d(h);return P(m,(h,{replaceWith:g})=>{if(h.kind!=="at-rule"||h.name!=="@apply")return;let y=h.params.split(/\s+/g);{let v=X(y,t,{onInvalidCandidate:A=>{throw new Error(`Cannot apply unknown utility class: ${A}`)}}).astNodes,b=[];for(let A of v)if(A.kind==="rule")for(let T of A.nodes)b.push(T);else b.push(A);g(b)}}),n}function*vt(r,t){for(let n of r.params.split(/\s+/g))for(let e of t.parseCandidate(n))switch(e.kind){case"arbitrary":break;case"static":case"functional":yield e.root;break;default:}}async function _e(r,t,n,e=0){let l=0,f=[];return P(r,(s,{replaceWith:p})=>{if(s.kind==="at-rule"&&(s.name==="@import"||s.name==="@reference")){let m=ur(M(s.params));if(m===null)return;s.name==="@reference"&&(m.media="reference"),l|=2;let{uri:c,layer:d,media:h,supports:g}=m;if(c.startsWith("data:")||c.startsWith("http://")||c.startsWith("https://"))return;let y=Z({},[]);return f.push((async()=>{if(e>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${c}\` in \`${t}\`)`);let v=await n(c,t),b=Q(v.content);await _e(b,v.base,n,e+1),y.nodes=fr([Z({base:v.base},b)],d,h,g)})()),p(y),1}}),f.length>0&&await Promise.all(f),l}function ur(r){let t,n=null,e=null,l=null;for(let f=0;f<r.length;f++){let s=r[f];if(s.kind!=="separator"){if(s.kind==="word"&&!t){if(!s.value||s.value[0]!=='"'&&s.value[0]!=="'")return null;t=s.value.slice(1,-1);continue}if(s.kind==="function"&&s.value.toLowerCase()==="url"||!t)return null;if((s.kind==="word"||s.kind==="function")&&s.value.toLowerCase()==="layer"){if(n)return null;if(l)throw new Error("`layer(\u2026)` in an `@import` should come before any other functions or conditions");"nodes"in s?n=q(s.nodes):n="";continue}if(s.kind==="function"&&s.value.toLowerCase()==="supports"){if(l)return null;l=q(s.nodes);continue}e=q(r.slice(f));break}}return t?{uri:t,layer:n,media:e,supports:l}:null}function fr(r,t,n,e){let l=r;return t!==null&&(l=[D("@layer",t,l)]),n!==null&&(l=[D("@media",n,l)]),e!==null&&(l=[D("@supports",e[0]==="("?e:`(${e})`,l)]),l}function ue(r,t=null){return Array.isArray(r)&&r.length===2&&typeof r[1]=="object"&&typeof r[1]!==null?t?r[1][t]??null:r[0]:Array.isArray(r)&&t===null?r.join(", "):typeof r=="string"&&t===null?r:null}function wt(r,{theme:t},n){for(let e of n){let l=Ce([e]);l&&r.theme.clearNamespace(`--${l}`,4)}for(let[e,l]of cr(t)){if(typeof l!="string"&&typeof l!="number")continue;if(typeof l=="string"&&(l=l.replace(/<alpha-value>/g,"1")),e[0]==="opacity"&&(typeof l=="number"||typeof l=="string")){let s=typeof l=="string"?parseFloat(l):l;s>=0&&s<=1&&(l=s*100+"%")}let f=Ce(e);f&&r.theme.add(`--${f}`,""+l,7)}if(Object.hasOwn(t,"fontFamily")){let e=5;{let l=ue(t.fontFamily.sans);l&&r.theme.hasDefault("--font-sans")&&(r.theme.add("--default-font-family",l,e),r.theme.add("--default-font-feature-settings",ue(t.fontFamily.sans,"fontFeatureSettings")??"normal",e),r.theme.add("--default-font-variation-settings",ue(t.fontFamily.sans,"fontVariationSettings")??"normal",e))}{let l=ue(t.fontFamily.mono);l&&r.theme.hasDefault("--font-mono")&&(r.theme.add("--default-mono-font-family",l,e),r.theme.add("--default-mono-font-feature-settings",ue(t.fontFamily.mono,"fontFeatureSettings")??"normal",e),r.theme.add("--default-mono-font-variation-settings",ue(t.fontFamily.mono,"fontVariationSettings")??"normal",e))}}return t}function cr(r){let t=[];return kt(r,[],(n,e)=>{if(pr(n))return t.push([e,n]),1;if(mr(n)){t.push([e,n[0]]);for(let l of Reflect.ownKeys(n[1]))t.push([[...e,`-${l}`],n[1][l]]);return 1}if(Array.isArray(n)&&n.every(l=>typeof l=="string"))return t.push([e,n.join(", ")]),1}),t}var dr=/^[a-zA-Z0-9-_%/\.]+$/;function Ce(r){if(r[0]==="container")return null;r=structuredClone(r),r[0]==="animation"&&(r[0]="animate"),r[0]==="aspectRatio"&&(r[0]="aspect"),r[0]==="borderRadius"&&(r[0]="radius"),r[0]==="boxShadow"&&(r[0]="shadow"),r[0]==="colors"&&(r[0]="color"),r[0]==="containers"&&(r[0]="container"),r[0]==="fontFamily"&&(r[0]="font"),r[0]==="fontSize"&
|
||
|
`,`
|
||
|
`);let t=[],n=[],e=null,l="",f;for(let s=0;s<r.length;s++){let p=r.charCodeAt(s);switch(p){case Vt:case Tt:case Nt:case Rt:case Kt:case jt:case Pt:{if(l.length>0){let g=he(l);e?e.nodes.push(g):t.push(g),l=""}let m=s,c=s+1;for(;c<r.length&&(f=r.charCodeAt(c),!(f!==Vt&&f!==Tt&&f!==Nt&&f!==Rt&&f!==Kt&&f!==jt&&f!==Pt));c++);s=c-1;let d=r.slice(m,c),h=d.trim()===","?yr(d):hr(d);e?e.nodes.push(h):t.push(h);break}case Et:{let m=vr(l,[]);if(l="",m.value!==":not"&&m.value!==":where"&&m.value!==":has"&&m.value!==":is"){let c=s+1,d=0;for(let g=s+1;g<r.length;g++){if(f=r.charCodeAt(g),f===Et){d++;continue}if(f===$t){if(d===0){s=g;break}d--}}let h=s;m.nodes.push(br(r.slice(c,h))),l="",s=h,t.push(m);break}e?e.nodes.push(m):t.push(m),n.push(m),e=m;break}case $t:{let m=n.pop();if(l.length>0){let c=he(l);m.nodes.push(c),l=""}n.length>0?e=n[n.length-1]:e=null;break}case Ar:case kr:case Cr:{if(l.length>0){let m=he(l);e?e.nodes.push(m):t.push(m)}l=String.fromCharCode(p);break}case St:{if(l.length>0){let d=he(l);e?e.nodes.push(d):t.push(d)}l="";let m=s,c=0;for(let d=s+1;d<r.length;d++){if(f=r.charCodeAt(d),f===St){c++;continue}if(f===wr){if(c===0){s=d;break}c--}}l+=r.slice(m,s+1);break}case $r:case xr:{let m=s;for(let c=s+1;c<r.length;c++)if(f=r.charCodeAt(c),f===Ct)c+=1;else if(f===p){s=c;break}l+=r.slice(m,s+1);break}case Ct:{let m=r.charCodeAt(s+1);l+=String.fromCharCode(p)+String.fromCharCode(m),s+=1;break}default:l+=String.fromCharCode(p)}}return l.length>0&&t.push(he(l)),t}var Ot=/^[a-z@][a-zA-Z0-9/%._-]*$/;function Fe({designSystem:r,ast:t,resolvedConfig:n,featuresRef:e,referenceMode:l}){let f={addBase(s){if(l)return;let p=Y(s);e.current|=ae(p,r),t.push(D("@layer","base",p))},addVariant(s,p){if(!Ae.test(s))throw new Error(`\`addVariant('${s}')\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);typeof p=="string"||Array.isArray(p)?r.variants.static(s,m=>{m.nodes=Dt(p,m.nodes)},{compounds:ie(typeof p=="string"?[p]:p)}):typeof p=="object"&&r.variants.fromAst(s,Y(p))},matchVariant(s,p,m){function c(h,g,y){let v=p(h,{modifier:g?.value??null});return Dt(v,y)}let d=Object.keys(m?.values??{});r.variants.group(()=>{r.variants.functional(s,(h,g)=>{if(!g.value){if(m?.values&&"DEFAULT"in m.values){h.nodes=c(m.values.DEFAULT,g.modifier,h.nodes);return}return null}if(g.value.kind==="arbitrary")h.nodes=c(g.value.value,g.modifier,h.nodes);else if(g.value.kind==="named"&&m?.values){let y=m.values[g.value.value];if(typeof y!="string")return;h.nodes=c(y,g.modifier,h.nodes)}})},(h,g)=>{if(h.kind!=="functional"||g.kind!=="functional")return 0;let y=h.value?h.value.value:"DEFAULT",v=g.value?g.value.value:"DEFAULT",b=m?.values?.[y]??y,A=m?.values?.[v]??v;if(m&&typeof m.sort=="function")return m.sort({value:b,modifier:h.modifier?.value??null},{value:A,modifier:g.modifier?.value??null});let T=d.indexOf(y),N=d.indexOf(v);return T=T===-1?d.length:T,N=N===-1?d.length:N,T!==N?T-N:b<A?-1:1})},addUtilities(s){s=Array.isArray(s)?s:[s];let p=s.flatMap(c=>Object.entries(c));p=p.flatMap(([c,d])=>O(c,",").map(h=>[h.trim(),d]));let m=new z(()=>[]);for(let[c,d]of p){if(c.startsWith("@keyframes ")){l||t.push(B(c,Y(d)));continue}let h=Te(c),g=!1;if(ve(h,y=>{if(y.kind==="selector"&&y.value[0]==="."&&Ot.test(y.value.slice(1))){let v=y.value;y.value="&";let b=ye(h),A=v.slice(1),T=b==="&"?Y(d):[B(b,Y(d))];m.get(A).push(...T),g=!0,y.value=v;return}if(y.kind==="function"&&y.value===":not")return 1}),!g)throw new Error(`\`addUtilities({ '${c}' : \u2026 })\` defines an invalid utility selector. Utilities must be a single class name and start with a lowercase letter, eg. \`.scrollbar-none\`.`)}for(let[c,d]of m)r.theme.prefix&&P(d,h=>{if(h.kind==="rule"){let g=Te(h.selector);ve(g,y=>{y.kind==="selector"&&y.value[0]==="."&&(y.value=`.${r.theme.prefix}\\:${y.value.slice(1)}`)}),h.selector=ye(g)}}),r.utilities.static(c,h=>{let g=structuredClone(d);return _t(g,c,h.raw),e.current|=me(g,r),g})},matchUtilities(s,p){let m=p?.type?Array.isArray(p?.type)?p.type:[p.type]:["any"];for(let[d,h]of Object.entries(s)){let g=function({nega
|
||
|
|
||
|
${J([T])}
|
||
|
|
||
|
\`@plugin\` options must be a flat list of declarations.`);if(T.value===void 0)continue;let N=T.value,R=O(N,",").map(K=>{if(K=K.trim(),K==="null")return null;if(K==="true")return!0;if(K==="false")return!1;if(Number.isNaN(Number(K))){if(K[0]==='"'&&K[K.length-1]==='"'||K[0]==="'"&&K[K.length-1]==="'")return K.slice(1,-1);if(K[0]==="{"&&K[K.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${J([T]).trim()}\` is not supported.
|
||
|
|
||
|
Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(K);return K});A[T.property]=R.length===1?R[0]:R}s.push([{id:b,base:v.base,reference:!!v.reference},Object.keys(A).length>0?A:null]),y([]),f|=4;return}if(h.name==="@config"){if(h.nodes.length>0)throw new Error("`@config` cannot have a body.");if(g!==null)throw new Error("`@config` cannot be nested.");p.push({id:h.params.slice(1,-1),base:v.base,reference:!!v.reference}),y([]),f|=4;return}}}),Mt(r);let m=r.resolveThemeValue;if(r.resolveThemeValue=function(g){return g.startsWith("--")?m(g):(f|=Wt({designSystem:r,base:t,ast:n,globs:l,configs:[],pluginDetails:[]}),r.resolveThemeValue(g))},!s.length&&!p.length)return 0;let[c,d]=await Promise.all([Promise.all(p.map(async({id:h,base:g,reference:y})=>{let v=await e(h,g,"config");return{path:h,base:v.base,config:v.module,reference:y}})),Promise.all(s.map(async([{id:h,base:g,reference:y},v])=>{let b=await e(h,g,"plugin");return{path:h,base:b.base,plugin:b.module,options:v,reference:y}}))]);return f|=Wt({designSystem:r,base:t,ast:n,globs:l,configs:c,pluginDetails:d}),f}function Wt({designSystem:r,base:t,ast:n,globs:e,configs:l,pluginDetails:f}){let s=0,m=[...f.map(b=>{if(!b.options)return{config:{plugins:[b.plugin]},base:b.base,reference:b.reference};if("__isOptionsFunction"in b.plugin)return{config:{plugins:[b.plugin(b.options)]},base:b.base,reference:b.reference};throw new Error(`The plugin "${b.path}" does not accept options`)}),...l],{resolvedConfig:c}=Ie(r,[{config:Ut(r.theme),base:t,reference:!0},...m,{config:{plugins:[zt]},base:t,reference:!0}]),{resolvedConfig:d,replacedThemeKeys:h}=Ie(r,m);r.resolveThemeValue=function(A,T){let N=y.theme(A,T);if(Array.isArray(N)&&N.length===2)return N[0];if(Array.isArray(N))return N.join(", ");if(typeof N=="string")return N};let g={designSystem:r,ast:n,resolvedConfig:c,featuresRef:{set current(b){s|=b}}},y=Fe({...g,referenceMode:!1}),v;for(let{handler:b,reference:A}of c.plugins)A?(v||=Fe({...g,referenceMode:!0}),b(v)):b(y);if(wt(r,d,h),Ft(r,d,h),Bt(d,r),Lt(d,r),It(d,r),!r.theme.prefix&&c.prefix){if(c.prefix.endsWith("-")&&(c.prefix=c.prefix.slice(0,-1),console.warn(`The prefix "${c.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only and is written as a variant before all utilities. We have fixed up the prefix for you. Remove the trailing \`-\` to silence this warning.`)),!jr.test(c.prefix))throw new Error(`The prefix "${c.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);r.theme.prefix=c.prefix}if(!r.important&&c.important===!0&&(r.important=!0),typeof c.important=="string"){let b=c.important;P(n,(A,{replaceWith:T,parent:N})=>{if(A.kind==="at-rule"&&!(A.name!=="@tailwind"||A.params!=="utilities"))return N?.kind==="rule"&&N.selector===b?2:(T(F(b,[A])),2)})}for(let b of c.blocklist)r.invalidCandidates.add(b);for(let b of c.content.files){if("raw"in b)throw new Error(`Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry:
|
||
|
|
||
|
${JSON.stringify(b,null,2)}
|
||
|
|
||
|
This feature is not currently supported.`);e.push(b)}return s}var Pr=/^[a-z]+$/;function Or(){throw new Error("No `loadModule` function provided to `compile`")}function Dr(){throw new Error("No `loadStylesheet` function provided to `compile`")}function _r(r){let t=0,n=null;for(let e of O(r," "))e==="reference"?t|=2:e==="inline"?t|=1:e==="default"?t|=4:e==="static"?t|=8:e.startsWith("prefix(")&&e.endsWith(")")&&(n=e.slice(7,-1));return[t,n]}var de=(p=>(p[p.None=0]="None",p[p.AtApply=1]="AtApply",p[p.AtImport=2]="AtImport",p[p.JsPluginCompat=4]="JsPluginCompat",p[p.ThemeFunction=8]="ThemeFunction",p[p.Utilities=16]="Utilities",p[p.Variants=32]="Variants",p))(de||{});async function Jt(r,{base:t="",loadModule:n=Or,loadStylesheet:e=Dr}={}){let l=0;r=[Z({base:t},r)],l|=await _e(r,t,e);let f=null,s=new ze,p=[],m=[],c=null,d=null,h=[],g=[],y=null;P(r,(b,{parent:A,replaceWith:T,context:N})=>{if(b.kind==="at-rule"){if(b.name==="@tailwind"&&(b.params==="utilities"||b.params.startsWith("utilities"))){if(d!==null){T([]);return}let R=O(b.params," ");for(let K of R)if(K.startsWith("source(")){let j=K.slice(7,-1);if(j==="none"){y=j;continue}if(j[0]==='"'&&j[j.length-1]!=='"'||j[0]==="'"&&j[j.length-1]!=="'"||j[0]!=="'"&&j[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");y={base:N.sourceBase??N.base,pattern:j.slice(1,-1)}}d=b,l|=16}if(b.name==="@utility"){if(A!==null)throw new Error("`@utility` cannot be nested.");if(b.nodes.length===0)throw new Error(`\`@utility ${b.params}\` is empty. Utilities should include at least one property.`);let R=nt(b);if(R===null)throw new Error(`\`@utility ${b.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`);m.push(R)}if(b.name==="@source"){if(b.nodes.length>0)throw new Error("`@source` cannot have a body.");if(A!==null)throw new Error("`@source` cannot be nested.");let R=b.params;if(R[0]==='"'&&R[R.length-1]!=='"'||R[0]==="'"&&R[R.length-1]!=="'"||R[0]!=="'"&&R[0]!=='"')throw new Error("`@source` paths must be quoted.");g.push({base:N.base,pattern:R.slice(1,-1)}),T([]);return}if(b.name==="@variant"&&(A===null?b.nodes.length===0?b.name="@custom-variant":(P(b.nodes,R=>{if(R.kind==="at-rule"&&R.name==="@slot")return b.name="@custom-variant",2}),b.name==="@variant"&&h.push(b)):h.push(b)),b.name==="@custom-variant"){if(A!==null)throw new Error("`@custom-variant` cannot be nested.");T([]);let[R,K]=O(b.params," ");if(!Ae.test(R))throw new Error(`\`@custom-variant ${R}\` defines an invalid variant name. Variants should only contain alphanumeric, dashes or underscore characters.`);if(b.nodes.length>0&&K)throw new Error(`\`@custom-variant ${R}\` cannot have both a selector and a body.`);if(b.nodes.length===0){if(!K)throw new Error(`\`@custom-variant ${R}\` has no selector or body.`);let j=O(K.slice(1,-1),",");if(j.length===0||j.some(u=>u.trim()===""))throw new Error(`\`@custom-variant ${R} (${j.join(",")})\` selector is invalid.`);let i=[],a=[];for(let u of j)u=u.trim(),u[0]==="@"?i.push(u):a.push(u);p.push(u=>{u.variants.static(R,k=>{let w=[];a.length>0&&w.push(F(a.join(", "),k.nodes));for(let V of i)w.push(B(V,k.nodes));k.nodes=w},{compounds:ie([...a,...i])})});return}else{p.push(j=>{j.variants.fromAst(R,b.nodes)});return}}if(b.name==="@media"){let R=O(b.params," "),K=[];for(let j of R)if(j.startsWith("source(")){let i=j.slice(7,-1);P(b.nodes,(a,{replaceWith:u})=>{if(a.kind==="at-rule"&&a.name==="@tailwind"&&a.params==="utilities")return a.params+=` source(${i})`,u([Z({sourceBase:N.base},[a])]),2})}else if(j.startsWith("theme(")){let i=j.slice(6,-1),a=i.includes("reference");P(b.nodes,u=>{if(u.kind!=="at-rule"){if(a)throw new Error('Files imported with `@import "\u2026" theme(reference)` must only contain `@theme` blocks.\nUse `@reference "\u2026";` instead.');return 0}if(u.name==="@theme")return u.params+=" "+i,1})}else if(j.startsWith("prefix(")){let i=j.slice(7,-1);P(b.nodes,a=>{if(a.kind==="at-rule"&&a.name==="@theme")return a.params+=` prefix(${i})`,1})}else j==="important"?f=!0:j==="reference"?b.nodes=[Z({reference:!0},b.nodes
|
||
|
`).map((a,u,k)=>`${u===0||u>=k.length-2?" ":">"} ${a}`).join(`
|
||
|
`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`.
|
||
|
|
||
|
${i}`)}),c?T([]):(c=F(":root, :host",[]),T([c])),1}}});let v=pt(s);f&&(v.important=f),l|=await qt({designSystem:v,base:t,ast:r,loadModule:n,globs:g});for(let b of p)b(v);for(let b of m)b(v);if(c){let b=[];for(let[T,N]of v.theme.entries())N.options&2||b.push(o(ne(T),N.value));let A=v.theme.getKeyframes();for(let T of A)b.push(_([T]));c.nodes=[Z({theme:!0},b)]}if(d){let b=d;b.kind="context",b.context={}}if(h.length>0){for(let b of h){let A=F("&",b.nodes),T=b.params,N=v.parseVariant(T);if(N===null)throw new Error(`Cannot use \`@variant\` with unknown variant: ${T}`);if(se(A,N,v.variants)===null)throw new Error(`Cannot use \`@variant\` with variant: ${T}`);Object.assign(b,A)}l|=32}return l|=ae(r,v),l|=me(r,v),P(r,(b,{replaceWith:A})=>{if(b.kind==="at-rule")return b.name==="@utility"&&A([]),1}),{designSystem:v,ast:r,globs:g,root:y,utilitiesNode:d,features:l,firstThemeRule:c}}async function Fr(r,t={}){let{designSystem:n,ast:e,globs:l,root:f,utilitiesNode:s,features:p,firstThemeRule:m}=await Jt(r,t);e.unshift(Le(`! tailwindcss v${Ge} | MIT License | https://tailwindcss.com `));function c(y){n.invalidCandidates.add(y)}let d=new Set,h=null,g=0;return{globs:l,root:f,features:p,build(y){if(p===0)return r;if(!s)return h??=ee(e,n,m),h;let v=!1,b=d.size;for(let T of y)n.invalidCandidates.has(T)||(T[0]==="-"&&T[1]==="-"?n.theme.markUsedVariable(T):d.add(T),v||=d.size!==b);if(!v)return h??=ee(e,n,m),h;let A=X(d,n,{onInvalidCandidate:c}).astNodes;return g===A.length?(h??=ee(e,n,m),h):(g=A.length,s.nodes=A,h=ee(e,n,m),h)}}}async function xo(r,t={}){let n=Q(r),e=await Fr(n,t),l=n,f=r;return{...e,build(s){let p=e.build(s);return p===l||(f=J(p),l=p),f}}}async function Ao(r,t={}){return(await Jt(Q(r),t)).designSystem}function Ur(){throw new Error("It looks like you're trying to use `tailwindcss` directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install `@tailwindcss/postcss` and update your PostCSS configuration.")}export{de as Features,Ao as __unstable__loadDesignSystem,xo as compile,Fr as compileAst,Ur as default};
|