transform-to-unocss-core 0.0.21 → 0.0.23

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