transform-to-unocss-core 0.0.25 → 0.0.26

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