@unocss/runtime 0.25.0 → 0.26.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
- (()=>{var gt=Object.defineProperty,mt=Object.defineProperties;var yt=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var W=(n,t,e)=>t in n?gt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,$=(n,t)=>{for(var e in t||(t={}))N.call(t,e)&&W(n,e,t[e]);if(j)for(var e of j(t))Z.call(t,e)&&W(n,e,t[e]);return n},V=(n,t)=>mt(n,yt(t));var J=(n,t)=>{var e={};for(var r in n)N.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&j)for(var r of j(n))t.indexOf(r)<0&&Z.call(n,r)&&(e[r]=n[r]);return e};function St(n){let t=n.length,e=-1,r,s="",o=n.charCodeAt(0);for(;++e<t;){if(r=n.charCodeAt(e),r===0){s+="\uFFFD";continue}if(r===44){s+="\\2c ";continue}if(r>=1&&r<=31||r===127||e===0&&r>=48&&r<=57||e===1&&r>=48&&r<=57&&o===45){s+=`\\${r.toString(16)} `;continue}if(e===0&&t===1&&r===45){s+=`\\${n.charAt(e)}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){s+=n.charAt(e);continue}s+=`\\${n.charAt(e)}`}return s}var D=St;function P(n){return(Array.isArray(n)?n:Object.entries(n)).filter(t=>t[1]!=null)}function Q(n){return Array.isArray(n)?n.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?n.map(t=>P(t)):[n]:[P(n)]}function xt(n){return n.filter(([t,e],r)=>{if(t.startsWith("$$"))return!1;for(let s=r-1;s>=0;s--)if(n[s][0]===t&&n[s][1]===e)return!1;return!0})}function K(n){return n==null?"":xt(n).map(([t,e])=>e!=null?`${t}:${e};`:void 0).filter(Boolean).join("")}function k(n){return n&&typeof n=="object"&&!Array.isArray(n)}function F(n,t){let e=n,r=t;if(Array.isArray(e)&&Array.isArray(r))return[...e,...r];if(Array.isArray(e))return[...e];let s=$({},e);return k(e)&&k(r)&&Object.keys(r).forEach(o=>{k(r[o])?o in e?s[o]=F(e[o],r[o]):Object.assign(s,{[o]:r[o]}):Object.assign(s,{[o]:r[o]})}),s}function M(n){let t,e,r;if(Array.isArray(n)){for(e=Array(t=n.length);t--;)e[t]=(r=n[t])&&typeof r=="object"?M(r):r;return e}if(Object.prototype.toString.call(n)==="[object Object]"){e={};for(t in n)t==="__proto__"?Object.defineProperty(e,t,{value:M(n[t]),configurable:!0,enumerable:!0,writable:!0}):e[t]=(r=n[t])&&typeof r=="object"?M(r):r;return e}return n}function X(n){return typeof n[0]=="string"}function Y(n){return typeof n[0]=="string"}function v(n=[]){return Array.isArray(n)?n:[n]}function L(n){return Array.from(new Set(n))}var Ct=/(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-?]/,z="$$shortcut-no-merge";function tt(n=""){return Ct.test(n)}function et(n){return typeof n=="function"?{match:n}:n}function B(n){return n.length===3}function rt(n){return n!=null}var G=class{_map=new Map;get(t,e){let r=this._map.get(t);if(r)return r.get(e)}getFallback(t,e,r){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.has(e)||s.set(e,r),s.get(e)}set(t,e,r){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.set(e,r),this}has(t,e){var r;return(r=this._map.get(t))==null?void 0:r.has(e)}delete(t,e){var r;return((r=this._map.get(t))==null?void 0:r.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(([s,o])=>t(o,e,s)))}};var bt=/([!\w+:_/-]+?)([:-])\(((?:[!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function nt(n){let t=[],e;for(;e=bt.exec(n);){let s=e.index,o=s+e[0].length,[,a,i,c]=e,f=c.split(/\s/g).map(h=>h.replace(/^(!?)(.*)/,`$1${a}${i}$2`)).join(" ");t.unshift([s,o,f])}let r=n;return t.forEach(([s,o,a])=>{r=r.slice(0,s)+a+r.slice(o)}),r}var st=new Set;function it(n){st.has(n)||(console.warn("[unocss]",n),st.add(n))}var Rt=n=>n.split(/[\s'"`;>=]+/g).filter(tt),H={name:"split",order:0,extract({code:n}){return new Set(Rt(n))}};function Ut(n){return v(n).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}var wt={shortcuts:-1,default:0};function I(n={},t={}){let e=Object.assign({},t,n),r=(e.presets||[]).flatMap(v),s=[...r.filter(l=>l.enforce==="pre"),...r.filter(l=>!l.enforce),...r.filter(l=>l.enforce==="post")],o=Object.assign(wt,...r.map(l=>l.layers),n.layers);function a(l){return L([...s.flatMap(y=>v(y[l]||[])),...v(e[l]||[])])}let i=a("extractors");i.length||i.push(H),i.sort((l,y)=>(l.order||0)-(y.order||0));let c=a("rules"),f={},h=c.length;c.forEach((l,y)=>{X(l)&&(f[l[0]]=[y,l[1],l[2]],delete c[y])});let x=M([...s.map(l=>l.theme||{}),e.theme||{}].reduce((l,y)=>F(l,y),{}));return a("extendTheme").forEach(l=>l(x)),V($({mergeSelectors:!0,warn:!0,blocklist:[],safelist:[],sortLayers:l=>l},e),{presets:s,envMode:e.envMode||"build",shortcutsLayer:e.shortcutsLayer||"shortcuts",layers:o,theme:x,rulesSize:h,rulesDynamic:c,rulesStaticMap:f,preprocess:a("preprocess"),postprocess:a("postprocess"),preflights:a("preflights"),variants:a("variants").map(et),shortcuts:Ut(a("shortcuts")),extractors:i})}var ot="0.25.0";var ct=class{constructor(t={},e={}){this.userConfig=t;this.defaults=e;this.config=I(t,e)}version=ot;_cache=new Map;config;blocked=new Set;parentOrders=new Map;setConfig(t,e){!t||(e&&(this.defaults=e),this.userConfig=t,this.config=I(t,this.defaults),this.blocked.clear(),this.parentOrders.clear(),this._cache.clear())}async applyExtractors(t,e,r=new Set){let s={get original(){return t},code:t,id:e};for(let o of this.config.extractors){let a=await o.extract(s);a==null||a.forEach(i=>r.add(i))}return r}async parseToken(t){var a;if(this.blocked.has(t))return;if(this._cache.has(t))return this._cache.get(t);let e=t;for(let i of this.config.preprocess)e=i(t);if(this.isBlocked(e)){this.blocked.add(t),this._cache.set(t,null);return}let r=this.matchVariants(t,e);if(!r||this.isBlocked(r[1])){this.blocked.add(t),this._cache.set(t,null);return}let s={rawSelector:t,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...i)=>this.constructCustomCSS(s,...i)},o=this.expandShortcut(r[1],s);if(o){let i=await this.stringifyShortcuts(r,s,o[0],o[1]);if(i==null?void 0:i.length)return this._cache.set(t,i),i}else{let i=(a=await this.parseUtil(r,s))==null?void 0:a.map(c=>this.stringifyUtil(c)).filter(rt);if(i==null?void 0:i.length)return this._cache.set(t,i),i}this._cache.set(t,null)}async generate(t,{id:e,scope:r,preflights:s=!0,safelist:o=!0,minify:a=!1}={}){let i=typeof t=="string"?await this.applyExtractors(t,e):t;o&&this.config.safelist.forEach(u=>i.add(u));let c=a?"":`
2
- `,f=new Set(["default"]),h=new Set,x=new Map;await Promise.all(Array.from(i).map(async u=>{var g;if(h.has(u))return;let d=await this.parseToken(u);if(d!=null){h.add(u);for(let S of d){let R=S[3]||"";x.has(R)||x.set(R,[]),x.get(R).push(S),((g=S[4])==null?void 0:g.layer)&&f.add(S[4].layer)}}})),s&&this.config.preflights.forEach(u=>{u.layer&&f.add(u.layer)});let l={},y=this.config.sortLayers(Array.from(f).sort((u,d)=>{var g,S;return((g=this.config.layers[u])!=null?g:0)-((S=this.config.layers[d])!=null?S:0)||u.localeCompare(d)})),U={};s&&(U=Object.fromEntries(await Promise.all(y.map(async u=>{let g=(await Promise.all(this.config.preflights.filter(S=>(S.layer||"default")===u).map(async S=>await S.getCSS()))).filter(Boolean).join(c);return[u,g]}))));let A=u=>{if(l[u])return l[u];let d=Array.from(x).sort((g,S)=>{var R,w,p;return((R=this.parentOrders.get(g[0]))!=null?R:0)-((w=this.parentOrders.get(S[0]))!=null?w:0)||((p=g[0])==null?void 0:p.localeCompare(S[0]||""))||0}).map(([g,S])=>{let R=S.length,w=S.filter(m=>{var b;return(((b=m[4])==null?void 0:b.layer)||"default")===u}).sort((m,b)=>{var T,_,E;return m[0]-b[0]||(((T=m[4])==null?void 0:T.sort)||0)-(((_=b[4])==null?void 0:_.sort)||0)||((E=m[1])==null?void 0:E.localeCompare(b[1]||""))||0}).map(m=>{var b;return[m[1]?$t(m[1],r):m[1],m[2],!!((b=m[4])==null?void 0:b.noMerge)]}).map(m=>[m[0]==null?m[0]:[m[0]],m[1],m[2]]);if(!w.length)return;let p=w.reverse().map(([m,b,T],_)=>{if(!T&&m&&this.config.mergeSelectors)for(let E=_+1;E<R;E++){let O=w[E];if(O&&!O[2]&&O[0]&&O[1]===b)return O[0].push(...m),null}return m?`${[...new Set(m)].join(`,${c}`)}{${b}}`:b}).filter(Boolean).reverse().join(c);return g?`${g}{${c}${p}${c}}`:p}).filter(Boolean).join(c);return s&&(d=[U[u],d].filter(Boolean).join(c)),l[u]=!a&&d?`/* layer: ${u} */${c}${d}`:d},C=(u=y,d)=>u.filter(g=>!(d==null?void 0:d.includes(g))).map(g=>A(g)||"").filter(Boolean).join(c);return{get css(){return C()},layers:y,getLayers:C,getLayer:A,matched:h}}matchVariants(t,e){let r=new Set,s=[],o=e||t,a=!1,i={rawSelector:t,theme:this.config.theme,generator:this};for(;;){a=!1;for(let c of this.config.variants){if(!c.multiPass&&r.has(c))continue;let f=c.match(o,i);if(!!f&&(typeof f=="string"&&(f={matcher:f}),f)){o=f.matcher,Array.isArray(f.parent)&&this.parentOrders.set(f.parent[0],f.parent[1]),s.push(f),r.add(c),a=!0;break}}if(!a)break;if(s.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,o,s]}applyVariants(t,e=t[4],r=t[1]){let s=[...e].sort((i,c)=>(i.order||0)-(c.order||0)),o=s.reduce((i,c)=>{var f;return((f=c.body)==null?void 0:f.call(c,i))||i},t[2]),a={selector:s.reduce((i,c)=>{var f;return((f=c.selector)==null?void 0:f.call(c,i,o))||i},Tt(r)),entries:o,parent:s.reduce((i,c)=>Array.isArray(c.parent)?c.parent[0]:c.parent||i,void 0),layer:s.reduce((i,c)=>c.layer||i,void 0),sort:s.reduce((i,c)=>c.sort||i,void 0)};for(let i of this.config.postprocess)i(a);return a}constructCustomCSS(t,e,r){e=P(e);let{selector:s,entries:o,parent:a}=this.applyVariants([0,r||t.rawSelector,e,void 0,t.variantHandlers]),i=`${s}{${K(o)}}`;return a?`${a}{${i}}`:i}async parseUtil(t,e,r=!1){var h,x;let[s,o,a]=typeof t=="string"?this.matchVariants(t):t,i=this.config.rulesStaticMap[o];if(i&&i[1]&&(r||!((h=i[2])==null?void 0:h.internal)))return[[i[0],s,P(i[1]),i[2],a]];e.variantHandlers=a;let{rulesDynamic:c,rulesSize:f}=this.config;for(let l=f;l>=0;l--){let y=c[l];if(!y||((x=y[2])==null?void 0:x.internal)&&!r)continue;let[U,A,C]=y,u=o.match(U);if(!u)continue;let d=await A(u,e);if(!d)continue;if(typeof d=="string")return[[l,d,C]];let g=Q(d).filter(S=>S.length);if(g.length)return g.map(S=>[l,s,S,C,a])}}stringifyUtil(t){var l;if(!t)return;if(B(t))return[t[0],void 0,t[1],void 0,t[2]];let{selector:e,entries:r,parent:s,layer:o,sort:a}=this.applyVariants(t),i=K(r);if(!i)return;let y=(l=t[3])!=null?l:{},{layer:c,sort:f}=y,h=J(y,["layer","sort"]),x=V($({},h),{layer:o!=null?o:c,sort:a!=null?a:f});return[t[0],e,i,s,x]}expandShortcut(t,e,r=3){if(r===0)return;let s,o;for(let a of this.config.shortcuts)if(Y(a)){if(a[0]===t){s=s||a[2],o=a[1];break}}else{let i=t.match(a[0]);if(i&&(o=a[1](i,e)),o){s=s||a[2];break}}if(typeof o=="string"&&(o=nt(o).split(/\s+/g)),!!o)return[o.flatMap(a=>{var i;return((i=this.expandShortcut(a,e,r-1))==null?void 0:i[0])||[a]}).filter(a=>a!==""),s]}async stringifyShortcuts(t,e,r,s={layer:this.config.shortcutsLayer}){var f;let o=new G,a=(await Promise.all(L(r).map(async h=>{let x=await this.parseUtil(h,e,!0);return x||it(`unmatched utility "${h}" in shortcut "${t[1]}"`),x||[]}))).flat(1).filter(Boolean).sort((h,x)=>h[0]-x[0]),[i,,c]=t;for(let h of a){if(B(h))continue;let{selector:x,entries:l,parent:y,sort:U}=this.applyVariants(h,[...h[4],...c],i);o.getFallback(x,y,[[],h[0]])[0].push([l,!!((f=h[3])==null?void 0:f.noMerge),U!=null?U:0])}return o.map(([h,x],l,y)=>{let U=(C,u,d)=>{let g=Math.max(...d.map(R=>R[1])),S=d.map(R=>R[0]);return(C?[S.flat(1)]:S).map(R=>{let w=K(R);if(w)return[x,l,w,y,V($({},s),{noMerge:u,sort:g})]})};return[[h.filter(([,C])=>C).map(([C,,u])=>[C,u]),!0],[h.filter(([,C])=>!C).map(([C,,u])=>[C,u]),!1]].map(([C,u])=>[...U(!1,u,C.filter(([d])=>d.some(g=>g[0]===z))),...U(!0,u,C.filter(([d])=>d.every(g=>g[0]!==z)))])}).flat(2).filter(Boolean)}isBlocked(t){return!t||this.config.blocklist.some(e=>typeof e=="string"?e===t:e.test(t))}};function lt(n,t){return new ct(n,t)}var ut=/ \$\$ /,At=n=>n.match(ut);function $t(n,t){return At(n)?n.replace(ut,t?` ${t} `:" "):t?`${t} ${n}`:n}var at=/^\[(.+?)(~?=)"(.*)"\]$/;function Tt(n){return at.test(n)?n.replace(at,(t,e,r,s)=>`[${D(e)}${r}"${D(s)}"]`):`.${D(n)}`}var _t=n=>n.replace(/-(\w)/g,(t,e)=>e?e.toUpperCase():""),ft=n=>n.charAt(0).toUpperCase()+n.slice(1),pt=n=>n.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),dt=["Webkit","Moz","ms"];function ht(n){let t={};function e(r){let s=t[r];if(s)return s;let o=_t(r);if(o!=="filter"&&o in n)return t[r]=pt(o);o=ft(o);for(let a=0;a<dt.length;a++){let i=`${dt[a]}${o}`;if(i in n)return t[r]=pt(ft(i))}return r}return({entries:r})=>r.forEach(s=>{s[0].startsWith("--")||(s[0]=e(s[0]))})}function q(n={}){var R,w;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window.__unocss||{},e=t==null?void 0:t.runtime,r=Object.assign(n.defaults||{},e);if(e==null?void 0:e.autoPrefix){let p=r.postprocess;p||(p=[]),Array.isArray(p)||(p=[p]),p.unshift(ht(document.createElement("div").style)),r.postprocess=p}(R=e==null?void 0:e.configResolved)==null||R.call(e,t,r);let s,o=!0,a,i=lt(t,r),c=new Set,f,h=[],x=()=>new Promise(p=>{h.push(p),f!=null&&clearTimeout(f),f=setTimeout(()=>l().then(()=>{let m=h;h=[],m.forEach(b=>b())}),0)});async function l(){let p=await i.generate(c);s||(s=document.createElement("style"),document.documentElement.prepend(s)),s.innerHTML=p.css}async function y(p){await i.applyExtractors(p,void 0,c),await x()}async function U(){let p=document.body&&document.body.outerHTML;p&&await y(p)}let A=new MutationObserver(p=>{o||p.forEach(m=>{let b=m.target;if(b===s||a&&!a(b))return;let T=Array.from(b.attributes).map(E=>E.value?`${E.name}="${E.value}"`:E.name).join(" "),_=`<${b.tagName.toLowerCase()} ${T}>`;y(_)})}),C=!1;function u(){if(!C)return;let p=document.documentElement||document.body;!p||(A.observe(p,{childList:!0,subtree:!0,attributes:!0}),C=!0)}function d(){U(),u()}function g(){d(),window.addEventListener("load",d),window.addEventListener("DOMContentLoaded",d)}let S=window.__unocss_runtime=window.__unocss_runtime={version:i.version,uno:i,async extract(p){if(typeof p=="string")return await y(p);p.forEach(m=>c.add(m)),await l()},extractAll:U,inspect(p){a=p},toggleObserver(p){p===void 0?o=!o:o=!!p,!C&&!o&&g()}};((w=e==null?void 0:e.ready)==null?void 0:w.call(e,S))!==!1&&(o=!1,g())}q();})();
1
+ (()=>{var gt=Object.defineProperty,mt=Object.defineProperties;var yt=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var W=(n,t,e)=>t in n?gt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,$=(n,t)=>{for(var e in t||(t={}))N.call(t,e)&&W(n,e,t[e]);if(j)for(var e of j(t))Z.call(t,e)&&W(n,e,t[e]);return n},M=(n,t)=>mt(n,yt(t));var J=(n,t)=>{var e={};for(var r in n)N.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&j)for(var r of j(n))t.indexOf(r)<0&&Z.call(n,r)&&(e[r]=n[r]);return e};function St(n){let t=n.length,e=-1,r,s="",i=n.charCodeAt(0);for(;++e<t;){if(r=n.charCodeAt(e),r===0){s+="\uFFFD";continue}if(r===44){s+="\\2c ";continue}if(r>=1&&r<=31||r===127||e===0&&r>=48&&r<=57||e===1&&r>=48&&r<=57&&i===45){s+=`\\${r.toString(16)} `;continue}if(e===0&&t===1&&r===45){s+=`\\${n.charAt(e)}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){s+=n.charAt(e);continue}s+=`\\${n.charAt(e)}`}return s}var D=St;function v(n){return(Array.isArray(n)?n:Object.entries(n)).filter(t=>t[1]!=null)}function Q(n){return Array.isArray(n)?n.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?n.map(t=>v(t)):[n]:[v(n)]}function xt(n){return n.filter(([t,e],r)=>{if(t.startsWith("$$"))return!1;for(let s=r-1;s>=0;s--)if(n[s][0]===t&&n[s][1]===e)return!1;return!0})}function K(n){return n==null?"":xt(n).map(([t,e])=>e!=null?`${t}:${e};`:void 0).filter(Boolean).join("")}function L(n){return n&&typeof n=="object"&&!Array.isArray(n)}function F(n,t){let e=n,r=t;if(Array.isArray(e)&&Array.isArray(r))return[...e,...r];if(Array.isArray(e))return[...e];let s=$({},e);return L(e)&&L(r)&&Object.keys(r).forEach(i=>{L(r[i])?i in e?s[i]=F(e[i],r[i]):Object.assign(s,{[i]:r[i]}):Object.assign(s,{[i]:r[i]})}),s}function V(n){let t,e,r;if(Array.isArray(n)){for(e=Array(t=n.length);t--;)e[t]=(r=n[t])&&typeof r=="object"?V(r):r;return e}if(Object.prototype.toString.call(n)==="[object Object]"){e={};for(t in n)t==="__proto__"?Object.defineProperty(e,t,{value:V(n[t]),configurable:!0,enumerable:!0,writable:!0}):e[t]=(r=n[t])&&typeof r=="object"?V(r):r;return e}return n}function X(n){return typeof n[0]=="string"}function Y(n){return typeof n[0]=="string"}function P(n=[]){return Array.isArray(n)?n:[n]}function k(n){return Array.from(new Set(n))}var Ct=/(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-?]/,z="$$shortcut-no-merge";function tt(n=""){return Ct.test(n)}function et(n){return typeof n=="function"?{match:n}:n}function B(n){return n.length===3}function rt(n){return n!=null}var G=class{_map=new Map;get(t,e){let r=this._map.get(t);if(r)return r.get(e)}getFallback(t,e,r){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.has(e)||s.set(e,r),s.get(e)}set(t,e,r){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.set(e,r),this}has(t,e){var r;return(r=this._map.get(t))==null?void 0:r.has(e)}delete(t,e){var r;return((r=this._map.get(t))==null?void 0:r.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(([s,i])=>t(i,e,s)))}};var bt=/([!\w+:_/-]+?)([:-])\(((?:[!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function nt(n){let t=[],e;for(;e=bt.exec(n);){let s=e.index,i=s+e[0].length,[,o,a,c]=e,f=c.split(/\s/g).map(u=>u.replace(/^(!?)(.*)/,`$1${o}${a}$2`)).join(" ");t.unshift([s,i,f])}let r=n;return t.forEach(([s,i,o])=>{r=r.slice(0,s)+o+r.slice(i)}),r}var st=new Set;function it(n){st.has(n)||(console.warn("[unocss]",n),st.add(n))}var Rt=n=>n.split(/[\s'"`;>=]+/g).filter(tt),H={name:"split",order:0,extract({code:n}){return new Set(Rt(n))}};function wt(n){return P(n).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}var Ut={shortcuts:-1,default:0};function I(n={},t={}){let e=Object.assign({},t,n),r=(e.presets||[]).flatMap(P),s=[...r.filter(l=>l.enforce==="pre"),...r.filter(l=>!l.enforce),...r.filter(l=>l.enforce==="post")],i=Object.assign(Ut,...r.map(l=>l.layers),n.layers);function o(l){return k([...s.flatMap(y=>P(y[l]||[])),...P(e[l]||[])])}let a=o("extractors");a.length||a.push(H),a.sort((l,y)=>(l.order||0)-(y.order||0));let c=o("rules"),f={},u=c.length;c.forEach((l,y)=>{X(l)&&(f[l[0]]=[y,l[1],l[2]],delete c[y])});let x=V([...s.map(l=>l.theme||{}),e.theme||{}].reduce((l,y)=>F(l,y),{}));return o("extendTheme").forEach(l=>l(x)),M($({mergeSelectors:!0,warn:!0,blocklist:[],safelist:[],sortLayers:l=>l},e),{presets:s,envMode:e.envMode||"build",shortcutsLayer:e.shortcutsLayer||"shortcuts",layers:i,theme:x,rulesSize:u,rulesDynamic:c,rulesStaticMap:f,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),variants:o("variants").map(et),shortcuts:wt(o("shortcuts")),extractors:a})}var ot="0.26.2";var ct=class{constructor(t={},e={}){this.userConfig=t;this.defaults=e;this.config=I(t,e)}version=ot;_cache=new Map;config;blocked=new Set;parentOrders=new Map;setConfig(t,e){!t||(e&&(this.defaults=e),this.userConfig=t,this.config=I(t,this.defaults),this.blocked.clear(),this.parentOrders.clear(),this._cache.clear())}async applyExtractors(t,e,r=new Set){let s={get original(){return t},code:t,id:e};for(let i of this.config.extractors){let o=await i.extract(s);o==null||o.forEach(a=>r.add(a))}return r}makeContext(t,e){let r={rawSelector:t,currentSelector:e[1],theme:this.config.theme,generator:this,variantHandlers:e[2],constructCSS:(...s)=>this.constructCustomCSS(r,...s),variantMatch:e};return r}async parseToken(t,e){var f;if(this.blocked.has(t))return;let r=`${t}${e?` ${e}`:""}`,s=this._cache.get(r);if(s)return s;let i=t;for(let u of this.config.preprocess)i=u(t);if(this.isBlocked(i)){this.blocked.add(t),this._cache.set(r,null);return}let o=this.matchVariants(t,i);if(!o||this.isBlocked(o[1])){this.blocked.add(t),this._cache.set(r,null);return}let a=this.makeContext(t,[e||o[0],o[1],o[2]]),c=this.expandShortcut(a.currentSelector,a);if(c){let u=await this.stringifyShortcuts(a.variantMatch,a,c[0],c[1]);if(u==null?void 0:u.length)return this._cache.set(r,u),u}else{let u=(f=await this.parseUtil(a.variantMatch,a))==null?void 0:f.map(x=>this.stringifyUtil(x)).filter(rt);if(u==null?void 0:u.length)return this._cache.set(r,u),u}this._cache.set(r,null)}async generate(t,{id:e,scope:r,preflights:s=!0,safelist:i=!0,minify:o=!1}={}){let a=typeof t=="string"?await this.applyExtractors(t,e):t;i&&this.config.safelist.forEach(p=>a.add(p));let c=o?"":`
2
+ `,f=new Set(["default"]),u=new Set,x=new Map;await Promise.all(Array.from(a).map(async p=>{var g;if(u.has(p))return;let h=await this.parseToken(p);if(h!=null){u.add(p);for(let S of h){let R=S[3]||"";x.has(R)||x.set(R,[]),x.get(R).push(S),((g=S[4])==null?void 0:g.layer)&&f.add(S[4].layer)}}})),s&&this.config.preflights.forEach(p=>{p.layer&&f.add(p.layer)});let l={},y=this.config.sortLayers(Array.from(f).sort((p,h)=>{var g,S;return((g=this.config.layers[p])!=null?g:0)-((S=this.config.layers[h])!=null?S:0)||p.localeCompare(h)})),w={};s&&(w=Object.fromEntries(await Promise.all(y.map(async p=>{let g=(await Promise.all(this.config.preflights.filter(S=>(S.layer||"default")===p).map(async S=>await S.getCSS()))).filter(Boolean).join(c);return[p,g]}))));let A=p=>{if(l[p])return l[p];let h=Array.from(x).sort((g,S)=>{var R,U,d;return((R=this.parentOrders.get(g[0]))!=null?R:0)-((U=this.parentOrders.get(S[0]))!=null?U:0)||((d=g[0])==null?void 0:d.localeCompare(S[0]||""))||0}).map(([g,S])=>{let R=S.length,U=S.filter(m=>{var b;return(((b=m[4])==null?void 0:b.layer)||"default")===p}).sort((m,b)=>{var T,O,E;return m[0]-b[0]||(((T=m[4])==null?void 0:T.sort)||0)-(((O=b[4])==null?void 0:O.sort)||0)||((E=m[1])==null?void 0:E.localeCompare(b[1]||""))||0}).map(m=>{var b;return[m[1]?$t(m[1],r):m[1],m[2],!!((b=m[4])==null?void 0:b.noMerge)]}).map(m=>[m[0]==null?m[0]:[m[0]],m[1],m[2]]);if(!U.length)return;let d=U.reverse().map(([m,b,T],O)=>{if(!T&&m&&this.config.mergeSelectors)for(let E=O+1;E<R;E++){let _=U[E];if(_&&!_[2]&&_[0]&&_[1]===b)return _[0].push(...m),null}return m?`${[...new Set(m)].join(`,${c}`)}{${b}}`:b}).filter(Boolean).reverse().join(c);return g?`${g}{${c}${d}${c}}`:d}).filter(Boolean).join(c);return s&&(h=[w[p],h].filter(Boolean).join(c)),l[p]=!o&&h?`/* layer: ${p} */${c}${h}`:h},C=(p=y,h)=>p.filter(g=>!(h==null?void 0:h.includes(g))).map(g=>A(g)||"").filter(Boolean).join(c);return{get css(){return C()},layers:y,getLayers:C,getLayer:A,matched:u}}matchVariants(t,e){let r=new Set,s=[],i=e||t,o=!1,a={rawSelector:t,theme:this.config.theme,generator:this};for(;;){o=!1;for(let c of this.config.variants){if(!c.multiPass&&r.has(c))continue;let f=c.match(i,a);if(!!f&&(typeof f=="string"&&(f={matcher:f}),f)){i=f.matcher,Array.isArray(f.parent)&&this.parentOrders.set(f.parent[0],f.parent[1]),s.push(f),r.add(c),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,i,s]}applyVariants(t,e=t[4],r=t[1]){let s=[...e].sort((a,c)=>(a.order||0)-(c.order||0)),i=s.reduce((a,c)=>{var f;return((f=c.body)==null?void 0:f.call(c,a))||a},t[2]),o={selector:s.reduce((a,c)=>{var f;return((f=c.selector)==null?void 0:f.call(c,a,i))||a},Tt(r)),entries:i,parent:s.reduce((a,c)=>Array.isArray(c.parent)?c.parent[0]:c.parent||a,void 0),layer:s.reduce((a,c)=>c.layer||a,void 0),sort:s.reduce((a,c)=>c.sort||a,void 0)};for(let a of this.config.postprocess)a(o);return o}constructCustomCSS(t,e,r){e=v(e);let{selector:s,entries:i,parent:o}=this.applyVariants([0,r||t.rawSelector,e,void 0,t.variantHandlers]),a=`${s}{${K(i)}}`;return o?`${o}{${a}}`:a}async parseUtil(t,e,r=!1){var u,x;let[s,i,o]=typeof t=="string"?this.matchVariants(t):t,a=this.config.rulesStaticMap[i];if(a&&a[1]&&(r||!((u=a[2])==null?void 0:u.internal)))return[[a[0],s,v(a[1]),a[2],o]];e.variantHandlers=o;let{rulesDynamic:c,rulesSize:f}=this.config;for(let l=f;l>=0;l--){let y=c[l];if(!y||((x=y[2])==null?void 0:x.internal)&&!r)continue;let[w,A,C]=y,p=i.match(w);if(!p)continue;let h=await A(p,e);if(!h)continue;if(typeof h=="string")return[[l,h,C]];let g=Q(h).filter(S=>S.length);if(g.length)return g.map(S=>[l,s,S,C,o])}}stringifyUtil(t){var l;if(!t)return;if(B(t))return[t[0],void 0,t[1],void 0,t[2]];let{selector:e,entries:r,parent:s,layer:i,sort:o}=this.applyVariants(t),a=K(r);if(!a)return;let y=(l=t[3])!=null?l:{},{layer:c,sort:f}=y,u=J(y,["layer","sort"]),x=M($({},u),{layer:i!=null?i:c,sort:o!=null?o:f});return[t[0],e,a,s,x]}expandShortcut(t,e,r=3){if(r===0)return;let s,i;for(let o of this.config.shortcuts)if(Y(o)){if(o[0]===t){s=s||o[2],i=o[1];break}}else{let a=t.match(o[0]);if(a&&(i=o[1](a,e)),i){s=s||o[2];break}}if(typeof i=="string"&&(i=nt(i).split(/\s+/g)),!!i)return[i.flatMap(o=>{var a;return((a=this.expandShortcut(o,e,r-1))==null?void 0:a[0])||[o]}).filter(o=>o!==""),s]}async stringifyShortcuts(t,e,r,s={layer:this.config.shortcutsLayer}){var f;let i=new G,o=(await Promise.all(k(r).map(async u=>{let x=await this.parseUtil(u,e,!0);return x||it(`unmatched utility "${u}" in shortcut "${t[1]}"`),x||[]}))).flat(1).filter(Boolean).sort((u,x)=>u[0]-x[0]),[a,,c]=t;for(let u of o){if(B(u))continue;let{selector:x,entries:l,parent:y,sort:w}=this.applyVariants(u,[...u[4],...c],a);i.getFallback(x,y,[[],u[0]])[0].push([l,!!((f=u[3])==null?void 0:f.noMerge),w!=null?w:0])}return i.map(([u,x],l,y)=>{let w=(C,p,h)=>{let g=Math.max(...h.map(R=>R[1])),S=h.map(R=>R[0]);return(C?[S.flat(1)]:S).map(R=>{let U=K(R);if(U)return[x,l,U,y,M($({},s),{noMerge:p,sort:g})]})};return[[u.filter(([,C])=>C).map(([C,,p])=>[C,p]),!0],[u.filter(([,C])=>!C).map(([C,,p])=>[C,p]),!1]].map(([C,p])=>[...w(!1,p,C.filter(([h])=>h.some(g=>g[0]===z))),...w(!0,p,C.filter(([h])=>h.every(g=>g[0]!==z)))])}).flat(2).filter(Boolean)}isBlocked(t){return!t||this.config.blocklist.some(e=>typeof e=="string"?e===t:e.test(t))}};function lt(n,t){return new ct(n,t)}var ut=/ \$\$ /,At=n=>n.match(ut);function $t(n,t){return At(n)?n.replace(ut,t?` ${t} `:" "):t?`${t} ${n}`:n}var at=/^\[(.+?)(~?=)"(.*)"\]$/;function Tt(n){return at.test(n)?n.replace(at,(t,e,r,s)=>`[${D(e)}${r}"${D(s)}"]`):`.${D(n)}`}var Ot=n=>n.replace(/-(\w)/g,(t,e)=>e?e.toUpperCase():""),ft=n=>n.charAt(0).toUpperCase()+n.slice(1),pt=n=>n.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),dt=["Webkit","Moz","ms"];function ht(n){let t={};function e(r){let s=t[r];if(s)return s;let i=Ot(r);if(i!=="filter"&&i in n)return t[r]=pt(i);i=ft(i);for(let o=0;o<dt.length;o++){let a=`${dt[o]}${i}`;if(a in n)return t[r]=pt(ft(a))}return r}return({entries:r})=>r.forEach(s=>{s[0].startsWith("--")||(s[0]=e(s[0]))})}function q(n={}){var R,U;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window.__unocss||{},e=t==null?void 0:t.runtime,r=Object.assign(n.defaults||{},e);if(e==null?void 0:e.autoPrefix){let d=r.postprocess;d||(d=[]),Array.isArray(d)||(d=[d]),d.unshift(ht(document.createElement("div").style)),r.postprocess=d}(R=e==null?void 0:e.configResolved)==null||R.call(e,t,r);let s,i=!0,o,a=lt(t,r),c=new Set,f,u=[],x=()=>new Promise(d=>{u.push(d),f!=null&&clearTimeout(f),f=setTimeout(()=>l().then(()=>{let m=u;u=[],m.forEach(b=>b())}),0)});async function l(){let d=await a.generate(c);s||(s=document.createElement("style"),document.documentElement.prepend(s)),s.innerHTML=d.css}async function y(d){await a.applyExtractors(d,void 0,c),await x()}async function w(){let d=document.body&&document.body.outerHTML;d&&await y(d)}let A=new MutationObserver(d=>{i||d.forEach(m=>{let b=m.target;if(b===s||o&&!o(b))return;let T=Array.from(b.attributes).map(E=>E.value?`${E.name}="${E.value}"`:E.name).join(" "),O=`<${b.tagName.toLowerCase()} ${T}>`;y(O)})}),C=!1;function p(){if(!C)return;let d=document.documentElement||document.body;!d||(A.observe(d,{childList:!0,subtree:!0,attributes:!0}),C=!0)}function h(){w(),p()}function g(){h(),window.addEventListener("load",h),window.addEventListener("DOMContentLoaded",h)}let S=window.__unocss_runtime=window.__unocss_runtime={version:a.version,uno:a,async extract(d){if(typeof d=="string")return await y(d);d.forEach(m=>c.add(m)),await l()},extractAll:w,inspect(d){o=d},toggleObserver(d){d===void 0?i=!i:i=!!d,!C&&!i&&g()}};((U=e==null?void 0:e.ready)==null?void 0:U.call(e,S))!==!1&&(i=!1,g())}q();})();