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