transform-to-unocss-core 0.0.16 → 0.0.18

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.d.ts CHANGED
@@ -16,7 +16,7 @@ declare function isPercent(s: string): boolean;
16
16
  declare function isHex(hex: string): boolean;
17
17
  declare function isRgb(s: string): boolean;
18
18
  declare function isHsl(s: string): boolean;
19
- declare function getVal(val: string, transform?: Function, inClass?: boolean): string;
19
+ declare function getVal(val: string, transform?: Function, inClass?: boolean, prefix?: string): string;
20
20
  declare function getHundred(n: string | number): string | number;
21
21
  declare function joinWithLine(s: string): string;
22
22
  declare function joinWithUnderLine(s: string): string;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var A=Object.defineProperty;var Sr=Object.getOwnPropertyDescriptor;var Tr=Object.getOwnPropertyNames;var Rr=Object.prototype.hasOwnProperty;var Ar=(r,o)=>{for(var t in o)A(r,t,{get:o[t],enumerable:!0})},Hr=(r,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of Tr(o))!Rr.call(r,e)&&e!==t&&A(r,e,{get:()=>o[e],enumerable:!(n=Sr(o,e))||n.enumerable});return r};var Pr=r=>Hr(A({},"__esModule",{value:!0}),r);var pt={};Ar(pt,{cssMathFnRE:()=>P,diffTemplateStyle:()=>Br,flag:()=>Mr,getFirstName:()=>f,getHundred:()=>b,getLastName:()=>u,getStyleScoped:()=>Dr,getVal:()=>a,isCalc:()=>I,isColor:()=>qr,isEmptyStyle:()=>Gr,isHex:()=>W,isHsl:()=>_,isNot:()=>Er,isPercent:()=>F,isRgb:()=>g,isSize:()=>Zr,isUrl:()=>J,isVar:()=>K,joinEmpty:()=>M,joinWithLine:()=>h,joinWithUnderLine:()=>v,numberWithUnitRE:()=>q,toUnocss:()=>T,toUnocssClass:()=>Ur,transformImportant:()=>i,transformStyleToUnocss:()=>R,trim:()=>H});module.exports=Pr(pt);var Mr=".__unocss_transfer__",P=/^(?:calc|clamp|min|max)\s*\(.*\)/,q=/[0-9]+(px|rem|em|%|vw|vh|vmin|vmax|deg)/;function Er(r){return/\[&:not\(/.test(r)}function I(r){return P.test(r)}function f(r){return r.split("-")[0]}function u(r){let o=r.split("-");return o[o.length-1]}function J(r){return r.startsWith("url(")}function F(r){return r.endsWith("%")}function W(r){return/^#[0-9A-Fa-f]{2,}$/.test(r)}function g(r){return r.startsWith("rgb")}function _(r){return r.startsWith("hsl")}function a(r,o,t){return I(r)||J(r)||W(r)||g(r)||_(r)||F(r)||K(r)?t?`-[${H(r,"all").replace(/['"]/g,"")}]`:`="[${H(r,"all").replace(/['"]/g,"")}]"`:`-${o?o(r):r}`}function b(r){return typeof r=="string"&&r.endsWith("%")?r.slice(0,-1):+r*100}function h(r){return r.replace(/\s+/," ").split(" ").join("-")}function v(r){return r.replace(/\s+/," ").split(" ").join("_")}function H(r,o="around"){return o==="pre"?r.replace(/(^\s*)/g,""):o==="post"?r.replace(/(\s*$)/g,""):o==="all"?r.replace(/\s+/g,""):o==="around"?r.replace(/(^\s*)|(\s*$)/g,""):r}function i(r){return r=r.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(r)&&(r=r.replace(/rgba?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/hsl/.test(r)&&(r=r.replace(/hsla?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/var\([^\)]+\)/.test(r)&&(r=r.replace(/var\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),r.endsWith("!important")?[r.replace(/\s*\!important/,"").trim(),"!"]:[r.trim(),""]}function Br(r,o){let t=r.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return t[0]===n[0]}function Gr(r){return/<style scoped>[\n\s]*<\/style>/.test(r)}function Dr(r){let o=r.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function M(r){return r.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function K(r){return r.startsWith("var(--")}function Zr(r){return P.test(r)||q.test(r)}function qr(r){return W(r)||g(r)||_(r)}function C(r,o){let[t,n]=i(o);return`${r[0]}${a(t,f)}${n}`}var Jr=["background-color","background-size","background-attachment","background-position"],Kr=/linear-gradient\(\s*to([\w\s]+),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Or=/linear-gradient\(\s*([^,]*),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Qr=/(radial|conic)-gradient\(([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,w="__comma__";function O(r,o){let[t,n]=i(o);if(Jr.includes(r))return`bg${a(t,B)}${n}`;if(["background","background-image"].includes(r)){if(/(linear)-gradient/.test(t)){let m=t.replace(/rgba?\(([^)]+)\)/g,(c,$)=>c.replace($,$.replace(/\s*,\s*/g,w))),p=m.match(Kr);if(p){let[c,$,V,N]=p.slice(1);return c=c.split(" ").map(L=>L[0]).join(""),c?`bg-gradient-to-${c}${E($,V,N)}`:E($,V,N)}let l=m.match(Or);return l?`bg-gradient-linear bg-gradient-[${l[1]},${l[2].replace(/\s+/,"_").replaceAll(w,",")},${l[3].replace(/\s+/,"_").replaceAll(w,",")}]`:void 0}else if(/(radial|conic)-gradient/.test(t)){let p=t.replace(/rgba?\(([^)]+)\)/g,(N,L)=>N.replace(L,L.replace(/\s*,\s*/g,w))).match(Qr);if(!p)return;let l=p[1],[c,$,V]=p.slice(2);return`bg-gradient-${l}${E(c,$,V)}`}let e=t.match(/rgba?\([^)]+\)/);if(e){let m=e[0];return`bg="${t.replace(m,`[${m}]`)}${n}"`}let s=t.match(/url\(["'\s\.\-_\w\/]*\)/);return s?`bg="${t.replace(s[0],`[${s[0].replace(/['"]/g,"")}]${n}`)}"`:`bg${a(t,B)}${n}`}return r==="background-blend-mode"?`bg-blend-${t}${n}`:`${Xr(r,t)}-${Yr(t)}${n}`}function Xr(r,o){return o.endsWith("repeat")?"bg":r.replace("background","bg")}function Yr(r){return/(border)|(content)|(padding)-box/.test(r)?r.replace("-box",""):r.startsWith("repeat-")?r.replace("repeat-",""):B(r)}function B(r){return r.replace(/\s+/," ").replace(" ","-")}function E(r,o,t){let n="";if(o&&!t&&(t=o,o=""),r){r=r.replaceAll(w,",");let[e,s]=r.split(" ");s?n+=` from="${g(e)?`[${e}]`:e} ${s}"`:e&&(n+=` from="${g(e)?`[${e}]`:e}"`)}if(o){o=o.replaceAll(w,",");let[e,s]=o.split(" ");s?n+=` via="${g(e)?`[${e}]`:e} ${s}"`:e&&(n+=` via="${g(e)?`[${e}]`:e}"`)}if(t){t=t.replaceAll(w,",");let[e,s]=t.split(" ");s?n+=` to="${g(e)?`[${e}]`:e} ${s}"`:e&&(n+=` to="${g(e)?`[${e}]`:e}"`)}return n}function G(r,o){let[t,n]=i(o),e=r.split("-"),s=I(t)?a(t):a(f(t));return`${e[0]}-${e[1][0]}${s}${n}`}function Q(r,o){let[t,n]=i(o);if(r==="font-size")return`text-${t}${n}`;if(r==="font-weight")return`font-${t}${n}`;if(r==="font-family"){let e=t.match(/ui-(\w{0,4})/);if(!e)return`font-${o}${n}`;let[s,m]=e;return`font-${m}${n}`}return r==="font-style"?t==="normal"?`font-not-italic${n}`:`font-${t}${n}`:r==="font-variant-numeric"?t==="normal"?`normal-nums${n}`:`${t}${n}`:`font="${yr(t)}${n}"`}function yr(r){return r.split(" ").map(o=>/^[0-9]/.test(o)?`text-${o}`:o).join(" ")}function X(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}var kr={"margin-left":"ml","margin-right":"mr","margin-top":"mt","margin-bottom":"mb","margin-inline-start":"ms","margin-inline-end":"me","padding-left":"pl","padding-right":"pr","padding-top":"pt","padding-bottom":"pb","padding-inline-start":"ps","padding-inline-end":"pe"};function D(r,o){let[t,n]=i(o),e=kr[r];if(e)return`${e}${a(t)}${n}`;let s=t.split(" "),m=s.length;return m===1?`${r[0]}${a(s[0])}${n}`:m===2?`${r[0]}x${a(s[1])}${n} ${r[0]}y${a(s[0])}${n}`:m===3?`${r[0]}x${a(s[1])}${n} ${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n}`:`${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n} ${r[0]}l${a(s[3])}${n} ${r[0]}r${a(s[1])}${n}`}function Y(r,o){let[t,n]=i(o);return F(o)?`op-${t.replace("%","")}${n}`:`op-${+t*100}${n}`}function y(r,o){let[t,n]=i(o);return`text${a(t)}${n}`}function k(r,o){let[t,n]=i(o);return r==="text-decoration-line"?t==="none"?`no-underline${n}`:`${t}${n}`:r==="text-transform"?t==="none"?`normal-case${n}`:`${t}${n}`:r.startsWith("text-decoration")||r==="text-indent"?`${r.split("-")[1]}${a(t)}${n}`:r==="text-underline-offset"?`underline-offset-${t}${n}`:`text-${t}${n}`}function rr(r,o){let[t,n]=i(o);return`v-${t}${n}`}function tr(r,o){let[t,n]=i(o);return`lh${a(t)}${n}`}var rt=["border-left","border-top","border-right","border-bottom"];function nr(r,o){let[t,n]=i(o);if(r==="border-spacing")return`${r}="[${v(t)}]${n}"`;if(r==="border-color"){if(t.includes(" ")){let e=t.split(" ").length,s=t.split(" ").map($=>W($)||g($)||_($)?`-[${$}]`:`-${$}`),[m,p,l,c]=s;switch(e){case 2:return`border-y${m}${n} border-x${p}${n}`;case 3:return`border-t${m}${n} border-b${l}${n} border-x${p}${n}`;case 4:return`border-t${m}${n} border-b${l}${n} border-r${p}${n} border-l${c}${n}`}}return`border${a(t)}${n}`}return r==="border-radius"?I(t)||!t.includes(" ")?`border-rd${a(t)}${n}`:`border-rd="[${v(t)}]${n}"`:rt.some(e=>r.startsWith(e))?t.split(" ").map(e=>`border-${r.split("-")[1][0]}${a(e)}${n}`).join(" "):r==="border-inline-end-width"?`border-e${a(t)}${n}`:r==="border-inline-start-width"?`border-s${a(t)}${n}`:r.startsWith("border-image")?"":/^\d[%|(px)|(rem)]$/.test(t)||r==="border-collapse"?`border-${t}${n}`:r==="border-width"||r==="border-style"?`border${a(t)}${n}`:r==="border-color"?t==="currentColor"?`border-current${n}`:`border${a(t)}${n}`:t.split(" ").map(e=>t==="currentColor"?`border-current${n}`:`border${a(e)}${n}`).join(" ")}function z(r,o){let[t,n]=i(o);return t==="none"?`hidden${n}`:t==="hidden"?`invisible${n}`:`${t}${n}`}function d(r,o){let[t,n]=i(o);return`${r}-${t}${n}`}function j(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}function x(r,o){let[t,n]=i(o);return`${f(r)}${a(t)}${n}`}function U(r,o){let[t,n]=i(o);return r.startsWith("box-decoration")?`box-decoration-${t}${n}`:r==="box-sizing"?`box-${f(t)}${n}`:`shadow="[${t.split(" ").join("_")}]${n}"`}var tt=["contrast","brightness","saturate"],nt=["grayscale","invert","sepia"];function S(r,o){let[t,n]=i(o),[e,s,m]=t.match(/([\w-]+)\((.*)\)/);return tt.includes(s)?`${s}-${b(m)}${n}`:s==="drop-shadow"?`drop-${U(s,m)}${n}`:nt.includes(s)?`${s}-${m.endsWith("%")?m.slice(0,-1):b(m)}${n}`:s==="hue-rotate"?`${s}-${m.slice(0,-3)}${n}`:`${s}-${m}${n}`}function or(r,o){let[t,n]=i(o);return`backdrop-${S(r,t)}${n}`}function er(r,o){let[t,n]=i(o);return r==="transform-origin"?`origin-${h(t)}${n}`:r==="transform-style"?`transform-${t}`:M(t).split(" ").map(e=>{let s=e.match(/([a-z]+)([A-Z])?\((.*)\)/);if(!s)return;let[m,p,l,c]=s;return l?p==="scale"?c.includes(",")?`${p}-${l.toLowerCase()}="${c.split(",").join(" ")}${n}"`:`${p}-${l.toLowerCase()}-${b(c)}${n}`:`${p}-${l.toLowerCase()}="${ir(c)}${n}"`:p==="scale"?c.includes(",")?`${p}="${c.split(",").join(" ")}${n}"`:`${p}-${b(c)}${n}`:`${p}="${ir(c).replace(/,/g," ")}${n}"`}).filter(Boolean).join(" ")}function ir(r){return r.endsWith("deg")?r.slice(0,-3):r}var ot=["transition-delay","transition-duration"];function sr(r,o){let[t,n]=i(o);if(r==="transition-timing-function")return t==="linear"?`ease-${t}${n}`:`ease="[${t}]${n}"`;if(r==="transition")return`transition="${it(t)}"`;if(r==="transition-property")return t.includes("color")?`transition-color${n}`:t==="box-shadow"?`transition-shadow${n}`:`transition-${t}${n}`;if(ot.includes(r))return`${r.split("-")[1]}-${t.slice(0,-2)}`}function it(r){let o=!1;return r.split(" ").map(t=>/^[0-9]/.test(t)||/^\.[0-9]/.test(t)?o?`delay${a(t,void 0,!0)}`:(o=!0,`duration${a(t,void 0,!0)}`):t==="background-color"?"colors":t).join(" ")}function ar(r,o){let[t,n]=i(o);return r==="justify-content"?`justify-${u(t)}${n}`:`${r}-${u(t)}${n}`}function mr(r,o){let[t,n]=i(o);return`${u(r)}-${u(t)}${n}`}var et=["flex-basis","flex-grow","flex-shrink"];function pr(r,o){let[t,n]=i(o);if(et.includes(r))return`${u(r)}-${t}${n}`;if(t==="1")return`flex-1${n}`;let e=t[0];return r==="flex"&&(e==="0"||e==="1")?`flex="[${v(t)}]${n}"`:`${f(r)}-${t.replace("column","col")}${n}`}function fr(r,o){let[t,n]=i(o);return t==="auto"?`${f(r)}-${t}`:`${f(r)}="[${t}]${n}"`}function cr(r,o){let[t,n]=i(o);return r==="column-gap"?`gap-x-${t}${n}`:`${r}-${t}${n}`}function ur(r,o){let[t,n]=i(o);return o==="isolate"?`${t}${n}`:`${r}-${t}${n}`}function lr(r,o){let[t,n]=i(o);return r==="object-position"?`${f(r)}-${h(t)}${n}`:`${f(r)}-${t}${n}`}function $r(r,o){let[t,n]=i(o),[e,s,m]=r.split("-");return m?`${e}-${m}-${t}${n}`:`${e}-${t}${n}`}function gr(r,o){let[t,n]=i(o);if(r.startsWith("grid-template")){let s=t.match(/repeat\s*\(\s*([0-9]+)/);return s?`grid-${u(r)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${u(r)==="rows"?"rows":"cols"}-${t}${n}`}if(r==="grid-auto-flow")return`grid-flow-${h(t).replace("column","col")}${n}`;if(r.startsWith("grid-auto")){let s=t.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${u(r)==="rows"?"rows":"cols"}-${s?"fr":f(t)}${n}`}let e=t.match(/span\s+([0-9])/);return e?`${r.slice(5).replace("column","col")}-span-${e[1]}${n}`:t==="1/-1"?`${r.slice(5).replace("column","col")}-span-full${n}`:`${r.slice(5).replace("column","col")}-${t}${n}`}function dr(r,o){let[t,n]=i(o);return`gap-y-${t}${n}`}function xr(r,o){let[t,n]=i(o);return`${r}-${u(t)}${n}`}function br(r,o){let[t,n]=i(o);return`tracking-${t}${n}`}function hr(r,o){let[t,n]=i(o);return`whitespace-${t}${n}`}function wr(r,o){let[t,n]=i(o);return r.startsWith("word-spacing")?`word-spacing${a(o)}`:t==="keep-all"?`break-keep${n}`:`break-${u(t)}${n}`}function Ir(r,o){let[t,n]=i(o);return r==="outline-offset"?`${r}-${t}${n}`:`${f(r)}-${t}${n}`}function vr(r,o){let[t,n]=i(o);return`mix-blend-${t}${n}`}var st={vertical:"y",horizontal:"x"};function jr(r,o){let[t,n]=i(o);return t==="both"?`${r}${n}`:`${r}-${st[t]||t}${n}`}function Wr(r,o){let[t,n]=i(o);if(r.startsWith("scroll-snap"))return`snap-${t}${n}`;if(r==="scroll-behavior")return`scroll-${t}${n}`;let[e,s,m,p]=r.match(/scroll-(margin|padding)-?([\w]+)?-?([\w]+)?/);return m==="inline"&&p?`scroll-${s[0]}${p[0]}-${t}${n}`:m?`scroll-${s[0]}${m[0]}-${t}${n}`:`scroll-${s[0]}-${t}${n}`}function _r(r,o){let[t,n]=i(o);return`${u(r)}-${t}${n}`}function Vr(r,o){let[t,n]=i(o);return`${r}-${f(t)}${n}`}function Nr(r,o){let[t,n]=i(o);return r==="animation-delay"?`animate${a(t)}${n}`:r==="animation"?`animate-${t.split(" ")[0]}${n}`:`animate-${t}${n}`}function Lr(r,o){let[t,n]=i(o);return t==='" "'||t==="' '"?`content-['_']${n}`:`content="[${t}]${n}"`}var at={show:"visible",hide:"hidden"};function Fr(r,o){var e;let[t,n]=i(o);return`table-empty-cells-${(e=at[t])!=null?e:t}${n}`}function Cr(r,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}function zr(r,o){let[t,n]=i(o);if(r==="inset-inline-start")return`start${a(t)}${n}`;if(r==="inset-inline-end")return`end${a(t)}${n}`}var Z={animation:Nr,aspect:fr,backface:x,caption:x,column:cr,columns:d,break:d,empty:Fr,box:U,writing:Cr,display:z,float:d,clear:d,isolation:ur,object:lr,overflow:d,overscroll:$r,position:z,top:j,left:j,right:j,bottom:j,visibility:z,z:C,flex:pr,order:d,grid:gr,gap:j,justify:ar,align:mr,place:xr,padding:D,perspective:d,margin:D,width:C,min:G,max:G,height:C,font:Q,letter:br,line:tr,list:x,text:k,vertical:rr,white:hr,word:wr,content:Lr,background:O,border:nr,outline:Ir,opacity:Y,mix:vr,filter:S,backdrop:or,table:x,transition:sr,transform:er,accent:x,appearance:x,cursor:X,caret:x,pointer:d,resize:jr,scroll:Wr,inset:zr,touch:x,user:_r,will:Vr,fill:d,stroke:x,color:y,row:dr},mt=/([\w-]+)\s*:\s*([.\w\(\)-\s%+'",#\/!]+)/;function T(r,o=!1){var l;let t=r.match(mt);if(!t)return;let[n,e,s]=t,m=f(e),p=(l=Z[m])==null?void 0:l.call(Z,e,s);return p&&o?p.replace(/-([0-9\.]+)px/,(c,$)=>`-${+$/4}`):p}function R(r,o){let t=[];return[r.split(";").filter(Boolean).reduce((n,e)=>{let s=T(e,o)||"";return s||t.push(e),n+=`${s} `},"").trim(),t]}function Ur(r,o=!1){let[t,n]=R(r,o);return[t?t.replace(/="([^"]+)"/g,(e,s)=>`-${s}`):"",n]}0&&(module.exports={cssMathFnRE,diffTemplateStyle,flag,getFirstName,getHundred,getLastName,getStyleScoped,getVal,isCalc,isColor,isEmptyStyle,isHex,isHsl,isNot,isPercent,isRgb,isSize,isUrl,isVar,joinEmpty,joinWithLine,joinWithUnderLine,numberWithUnitRE,toUnocss,toUnocssClass,transformImportant,transformStyleToUnocss,trim});
1
+ "use strict";var M=Object.defineProperty;var Sr=Object.getOwnPropertyDescriptor;var Tr=Object.getOwnPropertyNames;var Rr=Object.prototype.hasOwnProperty;var Ar=(r,o)=>{for(var t in o)M(r,t,{get:o[t],enumerable:!0})},Hr=(r,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of Tr(o))!Rr.call(r,e)&&e!==t&&M(r,e,{get:()=>o[e],enumerable:!(n=Sr(o,e))||n.enumerable});return r};var Pr=r=>Hr(M({},"__esModule",{value:!0}),r);var pt={};Ar(pt,{cssMathFnRE:()=>B,diffTemplateStyle:()=>Br,flag:()=>Mr,getFirstName:()=>c,getHundred:()=>h,getLastName:()=>u,getStyleScoped:()=>Dr,getVal:()=>a,isCalc:()=>j,isColor:()=>qr,isEmptyStyle:()=>Gr,isHex:()=>V,isHsl:()=>N,isNot:()=>Er,isPercent:()=>z,isRgb:()=>d,isSize:()=>Zr,isUrl:()=>O,isVar:()=>w,joinEmpty:()=>G,joinWithLine:()=>I,joinWithUnderLine:()=>W,numberWithUnitRE:()=>K,toUnocss:()=>H,toUnocssClass:()=>Ur,transformImportant:()=>i,transformStyleToUnocss:()=>P,trim:()=>E});module.exports=Pr(pt);var Mr=".__unocss_transfer__",B=/^(?:calc|clamp|min|max)\s*\(.*\)/,K=/[0-9]+(px|rem|em|%|vw|vh|vmin|vmax|deg)/;function Er(r){return/\[&:not\(/.test(r)}function j(r){return B.test(r)}function c(r){return r.split("-")[0]}function u(r){let o=r.split("-");return o[o.length-1]}function O(r){return r.startsWith("url(")}function z(r){return r.endsWith("%")}function V(r){return/^#[0-9A-Fa-f]{2,}$/.test(r)}function d(r){return r.startsWith("rgb")}function N(r){return r.startsWith("hsl")}function a(r,o,t,n=""){return j(r)||O(r)||V(r)||d(r)||N(r)||z(r)||w(r)?t?`-[${n}${E(r,"all").replace(/['"]/g,"")}]`:`="[${n}${E(r,"all").replace(/['"]/g,"")}]"`:`-${o?o(r):r}`}function h(r){return typeof r=="string"&&r.endsWith("%")?r.slice(0,-1):+r*100}function I(r){return r.replace(/\s+/," ").split(" ").join("-")}function W(r){return r.replace(/\s+/," ").split(" ").join("_")}function E(r,o="around"){return o==="pre"?r.replace(/(^\s*)/g,""):o==="post"?r.replace(/(\s*$)/g,""):o==="all"?r.replace(/\s+/g,""):o==="around"?r.replace(/(^\s*)|(\s*$)/g,""):r}function i(r){return r=r.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(r)&&(r=r.replace(/rgba?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/hsl/.test(r)&&(r=r.replace(/hsla?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/var\([^\)]+\)/.test(r)&&(r=r.replace(/var\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),r.endsWith("!important")?[r.replace(/\s*\!important/,"").trim(),"!"]:[r.trim(),""]}function Br(r,o){let t=r.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return t[0]===n[0]}function Gr(r){return/<style scoped>[\n\s]*<\/style>/.test(r)}function Dr(r){let o=r.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function G(r){return r.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function w(r){return r.startsWith("var(--")}function Zr(r){return B.test(r)||K.test(r)}function qr(r){return V(r)||d(r)||N(r)}function C(r,o){let[t,n]=i(o);return`${r[0]}${a(t,c)}${n}`}var Jr=["background-color","background-attachment","background-position"],Kr=/linear-gradient\(\s*to([\w\s]+),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Or=/linear-gradient\(\s*([^,]*),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Qr=/(radial|conic)-gradient\(([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,v="__comma__";function Q(r,o){let[t,n]=i(o);if(r==="background-size")return`bg${a(t,U,!1,"length:")}${n}`;if(Jr.includes(r))return`bg${a(t,U)}${n}`;if(["background","background-image"].includes(r)){if(/(linear)-gradient/.test(t)){let m=t.replace(/rgba?\(([^)]+)\)/g,($,p)=>$.replace(p,p.replace(/\s*,\s*/g,v))),f=m.match(Kr);if(f){let[$,p,g,L]=f.slice(1);return $=$.split(" ").map(F=>F[0]).join(""),$?`bg-gradient-to-${$}${D(p,g,L)}`:D(p,g,L)}let l=m.match(Or);return l?`bg-gradient-linear bg-gradient-[${l[1]},${l[2].replace(/\s+/,"_").replaceAll(v,",")},${l[3].replace(/\s+/,"_").replaceAll(v,",")}]`:void 0}else if(/(radial|conic)-gradient/.test(t)){let f=t.replace(/rgba?\(([^)]+)\)/g,(L,F)=>L.replace(F,F.replace(/\s*,\s*/g,v))).match(Qr);if(!f)return;let l=f[1],[$,p,g]=f.slice(2);return`bg-gradient-${l}${D($,p,g)}`}let e=t.match(/rgba?\([^)]+\)/);if(e){let m=e[0];return`bg="${t.replace(m,`[${m}]`)}${n}"`}let s=t.match(/url\(["'\s\.\-_\w\/]*\)/);return s?`bg="${t.replace(s[0],`[${s[0].replace(/['"]/g,"")}]${n}`)}"`:`bg${a(t,U)}${n}`}return r==="background-blend-mode"?`bg-blend-${t}${n}`:`${Xr(r,t)}-${Yr(t)}${n}`}function Xr(r,o){return o.endsWith("repeat")?"bg":r.replace("background","bg")}function Yr(r){return/(border)|(content)|(padding)-box/.test(r)?r.replace("-box",""):r.startsWith("repeat-")?r.replace("repeat-",""):U(r)}function U(r){return r.replace(/\s+/," ").replace(" ","-")}function D(r,o,t){let n="";if(o&&!t&&(t=o,o=""),r){r=r.replaceAll(v,",");let[e,s]=r.split(" ");s?n+=` from="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` from="${d(e)?`[${e}]`:e}"`)}if(o){o=o.replaceAll(v,",");let[e,s]=o.split(" ");s?n+=` via="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` via="${d(e)?`[${e}]`:e}"`)}if(t){t=t.replaceAll(v,",");let[e,s]=t.split(" ");s?n+=` to="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` to="${d(e)?`[${e}]`:e}"`)}return n}function Z(r,o){let[t,n]=i(o),e=r.split("-"),s=j(t)||w(t)?a(t):a(c(t));return`${e[0]}-${e[1][0]}${s}${n}`}function X(r,o){let[t,n]=i(o);if(r==="font-size")return`text-${t}${n}`;if(r==="font-weight")return`font-${t}${n}`;if(r==="font-family"){let e=t.match(/ui-(\w{0,4})/);if(!e)return`font-${o}${n}`;let[s,m]=e;return`font-${m}${n}`}return r==="font-style"?t==="normal"?`font-not-italic${n}`:`font-${t}${n}`:r==="font-variant-numeric"?t==="normal"?`normal-nums${n}`:`${t}${n}`:`font="${yr(t)}${n}"`}function yr(r){return r.split(" ").map(o=>/^[0-9]/.test(o)?`text-${o}`:o).join(" ")}function Y(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}var kr={"margin-left":"ml","margin-right":"mr","margin-top":"mt","margin-bottom":"mb","margin-inline-start":"ms","margin-inline-end":"me","padding-left":"pl","padding-right":"pr","padding-top":"pt","padding-bottom":"pb","padding-inline-start":"ps","padding-inline-end":"pe"};function q(r,o){let[t,n]=i(o),e=kr[r];if(e)return`${e}${a(t)}${n}`;let s=t.split(" "),m=s.length;return m===1?`${r[0]}${a(s[0])}${n}`:m===2?`${r[0]}x${a(s[1])}${n} ${r[0]}y${a(s[0])}${n}`:m===3?`${r[0]}x${a(s[1])}${n} ${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n}`:`${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n} ${r[0]}l${a(s[3])}${n} ${r[0]}r${a(s[1])}${n}`}function y(r,o){let[t,n]=i(o);return z(o)?`op-${t.replace("%","")}${n}`:`op-${+t*100}${n}`}function k(r,o){let[t,n]=i(o);return`text${a(t)}${n}`}function rr(r,o){let[t,n]=i(o);return r==="text-decoration-line"?t==="none"?`no-underline${n}`:`${t}${n}`:r==="text-transform"?t==="none"?`normal-case${n}`:`${t}${n}`:r.startsWith("text-decoration")||r==="text-indent"?`${r.split("-")[1]}${a(t)}${n}`:r==="text-underline-offset"?`underline-offset-${t}${n}`:`text-${t}${n}`}function tr(r,o){let[t,n]=i(o);return`v-${t}${n}`}function nr(r,o){let[t,n]=i(o);return`lh${a(t)}${n}`}var rt=["border-left","border-top","border-right","border-bottom"];function or(r,o){let[t,n]=i(o);if(r==="border-spacing")return`${r}="[${W(t)}]${n}"`;if(r==="border-color"){if(t.includes(" ")){let e=t.split(" ").length,s=t.split(" ").map(p=>V(p)||d(p)||N(p)?`-[${p}]`:`-${p}`),[m,f,l,$]=s;switch(e){case 2:return`border-y${m}${n} border-x${f}${n}`;case 3:return`border-t${m}${n} border-b${l}${n} border-x${f}${n}`;case 4:return`border-t${m}${n} border-b${l}${n} border-r${f}${n} border-l${$}${n}`}}return`border${a(t)}${n}`}return r==="border-radius"?j(t)||!t.includes(" ")?`border-rd${a(t)}${n}`:`border-rd="[${W(t)}]${n}"`:rt.some(e=>r.startsWith(e))?t.split(" ").map(e=>`border-${r.split("-")[1][0]}${a(e)}${n}`).join(" "):r==="border-inline-end-width"?`border-e${a(t)}${n}`:r==="border-inline-start-width"?`border-s${a(t)}${n}`:r.startsWith("border-image")?"":/^\d[%|(px)|(rem)]$/.test(t)||r==="border-collapse"?`border-${t}${n}`:r==="border-width"||r==="border-style"?`border${a(t)}${n}`:r==="border-color"?t==="currentColor"?`border-current${n}`:`border${a(t)}${n}`:t.split(" ").map(e=>t==="currentColor"?`border-current${n}`:`border${a(e)}${n}`).join(" ")}function S(r,o){let[t,n]=i(o);return t==="none"?`hidden${n}`:t==="hidden"?`invisible${n}`:`${t}${n}`}function x(r,o){let[t,n]=i(o);return`${r}-${t}${n}`}function _(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}function b(r,o){let[t,n]=i(o);return`${c(r)}${a(t)}${n}`}function T(r,o){let[t,n]=i(o);return r.startsWith("box-decoration")?`box-decoration-${t}${n}`:r==="box-sizing"?`box-${c(t)}${n}`:`shadow="[${t.split(" ").join("_")}]${n}"`}var tt=["contrast","brightness","saturate"],nt=["grayscale","invert","sepia"];function R(r,o){let[t,n]=i(o),[e,s,m]=t.match(/([\w-]+)\((.*)\)/);return tt.includes(s)?`${s}-${h(m)}${n}`:s==="drop-shadow"?`drop-${T(s,m)}${n}`:nt.includes(s)?`${s}-${m.endsWith("%")?m.slice(0,-1):h(m)}${n}`:s==="hue-rotate"?`${s}-${m.slice(0,-3)}${n}`:`${s}-${m}${n}`}function ir(r,o){let[t,n]=i(o);return`backdrop-${R(r,t)}${n}`}function er(r,o){let[t,n]=i(o);return r==="transform-origin"?`origin-${I(t)}${n}`:r==="transform-style"?`transform-${t}`:G(t).split(" ").map(e=>{let s=e.match(/([a-z]+)([A-Z])?\((.*)\)/);if(!s)return;let[m,f,l,$]=s;if(l){let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}-${l.toLowerCase()}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):A(g)).join(" ")}${n}"`:`${f}="${l.toLowerCase()}-${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):A(p[0])}${n}"`}else{let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):A(g)).join(" ")}${n}"`:`${f}="${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):A(p[0])}${n}"`}}).filter(Boolean).join(" ")}function A(r){return r.endsWith("deg")?r.slice(0,-3):r}var ot=["transition-delay","transition-duration"];function sr(r,o){let[t,n]=i(o);if(r==="transition-timing-function")return t==="linear"?`ease-${t}${n}`:`ease="[${t}]${n}"`;if(r==="transition")return`transition="${it(t)}"`;if(r==="transition-property")return t.includes("color")?`transition-color${n}`:t==="box-shadow"?`transition-shadow${n}`:`transition-${t}${n}`;if(ot.includes(r))return`${r.split("-")[1]}-${t.slice(0,-2)}`}function it(r){let o=!1;return r.split(" ").map(t=>/^[0-9]/.test(t)||/^\.[0-9]/.test(t)?o?`delay${a(t,void 0,!0)}`:(o=!0,`duration${a(t,void 0,!0)}`):t==="background-color"?"colors":t).join(" ")}function ar(r,o){let[t,n]=i(o);return r==="justify-content"?`justify-${u(t)}${n}`:`${r}-${u(t)}${n}`}function mr(r,o){let[t,n]=i(o);return`${u(r)}-${u(t)}${n}`}var et=["flex-basis","flex-grow","flex-shrink"];function pr(r,o){let[t,n]=i(o);if(et.includes(r))return`${u(r)}-${t}${n}`;if(t==="1")return`flex-1${n}`;let e=t[0];return r==="flex"&&(e==="0"||e==="1")?`flex="[${W(t)}]${n}"`:`${c(r)}-${t.replace("column","col")}${n}`}function fr(r,o){let[t,n]=i(o);return t==="auto"?`${c(r)}-${t}`:`${c(r)}="[${t}]${n}"`}function cr(r,o){let[t,n]=i(o);return r==="column-gap"?`gap-x-${t}${n}`:`${r}-${t}${n}`}function ur(r,o){let[t,n]=i(o);return o==="isolate"?`${t}${n}`:`${r}-${t}${n}`}function lr(r,o){let[t,n]=i(o);return r==="object-position"?`${c(r)}-${I(t)}${n}`:`${c(r)}-${t}${n}`}function $r(r,o){let[t,n]=i(o),[e,s,m]=r.split("-");return m?`${e}-${m}-${t}${n}`:`${e}-${t}${n}`}function gr(r,o){let[t,n]=i(o);if(r.startsWith("grid-template")){let s=t.match(/repeat\s*\(\s*([0-9]+)/);return s?`grid-${u(r)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${u(r)==="rows"?"rows":"cols"}-${t}${n}`}if(r==="grid-auto-flow")return`grid-flow-${I(t).replace("column","col")}${n}`;if(r.startsWith("grid-auto")){let s=t.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${u(r)==="rows"?"rows":"cols"}-${s?"fr":c(t)}${n}`}let e=t.match(/span\s+([0-9])/);return e?`${r.slice(5).replace("column","col")}-span-${e[1]}${n}`:t==="1/-1"?`${r.slice(5).replace("column","col")}-span-full${n}`:`${r.slice(5).replace("column","col")}-${t}${n}`}function dr(r,o){let[t,n]=i(o);return`gap-y-${t}${n}`}function xr(r,o){let[t,n]=i(o);return`${r}-${u(t)}${n}`}function br(r,o){let[t,n]=i(o);return`tracking-${t}${n}`}function hr(r,o){let[t,n]=i(o);return`whitespace-${t}${n}`}function wr(r,o){let[t,n]=i(o);return r.startsWith("word-spacing")?`word-spacing${a(o)}`:t==="keep-all"?`break-keep${n}`:`break-${u(t)}${n}`}function Ir(r,o){let[t,n]=i(o);return r==="outline-offset"?`${r}-${t}${n}`:`${c(r)}-${t}${n}`}function vr(r,o){let[t,n]=i(o);return`mix-blend-${t}${n}`}var st={vertical:"y",horizontal:"x"};function jr(r,o){let[t,n]=i(o);return t==="both"?`${r}${n}`:`${r}-${st[t]||t}${n}`}function Wr(r,o){let[t,n]=i(o);if(r.startsWith("scroll-snap"))return`snap-${t}${n}`;if(r==="scroll-behavior")return`scroll-${t}${n}`;let[e,s,m,f]=r.match(/scroll-(margin|padding)-?([\w]+)?-?([\w]+)?/);return m==="inline"&&f?`scroll-${s[0]}${f[0]}-${t}${n}`:m?`scroll-${s[0]}${m[0]}-${t}${n}`:`scroll-${s[0]}-${t}${n}`}function _r(r,o){let[t,n]=i(o);return`${u(r)}-${t}${n}`}function Vr(r,o){let[t,n]=i(o);return`${r}-${c(t)}${n}`}function Nr(r,o){let[t,n]=i(o);return r==="animation-delay"?`animate${a(t)}${n}`:r==="animation"?`animate-${t.split(" ")[0]}${n}`:`animate-${t}${n}`}function Lr(r,o){let[t,n]=i(o);return t==='" "'||t==="' '"?`content-['_']${n}`:`content="[${t}]${n}"`}var at={show:"visible",hide:"hidden"};function Fr(r,o){var e;let[t,n]=i(o);return`table-empty-cells-${(e=at[t])!=null?e:t}${n}`}function zr(r,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}function Cr(r,o){let[t,n]=i(o);if(r==="inset-inline-start")return`start${a(t)}${n}`;if(r==="inset-inline-end")return`end${a(t)}${n}`}var J={animation:Nr,aspect:fr,backface:b,caption:b,column:cr,columns:x,break:x,empty:Fr,box:T,writing:zr,display:S,float:x,clear:x,isolation:ur,object:lr,overflow:x,overscroll:$r,position:S,top:_,left:_,right:_,bottom:_,visibility:S,z:C,flex:pr,order:x,grid:gr,gap:_,justify:ar,align:mr,place:xr,padding:q,perspective:x,margin:q,width:C,min:Z,max:Z,height:C,font:X,letter:br,line:nr,list:b,text:rr,vertical:tr,white:hr,word:wr,content:Lr,background:Q,border:or,outline:Ir,opacity:y,mix:vr,filter:R,backdrop:ir,table:b,transition:sr,transform:er,accent:b,appearance:b,cursor:Y,caret:b,pointer:x,resize:jr,scroll:Wr,inset:Cr,touch:b,user:_r,will:Vr,fill:x,stroke:b,color:k,row:dr},mt=/([\w-]+)\s*:\s*([.\w\(\)-\s%+'",#\/!]+)/;function H(r,o=!1){var l;let t=r.match(mt);if(!t)return;let[n,e,s]=t,m=c(e),f=(l=J[m])==null?void 0:l.call(J,e,s);return f&&o?f.replace(/-([0-9\.]+)px/,($,p)=>`-${+p/4}`):f}function P(r,o){let t=[];return[r.split(";").filter(Boolean).reduce((n,e)=>{let s=H(e,o)||"";return s||t.push(e),n+=`${s} `},"").trim(),t]}function Ur(r,o=!1){let[t,n]=P(r,o);return[t?t.replace(/="([^"]+)"/g,(e,s)=>`-${s}`):"",n]}0&&(module.exports={cssMathFnRE,diffTemplateStyle,flag,getFirstName,getHundred,getLastName,getStyleScoped,getVal,isCalc,isColor,isEmptyStyle,isHex,isHsl,isNot,isPercent,isRgb,isSize,isUrl,isVar,joinEmpty,joinWithLine,joinWithUnderLine,numberWithUnitRE,toUnocss,toUnocssClass,transformImportant,transformStyleToUnocss,trim});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var Qr=".__unocss_transfer__",G=/^(?:calc|clamp|min|max)\s*\(.*\)/,Lr=/[0-9]+(px|rem|em|%|vw|vh|vmin|vmax|deg)/;function Xr(r){return/\[&:not\(/.test(r)}function v(r){return G.test(r)}function f(r){return r.split("-")[0]}function u(r){let o=r.split("-");return o[o.length-1]}function Fr(r){return r.startsWith("url(")}function S(r){return r.endsWith("%")}function N(r){return/^#[0-9A-Fa-f]{2,}$/.test(r)}function g(r){return r.startsWith("rgb")}function L(r){return r.startsWith("hsl")}function a(r,o,t){return v(r)||Fr(r)||N(r)||g(r)||L(r)||S(r)||Cr(r)?t?`-[${B(r,"all").replace(/['"]/g,"")}]`:`="[${B(r,"all").replace(/['"]/g,"")}]"`:`-${o?o(r):r}`}function h(r){return typeof r=="string"&&r.endsWith("%")?r.slice(0,-1):+r*100}function w(r){return r.replace(/\s+/," ").split(" ").join("-")}function j(r){return r.replace(/\s+/," ").split(" ").join("_")}function B(r,o="around"){return o==="pre"?r.replace(/(^\s*)/g,""):o==="post"?r.replace(/(\s*$)/g,""):o==="all"?r.replace(/\s+/g,""):o==="around"?r.replace(/(^\s*)|(\s*$)/g,""):r}function i(r){return r=r.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(r)&&(r=r.replace(/rgba?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/hsl/.test(r)&&(r=r.replace(/hsla?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/var\([^\)]+\)/.test(r)&&(r=r.replace(/var\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),r.endsWith("!important")?[r.replace(/\s*\!important/,"").trim(),"!"]:[r.trim(),""]}function Yr(r,o){let t=r.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return t[0]===n[0]}function yr(r){return/<style scoped>[\n\s]*<\/style>/.test(r)}function kr(r){let o=r.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function D(r){return r.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function Cr(r){return r.startsWith("var(--")}function rt(r){return G.test(r)||Lr.test(r)}function tt(r){return N(r)||g(r)||L(r)}function F(r,o){let[t,n]=i(o);return`${r[0]}${a(t,f)}${n}`}var zr=["background-color","background-size","background-attachment","background-position"],Ur=/linear-gradient\(\s*to([\w\s]+),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Sr=/linear-gradient\(\s*([^,]*),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Tr=/(radial|conic)-gradient\(([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,b="__comma__";function Z(r,o){let[t,n]=i(o);if(zr.includes(r))return`bg${a(t,R)}${n}`;if(["background","background-image"].includes(r)){if(/(linear)-gradient/.test(t)){let m=t.replace(/rgba?\(([^)]+)\)/g,(c,$)=>c.replace($,$.replace(/\s*,\s*/g,b))),p=m.match(Ur);if(p){let[c,$,W,_]=p.slice(1);return c=c.split(" ").map(V=>V[0]).join(""),c?`bg-gradient-to-${c}${T($,W,_)}`:T($,W,_)}let l=m.match(Sr);return l?`bg-gradient-linear bg-gradient-[${l[1]},${l[2].replace(/\s+/,"_").replaceAll(b,",")},${l[3].replace(/\s+/,"_").replaceAll(b,",")}]`:void 0}else if(/(radial|conic)-gradient/.test(t)){let p=t.replace(/rgba?\(([^)]+)\)/g,(_,V)=>_.replace(V,V.replace(/\s*,\s*/g,b))).match(Tr);if(!p)return;let l=p[1],[c,$,W]=p.slice(2);return`bg-gradient-${l}${T(c,$,W)}`}let e=t.match(/rgba?\([^)]+\)/);if(e){let m=e[0];return`bg="${t.replace(m,`[${m}]`)}${n}"`}let s=t.match(/url\(["'\s\.\-_\w\/]*\)/);return s?`bg="${t.replace(s[0],`[${s[0].replace(/['"]/g,"")}]${n}`)}"`:`bg${a(t,R)}${n}`}return r==="background-blend-mode"?`bg-blend-${t}${n}`:`${Rr(r,t)}-${Ar(t)}${n}`}function Rr(r,o){return o.endsWith("repeat")?"bg":r.replace("background","bg")}function Ar(r){return/(border)|(content)|(padding)-box/.test(r)?r.replace("-box",""):r.startsWith("repeat-")?r.replace("repeat-",""):R(r)}function R(r){return r.replace(/\s+/," ").replace(" ","-")}function T(r,o,t){let n="";if(o&&!t&&(t=o,o=""),r){r=r.replaceAll(b,",");let[e,s]=r.split(" ");s?n+=` from="${g(e)?`[${e}]`:e} ${s}"`:e&&(n+=` from="${g(e)?`[${e}]`:e}"`)}if(o){o=o.replaceAll(b,",");let[e,s]=o.split(" ");s?n+=` via="${g(e)?`[${e}]`:e} ${s}"`:e&&(n+=` via="${g(e)?`[${e}]`:e}"`)}if(t){t=t.replaceAll(b,",");let[e,s]=t.split(" ");s?n+=` to="${g(e)?`[${e}]`:e} ${s}"`:e&&(n+=` to="${g(e)?`[${e}]`:e}"`)}return n}function A(r,o){let[t,n]=i(o),e=r.split("-"),s=v(t)?a(t):a(f(t));return`${e[0]}-${e[1][0]}${s}${n}`}function q(r,o){let[t,n]=i(o);if(r==="font-size")return`text-${t}${n}`;if(r==="font-weight")return`font-${t}${n}`;if(r==="font-family"){let e=t.match(/ui-(\w{0,4})/);if(!e)return`font-${o}${n}`;let[s,m]=e;return`font-${m}${n}`}return r==="font-style"?t==="normal"?`font-not-italic${n}`:`font-${t}${n}`:r==="font-variant-numeric"?t==="normal"?`normal-nums${n}`:`${t}${n}`:`font="${Hr(t)}${n}"`}function Hr(r){return r.split(" ").map(o=>/^[0-9]/.test(o)?`text-${o}`:o).join(" ")}function J(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}var Pr={"margin-left":"ml","margin-right":"mr","margin-top":"mt","margin-bottom":"mb","margin-inline-start":"ms","margin-inline-end":"me","padding-left":"pl","padding-right":"pr","padding-top":"pt","padding-bottom":"pb","padding-inline-start":"ps","padding-inline-end":"pe"};function H(r,o){let[t,n]=i(o),e=Pr[r];if(e)return`${e}${a(t)}${n}`;let s=t.split(" "),m=s.length;return m===1?`${r[0]}${a(s[0])}${n}`:m===2?`${r[0]}x${a(s[1])}${n} ${r[0]}y${a(s[0])}${n}`:m===3?`${r[0]}x${a(s[1])}${n} ${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n}`:`${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n} ${r[0]}l${a(s[3])}${n} ${r[0]}r${a(s[1])}${n}`}function K(r,o){let[t,n]=i(o);return S(o)?`op-${t.replace("%","")}${n}`:`op-${+t*100}${n}`}function O(r,o){let[t,n]=i(o);return`text${a(t)}${n}`}function Q(r,o){let[t,n]=i(o);return r==="text-decoration-line"?t==="none"?`no-underline${n}`:`${t}${n}`:r==="text-transform"?t==="none"?`normal-case${n}`:`${t}${n}`:r.startsWith("text-decoration")||r==="text-indent"?`${r.split("-")[1]}${a(t)}${n}`:r==="text-underline-offset"?`underline-offset-${t}${n}`:`text-${t}${n}`}function X(r,o){let[t,n]=i(o);return`v-${t}${n}`}function Y(r,o){let[t,n]=i(o);return`lh${a(t)}${n}`}var Mr=["border-left","border-top","border-right","border-bottom"];function y(r,o){let[t,n]=i(o);if(r==="border-spacing")return`${r}="[${j(t)}]${n}"`;if(r==="border-color"){if(t.includes(" ")){let e=t.split(" ").length,s=t.split(" ").map($=>N($)||g($)||L($)?`-[${$}]`:`-${$}`),[m,p,l,c]=s;switch(e){case 2:return`border-y${m}${n} border-x${p}${n}`;case 3:return`border-t${m}${n} border-b${l}${n} border-x${p}${n}`;case 4:return`border-t${m}${n} border-b${l}${n} border-r${p}${n} border-l${c}${n}`}}return`border${a(t)}${n}`}return r==="border-radius"?v(t)||!t.includes(" ")?`border-rd${a(t)}${n}`:`border-rd="[${j(t)}]${n}"`:Mr.some(e=>r.startsWith(e))?t.split(" ").map(e=>`border-${r.split("-")[1][0]}${a(e)}${n}`).join(" "):r==="border-inline-end-width"?`border-e${a(t)}${n}`:r==="border-inline-start-width"?`border-s${a(t)}${n}`:r.startsWith("border-image")?"":/^\d[%|(px)|(rem)]$/.test(t)||r==="border-collapse"?`border-${t}${n}`:r==="border-width"||r==="border-style"?`border${a(t)}${n}`:r==="border-color"?t==="currentColor"?`border-current${n}`:`border${a(t)}${n}`:t.split(" ").map(e=>t==="currentColor"?`border-current${n}`:`border${a(e)}${n}`).join(" ")}function C(r,o){let[t,n]=i(o);return t==="none"?`hidden${n}`:t==="hidden"?`invisible${n}`:`${t}${n}`}function d(r,o){let[t,n]=i(o);return`${r}-${t}${n}`}function I(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}function x(r,o){let[t,n]=i(o);return`${f(r)}${a(t)}${n}`}function z(r,o){let[t,n]=i(o);return r.startsWith("box-decoration")?`box-decoration-${t}${n}`:r==="box-sizing"?`box-${f(t)}${n}`:`shadow="[${t.split(" ").join("_")}]${n}"`}var Er=["contrast","brightness","saturate"],Br=["grayscale","invert","sepia"];function U(r,o){let[t,n]=i(o),[e,s,m]=t.match(/([\w-]+)\((.*)\)/);return Er.includes(s)?`${s}-${h(m)}${n}`:s==="drop-shadow"?`drop-${z(s,m)}${n}`:Br.includes(s)?`${s}-${m.endsWith("%")?m.slice(0,-1):h(m)}${n}`:s==="hue-rotate"?`${s}-${m.slice(0,-3)}${n}`:`${s}-${m}${n}`}function k(r,o){let[t,n]=i(o);return`backdrop-${U(r,t)}${n}`}function tr(r,o){let[t,n]=i(o);return r==="transform-origin"?`origin-${w(t)}${n}`:r==="transform-style"?`transform-${t}`:D(t).split(" ").map(e=>{let s=e.match(/([a-z]+)([A-Z])?\((.*)\)/);if(!s)return;let[m,p,l,c]=s;return l?p==="scale"?c.includes(",")?`${p}-${l.toLowerCase()}="${c.split(",").join(" ")}${n}"`:`${p}-${l.toLowerCase()}-${h(c)}${n}`:`${p}-${l.toLowerCase()}="${rr(c)}${n}"`:p==="scale"?c.includes(",")?`${p}="${c.split(",").join(" ")}${n}"`:`${p}-${h(c)}${n}`:`${p}="${rr(c).replace(/,/g," ")}${n}"`}).filter(Boolean).join(" ")}function rr(r){return r.endsWith("deg")?r.slice(0,-3):r}var Gr=["transition-delay","transition-duration"];function nr(r,o){let[t,n]=i(o);if(r==="transition-timing-function")return t==="linear"?`ease-${t}${n}`:`ease="[${t}]${n}"`;if(r==="transition")return`transition="${Dr(t)}"`;if(r==="transition-property")return t.includes("color")?`transition-color${n}`:t==="box-shadow"?`transition-shadow${n}`:`transition-${t}${n}`;if(Gr.includes(r))return`${r.split("-")[1]}-${t.slice(0,-2)}`}function Dr(r){let o=!1;return r.split(" ").map(t=>/^[0-9]/.test(t)||/^\.[0-9]/.test(t)?o?`delay${a(t,void 0,!0)}`:(o=!0,`duration${a(t,void 0,!0)}`):t==="background-color"?"colors":t).join(" ")}function or(r,o){let[t,n]=i(o);return r==="justify-content"?`justify-${u(t)}${n}`:`${r}-${u(t)}${n}`}function ir(r,o){let[t,n]=i(o);return`${u(r)}-${u(t)}${n}`}var Zr=["flex-basis","flex-grow","flex-shrink"];function er(r,o){let[t,n]=i(o);if(Zr.includes(r))return`${u(r)}-${t}${n}`;if(t==="1")return`flex-1${n}`;let e=t[0];return r==="flex"&&(e==="0"||e==="1")?`flex="[${j(t)}]${n}"`:`${f(r)}-${t.replace("column","col")}${n}`}function sr(r,o){let[t,n]=i(o);return t==="auto"?`${f(r)}-${t}`:`${f(r)}="[${t}]${n}"`}function ar(r,o){let[t,n]=i(o);return r==="column-gap"?`gap-x-${t}${n}`:`${r}-${t}${n}`}function mr(r,o){let[t,n]=i(o);return o==="isolate"?`${t}${n}`:`${r}-${t}${n}`}function pr(r,o){let[t,n]=i(o);return r==="object-position"?`${f(r)}-${w(t)}${n}`:`${f(r)}-${t}${n}`}function fr(r,o){let[t,n]=i(o),[e,s,m]=r.split("-");return m?`${e}-${m}-${t}${n}`:`${e}-${t}${n}`}function cr(r,o){let[t,n]=i(o);if(r.startsWith("grid-template")){let s=t.match(/repeat\s*\(\s*([0-9]+)/);return s?`grid-${u(r)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${u(r)==="rows"?"rows":"cols"}-${t}${n}`}if(r==="grid-auto-flow")return`grid-flow-${w(t).replace("column","col")}${n}`;if(r.startsWith("grid-auto")){let s=t.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${u(r)==="rows"?"rows":"cols"}-${s?"fr":f(t)}${n}`}let e=t.match(/span\s+([0-9])/);return e?`${r.slice(5).replace("column","col")}-span-${e[1]}${n}`:t==="1/-1"?`${r.slice(5).replace("column","col")}-span-full${n}`:`${r.slice(5).replace("column","col")}-${t}${n}`}function ur(r,o){let[t,n]=i(o);return`gap-y-${t}${n}`}function lr(r,o){let[t,n]=i(o);return`${r}-${u(t)}${n}`}function $r(r,o){let[t,n]=i(o);return`tracking-${t}${n}`}function gr(r,o){let[t,n]=i(o);return`whitespace-${t}${n}`}function dr(r,o){let[t,n]=i(o);return r.startsWith("word-spacing")?`word-spacing${a(o)}`:t==="keep-all"?`break-keep${n}`:`break-${u(t)}${n}`}function xr(r,o){let[t,n]=i(o);return r==="outline-offset"?`${r}-${t}${n}`:`${f(r)}-${t}${n}`}function br(r,o){let[t,n]=i(o);return`mix-blend-${t}${n}`}var qr={vertical:"y",horizontal:"x"};function hr(r,o){let[t,n]=i(o);return t==="both"?`${r}${n}`:`${r}-${qr[t]||t}${n}`}function wr(r,o){let[t,n]=i(o);if(r.startsWith("scroll-snap"))return`snap-${t}${n}`;if(r==="scroll-behavior")return`scroll-${t}${n}`;let[e,s,m,p]=r.match(/scroll-(margin|padding)-?([\w]+)?-?([\w]+)?/);return m==="inline"&&p?`scroll-${s[0]}${p[0]}-${t}${n}`:m?`scroll-${s[0]}${m[0]}-${t}${n}`:`scroll-${s[0]}-${t}${n}`}function Ir(r,o){let[t,n]=i(o);return`${u(r)}-${t}${n}`}function vr(r,o){let[t,n]=i(o);return`${r}-${f(t)}${n}`}function jr(r,o){let[t,n]=i(o);return r==="animation-delay"?`animate${a(t)}${n}`:r==="animation"?`animate-${t.split(" ")[0]}${n}`:`animate-${t}${n}`}function Wr(r,o){let[t,n]=i(o);return t==='" "'||t==="' '"?`content-['_']${n}`:`content="[${t}]${n}"`}var Jr={show:"visible",hide:"hidden"};function _r(r,o){var e;let[t,n]=i(o);return`table-empty-cells-${(e=Jr[t])!=null?e:t}${n}`}function Vr(r,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}function Nr(r,o){let[t,n]=i(o);if(r==="inset-inline-start")return`start${a(t)}${n}`;if(r==="inset-inline-end")return`end${a(t)}${n}`}var P={animation:jr,aspect:sr,backface:x,caption:x,column:ar,columns:d,break:d,empty:_r,box:z,writing:Vr,display:C,float:d,clear:d,isolation:mr,object:pr,overflow:d,overscroll:fr,position:C,top:I,left:I,right:I,bottom:I,visibility:C,z:F,flex:er,order:d,grid:cr,gap:I,justify:or,align:ir,place:lr,padding:H,perspective:d,margin:H,width:F,min:A,max:A,height:F,font:q,letter:$r,line:Y,list:x,text:Q,vertical:X,white:gr,word:dr,content:Wr,background:Z,border:y,outline:xr,opacity:K,mix:br,filter:U,backdrop:k,table:x,transition:nr,transform:tr,accent:x,appearance:x,cursor:J,caret:x,pointer:d,resize:hr,scroll:wr,inset:Nr,touch:x,user:Ir,will:vr,fill:d,stroke:x,color:O,row:ur},Kr=/([\w-]+)\s*:\s*([.\w\(\)-\s%+'",#\/!]+)/;function M(r,o=!1){var l;let t=r.match(Kr);if(!t)return;let[n,e,s]=t,m=f(e),p=(l=P[m])==null?void 0:l.call(P,e,s);return p&&o?p.replace(/-([0-9\.]+)px/,(c,$)=>`-${+$/4}`):p}function E(r,o){let t=[];return[r.split(";").filter(Boolean).reduce((n,e)=>{let s=M(e,o)||"";return s||t.push(e),n+=`${s} `},"").trim(),t]}function Or(r,o=!1){let[t,n]=E(r,o);return[t?t.replace(/="([^"]+)"/g,(e,s)=>`-${s}`):"",n]}export{G as cssMathFnRE,Yr as diffTemplateStyle,Qr as flag,f as getFirstName,h as getHundred,u as getLastName,kr as getStyleScoped,a as getVal,v as isCalc,tt as isColor,yr as isEmptyStyle,N as isHex,L as isHsl,Xr as isNot,S as isPercent,g as isRgb,rt as isSize,Fr as isUrl,Cr as isVar,D as joinEmpty,w as joinWithLine,j as joinWithUnderLine,Lr as numberWithUnitRE,M as toUnocss,Or as toUnocssClass,i as transformImportant,E as transformStyleToUnocss,B as trim};
1
+ var Qr=".__unocss_transfer__",Z=/^(?:calc|clamp|min|max)\s*\(.*\)/,Fr=/[0-9]+(px|rem|em|%|vw|vh|vmin|vmax|deg)/;function Xr(r){return/\[&:not\(/.test(r)}function W(r){return Z.test(r)}function c(r){return r.split("-")[0]}function u(r){let o=r.split("-");return o[o.length-1]}function zr(r){return r.startsWith("url(")}function A(r){return r.endsWith("%")}function L(r){return/^#[0-9A-Fa-f]{2,}$/.test(r)}function d(r){return r.startsWith("rgb")}function F(r){return r.startsWith("hsl")}function a(r,o,t,n=""){return W(r)||zr(r)||L(r)||d(r)||F(r)||A(r)||w(r)?t?`-[${n}${D(r,"all").replace(/['"]/g,"")}]`:`="[${n}${D(r,"all").replace(/['"]/g,"")}]"`:`-${o?o(r):r}`}function h(r){return typeof r=="string"&&r.endsWith("%")?r.slice(0,-1):+r*100}function v(r){return r.replace(/\s+/," ").split(" ").join("-")}function _(r){return r.replace(/\s+/," ").split(" ").join("_")}function D(r,o="around"){return o==="pre"?r.replace(/(^\s*)/g,""):o==="post"?r.replace(/(\s*$)/g,""):o==="all"?r.replace(/\s+/g,""):o==="around"?r.replace(/(^\s*)|(\s*$)/g,""):r}function i(r){return r=r.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(r)&&(r=r.replace(/rgba?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/hsl/.test(r)&&(r=r.replace(/hsla?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/var\([^\)]+\)/.test(r)&&(r=r.replace(/var\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),r.endsWith("!important")?[r.replace(/\s*\!important/,"").trim(),"!"]:[r.trim(),""]}function Yr(r,o){let t=r.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return t[0]===n[0]}function yr(r){return/<style scoped>[\n\s]*<\/style>/.test(r)}function kr(r){let o=r.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function q(r){return r.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function w(r){return r.startsWith("var(--")}function rt(r){return Z.test(r)||Fr.test(r)}function tt(r){return L(r)||d(r)||F(r)}function z(r,o){let[t,n]=i(o);return`${r[0]}${a(t,c)}${n}`}var Cr=["background-color","background-attachment","background-position"],Ur=/linear-gradient\(\s*to([\w\s]+),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Sr=/linear-gradient\(\s*([^,]*),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Tr=/(radial|conic)-gradient\(([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,I="__comma__";function J(r,o){let[t,n]=i(o);if(r==="background-size")return`bg${a(t,C,!1,"length:")}${n}`;if(Cr.includes(r))return`bg${a(t,C)}${n}`;if(["background","background-image"].includes(r)){if(/(linear)-gradient/.test(t)){let m=t.replace(/rgba?\(([^)]+)\)/g,($,p)=>$.replace(p,p.replace(/\s*,\s*/g,I))),f=m.match(Ur);if(f){let[$,p,g,V]=f.slice(1);return $=$.split(" ").map(N=>N[0]).join(""),$?`bg-gradient-to-${$}${H(p,g,V)}`:H(p,g,V)}let l=m.match(Sr);return l?`bg-gradient-linear bg-gradient-[${l[1]},${l[2].replace(/\s+/,"_").replaceAll(I,",")},${l[3].replace(/\s+/,"_").replaceAll(I,",")}]`:void 0}else if(/(radial|conic)-gradient/.test(t)){let f=t.replace(/rgba?\(([^)]+)\)/g,(V,N)=>V.replace(N,N.replace(/\s*,\s*/g,I))).match(Tr);if(!f)return;let l=f[1],[$,p,g]=f.slice(2);return`bg-gradient-${l}${H($,p,g)}`}let e=t.match(/rgba?\([^)]+\)/);if(e){let m=e[0];return`bg="${t.replace(m,`[${m}]`)}${n}"`}let s=t.match(/url\(["'\s\.\-_\w\/]*\)/);return s?`bg="${t.replace(s[0],`[${s[0].replace(/['"]/g,"")}]${n}`)}"`:`bg${a(t,C)}${n}`}return r==="background-blend-mode"?`bg-blend-${t}${n}`:`${Rr(r,t)}-${Ar(t)}${n}`}function Rr(r,o){return o.endsWith("repeat")?"bg":r.replace("background","bg")}function Ar(r){return/(border)|(content)|(padding)-box/.test(r)?r.replace("-box",""):r.startsWith("repeat-")?r.replace("repeat-",""):C(r)}function C(r){return r.replace(/\s+/," ").replace(" ","-")}function H(r,o,t){let n="";if(o&&!t&&(t=o,o=""),r){r=r.replaceAll(I,",");let[e,s]=r.split(" ");s?n+=` from="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` from="${d(e)?`[${e}]`:e}"`)}if(o){o=o.replaceAll(I,",");let[e,s]=o.split(" ");s?n+=` via="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` via="${d(e)?`[${e}]`:e}"`)}if(t){t=t.replaceAll(I,",");let[e,s]=t.split(" ");s?n+=` to="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` to="${d(e)?`[${e}]`:e}"`)}return n}function P(r,o){let[t,n]=i(o),e=r.split("-"),s=W(t)||w(t)?a(t):a(c(t));return`${e[0]}-${e[1][0]}${s}${n}`}function K(r,o){let[t,n]=i(o);if(r==="font-size")return`text-${t}${n}`;if(r==="font-weight")return`font-${t}${n}`;if(r==="font-family"){let e=t.match(/ui-(\w{0,4})/);if(!e)return`font-${o}${n}`;let[s,m]=e;return`font-${m}${n}`}return r==="font-style"?t==="normal"?`font-not-italic${n}`:`font-${t}${n}`:r==="font-variant-numeric"?t==="normal"?`normal-nums${n}`:`${t}${n}`:`font="${Hr(t)}${n}"`}function Hr(r){return r.split(" ").map(o=>/^[0-9]/.test(o)?`text-${o}`:o).join(" ")}function O(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}var Pr={"margin-left":"ml","margin-right":"mr","margin-top":"mt","margin-bottom":"mb","margin-inline-start":"ms","margin-inline-end":"me","padding-left":"pl","padding-right":"pr","padding-top":"pt","padding-bottom":"pb","padding-inline-start":"ps","padding-inline-end":"pe"};function M(r,o){let[t,n]=i(o),e=Pr[r];if(e)return`${e}${a(t)}${n}`;let s=t.split(" "),m=s.length;return m===1?`${r[0]}${a(s[0])}${n}`:m===2?`${r[0]}x${a(s[1])}${n} ${r[0]}y${a(s[0])}${n}`:m===3?`${r[0]}x${a(s[1])}${n} ${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n}`:`${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n} ${r[0]}l${a(s[3])}${n} ${r[0]}r${a(s[1])}${n}`}function Q(r,o){let[t,n]=i(o);return A(o)?`op-${t.replace("%","")}${n}`:`op-${+t*100}${n}`}function X(r,o){let[t,n]=i(o);return`text${a(t)}${n}`}function Y(r,o){let[t,n]=i(o);return r==="text-decoration-line"?t==="none"?`no-underline${n}`:`${t}${n}`:r==="text-transform"?t==="none"?`normal-case${n}`:`${t}${n}`:r.startsWith("text-decoration")||r==="text-indent"?`${r.split("-")[1]}${a(t)}${n}`:r==="text-underline-offset"?`underline-offset-${t}${n}`:`text-${t}${n}`}function y(r,o){let[t,n]=i(o);return`v-${t}${n}`}function k(r,o){let[t,n]=i(o);return`lh${a(t)}${n}`}var Mr=["border-left","border-top","border-right","border-bottom"];function rr(r,o){let[t,n]=i(o);if(r==="border-spacing")return`${r}="[${_(t)}]${n}"`;if(r==="border-color"){if(t.includes(" ")){let e=t.split(" ").length,s=t.split(" ").map(p=>L(p)||d(p)||F(p)?`-[${p}]`:`-${p}`),[m,f,l,$]=s;switch(e){case 2:return`border-y${m}${n} border-x${f}${n}`;case 3:return`border-t${m}${n} border-b${l}${n} border-x${f}${n}`;case 4:return`border-t${m}${n} border-b${l}${n} border-r${f}${n} border-l${$}${n}`}}return`border${a(t)}${n}`}return r==="border-radius"?W(t)||!t.includes(" ")?`border-rd${a(t)}${n}`:`border-rd="[${_(t)}]${n}"`:Mr.some(e=>r.startsWith(e))?t.split(" ").map(e=>`border-${r.split("-")[1][0]}${a(e)}${n}`).join(" "):r==="border-inline-end-width"?`border-e${a(t)}${n}`:r==="border-inline-start-width"?`border-s${a(t)}${n}`:r.startsWith("border-image")?"":/^\d[%|(px)|(rem)]$/.test(t)||r==="border-collapse"?`border-${t}${n}`:r==="border-width"||r==="border-style"?`border${a(t)}${n}`:r==="border-color"?t==="currentColor"?`border-current${n}`:`border${a(t)}${n}`:t.split(" ").map(e=>t==="currentColor"?`border-current${n}`:`border${a(e)}${n}`).join(" ")}function U(r,o){let[t,n]=i(o);return t==="none"?`hidden${n}`:t==="hidden"?`invisible${n}`:`${t}${n}`}function x(r,o){let[t,n]=i(o);return`${r}-${t}${n}`}function j(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}function b(r,o){let[t,n]=i(o);return`${c(r)}${a(t)}${n}`}function S(r,o){let[t,n]=i(o);return r.startsWith("box-decoration")?`box-decoration-${t}${n}`:r==="box-sizing"?`box-${c(t)}${n}`:`shadow="[${t.split(" ").join("_")}]${n}"`}var Er=["contrast","brightness","saturate"],Br=["grayscale","invert","sepia"];function T(r,o){let[t,n]=i(o),[e,s,m]=t.match(/([\w-]+)\((.*)\)/);return Er.includes(s)?`${s}-${h(m)}${n}`:s==="drop-shadow"?`drop-${S(s,m)}${n}`:Br.includes(s)?`${s}-${m.endsWith("%")?m.slice(0,-1):h(m)}${n}`:s==="hue-rotate"?`${s}-${m.slice(0,-3)}${n}`:`${s}-${m}${n}`}function tr(r,o){let[t,n]=i(o);return`backdrop-${T(r,t)}${n}`}function nr(r,o){let[t,n]=i(o);return r==="transform-origin"?`origin-${v(t)}${n}`:r==="transform-style"?`transform-${t}`:q(t).split(" ").map(e=>{let s=e.match(/([a-z]+)([A-Z])?\((.*)\)/);if(!s)return;let[m,f,l,$]=s;if(l){let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}-${l.toLowerCase()}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):R(g)).join(" ")}${n}"`:`${f}="${l.toLowerCase()}-${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):R(p[0])}${n}"`}else{let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):R(g)).join(" ")}${n}"`:`${f}="${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):R(p[0])}${n}"`}}).filter(Boolean).join(" ")}function R(r){return r.endsWith("deg")?r.slice(0,-3):r}var Gr=["transition-delay","transition-duration"];function or(r,o){let[t,n]=i(o);if(r==="transition-timing-function")return t==="linear"?`ease-${t}${n}`:`ease="[${t}]${n}"`;if(r==="transition")return`transition="${Dr(t)}"`;if(r==="transition-property")return t.includes("color")?`transition-color${n}`:t==="box-shadow"?`transition-shadow${n}`:`transition-${t}${n}`;if(Gr.includes(r))return`${r.split("-")[1]}-${t.slice(0,-2)}`}function Dr(r){let o=!1;return r.split(" ").map(t=>/^[0-9]/.test(t)||/^\.[0-9]/.test(t)?o?`delay${a(t,void 0,!0)}`:(o=!0,`duration${a(t,void 0,!0)}`):t==="background-color"?"colors":t).join(" ")}function ir(r,o){let[t,n]=i(o);return r==="justify-content"?`justify-${u(t)}${n}`:`${r}-${u(t)}${n}`}function er(r,o){let[t,n]=i(o);return`${u(r)}-${u(t)}${n}`}var Zr=["flex-basis","flex-grow","flex-shrink"];function sr(r,o){let[t,n]=i(o);if(Zr.includes(r))return`${u(r)}-${t}${n}`;if(t==="1")return`flex-1${n}`;let e=t[0];return r==="flex"&&(e==="0"||e==="1")?`flex="[${_(t)}]${n}"`:`${c(r)}-${t.replace("column","col")}${n}`}function ar(r,o){let[t,n]=i(o);return t==="auto"?`${c(r)}-${t}`:`${c(r)}="[${t}]${n}"`}function mr(r,o){let[t,n]=i(o);return r==="column-gap"?`gap-x-${t}${n}`:`${r}-${t}${n}`}function pr(r,o){let[t,n]=i(o);return o==="isolate"?`${t}${n}`:`${r}-${t}${n}`}function fr(r,o){let[t,n]=i(o);return r==="object-position"?`${c(r)}-${v(t)}${n}`:`${c(r)}-${t}${n}`}function cr(r,o){let[t,n]=i(o),[e,s,m]=r.split("-");return m?`${e}-${m}-${t}${n}`:`${e}-${t}${n}`}function ur(r,o){let[t,n]=i(o);if(r.startsWith("grid-template")){let s=t.match(/repeat\s*\(\s*([0-9]+)/);return s?`grid-${u(r)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${u(r)==="rows"?"rows":"cols"}-${t}${n}`}if(r==="grid-auto-flow")return`grid-flow-${v(t).replace("column","col")}${n}`;if(r.startsWith("grid-auto")){let s=t.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${u(r)==="rows"?"rows":"cols"}-${s?"fr":c(t)}${n}`}let e=t.match(/span\s+([0-9])/);return e?`${r.slice(5).replace("column","col")}-span-${e[1]}${n}`:t==="1/-1"?`${r.slice(5).replace("column","col")}-span-full${n}`:`${r.slice(5).replace("column","col")}-${t}${n}`}function lr(r,o){let[t,n]=i(o);return`gap-y-${t}${n}`}function $r(r,o){let[t,n]=i(o);return`${r}-${u(t)}${n}`}function gr(r,o){let[t,n]=i(o);return`tracking-${t}${n}`}function dr(r,o){let[t,n]=i(o);return`whitespace-${t}${n}`}function xr(r,o){let[t,n]=i(o);return r.startsWith("word-spacing")?`word-spacing${a(o)}`:t==="keep-all"?`break-keep${n}`:`break-${u(t)}${n}`}function br(r,o){let[t,n]=i(o);return r==="outline-offset"?`${r}-${t}${n}`:`${c(r)}-${t}${n}`}function hr(r,o){let[t,n]=i(o);return`mix-blend-${t}${n}`}var qr={vertical:"y",horizontal:"x"};function wr(r,o){let[t,n]=i(o);return t==="both"?`${r}${n}`:`${r}-${qr[t]||t}${n}`}function Ir(r,o){let[t,n]=i(o);if(r.startsWith("scroll-snap"))return`snap-${t}${n}`;if(r==="scroll-behavior")return`scroll-${t}${n}`;let[e,s,m,f]=r.match(/scroll-(margin|padding)-?([\w]+)?-?([\w]+)?/);return m==="inline"&&f?`scroll-${s[0]}${f[0]}-${t}${n}`:m?`scroll-${s[0]}${m[0]}-${t}${n}`:`scroll-${s[0]}-${t}${n}`}function vr(r,o){let[t,n]=i(o);return`${u(r)}-${t}${n}`}function jr(r,o){let[t,n]=i(o);return`${r}-${c(t)}${n}`}function Wr(r,o){let[t,n]=i(o);return r==="animation-delay"?`animate${a(t)}${n}`:r==="animation"?`animate-${t.split(" ")[0]}${n}`:`animate-${t}${n}`}function _r(r,o){let[t,n]=i(o);return t==='" "'||t==="' '"?`content-['_']${n}`:`content="[${t}]${n}"`}var Jr={show:"visible",hide:"hidden"};function Vr(r,o){var e;let[t,n]=i(o);return`table-empty-cells-${(e=Jr[t])!=null?e:t}${n}`}function Nr(r,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}function Lr(r,o){let[t,n]=i(o);if(r==="inset-inline-start")return`start${a(t)}${n}`;if(r==="inset-inline-end")return`end${a(t)}${n}`}var E={animation:Wr,aspect:ar,backface:b,caption:b,column:mr,columns:x,break:x,empty:Vr,box:S,writing:Nr,display:U,float:x,clear:x,isolation:pr,object:fr,overflow:x,overscroll:cr,position:U,top:j,left:j,right:j,bottom:j,visibility:U,z,flex:sr,order:x,grid:ur,gap:j,justify:ir,align:er,place:$r,padding:M,perspective:x,margin:M,width:z,min:P,max:P,height:z,font:K,letter:gr,line:k,list:b,text:Y,vertical:y,white:dr,word:xr,content:_r,background:J,border:rr,outline:br,opacity:Q,mix:hr,filter:T,backdrop:tr,table:b,transition:or,transform:nr,accent:b,appearance:b,cursor:O,caret:b,pointer:x,resize:wr,scroll:Ir,inset:Lr,touch:b,user:vr,will:jr,fill:x,stroke:b,color:X,row:lr},Kr=/([\w-]+)\s*:\s*([.\w\(\)-\s%+'",#\/!]+)/;function B(r,o=!1){var l;let t=r.match(Kr);if(!t)return;let[n,e,s]=t,m=c(e),f=(l=E[m])==null?void 0:l.call(E,e,s);return f&&o?f.replace(/-([0-9\.]+)px/,($,p)=>`-${+p/4}`):f}function G(r,o){let t=[];return[r.split(";").filter(Boolean).reduce((n,e)=>{let s=B(e,o)||"";return s||t.push(e),n+=`${s} `},"").trim(),t]}function Or(r,o=!1){let[t,n]=G(r,o);return[t?t.replace(/="([^"]+)"/g,(e,s)=>`-${s}`):"",n]}export{Z as cssMathFnRE,Yr as diffTemplateStyle,Qr as flag,c as getFirstName,h as getHundred,u as getLastName,kr as getStyleScoped,a as getVal,W as isCalc,tt as isColor,yr as isEmptyStyle,L as isHex,F as isHsl,Xr as isNot,A as isPercent,d as isRgb,rt as isSize,zr as isUrl,w as isVar,q as joinEmpty,v as joinWithLine,_ as joinWithUnderLine,Fr as numberWithUnitRE,B as toUnocss,Or as toUnocssClass,i as transformImportant,G as transformStyleToUnocss,D as trim};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transform-to-unocss-core",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "packageManager": "pnpm@7.2.1",
5
5
  "description": "",
6
6
  "author": "Simon He",