Files

39 lines
239 KiB
JavaScript
Raw Permalink Normal View History

import{a as lt,b as L,c as cr,d as Z,e as Ye,f as I,g as Rt,h as ee,i as ot,j as dr}from"./chunk-XVOTX5KS.mjs";import{a as pr}from"./chunk-X4GG3EDV.mjs";import{a as _e,b as Ie,c as fr}from"./chunk-5JIJA4QV.mjs";var mr="4.3.1";function at(e){let i=[0];for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&i.push(n+1);function r(n){let s=0,l=i.length;for(;l>0;){let f=(l|0)>>1,c=s+f;i[c]<=n?(s=c+1,l=l-f-1):l=f}s-=1;let p=n-i[s];return{line:s+1,column:p}}function t({line:n,column:s}){n-=1,n=Math.min(Math.max(n,0),i.length-1);let l=i[n],p=i[n+1]??l;return Math.min(Math.max(l+s,0),p)}return{find:r,findOffset:t}}var Ge=92,st=47,ut=42,gr=34,hr=39,ln=58,ft=59,de=10,ct=13,qe=32,He=9,vr=123,Pt=125,It=40,wr=41,on=91,an=93,kr=45,Ot=64,sn=33,me=class e extends Error{loc;constructor(i,r){if(r){let t=r[0],n=at(t.code).find(r[1]);i=`${t.file}:${n.line}:${n.column+1}: ${i}`}super(i),this.name="CssSyntaxError",this.loc=r,Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function Se(e,i){let r=i?.from?{file:i.from,code:e}:null;e[0]==="\uFEFF"&&(e=" "+e.slice(1));let t=[],n=[],s=[],l=null,p=null,f="",c="",m=0,d;for(let u=0;u<e.length;u++){let h=e.charCodeAt(u);if(!(h===ct&&(d=e.charCodeAt(u+1),d===de)))if(h===Ge)f===""&&(m=u),f+=e.slice(u,u+2),u+=1;else if(h===st&&e.charCodeAt(u+1)===ut){let v=u;for(let y=u+2;y<e.length;y++)if(d=e.charCodeAt(y),d===Ge)y+=1;else if(d===ut&&e.charCodeAt(y+1)===st){u=y+1;break}let k=e.slice(v,u+1);if(k.charCodeAt(2)===sn){let y=pt(k.slice(2,-2));n.push(y),r&&(y.src=[r,v,u+1],y.dst=[r,v,u+1])}}else if(h===hr||h===gr){let v=br(e,u,h,r);f+=e.slice(u,v+1),u=v}else{if((h===qe||h===de||h===He)&&(d=e.charCodeAt(u+1))&&(d===qe||d===de||d===He||d===ct&&(d=e.charCodeAt(u+2))&&d==de))continue;if(h===de){if(f.length===0)continue;d=f.charCodeAt(f.length-1),d!==qe&&d!==de&&d!==He&&(f+=" ")}else if(h===kr&&e.charCodeAt(u+1)===kr&&f.length===0){let v="",k=u,y=-1;for(let A=u+2;A<e.length;A++)if(d=e.charCodeAt(A),d===Ge)A+=1;else if(d===hr||d===gr)A=br(e,A,d,r);else if(d===st&&e.charCodeAt(A+1)===ut){for(let b=A+2;b<e.length;b++)if(d=e.charCodeAt(b),d===Ge)b+=1;else if(d===ut&&e.charCodeAt(b+1)===st){A=b+1;break}}else if(y===-1&&d===ln)y=f.length+A-k;else if(d===ft&&v.length===0){f+=e.slice(k,A),u=A;break}else if(d===It)v+=")";else if(d===on)v+="]";else if(d===vr)v+="}";else if((d===Pt||e.length-1===A)&&v.length===0){u=A-1,f+=e.slice(k,A);break}else(d===wr||d===an||d===Pt)&&v.length>0&&e[A]===v[v.length-1]&&(v=v.slice(0,-1));let N=_t(f,y);if(!N)throw new me("Invalid custom property, expected a value",r?[r,k,u]:null);r&&(N.src=[r,k,u],N.dst=[r,k,u]),l?l.nodes.push(N):t.push(N),f=""}else if(h===ft&&f.charCodeAt(0)===Ot)p=Ze(f),r&&(p.src=[r,m,u],p.dst=[r,m,u]),l?l.nodes.push(p):t.push(p),f="",p=null;else if(h===ft&&c[c.length-1]!==")"){let v=_t(f);if(!v){if(f.length===0)continue;throw new me(`Invalid declaration: \`${f.trim()}\``,r?[r,m,u]:null)}r&&(v.src=[r,m,u],v.dst=[r,m,u]),l?l.nodes.push(v):t.push(v),f=""}else if(h===vr&&c[c.length-1]!==")")c+="}",p=J(f.trim()),r&&(p.src=[r,m,u],p.dst=[r,m,u]),l&&l.nodes.push(p),s.push(l),l=p,f="",p=null;else if(h===Pt&&c[c.length-1]!==")"){if(c==="")throw new me("Missing opening {",r?[r,u,u]:null);if(c=c.slice(0,-1),f.length>0)if(f.charCodeAt(0)===Ot)p=Ze(f),r&&(p.src=[r,m,u],p.dst=[r,m,u]),l?l.nodes.push(p):t.push(p),f="",p=null;else{let k=f.indexOf(":");if(l){let y=_t(f,k);if(!y)throw new me(`Invalid declaration: \`${f.trim()}\``,r?[r,m,u]:null);r&&(y.src=[r,m,u],y.dst=[r,m,u]),l.nodes.push(y)}}let v=s.pop()??null;v===null&&l&&t.push(l),l=v,f="",p=null}else if(h===It)c+=")",f+="(";else if(h===wr){if(c[c.length-1]!==")")throw new me("Missing opening (",r?[r,u,u]:null);c=c.slice(0,-1),f+=")"}else{if(f.length===0&&(h===qe||h===de||h===He))continue;f===""&&(m=u),f+=String.fromCharCode(h)}}}if(f.charCodeAt(0)===Ot){let u=Ze(f);r&&(u.src=[r,m,e.length],u.dst=[r,m,e.length]),t.push(u)}if(c.length>0&&l){if(l.kind==="rule")throw new me(`Missing closing } at ${l.selector}`,l.src?[l.src[0],l.src[1],l.src[1]]:null);if(l.kind==="at-rule")throw new me(`Missing closing } at ${l.name} ${l.params}`,l.sr
`,`
`);let i=[],r=[],t=null,n="",s;for(let l=0;l<e.length;l++){let p=e.charCodeAt(l);switch(p){case yr:{n+=e[l]+e[l+1],l++;break}case gn:{if(n.length>0){let c=ne(n);t?t.nodes.push(c):i.push(c),n=""}let f=ne(e[l]);t?t.nodes.push(f):i.push(f);break}case xr:case Ar:case Cr:case Vr:case Sr:case $r:case Tr:case Nr:{if(n.length>0){let d=ne(n);t?t.nodes.push(d):i.push(d),n=""}let f=l,c=l+1;for(;c<e.length&&(s=e.charCodeAt(c),!(s!==xr&&s!==Ar&&s!==Cr&&s!==Vr&&s!==Sr&&s!==$r&&s!==Tr&&s!==Nr));c++);l=c-1;let m=fn(e.slice(f,c));t?t.nodes.push(m):i.push(m);break}case mn:case pn:{let f=l;for(let c=l+1;c<e.length;c++)if(s=e.charCodeAt(c),s===yr)c+=1;else if(s===p){l=c;break}n+=e.slice(f,l+1);break}case dn:{let f=un(n,[]);n="",t?t.nodes.push(f):i.push(f),r.push(f),t=f;break}case cn:{let f=r.pop();if(n.length>0){let c=ne(n);f?.nodes.push(c),n=""}r.length>0?t=r[r.length-1]:t=null;break}default:n+=String.fromCharCode(p)}}return n.length>0&&i.push(ne(n)),i}var Kt=(l=>(l[l.Continue=0]="Continue",l[l.Skip=1]="Skip",l[l.Stop=2]="Stop",l[l.Replace=3]="Replace",l[l.ReplaceSkip=4]="ReplaceSkip",l[l.ReplaceStop=5]="ReplaceStop",l))(Kt||{}),V={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function _(e,i){typeof i=="function"?Er(e,i):Er(e,i.enter,i.exit)}function Er(e,i=()=>V.Continue,r=()=>V.Continue){let t={value:[e,0,null],prev:null},n={parent:null,depth:0,index:0,siblings:e,path(){let s=[],l=t;for(;l;){let p=l.value[2];p&&s.push(p),l=l.prev}return s.reverse(),s}};for(;t!==null;){let s=t.value,l=s[0],p=s[1],f=s[2];if(p>=l.length){t=t.prev,n.depth-=1;continue}if(n.parent=f,n.siblings=l,p>=0){n.index=p;let u=l[p],h=i(u,n)??V.Continue;switch(h.kind){case 0:{u.nodes&&u.nodes.length>0&&(n.depth+=1,t={value:[u.nodes,0,u],prev:t}),s[1]=~p;continue}case 2:return;case 1:{s[1]=~p;continue}case 3:{l.splice(p,1,...h.nodes);continue}case 5:{l.splice(p,1,...h.nodes);return}case 4:{l.splice(p,1,...h.nodes),s[1]+=h.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${Kt[h.kind]??`Unknown(${h.kind})`}\` in enter.`)}}let c=~p;n.index=c;let m=l[c],d=r(m,n)??V.Continue;switch(d.kind){case 0:s[1]=c+1;continue;case 2:return;case 3:{l.splice(c,1,...d.nodes),s[1]=c+d.nodes.length;continue}case 5:{l.splice(c,1,...d.nodes);return}case 4:{l.splice(c,1,...d.nodes),s[1]=c+d.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${Kt[d.kind]??`Unknown(${d.kind})`}\` in exit.`)}}}function dt(e){let i=[];return _(M(e),r=>{if(!(r.kind!=="function"||r.value!=="var"))return _(r.nodes,t=>{t.kind!=="word"||t.value[0]!=="-"||t.value[1]!=="-"||i.push(t.value)}),V.Skip}),i}var hn=64;function H(e,i=[]){return{kind:"rule",selector:e,nodes:i}}function B(e,i="",r=[]){return{kind:"at-rule",name:e,params:i,nodes:r}}function J(e,i=[]){return e.charCodeAt(0)===hn?Ze(e,i):H(e,i)}function o(e,i,r=!1){return{kind:"declaration",property:e,value:i,important:r}}function pt(e){return{kind:"comment",value:e}}function he(e,i){return{kind:"context",context:e,nodes:i}}function Y(e){return{kind:"at-root",nodes:e}}function re(e){switch(e.kind){case"rule":return{kind:e.kind,selector:e.selector,nodes:e.nodes.map(re),src:e.src,dst:e.dst};case"at-rule":return{kind:e.kind,name:e.name,params:e.params,nodes:e.nodes.map(re),src:e.src,dst:e.dst};case"at-root":return{kind:e.kind,nodes:e.nodes.map(re),src:e.src,dst:e.dst};case"context":return{kind:e.kind,context:{...e.context},nodes:e.nodes.map(re),src:e.src,dst:e.dst};case"declaration":return{kind:e.kind,property:e.property,value:e.value,important:e.important,src:e.src,dst:e.dst};case"comment":return{kind:e.kind,value:e.value,src:e.src,dst:e.dst};default:throw new Error(`Unknown node kind: ${e.kind}`)}}function Qe(e){return{depth:e.depth,index:e.index,siblings:e.siblings,get context(){let i={};for(let r of e.path())r.kind==="context"&&Object.assign(i,r.context);return Object.defineProperty(this,"context",{value:i}),i},get parent(){let i=this.path().pop()??null;return Object.defin
`,i){r+=c.length;let m=r;r+=l.property.length,r+=2,r+=l.value?.length??0,l.important&&(r+=11);let d=r;r+=2,l.dst=[t,m,d]}}else if(l.kind==="rule"){if(f+=`${c}${l.selector} {
`,i){r+=c.length;let m=r;r+=l.selector.length,r+=1;let d=r;l.dst=[t,m,d],r+=2}for(let m of l.nodes)f+=n(m,p+1);f+=`${c}}
`,i&&(r+=c.length,r+=2)}else if(l.kind==="at-rule"){if(l.nodes.length===0){let m=`${c}${l.name} ${l.params};
`;if(i){r+=c.length;let d=r;r+=l.name.length,r+=1,r+=l.params.length;let u=r;r+=2,l.dst=[t,d,u]}return m}if(f+=`${c}${l.name}${l.params?` ${l.params} `:" "}{
`,i){r+=c.length;let m=r;r+=l.name.length,l.params&&(r+=1,r+=l.params.length),r+=1;let d=r;l.dst=[t,m,d],r+=2}for(let m of l.nodes)f+=n(m,p+1);f+=`${c}}
`,i&&(r+=c.length,r+=2)}else if(l.kind==="comment"){if(f+=`${c}/*${l.value}*/
`,i){r+=c.length;let m=r;r+=2+l.value.length+2;let d=r;l.dst=[t,m,d],r+=1}}else if(l.kind==="context"||l.kind==="at-root")return"";return f}let s="";for(let l of e)s+=n(l,0);return t.code=s,s}function vn(e,i){let r=[];return _(e,(t,n)=>{if(i(t))return r=n.path(),r.push(t),V.Stop}),r}function Pr(e,i,r,t=new Set){if(t.has(e)||(t.add(e),i.getOptions(e)&24))return!0;{let s=r.get(e)??[];for(let l of s)if(Pr(l,i,r,t))return!0}return!1}function Rr(e){return e.split(/[\s,]+/)}function ye(e){if(e.indexOf("(")===-1)return De(e);let i=M(e);return zt(i),e=F(i),e=lt(e),e}function De(e,i=!1){let r="";for(let t=0;t<e.length;t++){let n=e[t];n==="\\"&&e[t+1]==="_"?(r+="_",t+=1):n==="_"&&!i?r+=" ":r+=n}return r}function zt(e){for(let i of e)switch(i.kind){case"function":{if(i.value==="url"||i.value.endsWith("_url")){i.value=De(i.value);break}if(i.value==="var"||i.value.endsWith("_var")||i.value==="theme"||i.value.endsWith("_theme")){i.value=De(i.value);for(let r=0;r<i.nodes.length;r++){if(r==0&&i.nodes[r].kind==="word"){i.nodes[r].value=De(i.nodes[r].value,!0);continue}zt([i.nodes[r]])}break}i.value=De(i.value),zt(i.nodes);break}case"separator":case"word":{i.value=De(i.value);break}default:wn(i)}}function wn(e){throw new Error(`Unexpected value: ${e}`)}var Lt=new Uint8Array(256);function ke(e){let i=0,r=e.length;for(let t=0;t<r;t++){let n=e.charCodeAt(t);switch(n){case 92:t+=1;break;case 39:case 34:for(;++t<r;){let s=e.charCodeAt(t);if(s===92){t+=1;continue}if(s===n)break}break;case 40:Lt[i]=41,i++;break;case 91:Lt[i]=93,i++;break;case 123:break;case 93:case 125:case 41:if(i===0)return!1;i>0&&n===Lt[i-1]&&i--;break;case 59:if(i===0)return!1;break}}return!0}var kn=58,Or=45,_r=97,Ir=122,Ft=/^[a-zA-Z0-9_.%-]+$/;function Ue(e){switch(e.kind){case"arbitrary":return{kind:e.kind,property:e.property,value:e.value,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null,variants:e.variants.map(Ke),important:e.important,raw:e.raw};case"static":return{kind:e.kind,root:e.root,variants:e.variants.map(Ke),important:e.important,raw:e.raw};case"functional":return{kind:e.kind,root:e.root,value:e.value?e.value.kind==="arbitrary"?{kind:e.value.kind,dataType:e.value.dataType,value:e.value.value}:{kind:e.value.kind,value:e.value.value,fraction:e.value.fraction}:null,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null,variants:e.variants.map(Ke),important:e.important,raw:e.raw};default:throw new Error("Unknown candidate kind")}}function Ke(e){switch(e.kind){case"arbitrary":return{kind:e.kind,selector:e.selector,relative:e.relative};case"static":return{kind:e.kind,root:e.root};case"functional":return{kind:e.kind,root:e.root,value:e.value?{kind:e.value.kind,value:e.value.value}:null,modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null};case"compound":return{kind:e.kind,root:e.root,variant:Ke(e.variant),modifier:e.modifier?{kind:e.modifier.kind,value:e.modifier.value}:null};default:throw new Error("Unknown variant kind")}}function*Dr(e,i){let r=L(e,":");if(i.theme.prefix){if(r.length===1||r[0]!==i.theme.prefix)return null;r.shift()}let t=r.pop(),n=[];for(let d=r.length-1;d>=0;--d){let u=i.parseVariant(r[d]);if(u===null)return;n.push(u)}let s=!1;t[t.length-1]==="!"?(s=!0,t=t.slice(0,-1)):t[0]==="!"&&(s=!0,t=t.slice(1)),i.utilities.has(t,"static")&&!t.includes("[")&&(yield{kind:"static",root:t,variants:n,important:s,raw:e});let[l,p=null,f]=L(t,"/");if(f)return;let c=p===null?null:jt(p);if(p!==null&&c===null)return;if(l[0]==="["){if(l[l.length-1]!=="]")return;let d=l.charCodeAt(1);if(d!==Or&&!(d>=_r&&d<=Ir))return;l=l.slice(1,-1);let u=l.indexOf(":");if(u===-1||u===0||u===l.length-1)return;let h=l.slice(0,u),v=ye(l.slice(u+1));if(!ke(v))return;yield{kind:"arbitrary",property:h,value:v,modifier:c,variants:n,important:s,raw:e};return}let m;if(l[l.length-1]==="]"){let d=l.indexOf("-[");if(d===-1)return;let u=l.slice(0,d);if(!i.utilities.has(u,"functional"))return;let h=l.slice(d+1);m=[[u,h]]}else if(l[l.length-1]===")"){let d=l.indexOf("-(");if(d===-1)return;let u=l.slice(0,d);if(!i.utilities.has(u,"functional"))retur
Only valid data types are: ${Yt.map(k=>`"${k}"`).join(", ")}.
`);let c=f.value,m=structuredClone(l),d="\xB6";_(m.nodes,k=>{if(k.kind==="word"&&k.value===c)return V.ReplaceSkip({kind:"word",value:d})});let u="^".repeat(F([f]).length),h=F([m]).indexOf(d),v=["```css",F([l])," ".repeat(h)+u,"```"].join(`
`);console.warn(v)}}),n.value=F(s)}),r.utilities.functional(i.slice(0,-2),n=>{let s=re(e),l=n.value,p=n.modifier,f=!1,c=!1,m=!1,d=!1,u=new Map,h=!1;if(_([s],(v,k)=>{let y=k.parent;if(y?.kind!=="rule"&&y?.kind!=="at-rule"||v.kind!=="declaration"||!v.value)return;let N=!1,A=M(v.value);if(_(A,b=>{if(b.kind==="function"){if(b.value==="--value"){f=!0;let D=Lr(l,b,r);return D?(c=!0,D.ratio?h=!0:u.set(v,y),V.ReplaceSkip(D.nodes)):(N=!0,V.Stop)}else if(b.value==="--modifier"){m=!0;let D=Lr(p,b,r);return D?(d=!0,V.ReplaceSkip(D.nodes)):(N=!0,V.Stop)}}}),N)return V.ReplaceSkip([]);v.value=F(A)}),!f||!c||m&&!d&&p!==null||h&&d||p&&!h&&!d)return null;if(h)for(let[v,k]of u){let y=k.nodes.indexOf(v);y!==-1&&k.nodes.splice(y,1)}return s.nodes}),r.utilities.suggest(i.slice(0,-2),()=>{let n=[],s=[];for(let[l,{literals:p,usedSpacingNumber:f,usedSpacingInteger:c,themeKeys:m}]of[[n,t["--value"]],[s,t["--modifier"]]]){for(let d of p)l.push(d);if(f)l.push(...wt);else if(c)for(let d of wt)I(d)&&l.push(d);for(let d of r.theme.keysInNamespaces(m))l.push(d.replace(Mr,(u,h,v)=>`${h}.${v}`))}return[{values:n,modifiers:s}]})}:zn(i)?r=>{r.utilities.static(i,()=>e.nodes.map(re))}:null}function Lr(e,i,r){if(e===null){for(let t of i.nodes)if(t.kind==="function"&&t.value==="--default")return{nodes:t.nodes};return}for(let t of i.nodes){if(e.kind==="named"&&t.kind==="word"&&(t.value[0]==="'"||t.value[0]==='"')&&t.value[t.value.length-1]===t.value[0]&&t.value.slice(1,-1)===e.value)return{nodes:M(e.value)};if(e.kind==="named"&&t.kind==="word"&&t.value[0]==="-"&&t.value[1]==="-"){let n=t.value;if(n.endsWith("-*")){n=n.slice(0,-2);let s=r.theme.resolve(e.value,[n]);if(s)return{nodes:M(s)}}else{let s=n.split("-*");if(s.length<=1)continue;let l=[s.shift()],p=r.theme.resolveWith(e.value,l,s);if(p){let[,f={}]=p;{let c=f[s.pop()];if(c)return{nodes:M(c)}}}}}else if(e.kind==="named"&&t.kind==="word"){if(!Yt.includes(t.value))continue;let n=t.value==="ratio"&&"fraction"in e?e.fraction:e.value;if(!n)continue;let s=Z(n,[t.value]);if(s===null)continue;if(s==="ratio"){let[l,p]=L(n,"/").map(Number);if(!I(l)||!I(p))continue}else{if(s==="number"&&!ee(n))continue;if(s==="percentage"&&!I(n.slice(0,-1)))continue}if(s==="ratio"){let[l,p]=L(n,"/");return{nodes:M(`${l.trim()} / ${p.trim()}`),ratio:!0}}return{nodes:M(n),ratio:!1}}else if(e.kind==="arbitrary"&&t.kind==="word"&&t.value[0]==="["&&t.value[t.value.length-1]==="]"){let n=t.value.slice(1,-1);if(n==="*")return{nodes:M(e.value)};if("dataType"in e&&e.dataType&&e.dataType!==n)continue;if("dataType"in e&&e.dataType)return{nodes:M(e.value)};if(Z(e.value,[n])!==null)return{nodes:M(e.value)}}}}function be(e,i,r,t,n=""){let s=!1,l=tt(i,f=>r==null?t(f):f.startsWith("current")?t(Q(f,r)):((f.startsWith("var(")||r.startsWith("var("))&&(s=!0),t(jr(f,r))));function p(f){return n?L(f,",").map(c=>n.trim()+" "+c.trim()).join(", "):f}return s?[o(e,p(tt(i,t))),J("@supports (color: lab(from red l a b))",[o(e,p(l))])]:[o(e,p(l))]}function gt(e,i,r,t,n=""){let s=!1,l=L(i,",").map(p=>tt(p,f=>r==null?t(f):f.startsWith("current")?t(Q(f,r)):((f.startsWith("var(")||r.startsWith("var("))&&(s=!0),t(jr(f,r))))).map(p=>`drop-shadow(${p})`).join(" ");return s?[o(e,n+L(i,",").map(p=>`drop-shadow(${tt(p,t)})`).join(" ")),J("@supports (color: lab(from red l a b))",[o(e,n+l)])]:[o(e,n+l)]}var Br=/^-?[a-z][a-zA-Z0-9_-]*/,En=37,Rn=47,Pn=46,On=97,_n=122,In=65,Dn=90,ht=48,vt=57,Kn=95,Un=45;function zn(e){let i=Br.exec(e);if(i===null)return!1;let r=i[0],t=e.slice(r.length);if(t.length===0&&r.endsWith("-"))return!1;if(t.length===0)return!0;let n=!1;for(let s=0;s<t.length;s++){let l=t.charCodeAt(s);switch(l){case En:{if(s!==t.length-1)return!1;let f=(t[s-1]||r[r.length-1]||"").charCodeAt(0);if(f<ht||f>vt)return!1;break}case Rn:{if(s===t.length-1||n)return!1;n=!0;break}case Pn:{let f=(t[s-1]||r[r.length-1]||"").charCodeAt(0);if(f<ht||f>vt)return!1;let m=(t[s+1]||"").charCodeAt(0);if(m<ht||m>vt)return!1;break}case Kn:case Un:continue;default:{if(l>=On&&l<=_n||l>=In&&l<=Dn||l>=ht&&l<=vt)continue;return!1}}}return!0}function Ln(e){if(!e.endsWith("-*"))return!1;e=e.slic
`,`
`);let i=[],r=i,t=!1,n=[],s=null,l="",p;function f(m=r){return m.length===1?m[0]:t?qt(m):ni(m)}function c(m){let d=r[r.length-1];d?.kind==="compound"?d.nodes.push(m):d&&d.kind!=="list"&&d.kind!=="combinator"?r[r.length-1]=ni([d,m]):r.push(m)}for(let m=0;m<e.length;m++){let d=e.charCodeAt(m);switch(d){case si:{for(l.length>0&&(c(Ae(l)),l="");m+1<e.length&&(p=e.charCodeAt(m+1),!(p!==Ht&&p!==Zt&&p!==Jt));m++);if(s)s.nodes.push(f()),r=[],t=!1;else{let u=r.splice(0),h=f(u),v=il([h]);r.push(v),s=v,r=[],t=!1}break}case ui:case Ht:case Zt:case pi:case Jt:case di:{l.length>0&&(c(Ae(l)),l="");let u=m,h=m+1;for(;h<e.length&&(p=e.charCodeAt(h),!(p!==ui&&p!==Ht&&p!==Zt&&p!==pi&&p!==Jt&&p!==di));h++);m=h-1;let v=e.slice(u,h).trim();if(v===""&&(r.length===0||h>=e.length||e.charCodeAt(h)===si))break;r.push(tl(v===""?" ":v)),t=!0;break}case ci:{let u=rl(l,[]);if(l="",u.value!==":not"&&u.value!==":where"&&u.value!==":has"&&u.value!==":is"){let h=m+1,v=0;for(let y=m+1;y<e.length;y++){if(p=e.charCodeAt(y),p===ci){v++;continue}if(p===oi){if(v===0){m=y;break}v--}}let k=m;u.nodes.push(nl(e.slice(h,k))),l="",m=k,c(u);break}c(u),n.push({target:r,currentList:s,containsCombinator:t}),r=u.nodes,t=!1,s=null;break}case oi:{l.length>0&&(c(Ae(l)),l=""),s?s.nodes.push(f()):t&&r.splice(0,r.length,qt(r.splice(0)));let u=n.pop();r=u?.target??i,s=u?.currentList??null,t=u?.containsCombinator??!1;break}case al:case ai:case sl:{if(d===ai&&l===":"){l+=e[m];break}l.length>0&&c(Ae(l)),l=e[m];break}case fi:{l.length>0&&c(Ae(l)),l="";let u=m,h=0;for(let v=m+1;v<e.length;v++){if(p=e.charCodeAt(v),p===fi){h++;continue}if(p===ll){if(h===0){m=v;break}h--}}l+=e.slice(u,m+1);break}case ul:case ol:{let u=m;for(let h=m+1;h<e.length;h++)if(p=e.charCodeAt(h),p===li)h+=1;else if(p===d){m=h;break}l+=e.slice(u,m+1);break}case fl:case cl:{l.length>0&&(c(Ae(l)),l=""),c(Ae(e[m]));break}case li:{l+=e[m]+e[m+1],m+=1;break}default:l+=e[m]}}return l.length>0&&c(Ae(l)),s?s.nodes.push(f()):t&&r.splice(0,r.length,qt(r.splice(0))),i}function ce(e,i){for(let r in e)delete e[r];return Object.assign(e,i)}function Re(e){let i=[];for(let r of L(e,".")){if(!r.includes("[")){i.push(r);continue}let t=0;for(;;){let n=r.indexOf("[",t),s=r.indexOf("]",n);if(n===-1||s===-1)break;n>t&&i.push(r.slice(t,n)),i.push(r.slice(n+1,s)),t=s+1}t<=r.length-1&&i.push(r.slice(t))}return i}function Qt(e,i){let r=e;return r.storage[ki]??=pl(),r.storage[bi]??=gl(r),r.storage[yi]??=wl(),r.storage[xi]??=bl(),r.storage[Ai]??=xl(),r.storage[er]??=Tl(r),r.storage[At]??=Rl(r,i),r.storage[ve]??=Yl(r),r.storage[tr]??=ql(),r.storage[Ct]??=Hl(r),r.storage[rr]??=Zl(r),r.storage[St]??=Jl(r),r.storage[Ti]??=Ql(r),r.storage[it]??=dl(r),r}var ki=Symbol();function pl(){return new U(e=>new U(i=>({rem:e,features:i})))}var it=Symbol();function dl(e){return new U(i=>{let r=e.storage[ve].get(i);return function(n,s){let l=typeof n=="string"?n:e.printCandidate(n),p=r.get(l);if(typeof p!="string")return!1;let f=typeof s=="string"?s:e.printCandidate(s),c=r.get(f);return typeof c!="string"?!1:p===c}})}function ml(e,i){let r=0;return i?.collapse&&(r|=1),i?.logicalToPhysical&&(r|=2),Qt(e,i).storage[ki].get(i?.rem??null).get(r)}var bi=Symbol();function gl(e){return new U(i=>new U(r=>({features:r,designSystem:e,signatureOptions:i})))}function hl(e,i,r){let t=0;return r?.collapse&&(t|=1),Qt(e).storage[bi].get(i).get(t)}function Xt(e,i,r){let t=ml(e,r),n=hl(e,t,r),s=Qt(e),l=new Set,p=s.storage[yi].get(n);for(let f of i)l.add(p.get(f));return l.size<=1||!(n.features&1)?Array.from(l):vl(n,Array.from(l))}function vl(e,i){let r=e.designSystem,t=new U(p=>new U(f=>new Set)),n=e.designSystem.theme.prefix?`${e.designSystem.theme.prefix}:`:"";for(let p of i){let f=L(p,":"),c=f.pop(),m=c.endsWith("!");m&&(c=c.slice(0,-1));let d=f.length>0?`${f.join(":")}:`:"",u=m?"!":"";t.get(d).get(u).add(`${n}${c}`)}let s=new Set;for(let[p,f]of t.entries())for(let[c,m]of f.entries())for(let d of l(Array.from(m)))n&&d.startsWith(n)&&(d=d.slice(n.length)),s.add(`${p}${d}${c}`);return Array.from(s);function l(p){let f=e.signatureOptions,c=r.storage[Ct].get(f),m=r.storage[tr]
`),s=!0;return _(M(t),l=>{if(l.kind==="function"&&l.value==="var"){let p=l.nodes[0].value;if(!new RegExp(`var\\(${p}[,)]\\s*`,"g").test(n)||n.includes(`${p}:`))return s=!1,V.Stop}}),s}function _l(e,i){if(e.kind!=="functional"||e.value?.kind!=="named")return e;let r=i.designSystem,t=r.storage[rr].get(i.signatureOptions),n=r.storage[ve].get(i.signatureOptions),s=r.storage[it].get(i.signatureOptions),l=r.printCandidate(e),p=n.get(l);if(typeof p!="string")return e;for(let c of f(p,e))if(s(e,c))return c;return e;function*f(c,m){let d=t.get(c);if(d.length>1){let u;for(let h of d)if(h[0]!=="-"){if(u)return;u=h}if(u)for(let h of pe(r,u))yield h;return}if(d.length===0&&m.modifier){let u={...m,modifier:null},h=n.get(r.printCandidate(u));if(typeof h=="string")for(let v of f(h,u))yield Object.assign({},v,{modifier:m.modifier})}if(d.length===1)for(let u of pe(r,d[0]))yield u}}var Il=new Map([["order-none","order-0"],["break-words","wrap-break-word"],["overflow-ellipsis","text-ellipsis"]]),Dl=new Map([[/^(-)?start-(.*?)$/,"$1inset-s-$2"],[/^(-)?end-(.*?)$/,"$1inset-e-$2"]]);function*Kl(e){let i=Il.get(e);i&&(yield i);for(let[r,t]of Dl){let n=e.replace(r,t);n!==e&&(yield n)}}function Ul(e,i){let r=i.designSystem,t=r.storage[it].get(i.signatureOptions),n=Ci(r,e);for(let s of Kl(n)){if(!t(e,s))continue;let[l]=pe(r,s);return l}return e}function zl(e,i){let r=i.designSystem,t=r.storage[St],n=r.storage[Ti],s=Vt(e);for(let[l]of s){if(l.kind==="compound")continue;let p=r.printVariant(l),f=t.get(p);if(typeof f!="string")continue;let c=n.get(f);if(c.length!==1)continue;let m=c[0],d=r.parseVariant(m);d!==null&&ce(l,d)}return e}function Ll(e,i){let r=i.designSystem,t=r.storage[ve].get(i.signatureOptions);if(e.kind==="functional"&&e.value?.kind==="arbitrary"&&e.value.dataType!==null){let n=r.printCandidate({...e,value:{...e.value,dataType:null}});t.get(r.printCandidate(e))===t.get(n)&&(e.value.dataType=null)}return e}function jl(e,i){if(e.kind!=="functional"||e.value?.kind!=="arbitrary")return e;let r=i.designSystem,t=r.storage[ve].get(i.signatureOptions),n=t.get(r.printCandidate(e));if(n===null)return e;for(let s of Si(e))if(t.get(r.printCandidate({...e,value:s}))===n)return e.value=s,e;return e}function Ml(e){let i=Vt(e);for(let[r]of i)if(r.kind==="functional"&&r.root==="data"&&r.value?.kind==="arbitrary"&&!r.value.value.includes("="))r.value={kind:"named",value:r.value.value};else if(r.kind==="functional"&&r.root==="aria"&&r.value?.kind==="arbitrary"&&(r.value.value.endsWith("=true")||r.value.value.endsWith('="true"')||r.value.value.endsWith("='true'"))){let[t,n]=L(r.value.value,"=");if(t[t.length-1]==="~"||t[t.length-1]==="|"||t[t.length-1]==="^"||t[t.length-1]==="$"||t[t.length-1]==="*")continue;r.value={kind:"named",value:r.value.value.slice(0,r.value.value.indexOf("="))}}else r.kind==="functional"&&r.root==="supports"&&r.value?.kind==="arbitrary"&&/^[a-z-][a-z0-9-]*$/i.test(r.value.value)&&(r.value={kind:"named",value:r.value.value});return e}function*Si(e,i=e.value?.value??"",r=new Set){if(r.has(i))return;if(r.add(i),yield{kind:"named",value:i,fraction:null},i.endsWith("%")&&ee(i.slice(0,-1))&&(yield{kind:"named",value:i.slice(0,-1),fraction:null}),i.includes("/")){let[s,l]=i.split("/");I(s)&&I(l)&&(yield{kind:"named",value:s,fraction:`${s}/${l}`})}let t=new Set;for(let s of i.matchAll(/(\d+\/\d+)|(\d+\.?\d+)/g))t.add(s[0].trim());let n=Array.from(t).sort((s,l)=>s.length-l.length);for(let s of n)yield*Si(e,s,r)}function vi(e){return!(e.length===1&&e[0].kind==="list")}function xt(e){return e.value[0]==="["&&e.value[e.value.length-1]==="]"}function Fl(e,i){let r=[e],t=i.designSystem,n=t.storage[St],s=Vt(e);for(let[l,p]of s)if(l.kind==="compound"&&(l.root==="has"||l.root==="not"||l.root==="in")&&l.modifier!==null&&"modifier"in l.variant&&(l.variant.modifier=l.modifier,l.modifier=null),l.kind==="arbitrary"){if(l.relative)continue;let f=Ee(l.selector);if(!vi(f))continue;if(f.length===1&&f[0].kind==="complex"&&(f=f[0].nodes),p===null&&f.length===3&&f[0].kind==="selector"&&f[0].value==="&"&&f[1].kind==="combinator"&&f[1].value===">"&&f[2].kind==
${ae([d])}
Relies on:
${ae([h])}`)}c.add(d);for(let h of s.get(d))for(let v of l.get(h))u.push(d),m(v,u),u.pop();p.add(d),c.delete(d),f.push(d)}}for(let d of n)m(d);for(let d of f)"nodes"in d&&_(d.nodes,u=>{if(u.kind!=="at-rule"||u.name!=="@apply")return;let h=u.params.split(/(\s+)/g),v={},k=[],y=[],N=0;for(let[b,D]of h.entries())b%2===0&&(D[0]==="-"&&D[1]==="-"?y.push(D):k.push(D),v[D]=N),N+=D.length;if(y.length){if(k.length===0)return V.Skip;let b=y.join(" ");throw new Error(`You cannot use \`@apply\` with both mixins and utilities. Please move \`@apply ${b}\` into a separate rule.`)}if(u.nodes.length>0&&k.length){let b=k.join(" ");throw new Error(`The rule \`@apply ${b}\` must not have a body.`)}{let b=Object.keys(v),D=Ve(b,i,{respectImportant:!1,onInvalidCandidate:E=>{if(i.theme.prefix&&!E.startsWith(i.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${E}\`. Did you mean \`${i.theme.prefix}:${E}\`?`);if(i.invalidCandidates.has(E))throw new Error(`Cannot apply utility class \`${E}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let j=L(E,":");if(j.length>1){let q=j.pop();if(i.candidatesToCss([q])[0]){let G=i.candidatesToCss(j.map(ie=>`${ie}:[--tw-variant-check:1]`)),X=j.filter((ie,a)=>G[a]===null);if(X.length>0){if(X.length===1)throw new Error(`Cannot apply utility class \`${E}\` because the ${X.map(ie=>`\`${ie}\``)} variant does not exist.`);{let ie=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${E}\` because the ${ie.format(X.map(a=>`\`${a}\``))} variants do not exist.`)}}}}throw i.theme.size===0?new Error(`Cannot apply unknown utility class \`${E}\`. Are you using CSS modules or similar and missing \`@reference\`? https://tailwindcss.com/docs/functions-and-directives#reference-directive`):new Error(`Cannot apply unknown utility class \`${E}\``)}}),O=u.src,P=D.astNodes.map(E=>{let j=D.nodeSorting.get(E)?.candidate,q=j?v[j]:void 0;if(E=re(E),!O||!j||q===void 0)return _([E],X=>{X.src=O}),E;let G=[O[0],O[1],O[2]];return G[1]+=7+q,G[2]=G[1]+j.length,_([E],X=>{X.src=G}),E}),z=[];for(let E of P)if(E.kind==="rule")for(let j of E.nodes)z.push(j);else z.push(E);return V.Replace(z)}});return r}function*Ui(e,i){for(let r of e.params.split(/\s+/g))for(let t of i.parseCandidate(r))switch(t.kind){case"arbitrary":break;case"static":case"functional":yield t.root;break;default:}}async function or(e,i,r,t=0,n=!1){let s=0,l=[];return _(e,p=>{if(p.kind==="at-rule"&&(p.name==="@import"||p.name==="@reference")){let f=oo(M(p.params));if(f===null)return;p.name==="@reference"&&(f.media="reference"),s|=2;let{uri:c,layer:m,media:d,supports:u}=f;if(c.startsWith("data:")||c.startsWith("http://")||c.startsWith("https://"))return;let h=he({},[]);return l.push((async()=>{if(t>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${c}\` in \`${i}\`)`);let v=await r(c,i),k=Se(v.content,{from:n?v.path:void 0});await or(k,v.base,r,t+1,n),h.nodes=ao(p,[he({base:v.base},k)],m,d,u)})()),V.ReplaceSkip(h)}}),l.length>0&&await Promise.all(l),s}function oo(e){let i,r=null,t=null,n=null;for(let s=0;s<e.length;s++){let l=e[s];if(l.kind!=="separator"){if(l.kind==="word"&&!i){if(!l.value||l.value[0]!=='"'&&l.value[0]!=="'")return null;i=l.value.slice(1,-1);continue}if(l.kind==="function"&&l.value.toLowerCase()==="url"||!i)return null;if((l.kind==="word"||l.kind==="function")&&l.value.toLowerCase()==="layer"){if(r)return null;if(n)throw new Error("`layer(\u2026)` in an `@import` should come before any other functions or conditions");"nodes"in l?r=F(l.nodes):r="";continue}if(l.kind==="function"&&l.value.toLowerCase()==="supports"){if(n)return null;n=F(l.nodes);continue}t=F(e.slice(s));break}}return i?{uri:i,layer:r,media:t,supports:n}:null}function ao(e,i,r,t,n){let s=i;if(r!==null){let l=B("@layer",r,s);l.src=e.src,s=[l]}if(t!==null){let l=B("@media",t,s);l.src=e.src,s=[l]}if(n!==null){let l=B("@supports",n[0]==="("?n:`(${n})`,s);l.src=e.src,s=[l]}return s}function Be(e){if(Object.prototype.toStrin
${ae([y])}
\`@plugin\` options must be a flat list of declarations.`);if(y.value===void 0)continue;let N=y.value,A=L(N,",").map(b=>{if(b=b.trim(),b==="null")return null;if(b==="true")return!0;if(b==="false")return!1;if(Number.isNaN(Number(b))){if(b[0]==='"'&&b[b.length-1]==='"'||b[0]==="'"&&b[b.length-1]==="'")return b.slice(1,-1);if(b[0]==="{"&&b[b.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${ae([y]).trim()}\` is not supported.
Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(b);return b});k[y.property]=A.length===1?A[0]:A}return l.push([{id:v,base:h.context.base,reference:!!h.context.reference,src:d.src},Object.keys(k).length>0?k:null]),s|=4,V.Replace([])}if(d.name==="@config"){if(d.nodes.length>0)throw new Error("`@config` cannot have a body.");if(h.parent!==null)throw new Error("`@config` cannot be nested.");return p.push({id:d.params.slice(1,-1),base:h.context.base,reference:!!h.context.reference,src:d.src}),s|=4,V.Replace([])}}),qi(e);let f=e.resolveThemeValue;if(e.resolveThemeValue=function(u,h){return u.startsWith("--")?f(u,h):(s|=Ji({designSystem:e,base:i,ast:r,sources:n,configs:[],pluginDetails:[]}),e.resolveThemeValue(u,h))},!l.length&&!p.length)return 0;let[c,m]=await Promise.all([Promise.all(p.map(async({id:d,base:u,reference:h,src:v})=>{let k=await t(d,u,"config");return{path:d,base:k.base,config:k.module,reference:h,src:v}})),Promise.all(l.map(async([{id:d,base:u,reference:h,src:v},k])=>{let y=await t(d,u,"plugin");return{path:d,base:y.base,plugin:y.module,options:k,reference:h,src:v}}))]);return s|=Ji({designSystem:e,base:i,ast:r,sources:n,configs:c,pluginDetails:m}),s}function Ji({designSystem:e,base:i,ast:r,sources:t,configs:n,pluginDetails:s}){let l=0,f=[...s.map(k=>{if(!k.options)return{config:{plugins:[k.plugin]},base:k.base,reference:k.reference,src:k.src};if("__isOptionsFunction"in k.plugin)return{config:{plugins:[k.plugin(k.options)]},base:k.base,reference:k.reference,src:k.src};throw new Error(`The plugin "${k.path}" does not accept options`)}),...n],{resolvedConfig:c}=ur(e,[{config:Bi(e.theme),base:i,reference:!0,src:void 0},...f,{config:{plugins:[Gi]},base:i,reference:!0,src:void 0}]),{resolvedConfig:m,replacedThemeKeys:d}=ur(e,f),u={designSystem:e,ast:r,resolvedConfig:c,featuresRef:{set current(k){l|=k}}},h=ar({...u,referenceMode:!1,src:void 0}),v=e.resolveThemeValue;e.resolveThemeValue=function(y,N){if(y[0]==="-"&&y[1]==="-")return v(y,N);let A=h.theme(y,void 0);if(Array.isArray(A)&&A.length===2)return A[0];if(Array.isArray(A))return A.join(", ");if(typeof A=="object"&&A!==null&&"DEFAULT"in A)return A.DEFAULT;if(typeof A=="string")return A};for(let{handler:k,reference:y,src:N}of c.plugins){let A=ar({...u,referenceMode:y??!1,src:N});k(A)}if(Zr(e,m,d),Wi(e,m),Zi(m,e),Hi(m,e),Yi(m,e),!e.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.`)),!ho.test(c.prefix))throw new Error(`The prefix "${c.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);e.theme.prefix=c.prefix}if(!e.important&&c.important===!0&&(e.important=!0),typeof c.important=="string"){let k=c.important;_(r,(y,N)=>{if(y.kind!=="at-rule"||y.name!=="@tailwind"||y.params!=="utilities")return;let A=Qe(N);return A.parent?.kind==="rule"&&A.parent.selector===k?V.Stop:V.ReplaceStop(H(k,[y]))})}for(let k of c.blocklist)e.invalidCandidates.add(k);for(let k of c.content.files){if("raw"in k)throw new Error(`Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry:
${JSON.stringify(k,null,2)}
This feature is not currently supported.`);let y=!1;k.pattern[0]=="!"&&(y=!0,k.pattern=k.pattern.slice(1)),t.push({...k,negated:y})}return l}function Xi({ast:e}){let i=new U(n=>at(n.code)),r=new U(n=>({url:n.file,content:n.code,ignore:!1})),t={file:null,sources:[],mappings:[]};_(e,n=>{if(!n.src||!n.dst)return;let s=r.get(n.src[0]);if(!s.content)return;let l=i.get(n.src[0]),p=i.get(n.dst[0]),f=s.content.slice(n.src[1],n.src[2]),c=0;for(let u of f.split(`
`)){if(u.trim()!==""){let h=l.find(n.src[1]+c),v=p.find(n.dst[1]);t.mappings.push({name:null,originalPosition:{source:s,...h},generatedPosition:v})}c+=u.length,c+=1}let m=l.find(n.src[2]),d=p.find(n.dst[2]);t.mappings.push({name:null,originalPosition:{source:s,...m},generatedPosition:d})});for(let n of i.keys())t.sources.push(r.get(n));return t.mappings.sort((n,s)=>n.generatedPosition.line-s.generatedPosition.line||n.generatedPosition.column-s.generatedPosition.column||(n.originalPosition?.line??0)-(s.originalPosition?.line??0)||(n.originalPosition?.column??0)-(s.originalPosition?.column??0)),t}var en=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function Nt(e){let i=e.indexOf("{");if(i===-1)return[e];let r=[],t=e.slice(0,i),n=e.slice(i),s=0,l=n.lastIndexOf("}");for(let d=0;d<n.length;d++){let u=n[d];if(u==="{")s++;else if(u==="}"&&(s--,s===0)){l=d;break}}if(l===-1)throw new Error(`The pattern \`${e}\` is not balanced.`);let p=n.slice(1,l),f=n.slice(l+1),c;vo(p)?c=wo(p):c=L(p,","),c=c.flatMap(d=>Nt(d));let m=Nt(f);for(let d of m)for(let u of c)r.push(t+u+d);return r}function vo(e){return en.test(e)}function wo(e){let i=e.match(en);if(!i)return[e];let[,r,t,n]=i,s=n?parseInt(n,10):void 0,l=[];if(/^-?\d+$/.test(r)&&/^-?\d+$/.test(t)){let p=parseInt(r,10),f=parseInt(t,10);if(s===void 0&&(s=p<=f?1:-1),s===0)throw new Error("Step cannot be zero in sequence expansion.");let c=p<f;c&&s<0&&(s=-s),!c&&s>0&&(s=-s);for(let m=p;c?m<=f:m>=f;m+=s)l.push(m.toString())}return l}function tn(e,i){let r=new Set,t=new Set,n=[];function s(l,p=[]){if(e.has(l)&&!r.has(l)){t.has(l)&&i.onCircularDependency?.(p,l),t.add(l);for(let f of e.get(l)??[])p.push(l),s(f,p),p.pop();r.add(l),t.delete(l),n.push(l)}}for(let l of e.keys())s(l);return n}var ko=/^[a-z]+$/,Ut=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(Ut||{});function bo(){throw new Error("No `loadModule` function provided to `compile`")}function yo(){throw new Error("No `loadStylesheet` function provided to `compile`")}function xo(e){let i=0,r=null;for(let t of L(e," "))t==="reference"?i|=2:t==="inline"?i|=1:t==="default"?i|=4:t==="static"?i|=8:t.startsWith("prefix(")&&t.endsWith(")")&&(r=t.slice(7,-1));return[i,r]}var Le=(f=>(f[f.None=0]="None",f[f.AtApply=1]="AtApply",f[f.AtImport=2]="AtImport",f[f.JsPluginCompat=4]="JsPluginCompat",f[f.ThemeFunction=8]="ThemeFunction",f[f.Utilities=16]="Utilities",f[f.Variants=32]="Variants",f[f.AtTheme=64]="AtTheme",f))(Le||{});async function rn(e,{base:i="",from:r,loadModule:t=bo,loadStylesheet:n=yo}={}){let s=0;e=[he({base:i},e)],s|=await or(e,i,n,0,r!==void 0);let l=null,p=new fr,f=new Map,c=new Map,m=[],d=null,u=null,h=[],v=[],k=[],y=[],N=null;_(e,(b,D)=>{if(b.kind!=="at-rule")return;let O=Qe(D);if(b.name==="@tailwind"&&(b.params==="utilities"||b.params.startsWith("utilities"))){if(u!==null)return V.Replace([]);if(O.context.reference)return V.Replace([]);let P=L(b.params," ");for(let z of P)if(z.startsWith("source(")){let E=z.slice(7,-1);if(E==="none"){N=E;continue}if(E[0]==='"'&&E[E.length-1]!=='"'||E[0]==="'"&&E[E.length-1]!=="'"||E[0]!=="'"&&E[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");N={base:O.context.sourceBase??O.context.base,pattern:E.slice(1,-1)}}u=b,s|=16}if(b.name==="@utility"){if(O.parent!==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 P=Wr(b);if(P===null){if(!b.params.endsWith("-*")){if(b.params.endsWith("*"))throw new Error(`\`@utility ${b.params}\` defines an invalid utility name. A functional utility must end in \`-*\`.`);if(b.params.includes("*"))throw new Error(`\`@utility ${b.params}\` defines an invalid utility name. The dynamic portion marked by \`-*\` must appear once at the end.`)}throw new Error(`\`@utility ${b.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`)}m.push(P)}if(b.name==="@source"){if(b.nodes.length>0)throw new Error("`@source` cannot have a body.")
`).map((q,G,X)=>`${G===0||G>=X.length-2?" ":">"} ${q}`).join(`
`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`.
${j}`)}),d?V.ReplaceSkip([]):(d=H(":root, :host",[]),d.src=b.src,V.ReplaceSkip(d))}});let A=_i(p,u?.src);if(l&&(A.important=l),y.length>0)for(let b of y)A.invalidCandidates.add(b);s|=await Qi({designSystem:A,base:i,ast:e,loadModule:t,sources:v});for(let b of f.keys())A.variants.static(b,()=>{});for(let b of tn(c,{onCircularDependency(D,O){let P=ae(D.map((z,E)=>B("@custom-variant",z,[B("@variant",D[E+1]??O,[])]))).replaceAll(";"," { \u2026 }").replace(`@custom-variant ${O} {`,`@custom-variant ${O} { /* \u2190 */`);throw new Error(`Circular dependency detected in custom variants:
${P}`)}}))f.get(b)?.(A);for(let b of m)b(A);if(d){let b=[];for(let[O,P]of A.theme.entries()){if(P.options&2)continue;let z=o(_e(O),P.value);z.src=P.src,b.push(z)}let D=A.theme.getKeyframes();for(let O of D)e.push(he({theme:!0},[Y([O])]));d.nodes=[he({theme:!0},b)]}if(s|=Oe(e,A),s|=ze(e,A),s|=Ce(e,A),u){let b=u;b.kind="context",b.context={}}return _(e,b=>{if(b.kind==="at-rule")return b.name==="@utility"?V.Replace([]):V.Skip}),{designSystem:A,ast:e,sources:v,root:N,utilitiesNode:u,features:s,inlineCandidates:k}}async function Ao(e,i={}){let{designSystem:r,ast:t,sources:n,root:s,utilitiesNode:l,features:p,inlineCandidates:f}=await rn(e,i);t.unshift(pt(`! tailwindcss v${mr} | MIT License | https://tailwindcss.com `));function c(v){r.invalidCandidates.add(v)}let m=new Set,d=null,u=0,h=!1;for(let v of f)r.invalidCandidates.has(v)||(m.add(v),h=!0);return{sources:n,root:s,features:p,build(v){if(p===0)return e;if(!l)return d??=$e(t,r,i.polyfills),d;let k=h,y=!1;h=!1;let N=m.size;for(let b of v)if(!r.invalidCandidates.has(b))if(b[0]==="-"&&b[1]==="-"){let D=r.theme.markUsedVariable(b);k||=D,y||=D}else m.add(b),k||=m.size!==N;if(!k)return d??=$e(t,r,i.polyfills),d;let A=Ve(m,r,{onInvalidCandidate:c}).astNodes;return i.from&&_(A,b=>{b.src??=l.src}),!y&&u===A.length?(d??=$e(t,r,i.polyfills),d):(u=A.length,l.nodes=A,d=$e(t,r,i.polyfills),d)}}}async function Ef(e,i={}){let r=Se(e,{from:i.from}),t=await Ao(r,i),n=r,s=e;return{...t,build(l){let p=t.build(l);return p===n||(s=ae(p,!!i.from),n=p),s},buildSourceMap(){return Xi({ast:n})}}}async function Rf(e,i={}){return(await rn(Se(e,{from:i.from}),i)).designSystem}function Co(){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{Le as Features,Ut as Polyfills,Rf as __unstable__loadDesignSystem,Ef as compile,Ao as compileAst,Co as default};