shweet 0.0.28 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -146,6 +146,7 @@ declare class _Var {
146
146
  new(val: CSSValue, fallback?: CSSValue): _Var;
147
147
  }
148
148
  declare const Var: (vr: obj<CSSValue | media>, fallback?: CSSValue) => _Var;
149
+ declare const Vars: <T extends Record<string, CSSValue | media>>(vr: T) => { [K in keyof T]: _Var; };
149
150
 
150
151
  type CSSValue = V | _Var | undefined | CSSValue[];
151
152
  type VarType = _Var;
@@ -755,5 +756,5 @@ declare class Shweet {
755
756
  }
756
757
  declare function fileName(path: string): string;
757
758
 
758
- export { Medyas, Shweet, Value, Var, __, f, fileName, log, med, media, ps, supports, v };
759
+ export { Medyas, Shweet, Value, Var, Vars, __, f, fileName, log, med, media, ps, supports, v };
759
760
  export type { CSS, CSSValue, CSSinR, KFCSS, VarType, atCSS, fontFace };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  // @bun
2
- var An=Object.defineProperty;var Pn=(n,C)=>{for(var f in C)An(n,f,{get:C[f],enumerable:!0,configurable:!0,set:($)=>C[f]=()=>$})};var Sn={};Pn(Sn,{isWindow:()=>ln,isUndefined:()=>Tn,isStr:()=>M,isPromise:()=>zn,isPlainObject:()=>_n,isObject:()=>un,isObj:()=>y,isNumber:()=>_,isNum:()=>$n,isNull:()=>v,isNotWindow:()=>En,isNotNull:()=>dn,isModule:()=>yn,isInt:()=>Zn,isFN:()=>k,isDefined:()=>b,isClassOrId:()=>fn,isBool:()=>Ln,isAsync:()=>on,isArraybuff:()=>cn,isArr:()=>L});var k=(n)=>typeof n==="function",on=(n)=>n.constructor.name==="AsyncFunction",zn=(n)=>!!n&&typeof n.then==="function",_=(n)=>{return!isNaN(parseFloat(n))&&isFinite(n)},un=(n)=>{return n&&typeof n==="object"&&!Array.isArray(n)},_n=(n)=>{return typeof n==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype&&!Array.isArray(n)},yn=(n)=>{return n&&typeof n==="object"&&n[Symbol.toStringTag]==="Module"},cn=(n)=>{return n instanceof Uint8Array||n instanceof ArrayBuffer||typeof n==="string"},fn=(n)=>{return n.startsWith(".")||n.startsWith("#")},Ln=(n)=>typeof n==="boolean",M=(n)=>typeof n==="string",L=(n)=>Array.isArray(n),y=(n)=>typeof n==="object",$n=(n)=>typeof n==="number",v=(n)=>n===null,dn=(n)=>n===null,Tn=(n)=>typeof n==="undefined",b=(n)=>typeof n!=="undefined",Zn=(n)=>{return Number.isInteger(Number(n))},ln=typeof window!=="undefined",En=typeof window==="undefined";var Qn=(n)=>{return L(n)?n:[n]};class c{static set i(n){console.info(...Qn(n))}static set e(n){console.error(...Qn(n))}static set w(n){console.warn(...Qn(n))}}var rn=(n)=>Array.from({length:n},(C,f)=>f),Bn="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Dn="abcdefghijklmnopqrstuvwxyz";var p=(n)=>JSON.stringify(n),Jn=(n)=>{return JSON.parse(n)},On=(n)=>{return n.replace(/-([a-z])/g,(C,f)=>f.toUpperCase())},K=(n)=>{if(n.startsWith("webkit"))n="-"+n;return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},x=(n)=>{let C=Bn+Dn,f=rn(10).join("");return Array.from({length:n},($,T)=>C+(T?f:"")).reduce(($,T)=>{return $+=T.charAt(Math.floor(Math.random()*T.length))},"")},mn=(n=6,C)=>{if(!C)return Math.floor(Math.random()*n);return Math.round(Math.random()*(C-n)+n)},Hn=()=>{let n=[...Bn,...Dn],C=mn(0,n.length);return n[C]};class B extends Map{obj(n){n&&q(n).forEach(([C,f])=>this.set(C,f))}map(n){n.forEach((C,f)=>{if(C instanceof B)this.set(f,C);else if(L(C)){if(this.lacks(f))this.set(f,[]);this.get(f).push(...C)}else if(y(C))this.ass(f,C);else this.set(f,C)})}ass(n,C){if(!this.has(n))this.set(n,{});X(this.get(n),C)}lacks(n){return!this.has(n)}init(n,C){return this.has(n)?this.get(n):this.set(n,C).get(n)}}var{values:V,keys:w,entries:q}=Object;var X=Object.assign,Fn=(n,C)=>Object.hasOwn(n,C),Nn=(n)=>{return Object.keys(n).length};class tn{static rand(n=6,C){if(C)return Math.floor(Math.random()*(C-n+1)+n);return Math.floor(Math.random()*n)+1-1}static fill(n,C=null){return Array(n).fill(C)}static new({dom:n,id:C,inner:f}){let $=document.createElement(n);if(C)$.id=C;if(f)$.innerHTML=f;return $}static randFrom(n){if(Array.isArray(n)){let C=n.length,f=this.rand(0,C-1);return n[f]}else if(typeof n=="object"){let C=w(n),f=C.length,$=this.rand(0,f-1);return C[$]}}static randArray(n=[],C=1,f=!1){let $=[],T=f?new Set:null;while((f?T.size:$.length)<C){let S=n[tn.rand(0,n.length-1)];f?T.add(S):$.push(S)}return f?[...T]:$}static randomAZ=Hn;static makeID=x;static class(n,...C){let f=C.filter(Boolean);if(n?.class)f.push(...L(n.class)?n.class:[n.class]);if(f.length)n.class=C}static get O(){return{vals:V,keys:w,items:q,has:Fn,ass:X,len:(n={})=>w(n).length}}static get is(){return Sn}static get return(){return Xn}static isHREF(n,C){return n===C?!0:n.startsWith(C)&&C!=="/"?!0:!1}static sleep=(n=1000)=>new Promise((C)=>setTimeout(C,n));static get screen(){let{innerWidth:n}=window,C={xs:n<=480,sm:n>=480,smd:n>=624,md:n>=768,lg:n>=1024,xl:n>=1280,xxl:n>=1536},f=q(C).reverse();for(let $=0;$<f.length;$++){let[T,S]=f[$];if(S)return T}return}bytes(n){if(n===0)return"0 Bytes";let C=1024,f=["Bytes","KB","MB","GB"],$=Math.floor(Math.log(n)/Math.log(C));return parseFloat((n/Math.pow(C,$)).toFixed(2))+" "+f[$]}static format(n){return new Yn(n)}}class Xn{static arr(n){return n?L(n)?n:[n]:[]}static num(n,C=0){let f=parseFloat(n);return isNaN(f)?C:f}static str(n){return String(n)}static arr2obj(n,C=!1){return n.reduce((f,$,T)=>{if(C)f[$]=T;else f[T]=$;return f},{})}}class Yn{val;constructor(n){this.val=n}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}var bn={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class N{static default="xs";static prop=q(bn).reduce((n,[C,f],$)=>{return n[C]=`(${$==0?"max-width":"min-width"}: ${f})`,n},{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)"};constructor(n,C={}){let f=N.default,$={};if(n!==void 0)i($,f,n,f);q(C).forEach(([T,S])=>{i($,T,S,f)}),X(this,$)}static get breakpoints(){return Jn(p(bn))}}var i=(n,C,f,$)=>{if(f!==void 0)if(f instanceof N)q(f).forEach(([T,S])=>{if($!==C)if(C!==T)if($===T)i(n,C,S,$);else i(n,`${C}-${T}`,S,$);else i(n,T,S,$);else i(n,T,S,$)});else n[C]=f};function g(n,C){if(C)return new N(n,C);return new N(void 0,n)}function pn(n){if(this._prefix)return g({[this._prefix]:n});else return g({xs:n})}function Y(n){return new this.constructor({prefix:n,values:this._values,data:this.data})}class a{_prefix;data;_values;constructor({prefix:n,data:C,values:f}={data:{},values:{}}){this._prefix=n,this._values=f,q(f).forEach(([$,T])=>{if(!this._values[$])this._values[$]=g({});X(this._values[$],T)}),this.data=C}get XS(){return Y.call(this,"xs")}get SM(){return Y.call(this,"sm")}get SMD(){return Y.call(this,"smd")}get MD(){return Y.call(this,"md")}get LG(){return Y.call(this,"lg")}get XL(){return Y.call(this,"xl")}get XXL(){return Y.call(this,"xxl")}get NO_HOVER(){return Y.call(this,"no_hover")}get MOBILE(){return Y.call(this,"no_hover")}get PRINT(){return Y.call(this,"print")}get SCREEN(){return Y.call(this,"screen")}get DARK(){return Y.call(this,"dark")}set _value(n){q(n).forEach(([C,f])=>{if(!this._values[C])this._values[C]=g({});X(this._values[C],pn.call(this,f))})}get _value(){return this._values}}class j{k="";fallback;var="";value;constructor(n={},C){if(Nn(n)){let[f,$]=q(n)[0];this.k=f,this.var="--"+K(f),this.value=$ instanceof N?$:g($,{}),this.fallback=C}else this.value=g({})}__(n){if(n)this.fallback=n;let C=this.fallback;if(C)return`var(${this.var}, ${Q(C)})`;else return`var(${this.var})`}new(n,C){return new j({[this.k]:n instanceof N?n:Q(n)},C)}}var an=(n,C)=>{return new j(n,C)};var Q=(n,C={unit:"rem"})=>{let{rem:f,second:$,quote:T,degree:S,percent:J,delimeter:U,unit:W,delimeter_arr:R}=C;if(Tn(n)||v(n)||!T&&n==="")return"";let t=L(n)?n:[n];if(!t.length)return"";return t.filter((G)=>b(G)).map((G)=>{if(L(G))return U=R||", ",Q(G,{...C,delimeter:" "});if(G instanceof j)return G.__();if(T)G=String(G);if($n(G))if(f)return`${G}${W?W:"rem"}`;else if(S)return`${G}deg`;else if(J)return`${G}%`;else if($)return`${G}s`;else return String(G);if(M(G))if(G.includes("("))return G;else if(T)return`'${G}'`;else return G;return""}).filter((G)=>b(G)&&G!=="").join(U||" ")};var gn=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),sn=new Set([...gn,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","animationIterationCount","animationTimingFunction","transitionTimingFunction","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),en=new Set(["content"]),nC=new Set(["transitionProperty"]),P=(n,C,f="rem")=>{let $=Q(C,{rem:!sn.has(n),second:gn.has(n),quote:en.has(n),delimeter:nC.has(n)?", ":" ",unit:f});return`${K(n)}: ${$};`};class s{value;__;constructor(n){if(this.value=new B,M(n))this.value.set(n,[]);else q(n).forEach(([C,f])=>{this.value.set(`${C}:${f}`,[])});this.__=(...C)=>{return this.value.forEach((f)=>{f.push(...C)}),this}}}function CC(n){return new s(n).__}var o=(n)=>{if(k(n))return o(n());if(n instanceof N)return n;if(n instanceof j)return g(n.__(),{});return g(n,{})};function fC(n){let C={};return n.split(";").map((f)=>f.trim()).filter((f)=>f!=="").forEach((f)=>{let[$,T]=f.split(":").map((J)=>J.trim()),S=On($);if(!isNaN(Number(T))&&isFinite(Number(T)))C[S]=Number(T);else C[S]=T}),C}var $C=(n)=>{n.value.forEach((C,f)=>{n.value.set(f,C.map(($)=>{let T={};return q($).forEach(([S,J])=>{if(b(J))T[S]=o(J)}),T}))})},qn=(n,C=[])=>{let f=[];if(L(n))return qn(n[0],f);if(n instanceof j)return qn(V(n.value),f);return f.push(String(n)),f};class Gn{base;constructor(n){this.base=n}props(n,C,f){let $=["animation","animationName"].includes(C);return q(f).forEach(([T,S])=>{if($)f[T]=this.addPrefixToAnimation(n,S);else f[T]=S}),f}addPrefixToAnimation(n,C){if(C instanceof j)this.saveAnim(n,C);else if(L(C))return C[0]=this.addPrefixToAnimation(n,C[0]),C;else if(M(C)&&!C.includes("("))return C.split(", ").map((T)=>{let S=T.split(" "),J=S[0],U=S.slice(1).join(" "),W=`${this.base.PREFIX}${J}`;return this.base.ANIM.init(W,new Set).add(n),`${this.base.PREFIX}${J} ${U}`.trim()}).join(", ");return C}saveAnim(n,C){qn(C).forEach((f)=>{this.base.ANIM.init(`${this.base.PREFIX}${f}`,new Set).add(n)})}process(n,C,f,$,T){if(f instanceof j)this.saveAnim(n,f),$.ass(C,this.props(n,f.var,o(f)));else if(C.startsWith(":")||C.startsWith(",")||C.startsWith("[")){if(C.startsWith("::before")||C.startsWith("::after")){if(L(f)){if(!f.some((J)=>("content"in J)))f.push({content:""})}}this.set(n+C,f,T)}else if(C.startsWith(" ")){let J=C.match(/^.*?\w/gm)?.[0].slice(0,-1),U=C.replaceAll(/, /gm,`, ${n}${J}`);this.set(n+U,f,T)}else if(fn(C))this.set(n+C,f,T);else $.set(C,this.props(n,C,o(f)))}set(n,C,f){if(!y(C)&&!M(C))return;let $=new B;if(C instanceof j)this.saveAnim(n,C),$.ass(C.var,this.props(n,C.var,o(C.value)));else if(C instanceof a)q(C._value).forEach(([S,J])=>{if(b(J))$.set(S,this.props(n,S,o(J)))});else if(C instanceof s)$C(C),$.init("supports",[]).push(C);else if(L(C))C.forEach((S)=>{this.set(n,S,f)});else if(M(C)){let S=fC(C);this.set(n,S,f)}else q(C).forEach(([S,J])=>{return this.process(n,S,J,$,f)});let T=f.init(n,new B);$.forEach((S,J)=>{if(J==="supports")f.init(n,new B).init(J,[])?.push(...S);else T.set(J,S)})}}class d{PRE;EXPORT;UNIT;PS;PREFIX;ARR=new B;CID=new B;DATA=new B;ANIM=new B;IMPORTED=[];constructor(n="",C="",f,$){this.PRE=n;this.EXPORT=f;this.UNIT=$;this.PREFIX=C?C+"_":C,this.PS=new Gn(this)}get(n,C,f){let $=n.PRE+C;if(n.DATA.has($))return $;else if(C in n)return n[C];else return n.PRE+C}set(n,C,f){return!1}get css(){return new Proxy(this,this)}load(n){return this.IMPORTED.push(n),this}__(n){Object.entries(n).forEach(([C,f])=>{this.set(this,C,f)})}}class A extends d{set(n,C,f){let $=n.PRE+C;return n.PS.set($,f,n.DATA),!0}}class l extends d{webkit;constructor(n="",C=!0,f){super("",n,!1,f);this.webkit=C}set(n,C,f){let $=n.PREFIX+C,T=L(f)?f:[f],S=new B;if(T.forEach((J)=>{q(J).forEach(([U,W])=>{let R=_(U)?`${U}%`:U;n.PS.set(R,W,S)})}),n.ANIM.init($,new Set),n.DATA.set(`@keyframes ${$}`,S),this.webkit)n.DATA.set(`@-webkit-keyframes ${$}`,S);return!0}}class r extends d{constructor(n=""){super("@",n)}set(n,C,f){return n.ARR.init(n.PRE+C,new Set).add(f),n}}class m extends d{constructor(n=""){super("@font-face",n);this.ARR.set(this.PRE,new Set)}set(n,C,f){let $=q({fontFamily:C,...f}).map(([T,S])=>{return P(T,S,this.UNIT)});return n.ARR.get(n.PRE)?.add($.join(`
3
- `)),!0}}var jn=Array.from;class Wn{shweet;shaker;include;CID=new B;css="";constructor(n,C=[],f=[]){this.shweet=n;this.shaker=C;this.include=f}load(n){let C=N.default,f=N.prop;X(f,N.extra);let $=new B,T={},S={},J={},U=new Set,W={},R={};w(f).forEach((t)=>{W[t]={}});for(let t of V(this.shweet))if(t instanceof A)this.ClassID(t,T,S,n),t.ANIM.forEach((G,Z)=>{G.forEach((O)=>{$.init(Z,new Set).add(O)})});else if(t instanceof l)this.KF(t,J,$);else if(t instanceof r)this.AT(t,U);else if(t instanceof m)this.FONT(t,U);return q(T).forEach(([t,G])=>{if(!W[t])W[t]={};q(G).forEach(([Z,O])=>{let D=O.join(", ");if(!W[t][D])W[t][D]=[];W[t][D].push(Z)})}),q(S).forEach(([t,G])=>{q(G).forEach(([Z,O])=>{if(!R[Z])R[Z]={};q(O).forEach(([D,H])=>{let F=`@supports(${t})`;if(!R[Z][F])R[Z][F]={};let I=H.join(", ");if(!R[Z][F][I])R[Z][F][I]=new Set;R[Z][F][I].add(D)})})}),q(W).forEach(([t,G])=>{let Z=[],O=[];if(q(G).forEach(([D,H])=>{if(H.some((I)=>{return I.startsWith("animation")||I.startsWith("transition")}))O.push(z(D,H));else Z.push(z(D,H))}),O.length)Z.unshift(...O);if(J[t])q(J[t]).forEach(([D,H])=>{Z.push(z(D,H))});if(R[t])q(R[t]).forEach(([D,H])=>{let F=q(H).map(([I,Cn])=>{return z(I,[...Cn])});Z.push(z(D,F))});if(Z.length)if(U.add(`/* -------------- ${t+(t===C?" ( default )":"")} */`),t===C)U.add(Z.join(`
4
- `));else{let D=t.split("-").map((H)=>f[H]).join(" and ");U.add(`@media ${D} {
2
+ var An=Object.defineProperty;var Pn=(n,C)=>{for(var f in C)An(n,f,{get:C[f],enumerable:!0,configurable:!0,set:($)=>C[f]=()=>$})};var Sn={};Pn(Sn,{isWindow:()=>rn,isUndefined:()=>Tn,isStr:()=>M,isPromise:()=>un,isPlainObject:()=>_n,isObject:()=>zn,isObj:()=>y,isNumber:()=>_,isNum:()=>$n,isNull:()=>v,isNotWindow:()=>tn,isNotNull:()=>dn,isModule:()=>yn,isInt:()=>Zn,isFN:()=>k,isDefined:()=>g,isClassOrId:()=>fn,isBool:()=>Ln,isAsync:()=>on,isArraybuff:()=>cn,isArr:()=>L});var k=(n)=>typeof n==="function",on=(n)=>n.constructor.name==="AsyncFunction",un=(n)=>!!n&&typeof n.then==="function",_=(n)=>{return!isNaN(parseFloat(n))&&isFinite(n)},zn=(n)=>{return n&&typeof n==="object"&&!Array.isArray(n)},_n=(n)=>{return typeof n==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype&&!Array.isArray(n)},yn=(n)=>{return n&&typeof n==="object"&&n[Symbol.toStringTag]==="Module"},cn=(n)=>{return n instanceof Uint8Array||n instanceof ArrayBuffer||typeof n==="string"},fn=(n)=>{return n.startsWith(".")||n.startsWith("#")},Ln=(n)=>typeof n==="boolean",M=(n)=>typeof n==="string",L=(n)=>Array.isArray(n),y=(n)=>typeof n==="object",$n=(n)=>typeof n==="number",v=(n)=>n===null,dn=(n)=>n===null,Tn=(n)=>typeof n==="undefined",g=(n)=>typeof n!=="undefined",Zn=(n)=>{return Number.isInteger(Number(n))},rn=typeof window!=="undefined",tn=typeof window==="undefined";var En=(n)=>{return L(n)?n:[n]};class c{static set i(n){console.info(...En(n))}static set e(n){console.error(...En(n))}static set w(n){console.warn(...En(n))}}var ln=(n)=>Array.from({length:n},(C,f)=>f),Bn="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Dn="abcdefghijklmnopqrstuvwxyz";var p=(n)=>JSON.stringify(n),Qn=(n)=>{return JSON.parse(n)},On=(n)=>{return n.replace(/-([a-z])/g,(C,f)=>f.toUpperCase())},K=(n)=>{if(n.startsWith("webkit"))n="-"+n;return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},x=(n)=>{let C=Bn+Dn,f=ln(10).join("");return Array.from({length:n},($,T)=>C+(T?f:"")).reduce(($,T)=>{return $+=T.charAt(Math.floor(Math.random()*T.length))},"")},mn=(n=6,C)=>{if(!C)return Math.floor(Math.random()*n);return Math.round(Math.random()*(C-n)+n)},Hn=()=>{let n=[...Bn,...Dn],C=mn(0,n.length);return n[C]};class B extends Map{obj(n){n&&q(n).forEach(([C,f])=>this.set(C,f))}map(n){n.forEach((C,f)=>{if(C instanceof B)this.set(f,C);else if(L(C)){if(this.lacks(f))this.set(f,[]);this.get(f).push(...C)}else if(y(C))this.ass(f,C);else this.set(f,C)})}ass(n,C){if(!this.has(n))this.set(n,{});X(this.get(n),C)}lacks(n){return!this.has(n)}init(n,C){return this.has(n)?this.get(n):this.set(n,C).get(n)}}var{values:V,keys:w,entries:q}=Object;var X=Object.assign,Fn=(n,C)=>Object.hasOwn(n,C),Nn=(n)=>{return Object.keys(n).length};class Jn{static rand(n=6,C){if(C)return Math.floor(Math.random()*(C-n+1)+n);return Math.floor(Math.random()*n)+1-1}static fill(n,C=null){return Array(n).fill(C)}static new({dom:n,id:C,inner:f}){let $=document.createElement(n);if(C)$.id=C;if(f)$.innerHTML=f;return $}static randFrom(n){if(Array.isArray(n)){let C=n.length,f=this.rand(0,C-1);return n[f]}else if(typeof n=="object"){let C=w(n),f=C.length,$=this.rand(0,f-1);return C[$]}}static randArray(n=[],C=1,f=!1){let $=[],T=f?new Set:null;while((f?T.size:$.length)<C){let S=n[Jn.rand(0,n.length-1)];f?T.add(S):$.push(S)}return f?[...T]:$}static randomAZ=Hn;static makeID=x;static class(n,...C){let f=C.filter(Boolean);if(n?.class)f.push(...L(n.class)?n.class:[n.class]);if(f.length)n.class=C}static get O(){return{vals:V,keys:w,items:q,has:Fn,ass:X,len:(n={})=>w(n).length}}static get is(){return Sn}static get return(){return Xn}static isHREF(n,C){return n===C?!0:n.startsWith(C)&&C!=="/"?!0:!1}static sleep=(n=1000)=>new Promise((C)=>setTimeout(C,n));static get screen(){let{innerWidth:n}=window,C={xs:n<=480,sm:n>=480,smd:n>=624,md:n>=768,lg:n>=1024,xl:n>=1280,xxl:n>=1536},f=q(C).reverse();for(let $=0;$<f.length;$++){let[T,S]=f[$];if(S)return T}return}bytes(n){if(n===0)return"0 Bytes";let C=1024,f=["Bytes","KB","MB","GB"],$=Math.floor(Math.log(n)/Math.log(C));return parseFloat((n/Math.pow(C,$)).toFixed(2))+" "+f[$]}static format(n){return new Yn(n)}}class Xn{static arr(n){return n?L(n)?n:[n]:[]}static num(n,C=0){let f=parseFloat(n);return isNaN(f)?C:f}static str(n){return String(n)}static arr2obj(n,C=!1){return n.reduce((f,$,T)=>{if(C)f[$]=T;else f[T]=$;return f},{})}}class Yn{val;constructor(n){this.val=n}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}var bn={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class N{static default="xs";static prop=q(bn).reduce((n,[C,f],$)=>{return n[C]=`(${$==0?"max-width":"min-width"}: ${f})`,n},{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)"};constructor(n,C={}){let f=N.default,$={};if(n!==void 0)A($,f,n,f);q(C).forEach(([T,S])=>{A($,T,S,f)}),X(this,$)}static get breakpoints(){return Qn(p(bn))}}var A=(n,C,f,$)=>{if(f!==void 0)if(f instanceof N)q(f).forEach(([T,S])=>{if($!==C)if(C!==T)if($===T)A(n,C,S,$);else A(n,`${C}-${T}`,S,$);else A(n,T,S,$);else A(n,T,S,$)});else n[C]=f};function j(n,C){if(C)return new N(n,C);return new N(void 0,n)}function pn(n){if(this._prefix)return j({[this._prefix]:n});else return j({xs:n})}function Y(n){return new this.constructor({prefix:n,values:this._values,data:this.data})}class a{_prefix;data;_values;constructor({prefix:n,data:C,values:f}={data:{},values:{}}){this._prefix=n,this._values=f,q(f).forEach(([$,T])=>{if(!this._values[$])this._values[$]=j({});X(this._values[$],T)}),this.data=C}get XS(){return Y.call(this,"xs")}get SM(){return Y.call(this,"sm")}get SMD(){return Y.call(this,"smd")}get MD(){return Y.call(this,"md")}get LG(){return Y.call(this,"lg")}get XL(){return Y.call(this,"xl")}get XXL(){return Y.call(this,"xxl")}get NO_HOVER(){return Y.call(this,"no_hover")}get MOBILE(){return Y.call(this,"no_hover")}get PRINT(){return Y.call(this,"print")}get SCREEN(){return Y.call(this,"screen")}get DARK(){return Y.call(this,"dark")}set _value(n){q(n).forEach(([C,f])=>{if(!this._values[C])this._values[C]=j({});X(this._values[C],pn.call(this,f))})}get _value(){return this._values}}class b{k="";fallback;var="";value;constructor(n={},C){if(Nn(n)){let[f,$]=q(n)[0];this.k=f,this.var="--"+K(f),this.value=$ instanceof N?$:j($,{}),this.fallback=C}else this.value=j({})}__(n){if(n)this.fallback=n;let C=this.fallback;if(C)return`var(${this.var}, ${E(C)})`;else return`var(${this.var})`}new(n,C){return new b({[this.k]:n instanceof N?n:E(n)},C)}}var an=(n,C)=>{return new b(n,C)},sn=(n)=>{let C={};for(let f in n)C[f]=new b({[f]:n[f]});return C};var E=(n,C={unit:"rem"})=>{let{rem:f,second:$,quote:T,degree:S,percent:Q,delimeter:U,unit:R,delimeter_arr:W}=C;if(Tn(n)||v(n)||!T&&n==="")return"";let J=L(n)?n:[n];if(!J.length)return"";return J.filter((G)=>g(G)).map((G)=>{if(L(G))return U=W||", ",E(G,{...C,delimeter:" "});if(G instanceof b)return G.__();if(T)G=String(G);if($n(G))if(f)return`${G}${R?R:"rem"}`;else if(S)return`${G}deg`;else if(Q)return`${G}%`;else if($)return`${G}s`;else return String(G);if(M(G))if(G.includes("("))return G;else if(T)return`'${G}'`;else return G;return""}).filter((G)=>g(G)&&G!=="").join(U||" ")};var gn=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),en=new Set([...gn,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","animationIterationCount","animationTimingFunction","transitionTimingFunction","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),nC=new Set(["content"]),CC=new Set(["transitionProperty"]),P=(n,C,f="rem")=>{let $=E(C,{rem:!en.has(n),second:gn.has(n),quote:nC.has(n),delimeter:CC.has(n)?", ":" ",unit:f});return`${K(n)}: ${$};`};class s{value;__;constructor(n){if(this.value=new B,M(n))this.value.set(n,[]);else q(n).forEach(([C,f])=>{this.value.set(`${C}:${f}`,[])});this.__=(...C)=>{return this.value.forEach((f)=>{f.push(...C)}),this}}}function fC(n){return new s(n).__}var o=(n)=>{if(k(n))return o(n());if(n instanceof N)return n;if(n instanceof b)return j(n.__(),{});return j(n,{})};function $C(n){let C={};return n.split(";").map((f)=>f.trim()).filter((f)=>f!=="").forEach((f)=>{let[$,T]=f.split(":").map((Q)=>Q.trim()),S=On($);if(!isNaN(Number(T))&&isFinite(Number(T)))C[S]=Number(T);else C[S]=T}),C}var TC=(n)=>{n.value.forEach((C,f)=>{n.value.set(f,C.map(($)=>{let T={};return q($).forEach(([S,Q])=>{if(g(Q))T[S]=o(Q)}),T}))})},qn=(n,C=[])=>{let f=[];if(L(n))return qn(n[0],f);if(n instanceof b)return qn(V(n.value),f);return f.push(String(n)),f};class Gn{base;constructor(n){this.base=n}props(n,C,f){let $=["animation","animationName"].includes(C);return q(f).forEach(([T,S])=>{if($)f[T]=this.addPrefixToAnimation(n,S);else f[T]=S}),f}addPrefixToAnimation(n,C){if(C instanceof b)this.saveAnim(n,C);else if(L(C))return C[0]=this.addPrefixToAnimation(n,C[0]),C;else if(M(C)&&!C.includes("("))return C.split(", ").map((T)=>{let S=T.split(" "),Q=S[0],U=S.slice(1).join(" "),R=`${this.base.PREFIX}${Q}`;return this.base.ANIM.init(R,new Set).add(n),`${this.base.PREFIX}${Q} ${U}`.trim()}).join(", ");return C}saveAnim(n,C){qn(C).forEach((f)=>{this.base.ANIM.init(`${this.base.PREFIX}${f}`,new Set).add(n)})}process(n,C,f,$,T){if(f instanceof b)this.saveAnim(n,f),$.ass(C,this.props(n,f.var,o(f)));else if(C.startsWith(":")||C.startsWith(",")||C.startsWith("[")){if(C.startsWith("::before")||C.startsWith("::after")){if(L(f)){if(!f.some((Q)=>("content"in Q)))f.push({content:""})}}this.set(n+C,f,T)}else if(C.startsWith(" ")){let Q=C.match(/^.*?\w/gm)?.[0].slice(0,-1),U=C.replaceAll(/, /gm,`, ${n}${Q}`);this.set(n+U,f,T)}else if(fn(C))this.set(n+C,f,T);else $.set(C,this.props(n,C,o(f)))}set(n,C,f){if(!y(C)&&!M(C))return;let $=new B;if(C instanceof b)this.saveAnim(n,C),$.ass(C.var,this.props(n,C.var,o(C.value)));else if(C instanceof a)q(C._value).forEach(([S,Q])=>{if(g(Q))$.set(S,this.props(n,S,o(Q)))});else if(C instanceof s)TC(C),$.init("supports",[]).push(C);else if(L(C))C.forEach((S)=>{this.set(n,S,f)});else if(M(C)){let S=$C(C);this.set(n,S,f)}else q(C).forEach(([S,Q])=>{return this.process(n,S,Q,$,f)});let T=f.init(n,new B);$.forEach((S,Q)=>{if(Q==="supports")f.init(n,new B).init(Q,[])?.push(...S);else T.set(Q,S)})}}class d{PRE;EXPORT;UNIT;PS;PREFIX;ARR=new B;CID=new B;DATA=new B;ANIM=new B;IMPORTED=[];constructor(n="",C="",f,$){this.PRE=n;this.EXPORT=f;this.UNIT=$;this.PREFIX=C?C+"_":C,this.PS=new Gn(this)}get(n,C,f){let $=n.PRE+C;if(n.DATA.has($))return $;else if(C in n)return n[C];else return n.PRE+C}set(n,C,f){return!1}get css(){return new Proxy(this,this)}load(n){return this.IMPORTED.push(n),this}__(n){Object.entries(n).forEach(([C,f])=>{this.set(this,C,f)})}}class i extends d{set(n,C,f){let $=n.PRE+C;return n.PS.set($,f,n.DATA),!0}}class r extends d{webkit;constructor(n="",C=!0,f){super("",n,!1,f);this.webkit=C}set(n,C,f){let $=n.PREFIX+C,T=L(f)?f:[f],S=new B;if(T.forEach((Q)=>{q(Q).forEach(([U,R])=>{let W=_(U)?`${U}%`:U;n.PS.set(W,R,S)})}),n.ANIM.init($,new Set),n.DATA.set(`@keyframes ${$}`,S),this.webkit)n.DATA.set(`@-webkit-keyframes ${$}`,S);return!0}}class l extends d{constructor(n=""){super("@",n)}set(n,C,f){return n.ARR.init(n.PRE+C,new Set).add(f),n}}class m extends d{constructor(n=""){super("@font-face",n);this.ARR.set(this.PRE,new Set)}set(n,C,f){let $=q({fontFamily:C,...f}).map(([T,S])=>{return P(T,S,this.UNIT)});return n.ARR.get(n.PRE)?.add($.join(`
3
+ `)),!0}}var jn=Array.from;class Rn{shweet;shaker;include;CID=new B;css="";constructor(n,C=[],f=[]){this.shweet=n;this.shaker=C;this.include=f}load(n){let C=N.default,f=N.prop;X(f,N.extra);let $=new B,T={},S={},Q={},U=new Set,R={},W={};w(f).forEach((J)=>{R[J]={}});for(let J of V(this.shweet))if(J instanceof i)this.ClassID(J,T,S,n),J.ANIM.forEach((G,Z)=>{G.forEach((O)=>{$.init(Z,new Set).add(O)})});else if(J instanceof r)this.KF(J,Q,$);else if(J instanceof l)this.AT(J,U);else if(J instanceof m)this.FONT(J,U);return q(T).forEach(([J,G])=>{if(!R[J])R[J]={};q(G).forEach(([Z,O])=>{let D=O.join(", ");if(!R[J][D])R[J][D]=[];R[J][D].push(Z)})}),q(S).forEach(([J,G])=>{q(G).forEach(([Z,O])=>{if(!W[Z])W[Z]={};q(O).forEach(([D,H])=>{let F=`@supports(${J})`;if(!W[Z][F])W[Z][F]={};let I=H.join(", ");if(!W[Z][F][I])W[Z][F][I]=new Set;W[Z][F][I].add(D)})})}),q(R).forEach(([J,G])=>{let Z=[],O=[];if(q(G).forEach(([D,H])=>{if(H.some((I)=>{return I.startsWith("animation")||I.startsWith("transition")}))O.push(u(D,H));else Z.push(u(D,H))}),O.length)Z.unshift(...O);if(Q[J])q(Q[J]).forEach(([D,H])=>{Z.push(u(D,H))});if(W[J])q(W[J]).forEach(([D,H])=>{let F=q(H).map(([I,Cn])=>{return u(I,[...Cn])});Z.push(u(D,F))});if(Z.length)if(U.add(`/* -------------- ${J+(J===C?" ( default )":"")} */`),J===C)U.add(Z.join(`
4
+ `));else{let D=J.split("-").map((H)=>f[H]).join(" and ");U.add(`@media ${D} {
5
5
  ${Z.join(`
6
6
  `)}
7
7
  }`)}}),this.css=[...U].join(`
8
- `),this}ClassID(n,C,f,$){let T=(S,J,U,W,R)=>{q(J).forEach(([t,G])=>{this.push(R,U,t,W,P(S,G,n.UNIT))})};n.DATA.forEach((S,J)=>{let U=EC(J,n.PREFIX),W=this.getCID(J,n.PREFIX,$);S.forEach((R,t)=>{if(t==="supports"){if(L(R))R.forEach((G)=>{G.value.forEach((Z,O)=>{if(!(O in f))f[O]={};Z.forEach((D)=>{q(D).forEach(([H,F])=>{T(H,F,U,W,f[O])})})})})}else T(t,R,U,W,C)})}),n.IMPORTED.forEach((S)=>{this.ClassID(S,C,f,S.EXPORT)})}KF(n,C,f){let $=(T,S,J)=>{In(C,T,S),C[T][S].push(J)};n.DATA.forEach((T,S)=>{T.forEach((J,U)=>{let W={};J.forEach((R,t)=>{if(t==="supports")c.e=["@supports not supported in @keyframes",{error:"support in keyframes"}];else q(R).forEach(([G,Z])=>{if(this.shaker.length){let O=S.split(" ")[1];if(f.has(O)){if([...f.get(O)].some((F)=>{return this.getCID(F,"",!1,!1)})){if(!(G in W))W[G]=[];W[G].push(P(t,Z,n.UNIT))}}}else{if(!(G in W))W[G]=[];W[G].push(P(t,Z,n.UNIT))}})}),q(W).forEach(([R,t])=>{$(R,S,z(U,t))})})}),n.IMPORTED.forEach((T)=>{this.KF(T,C,f)})}AT(n,C){for(let[f,$]of n.ARR)$.forEach((T)=>{let S=T.includes("(")?T:`"${T}"`;C.add(`${f} ${S.trim()};`)});n.IMPORTED.forEach((f)=>{this.AT(f,C)})}FONT(n,C){(n.ARR.get("@font-face")??new Set).forEach((T)=>{C.add(`@font-face {
8
+ `),this}ClassID(n,C,f,$){let T=(S,Q,U,R,W)=>{q(Q).forEach(([J,G])=>{this.push(W,U,J,R,P(S,G,n.UNIT))})};n.DATA.forEach((S,Q)=>{let U=SC(Q,n.PREFIX),R=this.getCID(Q,n.PREFIX,$);S.forEach((W,J)=>{if(J==="supports"){if(L(W))W.forEach((G)=>{G.value.forEach((Z,O)=>{if(!(O in f))f[O]={};Z.forEach((D)=>{q(D).forEach(([H,F])=>{T(H,F,U,R,f[O])})})})})}else T(J,W,U,R,C)})}),n.IMPORTED.forEach((S)=>{this.ClassID(S,C,f,S.EXPORT)})}KF(n,C,f){let $=(T,S,Q)=>{In(C,T,S),C[T][S].push(Q)};n.DATA.forEach((T,S)=>{T.forEach((Q,U)=>{let R={};Q.forEach((W,J)=>{if(J==="supports")c.e=["@supports not supported in @keyframes",{error:"support in keyframes"}];else q(W).forEach(([G,Z])=>{if(this.shaker.length){let O=S.split(" ")[1];if(f.has(O)){if([...f.get(O)].some((F)=>{return this.getCID(F,"",!1,!1)})){if(!(G in R))R[G]=[];R[G].push(P(J,Z,n.UNIT))}}}else{if(!(G in R))R[G]=[];R[G].push(P(J,Z,n.UNIT))}})}),q(R).forEach(([W,J])=>{$(W,S,u(U,J))})})}),n.IMPORTED.forEach((T)=>{this.KF(T,C,f)})}AT(n,C){for(let[f,$]of n.ARR)$.forEach((T)=>{let S=T.includes("(")?T:`"${T}"`;C.add(`${f} ${S.trim()};`)});n.IMPORTED.forEach((f)=>{this.AT(f,C)})}FONT(n,C){(n.ARR.get("@font-face")??new Set).forEach((T)=>{C.add(`@font-face {
9
9
  ${T}
10
- }`)}),n.IMPORTED.forEach((T)=>{this.FONT(T,C)})}getCID(n,C,f,$=!0){let T=/\.(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,S=/#(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,J=/\b([a-zA-Z][a-zA-Z0-9]*)\b(?![^{}]*})/g,U=[...new Set(Un(n,T)),...new Set(Un(n,S))];if($&&b(f)&&f)U.forEach((W)=>{this.CID.init(W.replaceAll("-","_"),new Set).add(C+W)});return U.push(...new Set(Un(n,J))),U.some((W)=>this.shaker.includes(W)||this.include.includes(W))}push(n,C,f,$,T){if(!(this.shaker.length&&C.startsWith(".")||this.shaker.length&&C.startsWith("#"))||$)In(n,f,T),TC(n,f,T,C)}}var z=(n,C)=>{return`${n} {
10
+ }`)}),n.IMPORTED.forEach((T)=>{this.FONT(T,C)})}getCID(n,C,f,$=!0){let T=/\.(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,S=/#(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,Q=/\b([a-zA-Z][a-zA-Z0-9]*)\b(?![^{}]*})/g,U=[...new Set(Un(n,T)),...new Set(Un(n,S))];if($&&g(f)&&f)U.forEach((R)=>{this.CID.init(R.replaceAll("-","_"),new Set).add(C+R)});return U.push(...new Set(Un(n,Q))),U.some((R)=>this.shaker.includes(R)||this.include.includes(R))}push(n,C,f,$,T){if(!(this.shaker.length&&C.startsWith(".")||this.shaker.length&&C.startsWith("#"))||$)In(n,f,T),tC(n,f,T,C)}}var u=(n,C)=>{return`${n} {
11
11
  ${C.join(`
12
12
  `)}
13
- }`},Un=(n,C)=>{return jn(n.matchAll(C),(f)=>f[1])},In=(n,C,f)=>{try{if(!n[C])n[C]={},n[C][f]=[];if(!n[C][f])n[C][f]=[]}catch($){c.e=[`property "${C}" not found!`,{error:"@ensurePropsInitialized"}]}},TC=(n,C,f,$)=>{if(!n[C])n[C]={[f]:$.split(",").map((T)=>T.trim())};else n[C][f].push(...$.split(",").map((T)=>T.trim()))},EC=(n,C)=>{if(C)return n.replaceAll(/\.|\#/g,(f)=>f+C);return n};import{mkdirSync as SC,writeFileSync as QC,existsSync as Mn}from"fs";var e=(n,C="")=>{if(Mn(n))return!0;return QC(n,C,{flag:"wx"}),!0},nn=(n)=>{if(Mn(n))return!0;return SC(n,{recursive:!0}),!0};import{writeFileSync as Vn}from"fs";function E(n){return function(...C){return{[n]:C}}}class wn{static attr(n){let[C,f]=q(n)[0];return E(`[${C}="${f}"]`)}static after(n=""){return E("::after"+n)}static before(n=""){return E("::before"+n)}static backdrop(n=""){return E("::backdrop"+n)}static cue(n=""){return E("::cue"+n)}static cueRegion(n=""){return E("::cue-region"+n)}static firstLetter(n=""){return E("::first-letter"+n)}static firstLine(n=""){return E("::first-line"+n)}static marker(n=""){return E("::marker"+n)}static part(n=""){return E("::part"+n)}static placeholder(n=""){return E("::placeholder"+n)}static selection(n=""){return E("::selection"+n)}static slotted(n=""){return E("::slotted"+n)}static spellingError(n=""){return E("::spelling-error"+n)}static targetText(n=""){return E("::target-text"+n)}static viewTransition(n=""){return E("::view-transition"+n)}static viewTransitionGroup(n=""){return E("::view-transition-group"+n)}static viewTransitionImagePair(n=""){return E("::view-transition-image-pair"+n)}static viewTransitionNew(n=""){return E("::view-transition-new"+n)}static viewTransitionOld(n=""){return E("::view-transition-old"+n)}static scrollbar(n=""){return E("::-webkit-scrollbar"+n)}static scrollbarThumb(n=""){return E("::-webkit-scrollbar-thumb"+n)}static scrollbarTrack(n=""){return E("::-webkit-scrollbar-track"+n)}static scrollbarCorner(n=""){return E("::-webkit-scrollbar-corner"+n)}static active(n=""){return E(":active"+n)}static anyLink(n=""){return E(":any-link"+n)}static autofill(n=""){return E(":autofill"+n)}static blank(n=""){return E(":blank"+n)}static checked(n=""){return E(":checked"+n)}static current(n=""){return E(":current"+n)}static default(n=""){return E(":default"+n)}static defined(n=""){return E(":defined"+n)}static disabled(n=""){return E(":disabled"+n)}static empty(n=""){return E(":empty"+n)}static enabled(n=""){return E(":enabled"+n)}static first(n=""){return E(":first"+n)}static firstChild(n=""){return E(":first-child"+n)}static firstOfType(n=""){return E(":first-of-type"+n)}static fullscreen(n=""){return E(":fullscreen"+n)}static future(n=""){return E(":future"+n)}static focus(n=""){return E(":focus"+n)}static focusVisible(n=""){return E(":focus-visible"+n)}static focusWithin(n=""){return E(":focus-within"+n)}static host(n=""){return E(":host"+n)}static hover(n=""){return E(":hover"+n)}static indeterminate(n=""){return E(":indeterminate"+n)}static inRange(n=""){return E(":in-range"+n)}static invalid(n=""){return E(":invalid"+n)}static lastChild(n=""){return E(":last-child"+n)}static lastOfType(n=""){return E(":last-of-type"+n)}static left(n=""){return E(":left"+n)}static link(n=""){return E(":link"+n)}static localLink(n=""){return E(":local-link"+n)}static modal(n=""){return E(":modal"+n)}static onlyChild(n=""){return E(":only-child"+n)}static onlyOfType(n=""){return E(":only-of-type"+n)}static optional(n=""){return E(":optional"+n)}static outOfRange(n=""){return E(":out-of-range"+n)}static past(n=""){return E(":past"+n)}static pictureInPicture(n=""){return E(":picture-in-picture"+n)}static placeholderShown(n=""){return E(":placeholder-shown"+n)}static paused(n=""){return E(":paused"+n)}static playing(n=""){return E(":playing"+n)}static readOnly(n=""){return E(":read-only"+n)}static readWrite(n=""){return E(":read-write"+n)}static required(n=""){return E(":required"+n)}static right(n=""){return E(":right"+n)}static root(n=""){return E(":root"+n)}static scope(n=""){return E(":scope"+n)}static target(n=""){return E(":target"+n)}static targetWithin(n=""){return E(":target-within"+n)}static userInvalid(n=""){return E(":user-invalid"+n)}static valid(n=""){return E(":valid"+n)}static visited(n=""){return E(":visited"+n)}static dir(n){return E(`:dir(${n})`)}static has(n){return E(`:has(${n})`)}static host_(n){return E(`:host(${n})`)}static hostContext(n){return E(`:host-context(${n})`)}static is(n){return E(`:is(${n})`)}static lang(n){return E(`:lang(${n})`)}static not(n){return E(`:not(${n})`)}static nthChild(n){return E(`:nth-child(${n})`)}static nthCol(n){return E(`:nth-col(${n})`)}static nthLastChild(n){return E(`:nth-last-child(${n})`)}static nthLastCol(n){return E(`:nth-last-col(${n})`)}static nthLastOfType(n){return E(`:nth-last-of-type(${n})`)}static nthOfType(n){return E(`:nth-of-type(${n})`)}static state(n){return E(`:state(${n})`)}static where(n){return E(`:where(${n})`)}static and(n){return E(", "+n)}static child(n){return E(" > "+n)}static desc(n){return E(" "+n)}static next(n){return E(" + "+n)}static general(n){return E(" ~ "+n)}static withClass(n){if(!n.startsWith("."))throw Error("should start with . or # - class / id");return E(n)}}class Kn{static minmax(n,C){return`minmax(${Q([n,C],{rem:!0,delimeter:", "})})`}static fitContent(n){return`fit-content(${Q([n],{rem:!0})})`}static repeat(n,...C){return`repeat(${Q([n,Q([C],{rem:!0})],{delimeter:", "})})`}}class hn extends Kn{static attr(n,C,f){return`attr(${Q([n,C,f])})`}static blur(n){return`blur(${Q([n],{rem:!0})})`}static brightness(n){return`brightness(${Q([n])})`}static calc(...n){return`calc(${Q(n,{rem:!0})})`}static circle(n,C){return`circle(${Q([n,C],{rem:!0})})`}static clamp(n,C,f){return`clamp(${Q([n,C,f],{rem:!0,delimeter:", "})})`}static colorMix(n,C,f){return`color-mix(${Q([n,Q(L(C)?C:[C]),Q(L(f)?f:[f])],{delimeter:", "})})`}static conicGradient(...n){return`conic-gradient(${Q(n,{delimeter:", "})})`}static contrast(n){return`contrast(${Q([n])})`}static cubicBezier(n,C,f,$){return`cubic-bezier(${Q([n,C,f,$],{delimeter:", "})})`}static dropShadow(...n){return`drop-shadow(${Q(n,{rem:!0})})`}static grayscale(n){return`grayscale(${Q([n])})`}static hsl(n,C,f){return`hsl(${Q([n,C,f])})`}static hsla(n,C,f,$){return`hsl(${Q([n,C,f,$?["/",$]:$])})`}static hueRotate(n){return`hue-rotate(${Q([n],{degree:!0})})`}static inset(...n){return`inset(${Q(n,{rem:!0})})`}static invert(n){return`invert(${Q([n])})`}static linearGradient(...n){return`linear-gradient(${Q(n,{delimeter:", "})})`}static matrix(n,C,f,$,T,S){return`matrix(${Q([n,C,f,$,T,S],{delimeter:", "})})`}static matrix3d(n,C,f,$){return`matrix3d(${Q([n,C,f,$],{delimeter:", "})})`}static max(...n){return`max(${Q(n,{rem:!0,delimeter:", "})})`}static min(...n){return`min(${Q(n,{rem:!0,delimeter:", "})})`}static opacity(n){return`opacity(${Q([n])})`}static path(n){return`path(${Q([n],{quote:!0})})`}static clipPath(n,C){return`path(${Q([n,Q([C],{quote:!0})],{delimeter:", "})})`}static perspective(n){return`perspective(${Q([n])})`}static polygon(...n){return`polygon(${Q(n,{percent:!0,delimeter:", "})})`}static ray(...n){return`ray(${Q(n,{degree:!0})})`}static radialGradient(...n){return`radial-gradient(${Q(n,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...n){return`repeating-conic-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...n){return`repeating-linear-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...n){return`repeating-radial-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static rgb(n,C,f){return`rgb(${Q([n,C,f])})`}static rgba(n,C,f,$){return`rgba(${Q([n,C,f,$?["/",$]:void 0],{delimeter_arr:" "})})`}static rotate(n){return`rotate(${Q([n],{degree:!0})})`}static rotate3d(n,C,f,$){return`rotate3d(${Q([Q([n,C,f],{delimeter:", "}),$],{degree:!0,delimeter:", "})})`}static rotateX(n){return`rotateX(${Q([n],{degree:!0})})`}static rotateY(n){return`rotateY(${Q([n],{degree:!0})})`}static rotateZ(n){return`rotateZ(${Q([n],{degree:!0})})`}static saturate(...n){return`saturate(${Q(n)})`}static scale(n,C){return`scale(${Q([n,C],{delimeter:", "})})`}static scale3d(n,C,f){return`scale3d(${Q([n,C,f],{delimeter:", "})})`}static scaleX(n){return`scaleX(${Q([n])})`}static scaleY(n){return`scaleY(${Q([n])})`}static scaleZ(n){return`scaleZ(${Q([n])})`}static sepia(n){return`sepia(${Q([n])})`}static skew(...n){return`skew(${Q(n,{degree:!0,delimeter:", "})})`}static skewX(n){return`skewX(${Q([n],{degree:!0})})`}static skewY(n){return`skewY(${Q([n],{degree:!0})})`}static steps(n,C){return`steps(${Q([n,C],{delimeter:", "})})`}static translate(...n){return`translate(${Q(n,{rem:!0,delimeter:", "})})`}static translate3d(...n){return`translate3d(${Q(n,{rem:!0,delimeter:", "})})`}static translateX(n){return`translateX(${Q([n],{rem:!0})})`}static translateY(n){return`translateY(${Q([n],{rem:!0})})`}static translateZ(...n){return`translateZ(${Q(n,{rem:!0,delimeter:", "})})`}static url(n){return`url(${Q([n],{quote:!0})})`}static var(n,C=""){n="--"+K(n);let f=C?", "+Q([C],{rem:!0,delimeter:", "}):"";return`var(${Q([n],{rem:!0})}${f})`}}var JC={important:" !important",visible:"visible",hidden:"hidden",auto:"auto",none:"none",clip:"clip",scroll:"scroll",initial:"initial",inherit:"inherit",flex:"flex",center:"center",flex_start:"flex-start",flex_end:"flex-end",space_evenly:"space-evenly",stretch:"stretch",wrap:"wrap",column:"column",column_reverse:"column-reverse",row:"row",row_reverse:"row-reverse",space_between:"space-between",space_around:"space-around",pr100:"100%",pr50:"50%",i100vh:"100vh",i100vw:"100vw",block:"block",sticky:"sticky",fixed:"fixed",absolute:"absolute",relative:"relative",pointer:"pointer",grabbing:"grabbing",checkbox:"checkbox",solid:"solid",inset:"inset",bold:"bold",currentColor:"currentColor",forwards:"forwards",text:"text",norepeat:"no-repeat",nowrap:"nowrap",difference:"difference",preserve3d:"preserve-3d"};class tC{path;name;prefix;exportMap;_imported=new Set;save;constructor({__filename:n,name:C,prefix:f,shweets:$=[],exportMap:T,webkitKeyframes:S,unit:J="rem"}){this.path=n,this.name=C||WC(n),this.prefix=f??"",this.exportMap=T;let U=L($)?$:[$];UC.call(this,this.prefix,U,S,T,J);let W=this;Object.assign(this,{get shweet(){return W}}),this.save=({dir:R,mapDir:t,mapName:G="index",minify:Z=!0,shaker:O=[],include:D=[]})=>{let H=b(T)?T:!!t,F=new Wn(this,O,D).load(H),I=L(R)?R:[R],Cn=Z?qC(F.css):F.css;if(I.forEach((h)=>{if(!h)return;let u=h.endsWith("/")?"":"/",Rn=h+u+this.name+".css";nn(h+u),e(Rn),Vn(Rn,Cn||"/* --------------*/")}),t){let h=t.endsWith("/")?"":"/",u=t+h+G+".js";nn(t+h),e(u),GC(u,F.CID)}return this}}get imported(){return[...this._imported]}}var qC=(n)=>{return n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").replace(/\s*([>~+])\s*/g,"$1").trim()},GC=(n,C)=>{let f={};C.forEach((T)=>{q(T).forEach(([S,J])=>{if(!f[S])f[S]=[J];else f[S].push(J)})});let $=[...C.entries()].map(([T,S])=>{return`${T}="${[...S].join(" ")}"`}).sort((T,S)=>T.localeCompare(S,void 0,{numeric:!0}));Vn(n,$.length?`export const ${$.join()};`:"export {}");return};function UC(n,C,f=!1,$,T){let S={d:new A("",n,$,T),i:new A("#",n,$,T),c:new A(".",n,$,T),kf:new l(n,f,T),at:new r,font:new m};C.forEach((J)=>{this._imported.add(J.path),J._imported.forEach((U)=>{this._imported.add(U)}),w(S).forEach((U)=>{S[U].load(J[U])})}),w(S).forEach((J)=>{S[J]=S[J].css}),X(this,S)}function WC(n){return n.split("/").slice(-1)[0].split(".")[0]}export{JC as v,CC as supports,wn as ps,N as media,g as med,c as log,WC as fileName,hn as f,tn as __,an as Var,Q as Value,tC as Shweet,a as Medyas};
13
+ }`},Un=(n,C)=>{return jn(n.matchAll(C),(f)=>f[1])},In=(n,C,f)=>{try{if(!n[C])n[C]={},n[C][f]=[];if(!n[C][f])n[C][f]=[]}catch($){c.e=[`property "${C}" not found!`,{error:"@ensurePropsInitialized"}]}},tC=(n,C,f,$)=>{if(!n[C])n[C]={[f]:$.split(",").map((T)=>T.trim())};else n[C][f].push(...$.split(",").map((T)=>T.trim()))},SC=(n,C)=>{if(C)return n.replaceAll(/\.|\#/g,(f)=>f+C);return n};import{mkdirSync as EC,writeFileSync as QC,existsSync as Mn}from"fs";var e=(n,C="")=>{if(Mn(n))return!0;return QC(n,C,{flag:"wx"}),!0},nn=(n)=>{if(Mn(n))return!0;return EC(n,{recursive:!0}),!0};import{writeFileSync as Vn}from"fs";function t(n){return function(...C){return{[n]:C}}}class wn{static attr(n){let[C,f]=q(n)[0];return t(`[${C}="${f}"]`)}static after(n=""){return t("::after"+n)}static before(n=""){return t("::before"+n)}static backdrop(n=""){return t("::backdrop"+n)}static cue(n=""){return t("::cue"+n)}static cueRegion(n=""){return t("::cue-region"+n)}static firstLetter(n=""){return t("::first-letter"+n)}static firstLine(n=""){return t("::first-line"+n)}static marker(n=""){return t("::marker"+n)}static part(n=""){return t("::part"+n)}static placeholder(n=""){return t("::placeholder"+n)}static selection(n=""){return t("::selection"+n)}static slotted(n=""){return t("::slotted"+n)}static spellingError(n=""){return t("::spelling-error"+n)}static targetText(n=""){return t("::target-text"+n)}static viewTransition(n=""){return t("::view-transition"+n)}static viewTransitionGroup(n=""){return t("::view-transition-group"+n)}static viewTransitionImagePair(n=""){return t("::view-transition-image-pair"+n)}static viewTransitionNew(n=""){return t("::view-transition-new"+n)}static viewTransitionOld(n=""){return t("::view-transition-old"+n)}static scrollbar(n=""){return t("::-webkit-scrollbar"+n)}static scrollbarThumb(n=""){return t("::-webkit-scrollbar-thumb"+n)}static scrollbarTrack(n=""){return t("::-webkit-scrollbar-track"+n)}static scrollbarCorner(n=""){return t("::-webkit-scrollbar-corner"+n)}static active(n=""){return t(":active"+n)}static anyLink(n=""){return t(":any-link"+n)}static autofill(n=""){return t(":autofill"+n)}static blank(n=""){return t(":blank"+n)}static checked(n=""){return t(":checked"+n)}static current(n=""){return t(":current"+n)}static default(n=""){return t(":default"+n)}static defined(n=""){return t(":defined"+n)}static disabled(n=""){return t(":disabled"+n)}static empty(n=""){return t(":empty"+n)}static enabled(n=""){return t(":enabled"+n)}static first(n=""){return t(":first"+n)}static firstChild(n=""){return t(":first-child"+n)}static firstOfType(n=""){return t(":first-of-type"+n)}static fullscreen(n=""){return t(":fullscreen"+n)}static future(n=""){return t(":future"+n)}static focus(n=""){return t(":focus"+n)}static focusVisible(n=""){return t(":focus-visible"+n)}static focusWithin(n=""){return t(":focus-within"+n)}static host(n=""){return t(":host"+n)}static hover(n=""){return t(":hover"+n)}static indeterminate(n=""){return t(":indeterminate"+n)}static inRange(n=""){return t(":in-range"+n)}static invalid(n=""){return t(":invalid"+n)}static lastChild(n=""){return t(":last-child"+n)}static lastOfType(n=""){return t(":last-of-type"+n)}static left(n=""){return t(":left"+n)}static link(n=""){return t(":link"+n)}static localLink(n=""){return t(":local-link"+n)}static modal(n=""){return t(":modal"+n)}static onlyChild(n=""){return t(":only-child"+n)}static onlyOfType(n=""){return t(":only-of-type"+n)}static optional(n=""){return t(":optional"+n)}static outOfRange(n=""){return t(":out-of-range"+n)}static past(n=""){return t(":past"+n)}static pictureInPicture(n=""){return t(":picture-in-picture"+n)}static placeholderShown(n=""){return t(":placeholder-shown"+n)}static paused(n=""){return t(":paused"+n)}static playing(n=""){return t(":playing"+n)}static readOnly(n=""){return t(":read-only"+n)}static readWrite(n=""){return t(":read-write"+n)}static required(n=""){return t(":required"+n)}static right(n=""){return t(":right"+n)}static root(n=""){return t(":root"+n)}static scope(n=""){return t(":scope"+n)}static target(n=""){return t(":target"+n)}static targetWithin(n=""){return t(":target-within"+n)}static userInvalid(n=""){return t(":user-invalid"+n)}static valid(n=""){return t(":valid"+n)}static visited(n=""){return t(":visited"+n)}static dir(n){return t(`:dir(${n})`)}static has(n){return t(`:has(${n})`)}static host_(n){return t(`:host(${n})`)}static hostContext(n){return t(`:host-context(${n})`)}static is(n){return t(`:is(${n})`)}static lang(n){return t(`:lang(${n})`)}static not(n){return t(`:not(${n})`)}static nthChild(n){return t(`:nth-child(${n})`)}static nthCol(n){return t(`:nth-col(${n})`)}static nthLastChild(n){return t(`:nth-last-child(${n})`)}static nthLastCol(n){return t(`:nth-last-col(${n})`)}static nthLastOfType(n){return t(`:nth-last-of-type(${n})`)}static nthOfType(n){return t(`:nth-of-type(${n})`)}static state(n){return t(`:state(${n})`)}static where(n){return t(`:where(${n})`)}static and(n){return t(", "+n)}static child(n){return t(" > "+n)}static desc(n){return t(" "+n)}static next(n){return t(" + "+n)}static general(n){return t(" ~ "+n)}static withClass(n){if(!n.startsWith("."))throw Error("should start with . or # - class / id");return t(n)}}class Kn{static minmax(n,C){return`minmax(${E([n,C],{rem:!0,delimeter:", "})})`}static fitContent(n){return`fit-content(${E([n],{rem:!0})})`}static repeat(n,...C){return`repeat(${E([n,E([C],{rem:!0})],{delimeter:", "})})`}}class hn extends Kn{static attr(n,C,f){return`attr(${E([n,C,f])})`}static blur(n){return`blur(${E([n],{rem:!0})})`}static brightness(n){return`brightness(${E([n])})`}static calc(...n){return`calc(${E(n,{rem:!0})})`}static circle(n,C){return`circle(${E([n,C],{rem:!0})})`}static clamp(n,C,f){return`clamp(${E([n,C,f],{rem:!0,delimeter:", "})})`}static colorMix(n,C,f){return`color-mix(${E([n,E(L(C)?C:[C]),E(L(f)?f:[f])],{delimeter:", "})})`}static conicGradient(...n){return`conic-gradient(${E(n,{delimeter:", "})})`}static contrast(n){return`contrast(${E([n])})`}static cubicBezier(n,C,f,$){return`cubic-bezier(${E([n,C,f,$],{delimeter:", "})})`}static dropShadow(...n){return`drop-shadow(${E(n,{rem:!0})})`}static grayscale(n){return`grayscale(${E([n])})`}static hsl(n,C,f){return`hsl(${E([n,C,f])})`}static hsla(n,C,f,$){return`hsl(${E([n,C,f,$?["/",$]:$])})`}static hueRotate(n){return`hue-rotate(${E([n],{degree:!0})})`}static inset(...n){return`inset(${E(n,{rem:!0})})`}static invert(n){return`invert(${E([n])})`}static linearGradient(...n){return`linear-gradient(${E(n,{delimeter:", "})})`}static matrix(n,C,f,$,T,S){return`matrix(${E([n,C,f,$,T,S],{delimeter:", "})})`}static matrix3d(n,C,f,$){return`matrix3d(${E([n,C,f,$],{delimeter:", "})})`}static max(...n){return`max(${E(n,{rem:!0,delimeter:", "})})`}static min(...n){return`min(${E(n,{rem:!0,delimeter:", "})})`}static opacity(n){return`opacity(${E([n])})`}static path(n){return`path(${E([n],{quote:!0})})`}static clipPath(n,C){return`path(${E([n,E([C],{quote:!0})],{delimeter:", "})})`}static perspective(n){return`perspective(${E([n])})`}static polygon(...n){return`polygon(${E(n,{percent:!0,delimeter:", "})})`}static ray(...n){return`ray(${E(n,{degree:!0})})`}static radialGradient(...n){return`radial-gradient(${E(n,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...n){return`repeating-conic-gradient(${E(n,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...n){return`repeating-linear-gradient(${E(n,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...n){return`repeating-radial-gradient(${E(n,{degree:!0,delimeter:", "})})`}static rgb(n,C,f){return`rgb(${E([n,C,f])})`}static rgba(n,C,f,$){return`rgba(${E([n,C,f,$?["/",$]:void 0],{delimeter_arr:" "})})`}static rotate(n){return`rotate(${E([n],{degree:!0})})`}static rotate3d(n,C,f,$){return`rotate3d(${E([E([n,C,f],{delimeter:", "}),$],{degree:!0,delimeter:", "})})`}static rotateX(n){return`rotateX(${E([n],{degree:!0})})`}static rotateY(n){return`rotateY(${E([n],{degree:!0})})`}static rotateZ(n){return`rotateZ(${E([n],{degree:!0})})`}static saturate(...n){return`saturate(${E(n)})`}static scale(n,C){return`scale(${E([n,C],{delimeter:", "})})`}static scale3d(n,C,f){return`scale3d(${E([n,C,f],{delimeter:", "})})`}static scaleX(n){return`scaleX(${E([n])})`}static scaleY(n){return`scaleY(${E([n])})`}static scaleZ(n){return`scaleZ(${E([n])})`}static sepia(n){return`sepia(${E([n])})`}static skew(...n){return`skew(${E(n,{degree:!0,delimeter:", "})})`}static skewX(n){return`skewX(${E([n],{degree:!0})})`}static skewY(n){return`skewY(${E([n],{degree:!0})})`}static steps(n,C){return`steps(${E([n,C],{delimeter:", "})})`}static translate(...n){return`translate(${E(n,{rem:!0,delimeter:", "})})`}static translate3d(...n){return`translate3d(${E(n,{rem:!0,delimeter:", "})})`}static translateX(n){return`translateX(${E([n],{rem:!0})})`}static translateY(n){return`translateY(${E([n],{rem:!0})})`}static translateZ(...n){return`translateZ(${E(n,{rem:!0,delimeter:", "})})`}static url(n){return`url(${E([n],{quote:!0})})`}static var(n,C=""){n="--"+K(n);let f=C?", "+E([C],{rem:!0,delimeter:", "}):"";return`var(${E([n],{rem:!0})}${f})`}}var JC={important:" !important",visible:"visible",hidden:"hidden",auto:"auto",none:"none",clip:"clip",scroll:"scroll",initial:"initial",inherit:"inherit",flex:"flex",center:"center",flex_start:"flex-start",flex_end:"flex-end",space_evenly:"space-evenly",stretch:"stretch",wrap:"wrap",column:"column",column_reverse:"column-reverse",row:"row",row_reverse:"row-reverse",space_between:"space-between",space_around:"space-around",pr100:"100%",pr50:"50%",i100vh:"100vh",i100vw:"100vw",block:"block",sticky:"sticky",fixed:"fixed",absolute:"absolute",relative:"relative",pointer:"pointer",grabbing:"grabbing",checkbox:"checkbox",solid:"solid",inset:"inset",bold:"bold",currentColor:"currentColor",forwards:"forwards",text:"text",norepeat:"no-repeat",nowrap:"nowrap",difference:"difference",preserve3d:"preserve-3d"};class qC{path;name;prefix;exportMap;_imported=new Set;save;constructor({__filename:n,name:C,prefix:f,shweets:$=[],exportMap:T,webkitKeyframes:S,unit:Q="rem"}){this.path=n,this.name=C||WC(n),this.prefix=f??"",this.exportMap=T;let U=L($)?$:[$];RC.call(this,this.prefix,U,S,T,Q);let R=this;Object.assign(this,{get shweet(){return R}}),this.save=({dir:W,mapDir:J,mapName:G="index",minify:Z=!0,shaker:O=[],include:D=[]})=>{let H=g(T)?T:!!J,F=new Rn(this,O,D).load(H),I=L(W)?W:[W],Cn=Z?GC(F.css):F.css;if(I.forEach((h)=>{if(!h)return;let z=h.endsWith("/")?"":"/",Wn=h+z+this.name+".css";nn(h+z),e(Wn),Vn(Wn,Cn||"/* --------------*/")}),J){let h=J.endsWith("/")?"":"/",z=J+h+G+".js";nn(J+h),e(z),UC(z,F.CID)}return this}}get imported(){return[...this._imported]}}var GC=(n)=>{return n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").replace(/\s*([>~+])\s*/g,"$1").trim()},UC=(n,C)=>{let f={};C.forEach((T)=>{q(T).forEach(([S,Q])=>{if(!f[S])f[S]=[Q];else f[S].push(Q)})});let $=[...C.entries()].map(([T,S])=>{return`${T}="${[...S].join(" ")}"`}).sort((T,S)=>T.localeCompare(S,void 0,{numeric:!0}));Vn(n,$.length?`export const ${$.join()};`:"export {}");return};function RC(n,C,f=!1,$,T){let S={d:new i("",n,$,T),i:new i("#",n,$,T),c:new i(".",n,$,T),kf:new r(n,f,T),at:new l,font:new m};C.forEach((Q)=>{this._imported.add(Q.path),Q._imported.forEach((U)=>{this._imported.add(U)}),w(S).forEach((U)=>{S[U].load(Q[U])})}),w(S).forEach((Q)=>{S[Q]=S[Q].css}),X(this,S)}function WC(n){return n.split("/").slice(-1)[0].split(".")[0]}export{JC as v,fC as supports,wn as ps,N as media,j as med,c as log,WC as fileName,hn as f,Jn as __,sn as Vars,an as Var,E as Value,qC as Shweet,a as Medyas};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shweet",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "CSS in TS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",