@tailwindcss/upgrade 4.0.0-alpha.27 → 4.0.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +160 -58
- package/package.json +6 -7
package/dist/index.mjs
CHANGED
|
@@ -1,72 +1,174 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{globby as
|
|
3
|
-
`)}function
|
|
4
|
-
`)}function
|
|
5
|
-
|
|
2
|
+
import{globby as Kr}from"globby";import Or from"node:fs/promises";import In from"node:path";import Fn from"postcss";import{parse as jr}from"postcss";import{format as Ir}from"prettier";function w(e,t){let r;return e.each?.(i=>{let n=t(i)??0;if(n===2)return r=!1,r;if(n!==1)return r=w(i,t),r}),r}function Ee(e,t){e?.each?.(r=>{Ee(r,t),t(r)})}function et(){async function e(t){let r=[];w(t,i=>{if(i.raws.tailwind_pretty)return r.push(i),1}),await Promise.all(r.map(async i=>{i.replaceWith(jr(await Ir(i.toString(),{parser:"css",semi:!0,singleQuote:!0})))}))}return{postcssPlugin:"@tailwindcss/upgrade/format-nodes",OnceExit:e}}import O from"picocolors";import zr from"node:fs";import eo from"node:path";import{stripVTControlCharacters as Br}from"node:util";import C from"picocolors";import tt from"enhanced-resolve";import Fr from"node:fs";import{createRequire as Mr}from"node:module";var Lr=Mr(import.meta.url).resolve;function rt(e){if(typeof globalThis.__tw_resolve=="function"){let t=globalThis.__tw_resolve(e);if(t)return t}return Lr(e)}var Ur=tt.ResolverFactory.createResolver({fileSystem:new tt.CachedInputFileSystem(Fr,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});function it(e,t){if(typeof globalThis.__tw_resolve=="function"){let r=globalThis.__tw_resolve(e,t);if(r)return r}return Ur.resolveSync({},t,e)}var oe={indent:2};function le(){return`${C.italic(C.bold(C.blue("\u2248")))} tailwindcss ${C.blue(`v${Wr()}`)}`}function se(e){return`${C.dim(C.blue("`"))}${C.blue(e)}${C.dim(C.blue("`"))}`}function j(e,t){let r=e.split(" "),i=[],n="",l=0;for(let s of r){let o=Br(s).length;l+o+1>t&&(i.push(n),n="",l=0),n+=(l?" ":"")+s,l+=o+(l?1:0)}return l&&i.push(n),i}function H(e,t=0){return`${" ".repeat(t+oe.indent)}${e}`}function I(e,t=F){j(e,process.stderr.columns-3).map(r=>t(`${C.green("\u2502")} ${r}`)),t()}function $(e,t=F){j(e,process.stderr.columns-3).map(r=>t(`${C.blue("\u2502")} ${r}`)),t()}function K(e,t=F){j(e,process.stderr.columns-3).map(r=>t(`${C.red("\u2502")} ${r}`)),t()}function ae(e,t=F){j(e,process.stderr.columns-3).map(r=>t(`${C.yellow("\u2502")} ${r}`)),t()}function F(e=""){process.stderr.write(`${e}
|
|
3
|
+
`)}function A(e=""){process.stdout.write(`${e}
|
|
4
|
+
`)}function Wr(){if(typeof globalThis.__tw_version=="string")return globalThis.__tw_version;let{version:e}=JSON.parse(zr.readFileSync(rt("tailwindcss/package.json"),"utf-8"));return e}function nt({invalid:e,usage:t,options:r}){let i=process.stdout.columns;if(A(le()),e&&(A(),A(`${O.dim("Invalid command:")} ${e}`)),t&&t.length>0){A(),A(O.dim("Usage:"));for(let[n,l]of t.entries()){let s=l.slice(0,l.indexOf("[")),o=l.slice(l.indexOf("["));o=o.replace(/\[.*?\]/g,f=>O.dim(f));let u=j(o,i-oe.indent-s.length-1);u.length>1&&n!==0&&A(),A(H(`${s}${u.shift()}`));for(let f of u)A(H(f,s.length))}}if(r){let n=0;for(let{alias:a}of Object.values(r))a&&(n=Math.max(n,a.length));let l=[],s=0;for(let[a,{alias:u}]of Object.entries(r)){let f=[u&&`${u.padStart(n)}`,u?a:" ".repeat(n+2)+a].filter(Boolean).join(", ");l.push(f),s=Math.max(s,f.length)}A(),A(O.dim("Options:"));let o=8;for(let{description:a,default:u=null}of Object.values(r)){let f=l.shift(),p=o+(s-f.length),c=2,m=i-f.length-p-c-oe.indent,d=j(u!==null?`${a} ${O.dim(`[default:\u202F${se(`${u}`)}]`)}`:a,m);A(H(`${O.blue(f)} ${O.dim(O.gray("\xB7")).repeat(p)} ${d.shift()}`));for(let g of d)A(H(`${" ".repeat(f.length+p+c)}${g}`))}}}import Li from"node:path";import Je from"postcss";var T=class extends Map{constructor(r){super();this.factory=r}get(r){let i=super.get(r);return i===void 0&&(i=this.factory(r,this),this.set(r,i)),i}};var ue=new Uint8Array(256);function v(e,t){let r=0,i=[],n=0,l=e.length,s=t.charCodeAt(0);for(let o=0;o<l;o++){let a=e.charCodeAt(o);if(r===0&&a===s){i.push(e.slice(n,o)),n=o+1;continue}switch(a){case 92:o+=1;break;case 39:case 34:for(;++o<l;){let u=e.charCodeAt(o);if(u===92){o+=1;continue}if(u===a)break}break;case 40:ue[r]=41,r++;break;case 91:ue[r]=93,r++;break;case 123:ue[r]=125,r++;break;case 93:case 125:case 41:r>0&&a===ue[r-1]&&r--;break}}return i.push(e.slice(n)),i}import It from"node:fs/promises";import xi,{extname as Ci}from"node:path";import{Scanner as Xr}from"@tailwindcss/oxide";function Oe(e){return{kind:"word",value:e}}function qr(e,t){return{kind:"function",value:e,nodes:t}}function Jr(e){return{kind:"separator",value:e}}function _(e,t,r=null){for(let i=0;i<e.length;i++){let n=e[i],l=t(n,{parent:r,replaceWith(s){e.splice(i,1,...Array.isArray(s)?s:[s]),i--}})??0;if(l===2)return;l!==1&&n.kind==="function"&&_(n.nodes,t,n)}}function S(e){let t="";for(let r of e)switch(r.kind){case"word":case"separator":{t+=r.value;break}case"function":t+=r.value+"("+S(r.nodes)+")"}return t}var Gr=92,Yr=41,ot=58,lt=44,Hr=34,Qr=40,Zr=39,st=32,at=60,ut=62,ft=61,ct=47;function V(e){e=e.replaceAll(`\r
|
|
5
|
+
`,`
|
|
6
|
+
`);let t=[],r=[],i=null,n="",l;for(let s=0;s<e.length;s++){let o=e.charCodeAt(s);switch(o){case ot:case lt:case st:case ct:case at:case ut:case ft:{if(n.length>0){let p=Oe(n);i?i.nodes.push(p):t.push(p),n=""}let a=s,u=s+1;for(;u<e.length&&(l=e.charCodeAt(u),!(l!==ot&&l!==lt&&l!==st&&l!==ct&&l!==at&&l!==ut&&l!==ft));u++);s=u-1;let f=Jr(e.slice(a,u));i?i.nodes.push(f):t.push(f);break}case Zr:case Hr:{let a=s;for(let u=s+1;u<e.length;u++)if(l=e.charCodeAt(u),l===Gr)u+=1;else if(l===o){s=u;break}n+=e.slice(a,s+1);break}case Qr:{let a=qr(n,[]);n="",i?i.nodes.push(a):t.push(a),r.push(a),i=a;break}case Yr:{let a=r.pop();if(n.length>0){let u=Oe(n);a.nodes.push(u),n=""}r.length>0?i=r[r.length-1]:i=null;break}default:n+=String.fromCharCode(o)}}return n.length>0&&t.push(Oe(n)),t}async function pt(e,t="html"){let i=new Xr({}).getCandidatesWithPositions({content:e,extension:t}),n=[];for(let{candidate:l,position:s}of i)n.push({rawCandidate:l,start:s,end:s+l.length});return n}function b(e,t){let r=[];for(let n of t.variants)r.unshift(dt(n));e.theme.prefix&&r.unshift(e.theme.prefix);let i="";return(t.kind==="static"||t.kind==="functional")&&t.negative&&(i+="-"),t.kind==="static"&&(i+=t.root),t.kind==="functional"&&(i+=t.root,t.value&&(t.value.kind==="arbitrary"?t.value===null?i+="":t.value.dataType?i+=`-[${t.value.dataType}:${M(t.value.value)}]`:i+=`-[${M(t.value.value)}]`:t.value.kind==="named"&&(i+=`-${t.value.value}`))),t.kind==="arbitrary"&&(i+=`[${t.property}:${M(t.value)}]`),(t.kind==="arbitrary"||t.kind==="functional")&&t.modifier&&(t.modifier.kind==="arbitrary"?i+=`/[${M(t.modifier.value)}]`:t.modifier.kind==="named"&&(i+=`/${t.modifier.value}`)),t.important&&(i+="!"),r.push(i),r.join(":")}function dt(e){if(e.kind==="static")return e.root;if(e.kind==="arbitrary")return`[${M(ei(e.selector))}]`;let t="";return e.kind==="functional"&&(t+=e.root,e.value&&(e.value.kind==="arbitrary"?t+=`-[${M(e.value.value)}]`:e.value.kind==="named"&&(t+=`-${e.value.value}`))),e.kind==="compound"&&(t+=e.root,t+="-",t+=dt(e.variant)),(e.kind==="functional"||e.kind==="compound")&&e.modifier&&(e.modifier.kind==="arbitrary"?t+=`/[${M(e.modifier.value)}]`:e.modifier.kind==="named"&&(t+=`/${e.modifier.value}`)),t}function M(e){let t=V(e),r=new Set;return _(t,(i,{parent:n})=>{let l=n===null?t:n.nodes??[];if(i.kind==="word"&&(i.value==="+"||i.value==="-"||i.value==="*"||i.value==="/")){let s=l.indexOf(i)??-1;if(s===-1)return;let o=l[s-1];if(o?.kind!=="separator"||o.value!==" ")return;let a=l[s+1];if(a?.kind!=="separator"||a.value!==" ")return;r.add(o),r.add(a)}else i.kind==="separator"&&i.value.trim()==="/"?i.value="/":i.kind==="separator"&&i.value.length>0&&i.value.trim()===""&&(l[0]===i||l[l.length-1]===i)&&r.add(i)}),r.size>0&&_(t,(i,{replaceWith:n})=>{r.has(i)&&(r.delete(i),n([]))}),S(t).replaceAll("_",String.raw`\_`).replaceAll(" ","_")}function ei(e){let t=V(e);return t.length===3&&t[0].kind==="word"&&t[0].value==="&"&&t[1].kind==="separator"&&t[1].value===":"&&t[2].kind==="function"&&t[2].value==="is"?S(t[2].nodes):e}var mt=["calc","min","max","clamp","mod","rem","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","round"],ce=["anchor-size"],gt=new RegExp(`(${ce.join("|")})\\(`,"g");function ht(e){if(e.indexOf("(")===-1||!mt.some(n=>e.includes(n)))return e;let t=!1;ce.some(n=>e.includes(n))&&(gt.lastIndex=0,e=e.replace(gt,(n,l)=>(t=!0,`$${ce.indexOf(l)}$(`)));let r="",i=[];for(let n=0;n<e.length;n++){let l=e[n];if(l==="("){r+=l;let s=n;for(let a=n-1;a>=0;a--){let u=e.charCodeAt(a);if(u>=48&&u<=57)s=a;else if(u>=97&&u<=122)s=a;else break}let o=e.slice(s,n);if(mt.includes(o)){i.unshift(!0);continue}else if(i[0]&&o===""){i.unshift(!0);continue}i.unshift(!1);continue}else if(l===")")r+=l,i.shift();else if(l===","&&i[0]){r+=", ";continue}else{if(l===" "&&i[0]&&r[r.length-1]===" ")continue;if((l==="+"||l==="*"||l==="/"||l==="-")&&i[0]){let s=r.trimEnd(),o=s[s.length-1];if(o==="+"||o==="*"||o==="/"||o==="-"){r+=l;continue}else if(o==="("||o===","){r+=l;continue}else e[n-1]===" "?r+=`${l} `:r+=` ${l} `}else if(i[0]&&e.startsWith("to-zero",n)){let s=n;n+=7,r+=e.slice(s,n+1)}else r+=l}}return t?r.replace(/\$(\d+)\$/g,(n,l)=>ce[l]??n):r}function pe(e){return e.startsWith("url(")||(e=ti(e),e=ht(e)),e}function ti(e){let t="";for(let r=0;r<e.length;r++){let i=e[r];i==="\\"&&e[r+1]==="_"?(t+="_",r+=1):i==="_"?t+=" ":t+=i}return t}var ri=58,yt=45,vt=97,wt=122;function*P(e,t){let r=v(e,":");if(t.theme.prefix){if(r.length===1||r[0]!==t.theme.prefix)return null;r.shift()}let i=r.pop(),n=[];for(let p=r.length-1;p>=0;--p){let c=t.parseVariant(r[p]);if(c===null)return;n.push(c)}let l=!1,s=!1;i[i.length-1]==="!"?(l=!0,i=i.slice(0,-1)):i[0]==="!"&&(l=!0,i=i.slice(1)),i[0]==="-"&&(s=!0,i=i.slice(1)),t.utilities.has(i,"static")&&!i.includes("[")&&(yield{kind:"static",root:i,variants:n,negative:s,important:l,raw:e});let[o,a=null,u]=v(i,"/");if(u)return;if(o[0]==="["){if(o[o.length-1]!=="]")return;let p=o.charCodeAt(1);if(p!==yt&&!(p>=vt&&p<=wt))return;o=o.slice(1,-1);let c=o.indexOf(":");if(c===-1||c===0||c===o.length-1)return;let m=o.slice(0,c),d=pe(o.slice(c+1));yield{kind:"arbitrary",property:m,value:d,modifier:a===null?null:bt(a),variants:n,important:l,raw:e};return}let f;if(o[o.length-1]==="]"){let p=o.indexOf("-[");if(p===-1)return;let c=o.slice(0,p);if(!t.utilities.has(c,"functional"))return;let m=o.slice(p+1);f=[[c,m]]}else f=ii(o,p=>t.utilities.has(p,"functional"));for(let[p,c]of f){let m={kind:"functional",root:p,modifier:a===null?null:bt(a),value:null,variants:n,negative:s,important:l,raw:e};if(c===null){yield m;continue}{let d=c.indexOf("[");if(d!==-1){let h=c.slice(d+1,-1),y="";for(let k=0;k<h.length;k++){let D=h.charCodeAt(k);if(D===ri){y=h.slice(0,k),h=h.slice(k+1);break}if(!(D===yt||D>=vt&&D<=wt))break}m.value={kind:"arbitrary",dataType:y||null,value:pe(h)}}else{let h=a===null||m.modifier?.kind==="arbitrary"?null:`${c}/${a}`;m.value={kind:"named",value:c,fraction:h}}}yield m}}function bt(e){if(e[0]==="["&&e[e.length-1]==="]"){let t=e.slice(1,-1);return{kind:"arbitrary",value:pe(t)}}return{kind:"named",value:e}}function*ii(e,t){t(e)&&(yield[e,null]);let r=e.lastIndexOf("-");if(r===-1){e[0]==="@"&&t("@")&&(yield["@",e.slice(1)]);return}do{let i=e.slice(0,r);if(t(i)){let n=[i,e.slice(r+1)];if(n[1]==="")break;yield n}r=e.lastIndexOf("-",r-1)}while(r>0)}var L=/[+-]?\d*\.?\d+(?:[eE][+-]?\d+)?/,$o=new RegExp(`^${L.source}$`);var To=new RegExp(`^${L.source}%$`);var ni=["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"],_o=new RegExp(`^${L.source}(${ni.join("|")})$`);var oi=["deg","rad","grad","turn"],Vo=new RegExp(`^${L.source}(${oi.join("|")})$`);var No=new RegExp(`^${L.source} +${L.source} +${L.source}$`);function Q(e){let t=Number(e);return Number.isInteger(t)&&t>=0&&String(t)===String(e)}function kt(e,t,r){for(let i of P(r,e)){let n=structuredClone(i),l=!1;if(n.kind==="functional"&&n.value?.kind==="arbitrary"&&n.value.dataType===null&&(n.root==="from"||n.root==="via"||n.root==="to"||n.root==="font-stretch")){if(n.value.value.endsWith("%")&&Q(n.value.value.slice(0,-1))){let s=parseInt(n.value.value);(n.root==="from"||n.root==="via"||n.root==="to"||n.root==="font-stretch"&&s>=50&&s<=200)&&(l=!0,n.value={kind:"named",value:n.value.value,fraction:null})}}else if(n.kind==="functional"&&n.value?.kind==="arbitrary"&&n.value.dataType===null){let s=v(n.value.value,"/");if(s.every(o=>Q(o))){l=!0;let o=n.value,a=n.modifier;s.length===1?n.value={kind:"named",value:n.value.value,fraction:null}:(n.value={kind:"named",value:s[0],fraction:n.value.value},n.modifier={kind:"named",value:s[1]}),e.compileAstNodes(n).length===0&&(n.value=o,n.modifier=a,l=!1)}}for(let s of li(n))if(s.kind==="functional"&&s.root==="data"&&s.value?.kind==="arbitrary"&&!s.value.value.includes("="))l=!0,s.value={kind:"named",value:s.value.value};else if(s.kind==="functional"&&s.root==="aria"&&s.value?.kind==="arbitrary"&&(s.value.value.endsWith("=true")||s.value.value.endsWith('="true"')||s.value.value.endsWith("='true'"))){let[o,a]=v(s.value.value,"=");if(o[o.length-1]==="~"||o[o.length-1]==="|"||o[o.length-1]==="^"||o[o.length-1]==="$"||o[o.length-1]==="*")continue;l=!0,s.value={kind:"named",value:s.value.value.slice(0,s.value.value.indexOf("="))}}else s.kind==="functional"&&s.root==="supports"&&s.value?.kind==="arbitrary"&&/^[a-z-][a-z0-9-]*$/i.test(s.value.value)&&(l=!0,s.value={kind:"named",value:s.value.value});return l?b(e,n):r}return r}function*li(e){function*t(r){yield r,r.kind==="compound"&&(yield*t(r.variant))}for(let r of e.variants)yield*t(r)}function x(e,t){return{kind:"rule",selector:e,nodes:t}}function R(e,t){return{kind:"declaration",property:e,value:t,important:!1}}function N(e,t,r=null,i={}){for(let n=0;n<e.length;n++){let l=e[n];if(l.kind==="context"){N(l.nodes,t,r,{...i,...l.context});continue}let s=t(l,{parent:r,replaceWith(o){e.splice(n,1,...Array.isArray(o)?o:[o]),n--},context:i})??0;if(s===2)return;s!==1&&l.kind==="rule"&&N(l.nodes,t,l,i)}}function De(e){let t="",r=new Set,i=[],n=[];function l(u,f=0){let p="",c=" ".repeat(f);if(u.kind==="rule"){if(u.selector==="@tailwind utilities"){for(let m of u.nodes)p+=l(m,f);return p}if(u.selector[0]==="@"&&u.nodes.length===0)return`${c}${u.selector};
|
|
7
|
+
`;if(u.selector[0]==="@"&&u.selector.startsWith("@property ")&&f===0){if(r.has(u.selector))return"";let m=u.selector.replace(/@property\s*/g,""),d=null,g=!1;for(let h of u.nodes)h.kind==="declaration"&&(h.property==="initial-value"?d=h.value:h.property==="inherits"&&(g=h.value==="true"));g?i.push(R(m,d??"initial")):n.push(R(m,d??"initial")),r.add(u.selector)}p+=`${c}${u.selector} {
|
|
6
8
|
`;for(let m of u.nodes)p+=l(m,f+1);p+=`${c}}
|
|
7
9
|
`}else if(u.kind==="comment")p+=`${c}/*${u.value}*/
|
|
8
10
|
`;else if(u.kind==="context")for(let m of u.nodes)p+=l(m,f);else if(u.kind==="at-root"){for(let m of u.nodes)t+=l(m,0);return p}else u.property!=="--tw-sort"&&u.value!==void 0&&u.value!==null&&(p+=`${c}${u.property}: ${u.value}${u.important?" !important":""};
|
|
9
|
-
`);return p}let
|
|
11
|
+
`);return p}let s="";for(let u of e){let f=l(u);f!==""&&(s+=f)}let o=[];i.length&&o.push(x(":root",i)),n.length&&o.push(x("*, ::before, ::after, ::backdrop",n));let a="";return o.length&&(a=l(x("@supports (-moz-orient: inline)",[x("@layer base",o)]))),`${s}${a}${t}`}function xt(e,t,r){for(let i of e.parseCandidate(r)){let n=structuredClone(i),l=!1;if("modifier"in n&&n.modifier?.kind==="arbitrary"&&!me(e,n,n.modifier.value)){let{value:s,didChange:o}=de(n.modifier.value);n.modifier.value=s,l||=o}for(let s of n.variants)Ct(e,s)&&(l=!0);if(n.kind==="arbitrary"&&!me(e,n,n.value)){let{value:s,didChange:o}=de(n.value);n.value=s,l||=o}if(n.kind==="functional"&&n.value&&n.value.kind==="arbitrary"&&!me(e,n,n.value.value)){let{value:s,didChange:o}=de(n.value.value);n.value.value=s,l||=o}if(l)return b(e,n)}return r}function de(e){let t=!1;return e.startsWith("--")?(e=`var(${e})`,t=!0):e.startsWith(" --")&&(e=e.slice(1),t=!0),{value:e,didChange:t}}function Ct(e,t){let r=!1;if(t.kind==="functional"&&t.value&&t.value.kind==="arbitrary"&&!me(e,si(t),t.value.value)){let{value:i,didChange:n}=de(t.value.value);t.value.value=i,r||=n}return t.kind==="compound"&&Ct(e,t.variant)&&(r=!0),r}function si(e){return{kind:"arbitrary",property:"color",value:"red",modifier:null,variants:[e],important:!1,raw:"candidate"}}var ai=new Set(["scroll-timeline-name","timeline-scope","view-timeline-name","font-palette","anchor-name","anchor-scope","position-anchor","position-try-options","scroll-timeline","animation-timeline","view-timeline","position-try"]);function me(e,t,r){let i=e.compileAstNodes(t).map(l=>l.node),n=!1;return N(i,l=>{if(l.kind==="declaration"&&ai.has(l.property)&&l.value==r)return n=!0,2}),n}var ui=["t","tr","r","br","b","bl","l","tl"];function At(e,t,r){for(let i of e.parseCandidate(r))if(i.kind==="static"&&i.root.startsWith("bg-gradient-to-")){let n=i.root.slice(15);if(!ui.includes(n))continue;return b(e,{...i,root:`bg-linear-to-${n}`})}return r}function $t(e,t,r,i){for(let n of P(r,e))if(n.important&&n.raw[n.raw.length-1]!=="!"){if(i){let l=!1;for(let o=i.start-1;o>=0;o--){let a=i.contents.at(o);if(a===`
|
|
12
|
+
`)break;if(St(a)){l=!0;break}}let s=!1;for(let o=i.end;o<i.contents.length;o++){let a=i.contents.at(o);if(a===`
|
|
13
|
+
`)break;if(St(a)){s=!0;break}}if(!l||!s)continue}return b(e,n)}return r}function St(e){switch(e){case'"':case"'":case"`":return!0;default:return!1}}function Tt(e,t,r){for(let i of e.parseCandidate(r))if(i.kind==="functional"&&i.root==="max-w"&&i.value?.value.startsWith("screen-"))return b(e,{...i,value:{...i.value,value:`[theme(screens.${i.value.value.slice(7)})]`}});return r}function _t(e,t,r){if(!e.theme.prefix)return r;let i=fi(e,t,r);if(!i)return r;let n=e.theme.prefix,l=null;try{e.theme.prefix=null;let s=r.slice(0,i.start)+i.base+r.slice(i.end),o=[...P(s,e)];o.length>0&&(l=o[0])}finally{e.theme.prefix=n}return l?b(e,l):r}function fi(e,t,r){if(!e.theme.prefix)return null;if(!t.prefix)throw new Error("Could not find the Tailwind CSS v3 `prefix` configuration inside the JavaScript config.");let n=v(r,":").pop(),l=r.length-n.length,s=l+n.length,o=!1,a=!1;return n[n.length-1]==="!"?(o=!0,n=n.slice(0,-1)):n[0]==="!"&&(o=!0,n=n.slice(1)),n[0]==="-"&&(a=!0,n=n.slice(1)),!n.startsWith(t.prefix)&&n[0]!=="["?null:(n[0]!=="["&&(n=n.slice(t.prefix.length)),a&&(n="-"+n),o&&(n+="!"),{base:n,start:l,end:s})}var ci=/([a-z]+)/;function Vt(e){let t=ci.exec(e.toLocaleLowerCase());return t?t[0]:(console.warn(`The prefix "${e} can not be used with Tailwind CSS v4 and cannot be converted to a valid one automatically. We've updated it to "tw" for you.`),"tw")}var Ie={"overflow-clip":"text-clip","overflow-ellipsis":"text-ellipsis","flex-grow":"grow","flex-grow-0":"grow-0","flex-shrink":"shrink","flex-shrink-0":"shrink-0","decoration-clone":"box-decoration-clone","decoration-slice":"box-decoration-slice"},Nt=new WeakSet;function Pt(e,t,r){if(!Nt.has(e)){for(let i in Ie)e.utilities.static(i,()=>[]);Nt.add(e)}for(let i of e.parseCandidate(r))if(i.kind==="static"&&Object.hasOwn(Ie,i.root))return b(e,{...i,root:Ie[i.root]});return r}function U(e){if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");var t=String(e),r=t.length,i=-1,n,l="",s=t.charCodeAt(0);if(r==1&&s==45)return"\\"+t;for(;++i<r;){if(n=t.charCodeAt(i),n==0){l+="\uFFFD";continue}if(n>=1&&n<=31||n==127||i==0&&n>=48&&n<=57||i==1&&n>=48&&n<=57&&s==45){l+="\\"+n.toString(16)+" ";continue}if(n>=128||n==45||n==95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){l+=t.charAt(i);continue}l+="\\"+t.charAt(i)}return l}function Rt(e){return e.replace(/\\([\dA-Fa-f]{1,6}[\t\n\f\r ]?|[\S\s])/g,t=>t.length>2?String.fromCodePoint(Number.parseInt(t.slice(1).trim(),16)):t[1])}function Et(e){let t=[];return Kt(e,[],(r,i)=>{if(mi(r))return t.push([i,r]),1;if(gi(r)){t.push([i,r[0]]);for(let n of Reflect.ownKeys(r[1]))t.push([[...i,`-${n}`],r[1][n]]);return 1}if(Array.isArray(r)&&r.every(n=>typeof n=="string"))return t.push([i,r.join(", ")]),1}),t}var di=/^[a-zA-Z0-9-_%/\.]+$/;function z(e){e[0]==="colors"&&(e[0]="color"),e[0]==="screens"&&(e[0]="breakpoint"),e[0]==="borderRadius"&&(e[0]="radius"),e[0]==="boxShadow"&&(e[0]="shadow"),e[0]==="animation"&&(e[0]="animate");for(let t of e)if(!di.test(t))return null;return e.map((t,r,i)=>t==="1"&&r!==i.length-1?"":t).map(t=>t.replaceAll(".","_").replace(/([a-z])([A-Z])/g,(r,i,n)=>`${i}-${n.toLowerCase()}`)).filter((t,r)=>t!=="DEFAULT"||r!==e.length-1).join("-")}function mi(e){return typeof e=="number"||typeof e=="string"}function gi(e){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"&&typeof e[0]!="number"||e[1]===void 0||e[1]===null||typeof e[1]!="object")return!1;for(let t of Reflect.ownKeys(e[1]))if(typeof t!="string"||typeof e[1][t]!="string"&&typeof e[1][t]!="number")return!1;return!0}function Kt(e,t=[],r){for(let i of Reflect.ownKeys(e)){let n=e[i];if(n==null)continue;let l=[...t,i],s=r(n,l)??0;if(s!==1){if(s===2)break;!Array.isArray(n)&&typeof n!="object"||Kt(n,l,r)}}}function B(e){let t=[];for(let r of v(e,".")){if(!r.includes("[")){t.push(r);continue}let i=0;for(;;){let n=r.indexOf("[",i),l=r.indexOf("]",n);if(n===-1||l===-1)break;n>i&&t.push(r.slice(i,n)),t.push(r.slice(n+1,l)),i=l+1}i<=r.length-1&&t.push(r.slice(i))}return t}function Ot(e,t,r){let i=Fe(e);for(let n of P(r,e)){let l=structuredClone(n),s=!1;if(l.kind==="arbitrary"){let[o,a]=i(l.value,l.modifier===null?1:0);o!==l.value&&(s=!0,l.value=o,a!==null&&(l.modifier=a))}else if(l.kind==="functional"&&l.value?.kind==="arbitrary"){let[o,a]=i(l.value.value,l.modifier===null?1:0);o!==l.value.value&&(s=!0,l.value.value=o,a!==null&&(l.modifier=a))}for(let o of yi(l))if(o.kind==="arbitrary"){let[a]=i(o.selector,2);a!==o.selector&&(s=!0,o.selector=a)}else if(o.kind==="functional"&&o.value?.kind==="arbitrary"){let[a]=i(o.value.value,2);a!==o.value.value&&(s=!0,o.value.value=a)}return s?b(e,l):r}return r}function Fe(e,{prettyPrint:t=!1}={}){function r(s,o=0){let a=V(s);if(o&2)return[ge(a,l),null];let u=0,f=0;if(_(a,m=>{m.kind==="function"&&m.value==="theme"&&(u+=1,_(m.nodes,d=>d.kind==="separator"&&d.value.includes(",")?2:d.kind==="separator"&&d.value.trim()==="/"?(f+=1,2):1))}),u===0)return[s,null];if(f===0)return[ge(a,n),null];if(f>1)return[ge(a,l),null];let p=null;return[ge(a,(m,d)=>{let g=v(m,"/").map(h=>h.trim());if(g.length>2)return null;if(g.length===2&&o&1){let[h,y]=g;if(/^\d+%$/.test(y))p={kind:"named",value:y.slice(0,-1)};else if(/^0?\.\d+$/.test(y)){let k=Number(y)*100;p={kind:Number.isInteger(k)?"named":"arbitrary",value:k.toString()}}else p={kind:"arbitrary",value:y};m=h}return n(m,d)||l(m,d)}),p]}function i(s){let o=`--${z(B(s))}`;return e.theme.get([o])?o:null}function n(s,o){let a=i(s);return a?o?`var(${a}, ${o})`:`var(${a})`:null}function l(s,o){let a=v(s,"/").map(p=>p.trim());s=a.shift();let u=i(s);if(!u)return null;let f=a.length>0?t?` / ${a.join(" / ")}`:`/${a.join("/")}`:"";return o?`theme(${u}${f}, ${o})`:`theme(${u}${f})`}return r}function ge(e,t){return _(e,(r,{replaceWith:i})=>{if(r.kind==="function"&&r.value==="theme"){if(r.nodes.length<1)return;let n=r.nodes[0];if(n.kind!=="word")return;let l=n.value,s=1;for(let u=s;u<r.nodes.length&&!r.nodes[u].value.includes(",");u++)l+=S([r.nodes[u]]),s=u+1;l=hi(l);let o=r.nodes.slice(s+1),a=o.length>0?t(l,S(o)):t(l);if(a===null)return;i(V(a))}}),S(e)}function hi(e){if(e[0]!=="'"&&e[0]!=='"')return e;let t="",r=e[0];for(let i=1;i<e.length-1;i++){let n=e[i],l=e[i+1];n==="\\"&&(l===r||l==="\\")?(t+=l,i++):t+=n}return t}function*yi(e){function*t(r){yield r,r.kind==="compound"&&(yield*t(r.variant))}for(let r of e.variants)yield*t(r)}function Dt(e,t,r){for(let i of e.parseCandidate(r)){if(i.variants.length<=1)continue;let n=[],l=[],s=[],o=i.variants;for(let f of i.variants)vi(e,f)?n.push(f):bi(e,f)?s.push(f):l.push(f);let a=l.some(f=>wi(e,f)),u=[...s,...a?l.reverse():l,...n];if(!ki(o,u))return b(e,{...i,variants:u})}return r}function vi(e,t){return t.kind==="static"&&t.root==="dark"?!0:Me(e,t).every(i=>i.kind==="rule"&&i.selector[0]==="@")}function wi(e,t){return Me(e,t).some(i=>i.kind==="rule"&&i.selector[0]!=="@"&&(i.selector.includes(" ")||i.selector.includes(">")||i.selector.includes("+")||i.selector.includes("~")))}function bi(e,t){return Me(e,t).some(i=>i.kind==="rule"&&(i.selector.includes("::after")||i.selector.includes("::backdrop")||i.selector.includes("::before")||i.selector.includes("::first-letter")||i.selector.includes("::first-line")||i.selector.includes("::marker")||i.selector.includes("::placeholder")||i.selector.includes("::selection")))}function Me(e,t){let r=[],i=e.compileAstNodes({kind:"arbitrary",property:"color",value:"red",modifier:null,variants:[t],important:!1,raw:"candidate"}).map(n=>n.node);return N(i,n=>{n.kind==="rule"&&n.selector===".candidate"||n.kind==="declaration"&&n.property==="color"&&n.value==="red"||r.push(n)}),r}function ki(e,t){return e.length!==t.length?!1:e.every((r,i)=>t[i]===r)}function jt(e,t){if(!t[0])return e;t.sort((n,l)=>n.end-l.end||n.start-l.start);let r="",i=t[0];r+=e.slice(0,i.start),r+=i.replacement;for(let n=1;n<t.length;++n){let l=t[n];r+=e.slice(i.end,l.start),r+=l.replacement,i=l}return r+=e.slice(i.end),r}var Ai=[_t,$t,xt,At,Pt,kt,Tt,Ot,Dt];function Le(e,t,r,i){for(let n of Ai)r=n(e,t,r,i);return r}async function Ft(e,t,r,i){let n=await pt(r,i),l=[];for(let{rawCandidate:s,start:o,end:a}of n){let u=Le(e,t,s,{contents:r,start:o,end:a});u!==s&&l.push({start:o,end:a,replacement:u})}return jt(r,l)}async function Mt(e,t,r){let i=xi.resolve(process.cwd(),r),n=await It.readFile(i,"utf-8");await It.writeFile(i,await Ft(e,t,n,Ci(r)))}function Lt({designSystem:e,userConfig:t}){function r(i){let n=i.params.split(/(\s+)/),l=n[n.length-1]==="!important"||n[n.length-1]==="#{!important}";l&&n.pop();let s=n.map(o=>{if(o.trim()==="")return o;let a=v(o,":"),u=a.pop();return l&&u[0]!=="!"&&u[u.length-1]!=="!"&&(u+="!"),[...a,u].join(":")});s=s.map(o=>Le(e,t,o)),i.params=s.join("").trim()}return{postcssPlugin:"@tailwindcss/upgrade/migrate-at-apply",OnceExit(i){i.walkAtRules("apply",r)}}}import"postcss";import ye from"postcss-selector-parser";import*as Ut from"node:fs/promises";import*as he from"node:path";import*as zt from"node:util";import*as Ue from"postcss";var W=class e{id;root;file=null;parents=new Set;children=new Set;canMigrate=!0;extension=null;static async load(t){t=he.resolve(process.cwd(),t);let r=await Ut.readFile(t,"utf-8"),i=Ue.parse(r,{from:t});return new e(i,t)}static async fromString(t){let r=Ue.parse(t);return new e(r)}static async fromRoot(t,r){return new e(t,r)}constructor(t,r){this.id=Math.random().toString(36).slice(2),this.root=t,this.file=r??null,r&&(this.extension=he.extname(r))}get importRules(){let t=new Set;return this.root.walkAtRules("import",r=>{t.add(r)}),t}get isEmpty(){return this.root.toString().trim()===""}*ancestors(){for(let{item:t}of Z(this,r=>r.parents))yield t}*descendants(){for(let{item:t}of Z(this,r=>r.children))yield t}layers(){let t=new Set;for(let{item:r,path:i}of Z(this,n=>n.parents))if(!(r.parents.size>0))for(let{meta:n}of i)for(let l of n.layers)t.add(l);return t}*pathsToRoot(){for(let{item:t,path:r}of Z(this,i=>i.parents))t.parents.size>0||(yield r)}analyzeImportPaths(){let t=[],r=[];for(let i of this.pathsToRoot()){let n=!1;for(let{meta:l}of i)for(let s of l.layers)n||=s==="utilities"||s==="components";n?t.push(i):r.push(i)}return{convertiblePaths:t,nonConvertiblePaths:r}}[zt.inspect.custom](){return{...this,root:this.root.toString(),layers:Array.from(this.layers()),parents:Array.from(this.parents,t=>t.item.id),children:Array.from(this.children,t=>t.item.id),parentsMeta:Array.from(this.parents,t=>t.meta),childrenMeta:Array.from(this.children,t=>t.meta)}}};function*Z(e,t,r=[]){for(let i of t(e)){let n=[...r,i];yield*Z(i.item,t,n),yield{item:i.item,path:n}}}function Bt(e){function t(r){if(r.params!=="utilities"&&r.params!=="components")return;let i=r.clone();w(r,s=>{if(s.type!=="rule")return;let o=v(s.selector,",");if(o.length>1){let a=[];for(let u of o){let f=s.clone({selector:u});a.push(f)}s.replaceWith(a)}return 1});let n=new Set;w(r,s=>{if(s.type==="rule")return ye(o=>{o.each(a=>{w(a,u=>{if(u.type==="pseudo"&&u.value===":not")return 1;u.type==="class"&&n.add(u.value)})})}).processSync(s.selector,{updateSelector:!1}),1}),w(i,s=>{s.type==="rule"&&ye(o=>{o.each(a=>{w(a,u=>{if(u.type==="pseudo"&&u.value===":not")return 1;if(u.type==="class"&&n.has(u.value))return s.remove(),2})})}).processSync(s,{updateSelector:!0})});let l=[i];for(let s of n){let o=r.clone();l.push(o),w(o,a=>{if(a.type==="atrule"&&(!a.nodes||a.nodes?.length===0)&&a.remove(),a.type!=="rule")return;let u=!1;if(ye(f=>{f.each(p=>{w(p,c=>{if(c.type==="pseudo"&&c.value===":not")return 1;if(c.type==="class"&&c.value===s){u=!0;let m=p.atPosition(c.source.start.line,c.source.start.column),d=m.parent,g=(m.parent?.index(m)??0)-1;for(;g>=0&&d.at(g)?.type!=="combinator";){let h=d.at(g+1),y=d.at(g);d.at(g+1).replaceWith(y),d.at(g).replaceWith(h),g--}m.replaceWith(ye.nesting())}})})}).processSync(a,{updateSelector:!0}),!u){let f=[a],p=a.parent?.index(a)??null;if(p!==null)for(let c=p-1;c>=0&&a.parent?.nodes.at(c)?.type!=="rule";c--)a.parent?.nodes.at(c)?.type==="comment"&&f.push(a.parent?.nodes.at(c));for(let c of f)c.remove()}return 1}),o.name="utility",o.params=s,o.raws.tailwind_pretty=!0,o.raws.before=`${o.raws.before??""}
|
|
10
14
|
|
|
11
|
-
`}for(let
|
|
15
|
+
`}for(let s=l.length-1;s>=0;s--){let o=l[s];Ee(o,a=>{if(o===i&&a.type==="comment"){let u=!1;for(let f of l)if(f!==i&&(w(f,p=>{if(p.type==="comment"&&p.source?.start?.offset===a.source?.start?.offset)return a.remove(),u=!0,2}),u))return 1}if((a.type==="rule"||a.type==="atrule")&&a.nodes?.length===0)a.remove();else if(a.type==="rule"&&a.selector==="&"){let u=a.parent,f=!1;for(;u;){if(u.type==="rule"){f=!0;break}u=u.parent}f||a.replaceWith(a.nodes)}}),o.nodes?.length===0&&l.splice(s,1)}r.replaceWith(l)}return{postcssPlugin:"@tailwindcss/upgrade/migrate-at-layer-utilities",OnceExit:(r,{atRule:i})=>{let n=e.layers(),l=n.has("utilities")||n.has("components");if(l){let s=i({name:"layer",params:"utilities"});s.append(r.nodes),r.append(s)}r.walkAtRules("layer",t);{let s=new Map;w(r,o=>{if(o.type==="atrule"&&o.name==="utility"){let a=s.get(o.params);a?(a.append(o.nodes),o.remove()):s.set(o.params,o)}})}l&&r.each(s=>{s.type==="atrule"&&s.name==="layer"&&s.params==="utilities"&&s.replaceWith(s.nodes??[])})}}}import Si from"dedent";import $i from"postcss";var Ti="currentColor",Wt=Si,_i=Wt`
|
|
16
|
+
/*
|
|
17
|
+
The default border color has changed to \`currentColor\` in Tailwind CSS v4,
|
|
18
|
+
so we've added these compatibility styles to make sure everything still
|
|
19
|
+
looks the same as it did with Tailwind CSS v3.
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
If we ever want to remove these styles, we need to add an explicit border
|
|
22
|
+
color utility to any element that depends on these defaults.
|
|
23
|
+
*/
|
|
24
|
+
@layer base {
|
|
25
|
+
*,
|
|
26
|
+
::after,
|
|
27
|
+
::before,
|
|
28
|
+
::backdrop,
|
|
29
|
+
::file-selector-button {
|
|
30
|
+
border-color: theme(borderColor.DEFAULT);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`,Vi=Wt`
|
|
34
|
+
/*
|
|
35
|
+
Form elements have a 1px border by default in Tailwind CSS v4, so we've
|
|
36
|
+
added these compatibility styles to make sure everything still looks the
|
|
37
|
+
same as it did with Tailwind CSS v3.
|
|
38
|
+
|
|
39
|
+
If we ever want to remove these styles, we need to add \`border-0\` to
|
|
40
|
+
any form elements that shouldn't have a border.
|
|
41
|
+
*/
|
|
42
|
+
@layer base {
|
|
43
|
+
input:where(:not([type='button'], [type='reset'], [type='submit'])),
|
|
44
|
+
select,
|
|
45
|
+
textarea {
|
|
46
|
+
border-width: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`;function qt({designSystem:e,userConfig:t}){let r=t?.theme?.borderColor?.DEFAULT;function i(l){let s=`--${z(B(l))}`;return!!e.theme.get([s])}function n(l){let s=null;if(l.walkAtRules(u=>{if(u.name==="import")s=u;else if(u.name==="layer"&&u.params==="base")return s=u,!1}),!s)return;let o="";r!==Ti&&(o+=_i,o+=`
|
|
50
|
+
|
|
51
|
+
`),o+=Vi;let a=$i.parse(o);if(a.walkDecls(u=>{u.value.includes("theme(")&&(u.value=Ni(V(u.value),f=>i(f)?r:f==="borderColor.DEFAULT"?"var(--color-gray-200, currentColor)":null))}),l.walkAtRules("theme",u=>{u.walkDecls("--border-color",f=>{f.remove()}),u.nodes?.length===0&&u.remove()}),s.name==="import"){s.after(a);let u=s.next();u&&(u.raws.before=`
|
|
52
|
+
|
|
53
|
+
`)}else{let u=a.last?.raws.before;s.before(a);let f=s.prev();f&&(f.raws.before=u)}}return{postcssPlugin:"@tailwindcss/upgrade/migrate-border-compatibility",OnceExit:n}}function Ni(e,t){return _(e,(r,{replaceWith:i})=>{if(r.kind==="function"&&r.value==="theme"){if(r.nodes.length<1)return;let n=r.nodes[0];if(n.kind!=="word")return;let l=n.value,s=1;for(let u=s;u<r.nodes.length&&!r.nodes[u].value.includes(",");u++)l+=S([r.nodes[u]]),s=u+1;l=Pi(l);let o=r.nodes.slice(s+1),a=o.length>0?t(l,S(o)):t(l);if(a===null)return;i(V(a))}}),S(e)}function Pi(e){if(e[0]!=="'"&&e[0]!=='"')return e;let t="",r=e[0];for(let i=1;i<e.length-1;i++){let n=e[i],l=e[i+1];n==="\\"&&(l===r||l==="\\")?(t+=l,i++):t+=n}return t}import ve from"node:path";import Ei,{AtRule as Gt}from"postcss";function Ri(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var i="";if(r>4&&e[3]==="\\"){var n=e[2];(n==="?"||n===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),i="//")}var l=e.split(/[/\\]+/);return t!==!1&&l[l.length-1]===""&&l.pop(),i+l.join("/")}function Jt(e){let t=Ri(e);return e.startsWith("\\\\")&&t.startsWith("/")&&!t.startsWith("//")?`/${t}`:t}var Yt=new WeakMap;function Qt(e,{configFilePath:t,jsConfigMigration:r}){function i(l){let s=Yt.get(l);if(s&&s.includes(t))return;s?s.push(t):Yt.set(l,[t]);let o=l.root;if(!l.file)return;let a=new Gt;if(r===null){{let f=!1;if(o.walkAtRules("config",()=>(f=!0,!1)),f)return}a.append(new Gt({name:"config",params:`'${ze(l,t)}'`}))}else{let f=`
|
|
54
|
+
|
|
55
|
+
`;for(let p of r.sources){let c=ve.resolve(p.base,p.pattern);f+=`@source '${ze(l,c)}';
|
|
14
56
|
`}r.sources.length>0&&(f=f+`
|
|
15
|
-
`);for(let p of r.plugins){let c=p.path[0]==="."?
|
|
16
|
-
|
|
17
|
-
`),s.append(Ur.parse(f+r.css))}let u=null;v(o,f=>(f.type==="atrule"&&f.name==="import"&&(u=f),1));for(let f of s?.nodes??[])f.raws.tailwind_pretty=!0;u?u.name==="import"&&u.after(s.nodes):o.prepend(s.nodes)}function n(l){let a=!1,o=!1;if(l.walkAtRules("import",s=>{if(s.params.match(/['"]tailwindcss['"]/))return a=!0,o=!0,!1;s.params.match(/['"]tailwindcss\/.*?['"]/)&&(a=!0)}),!!a){if(o||e.parents.size<=0){i(e);return}if(e.parents.size>0)for(let s of e.ancestors())s.parents.size===0&&i(s)}}return{postcssPlugin:"@tailwindcss/upgrade/migrate-config",OnceExit:n}}function Ne(e,t){if(!e.file)throw new Error("Can not find a path for the stylesheet");let r=e.file,i=se.relative(se.dirname(r),t);return i[0]!=="."&&(i=`./${i}`),At(i)}import"postcss";var Nt={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}};function ue(e,t){if(t===null)return e;let r=Number(t);return Number.isNaN(r)?t[t.length-1]!=="%"&&(t=`calc(${t} * 100%)`):t=`${r*100}%`,`color-mix(in srgb, ${e} ${t}, transparent)`}function _e(e){let t=[];for(let r of y(e,".")){if(!r.includes("[")){t.push(r);continue}let i=0;for(;;){let n=r.indexOf("[",i),l=r.indexOf("]",n);if(n===-1||l===-1)break;n>i&&t.push(r.slice(i,n)),t.push(r.slice(n+1,l)),i=l+1}i<=r.length-1&&t.push(r.slice(i))}return t}function L(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function F(e,t,r,i=[]){for(let n of t)if(n!=null)for(let l of Reflect.ownKeys(n)){let a=[...i,l],o=r(e[l],n[l],a);o!==void 0?e[l]=o:!L(e[l])||!L(n[l])?e[l]=n[l]:e[l]=F({},[e[l],n[l]],r,a)}return e}function Ve(e,t,r){return function(n,l){let a=n.lastIndexOf("/"),o=null;a!==-1&&(o=n.slice(a+1).trim(),n=n.slice(0,a).trim());let s=(()=>{let u=_e(n),[f,p]=Wr(e.theme,u),c=r(Vt(t()??{},u)??null);if(typeof f!="object")return typeof p!="object"&&p&4?c??f:f;if(c!==null&&typeof c=="object"&&!Array.isArray(c)){let m=F({},[c],(d,g)=>g);if(f===null&&Object.hasOwn(c,"__CSS_VALUES__")){let d={};for(let g in c.__CSS_VALUES__)d[g]=c[g],delete m[g];f=d}for(let d in f)d!=="__CSS_VALUES__"&&(c?.__CSS_VALUES__?.[d]&4&&Vt(m,d.split("-"))!==void 0||(m[d]=f[d]));return m}if(Array.isArray(f)&&Array.isArray(p)&&Array.isArray(c)){let m=f[0],d=f[1];p[0]&4&&(m=c[0]??m);for(let g of Object.keys(d))p[1][g]&4&&(d[g]=c[1][g]??d[g]);return[m,d]}return f??c})();return o&&typeof s=="string"&&(s=ue(s,o)),s??l}}function Wr(e,t){if(t.length===1&&t[0].startsWith("--"))return[e.get([t[0]]),e.getOptions(t[0])];let r=t.map(f=>f==="1"?"":f).map(f=>f.replaceAll(".","_").replace(/([a-z])([A-Z])/g,(p,c,m)=>`${c}-${m.toLowerCase()}`)).filter((f,p)=>f!=="DEFAULT"||p!==t.length-1).join("-"),i=new Map,n=new S(()=>new Map),l=e.namespace(`--${r}`);if(l.size===0)return[null,0];let a=new Map;for(let[f,p]of l){if(!f||!f.includes("--")){i.set(f,p),a.set(f,e.getOptions(f?`--${r}-${f}`:`--${r}`));continue}let c=f.indexOf("--"),m=f.slice(0,c),d=f.slice(c+2);d=d.replace(/-([a-z])/g,(g,h)=>h.toUpperCase()),n.get(m===""?null:m).set(d,[p,e.getOptions(`--${r}${f}`)])}let o=e.getOptions(`--${r}`);for(let[f,p]of n){let c=i.get(f);if(typeof c!="string")continue;let m={},d={};for(let[g,[h,b]]of p)m[g]=h,d[g]=b;i.set(f,[c,m]),a.set(f,[o,d])}let s={},u={};for(let[f,p]of i)Et(s,[f??"DEFAULT"],p);for(let[f,p]of a)Et(u,[f??"DEFAULT"],p);return t[t.length-1]==="DEFAULT"?[s?.DEFAULT??null,u.DEFAULT??0]:"DEFAULT"in s&&Object.keys(s).length===1?[s.DEFAULT,u.DEFAULT??0]:(s.__CSS_VALUES__=u,[s,u])}function Vt(e,t){for(let r=0;r<t.length;++r){let i=t[r];if(e[i]===void 0){if(t[r+1]===void 0)return;t[r+1]=`${i}-${t[r+1]}`;continue}e=e[i]}return e}function Et(e,t,r){for(let i of t.slice(0,-1))e[i]===void 0&&(e[i]={}),e=e[i];e[t[t.length-1]]=r}var Jr={blocklist:[],prefix:"",important:!1,darkMode:null,theme:{},plugins:[],content:{files:[]}};function fe(e,t){let r={design:e,configs:[],plugins:[],content:{files:[]},theme:{},extend:{},result:structuredClone(Jr)};for(let i of t)Ee(r,i);for(let i of r.configs)"darkMode"in i&&i.darkMode!==void 0&&(r.result.darkMode=i.darkMode??null),"prefix"in i&&i.prefix!==void 0&&(r.result.prefix=i.prefix??""),"blocklist"in i&&i.blocklist!==void 0&&(r.result.blocklist=i.blocklist??[]),"important"in i&&i.important!==void 0&&(r.result.important=i.important??!1);return qr(r),{...r.result,content:r.content,theme:r.theme,plugins:r.plugins}}function Ke(e,t){if(Array.isArray(e)&&L(e[0]))return e.concat(t);if(Array.isArray(t)&&L(t[0])&&L(e))return[e,...t];if(Array.isArray(t))return t}function Ee(e,{config:t,base:r,path:i}){let n=[];for(let o of t.plugins??[])"__isOptionsFunction"in o?n.push(o()):"handler"in o?n.push(o):n.push({handler:o});if(Array.isArray(t.presets)&&t.presets.length===0)throw new Error("Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.");for(let o of t.presets??[])Ee(e,{path:i,base:r,config:o});for(let o of n)e.plugins.push(o),o.config&&Ee(e,{path:i,base:r,config:o.config});let l=t.content??[],a=Array.isArray(l)?l:l.files;for(let o of a)e.content.files.push(typeof o=="object"?o:{base:r,pattern:o});e.configs.push(t)}function qr(e){let t=Ve(e.design,()=>e.theme,i),r=Object.assign(t,{theme:t,colors:Nt});function i(n){return typeof n=="function"?n(r)??null:n??null}for(let n of e.configs){let l=n.theme??{},a=l.extend??{};Object.assign(e.theme,l);for(let o in a)e.extend[o]??=[],e.extend[o].push(a[o])}delete e.theme.extend;for(let n in e.extend){let l=[e.theme[n],...e.extend[n]];e.theme[n]=()=>{let a=l.map(i);return F({},a,Ke)}}for(let n in e.theme)e.theme[n]=i(e.theme[n]);if(e.theme.screens&&typeof e.theme.screens=="object")for(let n of Object.keys(e.theme.screens)){let l=e.theme.screens[n];l&&typeof l=="object"&&("raw"in l||"max"in l||"min"in l&&(e.theme.screens[n]=l.min))}}function Kt(e){return(Array.isArray(e)?e:[e]).map(r=>typeof r=="string"?{min:r}:r&&typeof r=="object"?r:null).map(r=>{if(r===null)return null;if("raw"in r)return r.raw;let i="";return r.max!==void 0&&(i+=`${r.max} >= `),i+="width",r.min!==void 0&&(i+=` >= ${r.min}`),`(${i})`}).filter(Boolean).join(", ")}function Rt({designSystem:e,userConfig:t}={}){function r(i){if(!e||!t)return;let l=fe(e,[{base:"",config:t}])?.theme?.screens||{},a=new S(o=>{let s=e?.resolveThemeValue(`--breakpoint-${o}`)??l?.[o];return typeof s=="string"?`(width >= theme(--breakpoint-${o}))`:s?Kt(s):null});i.walkAtRules(o=>{if(o.name!=="media")return;let s=o.params.match(/screen\(([^)]+)\)/);if(!s)return;let u=a.get(s[1]);u&&(o.params=u)})}return{postcssPlugin:"@tailwindcss/upgrade/migrate-media-screen",OnceExit:r}}import{AtRule as Gr}from"postcss";function Pt(){function e(t){let r="",i=[],n=[],l=null;t.each(a=>{if(a.type==="atrule"){if(a.name==="config"||a.name==="source"||a.name==="theme"||a.name==="utility"||a.name==="variant"){i.length>0&&n.push([r,i.splice(0)]);return}if(a.name==="tailwind"&&a.params==="base"||a.name==="import"&&a.params.match(/^["']tailwindcss\/base["']/)){i.length>0&&n.push([r,i.splice(0)]),l??="base",r="base";return}if(a.name==="tailwind"&&a.params==="components"||a.name==="import"&&a.params.match(/^["']tailwindcss\/components["']/)){i.length>0&&n.push([r,i.splice(0)]),l??="components",r="components";return}if(a.name==="tailwind"&&a.params==="utilities"||a.name==="import"&&a.params.match(/^["']tailwindcss\/utilities["']/)){i.length>0&&n.push([r,i.splice(0)]),l??="utilities",r="utilities";return}if(a.name==="layer"){i.length>0&&n.push([r,i.splice(0)]);return}if(a.name==="import"){r!==""&&!a.params.includes("layer(")&&(a.params+=` layer(${r})`,a.raws.tailwind_injected_layer=!0),i.length>0&&n.push([r,i.splice(0)]);return}}r===""&&(a.type==="comment"||a.type==="atrule"&&!a.nodes||a.type==="atrule"&&a.name==="charset")||i.push(a)});for(let[a,o]of n){let s=a||l||"";if(s===""||o.every(p=>p.type==="comment"))continue;let u=o[0],f=new Gr({name:"layer",params:s,nodes:o.map(p=>p===u?p:p.remove()),raws:{tailwind_pretty:!0}});u.replaceWith(f)}}return{postcssPlugin:"@tailwindcss/upgrade/migrate-missing-layers",OnceExit:e}}import{AtRule as ce}from"postcss";var Re=["theme","base","components","utilities"];function Ot(e){let t=e.newPrefix?` prefix(${e.newPrefix})`:"";function r(i){let n=null,l=null,a=[],o=null,s=null,u=null,f=null,p=[];i.walkAtRules(c=>{c.name==="import"&&c.params.match(/^["']tailwindcss\/tailwind\.css["']$/)&&(c.params=c.params.replace("tailwindcss/tailwind.css","tailwindcss")),c.name==="import"&&c.params.match(/^["']tailwindcss["']/)?c.params+=t:c.name==="tailwind"&&c.params==="base"||c.name==="import"&&c.params.match(/^["']tailwindcss\/base["']$/)?(p.push("base"),a.push(c),n=c):c.name==="tailwind"&&c.params==="utilities"||c.name==="import"&&c.params.match(/^["']tailwindcss\/utilities["']$/)?(p.push("utilities"),a.push(c),l=c):(c.name==="tailwind"&&c.params==="components"||c.name==="tailwind"&&c.params==="screens"||c.name==="tailwind"&&c.params==="variants"||c.name==="import"&&c.params.match(/^["']tailwindcss\/components["']$/))&&c.remove()}),n!==null&&l!==null?(o||pe(a).before(new ce({name:"import",params:`'tailwindcss'${t}`})),n?.remove(),l?.remove()):l!==null?(s||pe(a).before(new ce({name:"import",params:"'tailwindcss/utilities' layer(utilities)"})),l?.remove()):n!==null&&(f||pe(a).before(new ce({name:"import",params:`'tailwindcss/theme' layer(theme)${t}`})),u||pe(a).before(new ce({name:"import",params:"'tailwindcss/preflight' layer(base)"})),n?.remove());{let c=p.toSorted((m,d)=>Re.indexOf(m)-Re.indexOf(d));if(p.some((m,d)=>m!==c[d])){let m=Re.toSorted((d,g)=>p.indexOf(d)-p.indexOf(g));i.prepend({name:"layer",params:m.join(", ")})}}}return{postcssPlugin:"@tailwindcss/upgrade/migrate-tailwind-directives",OnceExit:r}}function pe(e){let t=e.at(0),r=t.prev();for(;r;){if(r.type==="rule"&&(t=r),r.type==="atrule")if(r.name==="charset"||r.name==="import"){r=r.prev();continue}else if(r.name==="layer"&&!r.nodes){r=r.prev();continue}else t=r;r=r.prev()}return t}async function Hr(e,t,r){return typeof e=="string"&&(e=await I.fromString(e),e.file=r??null),Pe().use(bt(t)).use(Rt(t)).use(Ct(e)).use(Pt()).use(Ot(t)).use(Tt(e,t)).process(e.root,{from:e.file??void 0})}async function Dt(e,t){if(!e.file)throw new Error("Cannot migrate a stylesheet without a file path");e.canMigrate&&await Hr(e,t)}async function jt(e){let t=new Map;for(let o of e)o.file&&t.set(o.file,o);let r=Pe([{postcssPlugin:"mark-import-nodes",AtRule:{import(o){let s=o.params.match(/['"](.*)['"]/)?.[1];if(!s)return;let u=o.source?.input.file?Yr.dirname(o.source.input.file):process.cwd(),f;try{f=qe(s,u)}catch(d){console.warn(`Failed to resolve import: ${s}. Skipping.`),console.error(d);return}if(!f)return;let p=t.get(f);if(!p)return;o.raws.tailwind_destination_sheet_id=p.id;let c=o.source?.input.file?t.get(o.source.input.file):void 0,m=[];for(let d of y(o.params," "))d.startsWith("layer(")&&d.endsWith(")")&&m.push(d.slice(6,-1).trim());if(c){let d={layers:m};p.parents.add({item:c,meta:d}),c.children.add({item:p,meta:d})}}}}]);for(let o of e)o.file&&await r.process(o.root,{from:o.file});let i=process.cwd();function n(o){let s=[];for(let u of o){if(!u.item.file)continue;let f=u.item.file.replace(i,""),p=u.meta.layers.join(", ");p.length>0?s.push(`${f} (layers: ${p})`):s.push(f)}return s.join(" <- ")}let l=[];for(let o of e){if(!o.file)continue;let{convertablePaths:s,nonConvertablePaths:u}=o.analyzeImportPaths();if(!(s.length>0&&u.length>0))continue;o.canMigrate=!1;let p=o.file.replace(i,"");for(let c of s)l.push(`- ${p} <- ${n(c)}`);for(let c of u)l.push(`- ${p} <- ${n(c)}`)}if(l.length===0)return;let a=`You have one or more stylesheets that are imported into a utility layer and non-utility layer.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`))}async function It(e){let t=new Map,r=new Map;for(let o of e)t.set(o.id,o),o.file&&r.set(o.file,o);let i=new Set;for(let o of e){let s=o.layers();(s.has("utilities")||s.has("components"))&&v(o.root,f=>{if(f.type==="atrule"&&f.name==="utility")return i.add(o),2})}let n=new Map;for(let o of e){if(!o.file||o.parents.size===0||!i.has(o)&&!Array.from(o.descendants()).some(c=>i.has(c)))continue;let s=Pe.root({raws:{tailwind_pretty:!0}});v(o.root,c=>{if(c.type==="atrule"&&c.name==="utility")return s.append(c),1});let u=o.file.replace(/\.css$/,".utilities.css"),f=0;for(;r.has(u);)f+=1,u=o.file.replace(/\.css$/,`.utilities.${f}.css`);let p=await I.fromRoot(s,u);p.extension=f>0?`.utilities.${f}.css`:".utilities.css",n.set(o,p),t.set(p.id,p)}for(let[o,s]of n){for(let u of o.parents){let f=n.get(u.item);f&&s.parents.add({item:f,meta:u.meta})}for(let u of o.children){let f=n.get(u.item);f&&s.children.add({item:f,meta:u.meta})}}for(let o of e){let s=n.get(o),u=new Set;for(let f of o.importRules){let p=f.raws.tailwind_destination_sheet_id;if(!p)continue;let c=t.get(p);if(!c)continue;let m=n.get(c);if(!m)continue;let d=f.params.match(/(['"])(.*)\1/);if(!d)return;let g=d[1],h=d[2],b=h.replace(/\.css$/,m.extension),A=f.clone({params:`${g}${b}${g}`,raws:{after:`
|
|
57
|
+
`);for(let p of r.plugins){let c=p.path[0]==="."?ze(l,ve.resolve(p.base,p.path)):p.path;if(p.options===null)f+=`@plugin '${c}';
|
|
58
|
+
`;else{f+=`@plugin '${c}' {
|
|
59
|
+
`;for(let[m,d]of Object.entries(p.options)){let g="";typeof d=="string"?g=Ht(d):Array.isArray(d)?g=d.map(h=>typeof h=="string"?Ht(h):""+h).join(", "):g=""+d,f+=` ${m}: ${g};
|
|
60
|
+
`}f+=`}
|
|
61
|
+
`}}r.plugins.length>0&&(f=f+`
|
|
62
|
+
`),a.append(Ei.parse(f+r.css))}let u=null;w(o,f=>(f.type==="atrule"&&f.name==="import"&&(u=f),1));for(let f of a?.nodes??[])f.raws.tailwind_pretty=!0;u?u.name==="import"&&u.after(a.nodes):o.prepend(a.nodes)}function n(l){let s=!1,o=!1;if(l.walkAtRules("import",a=>{if(a.params.match(/['"]tailwindcss['"]/))return s=!0,o=!0,!1;a.params.match(/['"]tailwindcss\/.*?['"]/)&&(s=!0)}),!!s){if(o||e.parents.size<=0){i(e);return}if(e.parents.size>0)for(let a of e.ancestors())a.parents.size===0&&i(a)}}return{postcssPlugin:"@tailwindcss/upgrade/migrate-config",OnceExit:n}}function ze(e,t){if(!e.file)throw new Error("Can not find a path for the stylesheet");let r=e.file,i=ve.relative(ve.dirname(r),t);return i[0]!=="."&&(i=`./${i}`),Jt(i)}function Ht(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}import"postcss";var Zt={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(0.984 0.003 247.858)",100:"oklch(0.968 0.007 247.896)",200:"oklch(0.929 0.013 255.508)",300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",800:"oklch(0.279 0.041 260.031)",900:"oklch(0.208 0.042 265.755)",950:"oklch(0.129 0.042 264.695)"},gray:{50:"oklch(0.985 0.002 247.839)",100:"oklch(0.967 0.003 264.542)",200:"oklch(0.928 0.006 264.531)",300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",800:"oklch(0.278 0.033 256.848)",900:"oklch(0.21 0.034 264.665)",950:"oklch(0.13 0.028 261.692)"},zinc:{50:"oklch(0.985 0 0)",100:"oklch(0.967 0.001 286.375)",200:"oklch(0.92 0.004 286.32)",300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",800:"oklch(0.274 0.006 286.033)",900:"oklch(0.21 0.006 285.885)",950:"oklch(0.141 0.005 285.823)"},neutral:{50:"oklch(0.985 0 0)",100:"oklch(0.97 0 0)",200:"oklch(0.922 0 0)",300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",800:"oklch(0.269 0 0)",900:"oklch(0.205 0 0)",950:"oklch(0.145 0 0)"},stone:{50:"oklch(0.985 0.001 106.423)",100:"oklch(0.97 0.001 106.424)",200:"oklch(0.923 0.003 48.717)",300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",800:"oklch(0.268 0.007 34.298)",900:"oklch(0.216 0.006 56.043)",950:"oklch(0.147 0.004 49.25)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},amber:{50:"oklch(0.987 0.022 95.277)",100:"oklch(0.962 0.059 95.617)",200:"oklch(0.924 0.12 95.746)",300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",800:"oklch(0.473 0.137 46.201)",900:"oklch(0.414 0.112 45.904)",950:"oklch(0.279 0.077 45.635)"},yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"},lime:{50:"oklch(0.986 0.031 120.757)",100:"oklch(0.967 0.067 122.328)",200:"oklch(0.938 0.127 124.321)",300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",800:"oklch(0.453 0.124 130.933)",900:"oklch(0.405 0.101 131.063)",950:"oklch(0.274 0.072 132.109)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},emerald:{50:"oklch(0.979 0.021 166.113)",100:"oklch(0.95 0.052 163.051)",200:"oklch(0.905 0.093 164.15)",300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)",800:"oklch(0.432 0.095 166.913)",900:"oklch(0.378 0.077 168.94)",950:"oklch(0.262 0.051 172.552)"},teal:{50:"oklch(0.984 0.014 180.72)",100:"oklch(0.953 0.051 180.801)",200:"oklch(0.91 0.096 180.426)",300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)",800:"oklch(0.437 0.078 188.216)",900:"oklch(0.386 0.063 188.416)",950:"oklch(0.277 0.046 192.524)"},cyan:{50:"oklch(0.984 0.019 200.873)",100:"oklch(0.956 0.045 203.388)",200:"oklch(0.917 0.08 205.041)",300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)",800:"oklch(0.45 0.085 224.283)",900:"oklch(0.398 0.07 227.392)",950:"oklch(0.302 0.056 229.695)"},sky:{50:"oklch(0.977 0.013 236.62)",100:"oklch(0.951 0.026 236.824)",200:"oklch(0.901 0.058 230.902)",300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)",800:"oklch(0.443 0.11 240.79)",900:"oklch(0.391 0.09 240.876)",950:"oklch(0.293 0.066 243.157)"},blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},indigo:{50:"oklch(0.962 0.018 272.314)",100:"oklch(0.93 0.034 272.788)",200:"oklch(0.87 0.065 274.039)",300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)",800:"oklch(0.398 0.195 277.366)",900:"oklch(0.359 0.144 278.697)",950:"oklch(0.257 0.09 281.288)"},violet:{50:"oklch(0.969 0.016 293.756)",100:"oklch(0.943 0.029 294.588)",200:"oklch(0.894 0.057 293.283)",300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)",800:"oklch(0.432 0.232 292.759)",900:"oklch(0.38 0.189 293.745)",950:"oklch(0.283 0.141 291.089)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},fuchsia:{50:"oklch(0.977 0.017 320.058)",100:"oklch(0.952 0.037 318.852)",200:"oklch(0.903 0.076 319.62)",300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)",800:"oklch(0.452 0.211 324.591)",900:"oklch(0.401 0.17 325.612)",950:"oklch(0.293 0.136 325.661)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},rose:{50:"oklch(0.969 0.015 12.422)",100:"oklch(0.941 0.03 12.58)",200:"oklch(0.892 0.058 10.001)",300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)",800:"oklch(0.455 0.188 13.697)",900:"oklch(0.41 0.159 10.272)",950:"oklch(0.271 0.105 12.094)"}};function we(e,t){if(t===null)return e;let r=Number(t);return Number.isNaN(r)?t[t.length-1]!=="%"&&(t=`calc(${t} * 100%)`):t=`${r*100}%`,`color-mix(in oklch, ${e} ${t}, transparent)`}function q(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function X(e,t,r,i=[]){for(let n of t)if(n!=null)for(let l of Reflect.ownKeys(n)){let s=[...i,l],o=r(e[l],n[l],s);o!==void 0?e[l]=o:!q(e[l])||!q(n[l])?e[l]=n[l]:e[l]=X({},[e[l],n[l]],r,s)}return e}function Be(e,t,r){return function(n,l){let s=n.lastIndexOf("/"),o=null;s!==-1&&(o=n.slice(s+1).trim(),n=n.slice(0,s).trim());let a=(()=>{let u=B(n),[f,p]=Di(e.theme,u),c=r(Xt(t()??{},u)??null);if(typeof f!="object")return typeof p!="object"&&p&4?c??f:f;if(c!==null&&typeof c=="object"&&!Array.isArray(c)){let m=X({},[c],(d,g)=>g);if(f===null&&Object.hasOwn(c,"__CSS_VALUES__")){let d={};for(let g in c.__CSS_VALUES__)d[g]=c[g],delete m[g];f=d}for(let d in f)d!=="__CSS_VALUES__"&&(c?.__CSS_VALUES__?.[d]&4&&Xt(m,d.split("-"))!==void 0||(m[Rt(d)]=f[d]));return m}if(Array.isArray(f)&&Array.isArray(p)&&Array.isArray(c)){let m=f[0],d=f[1];p[0]&4&&(m=c[0]??m);for(let g of Object.keys(d))p[1][g]&4&&(d[g]=c[1][g]??d[g]);return[m,d]}return f??c})();return o&&typeof a=="string"&&(a=we(a,o)),a??l}}function Di(e,t){if(t.length===1&&t[0].startsWith("--"))return[e.get([t[0]]),e.getOptions(t[0])];let r=t.map(f=>f==="1"?"":f).map(f=>f.replaceAll(".","_").replace(/([a-z])([A-Z])/g,(p,c,m)=>`${c}-${m.toLowerCase()}`)).filter((f,p)=>f!=="DEFAULT"||p!==t.length-1).join("-"),i=new Map,n=new T(()=>new Map),l=e.namespace(`--${r}`);if(l.size===0)return[null,0];let s=new Map;for(let[f,p]of l){if(!f||!f.includes("--")){i.set(f,p),s.set(f,e.getOptions(f?`--${r}-${f}`:`--${r}`));continue}let c=f.indexOf("--"),m=f.slice(0,c),d=f.slice(c+2);d=d.replace(/-([a-z])/g,(g,h)=>h.toUpperCase()),n.get(m===""?null:m).set(d,[p,e.getOptions(`--${r}${f}`)])}let o=e.getOptions(`--${r}`);for(let[f,p]of n){let c=i.get(f);if(typeof c!="string")continue;let m={},d={};for(let[g,[h,y]]of p)m[g]=h,d[g]=y;i.set(f,[c,m]),s.set(f,[o,d])}let a={},u={};for(let[f,p]of i)er(a,[f??"DEFAULT"],p);for(let[f,p]of s)er(u,[f??"DEFAULT"],p);return t[t.length-1]==="DEFAULT"?[a?.DEFAULT??null,u.DEFAULT??0]:"DEFAULT"in a&&Object.keys(a).length===1?[a.DEFAULT,u.DEFAULT??0]:(a.__CSS_VALUES__=u,[a,u])}function Xt(e,t){for(let r=0;r<t.length;++r){let i=t[r];if(e[i]===void 0){if(t[r+1]===void 0)return;t[r+1]=`${i}-${t[r+1]}`;continue}e=e[i]}return e}function er(e,t,r){for(let i of t.slice(0,-1))e[i]===void 0&&(e[i]={}),e=e[i];e[t[t.length-1]]=r}var ji={blocklist:[],prefix:"",important:!1,darkMode:null,theme:{},plugins:[],content:{files:[]}};function J(e,t){let r={design:e,configs:[],plugins:[],content:{files:[]},theme:{},extend:{},result:structuredClone(ji)};for(let n of t)We(r,n);for(let n of r.configs)"darkMode"in n&&n.darkMode!==void 0&&(r.result.darkMode=n.darkMode??null),"prefix"in n&&n.prefix!==void 0&&(r.result.prefix=n.prefix??""),"blocklist"in n&&n.blocklist!==void 0&&(r.result.blocklist=n.blocklist??[]),"important"in n&&n.important!==void 0&&(r.result.important=n.important??!1);let i=Fi(r);return{resolvedConfig:{...r.result,content:r.content,theme:r.theme,plugins:r.plugins},replacedThemeKeys:i}}function Ii(e,t){if(Array.isArray(e)&&q(e[0]))return e.concat(t);if(Array.isArray(t)&&q(t[0])&&q(e))return[e,...t];if(Array.isArray(t))return t}function We(e,{config:t,base:r,path:i}){let n=[];for(let o of t.plugins??[])"__isOptionsFunction"in o?n.push(o()):"handler"in o?n.push(o):n.push({handler:o});if(Array.isArray(t.presets)&&t.presets.length===0)throw new Error("Error in the config file/plugin/preset. An empty preset (`preset: []`) is not currently supported.");for(let o of t.presets??[])We(e,{path:i,base:r,config:o});for(let o of n)e.plugins.push(o),o.config&&We(e,{path:i,base:r,config:o.config});let l=t.content??[],s=Array.isArray(l)?l:l.files;for(let o of s)e.content.files.push(typeof o=="object"?o:{base:r,pattern:o});e.configs.push(t)}function Fi(e){let t=new Set,r=Be(e.design,()=>e.theme,n),i=Object.assign(r,{theme:r,colors:Zt});function n(l){return typeof l=="function"?l(i)??null:l??null}for(let l of e.configs){let s=l.theme??{},o=s.extend??{};for(let a in s)a!=="extend"&&t.add(a);Object.assign(e.theme,s);for(let a in o)e.extend[a]??=[],e.extend[a].push(o[a])}delete e.theme.extend;for(let l in e.extend){let s=[e.theme[l],...e.extend[l]];e.theme[l]=()=>{let o=s.map(n);return X({},o,Ii)}}for(let l in e.theme)e.theme[l]=n(e.theme[l]);if(e.theme.screens&&typeof e.theme.screens=="object")for(let l of Object.keys(e.theme.screens)){let s=e.theme.screens[l];s&&typeof s=="object"&&("raw"in s||"max"in s||"min"in s&&(e.theme.screens[l]=s.min))}return t}function tr(e){return(Array.isArray(e)?e:[e]).map(r=>typeof r=="string"?{min:r}:r&&typeof r=="object"?r:null).map(r=>{if(r===null)return null;if("raw"in r)return r.raw;let i="";return r.max!==void 0&&(i+=`${r.max} >= `),i+="width",r.min!==void 0&&(i+=` >= ${r.min}`),`(${i})`}).filter(Boolean).join(", ")}function rr({designSystem:e,userConfig:t}={}){function r(i){if(!e||!t)return;let{resolvedConfig:n}=J(e,[{base:"",config:t}]),l=n?.theme?.screens||{},s=new T(o=>{let a=e?.resolveThemeValue(`--breakpoint-${o}`)??l?.[o];return typeof a=="string"?`(width >= theme(--breakpoint-${o}))`:a?tr(a):null});i.walkAtRules("screen",o=>{o.name="media",o.params=`screen(${o.params})`}),i.walkAtRules(o=>{if(o.name!=="media")return;let a=o.params.match(/screen\(([^)]+)\)/);if(!a)return;let u=s.get(a[1]);u&&(o.params=u)})}return{postcssPlugin:"@tailwindcss/upgrade/migrate-media-screen",OnceExit:r}}import{AtRule as Mi}from"postcss";function ir(){function e(t){let r="",i=[],n=[],l=null;t.each(s=>{if(s.type==="atrule"){if(s.name==="config"||s.name==="source"||s.name==="theme"||s.name==="utility"||s.name==="variant"){i.length>0&&n.push([r,i.splice(0)]);return}if(s.name==="tailwind"&&s.params==="base"||s.name==="import"&&s.params.match(/^["']tailwindcss\/base["']/)){i.length>0&&n.push([r,i.splice(0)]),l??="base",r="base";return}if(s.name==="tailwind"&&s.params==="components"||s.name==="import"&&s.params.match(/^["']tailwindcss\/components["']/)){i.length>0&&n.push([r,i.splice(0)]),l??="components",r="components";return}if(s.name==="tailwind"&&s.params==="utilities"||s.name==="import"&&s.params.match(/^["']tailwindcss\/utilities["']/)){i.length>0&&n.push([r,i.splice(0)]),l??="utilities",r="utilities";return}if(s.name==="layer"){i.length>0&&n.push([r,i.splice(0)]);return}if(s.name==="import"){r!==""&&!s.params.includes("layer(")&&(s.params+=` layer(${r})`,s.raws.tailwind_injected_layer=!0),i.length>0&&n.push([r,i.splice(0)]);return}}r===""&&(s.type==="comment"||s.type==="atrule"&&!s.nodes||s.type==="atrule"&&s.name==="charset")||i.push(s)});for(let[s,o]of n){let a=s||l||"";if(a===""||o.every(p=>p.type==="comment"))continue;let u=o[0],f=new Mi({name:"layer",params:a,nodes:o.map(p=>p===u?p:p.remove()),raws:{tailwind_pretty:!0}});u.replaceWith(f)}}return{postcssPlugin:"@tailwindcss/upgrade/migrate-missing-layers",OnceExit:e}}import{AtRule as be}from"postcss";var qe=["theme","base","components","utilities"];function nr(e){let t=e.newPrefix?` prefix(${e.newPrefix})`:"";function r(i){let n=null,l=null,s=[],o=null,a=null,u=null,f=null,p=[];i.walkAtRules(c=>{if(c.name==="import"&&c.params.match(/^["']tailwindcss\/tailwind\.css["']$/)&&(c.params=c.params.replace("tailwindcss/tailwind.css","tailwindcss")),c.name==="import"&&c.params.match(/^["']tailwindcss["']/))c.params+=t;else if(c.name==="tailwind"&&c.params==="base"||c.name==="import"&&c.params.match(/^["']tailwindcss\/base["']$/))p.push("base"),s.push(c),n=c;else if(c.name==="tailwind"&&c.params==="utilities"||c.name==="import"&&c.params.match(/^["']tailwindcss\/utilities["']$/))p.push("utilities"),s.push(c),l=c;else if(c.name==="tailwind"&&c.params==="components"||c.name==="tailwind"&&c.params==="screens"||c.name==="tailwind"&&c.params==="variants"||c.name==="import"&&c.params.match(/^["']tailwindcss\/components["']$/))c.remove();else if(c.name==="responsive")if(c.nodes){for(let m of c.nodes)m.raws.tailwind_pretty=!0;c.replaceWith(c.nodes)}else c.remove()}),n!==null&&l!==null?(o||ke(s).before(new be({name:"import",params:`'tailwindcss'${t}`})),n?.remove(),l?.remove()):l!==null?(a||ke(s).before(new be({name:"import",params:"'tailwindcss/utilities' layer(utilities)"})),l?.remove()):n!==null&&(f||ke(s).before(new be({name:"import",params:`'tailwindcss/theme' layer(theme)${t}`})),u||ke(s).before(new be({name:"import",params:"'tailwindcss/preflight' layer(base)"})),n?.remove());{let c=p.toSorted((m,d)=>qe.indexOf(m)-qe.indexOf(d));if(p.some((m,d)=>m!==c[d])){let m=qe.toSorted((d,g)=>p.indexOf(d)-p.indexOf(g));i.prepend({name:"layer",params:m.join(", ")})}}}return{postcssPlugin:"@tailwindcss/upgrade/migrate-tailwind-directives",OnceExit:r}}function ke(e){let t=e.at(0),r=t.prev();for(;r;){if(r.type==="rule"&&(t=r),r.type==="atrule")if(r.name==="charset"||r.name==="import"){r=r.prev();continue}else if(r.name==="layer"&&!r.nodes){r=r.prev();continue}else t=r;r=r.prev()}return t}import"postcss";function or({designSystem:e}={}){return{postcssPlugin:"@tailwindcss/upgrade/migrate-theme-to-var",OnceExit(t){if(!e)return;let r=Fe(e,{prettyPrint:!0});t.walkDecls(i=>{let[n]=r(i.value);i.value=n}),t.walkAtRules(i=>{if(i.name==="media"||i.name==="custom-media"||i.name==="container"||i.name==="supports"){let[n]=r(i.params,2);i.params=n}})}}}import"postcss";function lr(){function e(t){t.walkAtRules("variants",r=>{r.name==="variants"&&(r.name="layer",r.params="utilities")})}return{postcssPlugin:"@tailwindcss/upgrade/migrate-variants-directive",OnceExit:e}}async function Ui(e,t,r){return typeof e=="string"&&(e=await W.fromString(e),e.file=r??null),Je().use(Lt(t)).use(rr(t)).use(lr()).use(Bt(e)).use(ir()).use(nr(t)).use(Qt(e,t)).use(qt(t)).use(or(t)).process(e.root,{from:e.file??void 0})}async function sr(e,t){if(!e.file)throw new Error("Cannot migrate a stylesheet without a file path");e.canMigrate&&await Ui(e,t)}async function ar(e){let t=new Map;for(let o of e)o.file&&t.set(o.file,o);let r=Je([{postcssPlugin:"mark-import-nodes",AtRule:{import(o){let a=o.params.match(/['"](.*)['"]/)?.[1];if(!a)return;let u=o.source?.input.file?Li.dirname(o.source.input.file):process.cwd(),f;try{f=it(a,u)}catch(d){console.warn(`Failed to resolve import: ${a}. Skipping.`),console.error(d);return}if(!f)return;let p=t.get(f);if(!p)return;o.raws.tailwind_destination_sheet_id=p.id;let c=o.source?.input.file?t.get(o.source.input.file):void 0,m=[];for(let d of v(o.params," "))d.startsWith("layer(")&&d.endsWith(")")&&m.push(d.slice(6,-1).trim());if(c){let d={layers:m};p.parents.add({item:c,meta:d}),c.children.add({item:p,meta:d})}}}}]);for(let o of e)o.file&&await r.process(o.root,{from:o.file});let i=process.cwd();function n(o){let a=[];for(let u of o){if(!u.item.file)continue;let f=u.item.file.replace(i,""),p=u.meta.layers.join(", ");p.length>0?a.push(`${f} (layers: ${p})`):a.push(f)}return a.join(" <- ")}let l=[];for(let o of e){if(!o.file)continue;let{convertiblePaths:a,nonConvertiblePaths:u}=o.analyzeImportPaths();if(!(a.length>0&&u.length>0))continue;o.canMigrate=!1;let p=o.file.replace(i,"");for(let c of a)l.push(`- ${p} <- ${n(c)}`);for(let c of u)l.push(`- ${p} <- ${n(c)}`)}if(l.length===0)return;let s=`You have one or more stylesheets that are imported into a utility layer and non-utility layer.
|
|
63
|
+
`;throw s+=`We cannot convert stylesheets under these conditions. Please look at the following stylesheets:
|
|
64
|
+
`,new Error(s+l.join(`
|
|
65
|
+
`))}async function ur(e){let t=new Map,r=new Map;for(let o of e)t.set(o.id,o),o.file&&r.set(o.file,o);let i=new Set;for(let o of e){let a=o.layers();(a.has("utilities")||a.has("components"))&&w(o.root,f=>{if(f.type==="atrule"&&f.name==="utility")return i.add(o),2})}let n=new Map;for(let o of e){if(!o.file||o.parents.size===0||!i.has(o)&&!Array.from(o.descendants()).some(c=>i.has(c)))continue;let a=Je.root({raws:{tailwind_pretty:!0}});w(o.root,c=>{if(c.type==="atrule"&&c.name==="utility")return a.append(c),1});let u=o.file.replace(/\.css$/,".utilities.css"),f=0;for(;r.has(u);)f+=1,u=o.file.replace(/\.css$/,`.utilities.${f}.css`);let p=await W.fromRoot(a,u);p.extension=f>0?`.utilities.${f}.css`:".utilities.css",n.set(o,p),t.set(p.id,p)}for(let[o,a]of n){for(let u of o.parents){let f=n.get(u.item);f&&a.parents.add({item:f,meta:u.meta})}for(let u of o.children){let f=n.get(u.item);f&&a.children.add({item:f,meta:u.meta})}}for(let o of e){let a=n.get(o),u=new Set;for(let f of o.importRules){let p=f.raws.tailwind_destination_sheet_id;if(!p)continue;let c=t.get(p);if(!c)continue;let m=n.get(c);if(!m)continue;let d=f.params.match(/(['"])(.*)\1/);if(!d)return;let g=d[1],h=d[2],y=h.replace(/\.css$/,m.extension),k=f.clone({params:`${g}${y}${g}`,raws:{after:`
|
|
21
66
|
|
|
22
|
-
`,tailwind_original_params:`${g}${h}${g}`,tailwind_destination_sheet_id:m.id}});
|
|
67
|
+
`,tailwind_injected_layer:f.raws.tailwind_injected_layer,tailwind_original_params:`${g}${h}${g}`,tailwind_destination_sheet_id:m.id}});a?u.add(k):f.after(k)}a&&u.size>0&&a.root.prepend(Array.from(u))}let l=new T(()=>new Set);for(let o of t.values())for(let a of o.importRules){let u=a.raws.tailwind_destination_sheet_id;if(!u)continue;let f=t.get(u);f&&l.get(f).add(a)}let s=[];for(let o of e.slice()){for(let a of o.descendants())s.push(a);s.push(o)}for(let o of s){let a=n.get(o);if(a&&o.isEmpty){o.root=a.root;for(let u of l.get(a))u.params=u.raws.tailwind_original_params;for(let u of l.get(o))u.remove();n.delete(o)}}e.push(...n.values())}import{Scanner as Cr}from"@tailwindcss/oxide";import nn from"node:fs/promises";import{dirname as on}from"path";import"tailwindcss";import ln from"tailwindcss/defaultTheme";import{fileURLToPath as sn}from"url";import xe from"enhanced-resolve";import{createJiti as Gi}from"jiti";import yr from"node:fs";import ma from"node:fs/promises";import ha,{dirname as pr}from"node:path";import{pathToFileURL as dr}from"node:url";import{__unstable__loadDesignSystem as wa,compile as ba}from"tailwindcss";import Ge from"node:fs/promises";import ee from"node:path";var zi=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],Bi=[".js",".cjs",".mjs"],Wi=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],qi=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Ji(e,t){for(let r of t){let i=`${e}${r}`;if((await Ge.stat(i).catch(()=>null))?.isFile())return i}for(let r of t){let i=`${e}/index${r}`;if(await Ge.access(i).then(()=>!0,()=>!1))return i}return null}async function fr(e,t,r,i){let n=Bi.includes(i)?Wi:qi,l=await Ji(ee.resolve(r,t),n);if(l===null||e.has(l))return;e.add(l),r=ee.dirname(l),i=ee.extname(l);let s=await Ge.readFile(l,"utf-8"),o=[];for(let a of zi)for(let u of s.matchAll(a))u[1].startsWith(".")&&o.push(fr(e,u[1],r,i));await Promise.all(o)}async function cr(e){let t=new Set;return await fr(t,e,ee.dirname(e),ee.extname(e)),Array.from(t)}async function Ce(e,t,r){if(e[0]!=="."){let s=await hr(e,t);if(!s)throw new Error(`Could not resolve '${e}' from '${t}'`);let o=await gr(dr(s).href);return{base:pr(s),module:o.default??o}}let i=await hr(e,t);if(!i)throw new Error(`Could not resolve '${e}' from '${t}'`);let[n,l]=await Promise.all([gr(dr(i).href+"?id="+Date.now()),cr(i)]);for(let s of l)r(s);return{base:pr(i),module:n.default??n}}var mr=null;async function gr(e){try{return await import(e)}catch{return mr??=Gi(import.meta.url,{moduleCache:!1,fsCache:!1}),await mr.import(e)}}var xa=xe.ResolverFactory.createResolver({fileSystem:new xe.CachedInputFileSystem(yr,4e3),useSyncFileSystemCalls:!0,extensions:[".css"],mainFields:["style"],conditionNames:["style"]});var Yi=xe.ResolverFactory.createResolver({fileSystem:new xe.CachedInputFileSystem(yr,4e3),useSyncFileSystemCalls:!0,extensions:[".js",".json",".node",".ts"]});function hr(e,t){return Hi(Yi,e,t)}function Hi(e,t,r){return new Promise((i,n)=>e.resolve({},r,t,{},(l,s)=>{if(l)return n(l);i(s)}))}function Ae(e){let t=[];e=Array.isArray(e)?e:[e];let r=e.flatMap(i=>Object.entries(i));for(let[i,n]of r)if(typeof n!="object")!i.startsWith("--")&&n==="@slot"?t.push(x(i,[x("@slot",[])])):(i=i.replace(/([A-Z])/g,"-$1").toLowerCase(),t.push(R(i,String(n))));else if(Array.isArray(n))for(let l of n)typeof l=="string"?t.push(R(i,l)):t.push(x(i,Ae(l)));else n!==null&&t.push(x(i,Ae(n)));return t}function wr(e){let t=[];if("keyframes"in e.theme)for(let[r,i]of Object.entries(e.theme.keyframes))t.push(x(`@keyframes ${r}`,Ae(i)));return t}function br({addVariant:e,config:t}){let r=t("darkMode",null),[i,n=".dark"]=Array.isArray(r)?r:[r];if(i==="variant"){let l;if(Array.isArray(n)||typeof n=="function"?l=n:typeof n=="string"&&(l=[n]),Array.isArray(l))for(let s of l)s===".dark"?(i=!1,console.warn('When using `variant` for `darkMode`, you must provide a selector.\nExample: `darkMode: ["variant", ".your-selector &"]`')):s.includes("&")||(i=!1,console.warn('When using `variant` for `darkMode`, your selector must contain `&`.\nExample `darkMode: ["variant", ".your-selector &"]`'));n=l}i===null||(i==="selector"?e("dark",`&:where(${n}, ${n} *)`):i==="media"?e("dark","@media (prefers-color-scheme: dark)"):i==="variant"?e("dark",n):i==="class"&&e("dark",`&:is(${n} *)`))}import Se from"tree-sitter";import $e from"tree-sitter-typescript";var Ye=new Se;Ye.setLanguage($e.typescript);var He=String.raw,Xi=new Se.Query($e.typescript,He`
|
|
23
68
|
; export default {}
|
|
24
69
|
(export_statement
|
|
25
|
-
value:
|
|
26
|
-
(
|
|
27
|
-
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
28
|
-
value: (array) @imports
|
|
29
|
-
)
|
|
30
|
-
))?
|
|
31
|
-
value: (as_expression (object
|
|
32
|
-
(pair
|
|
33
|
-
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
34
|
-
value: (array) @imports
|
|
35
|
-
)
|
|
36
|
-
))?
|
|
37
|
-
value: (object
|
|
38
|
-
(pair
|
|
39
|
-
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
40
|
-
value: (array) @imports
|
|
41
|
-
)
|
|
42
|
-
)?
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
; module.exports = {}
|
|
46
|
-
(expression_statement
|
|
47
|
-
(assignment_expression
|
|
48
|
-
left: (member_expression) @left (#eq? @left "module.exports")
|
|
49
|
-
right: (satisfies_expression (object
|
|
70
|
+
value: [
|
|
71
|
+
(satisfies_expression (object
|
|
50
72
|
(pair
|
|
51
73
|
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
52
74
|
value: (array) @imports
|
|
53
75
|
)
|
|
54
|
-
))
|
|
55
|
-
|
|
76
|
+
))
|
|
77
|
+
value: (as_expression (object
|
|
56
78
|
(pair
|
|
57
79
|
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
58
80
|
value: (array) @imports
|
|
59
81
|
)
|
|
60
|
-
))
|
|
61
|
-
|
|
82
|
+
))
|
|
83
|
+
value: (object
|
|
62
84
|
(pair
|
|
63
85
|
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
64
86
|
value: (array) @imports
|
|
65
87
|
)
|
|
66
|
-
)
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
; module.exports = {}
|
|
93
|
+
(expression_statement
|
|
94
|
+
(assignment_expression
|
|
95
|
+
left: (member_expression) @left (#eq? @left "module.exports")
|
|
96
|
+
right: [
|
|
97
|
+
(satisfies_expression (object
|
|
98
|
+
(pair
|
|
99
|
+
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
100
|
+
value: (array) @imports
|
|
101
|
+
)
|
|
102
|
+
))
|
|
103
|
+
(as_expression (object
|
|
104
|
+
(pair
|
|
105
|
+
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
106
|
+
value: (array) @imports
|
|
107
|
+
)
|
|
108
|
+
))
|
|
109
|
+
(object
|
|
110
|
+
(pair
|
|
111
|
+
key: (property_identifier) @_name (#eq? @_name "plugins")
|
|
112
|
+
value: (array) @imports
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
]
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
`),en=new Se.Query($e.typescript,He`
|
|
119
|
+
(call_expression
|
|
120
|
+
function: [
|
|
121
|
+
(call_expression
|
|
122
|
+
function: (identifier) @_name (#eq? @_name "require")
|
|
123
|
+
arguments: (arguments
|
|
124
|
+
(string (string_fragment) @module_string)
|
|
125
|
+
)
|
|
126
|
+
)
|
|
127
|
+
(identifier) @module_identifier
|
|
128
|
+
]
|
|
129
|
+
arguments: [
|
|
130
|
+
(arguments
|
|
131
|
+
(object
|
|
132
|
+
(pair
|
|
133
|
+
key: [
|
|
134
|
+
(property_identifier) @property
|
|
135
|
+
(string (string_fragment) @property)
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
value: [
|
|
139
|
+
(string (string_fragment) @str_value)
|
|
140
|
+
(template_string
|
|
141
|
+
. (string_fragment) @str_value
|
|
142
|
+
; If the template string has more than exactly one string
|
|
143
|
+
; fragment at the top, the migration should bail.
|
|
144
|
+
_ @error
|
|
145
|
+
)
|
|
146
|
+
(number) @num_value
|
|
147
|
+
(true) @true_value
|
|
148
|
+
(false) @false_value
|
|
149
|
+
(null) @null_value
|
|
150
|
+
(array [
|
|
151
|
+
(string (string_fragment) @str_value)
|
|
152
|
+
(template_string (string_fragment) @str_value)
|
|
153
|
+
(number) @num_value
|
|
154
|
+
(true) @true_value
|
|
155
|
+
(false) @false_value
|
|
156
|
+
(null) @null_value
|
|
157
|
+
]) @array_value
|
|
158
|
+
]
|
|
159
|
+
)
|
|
160
|
+
)
|
|
161
|
+
)
|
|
162
|
+
(arguments) @_empty_args (#eq? @_empty_args "()")
|
|
163
|
+
]
|
|
164
|
+
)
|
|
165
|
+
(call_expression
|
|
166
|
+
function: (identifier) @_name (#eq? @_name "require")
|
|
167
|
+
arguments: (arguments
|
|
168
|
+
(string (string_fragment) @module_string)
|
|
67
169
|
)
|
|
68
170
|
)
|
|
69
|
-
`);function
|
|
171
|
+
`);function Qe(e){try{let r=Ye.parse(e).rootNode,i=rn(e),n=Xi.matches(r),l=[];for(let s of n)for(let o of s.captures)if(o.name==="imports"){for(let a of o.node.children)if(!(a.type==="["||a.type==="]"||a.type===","))switch(a.type){case"identifier":let u=i[a.text];if(!u||u.export!==null)return null;l.push([u.module,null]);break;case"string":l.push([a.children[1].text,null]);break;case"call_expression":let f=en.matches(a);if(f.length===0)return null;let p=null,c=null,m=null,d=null,g=f.flatMap(h=>h.captures);for(let h=0;h<g.length;h++){let y=g[h];switch(y.name){case"module_identifier":{c=y.node.text;break}case"module_string":{p=y.node.text;break}case"property":{if(d!==null)return null;d=y.node.text;break}case"str_value":case"num_value":case"null_value":case"true_value":case"false_value":{if(d===null)return null;m??={},m[d]=kr(y),d=null;break}case"array_value":{if(d===null)return null;m??={};let k=[],D=h;e:for(let ne=h+1;ne<g.length;ne++){let Re=g[ne];switch(Re.name){case"property":{if(Re.node.text!==d)break e;break}case"str_value":case"num_value":case"null_value":case"true_value":case"false_value":k.push(kr(Re)),D=ne}}h=D,m[d]=k,d=null;break}case"_name":case"_empty_args":break;default:return null}}if(d!==null)return null;if(c!==null){let h=i[c];if(!h||h.export!==null&&h.export!=="*")return null;p=h.module}if(p===null)return null;l.push([p,m]);break;default:return null}}return l}catch(t){return console.error(t),null}}var tn=new Se.Query($e.typescript,He`
|
|
70
172
|
; ESM import
|
|
71
173
|
(import_statement
|
|
72
174
|
(import_clause
|
|
@@ -105,19 +207,19 @@ import{globby as ur}from"globby";import fr from"node:fs/promises";import Wi from
|
|
|
105
207
|
)
|
|
106
208
|
)
|
|
107
209
|
)
|
|
108
|
-
`);function
|
|
109
|
-
`)}}async function
|
|
110
|
-
`,
|
|
111
|
-
`)
|
|
112
|
-
`}return"keyframes"in n&&(
|
|
113
|
-
|
|
114
|
-
`:null}function
|
|
115
|
-
`}function
|
|
116
|
-
`}import
|
|
117
|
-
`),m=[];for(let d=0;d<c.length;d++){let g=c[d];if(r(g))o=!0,m.push(g.replace("tailwindcss:","'@tailwindcss/postcss':"));else if(n(g))
|
|
118
|
-
`)),{didAddPostcssClient:o,didRemoveAutoprefixer:
|
|
210
|
+
`);function rn(e){let r=Ye.parse(e).rootNode,i=tn.matches(r),n={};for(let l of i){let s=[],o="";for(let a=0;a<l.captures.length;a++){let u=l.captures[a];switch(u.name){case"default":s.push({name:u.node.text,export:null});break;case"imported-name":s.push({name:u.node.text,export:u.node.text});break;case"imported-from":o=u.node.text;break;case"imported-namespace":s.push({name:u.node.text,export:"*"});break;case"imported-alias":if(s.length<1)throw new Error("Unexpected alias: "+JSON.stringify(i,null,2));let f=s[s.length-1],p=f.name;f.export=p,f.name=u.node.text;break}}for(let{name:a,export:u}of s)n[a]={module:o,export:u}}return n}function kr(e){return e.name==="num_value"?parseFloat(e.node.text):e.name==="null_value"?null:e.name==="true_value"?!0:e.name==="false_value"?!1:e.node.text}var an=sn(import.meta.url),un=on(an);async function Ar(e,t,r){let[i,n]=await Promise.all([Ce(t,un,()=>{}).then(u=>u.module),nn.readFile(t,"utf-8")]);if(!mn(i,n))return $("Your configuration file could not be automatically migrated to the new CSS configuration format, so your CSS has been updated to load your existing configuration file."),null;let l=[],s=[],o=[];if("darkMode"in i&&o.push(cn(i)),"content"in i&&(l=await dn(i,r)),"theme"in i){let u=await fn(e,i,r);u&&o.push(u)}"corePlugins"in i&&$("The `corePlugins` option is no longer supported as of Tailwind CSS v4.0, so it's been removed from your configuration.");let a=Qe(n);if(a!==null)for(let[u,f]of a)s.push({base:r,path:u,options:f});return{sources:l,plugins:s,css:o.join(`
|
|
211
|
+
`)}}async function fn(e,t,r){let i={base:r,config:{...t,plugins:[],presets:void 0}},{resolvedConfig:n,replacedThemeKeys:l}=J(e,[i]),s=new Map(Array.from(l.entries()).map(([f])=>[f,!1])),o="",a="@theme {",u=!1;for(let[f,p]of Et(n.theme)){if(typeof p!="string"&&typeof p!="number"||f[0]==="keyframes")continue;u=!0;let c=pn(f);if(c!==o&&(a+=`
|
|
212
|
+
`,o=c),s.has(f[0])&&s.get(f[0])===!1){s.set(f[0],!0);let d=z([f[0]]);d!==null&&(a+=` ${U(`--${d}`)}-*: initial;
|
|
213
|
+
`)}let m=z(f);m!==null&&(a+=` ${U(`--${m}`)}: ${p};
|
|
214
|
+
`)}return"keyframes"in n.theme&&(u=!0,a+=`
|
|
215
|
+
`+yn(n.theme.keyframes)),u?a+`}
|
|
216
|
+
`:null}function cn(e){let t="";return br({config:()=>e.darkMode,addVariant:(n,l)=>t=l}),t===""?"":`@variant dark (${t});
|
|
217
|
+
`}function pn(e){let t=[];for(let r=0;r<e.length-1;r++){let i=e[r];if(e[r+1][0]==="-")break;t.push(i)}return t.join("-")}async function dn(e,t){let r=vn(t),i=[];for(let n of e.content){if(typeof n!="string")throw new Error("Unsupported content value: "+n);let l=wn({base:t,pattern:n}),s=!0;for(let o of l)if(!r.includes(o)){s=!1;break}s||i.push({base:t,pattern:n})}return i}function mn(e,t){function r(o){return typeof o=="function"?!1:Array.isArray(o)?o.every(r):typeof o=="object"&&o!==null?Object.values(o).every(r):["string","number","boolean","undefined"].includes(typeof o)}let{plugins:i,theme:n,...l}=e;if(!r(l))return!1;let s=["darkMode","content","theme","plugins","presets","prefix","corePlugins"];if(Object.keys(e).some(o=>!s.includes(o))||Qe(t)===null||e.presets&&e.presets.length>0)return!1;if(n&&typeof n=="object"){if(n.extend&&!xr(n.extend))return!1;let{extend:o,...a}=n;if(!xr(a))return!1}return!0}var gn=[...Object.keys(ln),"containers"],hn=["supports","data","aria"];function xr(e){for(let t of Object.keys(e))if(!gn.includes(t)||hn.includes(t))return!1;if("screens"in e&&typeof e.screens=="object"&&e.screens!==null){for(let t of Object.values(e.screens))if(typeof t=="object"&&t!==null&&("max"in t||"raw"in t))return!1}return!0}function yn(e){let t=wr({theme:{keyframes:e}});return De(t).trim()+`
|
|
218
|
+
`}function vn(e){let t=new Cr({detectSources:{base:e}});return t.scan(),t.files}function wn(e){let t=new Cr({sources:[e]});return t.scan(),t.files}import E from"node:fs/promises";import re from"node:path";import{execSync as bn}from"node:child_process";import G from"node:fs/promises";import{dirname as kn,resolve as Y}from"node:path";var Sr=!1;async function te(e,t){let r=await xn(t);if(!r){Sr||(Sr=!0,ae("Could not detect a package manager. Please manually update `tailwindcss` to v4."));return}return bn(`${r} ${e}`,{cwd:t})}async function xn(e){do{let t=Y(e,"package.json");try{let r=await G.readFile(t,"utf-8"),i=JSON.parse(r);if(i.packageManager){if(i.packageManager.includes("bun"))return"bun";if(i.packageManager.includes("yarn"))return"yarn";if(i.packageManager.includes("pnpm"))return"pnpm";if(i.packageManager.includes("npm"))return"npm"}}catch{}try{return await G.access(Y(e,"bun.lockb")),"bun"}catch{}try{return await G.access(Y(e,"bun.lock")),"bun"}catch{}try{return await G.access(Y(e,"pnpm-lock.yaml")),"pnpm"}catch{}try{return await G.access(Y(e,"yarn.lock")),"yarn"}catch{}try{return await G.access(Y(e,"package-lock.json")),"npm"}catch{}e=kn(e)}while(!0)}async function Tr(e){let t=!1,r=!1,i=!1,n=!1,l=await Sn(e);if(l){let f=await Cn(e,l);f&&(t=!0,r=f.didAddPostcssClient,i=f.didRemoveAutoprefixer,n=f.didRemovePostCSSImport)}let s=re.resolve(e,"package.json"),o;try{o=JSON.parse(await E.readFile(s,"utf-8"))}catch{}if(!t&&o&&"postcss"in o){let f=await $r(e,o.postcss);f&&(await E.writeFile(s,JSON.stringify({...o,postcss:f?.json},null,2)),t=!0,r=f.didAddPostcssClient,i=f.didRemoveAutoprefixer,n=f.didRemovePostCSSImport)}let a=await Tn(e),u=null;if(!t&&a){try{u=JSON.parse(await E.readFile(a,"utf-8"))}catch{}if(u){let f=await $r(e,u);f&&(await E.writeFile(a,JSON.stringify(f.json,null,2)),t=!0,r=f.didAddPostcssClient,i=f.didRemoveAutoprefixer,n=f.didRemovePostCSSImport)}}if(!t){$("No PostCSS config found, skipping migration.");return}if(r)try{await te("add -D @tailwindcss/postcss@next",e)}catch{}if(i||n)try{let f=[i?"autoprefixer":null,n?"postcss-import":null].filter(Boolean).join(" ");await te(`remove ${f}`,e)}catch{}I("PostCSS config has been upgraded.")}async function Cn(e,t){function r(d){return/['"]?tailwindcss['"]?\: ?\{\}/.test(d)}function i(d){return/['"]?postcss-import['"]?\: ?\{\}/.test(d)}function n(d){return/['"]?autoprefixer['"]?\: ?\{\}/.test(d)}function l(d){return/['"]tailwindcss\/nesting['"]\: ?(\{\}|['"]postcss-nesting['"])/.test(d)}if($(`Attempt to upgrade the PostCSS config in file: ${t}`),!await _n(e,t))return ae("The PostCSS config contains dynamic JavaScript and can not be automatically migrated."),null;let o=!1,a=!1,u=!1,f=re.resolve(e,t),c=(await E.readFile(f,"utf-8")).split(`
|
|
219
|
+
`),m=[];for(let d=0;d<c.length;d++){let g=c[d];if(r(g))o=!0,m.push(g.replace("tailwindcss:","'@tailwindcss/postcss':"));else if(n(g))a=!0;else if(i(g)){let h=!1;for(let y=d+1;y<c.length;y++){let k=c[y];if(r(k))break;if(!l(k)){h=!0;break}}h?m.push(g):u=!0}else if(l(g)){let h=c[d+1];r(h)||m.push(g)}else m.push(g)}return await E.writeFile(f,m.join(`
|
|
220
|
+
`)),{didAddPostcssClient:o,didRemoveAutoprefixer:a,didRemovePostCSSImport:u}}async function $r(e,t){function r(p,c){return p==="tailwindcss"&&Te(c)}function i(p,c){return p==="postcss-import"&&Te(c)}function n(p,c){return p==="autoprefixer"&&Te(c)}function l(p,c){return p==="tailwindcss/nesting"&&(c==="postcss-nesting"||Te(c))}let s=!1,o=!1,a=!1,u=Object.entries(t.plugins||{}),f=[];for(let p=0;p<u.length;p++){let[c,m]=u[p];if(r(c,m))s=!0,f.push(["@tailwindcss/postcss",m]);else if(n(c,m))o=!0;else if(i(c,m)){let d=!1;for(let g=p+1;g<u.length;g++){let[h,y]=u[g];if(r(h,y))break;if(!l(h,y)){d=!0;break}}d?f.push([c,m]):a=!0}else if(l(c,m)){let[d,g]=u[p+1];r(d,g)||f.push([c,m])}else f.push([c,m])}return{json:{...t,plugins:Object.fromEntries(f)},didAddPostcssClient:s,didRemoveAutoprefixer:o,didRemovePostCSSImport:a}}var An=[".postcssrc.js",".postcssrc.mjs",".postcssrc.cjs",".postcssrc.ts",".postcssrc.mts",".postcssrc.cts","postcss.config.js","postcss.config.mjs","postcss.config.cjs","postcss.config.ts","postcss.config.mts","postcss.config.cts"];async function Sn(e){for(let t of An){let r=re.resolve(e,t);try{return await E.access(r),t}catch{}}return null}var $n=[".postcssrc",".postcssrc.json"];async function Tn(e){for(let t of $n){let r=re.resolve(e,t);try{return await E.access(r),t}catch{}}return null}async function _n(e,t){let r=re.resolve(e,t),i=await E.readFile(r,"utf-8");return i.includes("tailwindcss:")&&!(i.includes("require")||i.includes("import "))}function Te(e){return typeof e=="object"&&e!==null&&Object.keys(e).length===0}import{__unstable__loadDesignSystem as _r,compile as Vn}from"@tailwindcss/node";import Nn from"node:fs/promises";import Ze from"node:path";import{dirname as Vr}from"path";import{fileURLToPath as Pn}from"url";var Rn=Pn(import.meta.url),ie=Vr(Rn),Nr=String.raw;async function Pr(e,t){try{e===null&&(e=await On(t.base));let r=Ze.resolve(t.base,e),i=Ze.relative(ie,r);i.startsWith(".")||(i="./"+i);let n=await En(r),l=n.prefix?Vt(n.prefix):null,s=Nr`
|
|
119
221
|
@import 'tailwindcss' ${l?`prefix(${l})`:""};
|
|
120
222
|
@config './${i}';
|
|
121
|
-
`,[o,
|
|
223
|
+
`,[o,a]=await Promise.all([Vn(s,{base:ie,onDependency:()=>{}}),_r(s,{base:ie})]);return{designSystem:a,globs:o.globs,userConfig:n,newPrefix:l,configFilePath:r}}catch(r){K("Could not load the configuration file: "+r.message),process.exit(1)}}async function En(e){let[t,r]=await Promise.all([_r(Nr`
|
|
122
224
|
@import 'tailwindcss';
|
|
123
|
-
`,{base:
|
|
225
|
+
`,{base:ie}),Ce(e,ie,()=>{}).then(i=>i.module)]);return J(t,[{base:Vr(e),config:r}]).resolvedConfig}var Kn=["./tailwind.config.js","./tailwind.config.cjs","./tailwind.config.mjs","./tailwind.config.ts","./tailwind.config.cts","./tailwind.config.mts"];async function On(e){for(let t of Kn){let r=Ze.resolve(e,t);try{return await Nn.access(r),t}catch{}}throw new Error("No configuration file found. Please provide a path to the Tailwind CSS v3 config file via the `--config` option.")}import Dn from"mri";function Er(e,t=process.argv.slice(2)){let r=Dn(t),i={_:r._};for(let[n,{type:l,alias:s,default:o=l==="boolean"?!1:null}]of Object.entries(e)){if(i[n]=o,s){let a=s.slice(1);r[a]!==void 0&&(i[n]=Rr(r[a],l))}{let a=n.slice(2);r[a]!==void 0&&(i[n]=Rr(r[a],l))}}return i}function Rr(e,t){switch(t){case"string":return Ne(e);case"boolean":return _e(e);case"number":return Ve(e);case"boolean | string":return _e(e)??Ne(e);case"number | string":return Ve(e)??Ne(e);case"boolean | number":return _e(e)??Ve(e);case"boolean | number | string":return _e(e)??Ve(e)??Ne(e);default:throw new Error(`Unhandled type: ${t}`)}}function _e(e){if(e===!0||e===!1)return e;if(e==="true")return!0;if(e==="false")return!1}function Ve(e){if(typeof e=="number")return e;{let t=Number(e);if(!Number.isNaN(t))return t}}function Ne(e){return`${e}`}import{execSync as jn}from"node:child_process";function Xe(){try{return jn("git status --porcelain",{encoding:"utf-8"}).trim()!==""}catch(e){return!e?.toString?.().includes("not a git repository")}}var Dr={"--config":{type:"string",description:"Path to the configuration file",alias:"-c"},"--help":{type:"boolean",description:"Display usage information",alias:"-h"},"--force":{type:"boolean",description:"Force the migration",alias:"-f"},"--version":{type:"boolean",description:"Display the version number",alias:"-v"}},Pe=Er(Dr);Pe["--help"]&&(nt({usage:["npx @tailwindcss/upgrade"],options:Dr}),process.exit(0));async function Mn(){let e=process.cwd();F(le()),F(),Pe["--force"]||Xe()&&(K("Git directory is not clean. Please stash or commit your changes before migrating."),$(`You may use the ${se("--force")} flag to silence this warning and perform the migration.`),process.exit(1));let t=await Pr(Pe["--config"],{base:e});{$("Migrating templates using the provided configuration file.");let i=new Set;for(let{pattern:l,base:s}of t.globs){let o=await Kr([l],{absolute:!0,gitignore:!0,cwd:s});for(let a of o)i.add(a)}let n=Array.from(i);n.sort(),await Promise.allSettled(n.map(l=>Mt(t.designSystem,t.userConfig,l))),I("Template migration complete.")}$("Migrating JavaScript configuration files using the provided configuration file.");let r=await Ar(t.designSystem,t.configFilePath,e);{let i=Pe._.map(o=>In.resolve(e,o));i.length===0&&($("No input stylesheets provided. Searching for CSS files in the current directory and its subdirectories\u2026"),i=await Kr(["**/*.css"],{absolute:!0,gitignore:!0})),i=i.filter(o=>o.endsWith(".css"));let n=await Promise.allSettled(i.map(o=>W.load(o)));for(let o of n)o.status==="rejected"&&K(`${o.reason}`);let l=n.filter(o=>o.status==="fulfilled").map(o=>o.value);try{await ar(l)}catch(o){K(`${o}`)}let s=await Promise.allSettled(l.map(o=>sr(o,{...t,jsConfigMigration:r})));for(let o of s)o.status==="rejected"&&K(`${o.reason}`);try{await ur(l)}catch(o){K(`${o}`)}for(let o of l){if(!Array.from(o.importRules).some(u=>u.raws.tailwind_injected_layer))continue;let a=!1;if(o.root.walkAtRules("utility",()=>(a=!0,!1)),!a){for(let u of o.descendants())if(u.root.walkAtRules("utility",()=>(a=!0,!1)),a)break}if(a)for(let u of o.importRules)u.raws.tailwind_injected_layer&&(u.params=u.params.replace(/ layer\([^)]+\)/,"").trim())}for(let o of l)await Fn([et()]).process(o.root,{from:o.file});for(let o of l)o.file&&await Or.writeFile(o.file,o.root.toString());I("Stylesheet migration complete.")}await Tr(e);try{await te("add tailwindcss@next",e)}catch{}r!==null&&await Or.rm(t.configFilePath),Xe()?I("Verify the changes and commit them to your repository."):I("No changes were made to your repository.")}Mn().then(()=>process.exit(0)).catch(e=>{console.error(e),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailwindcss/upgrade",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.29",
|
|
4
4
|
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"dedent": "1.5.3",
|
|
25
26
|
"enhanced-resolve": "^5.17.1",
|
|
26
27
|
"globby": "^14.0.2",
|
|
27
28
|
"jiti": "^2.0.0-beta.3",
|
|
@@ -31,17 +32,15 @@
|
|
|
31
32
|
"postcss-import": "^16.1.0",
|
|
32
33
|
"postcss-selector-parser": "^6.1.2",
|
|
33
34
|
"prettier": "^3.3.3",
|
|
34
|
-
"string-byte-slice": "^3.0.0",
|
|
35
35
|
"tree-sitter": "^0.21.1",
|
|
36
36
|
"tree-sitter-typescript": "^0.23.0",
|
|
37
|
-
"@tailwindcss/oxide": "4.0.0-alpha.
|
|
38
|
-
"tailwindcss": "4.0.0-alpha.
|
|
39
|
-
"
|
|
37
|
+
"@tailwindcss/oxide": "4.0.0-alpha.29",
|
|
38
|
+
"@tailwindcss/node": "4.0.0-alpha.29",
|
|
39
|
+
"tailwindcss": "4.0.0-alpha.29"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^20.14.8",
|
|
43
|
-
"@types/postcss-import": "^14.0.3"
|
|
44
|
-
"dedent": "1.5.3"
|
|
43
|
+
"@types/postcss-import": "^14.0.3"
|
|
45
44
|
},
|
|
46
45
|
"scripts": {
|
|
47
46
|
"lint": "tsc --noEmit",
|