effcss 3.10.0 → 3.10.1

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.
@@ -1,7 +1,7 @@
1
1
  /*
2
- * EffCSS v3.10.0
2
+ * EffCSS v3.10.1
3
3
  * {@link https://gitverse.ru/msabitov/effcss}
4
4
  * Copyright (c) Marat Sabitov
5
5
  * @license Apache-2.0
6
6
  */
7
- "function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>"string"==typeof t,i=t=>null!==t&&"object"==typeof t,a=t=>t.split("."),l=(s,r)=>e(s).reduce(((s,[n,a])=>{if(i(a)){const l=e(a);l.length?s.push(...l.reduce(((s,[a,l])=>{if((e=>null!==e&&e!==t)(a)&&r&&s.push([n,a,t,t]),i(l)){const t=e(l);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,a,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),c=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),o=(t,e)=>"."+(e?t+"-"+e:t),h=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`,u=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:u(t[e],r||{}):t[e]=r})),t)),t):t,g={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},m="effcss-provider",p={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=t=>Number((.1*184+.9*t).toFixed(2)),b={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:d(142),inf:d(264),war:d(109),dan:d(29)}},f={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:g,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:g},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:b,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}};const x=t=>t||"",v=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},y=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},$=(t,e,s)=>Object.entries(t).reduce(e,s),j=Symbol("noParse"),O=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(j)?`${l=a,l.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${$(e,((t,e)=>t+O(...e,a)),"")}}`;var l},k="@media",_="@container",w="@property",S="@keyframes",q="@layer",A="@scope",P="@supports",E=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};E.toString=()=>k;const z=t=>`(${t})`,C=t=>"string"==typeof t;function W(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>C(t)?z(t):W(t))).join(" or ");case"and":return t.args.map((t=>{const e=!C(t);return e&&"or"===t.key?z(W(t)):e?W(t):z(t)})).join(" and ");case"not":const e=t.args[0];return"not "+(C(e)?z(e):z(W(e)))}}const I=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?z(W(e)):W(e))),s},N=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=I(e,s);return{[`${k}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>N({state:s,type:["all"]})},print:{get:()=>N({state:s,type:["print"]})},screen:{get:()=>N({state:s,type:["screen"]})},and:{value:(...t)=>N({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>N({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>N(s?{type:e,state:C(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},K=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[A+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>K({root:e,limit:t,mode:r})},root:{value:t=>K({root:t,limit:s,mode:r})},both:{value:()=>K({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>K({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>K({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>K({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},M=t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=_+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>_;const r=(s={})=>{const{scroll:n,type:i,name:a,state:l}=s;return Object.defineProperties((t=>{const e=I([],l);return{[`${_}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==l?void 0:l.key},args:{value:null==l?void 0:l.args},named:{get:()=>r({scroll:n,state:l,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:l,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:l,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:l,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:l?[l,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:l?[l,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[j]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=w+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};n.toString=()=>w;const i=s=>{const r=s||t.name("kf",e.kf++),n=S+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>S;const a=s=>{const r=s||t.name("lay",e.lay++),n=q+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>q;a.toString=()=>A;const l=(t="",e=!1)=>{const s=P+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return l.toString=()=>P,{pr:n,kf:i,mq:E,cq:s,lay:a,sc:(t="",e="")=>{const s=A+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:l,keyframes:s=>{const r=t.name("kf",e.kf++),n=S+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:l,fm:c}=t;return{animation:[e,s,n,i,a,l,c,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[j]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,l="--"+t.name("cp",e.cp++),c=`var(${l}${void 0!==a?","+a:""})`,o=w+" "+l;return Object.defineProperties((t=>({[l]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>c},[j]:{value:!0}})},scope:K({}),media:N({}),container:r({})}},B=t=>t+"px",L=t=>t+"vh",R=t=>t+"vw",V=t=>t+"vmin",F=t=>t+"vmax",H=t=>t+"rem",T=t=>t+"deg",Z=t=>t+"ms",D=t=>t+"%",G=t=>t+"cqw",J=t=>t+"cqh",Q=t=>t+"cqi",U=t=>t+"cqb",X=t=>t+"cqmin",Y=t=>t+"cqmax",tt=Object.fromEntries,et=Object.entries,st=":first-",rt=":last-",nt=":only-",it="child",at=":nth-",lt="of-type",ct=at+it,ot=":focus",ht={r:":root",h:":hover",f:ot,fv:ot+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:st+it,lc:rt+it,oc:nt+it,odd:ct+"(odd)",even:ct+"(even)",ft:st+lt,lt:rt+lt,ot:nt+lt,bef:"::before",aft:"::after",bd:"::backdrop"},ut={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:ct,ntho:at+lt,dir:":dir",lang:":lang"},gt="oklch",mt=t=>gt+`(${t})`,pt=t=>mt(`from ${t}`),dt="def",bt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",dt),c:e("c",dt),h:e("h",dt),a:e("a",dt)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return mt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ft=(t,e=.1)=>pt(`${t} calc(l + ${e}) c h / alpha)`),xt=(t,e=.1)=>pt(`${t} calc(l - ${e}) c h / alpha)`),vt=(t,e=.1)=>pt(`${t} l c h / calc(alpha + ${e}))`),yt=(t,e=.1)=>pt(`${t} l c h / calc(alpha - ${e}))`),$t=(t,e=.04)=>pt(`${t} l calc(c + ${e}) h / alpha)`),jt=(t,e=.04)=>pt(`${t} l calc(c - ${e}) h / alpha)`),Ot=(t,e=30)=>pt(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),kt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||gt}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,_t=t=>({create:bt(t),oklch:mt,lighten:ft,darken:xt,saturate:$t,desaturate:jt,fadein:vt,fadeout:yt,spin:Ot,mix:kt}),wt="palette",St=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[j]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(wt,"l",i,e)} ${t(wt,"c",i,s)} ${t(wt,"h",r)} / ${n})`}}return new e},qt="coef",At=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(qt,this.state.center-4)}get xxs(){return t(qt,this.state.center-3)}get xs(){return t(qt,this.state.center-2)}get s(){return t(qt,this.state.center-1)}get m(){return t(qt,this.state.center)}get l(){return t(qt,this.state.center+1)}get xl(){return t(qt,this.state.center+2)}get xxl(){return t(qt,this.state.center+3)}get max(){return t(qt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},Pt=Object.assign,Et=Object.entries,zt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Pt(t,e(s+1))),{}),each:(t,e)=>Et(t).reduce(((t,[s,r])=>Pt(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Ct="width: ",Wt=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,l=(t=1)=>`calc(${t} * ${i("rangle")})`,c=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=M(o),g=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},m=t=>"min-"+Ct+g(t),p=t=>"max-"+Ct+g(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(m(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(m(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(zt,{key:t,vars:i,size:c,time:a,angle:l,bem:o.selector,pseudo:Object.assign(tt(et(ht).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),tt(et(ut).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:_t(n),palette:St(n),coef:At(n),units:{px:B,vh:L,vw:R,vmin:V,vmax:F,rem:H,deg:T,ms:Z,pc:D,cqw:G,cqh:J,cqb:U,cqi:Q,cqmin:X,cqmax:Y},at:h,limit:f,merge:u})),$(x,((t,e)=>t+O(...e)),"");var x}}};const It="theme",Nt="size",Kt="time",Mt="angle",Bt="palette",Lt=Object.assign,Rt=Object.entries,Vt=Object.fromEntries,Ft=(t,e)=>t.getAttribute(e)||p[e],Ht=(t,e)=>{const s=Ft(t,e);return null!==s?Number(s):null},Tt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Zt=t=>`:root:has(script[is=${m}]${t?`[${t}]`:""})`,Dt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Gt=["xs","s","m","l","xl"],Jt=["pale","base","rich"];!function(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(m))return!1;{class i extends HTMLScriptElement{constructor(){super(...arguments),this._c=y(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=t=>{const e=c(t);return!!e&&-1!==l(e)};return{apply:i,notify:a,getIndex:l,get:c,has:t=>!!t&&!!c(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);if(r&&h(e)){const e=l(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=c(r);if(!n)return;const i=l(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&o(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=f,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Rt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Lt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Vt(Rt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:l,light:c}=i,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Dt(b.$0_),1,...Dt(b.$1_),2,...Dt(b.$2_),16,...Dt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:l,merge:c,at:{media:b},units:{px:x,ms:v,deg:y}})=>{const $="prefers-color-scheme",j={light:`${$}: light`,dark:`${$}: dark`};return c({[Zt()]:c({fontSize:l("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Bt,"h",t)]:e}))),{[s(Bt,"c","bg","gray")]:0,[s(Bt,"c","fg","gray")]:0},e(j,((t,r)=>b.and(r)(c(i[t]||{},e(Gt,((e,r)=>({[s(Bt,"l","bg",r)]:m[t].bg[r],[s(Bt,"l","fg",r)]:m[t].fg[r]}))),e(Jt,((e,r)=>({[s(Bt,"c","bg",r)]:p[t].bg[r],[s(Bt,"c","fg",r)]:p[t].fg[r]}))))))))},e(o,((e,s)=>({[Zt(`${It}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Zt(Nt)]:{[r("rem")]:x(h)}}),n(!!u,{[Zt(Kt)]:{[r("rtime")]:v(u)}}),n(!!g,{[Zt(Mt)]:{[r("rangle")]:y(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(n))&&(this._m.pack(n,this.css(t,n)),e||this._k.next()),this.resolve(n)},this.usePublic=t=>Vt(Rt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:this._c.keys,e.map((t=>this._m.get(this.key(t))))}}static get observedAttributes(){return[Nt,Kt,Mt]}get prefix(){return Ft(this,"prefix")||""}get mode(){return this.getAttribute("mode")||"a"}get min(){return"string"==typeof this.getAttribute("min")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=u({},this._settings,t),{makers:i,bp:a,off:l}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Wt({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==l?void 0:l.length)&&this._settings.off!==l&&this.off(...l),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}set theme(t){Tt(this,It,t)}get theme(){return Ft(this,It)||""}set size(t){Tt(this,Nt,t)}get size(){return Ht(this,Nt)}set time(t){Tt(this,"time",t)}get time(){return Ht(this,Kt)}set angle(t){Tt(this,"angle",t)}get angle(){return Ht(this,Mt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=v({prefix:this.prefix}),this._s=((t={})=>{const{mode:e,min:s}=t;let i,u;return i="a"===e?h:o,s&&(u={}),t=>{let s=0,o=x,h=x;u&&(u[t]||(u[t]={}),o=e=>{var r;return null!==(r=u[t][e])&&void 0!==r?r:u[t][e]=(s++).toString(36)},h=e=>u[t][e]);let g=(...e)=>[t,...e].filter(Boolean).join("-"),m="class",p=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(m="data-"+t,p=x);const d=(...t)=>"--"+g(...t),b=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(b);let e,s,i,o,u="";const g=n(t);return u=g||Array.isArray(t)?[...(g?[t]:t).reduce(((t,r)=>([e,s,i,o]=a(r),t.add(p(h(c(e,s)))),i&&t.add(p(h(c(e,s,i,o)))),t)),new Set).values()].join(" "):t&&l(t,!0).map((([t,e,s,r])=>p(h(c(t,e,s,r))))).join(" "),r({[m]:u},{toString:{value:()=>`${m}="${u}"`},$:{value:u}})};return{selector:e=>{let s,r,h,u;return n(e)?([s,r,h,u]=a(e),i(t,o(c(s,r,h,u)))):e&&l(e).map((([e,s,r,n])=>i(t,o(c(e,s,r,n))))).join(",")},attr:b,name:g,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode,min:this.min});const s=this;this._n={set adoptedStyleSheets(t){s.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}s.define(m,i,{extends:"script"})}}();
7
+ "function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>"string"==typeof t,i=t=>null!==t&&"object"==typeof t,a=t=>t.split("."),l=(s,r)=>e(s).reduce(((s,[n,a])=>{if(i(a)){const l=e(a);l.length?s.push(...l.reduce(((s,[a,l])=>{if((e=>null!==e&&e!==t)(a)&&r&&s.push([n,a,t,t]),i(l)){const t=e(l);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,a,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),c=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),o=(t,e)=>"."+(e?t+(e.startsWith("_")?"":"-")+e:t),h=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`,u=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:u(t[e],r||{}):t[e]=r})),t)),t):t,g={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},m="effcss-provider",p={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=t=>Number((.1*184+.9*t).toFixed(2)),b={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:d(142),inf:d(264),war:d(109),dan:d(29)}},f={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:g,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:g},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:b,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}};const x=t=>t||"",v=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},y=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},$=(t,e,s)=>Object.entries(t).reduce(e,s),j=Symbol("noParse"),O=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(j)?`${l=a,l.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${$(e,((t,e)=>t+O(...e,a)),"")}}`;var l},k="@media",_="@container",w="@property",S="@keyframes",q="@layer",A="@scope",P="@supports",E=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};E.toString=()=>k;const z=t=>`(${t})`,C=t=>"string"==typeof t;function W(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>C(t)?z(t):W(t))).join(" or ");case"and":return t.args.map((t=>{const e=!C(t);return e&&"or"===t.key?z(W(t)):e?W(t):z(t)})).join(" and ");case"not":const e=t.args[0];return"not "+(C(e)?z(e):z(W(e)))}}const I=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?z(W(e)):W(e))),s},N=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=I(e,s);return{[`${k}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>N({state:s,type:["all"]})},print:{get:()=>N({state:s,type:["print"]})},screen:{get:()=>N({state:s,type:["screen"]})},and:{value:(...t)=>N({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>N({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>N(s?{type:e,state:C(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},K=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[A+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>K({root:e,limit:t,mode:r})},root:{value:t=>K({root:t,limit:s,mode:r})},both:{value:()=>K({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>K({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>K({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>K({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},M=t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=_+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>_;const r=(s={})=>{const{scroll:n,type:i,name:a,state:l}=s;return Object.defineProperties((t=>{const e=I([],l);return{[`${_}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==l?void 0:l.key},args:{value:null==l?void 0:l.args},named:{get:()=>r({scroll:n,state:l,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:l,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:l,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:l,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:l?[l,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:l?[l,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[j]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=w+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};n.toString=()=>w;const i=s=>{const r=s||t.name("kf",e.kf++),n=S+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>S;const a=s=>{const r=s||t.name("lay",e.lay++),n=q+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>q;a.toString=()=>A;const l=(t="",e=!1)=>{const s=P+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return l.toString=()=>P,{pr:n,kf:i,mq:E,cq:s,lay:a,sc:(t="",e="")=>{const s=A+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:l,keyframes:s=>{const r=t.name("kf",e.kf++),n=S+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:l,fm:c}=t;return{animation:[e,s,n,i,a,l,c,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[j]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,l="--"+t.name("cp",e.cp++),c=`var(${l}${void 0!==a?","+a:""})`,o=w+" "+l;return Object.defineProperties((t=>({[l]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>c},[j]:{value:!0}})},scope:K({}),media:N({}),container:r({})}},B=t=>t+"px",L=t=>t+"vh",R=t=>t+"vw",V=t=>t+"vmin",F=t=>t+"vmax",H=t=>t+"rem",T=t=>t+"deg",Z=t=>t+"ms",D=t=>t+"%",G=t=>t+"cqw",J=t=>t+"cqh",Q=t=>t+"cqi",U=t=>t+"cqb",X=t=>t+"cqmin",Y=t=>t+"cqmax",tt=Object.fromEntries,et=Object.entries,st=":first-",rt=":last-",nt=":only-",it="child",at=":nth-",lt="of-type",ct=at+it,ot=":focus",ht={r:":root",h:":hover",f:ot,fv:ot+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:st+it,lc:rt+it,oc:nt+it,odd:ct+"(odd)",even:ct+"(even)",ft:st+lt,lt:rt+lt,ot:nt+lt,bef:"::before",aft:"::after",bd:"::backdrop"},ut={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:ct,ntho:at+lt,dir:":dir",lang:":lang"},gt="oklch",mt=t=>gt+`(${t})`,pt=t=>mt(`from ${t}`),dt="def",bt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",dt),c:e("c",dt),h:e("h",dt),a:e("a",dt)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return mt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ft=(t,e=.1)=>pt(`${t} calc(l + ${e}) c h / alpha)`),xt=(t,e=.1)=>pt(`${t} calc(l - ${e}) c h / alpha)`),vt=(t,e=.1)=>pt(`${t} l c h / calc(alpha + ${e}))`),yt=(t,e=.1)=>pt(`${t} l c h / calc(alpha - ${e}))`),$t=(t,e=.04)=>pt(`${t} l calc(c + ${e}) h / alpha)`),jt=(t,e=.04)=>pt(`${t} l calc(c - ${e}) h / alpha)`),Ot=(t,e=30)=>pt(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),kt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||gt}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,_t=t=>({create:bt(t),oklch:mt,lighten:ft,darken:xt,saturate:$t,desaturate:jt,fadein:vt,fadeout:yt,spin:Ot,mix:kt}),wt="palette",St=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[j]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(wt,"l",i,e)} ${t(wt,"c",i,s)} ${t(wt,"h",r)} / ${n})`}}return new e},qt="coef",At=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(qt,this.state.center-4)}get xxs(){return t(qt,this.state.center-3)}get xs(){return t(qt,this.state.center-2)}get s(){return t(qt,this.state.center-1)}get m(){return t(qt,this.state.center)}get l(){return t(qt,this.state.center+1)}get xl(){return t(qt,this.state.center+2)}get xxl(){return t(qt,this.state.center+3)}get max(){return t(qt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},Pt=Object.assign,Et=Object.entries,zt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Pt(t,e(s+1))),{}),each:(t,e)=>Et(t).reduce(((t,[s,r])=>Pt(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Ct="width: ",Wt=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,l=(t=1)=>`calc(${t} * ${i("rangle")})`,c=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=M(o),g=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},m=t=>"min-"+Ct+g(t),p=t=>"max-"+Ct+g(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(m(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(m(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(zt,{key:t,vars:i,size:c,time:a,angle:l,bem:o.selector,pseudo:Object.assign(tt(et(ht).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),tt(et(ut).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:_t(n),palette:St(n),coef:At(n),units:{px:B,vh:L,vw:R,vmin:V,vmax:F,rem:H,deg:T,ms:Z,pc:D,cqw:G,cqh:J,cqb:U,cqi:Q,cqmin:X,cqmax:Y},at:h,limit:f,merge:u})),$(x,((t,e)=>t+O(...e)),"");var x}}};const It="theme",Nt="size",Kt="time",Mt="angle",Bt="palette",Lt=Object.assign,Rt=Object.entries,Vt=Object.fromEntries,Ft=(t,e)=>t.getAttribute(e)||p[e],Ht=(t,e)=>{const s=Ft(t,e);return null!==s?Number(s):null},Tt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Zt=t=>`:root:has(script[is=${m}]${t?`[${t}]`:""})`,Dt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Gt=["xs","s","m","l","xl"],Jt=["pale","base","rich"];!function(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(m))return!1;{class i extends HTMLScriptElement{constructor(){super(...arguments),this._c=y(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=t=>{const e=c(t);return!!e&&-1!==l(e)};return{apply:i,notify:a,getIndex:l,get:c,has:t=>!!t&&!!c(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);if(r&&h(e)){const e=l(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=c(r);if(!n)return;const i=l(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&o(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=f,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Rt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Lt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Vt(Rt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:l,light:c}=i,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Dt(b.$0_),1,...Dt(b.$1_),2,...Dt(b.$2_),16,...Dt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:l,merge:c,at:{media:b},units:{px:x,ms:v,deg:y}})=>{const $="prefers-color-scheme",j={light:`${$}: light`,dark:`${$}: dark`};return c({[Zt()]:c({fontSize:l("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Bt,"h",t)]:e}))),{[s(Bt,"c","bg","gray")]:0,[s(Bt,"c","fg","gray")]:0},e(j,((t,r)=>b.and(r)(c(i[t]||{},e(Gt,((e,r)=>({[s(Bt,"l","bg",r)]:m[t].bg[r],[s(Bt,"l","fg",r)]:m[t].fg[r]}))),e(Jt,((e,r)=>({[s(Bt,"c","bg",r)]:p[t].bg[r],[s(Bt,"c","fg",r)]:p[t].fg[r]}))))))))},e(o,((e,s)=>({[Zt(`${It}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Zt(Nt)]:{[r("rem")]:x(h)}}),n(!!u,{[Zt(Kt)]:{[r("rtime")]:v(u)}}),n(!!g,{[Zt(Mt)]:{[r("rangle")]:y(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(n))&&(this._m.pack(n,this.css(t,n)),e||this._k.next()),this.resolve(n)},this.usePublic=t=>Vt(Rt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:this._c.keys,e.map((t=>this._m.get(this.key(t))))}}static get observedAttributes(){return[Nt,Kt,Mt]}get prefix(){return Ft(this,"prefix")||""}get mode(){return this.getAttribute("mode")||"a"}get min(){return"string"==typeof this.getAttribute("min")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=u({},this._settings,t),{makers:i,bp:a,off:l}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Wt({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==l?void 0:l.length)&&this._settings.off!==l&&this.off(...l),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}set theme(t){Tt(this,It,t)}get theme(){return Ft(this,It)||""}set size(t){Tt(this,Nt,t)}get size(){return Ht(this,Nt)}set time(t){Tt(this,"time",t)}get time(){return Ht(this,Kt)}set angle(t){Tt(this,"angle",t)}get angle(){return Ht(this,Mt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=v({prefix:this.prefix}),this._s=((t={})=>{const{mode:e,min:s}=t;let i,u;return i="a"===e?h:o,s&&(u={}),t=>{let s=0,o=x,h=x;u&&(u[t]||(u[t]={}),o=e=>{var r;return null!==(r=u[t][e])&&void 0!==r?r:u[t][e]=(s++).toString(36)},h=e=>u[t][e]);let g=(...e)=>[t,...e].filter(Boolean).join("-"),m="class",p=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(m="data-"+t,p=x);const d=(...t)=>"--"+g(...t),b=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(b);let e,s,i,o,u="";const g=n(t);return u=g||Array.isArray(t)?[...(g?[t]:t).reduce(((t,r)=>([e,s,i,o]=a(r),t.add(p(h(c(e,s)))),i&&t.add(p(h(c(e,s,i,o)))),t)),new Set).values()].join(" "):t&&l(t,!0).map((([t,e,s,r])=>p(h(c(t,e,s,r))))).join(" "),r({[m]:u},{toString:{value:()=>`${m}="${u}"`},$:{value:u}})};return{selector:e=>{let s,r,h,u;return n(e)?([s,r,h,u]=a(e),i(t,o(c(s,r,h,u)))):e&&l(e).map((([e,s,r,n])=>i(t,o(c(e,s,r,n))))).join(",")},attr:b,name:g,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode,min:this.min});const s=this;this._n={set adoptedStyleSheets(t){s.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}s.define(m,i,{extends:"script"})}}();
package/dist/consumer.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * EffCSS v3.10.0
2
+ * EffCSS v3.10.1
3
3
  * {@link https://gitverse.ru/msabitov/effcss}
4
4
  * Copyright (c) Marat Sabitov
5
5
  * @license Apache-2.0
6
6
  */
7
- const e=void 0,t=Object.entries,r=Object.defineProperties,n=e=>"string"==typeof e,s=e=>null!==e&&"object"==typeof e,u=e=>e.split("."),i=(r,n)=>t(r).reduce(((r,[u,i])=>{if(s(i)){const l=t(i);l.length?r.push(...l.reduce(((r,[i,l])=>{if((t=>null!==t&&t!==e)(i)&&n&&r.push([u,i,e,e]),s(l)){const e=t(l);e.length&&r.push(...e.reduce(((e,[t,r])=>{const n=typeof r;return"string"!==n&&"number"!==n||e.push([u,i,t,r]),e}),[]))}return r}),[])):r.push([u,e,e,e])}return r}),[]),l=(e,t,r,n)=>""+(((e,t)=>`${e||""}${t?"__"+t:""}`)(e,t)+(r?"_"+r:"")+(r&&n?"_"+n:"")),a=(e,t)=>"."+(t?e+"-"+t:e),o=(e,t)=>`[data-${e}${t?`~="${t}"`:""}]`,m="effcss-provider",c={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=e=>Number((.1*184+.9*e).toFixed(2));d(142),d(264),d(109),d(29);Array(12).keys();const g=e=>e||"",p=({prefix:e})=>{let t=1;return{get base(){return e+0},get current(){return e+t},next(){return t++,this.current},reset(){t=1}}},f=()=>{const e=new Set,r=new Map;return{use(t,n){const s=r.get(t);return s||(e.add(n),r.set(t,n),n)},useMany(e){return t(e).map((([e,t])=>this.use(t,e)))},getKey:e=>r.get(e),get keys(){return[...e]},get makers(){return Object.fromEntries(r.entries().map((([e,t])=>[t,e])))}}},b=e=>null==e?null:Number(e),$=(e={})=>{var t;let s,d,$,h,v,y,j,x,S=null===(t=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===t?void 0:t.querySelector(`script[is=${m}]`);if(S)return S;({prefix:d,mode:$,hydrate:v,theme:s,size:y,time:j,angle:x,min:h}=Object.assign({},c,e));let k,O,z,_=b(y),w=b(j),A=b(x);const E=new Set,N=()=>d||c.prefix,P=()=>$||c.mode,T=()=>""===v,B=p({prefix:N()}),K=((e={})=>{const{mode:t,min:s}=e;let m,c;return m="a"===t?o:a,s&&(c={}),e=>{let s=0,a=g,o=g;c&&(c[e]||(c[e]={}),a=t=>{var r;return null!==(r=c[e][t])&&void 0!==r?r:c[e][t]=(s++).toString(36)},o=t=>c[e][t]);let d=(...t)=>[e,...t].filter(Boolean).join("-"),p="class",f=t=>t?e+(t.startsWith("_")?"":"-")+t:void 0===t?void 0:e;"a"===t&&(p="data-"+e,f=g);const b=(...e)=>"--"+d(...e),$=e=>{if(void 0===e)return function(e){const t=({b:r,e:n,m:s})=>({b:e=>t({b:e,e:"",m:{}}),e:e=>t({b:r,e:e,m:{}}),m:(e={})=>t({b:r,e:n,m:e}),get $(){return e({[r]:{[n]:s}})}});return t({b:"",e:"",m:{}})}($);let t,s,a,m,c="";const d=n(e);return c=d||Array.isArray(e)?[...(d?[e]:e).reduce(((e,r)=>([t,s,a,m]=u(r),e.add(f(o(l(t,s)))),a&&e.add(f(o(l(t,s,a,m)))),e)),new Set).values()].join(" "):e&&i(e,!0).map((([e,t,r,n])=>f(o(l(e,t,r,n))))).join(" "),r({[p]:c},{toString:{value:()=>`${p}="${c}"`},$:{value:c}})};return{selector:t=>{let r,s,o,c;return n(t)?([r,s,o,c]=u(t),m(e,a(l(r,s,o,c)))):t&&i(t).map((([t,r,n,s])=>m(e,a(l(t,r,n,s))))).join(",")},attr:$,name:d,varName:b,varExp:(...e)=>`var(${b(...e)})`}}})({mode:P()}),M=f(),q=e=>"string"==typeof e?e:M.getKey(e),F=e=>K(e||B.base).attr,W=(e,t)=>{const r=t||B.current;let n=M.use(e,r);return t||B.next(),F(n)};return{get makers(){return M.makers},get prefix(){return N()},get mode(){return P()},get min(){return""===h},get hydrate(){return T()},set theme(e){s=e},get theme(){return s||""},get size(){return _},set size(e){_=e},get time(){return w},set time(e){w=e},get angle(){return A},set angle(e){A=e},get settings(){return{bp:z,vars:O,off:[...E],makers:M.makers,palette:k}},set settings(e){({bp:z,vars:O,palette:k}=e)},resolve:F,use:W,usePublic:e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,W(t,e)]))),usePrivate:e=>e.map((e=>W(e))),css:()=>"",key:q,status:e=>{const t=q(e);return!!t&&!E.has(t)},on:(...e)=>e.map(q).reduce(((e,t)=>e&&!!t&&E.delete(t)),!0),off:(...e)=>e.map(q).reduce(((e,t)=>e&&!!t&&!!E.add(t)),!0),stylesheets:()=>[],toString(){const e=M.makers;delete e[B.base];const t=Object.entries({is:m,prefix:N(),mode:P(),hydrate:T(),theme:s,size:null!==_&&String(_),time:null!==w&&String(w),angle:null!==A&&String(A)}).map((([e,t])=>t?`${e}="${t}"`:""===t?e:"")).filter(Boolean).join(" "),r=`document.currentScript.settings = {makers: {${e?Object.entries(e).reduce(((e,[t,r])=>e+`${e?",":""}${t}: ${r.toString().replaceAll(/\s+/g," ")}`),""):""}},${O?` vars: ${O},`:""}${z?` bp: ${z},`:""}${k?` palette: ${k},`:""}${E.size?` off: [${[...E]}]`:""}}`;return`<script ${t}>${r}<\/script>`}}};export{$ as createConsumer};
7
+ const e=void 0,t=Object.entries,r=Object.defineProperties,n=e=>"string"==typeof e,s=e=>null!==e&&"object"==typeof e,u=e=>e.split("."),i=(r,n)=>t(r).reduce(((r,[u,i])=>{if(s(i)){const l=t(i);l.length?r.push(...l.reduce(((r,[i,l])=>{if((t=>null!==t&&t!==e)(i)&&n&&r.push([u,i,e,e]),s(l)){const e=t(l);e.length&&r.push(...e.reduce(((e,[t,r])=>{const n=typeof r;return"string"!==n&&"number"!==n||e.push([u,i,t,r]),e}),[]))}return r}),[])):r.push([u,e,e,e])}return r}),[]),l=(e,t,r,n)=>""+(((e,t)=>`${e||""}${t?"__"+t:""}`)(e,t)+(r?"_"+r:"")+(r&&n?"_"+n:"")),a=(e,t)=>"."+(t?e+(t.startsWith("_")?"":"-")+t:e),o=(e,t)=>`[data-${e}${t?`~="${t}"`:""}]`,m="effcss-provider",c={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=e=>Number((.1*184+.9*e).toFixed(2));d(142),d(264),d(109),d(29);Array(12).keys();const g=e=>e||"",p=({prefix:e})=>{let t=1;return{get base(){return e+0},get current(){return e+t},next(){return t++,this.current},reset(){t=1}}},f=()=>{const e=new Set,r=new Map;return{use(t,n){const s=r.get(t);return s||(e.add(n),r.set(t,n),n)},useMany(e){return t(e).map((([e,t])=>this.use(t,e)))},getKey:e=>r.get(e),get keys(){return[...e]},get makers(){return Object.fromEntries(r.entries().map((([e,t])=>[t,e])))}}},b=e=>null==e?null:Number(e),$=(e={})=>{var t;let s,d,$,h,v,y,j,x,S=null===(t=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===t?void 0:t.querySelector(`script[is=${m}]`);if(S)return S;({prefix:d,mode:$,hydrate:v,theme:s,size:y,time:j,angle:x,min:h}=Object.assign({},c,e));let k,O,z,_=b(y),w=b(j),A=b(x);const E=new Set,N=()=>d||c.prefix,P=()=>$||c.mode,T=()=>""===v,B=p({prefix:N()}),K=((e={})=>{const{mode:t,min:s}=e;let m,c;return m="a"===t?o:a,s&&(c={}),e=>{let s=0,a=g,o=g;c&&(c[e]||(c[e]={}),a=t=>{var r;return null!==(r=c[e][t])&&void 0!==r?r:c[e][t]=(s++).toString(36)},o=t=>c[e][t]);let d=(...t)=>[e,...t].filter(Boolean).join("-"),p="class",f=t=>t?e+(t.startsWith("_")?"":"-")+t:void 0===t?void 0:e;"a"===t&&(p="data-"+e,f=g);const b=(...e)=>"--"+d(...e),$=e=>{if(void 0===e)return function(e){const t=({b:r,e:n,m:s})=>({b:e=>t({b:e,e:"",m:{}}),e:e=>t({b:r,e:e,m:{}}),m:(e={})=>t({b:r,e:n,m:e}),get $(){return e({[r]:{[n]:s}})}});return t({b:"",e:"",m:{}})}($);let t,s,a,m,c="";const d=n(e);return c=d||Array.isArray(e)?[...(d?[e]:e).reduce(((e,r)=>([t,s,a,m]=u(r),e.add(f(o(l(t,s)))),a&&e.add(f(o(l(t,s,a,m)))),e)),new Set).values()].join(" "):e&&i(e,!0).map((([e,t,r,n])=>f(o(l(e,t,r,n))))).join(" "),r({[p]:c},{toString:{value:()=>`${p}="${c}"`},$:{value:c}})};return{selector:t=>{let r,s,o,c;return n(t)?([r,s,o,c]=u(t),m(e,a(l(r,s,o,c)))):t&&i(t).map((([t,r,n,s])=>m(e,a(l(t,r,n,s))))).join(",")},attr:$,name:d,varName:b,varExp:(...e)=>`var(${b(...e)})`}}})({mode:P()}),M=f(),W=e=>"string"==typeof e?e:M.getKey(e),q=e=>K(e||B.base).attr,F=(e,t)=>{const r=t||B.current;let n=M.use(e,r);return t||B.next(),q(n)};return{get makers(){return M.makers},get prefix(){return N()},get mode(){return P()},get min(){return""===h},get hydrate(){return T()},set theme(e){s=e},get theme(){return s||""},get size(){return _},set size(e){_=e},get time(){return w},set time(e){w=e},get angle(){return A},set angle(e){A=e},get settings(){return{bp:z,vars:O,off:[...E],makers:M.makers,palette:k}},set settings(e){({bp:z,vars:O,palette:k}=e)},resolve:q,use:F,usePublic:e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,F(t,e)]))),usePrivate:e=>e.map((e=>F(e))),css:()=>"",key:W,status:e=>{const t=W(e);return!!t&&!E.has(t)},on:(...e)=>e.map(W).reduce(((e,t)=>e&&!!t&&E.delete(t)),!0),off:(...e)=>e.map(W).reduce(((e,t)=>e&&!!t&&!!E.add(t)),!0),stylesheets:()=>[],toString(){const e=M.makers;delete e[B.base];const t=Object.entries({is:m,prefix:N(),mode:P(),hydrate:T(),theme:s,size:null!==_&&String(_),time:null!==w&&String(w),angle:null!==A&&String(A)}).map((([e,t])=>t?`${e}="${t}"`:""===t?e:"")).filter(Boolean).join(" "),r=`document.currentScript.settings = {makers: {${e?Object.entries(e).reduce(((e,[t,r])=>e+`${e?",":""}${t}: ${r.toString().replaceAll(/\s+/g," ")}`),""):""}},${O?` vars: ${O},`:""}${z?` bp: ${z},`:""}${k?` palette: ${k},`:""}${E.size?` off: [${[...E]}]`:""}}`;return`<script ${t}>${r}<\/script>`}}};export{$ as createConsumer};
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * EffCSS v3.10.0
2
+ * EffCSS v3.10.1
3
3
  * {@link https://gitverse.ru/msabitov/effcss}
4
4
  * Copyright (c) Marat Sabitov
5
5
  * @license Apache-2.0
6
6
  */
7
- "function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>"string"==typeof t,i=t=>null!==t&&"object"==typeof t,a=t=>t.split("."),l=(s,r)=>e(s).reduce(((s,[n,a])=>{if(i(a)){const l=e(a);l.length?s.push(...l.reduce(((s,[a,l])=>{if((e=>null!==e&&e!==t)(a)&&r&&s.push([n,a,t,t]),i(l)){const t=e(l);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,a,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),c=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),o=(t,e)=>"."+(e?t+"-"+e:t),h=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`,u=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:u(t[e],r||{}):t[e]=r})),t)),t):t,g={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},m="effcss-provider",p={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=t=>Number((.1*184+.9*t).toFixed(2)),b={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:d(142),inf:d(264),war:d(109),dan:d(29)}},f={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:g,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:g},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:b,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}};const x=t=>t||"",v=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},y=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},$=(t,e,s)=>Object.entries(t).reduce(e,s),j=Symbol("noParse"),O=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(j)?`${l=a,l.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${$(e,((t,e)=>t+O(...e,a)),"")}}`;var l},k="@media",_="@container",w="@property",S="@keyframes",q="@layer",A="@scope",P="@supports",E=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};E.toString=()=>k;const z=t=>`(${t})`,C=t=>"string"==typeof t;function W(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>C(t)?z(t):W(t))).join(" or ");case"and":return t.args.map((t=>{const e=!C(t);return e&&"or"===t.key?z(W(t)):e?W(t):z(t)})).join(" and ");case"not":const e=t.args[0];return"not "+(C(e)?z(e):z(W(e)))}}const I=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?z(W(e)):W(e))),s},N=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=I(e,s);return{[`${k}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>N({state:s,type:["all"]})},print:{get:()=>N({state:s,type:["print"]})},screen:{get:()=>N({state:s,type:["screen"]})},and:{value:(...t)=>N({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>N({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>N(s?{type:e,state:C(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},K=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[A+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>K({root:e,limit:t,mode:r})},root:{value:t=>K({root:t,limit:s,mode:r})},both:{value:()=>K({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>K({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>K({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>K({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},M=t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=_+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>_;const r=(s={})=>{const{scroll:n,type:i,name:a,state:l}=s;return Object.defineProperties((t=>{const e=I([],l);return{[`${_}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==l?void 0:l.key},args:{value:null==l?void 0:l.args},named:{get:()=>r({scroll:n,state:l,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:l,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:l,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:l,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:l?[l,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:l?[l,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[j]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=w+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};n.toString=()=>w;const i=s=>{const r=s||t.name("kf",e.kf++),n=S+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>S;const a=s=>{const r=s||t.name("lay",e.lay++),n=q+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>q;a.toString=()=>A;const l=(t="",e=!1)=>{const s=P+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return l.toString=()=>P,{pr:n,kf:i,mq:E,cq:s,lay:a,sc:(t="",e="")=>{const s=A+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:l,keyframes:s=>{const r=t.name("kf",e.kf++),n=S+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:l,fm:c}=t;return{animation:[e,s,n,i,a,l,c,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[j]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,l="--"+t.name("cp",e.cp++),c=`var(${l}${void 0!==a?","+a:""})`,o=w+" "+l;return Object.defineProperties((t=>({[l]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>c},[j]:{value:!0}})},scope:K({}),media:N({}),container:r({})}},B=t=>t+"px",L=t=>t+"vh",R=t=>t+"vw",V=t=>t+"vmin",F=t=>t+"vmax",H=t=>t+"rem",T=t=>t+"deg",Z=t=>t+"ms",D=t=>t+"%",G=t=>t+"cqw",J=t=>t+"cqh",Q=t=>t+"cqi",U=t=>t+"cqb",X=t=>t+"cqmin",Y=t=>t+"cqmax",tt=Object.fromEntries,et=Object.entries,st=":first-",rt=":last-",nt=":only-",it="child",at=":nth-",lt="of-type",ct=at+it,ot=":focus",ht={r:":root",h:":hover",f:ot,fv:ot+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:st+it,lc:rt+it,oc:nt+it,odd:ct+"(odd)",even:ct+"(even)",ft:st+lt,lt:rt+lt,ot:nt+lt,bef:"::before",aft:"::after",bd:"::backdrop"},ut={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:ct,ntho:at+lt,dir:":dir",lang:":lang"},gt="oklch",mt=t=>gt+`(${t})`,pt=t=>mt(`from ${t}`),dt="def",bt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",dt),c:e("c",dt),h:e("h",dt),a:e("a",dt)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return mt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ft=(t,e=.1)=>pt(`${t} calc(l + ${e}) c h / alpha)`),xt=(t,e=.1)=>pt(`${t} calc(l - ${e}) c h / alpha)`),vt=(t,e=.1)=>pt(`${t} l c h / calc(alpha + ${e}))`),yt=(t,e=.1)=>pt(`${t} l c h / calc(alpha - ${e}))`),$t=(t,e=.04)=>pt(`${t} l calc(c + ${e}) h / alpha)`),jt=(t,e=.04)=>pt(`${t} l calc(c - ${e}) h / alpha)`),Ot=(t,e=30)=>pt(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),kt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||gt}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,_t=t=>({create:bt(t),oklch:mt,lighten:ft,darken:xt,saturate:$t,desaturate:jt,fadein:vt,fadeout:yt,spin:Ot,mix:kt}),wt="palette",St=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[j]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(wt,"l",i,e)} ${t(wt,"c",i,s)} ${t(wt,"h",r)} / ${n})`}}return new e},qt="coef",At=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(qt,this.state.center-4)}get xxs(){return t(qt,this.state.center-3)}get xs(){return t(qt,this.state.center-2)}get s(){return t(qt,this.state.center-1)}get m(){return t(qt,this.state.center)}get l(){return t(qt,this.state.center+1)}get xl(){return t(qt,this.state.center+2)}get xxl(){return t(qt,this.state.center+3)}get max(){return t(qt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},Pt=Object.assign,Et=Object.entries,zt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Pt(t,e(s+1))),{}),each:(t,e)=>Et(t).reduce(((t,[s,r])=>Pt(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Ct="width: ",Wt=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,l=(t=1)=>`calc(${t} * ${i("rangle")})`,c=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=M(o),g=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},m=t=>"min-"+Ct+g(t),p=t=>"max-"+Ct+g(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(m(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(m(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(zt,{key:t,vars:i,size:c,time:a,angle:l,bem:o.selector,pseudo:Object.assign(tt(et(ht).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),tt(et(ut).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:_t(n),palette:St(n),coef:At(n),units:{px:B,vh:L,vw:R,vmin:V,vmax:F,rem:H,deg:T,ms:Z,pc:D,cqw:G,cqh:J,cqb:U,cqi:Q,cqmin:X,cqmax:Y},at:h,limit:f,merge:u})),$(x,((t,e)=>t+O(...e)),"");var x}}};const It="theme",Nt="size",Kt="time",Mt="angle",Bt="palette",Lt=Object.assign,Rt=Object.entries,Vt=Object.fromEntries,Ft=(t,e)=>t.getAttribute(e)||p[e],Ht=(t,e)=>{const s=Ft(t,e);return null!==s?Number(s):null},Tt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Zt=t=>`:root:has(script[is=${m}]${t?`[${t}]`:""})`,Dt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Gt=["xs","s","m","l","xl"],Jt=["pale","base","rich"];function Qt(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(m))return!1;{class i extends HTMLScriptElement{constructor(){super(...arguments),this._c=y(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=t=>{const e=c(t);return!!e&&-1!==l(e)};return{apply:i,notify:a,getIndex:l,get:c,has:t=>!!t&&!!c(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);if(r&&h(e)){const e=l(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=c(r);if(!n)return;const i=l(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&o(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=f,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Rt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Lt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Vt(Rt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:l,light:c}=i,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Dt(b.$0_),1,...Dt(b.$1_),2,...Dt(b.$2_),16,...Dt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:l,merge:c,at:{media:b},units:{px:x,ms:v,deg:y}})=>{const $="prefers-color-scheme",j={light:`${$}: light`,dark:`${$}: dark`};return c({[Zt()]:c({fontSize:l("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Bt,"h",t)]:e}))),{[s(Bt,"c","bg","gray")]:0,[s(Bt,"c","fg","gray")]:0},e(j,((t,r)=>b.and(r)(c(i[t]||{},e(Gt,((e,r)=>({[s(Bt,"l","bg",r)]:m[t].bg[r],[s(Bt,"l","fg",r)]:m[t].fg[r]}))),e(Jt,((e,r)=>({[s(Bt,"c","bg",r)]:p[t].bg[r],[s(Bt,"c","fg",r)]:p[t].fg[r]}))))))))},e(o,((e,s)=>({[Zt(`${It}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Zt(Nt)]:{[r("rem")]:x(h)}}),n(!!u,{[Zt(Kt)]:{[r("rtime")]:v(u)}}),n(!!g,{[Zt(Mt)]:{[r("rangle")]:y(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(n))&&(this._m.pack(n,this.css(t,n)),e||this._k.next()),this.resolve(n)},this.usePublic=t=>Vt(Rt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:this._c.keys,e.map((t=>this._m.get(this.key(t))))}}static get observedAttributes(){return[Nt,Kt,Mt]}get prefix(){return Ft(this,"prefix")||""}get mode(){return this.getAttribute("mode")||"a"}get min(){return"string"==typeof this.getAttribute("min")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=u({},this._settings,t),{makers:i,bp:a,off:l}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Wt({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==l?void 0:l.length)&&this._settings.off!==l&&this.off(...l),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}set theme(t){Tt(this,It,t)}get theme(){return Ft(this,It)||""}set size(t){Tt(this,Nt,t)}get size(){return Ht(this,Nt)}set time(t){Tt(this,"time",t)}get time(){return Ht(this,Kt)}set angle(t){Tt(this,"angle",t)}get angle(){return Ht(this,Mt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=v({prefix:this.prefix}),this._s=((t={})=>{const{mode:e,min:s}=t;let i,u;return i="a"===e?h:o,s&&(u={}),t=>{let s=0,o=x,h=x;u&&(u[t]||(u[t]={}),o=e=>{var r;return null!==(r=u[t][e])&&void 0!==r?r:u[t][e]=(s++).toString(36)},h=e=>u[t][e]);let g=(...e)=>[t,...e].filter(Boolean).join("-"),m="class",p=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(m="data-"+t,p=x);const d=(...t)=>"--"+g(...t),b=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(b);let e,s,i,o,u="";const g=n(t);return u=g||Array.isArray(t)?[...(g?[t]:t).reduce(((t,r)=>([e,s,i,o]=a(r),t.add(p(h(c(e,s)))),i&&t.add(p(h(c(e,s,i,o)))),t)),new Set).values()].join(" "):t&&l(t,!0).map((([t,e,s,r])=>p(h(c(t,e,s,r))))).join(" "),r({[m]:u},{toString:{value:()=>`${m}="${u}"`},$:{value:u}})};return{selector:e=>{let s,r,h,u;return n(e)?([s,r,h,u]=a(e),i(t,o(c(s,r,h,u)))):e&&l(e).map((([e,s,r,n])=>i(t,o(c(e,s,r,n))))).join(",")},attr:b,name:g,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode,min:this.min});const s=this;this._n={set adoptedStyleSheets(t){s.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}return s.define(m,i,{extends:"script"}),!0}}export{Qt as defineProvider};
7
+ "function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>"string"==typeof t,i=t=>null!==t&&"object"==typeof t,a=t=>t.split("."),l=(s,r)=>e(s).reduce(((s,[n,a])=>{if(i(a)){const l=e(a);l.length?s.push(...l.reduce(((s,[a,l])=>{if((e=>null!==e&&e!==t)(a)&&r&&s.push([n,a,t,t]),i(l)){const t=e(l);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,a,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),c=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),o=(t,e)=>"."+(e?t+(e.startsWith("_")?"":"-")+e:t),h=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`,u=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:u(t[e],r||{}):t[e]=r})),t)),t):t,g={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},m="effcss-provider",p={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=t=>Number((.1*184+.9*t).toFixed(2)),b={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:d(142),inf:d(264),war:d(109),dan:d(29)}},f={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:g,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:g},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:b,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}};const x=t=>t||"",v=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},y=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},$=(t,e,s)=>Object.entries(t).reduce(e,s),j=Symbol("noParse"),O=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(j)?`${l=a,l.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${$(e,((t,e)=>t+O(...e,a)),"")}}`;var l},k="@media",_="@container",w="@property",S="@keyframes",q="@layer",A="@scope",P="@supports",E=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};E.toString=()=>k;const z=t=>`(${t})`,C=t=>"string"==typeof t;function W(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>C(t)?z(t):W(t))).join(" or ");case"and":return t.args.map((t=>{const e=!C(t);return e&&"or"===t.key?z(W(t)):e?W(t):z(t)})).join(" and ");case"not":const e=t.args[0];return"not "+(C(e)?z(e):z(W(e)))}}const I=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?z(W(e)):W(e))),s},N=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=I(e,s);return{[`${k}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>N({state:s,type:["all"]})},print:{get:()=>N({state:s,type:["print"]})},screen:{get:()=>N({state:s,type:["screen"]})},and:{value:(...t)=>N({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>N({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>N(s?{type:e,state:C(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},K=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[A+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>K({root:e,limit:t,mode:r})},root:{value:t=>K({root:t,limit:s,mode:r})},both:{value:()=>K({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>K({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>K({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>K({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},M=t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=_+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>_;const r=(s={})=>{const{scroll:n,type:i,name:a,state:l}=s;return Object.defineProperties((t=>{const e=I([],l);return{[`${_}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==l?void 0:l.key},args:{value:null==l?void 0:l.args},named:{get:()=>r({scroll:n,state:l,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:l,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:l,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:l,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:l?[l,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:l?[l,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[j]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=w+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};n.toString=()=>w;const i=s=>{const r=s||t.name("kf",e.kf++),n=S+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>S;const a=s=>{const r=s||t.name("lay",e.lay++),n=q+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>q;a.toString=()=>A;const l=(t="",e=!1)=>{const s=P+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return l.toString=()=>P,{pr:n,kf:i,mq:E,cq:s,lay:a,sc:(t="",e="")=>{const s=A+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:l,keyframes:s=>{const r=t.name("kf",e.kf++),n=S+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:l,fm:c}=t;return{animation:[e,s,n,i,a,l,c,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[j]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,l="--"+t.name("cp",e.cp++),c=`var(${l}${void 0!==a?","+a:""})`,o=w+" "+l;return Object.defineProperties((t=>({[l]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>c},[j]:{value:!0}})},scope:K({}),media:N({}),container:r({})}},B=t=>t+"px",L=t=>t+"vh",R=t=>t+"vw",V=t=>t+"vmin",F=t=>t+"vmax",H=t=>t+"rem",T=t=>t+"deg",Z=t=>t+"ms",D=t=>t+"%",G=t=>t+"cqw",J=t=>t+"cqh",Q=t=>t+"cqi",U=t=>t+"cqb",X=t=>t+"cqmin",Y=t=>t+"cqmax",tt=Object.fromEntries,et=Object.entries,st=":first-",rt=":last-",nt=":only-",it="child",at=":nth-",lt="of-type",ct=at+it,ot=":focus",ht={r:":root",h:":hover",f:ot,fv:ot+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:st+it,lc:rt+it,oc:nt+it,odd:ct+"(odd)",even:ct+"(even)",ft:st+lt,lt:rt+lt,ot:nt+lt,bef:"::before",aft:"::after",bd:"::backdrop"},ut={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:ct,ntho:at+lt,dir:":dir",lang:":lang"},gt="oklch",mt=t=>gt+`(${t})`,pt=t=>mt(`from ${t}`),dt="def",bt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",dt),c:e("c",dt),h:e("h",dt),a:e("a",dt)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return mt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ft=(t,e=.1)=>pt(`${t} calc(l + ${e}) c h / alpha)`),xt=(t,e=.1)=>pt(`${t} calc(l - ${e}) c h / alpha)`),vt=(t,e=.1)=>pt(`${t} l c h / calc(alpha + ${e}))`),yt=(t,e=.1)=>pt(`${t} l c h / calc(alpha - ${e}))`),$t=(t,e=.04)=>pt(`${t} l calc(c + ${e}) h / alpha)`),jt=(t,e=.04)=>pt(`${t} l calc(c - ${e}) h / alpha)`),Ot=(t,e=30)=>pt(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),kt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||gt}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,_t=t=>({create:bt(t),oklch:mt,lighten:ft,darken:xt,saturate:$t,desaturate:jt,fadein:vt,fadeout:yt,spin:Ot,mix:kt}),wt="palette",St=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[j]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(wt,"l",i,e)} ${t(wt,"c",i,s)} ${t(wt,"h",r)} / ${n})`}}return new e},qt="coef",At=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(qt,this.state.center-4)}get xxs(){return t(qt,this.state.center-3)}get xs(){return t(qt,this.state.center-2)}get s(){return t(qt,this.state.center-1)}get m(){return t(qt,this.state.center)}get l(){return t(qt,this.state.center+1)}get xl(){return t(qt,this.state.center+2)}get xxl(){return t(qt,this.state.center+3)}get max(){return t(qt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},Pt=Object.assign,Et=Object.entries,zt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Pt(t,e(s+1))),{}),each:(t,e)=>Et(t).reduce(((t,[s,r])=>Pt(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Ct="width: ",Wt=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,l=(t=1)=>`calc(${t} * ${i("rangle")})`,c=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=M(o),g=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},m=t=>"min-"+Ct+g(t),p=t=>"max-"+Ct+g(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(m(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(m(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(zt,{key:t,vars:i,size:c,time:a,angle:l,bem:o.selector,pseudo:Object.assign(tt(et(ht).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),tt(et(ut).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:_t(n),palette:St(n),coef:At(n),units:{px:B,vh:L,vw:R,vmin:V,vmax:F,rem:H,deg:T,ms:Z,pc:D,cqw:G,cqh:J,cqb:U,cqi:Q,cqmin:X,cqmax:Y},at:h,limit:f,merge:u})),$(x,((t,e)=>t+O(...e)),"");var x}}};const It="theme",Nt="size",Kt="time",Mt="angle",Bt="palette",Lt=Object.assign,Rt=Object.entries,Vt=Object.fromEntries,Ft=(t,e)=>t.getAttribute(e)||p[e],Ht=(t,e)=>{const s=Ft(t,e);return null!==s?Number(s):null},Tt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Zt=t=>`:root:has(script[is=${m}]${t?`[${t}]`:""})`,Dt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Gt=["xs","s","m","l","xl"],Jt=["pale","base","rich"];function Qt(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(m))return!1;{class i extends HTMLScriptElement{constructor(){super(...arguments),this._c=y(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=t=>{const e=c(t);return!!e&&-1!==l(e)};return{apply:i,notify:a,getIndex:l,get:c,has:t=>!!t&&!!c(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);if(r&&h(e)){const e=l(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=c(r);if(!n)return;const i=l(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&o(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=f,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Rt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Lt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Vt(Rt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:l,light:c}=i,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Dt(b.$0_),1,...Dt(b.$1_),2,...Dt(b.$2_),16,...Dt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:l,merge:c,at:{media:b},units:{px:x,ms:v,deg:y}})=>{const $="prefers-color-scheme",j={light:`${$}: light`,dark:`${$}: dark`};return c({[Zt()]:c({fontSize:l("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Bt,"h",t)]:e}))),{[s(Bt,"c","bg","gray")]:0,[s(Bt,"c","fg","gray")]:0},e(j,((t,r)=>b.and(r)(c(i[t]||{},e(Gt,((e,r)=>({[s(Bt,"l","bg",r)]:m[t].bg[r],[s(Bt,"l","fg",r)]:m[t].fg[r]}))),e(Jt,((e,r)=>({[s(Bt,"c","bg",r)]:p[t].bg[r],[s(Bt,"c","fg",r)]:p[t].fg[r]}))))))))},e(o,((e,s)=>({[Zt(`${It}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Zt(Nt)]:{[r("rem")]:x(h)}}),n(!!u,{[Zt(Kt)]:{[r("rtime")]:v(u)}}),n(!!g,{[Zt(Mt)]:{[r("rangle")]:y(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(n))&&(this._m.pack(n,this.css(t,n)),e||this._k.next()),this.resolve(n)},this.usePublic=t=>Vt(Rt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:this._c.keys,e.map((t=>this._m.get(this.key(t))))}}static get observedAttributes(){return[Nt,Kt,Mt]}get prefix(){return Ft(this,"prefix")||""}get mode(){return this.getAttribute("mode")||"a"}get min(){return"string"==typeof this.getAttribute("min")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=u({},this._settings,t),{makers:i,bp:a,off:l}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Wt({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==l?void 0:l.length)&&this._settings.off!==l&&this.off(...l),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}set theme(t){Tt(this,It,t)}get theme(){return Ft(this,It)||""}set size(t){Tt(this,Nt,t)}get size(){return Ht(this,Nt)}set time(t){Tt(this,"time",t)}get time(){return Ht(this,Kt)}set angle(t){Tt(this,"angle",t)}get angle(){return Ht(this,Mt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=v({prefix:this.prefix}),this._s=((t={})=>{const{mode:e,min:s}=t;let i,u;return i="a"===e?h:o,s&&(u={}),t=>{let s=0,o=x,h=x;u&&(u[t]||(u[t]={}),o=e=>{var r;return null!==(r=u[t][e])&&void 0!==r?r:u[t][e]=(s++).toString(36)},h=e=>u[t][e]);let g=(...e)=>[t,...e].filter(Boolean).join("-"),m="class",p=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(m="data-"+t,p=x);const d=(...t)=>"--"+g(...t),b=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(b);let e,s,i,o,u="";const g=n(t);return u=g||Array.isArray(t)?[...(g?[t]:t).reduce(((t,r)=>([e,s,i,o]=a(r),t.add(p(h(c(e,s)))),i&&t.add(p(h(c(e,s,i,o)))),t)),new Set).values()].join(" "):t&&l(t,!0).map((([t,e,s,r])=>p(h(c(t,e,s,r))))).join(" "),r({[m]:u},{toString:{value:()=>`${m}="${u}"`},$:{value:u}})};return{selector:e=>{let s,r,h,u;return n(e)?([s,r,h,u]=a(e),i(t,o(c(s,r,h,u)))):e&&l(e).map((([e,s,r,n])=>i(t,o(c(e,s,r,n))))).join(",")},attr:b,name:g,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode,min:this.min});const s=this;this._n={set adoptedStyleSheets(t){s.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}return s.define(m,i,{extends:"script"}),!0}}export{Qt as defineProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effcss",
3
- "version": "3.10.0",
3
+ "version": "3.10.1",
4
4
  "description": "Self-confident CSS-in-JS",
5
5
  "type": "module",
6
6
  "scripts": {