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