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