@unocss/runtime 0.58.2 → 0.58.4

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/core.global.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{function Me(t){let e=t.length,r=-1,n,s="",i=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===37){s+="\\%";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&e===1&&n===45){s+=`\\${t.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=t.charAt(r);continue}s+=`\\${t.charAt(r)}`}return s}var F=Me;function w(t=[]){return Array.isArray(t)?t:[t]}function D(t){return Array.from(new Set(t))}function ne(t,e){return t.reduce((r,n)=>(r.findIndex(i=>e(n,i))===-1&&r.push(n),r),[])}function A(t){return typeof t=="string"}function L(t){return A(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function se(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>L(e)):[t]:[L(t)]}function Ue(t){return t.filter(([e,r],n)=>{if(e.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(t[s][0]===e&&t[s][1]===r)return!1;return!0})}function N(t){return t==null?"":Ue(t).map(([e,r])=>r!=null?`${e}:${r};`:void 0).filter(Boolean).join("")}function I(t){return t&&typeof t=="object"&&!Array.isArray(t)}function J(t,e,r=!1){let n=t,s=e;if(Array.isArray(s))return r&&Array.isArray(s)?[...n,...s]:[...s];let i={...n};return I(n)&&I(s)&&Object.keys(s).forEach(c=>{I(n[c])&&I(s[c])||Array.isArray(n[c])&&Array.isArray(s[c])?i[c]=J(n[c],s[c],r):Object.assign(i,{[c]:s[c]})}),i}function K(t){let e,r,n;if(Array.isArray(t)){for(r=Array(e=t.length);e--;)r[e]=(n=t[e])&&typeof n=="object"?K(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:K(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?K(n):n;return r}return t}function ie(t){return A(t[0])}function oe(t){return A(t[0])}var Q="$$shortcut-no-merge";function ae(t){return typeof t=="function"?{match:t}:t}function X(t){return t.length===3}function ce(t){return t!=null}function le(){}var B=class{_map=new Map;get(e,r){let n=this._map.get(e);if(n)return n.get(r)}getFallback(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(r)||s.set(r,n),s.get(r)}set(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(r,n),this}has(e,r){return this._map.get(e)?.has(r)}delete(e,r){return this._map.get(e)?.delete(r)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>e(i,r,s)))}};var G=class extends Set{_map;constructor(e){super(e),this._map??=new Map}add(e){return this._map??=new Map,this._map.set(e,(this._map.get(e)??0)+1),super.add(e)}delete(e){return this._map.delete(e),super.delete(e)}clear(){this._map.clear(),super.clear()}getCount(e){return this._map.get(e)??0}setCount(e,r){return this._map.set(e,r),super.add(e)}};function z(t){return t instanceof G}var W={};function _e(t=["-",":"]){let e=t.join("|");return W[e]||(W[e]=new RegExp(`((?:[!@<~\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),W[e].lastIndex=0,W[e]}function Ve(t,e=["-",":"],r=5){let n=_e(e),s,i=t.toString(),c=new Set,l=new Map;do s=!1,i=i.replace(n,(f,o,d,h,y)=>{if(!e.includes(d))return f;s=!0,c.add(o+d);let R=y+o.length+d.length+1,v={length:f.length,items:[]};l.set(y,v);for(let S of[...h.matchAll(/\S+/g)]){let C=R+S.index,x=l.get(C)?.items;x?l.delete(C):x=[{offset:C,length:S[0].length,className:S[0]}];for(let T of x)T.className=T.className==="~"?o:T.className.replace(/^(!?)(.*)/,`$1${o}${d}$2`),v.items.push(T)}return"$".repeat(f.length)}),r-=1;while(s&&r);let u;if(typeof t=="string"){u="";let f=0;for(let[o,d]of l)u+=t.slice(f,o),u+=d.items.map(h=>h.className).join(" "),f=o+d.length;u+=t.slice(f)}else{u=t;for(let[f,o]of l)u.overwrite(f,f+o.length,o.items.map(d=>d.className).join(" "))}return{prefixes:Array.from(c),hasChanged:s,groupsByOffset:l,get expanded(){return u.toString()}}}function ue(t,e=["-",":"],r=5){let n=Ve(t,e,r);return typeof t=="string"?n.expanded:t}var fe=new Set;function pe(t){fe.has(t)||(console.warn("[unocss]",t),fe.add(t))}var de=/[\\:]?[\s'"`;{}]+/g;function Pe(t){return t.split(de)}var Y={name:"@unocss/core/extractor-split",order:0,extract({code:t}){return Pe(t)}};function ge(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(r=>r(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(r=>r!==e)}}}var q="default",Z="preflights",Oe="shortcuts",je="imports",me={[je]:-200,[Z]:-100,[Oe]:-10,[q]:0};function ye(t){return w(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var he="_uno_resolved";function $e(t){let e=typeof t=="function"?t():t;if(he in e)return e;e={...e},Object.defineProperty(e,he,{value:!0,enumerable:!1});let r=e.shortcuts?ye(e.shortcuts):void 0;if(e.shortcuts=r,e.prefix||e.layer){let n=s=>{s[2]||(s[2]={});let i=s[2];i.prefix==null&&e.prefix&&(i.prefix=w(e.prefix)),i.layer==null&&e.layer&&(i.layer=e.layer)};r?.forEach(n),e.rules?.forEach(n)}return e}function xe(t){let e=$e(t);if(!e.presets)return[e];let r=(e.presets||[]).flatMap(w).flatMap(xe);return[e,...r]}function ee(t={},e={}){let r=Object.assign({},e,t),n=ne((r.presets||[]).flatMap(w).flatMap(xe),(a,g)=>a.name===g.name),s=[...n.filter(a=>a.enforce==="pre"),...n.filter(a=>!a.enforce),...n.filter(a=>a.enforce==="post")],i=[...s,r],c=[...i].reverse(),l=Object.assign({},me,...i.map(a=>a.layers));function u(a){return D(i.flatMap(g=>w(g[a]||[])))}let f=u("extractors"),o=c.find(a=>a.extractorDefault!==void 0)?.extractorDefault;o===void 0&&(o=Y),o&&!f.includes(o)&&f.unshift(o),f.sort((a,g)=>(a.order||0)-(g.order||0));let d=u("rules"),h={},y=d.length,R=d.map((a,g)=>{if(ie(a)){w(a[2]?.prefix||"").forEach(M=>{h[M+a[0]]=[g,a[1],a[2],a]});return}return[g,...a]}).filter(Boolean).reverse(),v=De(i.map(a=>a.theme)),S=u("extendTheme");for(let a of S)v=a(v)||v;let C={templates:D(i.flatMap(a=>w(a.autocomplete?.templates))),extractors:i.flatMap(a=>w(a.autocomplete?.extractors)).sort((a,g)=>(a.order||0)-(g.order||0)),shorthands:Le(i.map(a=>a.autocomplete?.shorthands||{}))},x=u("separators");x.length||(x=[":","-"]);let T={mergeSelectors:!0,warn:!0,sortLayers:a=>a,...r,blocklist:u("blocklist"),presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:l,theme:v,rulesSize:y,rulesDynamic:R,rulesStaticMap:h,preprocess:u("preprocess"),postprocess:u("postprocess"),preflights:u("preflights"),autocomplete:C,variants:u("variants").map(ae).sort((a,g)=>(a.order||0)-(g.order||0)),shortcuts:ye(u("shortcuts")).reverse(),extractors:f,safelist:u("safelist"),separators:x,details:r.details??r.envMode==="dev"};for(let a of i)a?.configResolved?.(T);return T}function De(t){return t.map(e=>e?K(e):{}).reduce((e,r)=>J(e,r),{})}function Le(t){return t.reduce((e,r)=>{let n={};for(let s in r){let i=r[s];Array.isArray(i)?n[s]=`(${i.join("|")})`:n[s]=i}return{...e,...n}},{})}var Se="0.58.2";var te=class{constructor(e={},r={}){this.userConfig=e;this.defaults=r;this.config=ee(e,r),this.events.emit("config",this.config)}version=Se;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=ge();setConfig(e,r){e&&(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=ee(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,r,n=new Set){let s={original:e,code:e,id:r,extracted:n,envMode:this.config.envMode};for(let i of this.config.extractors){let c=await i.extract?.(s);if(c)if(z(c)&&z(n))for(let l of c)n.setCount(l,n.getCount(l)+c.getCount(l));else for(let l of c)n.add(l)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(e,r){if(this.blocked.has(e))return;let n=`${e}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=e;for(let f of this.config.preprocess)s=f(e);if(this.isBlocked(s)){this.blocked.add(e),this._cache.set(n,null);return}let i=await this.matchVariants(e,s);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(n,null);return}let c=this.makeContext(e,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(c.variants=[...i[3]]);let l=await this.expandShortcut(c.currentSelector,c),u=l?await this.stringifyShortcuts(c.variantMatch,c,l[0],l[1]):(await this.parseUtil(c.variantMatch,c))?.map(f=>this.stringifyUtil(f,c)).filter(ce);if(u?.length)return this._cache.set(n,u),u;this._cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:i=!0,safelist:c=!0,minify:l=!1,extendedInfo:u=!1}=r,f=A(e)?await this.applyExtractors(e,n,u?new G:new Set):Array.isArray(e)?new Set(e):e;c&&this.config.safelist.forEach(a=>{f.has(a)||f.add(a)});let o=l?"":`
1
+ "use strict";(()=>{function Me(t){let e=t.length,r=-1,n,s="",i=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===37){s+="\\%";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&e===1&&n===45){s+=`\\${t.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=t.charAt(r);continue}s+=`\\${t.charAt(r)}`}return s}var F=Me;function w(t=[]){return Array.isArray(t)?t:[t]}function D(t){return Array.from(new Set(t))}function ne(t,e){return t.reduce((r,n)=>(r.findIndex(i=>e(n,i))===-1&&r.push(n),r),[])}function A(t){return typeof t=="string"}function L(t){return A(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function se(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>L(e)):[t]:[L(t)]}function Ue(t){return t.filter(([e,r],n)=>{if(e.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(t[s][0]===e&&t[s][1]===r)return!1;return!0})}function N(t){return t==null?"":Ue(t).map(([e,r])=>r!=null?`${e}:${r};`:void 0).filter(Boolean).join("")}function I(t){return t&&typeof t=="object"&&!Array.isArray(t)}function J(t,e,r=!1){let n=t,s=e;if(Array.isArray(s))return r&&Array.isArray(s)?[...n,...s]:[...s];let i={...n};return I(n)&&I(s)&&Object.keys(s).forEach(c=>{I(n[c])&&I(s[c])||Array.isArray(n[c])&&Array.isArray(s[c])?i[c]=J(n[c],s[c],r):Object.assign(i,{[c]:s[c]})}),i}function K(t){let e,r,n;if(Array.isArray(t)){for(r=Array(e=t.length);e--;)r[e]=(n=t[e])&&typeof n=="object"?K(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:K(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?K(n):n;return r}return t}function ie(t){return A(t[0])}function oe(t){return A(t[0])}var Q="$$shortcut-no-merge";function ae(t){return typeof t=="function"?{match:t}:t}function X(t){return t.length===3}function ce(t){return t!=null}function le(){}var B=class{_map=new Map;get(e,r){let n=this._map.get(e);if(n)return n.get(r)}getFallback(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(r)||s.set(r,n),s.get(r)}set(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(r,n),this}has(e,r){return this._map.get(e)?.has(r)}delete(e,r){return this._map.get(e)?.delete(r)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>e(i,r,s)))}};var G=class extends Set{_map;constructor(e){super(e),this._map??=new Map}add(e){return this._map??=new Map,this._map.set(e,(this._map.get(e)??0)+1),super.add(e)}delete(e){return this._map.delete(e),super.delete(e)}clear(){this._map.clear(),super.clear()}getCount(e){return this._map.get(e)??0}setCount(e,r){return this._map.set(e,r),super.add(e)}};function z(t){return t instanceof G}var W={};function _e(t=["-",":"]){let e=t.join("|");return W[e]||(W[e]=new RegExp(`((?:[!@<~\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),W[e].lastIndex=0,W[e]}function Ve(t,e=["-",":"],r=5){let n=_e(e),s,i=t.toString(),c=new Set,l=new Map;do s=!1,i=i.replace(n,(f,o,d,h,y)=>{if(!e.includes(d))return f;s=!0,c.add(o+d);let R=y+o.length+d.length+1,v={length:f.length,items:[]};l.set(y,v);for(let S of[...h.matchAll(/\S+/g)]){let C=R+S.index,x=l.get(C)?.items;x?l.delete(C):x=[{offset:C,length:S[0].length,className:S[0]}];for(let T of x)T.className=T.className==="~"?o:T.className.replace(/^(!?)(.*)/,`$1${o}${d}$2`),v.items.push(T)}return"$".repeat(f.length)}),r-=1;while(s&&r);let u;if(typeof t=="string"){u="";let f=0;for(let[o,d]of l)u+=t.slice(f,o),u+=d.items.map(h=>h.className).join(" "),f=o+d.length;u+=t.slice(f)}else{u=t;for(let[f,o]of l)u.overwrite(f,f+o.length,o.items.map(d=>d.className).join(" "))}return{prefixes:Array.from(c),hasChanged:s,groupsByOffset:l,get expanded(){return u.toString()}}}function ue(t,e=["-",":"],r=5){let n=Ve(t,e,r);return typeof t=="string"?n.expanded:t}var fe=new Set;function pe(t){fe.has(t)||(console.warn("[unocss]",t),fe.add(t))}var de=/[\\:]?[\s'"`;{}]+/g;function Pe(t){return t.split(de)}var Y={name:"@unocss/core/extractor-split",order:0,extract({code:t}){return Pe(t)}};function ge(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(r=>r(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(r=>r!==e)}}}var q="default",Z="preflights",Oe="shortcuts",je="imports",me={[je]:-200,[Z]:-100,[Oe]:-10,[q]:0};function ye(t){return w(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var he="_uno_resolved";function $e(t){let e=typeof t=="function"?t():t;if(he in e)return e;e={...e},Object.defineProperty(e,he,{value:!0,enumerable:!1});let r=e.shortcuts?ye(e.shortcuts):void 0;if(e.shortcuts=r,e.prefix||e.layer){let n=s=>{s[2]||(s[2]={});let i=s[2];i.prefix==null&&e.prefix&&(i.prefix=w(e.prefix)),i.layer==null&&e.layer&&(i.layer=e.layer)};r?.forEach(n),e.rules?.forEach(n)}return e}function xe(t){let e=$e(t);if(!e.presets)return[e];let r=(e.presets||[]).flatMap(w).flatMap(xe);return[e,...r]}function ee(t={},e={}){let r=Object.assign({},e,t),n=ne((r.presets||[]).flatMap(w).flatMap(xe),(a,g)=>a.name===g.name),s=[...n.filter(a=>a.enforce==="pre"),...n.filter(a=>!a.enforce),...n.filter(a=>a.enforce==="post")],i=[...s,r],c=[...i].reverse(),l=Object.assign({},me,...i.map(a=>a.layers));function u(a){return D(i.flatMap(g=>w(g[a]||[])))}let f=u("extractors"),o=c.find(a=>a.extractorDefault!==void 0)?.extractorDefault;o===void 0&&(o=Y),o&&!f.includes(o)&&f.unshift(o),f.sort((a,g)=>(a.order||0)-(g.order||0));let d=u("rules"),h={},y=d.length,R=d.map((a,g)=>{if(ie(a)){w(a[2]?.prefix||"").forEach(M=>{h[M+a[0]]=[g,a[1],a[2],a]});return}return[g,...a]}).filter(Boolean).reverse(),v=De(i.map(a=>a.theme)),S=u("extendTheme");for(let a of S)v=a(v)||v;let C={templates:D(i.flatMap(a=>w(a.autocomplete?.templates))),extractors:i.flatMap(a=>w(a.autocomplete?.extractors)).sort((a,g)=>(a.order||0)-(g.order||0)),shorthands:Le(i.map(a=>a.autocomplete?.shorthands||{}))},x=u("separators");x.length||(x=[":","-"]);let T={mergeSelectors:!0,warn:!0,sortLayers:a=>a,...r,blocklist:u("blocklist"),presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:l,theme:v,rulesSize:y,rulesDynamic:R,rulesStaticMap:h,preprocess:u("preprocess"),postprocess:u("postprocess"),preflights:u("preflights"),autocomplete:C,variants:u("variants").map(ae).sort((a,g)=>(a.order||0)-(g.order||0)),shortcuts:ye(u("shortcuts")).reverse(),extractors:f,safelist:u("safelist"),separators:x,details:r.details??r.envMode==="dev"};for(let a of i)a?.configResolved?.(T);return T}function De(t){return t.map(e=>e?K(e):{}).reduce((e,r)=>J(e,r),{})}function Le(t){return t.reduce((e,r)=>{let n={};for(let s in r){let i=r[s];Array.isArray(i)?n[s]=`(${i.join("|")})`:n[s]=i}return{...e,...n}},{})}var Se="0.58.4";var te=class{constructor(e={},r={}){this.userConfig=e;this.defaults=r;this.config=ee(e,r),this.events.emit("config",this.config)}version=Se;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=ge();setConfig(e,r){e&&(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=ee(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,r,n=new Set){let s={original:e,code:e,id:r,extracted:n,envMode:this.config.envMode};for(let i of this.config.extractors){let c=await i.extract?.(s);if(c)if(z(c)&&z(n))for(let l of c)n.setCount(l,n.getCount(l)+c.getCount(l));else for(let l of c)n.add(l)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(e,r){if(this.blocked.has(e))return;let n=`${e}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=e;for(let f of this.config.preprocess)s=f(e);if(this.isBlocked(s)){this.blocked.add(e),this._cache.set(n,null);return}let i=await this.matchVariants(e,s);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(n,null);return}let c=this.makeContext(e,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(c.variants=[...i[3]]);let l=await this.expandShortcut(c.currentSelector,c),u=l?await this.stringifyShortcuts(c.variantMatch,c,l[0],l[1]):(await this.parseUtil(c.variantMatch,c))?.map(f=>this.stringifyUtil(f,c)).filter(ce);if(u?.length)return this._cache.set(n,u),u;this._cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:i=!0,safelist:c=!0,minify:l=!1,extendedInfo:u=!1}=r,f=A(e)?await this.applyExtractors(e,n,u?new G:new Set):Array.isArray(e)?new Set(e):e;c&&this.config.safelist.forEach(a=>{f.has(a)||f.add(a)});let o=l?"":`
2
2
  `,d=new Set([q]),h=u?new Map:new Set,y=new Map,R={},v=Array.from(f).map(async a=>{if(h.has(a))return;let g=await this.parseToken(a);if(g!=null){h instanceof Map?h.set(a,{data:g,count:z(f)?f.getCount(a):-1}):h.add(a);for(let E of g){let M=E[3]||"",U=E[4]?.layer;y.has(M)||y.set(M,[]),y.get(M).push(E),U&&d.add(U)}}});await Promise.all(v),await(async()=>{if(!i)return;let a={generator:this,theme:this.config.theme},g=new Set([]);this.config.preflights.forEach(({layer:E=Z})=>{d.add(E),g.add(E)}),R=Object.fromEntries(await Promise.all(Array.from(g).map(async E=>{let U=(await Promise.all(this.config.preflights.filter(j=>(j.layer||Z)===E).map(async j=>await j.getCSS(a)))).filter(Boolean).join(o);return[E,U]})))})();let S=this.config.sortLayers(Array.from(d).sort((a,g)=>(this.config.layers[a]??0)-(this.config.layers[g]??0)||a.localeCompare(g))),C={},x=a=>{if(C[a])return C[a];let g=Array.from(y).sort((M,U)=>(this.parentOrders.get(M[0])??0)-(this.parentOrders.get(U[0])??0)||M[0]?.localeCompare(U[0]||"")||0).map(([M,U])=>{let j=U.length,$=U.filter(p=>(p[4]?.layer||q)===a).sort((p,m)=>p[0]-m[0]||(p[4]?.sort||0)-(m[4]?.sort||0)||p[5]?.currentSelector?.localeCompare(m[5]?.currentSelector??"")||p[1]?.localeCompare(m[1]||"")||p[2]?.localeCompare(m[2]||"")||0).map(([,p,m,,b,,_])=>[[[(p&&Ge(p,s))??"",b?.sort??0]],m,!!(_??b?.noMerge)]);if(!$.length)return;let k=$.reverse().map(([p,m,b],_)=>{if(!b&&this.config.mergeSelectors)for(let V=_+1;V<j;V++){let O=$[V];if(O&&!O[2]&&(p&&O[0]||p==null&&O[0]==null)&&O[1]===m)return p&&O[0]&&O[0].push(...p),null}let P=p?D(p.sort((V,O)=>V[1]-O[1]||V[0]?.localeCompare(O[0]||"")||0).map(V=>V[0]).filter(Boolean)):[];return P.length?`${P.join(`,${o}`)}{${m}}`:m}).filter(Boolean).reverse().join(o);if(!M)return k;let H=M.split(" $$ ");return`${H.join("{")}{${o}${k}${o}${"}".repeat(H.length)}`}).filter(Boolean).join(o);i&&(g=[R[a],g].filter(Boolean).join(o));let E=l?"":`/* layer: ${a} */${o}`;return C[a]=g?E+g:""},T=(a=S,g)=>a.filter(E=>!g?.includes(E)).map(E=>x(E)||"").filter(Boolean).join(o);return{get css(){return T()},layers:S,matched:h,getLayers:T,getLayer:x}}async matchVariants(e,r){let n=new Set,s=[],i=r||e,c=!0,l={rawSelector:e,theme:this.config.theme,generator:this};for(;c;){c=!1;for(let u of this.config.variants){if(!u.multiPass&&n.has(u))continue;let f=await u.match(i,l);if(f){if(A(f)){if(f===i)continue;f={matcher:f}}i=f.matcher,s.unshift(f),n.add(u),c=!0;break}}if(!c)break;if(s.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[e,i,s,n]}applyVariants(e,r=e[4],n=e[1]){let i=r.slice().sort((f,o)=>(f.order||0)-(o.order||0)).reduceRight((f,o)=>d=>{let h=o.body?.(d.entries)||d.entries,y=Array.isArray(o.parent)?o.parent:[o.parent,void 0];return(o.handle??Fe)({...d,entries:h,selector:o.selector?.(d.selector,h)||d.selector,parent:y[0]||d.parent,parentOrder:y[1]||d.parentOrder,layer:o.layer||d.layer,sort:o.sort||d.sort},f)},f=>f)({prefix:"",selector:He(n),pseudo:"",entries:e[2]}),{parent:c,parentOrder:l}=i;c!=null&&l!=null&&this.parentOrders.set(c,l);let u={selector:[i.prefix,i.selector,i.pseudo].join(""),entries:i.entries,parent:c,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let f of this.config.postprocess)f(u);return u}constructCustomCSS(e,r,n){let s=L(r);if(A(s))return s;let{selector:i,entries:c,parent:l}=this.applyVariants([0,n||e.rawSelector,s,void 0,e.variantHandlers]),u=`${i}{${N(c)}}`;return l?`${l}{${u}}`:u}async parseUtil(e,r,n=!1,s){let[i,c,l]=A(e)?await this.matchVariants(e):e;this.config.details&&(r.rules=r.rules??[]);let u=this.config.rulesStaticMap[c];if(u&&u[1]&&(n||!u[2]?.internal)){this.config.details&&r.rules.push(u[3]);let o=u[0],d=L(u[1]),h=u[2];return A(d)?[[o,d,h]]:[[o,i,d,h,l]]}r.variantHandlers=l;let{rulesDynamic:f}=this.config;for(let[o,d,h,y]of f){if(y?.internal&&!n)continue;let R=c;if(y?.prefix){let x=w(y.prefix);if(s){let T=w(s);if(!x.some(a=>T.includes(a)))continue}else{let T=x.find(a=>c.startsWith(a));if(T==null)continue;R=c.slice(T.length)}}let v=R.match(d);if(!v)continue;let S=await h(v,r);if(!S)continue;this.config.details&&r.rules.push([d,h,y]);let C=se(S).filter(x=>x.length);if(C.length)return C.map(x=>A(x)?[o,x,y]:[o,i,x,y,l])}}stringifyUtil(e,r){if(!e)return;if(X(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:c,sort:l,noMerge:u}=this.applyVariants(e),f=N(s);if(!f)return;let{layer:o,sort:d,...h}=e[3]??{},y={...h,layer:c??o,sort:l??d};return[e[0],n,f,i,y,this.config.details?r:void 0,u]}async expandShortcut(e,r,n=5){if(n===0)return;let s=this.config.details?l=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(l)}:le,i,c;for(let l of this.config.shortcuts){let u=e;if(l[2]?.prefix){let o=w(l[2].prefix).find(d=>e.startsWith(d));if(o==null)continue;u=e.slice(o.length)}if(oe(l)){if(l[0]===u){i=i||l[2],c=l[1],s(l);break}}else{let f=u.match(l[0]);if(f&&(c=l[1](f,r)),c){i=i||l[2],s(l);break}}}if(A(c)&&(c=ue(c.trim()).split(/\s+/g)),!c){let[l,u]=A(e)?await this.matchVariants(e):e;if(l!==u){let f=await this.expandShortcut(u,r,n-1);f&&(c=f[0].map(o=>A(o)?l.replace(u,o):o))}}if(c)return[(await Promise.all(c.map(async l=>(A(l)?(await this.expandShortcut(l,r,n-1))?.[0]:void 0)||[l]))).flat(1).filter(Boolean),i]}async stringifyShortcuts(e,r,n,s={layer:this.config.shortcutsLayer}){let i=new B,c=(await Promise.all(D(n).map(async o=>{let d=A(o)?await this.parseUtil(o,r,!0,s.prefix):[[Number.POSITIVE_INFINITY,"{inline}",L(o),void 0,[]]];return!d&&this.config.warn&&pe(`unmatched utility "${o}" in shortcut "${e[1]}"`),d||[]}))).flat(1).filter(Boolean).sort((o,d)=>o[0]-d[0]),[l,,u]=e,f=[];for(let o of c){if(X(o)){f.push([o[0],void 0,o[1],void 0,o[2],r,void 0]);continue}let{selector:d,entries:h,parent:y,sort:R,noMerge:v}=this.applyVariants(o,[...o[4],...u],l);i.getFallback(d,y,[[],o[0]])[0].push([h,!!(v??o[3]?.noMerge),R??0])}return f.concat(i.map(([o,d],h,y)=>{let R=(S,C,x)=>{let T=Math.max(...x.map(g=>g[1])),a=x.map(g=>g[0]);return(S?[a.flat(1)]:a).map(g=>{let E=N(g);if(E)return[d,h,E,y,{...s,noMerge:C,sort:T},r,void 0]})};return[[o.filter(([,S])=>S).map(([S,,C])=>[S,C]),!0],[o.filter(([,S])=>!S).map(([S,,C])=>[S,C]),!1]].map(([S,C])=>[...R(!1,C,S.filter(([x])=>x.some(T=>T[0]===Q))),...R(!0,C,S.filter(([x])=>x.every(T=>T[0]!==Q)))])}).flat(2).filter(Boolean))}isBlocked(e){return!e||this.config.blocklist.some(r=>typeof r=="function"?r(e):A(r)?r===e:r.test(e))}};function Te(t,e){return new te(t,e)}var Ce=/\s\$\$\s+/g;function Ke(t){return Ce.test(t)}function Ge(t,e){return Ke(t)?t.replace(Ce,e?` ${e} `:" "):e?`${e} ${t}`:t}var be=/^\[(.+?)(~?=)"(.*)"\]$/;function He(t){return be.test(t)?t.replace(be,(e,r,n,s)=>`[${F(r)}${n}"${F(s)}"]`):`.${F(t)}`}function Fe(t,e){return e(t)}function Ie(t){return t.replace(/-(\w)/g,(e,r)=>r?r.toUpperCase():"")}function Ee(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Re(t){return t.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var ve=["Webkit","Moz","ms"];function Ae(t){let e={};function r(n){let s=e[n];if(s)return s;let i=Ie(n);if(i!=="filter"&&i in t)return e[n]=Re(i);i=Ee(i);for(let c=0;c<ve.length;c++){let l=`${ve[c]}${i}`;if(l in t)return e[n]=Re(Ee(l))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function we(t){return t.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function re(t={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let e=window,r=window.document,n=()=>r.documentElement,s=e.__unocss||{},i=Object.assign({},t,s.runtime),c=i.defaults||{},l=i.cloakAttribute??"un-cloak";i.autoPrefix&&(c.postprocess=w(c.postprocess)).unshift(Ae(r.createElement("div").style)),i.configResolved?.(s,c);let u=Te(s,c),f=p=>i.inject?i.inject(p):n().prepend(p),o=()=>i.rootElement?i.rootElement():r.body,d=new Map,h=!0,y=new Set,R,v,S=[],C=()=>new Promise(p=>{S.push(p),v!=null&&clearTimeout(v),v=setTimeout(()=>a().then(()=>{let m=S;S=[],m.forEach(b=>b())}),0)});function x(p){if(p.nodeType!==1)return;let m=p;m.hasAttribute(l)&&m.removeAttribute(l),m.querySelectorAll(`[${l}]`).forEach(b=>{b.removeAttribute(l)})}function T(p,m){let b=d.get(p);if(!b)if(b=r.createElement("style"),b.setAttribute("data-unocss-runtime-layer",p),d.set(p,b),m==null)f(b);else{let _=T(m),P=_.parentNode;P?P.insertBefore(b,_.nextSibling):f(b)}return b}async function a(){let p=await u.generate(y);return p.layers.reduce((m,b)=>(T(b,m).innerHTML=p.getLayer(b)??"",b),void 0),y=p.matched,{...p,getStyleElement:m=>d.get(m),getStyleElements:()=>d}}async function g(p){let m=y.size;await u.applyExtractors(p,void 0,y),m!==y.size&&await C()}async function E(p=o()){let m=p&&p.outerHTML;m&&(await g(`${m} ${we(m)}`),x(n()),x(p))}let M=new MutationObserver(p=>{h||p.forEach(async m=>{if(m.target.nodeType!==1)return;let b=m.target;for(let _ of d)if(b===_[1])return;if(m.type==="childList")m.addedNodes.forEach(async _=>{if(_.nodeType!==1)return;let P=_;R&&!R(P)||(await g(P.outerHTML),x(P))});else{if(R&&!R(b))return;if(m.attributeName!==l){let _=Array.from(b.attributes).map(V=>V.value?`${V.name}="${V.value}"`:V.name).join(" "),P=`<${b.tagName.toLowerCase()} ${_}>`;await g(P)}b.hasAttribute(l)&&b.removeAttribute(l)}})}),U=!1;function j(){if(U)return;let p=i.observer?.target?i.observer.target():o();p&&(M.observe(p,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.observer?.attributeFilter}),U=!0)}function $(){i.bypassDefined&&Ne(u.blocked),E(),j()}function k(){r.readyState==="loading"?e.addEventListener("DOMContentLoaded",$):$()}let H=e.__unocss_runtime=e.__unocss_runtime={version:u.version,uno:u,async extract(p){A(p)||(p.forEach(m=>y.add(m)),p=""),await g(p)},extractAll:E,inspect(p){R=p},toggleObserver(p){p===void 0?h=!h:h=!!p,!U&&!h&&k()},update:a,presets:e.__unocss_runtime?.presets??{}};i.ready?.(H)!==!1&&(h=!1,k())}function Ne(t=new Set){for(let e=0;e<document.styleSheets.length;e++){let r=document.styleSheets[e],n;try{if(n=r.cssRules||r.rules,!n)continue;Array.from(n).flatMap(s=>s.selectorText?.split(/,/g)||[]).forEach(s=>{s&&(s=s.trim(),s.startsWith(".")&&(s=s.slice(1)),t.add(s))})}catch{continue}}return t}re();})();