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