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