@unocss/runtime 0.46.1 → 0.46.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core.global.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{function Rt(e){let t=e.length,r=-1,n,s="",i=e.charCodeAt(0);for(;++r<t;){if(n=e.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&t===1&&n===45){s+=`\\${e.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=e.charAt(r);continue}s+=`\\${e.charAt(r)}`}return s}var H=Rt;function O(e=[]){return Array.isArray(e)?e:[e]}function P(e){return Array.from(new Set(e))}function v(e){return typeof e=="string"}function L(e){return v(e)?e:(Array.isArray(e)?e:Object.entries(e)).filter(t=>t[1]!=null)}function tt(e){return Array.isArray(e)?e.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?e.map(t=>L(t)):[e]:[L(e)]}function vt(e){return e.filter(([t,r],n)=>{if(t.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(e[s][0]===t&&e[s][1]===r)return!1;return!0})}function G(e){return e==null?"":vt(e).map(([t,r])=>r!=null?`${t}:${r};`:void 0).filter(Boolean).join("")}function F(e){return e&&typeof e=="object"&&!Array.isArray(e)}function N(e,t){let r=e,n=t;if(Array.isArray(r))return[...n];let s={...r};return F(r)&&F(n)&&Object.keys(n).forEach(i=>{F(r[i])&&F(n[i])||Array.isArray(r[i])&&Array.isArray(n[i])?s[i]=N(r[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function K(e){let t,r,n;if(Array.isArray(e)){for(r=Array(t=e.length);t--;)r[t]=(n=e[t])&&typeof n=="object"?K(n):n;return r}if(Object.prototype.toString.call(e)==="[object Object]"){r={};for(t in e)t==="__proto__"?Object.defineProperty(r,t,{value:K(e[t]),configurable:!0,enumerable:!0,writable:!0}):r[t]=(n=e[t])&&typeof n=="object"?K(n):n;return r}return e}function et(e){return v(e[0])}function rt(e){return v(e[0])}var At=/[\w\u00A0-\uFFFF-_:%-?]/,W="$$shortcut-no-merge";function nt(e=""){return At.test(e)}function st(e){return typeof e=="function"?{match:e}:e}function Y(e){return e.length===3}function it(e){return e!=null}function ot(){}var B=class{_map=new Map;get(t,r){let n=this._map.get(t);if(n)return n.get(r)}getFallback(t,r,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.has(r)||s.set(r,n),s.get(r)}set(t,r,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.set(r,n),this}has(t,r){var n;return(n=this._map.get(t))==null?void 0:n.has(r)}delete(t,r){var n;return((n=this._map.get(t))==null?void 0:n.delete(r))||!1}deleteTop(t){return this._map.delete(t)}map(t){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>t(i,r,s)))}};var at=/((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function ct(e,t=["-",":"],r=5){at.lastIndex=0;let n=!1,s=e.toString();do{let i=s;s=s.replace(at,(o,d,a,l)=>t.includes(a)?l.split(/\s/g).filter(Boolean).map(p=>p==="~"?d:p.replace(/^(!?)(.*)/,`$1${d}${a}$2`)).join(" "):o),n=s!==i,r-=1}while(n&&r);return typeof e=="string"?s:e.length()?e.overwrite(0,e.length(),s):e}var lt=new Set;function ut(e){lt.has(e)||(console.warn("[unocss]",e),lt.add(e))}var Ut=e=>[...new Set(e.split(/\\?[\s'"`;={}]+/g))].filter(nt),q={name:"split",order:0,extract({code:e}){return Ut(e)}};function ft(){return{events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}}}var z="default",I="preflights",wt="shortcuts",pt={[I]:-100,[wt]:-10,[z]:0};function dt(e){return O(e).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}function Vt(e){var r;let t=e.shortcuts?dt(e.shortcuts):void 0;if(e.shortcuts=t,e.prefix||e.layer){let n=s=>{s[2]||(s[2]={});let i=s[2];i.prefix==null&&e.prefix&&(i.prefix=e.prefix),i.layer==null&&e.layer&&(i.prefix=e.layer)};t==null||t.forEach(n),(r=e.rules)==null||r.forEach(n)}return e}function Z(e={},t={}){let r=Object.assign({},t,e),n=(r.presets||[]).flatMap(O).map(Vt),s=[...n.filter(c=>c.enforce==="pre"),...n.filter(c=>!c.enforce),...n.filter(c=>c.enforce==="post")],i=Object.assign(pt,...n.map(c=>c.layers),e.layers);function o(c){return P([...s.flatMap(m=>O(m[c]||[])),...O(r[c]||[])])}let d=o("extractors");d.length||d.push(q),d.sort((c,m)=>(c.order||0)-(m.order||0));let a=o("rules"),l={},p=a.length,u=a.map((c,m)=>{var V;if(et(c)){let S=((V=c[2])==null?void 0:V.prefix)||"";l[S+c[0]]=[m,c[1],c[2],c];return}return[m,...c]}).filter(Boolean).reverse(),y=K([...s.map(c=>c.theme||{}),r.theme||{}].reduce((c,m)=>N(c,m),{}));o("extendTheme").forEach(c=>c(y));let C={templates:P(s.map(c=>{var m;return O((m=c.autocomplete)==null?void 0:m.templates)}).flat()),extractors:s.map(c=>{var m;return O((m=c.autocomplete)==null?void 0:m.extractors)}).flat().sort((c,m)=>(c.order||0)-(m.order||0))};return{mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:c=>c,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:i,theme:y,rulesSize:p,rulesDynamic:u,rulesStaticMap:l,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:C,variants:o("variants").map(st),shortcuts:dt(o("shortcuts")),extractors:d,safelist:o("safelist")}}var gt="0.46.1";var J=class{constructor(t={},r={}){this.userConfig=t;this.defaults=r;this.config=Z(t,r),this.events.emit("config",this.config)}version=gt;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=ft();setConfig(t,r){!t||(r&&(this.defaults=r),this.userConfig=t,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=Z(t,this.defaults),this.events.emit("config",this.config))}async applyExtractors(t,r,n=new Set){let s={get original(){return t},code:t,id:r};for(let i of this.config.extractors){let o=await i.extract(s);if(o)for(let d of o)n.add(d)}return n}makeContext(t,r){let n={rawSelector:t,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(t,r){var l;if(this.blocked.has(t))return;let n=`${t}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=t;for(let p of this.config.preprocess)s=p(t);if(this.isBlocked(s)){this.blocked.add(t),this._cache.set(n,null);return}let i=this.matchVariants(t,s);if(!i||this.isBlocked(i[1])){this.blocked.add(t),this._cache.set(n,null);return}let o=this.makeContext(t,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let d=this.expandShortcut(o.currentSelector,o),a=d?await this.stringifyShortcuts(o.variantMatch,o,d[0],d[1]):(l=await this.parseUtil(o.variantMatch,o))==null?void 0:l.map(p=>this.stringifyUtil(p,o)).filter(it);if(a!=null&&a.length)return this._cache.set(n,a),a;this._cache.set(n,null)}async generate(t,r={}){let{id:n,scope:s,preflights:i=!0,safelist:o=!0,minify:d=!1}=r,a=v(t)?await this.applyExtractors(t,n):Array.isArray(t)?new Set(t):t;o&&this.config.safelist.forEach(h=>a.add(h));let l=d?"":`
2
- `,p=new Set([z]),u=new Set,y=new Map,C={},c=Array.from(a).map(async h=>{var b;if(u.has(h))return;let x=await this.parseToken(h);if(x!=null){u.add(h);for(let A of x){let U=A[3]||"",$=(b=A[4])==null?void 0:b.layer;y.has(U)||y.set(U,[]),y.get(U).push(A),$&&p.add($)}}});await Promise.all(c),await(async()=>{if(!i)return;let h={generator:this,theme:this.config.theme},x=new Set([]);this.config.preflights.forEach(({layer:b=I})=>{p.add(b),x.add(b)}),C=Object.fromEntries(await Promise.all(Array.from(x).map(async b=>{let U=(await Promise.all(this.config.preflights.filter($=>($.layer||I)===b).map(async $=>await $.getCSS(h)))).filter(Boolean).join(l);return[b,U]})))})();let m=this.config.sortLayers(Array.from(p).sort((h,x)=>(this.config.layers[h]??0)-(this.config.layers[x]??0)||h.localeCompare(x))),V={},S=h=>{if(V[h])return V[h];let x=Array.from(y).sort((A,U)=>{var $;return(this.parentOrders.get(A[0])??0)-(this.parentOrders.get(U[0])??0)||(($=A[0])==null?void 0:$.localeCompare(U[0]||""))||0}).map(([A,U])=>{let $=U.length,j=U.filter(f=>{var g;return(((g=f[4])==null?void 0:g.layer)||z)===h}).sort((f,g)=>{var E,T,M,w;return f[0]-g[0]||(((E=f[4])==null?void 0:E.sort)||0)-(((T=g[4])==null?void 0:T.sort)||0)||((M=f[1])==null?void 0:M.localeCompare(g[1]||""))||((w=f[2])==null?void 0:w.localeCompare(g[2]||""))||0}).map(([,f,g,,E,,T])=>[[[(f&&Tt(f,s))??"",(E==null?void 0:E.sort)??0]],g,!!(T??(E==null?void 0:E.noMerge))]);if(!j.length)return;let D=j.reverse().map(([f,g,E],T)=>{if(!E&&this.config.mergeSelectors)for(let w=T+1;w<$;w++){let _=j[w];if(_&&!_[2]&&(f&&_[0]||f==null&&_[0]==null)&&_[1]===g)return f&&_[0]&&_[0].push(...f),null}let M=f?P(f.sort((w,_)=>{var X;return w[1]-_[1]||((X=w[0])==null?void 0:X.localeCompare(_[0]||""))||0}).map(w=>w[0]).filter(Boolean)):[];return M.length?`${M.join(`,${l}`)}{${g}}`:g}).filter(Boolean).reverse().join(l);if(!A)return D;let k=A.split(" $$ ");return`${k.join("{")}{${l}${D}${l}}${k.map(f=>"").join("}")}`}).filter(Boolean).join(l);i&&(x=[C[h],x].filter(Boolean).join(l));let b=d?"":`/* layer: ${h} */${l}`;return V[h]=x?b+x:""},R=(h=m,x)=>h.filter(b=>!(x!=null&&x.includes(b))).map(b=>S(b)||"").filter(Boolean).join(l);return{get css(){return R()},layers:m,matched:u,getLayers:R,getLayer:S}}matchVariants(t,r){let n=new Set,s=[],i=r||t,o=!1,d={rawSelector:t,theme:this.config.theme,generator:this};for(;;){o=!1;for(let a of this.config.variants){if(!a.multiPass&&n.has(a))continue;let l=a.match(i,d);if(!!l){v(l)&&(l={matcher:l}),i=l.matcher,s.unshift(l),n.add(a),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,i,s,n]}applyVariants(t,r=t[4],n=t[1]){let i=r.slice().sort((l,p)=>(l.order||0)-(p.order||0)).reduceRight((l,p)=>u=>{var c,m;let y=((c=p.body)==null?void 0:c.call(p,u.entries))||u.entries,C=Array.isArray(p.parent)?p.parent:[p.parent,void 0];return(p.handle??Pt)({...u,entries:y,selector:((m=p.selector)==null?void 0:m.call(p,u.selector,y))||u.selector,parent:C[0]||u.parent,parentOrder:C[1]||u.parentOrder,layer:p.layer||u.layer,sort:p.sort||u.sort},l)},l=>l)({prefix:"",selector:Ot(n),pseudo:"",entries:t[2]}),{parent:o,parentOrder:d}=i;o!=null&&d!=null&&this.parentOrders.set(o,d);let a={selector:_t([i.prefix,i.selector,i.pseudo].join("")),entries:i.entries,parent:o,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let l of this.config.postprocess)l(a);return a}constructCustomCSS(t,r,n){let s=L(r);if(v(s))return s;let{selector:i,entries:o,parent:d}=this.applyVariants([0,n||t.rawSelector,s,void 0,t.variantHandlers]),a=`${i}{${G(o)}}`;return d?`${d}{${a}}`:a}async parseUtil(t,r,n=!1,s=void 0){var p;let[i,o,d]=v(t)?this.matchVariants(t):t;this.config.details&&(r.rules=r.rules??[]);let a=this.config.rulesStaticMap[o];if(a&&a[1]&&(n||!((p=a[2])!=null&&p.internal))){this.config.details&&r.rules.push(a[3]);let u=a[0],y=L(a[1]),C=a[2];return v(y)?[[u,y,C]]:[[u,i,y,C,d]]}r.variantHandlers=d;let{rulesDynamic:l}=this.config;for(let[u,y,C,c]of l){if((c==null?void 0:c.internal)&&!n)continue;let m=o;if(c!=null&&c.prefix)if(s){if(s!==c.prefix)continue}else{if(!o.startsWith(c.prefix))continue;m=o.slice(c.prefix.length)}let V=m.match(y);if(!V)continue;let S=await C(V,r);if(!S)continue;this.config.details&&r.rules.push([y,C,c]);let R=tt(S).filter(h=>h.length);if(R.length)return R.map(h=>v(h)?[u,h,c]:[u,i,h,c,d])}}stringifyUtil(t,r){if(!t)return;if(Y(t))return[t[0],void 0,t[1],void 0,t[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:o,sort:d,noMerge:a}=this.applyVariants(t),l=G(s);if(!l)return;let{layer:p,sort:u,...y}=t[3]??{},C={...y,layer:o??p,sort:d??u};return[t[0],n,l,i,C,this.config.details?r:void 0,a]}expandShortcut(t,r,n=5){var d;if(n===0)return;let s=this.config.details?a=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(a)}:ot,i,o;for(let a of this.config.shortcuts){let l=(d=a[2])!=null&&d.prefix?t.slice(a[2].prefix.length):t;if(rt(a)){if(a[0]===l){i=i||a[2],o=a[1],s(a);break}}else{let p=l.match(a[0]);if(p&&(o=a[1](p,r)),o){i=i||a[2],s(a);break}}}if(v(o)&&(o=ct(o.trim()).split(/\s+/g)),!o){let[a,l]=v(t)?this.matchVariants(t):t;if(a!==l){let p=this.expandShortcut(l,r,n-1);p&&(o=p[0].map(u=>v(u)?a.replace(l,u):u))}}if(!!o)return[o.flatMap(a=>{var l;return(v(a)?(l=this.expandShortcut(a,r,n-1))==null?void 0:l[0]:void 0)||[a]}).filter(Boolean),i]}async stringifyShortcuts(t,r,n,s={layer:this.config.shortcutsLayer}){var p;let i=new B,o=(await Promise.all(P(n).map(async u=>{let y=v(u)?await this.parseUtil(u,r,!0,s.prefix):[[1/0,"{inline}",L(u),void 0,[]]];return y||ut(`unmatched utility "${u}" in shortcut "${t[1]}"`),y||[]}))).flat(1).filter(Boolean).sort((u,y)=>u[0]-y[0]),[d,,a]=t,l=[];for(let u of o){if(Y(u)){l.push([u[0],void 0,u[1],void 0,u[2],r,void 0]);continue}let{selector:y,entries:C,parent:c,sort:m,noMerge:V}=this.applyVariants(u,[...u[4],...a],d);i.getFallback(y,c,[[],u[0]])[0].push([C,!!(V??((p=u[3])==null?void 0:p.noMerge)),m??0])}return l.concat(i.map(([u,y],C,c)=>{let m=(S,R,h)=>{let x=Math.max(...h.map(A=>A[1])),b=h.map(A=>A[0]);return(S?[b.flat(1)]:b).map(A=>{let U=G(A);if(U)return[y,C,U,c,{...s,noMerge:R,sort:x},r,void 0]})};return[[u.filter(([,S])=>S).map(([S,,R])=>[S,R]),!0],[u.filter(([,S])=>!S).map(([S,,R])=>[S,R]),!1]].map(([S,R])=>[...m(!1,R,S.filter(([h])=>h.some(x=>x[0]===W))),...m(!0,R,S.filter(([h])=>h.every(x=>x[0]!==W)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(r=>v(r)?r===t:r.test(t))}};function mt(e,t){return new J(e,t)}var yt=/ \$\$ /,Mt=e=>e.match(yt);function Tt(e,t){return Mt(e)?e.replace(yt,t?` ${t} `:" "):t?`${t} ${e}`:e}function _t(e){let t=e.match(/::[\w-]+(\([\w-]+\))?/g);if(t){for(let r of t)e=e.replace(r,"");e+=t.join("")}return e}var ht=/^\[(.+?)(~?=)"(.*)"\]$/;function Ot(e){return ht.test(e)?e.replace(ht,(t,r,n,s)=>`[${H(r)}${n}"${H(s)}"]`):`.${H(e)}`}function Pt(e,t){return t(e)}var Lt=e=>e.replace(/-(\w)/g,(t,r)=>r?r.toUpperCase():""),xt=e=>e.charAt(0).toUpperCase()+e.slice(1),St=e=>e.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),Ct=["Webkit","Moz","ms"];function Et(e){let t={};function r(n){let s=t[n];if(s)return s;let i=Lt(n);if(i!=="filter"&&i in e)return t[n]=St(i);i=xt(i);for(let o=0;o<Ct.length;o++){let d=`${Ct[o]}${i}`;if(d in e)return t[n]=St(xt(d))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function bt(e){return e.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function Q(e={}){var D,k;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window,r=document,n=t.__unocss||{},s=Object.assign({},e,n.runtime),i=s.defaults||{},o=s.cloakAttribute??"un-cloak";s.autoPrefix&&(i.postprocess=O(i.postprocess)).unshift(Et(r.createElement("div").style)),(D=s.configResolved)==null||D.call(s,n,i);let d=mt(n,i),a=!0,l=new Set,p,u,y,C=[],c=()=>new Promise(f=>{C.push(f),y!=null&&clearTimeout(y),y=setTimeout(()=>S().then(()=>{let g=C;C=[],g.forEach(E=>E())}),0)});function m(f){if(f.nodeType!==1)return;let g=f;g.hasAttribute(o)&&g.removeAttribute(o),g.querySelectorAll(`[${o}]`).forEach(E=>{E.removeAttribute(o)})}function V(){return p||(p=r.createElement("style"),r.documentElement.prepend(p)),p}async function S(){let f=await d.generate(l),g=V();return g.innerHTML=f.css,l=f.matched,{...f,styleElement:g}}async function R(f){let g=l.size;await d.applyExtractors(f,void 0,l),g!==l.size&&await c()}async function h(){let f=r.body,g=f&&f.outerHTML;g&&(await R(`${g} ${bt(g)}`),m(f))}let x=new MutationObserver(f=>{a||f.forEach(async g=>{if(g.target.nodeType!==1)return;let E=g.target;if(E!==p)if(g.type==="childList")g.addedNodes.forEach(async T=>{if(T.nodeType!==1)return;let M=T;u&&!u(M)||(await R(M.outerHTML),m(M))});else{if(u&&!u(E))return;if(g.attributeName!==o){let T=Array.from(E.attributes).map(w=>w.value?`${w.name}="${w.value}"`:w.name).join(" "),M=`<${E.tagName.toLowerCase()} ${T}>`;await R(M)}E.hasAttribute(o)&&E.removeAttribute(o)}})}),b=!1;function A(){if(b)return;let f=r.documentElement||r.body;!f||(x.observe(f,{childList:!0,subtree:!0,attributes:!0}),b=!0)}function U(){h(),A()}function $(){r.readyState==="loading"?t.addEventListener("DOMContentLoaded",U):U()}let j=t.__unocss_runtime=t.__unocss_runtime={version:d.version,uno:d,async extract(f){v(f)||(f.forEach(g=>l.add(g)),f=""),await R(f)},extractAll:h,inspect(f){u=f},toggleObserver(f){f===void 0?a=!a:a=!!f,!b&&!a&&$()},update:S};((k=s.ready)==null?void 0:k.call(s,j))!==!1&&(a=!1,$())}Q();})();
1
+ "use strict";(()=>{function Rt(e){let t=e.length,r=-1,n,s="",i=e.charCodeAt(0);for(;++r<t;){if(n=e.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&t===1&&n===45){s+=`\\${e.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=e.charAt(r);continue}s+=`\\${e.charAt(r)}`}return s}var H=Rt;function O(e=[]){return Array.isArray(e)?e:[e]}function P(e){return Array.from(new Set(e))}function v(e){return typeof e=="string"}function L(e){return v(e)?e:(Array.isArray(e)?e:Object.entries(e)).filter(t=>t[1]!=null)}function tt(e){return Array.isArray(e)?e.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?e.map(t=>L(t)):[e]:[L(e)]}function vt(e){return e.filter(([t,r],n)=>{if(t.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(e[s][0]===t&&e[s][1]===r)return!1;return!0})}function G(e){return e==null?"":vt(e).map(([t,r])=>r!=null?`${t}:${r};`:void 0).filter(Boolean).join("")}function F(e){return e&&typeof e=="object"&&!Array.isArray(e)}function N(e,t){let r=e,n=t;if(Array.isArray(r))return[...n];let s={...r};return F(r)&&F(n)&&Object.keys(n).forEach(i=>{F(r[i])&&F(n[i])||Array.isArray(r[i])&&Array.isArray(n[i])?s[i]=N(r[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function K(e){let t,r,n;if(Array.isArray(e)){for(r=Array(t=e.length);t--;)r[t]=(n=e[t])&&typeof n=="object"?K(n):n;return r}if(Object.prototype.toString.call(e)==="[object Object]"){r={};for(t in e)t==="__proto__"?Object.defineProperty(r,t,{value:K(e[t]),configurable:!0,enumerable:!0,writable:!0}):r[t]=(n=e[t])&&typeof n=="object"?K(n):n;return r}return e}function et(e){return v(e[0])}function rt(e){return v(e[0])}var At=/[\w\u00A0-\uFFFF-_:%-?]/,W="$$shortcut-no-merge";function nt(e=""){return At.test(e)}function st(e){return typeof e=="function"?{match:e}:e}function Y(e){return e.length===3}function it(e){return e!=null}function ot(){}var B=class{_map=new Map;get(t,r){let n=this._map.get(t);if(n)return n.get(r)}getFallback(t,r,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.has(r)||s.set(r,n),s.get(r)}set(t,r,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.set(r,n),this}has(t,r){var n;return(n=this._map.get(t))==null?void 0:n.has(r)}delete(t,r){var n;return((n=this._map.get(t))==null?void 0:n.delete(r))||!1}deleteTop(t){return this._map.delete(t)}map(t){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>t(i,r,s)))}};var at=/((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function ct(e,t=["-",":"],r=5){at.lastIndex=0;let n=!1,s=e.toString();do{let i=s;s=s.replace(at,(o,d,a,c)=>t.includes(a)?c.split(/\s/g).filter(Boolean).map(p=>p==="~"?d:p.replace(/^(!?)(.*)/,`$1${d}${a}$2`)).join(" "):o),n=s!==i,r-=1}while(n&&r);return typeof e=="string"?s:e.length()?e.overwrite(0,e.length(),s):e}var lt=new Set;function ut(e){lt.has(e)||(console.warn("[unocss]",e),lt.add(e))}var Ut=e=>[...new Set(e.split(/\\?[\s'"`;{}]+/g))].filter(nt),q={name:"split",order:0,extract({code:e}){return Ut(e)}};function ft(){return{events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}}}var z="default",I="preflights",wt="shortcuts",pt={[I]:-100,[wt]:-10,[z]:0};function dt(e){return O(e).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}function Vt(e){var r;let t=e.shortcuts?dt(e.shortcuts):void 0;if(e.shortcuts=t,e.prefix||e.layer){let n=s=>{s[2]||(s[2]={});let i=s[2];i.prefix==null&&e.prefix&&(i.prefix=e.prefix),i.layer==null&&e.layer&&(i.prefix=e.layer)};t==null||t.forEach(n),(r=e.rules)==null||r.forEach(n)}return e}function Z(e={},t={}){let r=Object.assign({},t,e),n=(r.presets||[]).flatMap(O).map(Vt),s=[...n.filter(l=>l.enforce==="pre"),...n.filter(l=>!l.enforce),...n.filter(l=>l.enforce==="post")],i=Object.assign(pt,...n.map(l=>l.layers),e.layers);function o(l){return P([...s.flatMap(m=>O(m[l]||[])),...O(r[l]||[])])}let d=o("extractors");d.length||d.push(q),d.sort((l,m)=>(l.order||0)-(m.order||0));let a=o("rules"),c={},p=a.length,u=a.map((l,m)=>{var V;if(et(l)){let S=((V=l[2])==null?void 0:V.prefix)||"";c[S+l[0]]=[m,l[1],l[2],l];return}return[m,...l]}).filter(Boolean).reverse(),y=K([...s.map(l=>l.theme||{}),r.theme||{}].reduce((l,m)=>N(l,m),{}));o("extendTheme").forEach(l=>l(y));let C={templates:P(s.map(l=>{var m;return O((m=l.autocomplete)==null?void 0:m.templates)}).flat()),extractors:s.map(l=>{var m;return O((m=l.autocomplete)==null?void 0:m.extractors)}).flat().sort((l,m)=>(l.order||0)-(m.order||0))};return{mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:l=>l,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:i,theme:y,rulesSize:p,rulesDynamic:u,rulesStaticMap:c,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:C,variants:o("variants").map(st),shortcuts:dt(o("shortcuts")),extractors:d,safelist:o("safelist")}}var gt="0.46.2";var J=class{constructor(t={},r={}){this.userConfig=t;this.defaults=r;this.config=Z(t,r),this.events.emit("config",this.config)}version=gt;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=ft();setConfig(t,r){!t||(r&&(this.defaults=r),this.userConfig=t,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=Z(t,this.defaults),this.events.emit("config",this.config))}async applyExtractors(t,r,n=new Set){let s={get original(){return t},code:t,id:r};for(let i of this.config.extractors){let o=await i.extract(s);if(o)for(let d of o)n.add(d)}return n}makeContext(t,r){let n={rawSelector:t,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(t,r){var c;if(this.blocked.has(t))return;let n=`${t}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=t;for(let p of this.config.preprocess)s=p(t);if(this.isBlocked(s)){this.blocked.add(t),this._cache.set(n,null);return}let i=this.matchVariants(t,s);if(!i||this.isBlocked(i[1])){this.blocked.add(t),this._cache.set(n,null);return}let o=this.makeContext(t,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let d=this.expandShortcut(o.currentSelector,o),a=d?await this.stringifyShortcuts(o.variantMatch,o,d[0],d[1]):(c=await this.parseUtil(o.variantMatch,o))==null?void 0:c.map(p=>this.stringifyUtil(p,o)).filter(it);if(a!=null&&a.length)return this._cache.set(n,a),a;this._cache.set(n,null)}async generate(t,r={}){let{id:n,scope:s,preflights:i=!0,safelist:o=!0,minify:d=!1}=r,a=v(t)?await this.applyExtractors(t,n):Array.isArray(t)?new Set(t):t;o&&this.config.safelist.forEach(h=>a.add(h));let c=d?"":`
2
+ `,p=new Set([z]),u=new Set,y=new Map,C={},l=Array.from(a).map(async h=>{var b;if(u.has(h))return;let x=await this.parseToken(h);if(x!=null){u.add(h);for(let A of x){let U=A[3]||"",$=(b=A[4])==null?void 0:b.layer;y.has(U)||y.set(U,[]),y.get(U).push(A),$&&p.add($)}}});await Promise.all(l),await(async()=>{if(!i)return;let h={generator:this,theme:this.config.theme},x=new Set([]);this.config.preflights.forEach(({layer:b=I})=>{p.add(b),x.add(b)}),C=Object.fromEntries(await Promise.all(Array.from(x).map(async b=>{let U=(await Promise.all(this.config.preflights.filter($=>($.layer||I)===b).map(async $=>await $.getCSS(h)))).filter(Boolean).join(c);return[b,U]})))})();let m=this.config.sortLayers(Array.from(p).sort((h,x)=>(this.config.layers[h]??0)-(this.config.layers[x]??0)||h.localeCompare(x))),V={},S=h=>{if(V[h])return V[h];let x=Array.from(y).sort((A,U)=>{var $;return(this.parentOrders.get(A[0])??0)-(this.parentOrders.get(U[0])??0)||(($=A[0])==null?void 0:$.localeCompare(U[0]||""))||0}).map(([A,U])=>{let $=U.length,j=U.filter(f=>{var g;return(((g=f[4])==null?void 0:g.layer)||z)===h}).sort((f,g)=>{var E,T,M,w;return f[0]-g[0]||(((E=f[4])==null?void 0:E.sort)||0)-(((T=g[4])==null?void 0:T.sort)||0)||((M=f[1])==null?void 0:M.localeCompare(g[1]||""))||((w=f[2])==null?void 0:w.localeCompare(g[2]||""))||0}).map(([,f,g,,E,,T])=>[[[(f&&Tt(f,s))??"",(E==null?void 0:E.sort)??0]],g,!!(T??(E==null?void 0:E.noMerge))]);if(!j.length)return;let D=j.reverse().map(([f,g,E],T)=>{if(!E&&this.config.mergeSelectors)for(let w=T+1;w<$;w++){let _=j[w];if(_&&!_[2]&&(f&&_[0]||f==null&&_[0]==null)&&_[1]===g)return f&&_[0]&&_[0].push(...f),null}let M=f?P(f.sort((w,_)=>{var X;return w[1]-_[1]||((X=w[0])==null?void 0:X.localeCompare(_[0]||""))||0}).map(w=>w[0]).filter(Boolean)):[];return M.length?`${M.join(`,${c}`)}{${g}}`:g}).filter(Boolean).reverse().join(c);if(!A)return D;let k=A.split(" $$ ");return`${k.join("{")}{${c}${D}${c}}${k.map(f=>"").join("}")}`}).filter(Boolean).join(c);i&&(x=[C[h],x].filter(Boolean).join(c));let b=d?"":`/* layer: ${h} */${c}`;return V[h]=x?b+x:""},R=(h=m,x)=>h.filter(b=>!(x!=null&&x.includes(b))).map(b=>S(b)||"").filter(Boolean).join(c);return{get css(){return R()},layers:m,matched:u,getLayers:R,getLayer:S}}matchVariants(t,r){let n=new Set,s=[],i=r||t,o=!1,d={rawSelector:t,theme:this.config.theme,generator:this};for(;;){o=!1;for(let a of this.config.variants){if(!a.multiPass&&n.has(a))continue;let c=a.match(i,d);if(!!c){v(c)&&(c={matcher:c}),i=c.matcher,s.unshift(c),n.add(a),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,i,s,n]}applyVariants(t,r=t[4],n=t[1]){let i=r.slice().sort((c,p)=>(c.order||0)-(p.order||0)).reduceRight((c,p)=>u=>{var l,m;let y=((l=p.body)==null?void 0:l.call(p,u.entries))||u.entries,C=Array.isArray(p.parent)?p.parent:[p.parent,void 0];return(p.handle??Pt)({...u,entries:y,selector:((m=p.selector)==null?void 0:m.call(p,u.selector,y))||u.selector,parent:C[0]||u.parent,parentOrder:C[1]||u.parentOrder,layer:p.layer||u.layer,sort:p.sort||u.sort},c)},c=>c)({prefix:"",selector:Ot(n),pseudo:"",entries:t[2]}),{parent:o,parentOrder:d}=i;o!=null&&d!=null&&this.parentOrders.set(o,d);let a={selector:_t([i.prefix,i.selector,i.pseudo].join("")),entries:i.entries,parent:o,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let c of this.config.postprocess)c(a);return a}constructCustomCSS(t,r,n){let s=L(r);if(v(s))return s;let{selector:i,entries:o,parent:d}=this.applyVariants([0,n||t.rawSelector,s,void 0,t.variantHandlers]),a=`${i}{${G(o)}}`;return d?`${d}{${a}}`:a}async parseUtil(t,r,n=!1,s=void 0){var p;let[i,o,d]=v(t)?this.matchVariants(t):t;this.config.details&&(r.rules=r.rules??[]);let a=this.config.rulesStaticMap[o];if(a&&a[1]&&(n||!((p=a[2])!=null&&p.internal))){this.config.details&&r.rules.push(a[3]);let u=a[0],y=L(a[1]),C=a[2];return v(y)?[[u,y,C]]:[[u,i,y,C,d]]}r.variantHandlers=d;let{rulesDynamic:c}=this.config;for(let[u,y,C,l]of c){if((l==null?void 0:l.internal)&&!n)continue;let m=o;if(l!=null&&l.prefix)if(s){if(s!==l.prefix)continue}else{if(!o.startsWith(l.prefix))continue;m=o.slice(l.prefix.length)}let V=m.match(y);if(!V)continue;let S=await C(V,r);if(!S)continue;this.config.details&&r.rules.push([y,C,l]);let R=tt(S).filter(h=>h.length);if(R.length)return R.map(h=>v(h)?[u,h,l]:[u,i,h,l,d])}}stringifyUtil(t,r){if(!t)return;if(Y(t))return[t[0],void 0,t[1],void 0,t[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:o,sort:d,noMerge:a}=this.applyVariants(t),c=G(s);if(!c)return;let{layer:p,sort:u,...y}=t[3]??{},C={...y,layer:o??p,sort:d??u};return[t[0],n,c,i,C,this.config.details?r:void 0,a]}expandShortcut(t,r,n=5){var d;if(n===0)return;let s=this.config.details?a=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(a)}:ot,i,o;for(let a of this.config.shortcuts){let c=t;if((d=a[2])!=null&&d.prefix){if(!t.startsWith(a[2].prefix))continue;c=t.slice(a[2].prefix.length)}if(rt(a)){if(a[0]===c){i=i||a[2],o=a[1],s(a);break}}else{let p=c.match(a[0]);if(p&&(o=a[1](p,r)),o){i=i||a[2],s(a);break}}}if(v(o)&&(o=ct(o.trim()).split(/\s+/g)),!o){let[a,c]=v(t)?this.matchVariants(t):t;if(a!==c){let p=this.expandShortcut(c,r,n-1);p&&(o=p[0].map(u=>v(u)?a.replace(c,u):u))}}if(!!o)return[o.flatMap(a=>{var c;return(v(a)?(c=this.expandShortcut(a,r,n-1))==null?void 0:c[0]:void 0)||[a]}).filter(Boolean),i]}async stringifyShortcuts(t,r,n,s={layer:this.config.shortcutsLayer}){var p;let i=new B,o=(await Promise.all(P(n).map(async u=>{let y=v(u)?await this.parseUtil(u,r,!0,s.prefix):[[1/0,"{inline}",L(u),void 0,[]]];return y||ut(`unmatched utility "${u}" in shortcut "${t[1]}"`),y||[]}))).flat(1).filter(Boolean).sort((u,y)=>u[0]-y[0]),[d,,a]=t,c=[];for(let u of o){if(Y(u)){c.push([u[0],void 0,u[1],void 0,u[2],r,void 0]);continue}let{selector:y,entries:C,parent:l,sort:m,noMerge:V}=this.applyVariants(u,[...u[4],...a],d);i.getFallback(y,l,[[],u[0]])[0].push([C,!!(V??((p=u[3])==null?void 0:p.noMerge)),m??0])}return c.concat(i.map(([u,y],C,l)=>{let m=(S,R,h)=>{let x=Math.max(...h.map(A=>A[1])),b=h.map(A=>A[0]);return(S?[b.flat(1)]:b).map(A=>{let U=G(A);if(U)return[y,C,U,l,{...s,noMerge:R,sort:x},r,void 0]})};return[[u.filter(([,S])=>S).map(([S,,R])=>[S,R]),!0],[u.filter(([,S])=>!S).map(([S,,R])=>[S,R]),!1]].map(([S,R])=>[...m(!1,R,S.filter(([h])=>h.some(x=>x[0]===W))),...m(!0,R,S.filter(([h])=>h.every(x=>x[0]!==W)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(r=>v(r)?r===t:r.test(t))}};function mt(e,t){return new J(e,t)}var yt=/ \$\$ /,Mt=e=>e.match(yt);function Tt(e,t){return Mt(e)?e.replace(yt,t?` ${t} `:" "):t?`${t} ${e}`:e}function _t(e){let t=e.match(/::[\w-]+(\([\w-]+\))?/g);if(t){for(let r of t)e=e.replace(r,"");e+=t.join("")}return e}var ht=/^\[(.+?)(~?=)"(.*)"\]$/;function Ot(e){return ht.test(e)?e.replace(ht,(t,r,n,s)=>`[${H(r)}${n}"${H(s)}"]`):`.${H(e)}`}function Pt(e,t){return t(e)}var Lt=e=>e.replace(/-(\w)/g,(t,r)=>r?r.toUpperCase():""),xt=e=>e.charAt(0).toUpperCase()+e.slice(1),St=e=>e.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),Ct=["Webkit","Moz","ms"];function Et(e){let t={};function r(n){let s=t[n];if(s)return s;let i=Lt(n);if(i!=="filter"&&i in e)return t[n]=St(i);i=xt(i);for(let o=0;o<Ct.length;o++){let d=`${Ct[o]}${i}`;if(d in e)return t[n]=St(xt(d))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function bt(e){return e.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function Q(e={}){var D,k;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window,r=document,n=t.__unocss||{},s=Object.assign({},e,n.runtime),i=s.defaults||{},o=s.cloakAttribute??"un-cloak";s.autoPrefix&&(i.postprocess=O(i.postprocess)).unshift(Et(r.createElement("div").style)),(D=s.configResolved)==null||D.call(s,n,i);let d=mt(n,i),a=!0,c=new Set,p,u,y,C=[],l=()=>new Promise(f=>{C.push(f),y!=null&&clearTimeout(y),y=setTimeout(()=>S().then(()=>{let g=C;C=[],g.forEach(E=>E())}),0)});function m(f){if(f.nodeType!==1)return;let g=f;g.hasAttribute(o)&&g.removeAttribute(o),g.querySelectorAll(`[${o}]`).forEach(E=>{E.removeAttribute(o)})}function V(){return p||(p=r.createElement("style"),r.documentElement.prepend(p)),p}async function S(){let f=await d.generate(c),g=V();return g.innerHTML=f.css,c=f.matched,{...f,styleElement:g}}async function R(f){let g=c.size;await d.applyExtractors(f,void 0,c),g!==c.size&&await l()}async function h(){let f=r.body,g=f&&f.outerHTML;g&&(await R(`${g} ${bt(g)}`),m(f))}let x=new MutationObserver(f=>{a||f.forEach(async g=>{if(g.target.nodeType!==1)return;let E=g.target;if(E!==p)if(g.type==="childList")g.addedNodes.forEach(async T=>{if(T.nodeType!==1)return;let M=T;u&&!u(M)||(await R(M.outerHTML),m(M))});else{if(u&&!u(E))return;if(g.attributeName!==o){let T=Array.from(E.attributes).map(w=>w.value?`${w.name}="${w.value}"`:w.name).join(" "),M=`<${E.tagName.toLowerCase()} ${T}>`;await R(M)}E.hasAttribute(o)&&E.removeAttribute(o)}})}),b=!1;function A(){if(b)return;let f=r.documentElement||r.body;!f||(x.observe(f,{childList:!0,subtree:!0,attributes:!0}),b=!0)}function U(){h(),A()}function $(){r.readyState==="loading"?t.addEventListener("DOMContentLoaded",U):U()}let j=t.__unocss_runtime=t.__unocss_runtime={version:d.version,uno:d,async extract(f){v(f)||(f.forEach(g=>c.add(g)),f=""),await R(f)},extractAll:h,inspect(f){u=f},toggleObserver(f){f===void 0?a=!a:a=!!f,!b&&!a&&$()},update:S};((k=s.ready)==null?void 0:k.call(s,j))!==!1&&(a=!1,$())}Q();})();