shweet 0.0.35 → 0.0.36
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/README.md +3 -1
- package/dist/index.d.ts +2 -17
- package/dist/index.js +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -830,10 +830,12 @@ current source rather than a separate stable abstraction:
|
|
|
830
830
|
- `Var`, `Vars` — custom-property token helpers; see
|
|
831
831
|
[Variables with `Var` and `Vars`](#variables-with-var-and-vars).
|
|
832
832
|
- `fileName` — derives a base file name from a path.
|
|
833
|
-
- `log` — logger re-exported from the helper barrel.
|
|
834
833
|
- `__` — miscellaneous utility namespace (random helpers, DOM creation, and
|
|
835
834
|
formatting) from the helper barrel.
|
|
836
835
|
|
|
836
|
+
Utilities from `@ohmyqt/u` are internal imports where Shweet needs them; Shweet
|
|
837
|
+
does not re-export that package's helpers from its root API.
|
|
838
|
+
|
|
837
839
|
## Examples
|
|
838
840
|
|
|
839
841
|
- [`test/a/index.ts`](test/a/index.ts) — the shared design kit: `Vars` tokens on
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { log } from '@ohmyqt/u';
|
|
1
|
+
import { Mapped } from '@ohmyqt/u';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Value-level number guard matching the migrated source's original behavior.
|
|
6
|
-
* Unlike
|
|
5
|
+
* Unlike the utility package's strict `isNumber`, `NaN` is still a number here, which keeps
|
|
7
6
|
* `Value` output unchanged for non-finite CSS values.
|
|
8
7
|
*/
|
|
9
8
|
declare const isNumber: (value: unknown) => value is number;
|
|
@@ -14,28 +13,14 @@ declare const isNumber: (value: unknown) => value is number;
|
|
|
14
13
|
declare const isNumeric: (value: unknown) => boolean;
|
|
15
14
|
declare const isClassOrId: (key: string) => boolean;
|
|
16
15
|
|
|
17
|
-
declare const guards_isArray: typeof isArray;
|
|
18
16
|
declare const guards_isClassOrId: typeof isClassOrId;
|
|
19
|
-
declare const guards_isDefined: typeof isDefined;
|
|
20
|
-
declare const guards_isFunction: typeof isFunction;
|
|
21
|
-
declare const guards_isNull: typeof isNull;
|
|
22
17
|
declare const guards_isNumber: typeof isNumber;
|
|
23
18
|
declare const guards_isNumeric: typeof isNumeric;
|
|
24
|
-
declare const guards_isObject: typeof isObject;
|
|
25
|
-
declare const guards_isString: typeof isString;
|
|
26
|
-
declare const guards_isUndefined: typeof isUndefined;
|
|
27
19
|
declare namespace guards {
|
|
28
20
|
export {
|
|
29
|
-
guards_isArray as isArray,
|
|
30
21
|
guards_isClassOrId as isClassOrId,
|
|
31
|
-
guards_isDefined as isDefined,
|
|
32
|
-
guards_isFunction as isFunction,
|
|
33
|
-
guards_isNull as isNull,
|
|
34
22
|
guards_isNumber as isNumber,
|
|
35
23
|
guards_isNumeric as isNumeric,
|
|
36
|
-
guards_isObject as isObject,
|
|
37
|
-
guards_isString as isString,
|
|
38
|
-
guards_isUndefined as isUndefined,
|
|
39
24
|
};
|
|
40
25
|
}
|
|
41
26
|
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)??[])[e]||"").match(/at\s+([^(]+)\s*\(/);return(n?n[1].split(".").pop()?.trim():"?")??"?"};class Le{name;constructor(e){this.name=e}log=(...e)=>{let t=Ce(3);console.log(`[${this.name}.${t}]`,...e)};set i(e){let t=Ce(3);console.log(`[${this.name}.${t}]`,...N(e))}}class ee{static logger=(e)=>new Le(O(e)?e:e.constructor.name);static set f(e){let t=Ce();console.log(`[${t}]`,...N(e))}static set i(e){console.info(...N(e))}static set e(e){console.error(...N(e))}static set w(e){console.warn(...N(e))}static set d(e){let t=new Date().toLocaleTimeString();console.log(...N(e),`@ ${t}`)}static get d(){let e=new Date().toLocaleTimeString();console.log(`@ ${e}`);return}}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";var re=(e)=>{if(!e)return"";return e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase())},K=(e)=>{if(!e)return"";let t=e;if(t.startsWith("webkit"))t="-"+t;return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},He=()=>{let e=Math.floor(Math.random()*te.length);return te[e]},We=(e)=>{let t=te+"0123456789",r="";for(let n=0;n<e;n+=1){let i=n===0?te:t;r+=i.charAt(Math.floor(Math.random()*i.length))}return r};var ze=(e)=>JSON.stringify(e),Xe=(e)=>{if(!e||typeof e!=="string")return null;try{return JSON.parse(e)}catch{return null}};import{existsSync as Ue,mkdirSync as Ut,writeFileSync as Zt}from"fs";var be=(e)=>{if(Ue(e))return!0;return Ut(e,{recursive:!0}),!0},Ve=(e,t="")=>{if(Ue(e))return!0;return Zt(e,t,{flag:"wx"}),!0};function Ze(e,t){let r=t.name;t.addInitializer(function(){Object.defineProperty(this,r,{configurable:!0,enumerable:!1,get(){let n=e.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,value:n}),n}})})}class Ge{static arr(e){return e?C(e)?e:[e]:[]}static num(e,t=0){let r=parseFloat(String(e));return Number.isNaN(r)?t:r}static str(e){return String(e)}static arr2obj(e,t=!1){return e.reduce((r,n,i)=>{if(t)r[String(n)]=i;else r[i]=n;return r},{})}}class qe{val;constructor(e){this.val=e}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}class xe{static rand(e=6,t){if(t)return Math.floor(Math.random()*(t-e+1)+e);return Math.floor(Math.random()*e)}static fill(e,t=null){return Array(e).fill(t)}static new({dom:e,id:t,inner:r}){let n=document.createElement(e);if(t)n.id=t;if(r)n.innerHTML=r;return n}static randFrom(e){if(C(e))return e[this.rand(0,e.length-1)];let t=Object.keys(e);return t[this.rand(0,t.length-1)]}static randArray(e=[],t=1,r=!1){let n=[],i=r?new Set:null;while((r?i.size:n.length)<t){let s=e[xe.rand(0,e.length-1)];if(r)i.add(s);else n.push(s)}return r?[...i]:n}static randomAZ=He;static makeID=We;static class(e,...t){let r=t.filter(Boolean);if(e?.class)r.push(...C(e.class)?e.class:[e.class]);if(r.length)e.class=r}static get O(){return{vals:Object.values,keys:Object.keys,items:Object.entries,has:(e,t)=>Object.hasOwn(e,t),ass:Object.assign,len:(e={})=>Object.keys(e).length}}static get is(){return ge}static get return(){return Ge}static isHREF(e,t){return e===t?!0:e.startsWith(t)&&t!=="/"?!0:!1}static sleep=(e=1000)=>new Promise((t)=>setTimeout(t,e));static get screen(){let{innerWidth:e}=window,t={xs:e<=480,sm:e>=480,smd:e>=624,md:e>=768,lg:e>=1024,xl:e>=1280,xxl:e>=1536},r=Object.entries(t).reverse();for(let[n,i]of r)if(i)return n;return}bytes(e){if(e===0)return"0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,n)).toFixed(2))} ${r[n]}`}static format(e){return new qe(e)}static compareObjects=he;static isObjectUdpated=ye}function c(e){return function(...t){return{[e]:t}}}class Qe{static attr(e){let[t,r]=Object.entries(e)[0];return c(`[${t}="${r}"]`)}static after(e=""){return c("::after"+e)}static before(e=""){return c("::before"+e)}static backdrop(e=""){return c("::backdrop"+e)}static cue(e=""){return c("::cue"+e)}static cueRegion(e=""){return c("::cue-region"+e)}static firstLetter(e=""){return c("::first-letter"+e)}static firstLine(e=""){return c("::first-line"+e)}static marker(e=""){return c("::marker"+e)}static part(e=""){return c("::part"+e)}static placeholder(e=""){return c("::placeholder"+e)}static selection(e=""){return c("::selection"+e)}static slotted(e=""){return c("::slotted"+e)}static spellingError(e=""){return c("::spelling-error"+e)}static targetText(e=""){return c("::target-text"+e)}static viewTransition(e=""){return c("::view-transition"+e)}static viewTransitionGroup(e=""){return c("::view-transition-group"+e)}static viewTransitionImagePair(e=""){return c("::view-transition-image-pair"+e)}static viewTransitionNew(e=""){return c("::view-transition-new"+e)}static viewTransitionOld(e=""){return c("::view-transition-old"+e)}static scrollbar(e=""){return c("::-webkit-scrollbar"+e)}static scrollbarThumb(e=""){return c("::-webkit-scrollbar-thumb"+e)}static scrollbarTrack(e=""){return c("::-webkit-scrollbar-track"+e)}static scrollbarCorner(e=""){return c("::-webkit-scrollbar-corner"+e)}static active(e=""){return c(":active"+e)}static anyLink(e=""){return c(":any-link"+e)}static autofill(e=""){return c(":autofill"+e)}static blank(e=""){return c(":blank"+e)}static checked(e=""){return c(":checked"+e)}static current(e=""){return c(":current"+e)}static default(e=""){return c(":default"+e)}static defined(e=""){return c(":defined"+e)}static disabled(e=""){return c(":disabled"+e)}static empty(e=""){return c(":empty"+e)}static enabled(e=""){return c(":enabled"+e)}static first(e=""){return c(":first"+e)}static firstChild(e=""){return c(":first-child"+e)}static firstOfType(e=""){return c(":first-of-type"+e)}static fullscreen(e=""){return c(":fullscreen"+e)}static future(e=""){return c(":future"+e)}static focus(e=""){return c(":focus"+e)}static focusVisible(e=""){return c(":focus-visible"+e)}static focusWithin(e=""){return c(":focus-within"+e)}static host(e=""){return c(":host"+e)}static hover(e=""){return c(":hover"+e)}static indeterminate(e=""){return c(":indeterminate"+e)}static inRange(e=""){return c(":in-range"+e)}static invalid(e=""){return c(":invalid"+e)}static lastChild(e=""){return c(":last-child"+e)}static lastOfType(e=""){return c(":last-of-type"+e)}static left(e=""){return c(":left"+e)}static link(e=""){return c(":link"+e)}static localLink(e=""){return c(":local-link"+e)}static modal(e=""){return c(":modal"+e)}static onlyChild(e=""){return c(":only-child"+e)}static onlyOfType(e=""){return c(":only-of-type"+e)}static optional(e=""){return c(":optional"+e)}static outOfRange(e=""){return c(":out-of-range"+e)}static past(e=""){return c(":past"+e)}static pictureInPicture(e=""){return c(":picture-in-picture"+e)}static placeholderShown(e=""){return c(":placeholder-shown"+e)}static paused(e=""){return c(":paused"+e)}static playing(e=""){return c(":playing"+e)}static readOnly(e=""){return c(":read-only"+e)}static readWrite(e=""){return c(":read-write"+e)}static required(e=""){return c(":required"+e)}static right(e=""){return c(":right"+e)}static root(e=""){return c(":root"+e)}static scope(e=""){return c(":scope"+e)}static target(e=""){return c(":target"+e)}static targetWithin(e=""){return c(":target-within"+e)}static userInvalid(e=""){return c(":user-invalid"+e)}static valid(e=""){return c(":valid"+e)}static visited(e=""){return c(":visited"+e)}static dir(e){return c(`:dir(${e})`)}static has(e){return c(`:has(${e})`)}static host_(e){return c(`:host(${e})`)}static hostContext(e){return c(`:host-context(${e})`)}static is(e){return c(`:is(${e})`)}static lang(e){return c(`:lang(${e})`)}static not(e){return c(`:not(${e})`)}static nthChild(e){return c(`:nth-child(${e})`)}static nthCol(e){return c(`:nth-col(${e})`)}static nthLastChild(e){return c(`:nth-last-child(${e})`)}static nthLastCol(e){return c(`:nth-last-col(${e})`)}static nthLastOfType(e){return c(`:nth-last-of-type(${e})`)}static nthOfType(e){return c(`:nth-of-type(${e})`)}static state(e){return c(`:state(${e})`)}static where(e){return c(`:where(${e})`)}static webkit(e){return c(`::-webkit-${e}`)}static and(e){return c(", "+e)}static child(e){return c(" > "+e)}static desc(e){return c(" "+e)}static next(e){return c(" + "+e)}static general(e){return c(" ~ "+e)}static withClass(e){if(!e.startsWith("."))throw Error("should start with . or # - class / id");return c(e)}}var we={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class w{static default="xs";static prop=Object.entries(we).reduce((e,[t,r],n)=>(e[t]=`(${n==0?"max-width":"min-width"}: ${r})`,e),{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};constructor(e,t={}){let r=w.default,n={};if(e!==void 0)L(n,r,e,r);Object.entries(t).forEach(([i,s])=>{L(n,i,s,r)}),Object.assign(this,n)}static get breakpoints(){return Xe(ze(we))??we}}var L=(e,t,r,n)=>{if(r!==void 0)if(r instanceof w)Object.entries(r).forEach(([i,s])=>{if(n!==t)if(t!==i)if(n===i)L(e,t,s,n);else L(e,`${t}-${i}`,s,n);else L(e,i,s,n);else L(e,i,s,n)});else e[t]=r};function v(e,t){if(t)return new w(e,t);if(typeof e==="object")return new w(void 0,e);return new w(e,{})}function Gt(e){if(this._prefix)return v({[this._prefix]:e});else return v({xs:e})}function j(e){return new this.constructor({prefix:e,values:this._values,data:this.data})}class ne{_prefix;data;_values;constructor({prefix:e,data:t,values:r}={}){this._prefix=e,this._values=r??{},Object.entries(this._values).forEach(([n,i])=>{if(!this._values[n])this._values[n]=v({});Object.assign(this._values[n],i)}),this.data=t??{}}get XS(){return j.call(this,"xs")}get SM(){return j.call(this,"sm")}get SMD(){return j.call(this,"smd")}get MD(){return j.call(this,"md")}get LG(){return j.call(this,"lg")}get XL(){return j.call(this,"xl")}get XXL(){return j.call(this,"xxl")}get NO_HOVER(){return j.call(this,"no_hover")}get MOBILE(){return j.call(this,"mobile")}get PRINT(){return j.call(this,"print")}get SCREEN(){return j.call(this,"screen")}get DARK(){return j.call(this,"dark")}set _value(e){Object.entries(e).forEach(([t,r])=>{if(!this._values[t])this._values[t]=v({});Object.assign(this._values[t],Gt.call(this,r))})}get _value(){return this._values}}class M{k="";fallback;var="";value;constructor(e={},t){if(Object.keys(e).length){let[r,n]=Object.entries(e)[0];this.k=r,this.var="--"+K(r),this.value=n instanceof w?n:v(n,{}),this.fallback=t}else this.value=v({})}__(e){if(e)this.fallback=e;let t=this.fallback;if(t)return`var(${this.var}, ${l(t)})`;else return`var(${this.var})`}new(e,t){return new M({[this.k]:e instanceof w?e:l(e)},t)}}var qt=(e,t)=>new M(e,t),Qt=(e)=>{let t={};for(let r in e)t[r]=new M({[r]:e[r]});return t};var l=(e,t={unit:"rem"})=>{let{rem:r,second:n,quote:i,degree:s,percent:o,delimeter:a,unit:p,delimeter_arr:g}=t;if(Y(e)||B(e)||!i&&e==="")return"";let h=C(e)?e:[e];if(!h.length)return"";return h.filter((u)=>T(u)).map((u)=>{if(C(u))return a=g||", ",l(u,{...t,delimeter:" "});if(u instanceof M)return u.__();if(i)u=String(u);if(fe(u))if(r)return`${u}${p?p:"rem"}`;else if(s)return`${u}deg`;else if(o)return`${u}%`;else if(n)return`${u}s`;else return String(u);if(O(u))if(u.includes("("))return u;else if(i)return`'${u}'`;else return u;return""}).filter((u)=>T(u)&&u!=="").join(a||" ")};class Ye{static minmax(e,t){return`minmax(${l([e,t],{rem:!0,delimeter:", "})})`}static fitContent(e){return`fit-content(${l([e],{rem:!0})})`}static repeat(e,...t){return`repeat(${l([e,l([t],{rem:!0})],{delimeter:", "})})`}}class Je extends Ye{static attr(e,t,r){return`attr(${l([e,t,r])})`}static blur(e){return`blur(${l([e],{rem:!0})})`}static brightness(e){return`brightness(${l([e])})`}static calc(...e){return`calc(${l(e,{rem:!0})})`}static circle(e,t){return`circle(${l([e,t],{rem:!0})})`}static clamp(e,t,r){return`clamp(${l([e,t,r],{rem:!0,delimeter:", "})})`}static colorMix(e,t,r){return`color-mix(${l([e,l(C(t)?t:[t]),l(C(r)?r:[r])],{delimeter:", "})})`}static conicGradient(...e){return`conic-gradient(${l(e,{delimeter:", "})})`}static contrast(e){return`contrast(${l([e])})`}static cubicBezier(e,t,r,n){return`cubic-bezier(${l([e,t,r,n],{delimeter:", "})})`}static dropShadow(...e){return`drop-shadow(${l(e,{rem:!0})})`}static grayscale(e){return`grayscale(${l([e])})`}static hsl(e,t,r){return`hsl(${l([e,t,r])})`}static hsla(e,t,r,n){return`hsl(${l([e,t,r,n?["/",n]:n])})`}static hueRotate(e){return`hue-rotate(${l([e],{degree:!0})})`}static inset(...e){return`inset(${l(e,{rem:!0})})`}static invert(e){return`invert(${l([e])})`}static linearGradient(...e){return`linear-gradient(${l(e,{delimeter:", "})})`}static matrix(e,t,r,n,i,s){return`matrix(${l([e,t,r,n,i,s],{delimeter:", "})})`}static matrix3d(e,t,r,n){return`matrix3d(${l([e,t,r,n],{delimeter:", "})})`}static max(...e){return`max(${l(e,{rem:!0,delimeter:", "})})`}static min(...e){return`min(${l(e,{rem:!0,delimeter:", "})})`}static opacity(e){return`opacity(${l([e])})`}static path(e){return`path(${l([e],{quote:!0})})`}static clipPath(e,t){return`path(${l([e,l([t],{quote:!0})],{delimeter:", "})})`}static perspective(e){return`perspective(${l([e])})`}static polygon(...e){return`polygon(${l(e,{percent:!0,delimeter:", "})})`}static ray(...e){return`ray(${l(e,{degree:!0})})`}static radialGradient(...e){return`radial-gradient(${l(e,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...e){return`repeating-conic-gradient(${l(e,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...e){return`repeating-linear-gradient(${l(e,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...e){return`repeating-radial-gradient(${l(e,{degree:!0,delimeter:", "})})`}static rgb(e,t,r){return`rgb(${l([e,t,r])})`}static rgba(e,t,r,n){return`rgba(${l([e,t,r,n?["/",n]:void 0],{delimeter_arr:" "})})`}static rotate(e){return`rotate(${l([e],{degree:!0})})`}static rotate3d(e,t,r,n){return`rotate3d(${l([l([e,t,r],{delimeter:", "}),n],{degree:!0,delimeter:", "})})`}static rotateX(e){return`rotateX(${l([e],{degree:!0})})`}static rotateY(e){return`rotateY(${l([e],{degree:!0})})`}static rotateZ(e){return`rotateZ(${l([e],{degree:!0})})`}static saturate(...e){return`saturate(${l(e)})`}static scale(e,t){return`scale(${l([e,t],{delimeter:", "})})`}static scale3d(e,t,r){return`scale3d(${l([e,t,r],{delimeter:", "})})`}static scaleX(e){return`scaleX(${l([e])})`}static scaleY(e){return`scaleY(${l([e])})`}static scaleZ(e){return`scaleZ(${l([e])})`}static sepia(e){return`sepia(${l([e])})`}static skew(...e){return`skew(${l(e,{degree:!0,delimeter:", "})})`}static skewX(e){return`skewX(${l([e],{degree:!0})})`}static skewY(e){return`skewY(${l([e],{degree:!0})})`}static steps(e,t){return`steps(${l([e,t],{delimeter:", "})})`}static translate(...e){return`translate(${l(e,{rem:!0,delimeter:", "})})`}static translate3d(...e){return`translate3d(${l(e,{rem:!0,delimeter:", "})})`}static translateX(e){return`translateX(${l([e],{rem:!0})})`}static translateY(e){return`translateY(${l([e],{rem:!0})})`}static translateZ(...e){return`translateZ(${l(e,{rem:!0,delimeter:", "})})`}static url(e){return`url(${l([e],{quote:!0})})`}static format(e){return`format(${l([e],{quote:!0})})`}static var(e,t=""){e="--"+K(e);let r=t?", "+l([t],{rem:!0,delimeter:", "}):"";return`var(${l([e],{rem:!0})}${r})`}}var Yt={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 ie{value;__;constructor(e){if(this.value=new V,O(e))this.value.set(e,[]);else Object.entries(e).forEach(([t,r])=>{this.value.set(`${t}:${r}`,[])});this.__=(...t)=>(this.value.forEach((r)=>{r.push(...t)}),this)}}function Jt(e){return new ie(e).__}var _=(e)=>{if(pe(e))return _(e());if(e instanceof w)return e;if(e instanceof M)return v(e.__(),{});return v(e,{})},oe=(e)=>e==='"'||e==="'",Me="([{",$e=")]}",tt=(e,t)=>{let r=[],n=0,i=null,s=0;for(let o=0;o<e.length;o++){let a=e[o];if(i){if(a==="\\")o++;else if(a===i)i=null;continue}if(a==="\\")o++;else if(oe(a))i=a;else if(Me.includes(a))s++;else if($e.includes(a)){if(s>0)s--}else if(a===t&&s===0)r.push(e.slice(n,o)),n=o+1}return r.push(e.slice(n)),r},er=(e,t)=>{let r=null,n=0;for(let i=0;i<e.length;i++){let s=e[i];if(r){if(s==="\\")i++;else if(s===r)r=null;continue}if(s==="\\")i++;else if(oe(s))r=s;else if(Me.includes(s))n++;else if($e.includes(s)){if(n>0)n--}else if(s===t&&n===0)return i}return-1},Te=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,tr=(e)=>{if(!Te.test(e))return;let t=Number(e);return Number.isFinite(t)?t:void 0};function rt(e){let t={};return tt(e,";").forEach((r)=>{let n=r.trim();if(n==="")return;let i=er(n,":");if(i===-1)return;let s=n.slice(0,i).trim();if(s==="")return;let o=n.slice(i+1).trim(),a=s.startsWith("--"),p=a?s:re(s);if(a){t[p]=o;return}let g=tr(o);t[p]=g===void 0?o:g}),t}var nt=new Set(["initial","inherit","unset","revert","revert-layer"]),rr=new Set(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),nr=new Set(["cubic-bezier","steps","linear"]),ir=new Set(["normal","reverse","alternate","alternate-reverse"]),sr=new Set(["forwards","backwards","both"]),or=new Set(["running","paused"]),it=/^-{0,2}[A-Za-z_][A-Za-z0-9_-]*$/,st=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:s|ms)$/i,je=(e)=>e.length>=2&&oe(e[0])&&e[e.length-1]===e[0],ot=(e)=>{let t=[],r=-1,n=null,i=0;for(let s=0;s<e.length;s++){let o=e[s];if(n){if(o==="\\")s++;else if(o===n)n=null;continue}if(o==="\\"){if(r===-1)r=s;s++;continue}if(oe(o)){if(r===-1)r=s;n=o;continue}if(Me.includes(o)){if(r===-1)r=s;i++;continue}if($e.includes(o)){if(r===-1)r=s;if(i>0)i--;continue}if(i===0&&/\s/.test(o)){if(r!==-1)t.push(e.slice(r,s)),r=-1;continue}if(r===-1)r=s}if(r!==-1)t.push(e.slice(r));return t},ar=(e)=>{if(je(e))return"name";let t=e.match(/^([A-Za-z][A-Za-z0-9-]*)\(/);if(t){if(e.endsWith(")")&&nr.has(t[1].toLowerCase()))return"skip";return"abort"}if(st.test(e)||Te.test(e))return"skip";if(e.toLowerCase()==="!important")return"skip";if(!it.test(e))return"abort";let r=e.toLowerCase();if(nt.has(r)||rr.has(r)||ir.has(r)||sr.has(r)||or.has(r)||r==="infinite"||r==="none")return"skip";return"name"},Re=(e,t)=>{if(je(e)){let r=e.slice(1,-1);if(r==="")return;let n=e[0];return{text:`${n}${t}${r}${n}`,name:r}}return{text:`${t}${e}`,name:e}},cr=(e,t)=>{let r=ot(e),n=-1,i="";for(let a=0;a<r.length;a++){let p=r[a],g=p.toLowerCase(),h=ar(p);if(h==="abort")return{value:e,names:[]};if(g==="!important"&&a!==r.length-1)return{value:e,names:[]};if(h==="skip")continue;if(n!==-1)return{value:e,names:[]};n=a,i=p}if(n===-1)return{value:e,names:[]};let s=Re(i,t);if(!s)return{value:e,names:[]};let o=[...r];return o[n]=s.text,{value:o.join(" "),names:[s.name]}},lr=(e,t)=>{let r=ot(e.trim()),n=r.length>1&&r[r.length-1].toLowerCase()==="!important"?r.pop():void 0;if(r.length!==1)return{value:e,names:[]};let i=r[0];if(je(i)){let o=Re(i,t);if(!o)return{value:e,names:[]};return{value:[o.text,n].filter(Boolean).join(" "),names:[o.name]}}if(i.includes("("))return{value:e,names:[]};if(st.test(i)||Te.test(i))return{value:e,names:[]};if(!it.test(i))return{value:e,names:[]};let s=i.toLowerCase();if(nt.has(s)||s==="none")return{value:e,names:[]};return{value:[Re(i,t).text,n].filter(Boolean).join(" "),names:[i]}},et=(e,t,r)=>{let n=tt(e,",");if(n.some((a)=>a.trim()===""))return{value:e,names:[]};let i=[],s=!1,o=n.map((a)=>{let p=r(a,t);if(i.push(...p.names),p.value!==a)s=!0;return p.value});return{value:s?o.map((a)=>a.trim()).join(", "):e,names:i}},at=(e,t,r="animation")=>{if(r==="animationName")return et(e,t,lr);return et(e,t,cr)},ct=(e)=>{e.value.forEach((t,r)=>{e.value.set(r,t.map((n)=>{let i={};return Object.entries(n).forEach(([s,o])=>{if(T(o))i[s]=_(o)}),i}))})},se=(e,t=[])=>{if(C(e))return se(e[0]);if(e instanceof M)return se(Object.values(e.value));return[String(e)]};function ur(e){let t=[],r=0,n=0,i=null;for(let s=0;s<e.length;s++){let o=e[s];if(o==="\\"){s++;continue}if(i){if(o===i)i=null;continue}if(o==='"'||o==="'")i=o;else if(o==="("||o==="[")n++;else if(o===")"||o==="]"){if(n>0)n--}else if(o===","&&n===0)t.push(e.slice(r,s)),r=s+1}return t.push(e.slice(r)),t}class ke{base;constructor(e){this.base=e}prefixAnimationValues(e,t,r){if(!["animation","animationName"].includes(t))return r;let i=Object.assign(new w,r);return Object.entries(i).forEach(([s,o])=>{i[s]=this.addPrefixToAnimation(e,t,o)}),i}addPrefixToAnimation(e,t,r){if(r instanceof M)this.saveAnim(e,r);else if(C(r))return[this.addPrefixToAnimation(e,t,r[0]),...r.slice(1)];else if(O(r)){let n=at(r,this.base.PREFIX,t);return n.names.forEach((i)=>{let s=`${this.base.PREFIX}${i}`;this.base.ANIM.init(s,new Set).add(e)}),n.value}return r}saveAnim(e,t){se(t).forEach((r)=>{this.base.ANIM.init(`${this.base.PREFIX}${r}`,new Set).add(e)})}processDeclaration(e,t,r,n,i){if(r instanceof M)this.saveAnim(e,r),J(n,t,this.prefixAnimationValues(e,r.var,_(r)));else if(t.startsWith(":")||t.startsWith(",")||t.startsWith("[")){if(t.startsWith("::before")||t.startsWith("::after"));this.set(e+t,r,i)}else if(t.startsWith(" ")){let s=t.match(/^\s*(?:[>+~]\s*)?/)?.[0]??"",o=ur(t.slice(s.length)).map((a)=>`${e}${s}${a.trim()}`).join(", ");this.set(o,r,i)}else if(Se(t))this.set(e+t,r,i);else n.set(t,this.prefixAnimationValues(e,t,_(r)))}set(e,t,r){if(!A(t)&&!B(t)&&!O(t))return;let n=new V;if(t instanceof M)this.saveAnim(e,t),J(n,t.var,this.prefixAnimationValues(e,t.var,_(t.value)));else if(t instanceof ne)Object.entries(t._value).forEach(([s,o])=>{if(T(o))n.set(s,this.prefixAnimationValues(e,s,_(o)))});else if(t instanceof ie)ct(t),n.init("supports",[]).push(t);else if(C(t))t.forEach((s)=>{this.set(e,s,r)});else if(O(t)){let s=rt(t);this.set(e,s,r)}else Object.entries(t).forEach(([s,o])=>{if(o instanceof M){this.saveAnim(e,o),J(n,o.var,this.prefixAnimationValues(e,o.var,_(o.value)));return}return this.processDeclaration(e,s,o,n,r)});let i=r.init(e,new V);n.forEach((s,o)=>{if(o==="supports"&&C(s))r.init(e,new V).init(o,[]).push(...s);else i.set(o,s)})}}class D{PRE;EXPORT;UNIT;SOURCE;PS;PREFIX;ARR=new V;CID=new V;DATA=new V;ANIM=new V;IMPORTED=[];constructor(e="",t="",r,n,i=""){this.PRE=e;this.EXPORT=r;this.UNIT=n;this.SOURCE=i;this.PREFIX=t?t+"_":t,this.PS=new ke(this)}get(e,t,r){let n=e.PRE+t;if(e.DATA.has(n))return n;else if(t in e)return e[t];else return e.PRE+t}set(e,t,r){return!1}get css(){return new Proxy(this,this)}load(e){return this.IMPORTED.push(e),this}__(e){Object.entries(e).forEach(([t,r])=>{this.set(this,t,r)})}}var lt=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),dr=new Set([...lt,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","lineHeight","fontWeight","orphans","widows","tabSize","zoom","borderImageOutset","borderImageSlice","borderImageWidth","animationIterationCount","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),pr=new Set(["content"]),fr=new Set(["transitionProperty"]),H=(e,t,r="rem")=>{let n=re(e),i=l(t,{rem:!dr.has(n),second:lt.has(n),quote:pr.has(e),delimeter:fr.has(e)?", ":" ",unit:r});return`${K(e)}: ${i};`};class E extends D{set(e,t,r){let n=e.PRE+t;return e.PS.set(n,r,e.DATA),!0}}class P extends D{webkit;constructor(e="",t=!0,r,n=""){super("",e,!1,r,n);this.webkit=t}set(e,t,r){let n=e.PREFIX+t,i=C(r)?r:[r],s=new V;if(i.forEach((o)=>{Object.entries(o).forEach(([a,p])=>{let g=me(a)?`${a}%`:a;e.PS.set(g,p,s)})}),e.ANIM.init(n,new Set),e.DATA.set(`@keyframes ${n}`,s),this.webkit)e.DATA.set(`@-webkit-keyframes ${n}`,s);return!0}}class I extends D{constructor(e="",t=""){super("@",e,void 0,void 0,t)}set(e,t,r){return e.ARR.init(e.PRE+t,new Set).add(r),e}}class F extends D{constructor(e="",t=""){super("@font-face",e,void 0,void 0,t);this.ARR.set(this.PRE,new Set)}set(e,t,r){let n=Object.entries({fontFamily:l([t],{quote:!0}),...r}).map(([i,s])=>H(i,s,this.UNIT));return e.ARR.get(e.PRE)?.add(n.join(`
|
|
4
|
-
`)),!0}}var
|
|
2
|
+
var _t=Object.create;var oe=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Ee=(e,t)=>(Object.defineProperty(e,"name",{value:t,enumerable:!1,configurable:!0}),e),It=(e)=>e;function Lt(e,t){this[e]=It.bind(null,t)}var Ht=(e,t)=>{for(var r in t)oe(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Lt.bind(t,r)})};var Be=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),q=(e)=>{throw TypeError(e)},Kt=(e,t,r)=>(t in e)?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var le=(e,t,r)=>t.has(e)||q("Cannot "+r),Ut=(e,t)=>Object(t)!==t?q('Cannot use the "in" operator on this value'):e.has(t),ke=(e,t,r)=>(le(e,t,"read from private field"),r?r.call(e):t.get(e));var De=(e,t,r,n)=>(le(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),zt=(e,t,r)=>(le(e,t,"access private method"),r),Pe=(e)=>[,,,_t(e?.[Be("metadata")]??null)],_e=["class","method","getter","setter","accessor","field","value","get","set"],W=(e)=>e!==void 0&&typeof e!=="function"?q("Function expected"):e,Wt=(e,t,r,n,i)=>({kind:_e[e],name:t,metadata:n,addInitializer:(s)=>r._?q("Already initialized"):i.push(W(s||null))}),ue=(e,t)=>Kt(t,Be("metadata"),e[3]),Fe=(e,t,r,n)=>{for(var i=0,s=e[t>>1],a=s&&s.length;i<a;i++)t&1?s[i].call(r):n=s[i].call(r,n);return n},Ie=(e,t,r,n,i,s)=>{var a,o,p,g,S,c=t&7,d=!!(t&8),m=!!(t&16),f=c>3?e.length+1:c?d?1:2:0,h=_e[c+5],y=c>3&&(e[f-1]=[]),b=e[f]||(e[f]=[]),V=c&&(!m&&!d&&(i=i.prototype),c<5&&(c>3||!m)&&Ft(c<4?i:{get[r](){return ke(this,s)},set[r](M){De(this,s,M)}},r));c?m&&c<4&&Ee(s,(c>2?"set ":c>1?"get ":"")+r):Ee(i,r);for(var A=n.length-1;A>=0;A--){if(g=Wt(c,r,p={},e[3],b),c){if(g.static=d,g.private=m,S=g.access={has:m?(M)=>Ut(i,M):(M)=>(r in M)},c^3)S.get=m?(M)=>(c^1?ke:zt)(M,i,c^4?s:V.get):(M)=>M[r];if(c>2)S.set=m?(M,z)=>De(M,i,z,c^4?s:V.set):(M,z)=>M[r]=z}if(o=(0,n[A])(c?c<4?m?s:V[h]:c>4?void 0:{get:V.get,set:V.set}:i,g),p._=1,c^4||o===void 0)W(o)&&(c>4?y.unshift(o):c?m?s=o:V[h]=o:i=o);else if(typeof o!=="object"||o===null)q("Object expected");else W(a=o.get)&&(V.get=a),W(a=o.set)&&(V.set=a),W(a=o.init)&&y.unshift(a)}return c||ue(e,i),V&&oe(i,r,V),m?c^4?s:V:i};var de={};Ht(de,{isClassOrId:()=>pe,isNumber:()=>ce,isNumeric:()=>fe});var ce=(e)=>typeof e==="number",fe=(e)=>{let t=String(e);return!Number.isNaN(parseFloat(t))&&Number.isFinite(Number(e))},pe=(e)=>e.startsWith(".")||e.startsWith("#");var T=(e)=>typeof e==="string";var Le=(e)=>typeof e==="function";var C=(e)=>Array.isArray(e);var E=(e)=>qt(e)&&typeof e==="object";var D=(e)=>e===null,he=(e)=>e===void 0,N=(e)=>!he(e);var qt=(e)=>e!==null;var I=(e)=>C(e)?e:[e];function me(e=3){let t=((Error().stack?.split(`
|
|
3
|
+
`)??[])[e]||"").match(/at\s+([^(]+)\s*\(/);return(t?t[1].split(".").pop()?.trim():"?")??"?"}class He{name;constructor(e){this.name=e}log=(...e)=>{let t=me(3);console.log(`[${this.name}.${t}]`,...e)};set i(e){let t=me(3);console.log(`[${this.name}.${t}]`,...I(e))}}class ge{static logger=(e)=>new He(T(e)?e:e.constructor.name);static set f(e){let t=me();console.log(`[${t}]`,...I(e))}static set i(e){console.info(...I(e))}static set e(e){console.error(...I(e))}static set w(e){console.warn(...I(e))}static set d(e){let t=new Date().toLocaleTimeString();console.log(...I(e),`@ ${t}`)}static get d(){let e=new Date().toLocaleTimeString();console.log(`@ ${e}`);return}}var Ke=(e)=>JSON.stringify(e),Ue=(e)=>{if(!e||typeof e!=="string")return null;try{return JSON.parse(e)}catch{return null}};class w extends Map{constructor(e){if(e&&!Array.isArray(e)&&typeof e==="object"){super();this.mergeObject(e)}else super(e)}mergeObject(e){if(e&&E(e))Object.entries(e).forEach(([t,r])=>{this.set(t,r)});return this}mergeMap(e){if(!(e instanceof Map))return this;return e.forEach((t,r)=>{let n=this.get(r);if(t instanceof w)if(n instanceof w)n.mergeMap(t);else this.set(r,t);else if(C(t)){let i=C(n)?n:[];this.set(r,[...i,...t])}else if(E(t))this.assign(r,t);else this.set(r,t)}),this}assign(e,t){let r=this.get(e),n=E(r)?r:{};return this.set(e,{...n,...t}),this}lacks(e){return!this.has(e)}init(e,t){if(this.has(e))return this.get(e);return this.set(e,t),t}mapValues(e){let t=new w;return this.forEach((r,n)=>{t.set(n,e(r,n,this))}),t}filter(e){let t=new w;return this.forEach((r,n)=>{if(e(r,n,this))t.set(n,r)}),t}toObject(){let e={};return this.forEach((t,r)=>{let n=String(r);if(t instanceof w)e[n]=t.toObject();else e[n]=t}),e}toJson(){return JSON.stringify(this.toObject())}static fromGroup(e,t){let r=new w;if(!Array.isArray(e))return r;return e.forEach((n)=>{let i=n[t];r.init(i,[]).push(n)}),r}}var J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Q=(e)=>{if(!e)return"";return e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase())},L=(e)=>{if(!e)return"";let t=e;if(t.startsWith("webkit"))t="-"+t;return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()};var ze=()=>{let e=Math.floor(Math.random()*J.length);return J[e]},We=(e)=>{let t=J+"0123456789",r="";for(let n=0;n<e;n++){let i=n===0?J:t;r+=i.charAt(Math.floor(Math.random()*i.length))}return r};var ee=(e,t,r)=>{if(!e.has(t))e.set(t,{});Object.assign(e.get(t),r)},Se=(e,t)=>{let r={added:{},removed:{},modified:{}},n=e,i=t;for(let s of Object.keys(i)){let a=n[s],o=i[s];if(!Object.hasOwn(n,s))r.added[s]=o;else if(C(a)&&C(o)){if(JSON.stringify(a)!==JSON.stringify(o))r.modified[s]={old:a,new:o}}else if(E(a)&&E(o)&&!D(a)&&!D(o)){let p=Se(a,o);if(ye(p))r.modified[s]={old:a,new:o}}else if(a!==o)r.modified[s]={old:a,new:o}}for(let s of Object.keys(n))if(!Object.hasOwn(i,s))r.removed[s]=n[s];return r},ye=(e)=>Object.values(e).some((t)=>Object.keys(t).length>0);import{existsSync as qe,mkdirSync as Yt,writeFileSync as Gt}from"fs";var be=(e)=>{if(qe(e))return!0;return Yt(e,{recursive:!0}),!0},Ce=(e,t="")=>{if(qe(e))return!0;return Gt(e,t,{flag:"wx"}),!0};function Ye(e,t){let r=t.name;t.addInitializer(function(){Object.defineProperty(this,r,{configurable:!0,enumerable:!1,get(){let n=e.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,value:n}),n}})})}class Ge{static arr(e){return e?C(e)?e:[e]:[]}static num(e,t=0){let r=parseFloat(String(e));return Number.isNaN(r)?t:r}static str(e){return String(e)}static arr2obj(e,t=!1){return e.reduce((r,n,i)=>{if(t)r[String(n)]=i;else r[i]=n;return r},{})}}class Xe{val;constructor(e){this.val=e}get px(){return`${this.val}px`}get rem(){return`${this.val}rem`}get pr(){return`${this.val}%`}}class we{static rand(e=6,t){if(t)return Math.floor(Math.random()*(t-e+1)+e);return Math.floor(Math.random()*e)}static fill(e,t=null){return Array(e).fill(t)}static new({dom:e,id:t,inner:r}){let n=document.createElement(e);if(t)n.id=t;if(r)n.innerHTML=r;return n}static randFrom(e){if(C(e))return e[this.rand(0,e.length-1)];let t=Object.keys(e);return t[this.rand(0,t.length-1)]}static randArray(e=[],t=1,r=!1){let n=[],i=r?new Set:null;while((r?i.size:n.length)<t){let s=e[we.rand(0,e.length-1)];if(r)i.add(s);else n.push(s)}return r?[...i]:n}static randomAZ=ze;static makeID=We;static class(e,...t){let r=t.filter(Boolean);if(e?.class)r.push(...C(e.class)?e.class:[e.class]);if(r.length)e.class=r}static get O(){return{vals:Object.values,keys:Object.keys,items:Object.entries,has:(e,t)=>Object.hasOwn(e,t),ass:Object.assign,len:(e={})=>Object.keys(e).length}}static get is(){return de}static get return(){return Ge}static isHREF(e,t){return e===t?!0:e.startsWith(t)&&t!=="/"?!0:!1}static sleep=(e=1000)=>new Promise((t)=>setTimeout(t,e));static get screen(){let{innerWidth:e}=window,t={xs:e<=480,sm:e>=480,smd:e>=624,md:e>=768,lg:e>=1024,xl:e>=1280,xxl:e>=1536},r=Object.entries(t).reverse();for(let[n,i]of r)if(i)return n;return}bytes(e){if(e===0)return"0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,n)).toFixed(2))} ${r[n]}`}static format(e){return new Xe(e)}static compareObjects=Se;static isObjectUdpated=ye}function l(e){return function(...t){return{[e]:t}}}class Ze{static attr(e){let[t,r]=Object.entries(e)[0];return l(`[${t}="${r}"]`)}static after(e=""){return l("::after"+e)}static before(e=""){return l("::before"+e)}static backdrop(e=""){return l("::backdrop"+e)}static cue(e=""){return l("::cue"+e)}static cueRegion(e=""){return l("::cue-region"+e)}static firstLetter(e=""){return l("::first-letter"+e)}static firstLine(e=""){return l("::first-line"+e)}static marker(e=""){return l("::marker"+e)}static part(e=""){return l("::part"+e)}static placeholder(e=""){return l("::placeholder"+e)}static selection(e=""){return l("::selection"+e)}static slotted(e=""){return l("::slotted"+e)}static spellingError(e=""){return l("::spelling-error"+e)}static targetText(e=""){return l("::target-text"+e)}static viewTransition(e=""){return l("::view-transition"+e)}static viewTransitionGroup(e=""){return l("::view-transition-group"+e)}static viewTransitionImagePair(e=""){return l("::view-transition-image-pair"+e)}static viewTransitionNew(e=""){return l("::view-transition-new"+e)}static viewTransitionOld(e=""){return l("::view-transition-old"+e)}static scrollbar(e=""){return l("::-webkit-scrollbar"+e)}static scrollbarThumb(e=""){return l("::-webkit-scrollbar-thumb"+e)}static scrollbarTrack(e=""){return l("::-webkit-scrollbar-track"+e)}static scrollbarCorner(e=""){return l("::-webkit-scrollbar-corner"+e)}static active(e=""){return l(":active"+e)}static anyLink(e=""){return l(":any-link"+e)}static autofill(e=""){return l(":autofill"+e)}static blank(e=""){return l(":blank"+e)}static checked(e=""){return l(":checked"+e)}static current(e=""){return l(":current"+e)}static default(e=""){return l(":default"+e)}static defined(e=""){return l(":defined"+e)}static disabled(e=""){return l(":disabled"+e)}static empty(e=""){return l(":empty"+e)}static enabled(e=""){return l(":enabled"+e)}static first(e=""){return l(":first"+e)}static firstChild(e=""){return l(":first-child"+e)}static firstOfType(e=""){return l(":first-of-type"+e)}static fullscreen(e=""){return l(":fullscreen"+e)}static future(e=""){return l(":future"+e)}static focus(e=""){return l(":focus"+e)}static focusVisible(e=""){return l(":focus-visible"+e)}static focusWithin(e=""){return l(":focus-within"+e)}static host(e=""){return l(":host"+e)}static hover(e=""){return l(":hover"+e)}static indeterminate(e=""){return l(":indeterminate"+e)}static inRange(e=""){return l(":in-range"+e)}static invalid(e=""){return l(":invalid"+e)}static lastChild(e=""){return l(":last-child"+e)}static lastOfType(e=""){return l(":last-of-type"+e)}static left(e=""){return l(":left"+e)}static link(e=""){return l(":link"+e)}static localLink(e=""){return l(":local-link"+e)}static modal(e=""){return l(":modal"+e)}static onlyChild(e=""){return l(":only-child"+e)}static onlyOfType(e=""){return l(":only-of-type"+e)}static optional(e=""){return l(":optional"+e)}static outOfRange(e=""){return l(":out-of-range"+e)}static past(e=""){return l(":past"+e)}static pictureInPicture(e=""){return l(":picture-in-picture"+e)}static placeholderShown(e=""){return l(":placeholder-shown"+e)}static paused(e=""){return l(":paused"+e)}static playing(e=""){return l(":playing"+e)}static readOnly(e=""){return l(":read-only"+e)}static readWrite(e=""){return l(":read-write"+e)}static required(e=""){return l(":required"+e)}static right(e=""){return l(":right"+e)}static root(e=""){return l(":root"+e)}static scope(e=""){return l(":scope"+e)}static target(e=""){return l(":target"+e)}static targetWithin(e=""){return l(":target-within"+e)}static userInvalid(e=""){return l(":user-invalid"+e)}static valid(e=""){return l(":valid"+e)}static visited(e=""){return l(":visited"+e)}static dir(e){return l(`:dir(${e})`)}static has(e){return l(`:has(${e})`)}static host_(e){return l(`:host(${e})`)}static hostContext(e){return l(`:host-context(${e})`)}static is(e){return l(`:is(${e})`)}static lang(e){return l(`:lang(${e})`)}static not(e){return l(`:not(${e})`)}static nthChild(e){return l(`:nth-child(${e})`)}static nthCol(e){return l(`:nth-col(${e})`)}static nthLastChild(e){return l(`:nth-last-child(${e})`)}static nthLastCol(e){return l(`:nth-last-col(${e})`)}static nthLastOfType(e){return l(`:nth-last-of-type(${e})`)}static nthOfType(e){return l(`:nth-of-type(${e})`)}static state(e){return l(`:state(${e})`)}static where(e){return l(`:where(${e})`)}static webkit(e){return l(`::-webkit-${e}`)}static and(e){return l(", "+e)}static child(e){return l(" > "+e)}static desc(e){return l(" "+e)}static next(e){return l(" + "+e)}static general(e){return l(" ~ "+e)}static withClass(e){if(!e.startsWith("."))throw Error("should start with . or # - class / id");return l(e)}}var Ve={xs:"480px",sm:"480px",smd:"624px",md:"768px",lg:"1024px",xl:"1280px",xxl:"1536px"};class x{static default="xs";static prop=Object.entries(Ve).reduce((e,[t,r],n)=>(e[t]=`(${n==0?"max-width":"min-width"}: ${r})`,e),{});static extra={no_hover:"(pointer: coarse)",mobile:"(pointer: coarse)",print:"print",screen:"screen",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};constructor(e,t={}){let r=x.default,n={};if(e!==void 0)H(n,r,e,r);Object.entries(t).forEach(([i,s])=>{H(n,i,s,r)}),Object.assign(this,n)}static get breakpoints(){return Ue(Ke(Ve))??Ve}}var H=(e,t,r,n)=>{if(r!==void 0)if(r instanceof x)Object.entries(r).forEach(([i,s])=>{if(n!==t)if(t!==i)if(n===i)H(e,t,s,n);else H(e,`${t}-${i}`,s,n);else H(e,i,s,n);else H(e,i,s,n)});else e[t]=r};function j(e,t){if(t)return new x(e,t);if(typeof e==="object")return new x(void 0,e);return new x(e,{})}function Xt(e){if(this._prefix)return j({[this._prefix]:e});else return j({xs:e})}function v(e){return new this.constructor({prefix:e,values:this._values,data:this.data})}class te{_prefix;data;_values;constructor({prefix:e,data:t,values:r}={}){this._prefix=e,this._values=r??{},Object.entries(this._values).forEach(([n,i])=>{if(!this._values[n])this._values[n]=j({});Object.assign(this._values[n],i)}),this.data=t??{}}get XS(){return v.call(this,"xs")}get SM(){return v.call(this,"sm")}get SMD(){return v.call(this,"smd")}get MD(){return v.call(this,"md")}get LG(){return v.call(this,"lg")}get XL(){return v.call(this,"xl")}get XXL(){return v.call(this,"xxl")}get NO_HOVER(){return v.call(this,"no_hover")}get MOBILE(){return v.call(this,"mobile")}get PRINT(){return v.call(this,"print")}get SCREEN(){return v.call(this,"screen")}get DARK(){return v.call(this,"dark")}set _value(e){Object.entries(e).forEach(([t,r])=>{if(!this._values[t])this._values[t]=j({});Object.assign(this._values[t],Xt.call(this,r))})}get _value(){return this._values}}class R{k="";fallback;var="";value;constructor(e={},t){if(Object.keys(e).length){let[r,n]=Object.entries(e)[0];this.k=r,this.var="--"+L(r),this.value=n instanceof x?n:j(n,{}),this.fallback=t}else this.value=j({})}__(e){if(e)this.fallback=e;let t=this.fallback;if(t)return`var(${this.var}, ${u(t)})`;else return`var(${this.var})`}new(e,t){return new R({[this.k]:e instanceof x?e:u(e)},t)}}var Zt=(e,t)=>new R(e,t),Jt=(e)=>{let t={};for(let r in e)t[r]=new R({[r]:e[r]});return t};var u=(e,t={unit:"rem"})=>{let{rem:r,second:n,quote:i,degree:s,percent:a,delimeter:o,unit:p,delimeter_arr:g}=t;if(he(e)||D(e)||!i&&e==="")return"";let S=C(e)?e:[e];if(!S.length)return"";return S.filter((c)=>N(c)).map((c)=>{if(C(c))return o=g||", ",u(c,{...t,delimeter:" "});if(c instanceof R)return c.__();if(i)c=String(c);if(ce(c))if(r)return`${c}${p?p:"rem"}`;else if(s)return`${c}deg`;else if(a)return`${c}%`;else if(n)return`${c}s`;else return String(c);if(T(c))if(c.includes("("))return c;else if(i)return`'${c}'`;else return c;return""}).filter((c)=>N(c)&&c!=="").join(o||" ")};class Je{static minmax(e,t){return`minmax(${u([e,t],{rem:!0,delimeter:", "})})`}static fitContent(e){return`fit-content(${u([e],{rem:!0})})`}static repeat(e,...t){return`repeat(${u([e,u([t],{rem:!0})],{delimeter:", "})})`}}class Qe extends Je{static attr(e,t,r){return`attr(${u([e,t,r])})`}static blur(e){return`blur(${u([e],{rem:!0})})`}static brightness(e){return`brightness(${u([e])})`}static calc(...e){return`calc(${u(e,{rem:!0})})`}static circle(e,t){return`circle(${u([e,t],{rem:!0})})`}static clamp(e,t,r){return`clamp(${u([e,t,r],{rem:!0,delimeter:", "})})`}static colorMix(e,t,r){return`color-mix(${u([e,u(C(t)?t:[t]),u(C(r)?r:[r])],{delimeter:", "})})`}static conicGradient(...e){return`conic-gradient(${u(e,{delimeter:", "})})`}static contrast(e){return`contrast(${u([e])})`}static cubicBezier(e,t,r,n){return`cubic-bezier(${u([e,t,r,n],{delimeter:", "})})`}static dropShadow(...e){return`drop-shadow(${u(e,{rem:!0})})`}static grayscale(e){return`grayscale(${u([e])})`}static hsl(e,t,r){return`hsl(${u([e,t,r])})`}static hsla(e,t,r,n){return`hsl(${u([e,t,r,n?["/",n]:n])})`}static hueRotate(e){return`hue-rotate(${u([e],{degree:!0})})`}static inset(...e){return`inset(${u(e,{rem:!0})})`}static invert(e){return`invert(${u([e])})`}static linearGradient(...e){return`linear-gradient(${u(e,{delimeter:", "})})`}static matrix(e,t,r,n,i,s){return`matrix(${u([e,t,r,n,i,s],{delimeter:", "})})`}static matrix3d(e,t,r,n){return`matrix3d(${u([e,t,r,n],{delimeter:", "})})`}static max(...e){return`max(${u(e,{rem:!0,delimeter:", "})})`}static min(...e){return`min(${u(e,{rem:!0,delimeter:", "})})`}static opacity(e){return`opacity(${u([e])})`}static path(e){return`path(${u([e],{quote:!0})})`}static clipPath(e,t){return`path(${u([e,u([t],{quote:!0})],{delimeter:", "})})`}static perspective(e){return`perspective(${u([e])})`}static polygon(...e){return`polygon(${u(e,{percent:!0,delimeter:", "})})`}static ray(...e){return`ray(${u(e,{degree:!0})})`}static radialGradient(...e){return`radial-gradient(${u(e,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...e){return`repeating-conic-gradient(${u(e,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...e){return`repeating-linear-gradient(${u(e,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...e){return`repeating-radial-gradient(${u(e,{degree:!0,delimeter:", "})})`}static rgb(e,t,r){return`rgb(${u([e,t,r])})`}static rgba(e,t,r,n){return`rgba(${u([e,t,r,n?["/",n]:void 0],{delimeter_arr:" "})})`}static rotate(e){return`rotate(${u([e],{degree:!0})})`}static rotate3d(e,t,r,n){return`rotate3d(${u([u([e,t,r],{delimeter:", "}),n],{degree:!0,delimeter:", "})})`}static rotateX(e){return`rotateX(${u([e],{degree:!0})})`}static rotateY(e){return`rotateY(${u([e],{degree:!0})})`}static rotateZ(e){return`rotateZ(${u([e],{degree:!0})})`}static saturate(...e){return`saturate(${u(e)})`}static scale(e,t){return`scale(${u([e,t],{delimeter:", "})})`}static scale3d(e,t,r){return`scale3d(${u([e,t,r],{delimeter:", "})})`}static scaleX(e){return`scaleX(${u([e])})`}static scaleY(e){return`scaleY(${u([e])})`}static scaleZ(e){return`scaleZ(${u([e])})`}static sepia(e){return`sepia(${u([e])})`}static skew(...e){return`skew(${u(e,{degree:!0,delimeter:", "})})`}static skewX(e){return`skewX(${u([e],{degree:!0})})`}static skewY(e){return`skewY(${u([e],{degree:!0})})`}static steps(e,t){return`steps(${u([e,t],{delimeter:", "})})`}static translate(...e){return`translate(${u(e,{rem:!0,delimeter:", "})})`}static translate3d(...e){return`translate3d(${u(e,{rem:!0,delimeter:", "})})`}static translateX(e){return`translateX(${u([e],{rem:!0})})`}static translateY(e){return`translateY(${u([e],{rem:!0})})`}static translateZ(...e){return`translateZ(${u(e,{rem:!0,delimeter:", "})})`}static url(e){return`url(${u([e],{quote:!0})})`}static format(e){return`format(${u([e],{quote:!0})})`}static var(e,t=""){e="--"+L(e);let r=t?", "+u([t],{rem:!0,delimeter:", "}):"";return`var(${u([e],{rem:!0})}${r})`}}var Qt={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 re{value;__;constructor(e){if(this.value=new w,T(e))this.value.set(e,[]);else Object.entries(e).forEach(([t,r])=>{this.value.set(`${t}:${r}`,[])});this.__=(...t)=>(this.value.forEach((r)=>{r.push(...t)}),this)}}function er(e){return new re(e).__}var k=(e)=>{if(Le(e))return k(e());if(e instanceof x)return e;if(e instanceof R)return j(e.__(),{});return j(e,{})},ie=(e)=>e==='"'||e==="'",Me="([{",Re=")]}",tt=(e,t)=>{let r=[],n=0,i=null,s=0;for(let a=0;a<e.length;a++){let o=e[a];if(i){if(o==="\\")a++;else if(o===i)i=null;continue}if(o==="\\")a++;else if(ie(o))i=o;else if(Me.includes(o))s++;else if(Re.includes(o)){if(s>0)s--}else if(o===t&&s===0)r.push(e.slice(n,a)),n=a+1}return r.push(e.slice(n)),r},tr=(e,t)=>{let r=null,n=0;for(let i=0;i<e.length;i++){let s=e[i];if(r){if(s==="\\")i++;else if(s===r)r=null;continue}if(s==="\\")i++;else if(ie(s))r=s;else if(Me.includes(s))n++;else if(Re.includes(s)){if(n>0)n--}else if(s===t&&n===0)return i}return-1},ve=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,rr=(e)=>{if(!ve.test(e))return;let t=Number(e);return Number.isFinite(t)?t:void 0};function rt(e){let t={};return tt(e,";").forEach((r)=>{let n=r.trim();if(n==="")return;let i=tr(n,":");if(i===-1)return;let s=n.slice(0,i).trim();if(s==="")return;let a=n.slice(i+1).trim(),o=s.startsWith("--"),p=o?s:Q(s);if(o){t[p]=a;return}let g=rr(a);t[p]=g===void 0?a:g}),t}var nt=new Set(["initial","inherit","unset","revert","revert-layer"]),nr=new Set(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),ir=new Set(["cubic-bezier","steps","linear"]),sr=new Set(["normal","reverse","alternate","alternate-reverse"]),ar=new Set(["forwards","backwards","both"]),or=new Set(["running","paused"]),it=/^-{0,2}[A-Za-z_][A-Za-z0-9_-]*$/,st=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:s|ms)$/i,Ae=(e)=>e.length>=2&&ie(e[0])&&e[e.length-1]===e[0],at=(e)=>{let t=[],r=-1,n=null,i=0;for(let s=0;s<e.length;s++){let a=e[s];if(n){if(a==="\\")s++;else if(a===n)n=null;continue}if(a==="\\"){if(r===-1)r=s;s++;continue}if(ie(a)){if(r===-1)r=s;n=a;continue}if(Me.includes(a)){if(r===-1)r=s;i++;continue}if(Re.includes(a)){if(r===-1)r=s;if(i>0)i--;continue}if(i===0&&/\s/.test(a)){if(r!==-1)t.push(e.slice(r,s)),r=-1;continue}if(r===-1)r=s}if(r!==-1)t.push(e.slice(r));return t},lr=(e)=>{if(Ae(e))return"name";let t=e.match(/^([A-Za-z][A-Za-z0-9-]*)\(/);if(t){if(e.endsWith(")")&&ir.has(t[1].toLowerCase()))return"skip";return"abort"}if(st.test(e)||ve.test(e))return"skip";if(e.toLowerCase()==="!important")return"skip";if(!it.test(e))return"abort";let r=e.toLowerCase();if(nt.has(r)||nr.has(r)||sr.has(r)||ar.has(r)||or.has(r)||r==="infinite"||r==="none")return"skip";return"name"},xe=(e,t)=>{if(Ae(e)){let r=e.slice(1,-1);if(r==="")return;let n=e[0];return{text:`${n}${t}${r}${n}`,name:r}}return{text:`${t}${e}`,name:e}},ur=(e,t)=>{let r=at(e),n=-1,i="";for(let o=0;o<r.length;o++){let p=r[o],g=p.toLowerCase(),S=lr(p);if(S==="abort")return{value:e,names:[]};if(g==="!important"&&o!==r.length-1)return{value:e,names:[]};if(S==="skip")continue;if(n!==-1)return{value:e,names:[]};n=o,i=p}if(n===-1)return{value:e,names:[]};let s=xe(i,t);if(!s)return{value:e,names:[]};let a=[...r];return a[n]=s.text,{value:a.join(" "),names:[s.name]}},cr=(e,t)=>{let r=at(e.trim()),n=r.length>1&&r[r.length-1].toLowerCase()==="!important"?r.pop():void 0;if(r.length!==1)return{value:e,names:[]};let i=r[0];if(Ae(i)){let a=xe(i,t);if(!a)return{value:e,names:[]};return{value:[a.text,n].filter(Boolean).join(" "),names:[a.name]}}if(i.includes("("))return{value:e,names:[]};if(st.test(i)||ve.test(i))return{value:e,names:[]};if(!it.test(i))return{value:e,names:[]};let s=i.toLowerCase();if(nt.has(s)||s==="none")return{value:e,names:[]};return{value:[xe(i,t).text,n].filter(Boolean).join(" "),names:[i]}},et=(e,t,r)=>{let n=tt(e,",");if(n.some((o)=>o.trim()===""))return{value:e,names:[]};let i=[],s=!1,a=n.map((o)=>{let p=r(o,t);if(i.push(...p.names),p.value!==o)s=!0;return p.value});return{value:s?a.map((o)=>o.trim()).join(", "):e,names:i}},ot=(e,t,r="animation")=>{if(r==="animationName")return et(e,t,cr);return et(e,t,ur)},lt=(e)=>{e.value.forEach((t,r)=>{e.value.set(r,t.map((n)=>{let i={};return Object.entries(n).forEach(([s,a])=>{if(N(a))i[s]=k(a)}),i}))})},ne=(e,t=[])=>{if(C(e))return ne(e[0]);if(e instanceof R)return ne(Object.values(e.value));return[String(e)]};function fr(e){let t=[],r=0,n=0,i=null;for(let s=0;s<e.length;s++){let a=e[s];if(a==="\\"){s++;continue}if(i){if(a===i)i=null;continue}if(a==='"'||a==="'")i=a;else if(a==="("||a==="[")n++;else if(a===")"||a==="]"){if(n>0)n--}else if(a===","&&n===0)t.push(e.slice(r,s)),r=s+1}return t.push(e.slice(r)),t}class Ne{base;constructor(e){this.base=e}prefixAnimationValues(e,t,r){if(!["animation","animationName"].includes(t))return r;let i=Object.assign(new x,r);return Object.entries(i).forEach(([s,a])=>{i[s]=this.addPrefixToAnimation(e,t,a)}),i}addPrefixToAnimation(e,t,r){if(r instanceof R)this.saveAnim(e,r);else if(C(r))return[this.addPrefixToAnimation(e,t,r[0]),...r.slice(1)];else if(T(r)){let n=ot(r,this.base.PREFIX,t);return n.names.forEach((i)=>{let s=`${this.base.PREFIX}${i}`;this.base.ANIM.init(s,new Set).add(e)}),n.value}return r}saveAnim(e,t){ne(t).forEach((r)=>{this.base.ANIM.init(`${this.base.PREFIX}${r}`,new Set).add(e)})}processDeclaration(e,t,r,n,i){if(r instanceof R)this.saveAnim(e,r),ee(n,t,this.prefixAnimationValues(e,r.var,k(r)));else if(t.startsWith(":")||t.startsWith(",")||t.startsWith("[")){if(t.startsWith("::before")||t.startsWith("::after"));this.set(e+t,r,i)}else if(t.startsWith(" ")){let s=t.match(/^\s*(?:[>+~]\s*)?/)?.[0]??"",a=fr(t.slice(s.length)).map((o)=>`${e}${s}${o.trim()}`).join(", ");this.set(a,r,i)}else if(pe(t))this.set(e+t,r,i);else n.set(t,this.prefixAnimationValues(e,t,k(r)))}set(e,t,r){if(!E(t)&&!D(t)&&!T(t))return;let n=new w;if(t instanceof R)this.saveAnim(e,t),ee(n,t.var,this.prefixAnimationValues(e,t.var,k(t.value)));else if(t instanceof te)Object.entries(t._value).forEach(([s,a])=>{if(N(a))n.set(s,this.prefixAnimationValues(e,s,k(a)))});else if(t instanceof re)lt(t),n.init("supports",[]).push(t);else if(C(t))t.forEach((s)=>{this.set(e,s,r)});else if(T(t)){let s=rt(t);this.set(e,s,r)}else Object.entries(t).forEach(([s,a])=>{if(a instanceof R){this.saveAnim(e,a),ee(n,a.var,this.prefixAnimationValues(e,a.var,k(a.value)));return}return this.processDeclaration(e,s,a,n,r)});let i=r.init(e,new w);n.forEach((s,a)=>{if(a==="supports"&&C(s))r.init(e,new w).init(a,[]).push(...s);else i.set(a,s)})}}class B{PRE;EXPORT;UNIT;SOURCE;PS;PREFIX;ARR=new w;CID=new w;DATA=new w;ANIM=new w;IMPORTED=[];constructor(e="",t="",r,n,i=""){this.PRE=e;this.EXPORT=r;this.UNIT=n;this.SOURCE=i;this.PREFIX=t?t+"_":t,this.PS=new Ne(this)}get(e,t,r){let n=e.PRE+t;if(e.DATA.has(n))return n;else if(t in e)return e[t];else return e.PRE+t}set(e,t,r){return!1}get css(){return new Proxy(this,this)}load(e){return this.IMPORTED.push(e),this}__(e){Object.entries(e).forEach(([t,r])=>{this.set(this,t,r)})}}var ut=new Set(["transitionDuration","transitionDelay","animationDelay","animationDuration"]),pr=new Set([...ut,"zIndex","opacity","aspectRatio","order","flexShrink","flexGrow","flex","fillOpacity","lineClamp","order","scale","webkitLineClamp","lineHeight","fontWeight","orphans","widows","tabSize","zoom","borderImageOutset","borderImageSlice","borderImageWidth","animationIterationCount","columnCount","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd"]),dr=new Set(["content"]),mr=new Set(["transitionProperty"]),K=(e,t,r="rem")=>{let n=Q(e),i=u(t,{rem:!pr.has(n),second:ut.has(n),quote:dr.has(e),delimeter:mr.has(e)?", ":" ",unit:r});return`${L(e)}: ${i};`};class O extends B{set(e,t,r){let n=e.PRE+t;return e.PS.set(n,r,e.DATA),!0}}class P extends B{webkit;constructor(e="",t=!0,r,n=""){super("",e,!1,r,n);this.webkit=t}set(e,t,r){let n=e.PREFIX+t,i=C(r)?r:[r],s=new w;if(i.forEach((a)=>{Object.entries(a).forEach(([o,p])=>{let g=fe(o)?`${o}%`:o;e.PS.set(g,p,s)})}),e.ANIM.init(n,new Set),e.DATA.set(`@keyframes ${n}`,s),this.webkit)e.DATA.set(`@-webkit-keyframes ${n}`,s);return!0}}class _ extends B{constructor(e="",t=""){super("@",e,void 0,void 0,t)}set(e,t,r){return e.ARR.init(e.PRE+t,new Set).add(r),e}}class F extends B{constructor(e="",t=""){super("@font-face",e,void 0,void 0,t);this.ARR.set(this.PRE,new Set)}set(e,t,r){let n=Object.entries({fontFamily:u([t],{quote:!0}),...r}).map(([i,s])=>K(i,s,this.UNIT));return e.ARR.get(e.PRE)?.add(n.join(`
|
|
4
|
+
`)),!0}}var ct=(e,t=!1,r,n,i="")=>({d:new O("",e,r,n,i),i:new O("#",e,r,n,i),c:new O(".",e,r,n,i),kf:new P(e,t,n,i),at:new _("",i),font:new F("",i)}),hr=(e)=>{let t=new Set;return e.filter((r)=>{if(t.has(r))return!1;return t.add(r),!0})},ft=(e,t,r)=>(hr(t).forEach((n)=>{r.add(n.path),n.imported.forEach((i)=>{r.add(i)}),Object.keys(e).forEach((i)=>{e[i].load(n[i])})}),e),pt=(e)=>{let t={};return Object.keys(e).forEach((r)=>{t[r]=e[r].css}),t};import{writeFileSync as jr}from"fs";var Y=(e,t)=>`${e} {
|
|
5
5
|
${t.join(`
|
|
6
6
|
`)}
|
|
7
|
-
}`,
|
|
8
|
-
`));else{let
|
|
9
|
-
${
|
|
7
|
+
}`,gr=(e)=>[...e].join(", "),Sr=(e)=>e.some((t)=>t.startsWith("animation")||t.startsWith("transition")),dt=(e,t)=>Y(gr(e),t),mt=(e,t,r)=>{let n=new Set;return e.atRules.forEach((i)=>{n.add(i)}),Object.entries(e.groupedRulesByMedia).forEach(([i,s])=>{let a=[],o=[];if(s.forEach(({selectors:S,declarations:c})=>{let d=dt(S,c);if(Sr(c))o.push(d);else a.push(d)}),o.length)a.unshift(...o);let p=e.keyframeBlocksByMedia[i];if(p)Object.entries(p).forEach(([S,c])=>{a.push(Y(S,c))});let g=e.groupedSupportsByMedia[i];if(g)Object.entries(g).forEach(([S,c])=>{let d=c.map(({selectors:m,declarations:f})=>dt(m,f));a.push(Y(S,d))});if(a.length)if(i===r)n.add(`/* -------------- ${i} ( default ) */`),n.add(a.join(`
|
|
8
|
+
`));else{let S=i.split("-").map((c)=>t[c]).join(" and ");if(S)n.add(`/* -------------- ${i} */`),n.add(`@media ${S} {
|
|
9
|
+
${a.join(`
|
|
10
10
|
`)}
|
|
11
11
|
}`)}}),[...n].join(`
|
|
12
|
-
`)};var
|
|
13
|
-
${
|
|
14
|
-
}`)}),e.IMPORTED.forEach((
|
|
12
|
+
`)};var St=(e,t,r,n)=>{let i={code:r.code,severity:r.severity,message:r.message,sourcePath:t.SOURCE||e.sourcePath||""};if(r.rule!==void 0)i.rule=r.rule;if(r.selector!==void 0)i.selector=r.selector;let s=e.onDiagnostic;if(typeof s==="function"){try{s(i)}catch{}return}n?.()},G=()=>({visited:new Set,active:new Set,stack:[]}),X=(e,t,r,n)=>{if(r.active.has(t)){let s=[...r.stack,t].map((o)=>o.SOURCE||e.sourcePath||"").join(" -> "),a=n.get(t);if(a===void 0)a=new Set,n.set(t,a);if(!a.has(s))a.add(s),St(e,t,{code:"import.cycle",severity:"warning",message:`Circular import detected: ${s}`});return!1}if(r.visited.has(t))return!1;return r.visited.add(t),r.active.add(t),r.stack.push(t),!0},Z=(e,t)=>{t.stack.pop(),t.active.delete(e)},$e=(e,t)=>Array.from(e.matchAll(t),(r)=>r[1]).filter((r)=>r!==void 0),yt=(e,t,r,n,i=!0)=>{let s=/\.(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,a=/#(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,o=/\b([a-zA-Z][a-zA-Z0-9]*)\b(?![^{}]*})/g,p=[...new Set($e(t,s)),...new Set($e(t,a))];if(i&&N(n)&&n)p.forEach((g)=>{e.cid.init(g.replaceAll("-","_"),new Set).add(r+g)});return p.push(...new Set($e(t,o))),p.some((g)=>e.shaker.includes(g)||e.include.includes(g))},yr=(e,t)=>{let r=e[t];if(r===void 0)return!1;if(r==="\\")return!0;if(/[a-zA-Z_-]/.test(r))return!0;return r.charCodeAt(0)>=128},br=(e,t)=>{if(!t)return e;let r="",n=0,i,s=0;while(n<e.length){let a=e[n];if(a==="\\"){if(r+=a,n+1<e.length)r+=e[n+1];n+=2;continue}if(i!==void 0){if(r+=a,a===i)i=void 0;n+=1;continue}if(a==='"'||a==="'"){i=a,r+=a,n+=1;continue}if(a==="/"&&e[n+1]==="*"){let o=e.indexOf("*/",n+2),p=o===-1?e.length:o+2;r+=e.slice(n,p),n=p;continue}if(a==="[")s+=1;if(a==="]")s=Math.max(0,s-1);if(s===0&&(a==="."||a==="#")&&yr(e,n+1)){r+=a+t,n+=1;continue}r+=a,n+=1}return r},Cr=(e,t,r)=>!(e.shaker.length>0&&(t.startsWith(".")||t.startsWith("#")))||r,ht=(e,t,r)=>{(e[t]??=[]).push(r)},bt=(e,t,r,n,i,s)=>{if(!X(t,e,i,s))return;e.DATA.forEach((a,o)=>{let p=br(o,e.PREFIX),g=yt(t,o,e.PREFIX,t.exportMap);if(!Cr(t,p,g))return;let S=new w,c=new w;a.forEach((d,m)=>{if(m==="supports"){if(C(d))d.forEach((f)=>{f.value.forEach((h,y)=>{let b=c.init(y,new w);h.forEach((V)=>{Object.entries(V).forEach(([A,M])=>{Object.entries(M).forEach(([z,Pt])=>{b.init(z,[]).push(K(A,Pt,e.UNIT))})})})})})}else Object.entries(d).forEach(([f,h])=>{S.init(f,[]).push(K(m,h,e.UNIT))})}),S.forEach((d,m)=>{ht(r,m,{selector:p,declarations:d})}),c.forEach((d,m)=>{let f=n[m]??={};d.forEach((h,y)=>{ht(f,y,{selector:p,declarations:h})})})}),e.IMPORTED.forEach((a)=>{if(a instanceof O)bt(a,t,r,n,i,s)}),Z(e,i)},wr=(e,t)=>{t.forEach((r,n)=>{r.forEach((i)=>{e.init(n,new Set).add(i)})})},Ct=(e,t,r,n,i)=>{if(!X(t,e,n,i))return;wr(r,e.ANIM),e.IMPORTED.forEach((s)=>{if(s instanceof O)Ct(s,t,r,n,i)}),Z(e,n)},wt=(e,t,r,n,i,s)=>{if(!X(t,e,i,s))return;let a=(p,g,S)=>{let c=r[p]??={};(c[g]??=[]).push(S)},o=(p)=>{if(!t.shaker.length)return!0;let g=n.get(p);return g!==void 0&&[...g].some((S)=>yt(t,S,"",!1,!1))};e.DATA.forEach((p,g)=>{let S=g.split(" ")[1],c=o(S);p.forEach((d,m)=>{if(!(d instanceof w))return;let f={};d.forEach((h,y)=>{if(y==="supports"||C(h)){St(t,e,{code:"keyframes.supports-unsupported",severity:"error",message:"@supports is not supported in @keyframes",rule:g,selector:m},()=>{ge.e=["@supports not supported in @keyframes",{error:"support in keyframes"}]});return}if(!c)return;Object.entries(h).forEach(([b,V])=>{(f[b]??=[]).push(K(y,V,e.UNIT))})}),Object.entries(f).forEach(([h,y])=>{a(h,g,Y(m,y))})})}),e.IMPORTED.forEach((p)=>{if(p instanceof P)wt(p,t,r,n,i,s)}),Z(e,i)},Vt=(e,t,r,n,i)=>{if(!X(r,e,n,i))return;for(let[s,a]of e.ARR)a.forEach((o)=>{let p=o.includes("(")?o:`"${o}"`;t.add(`${s} ${p.trim()};`)});e.IMPORTED.forEach((s)=>{if(s instanceof _)Vt(s,t,r,n,i)}),Z(e,n)},gt="@font-face",xt=(e,t,r,n,i)=>{if(!X(r,e,n,i))return;(e.ARR.get(gt)??new Set).forEach((a)=>{t.add(`${gt} {
|
|
13
|
+
${a}
|
|
14
|
+
}`)}),e.IMPORTED.forEach((a)=>{if(a instanceof F)xt(a,t,r,n,i)}),Z(e,n)},Mt=(e,t)=>{let r={},n={},i={},s=new w,a=new Set,o=t,p=G(),g=G(),S=G(),c=G(),d=G(),m=new Map,f=Object.values(e);for(let h of f)if(h instanceof O)Ct(h,o,s,p,m);for(let h of f)if(h instanceof O)bt(h,o,r,n,g,m);else if(h instanceof P)wt(h,o,i,s,S,m);else if(h instanceof _)Vt(h,a,o,c,m);else if(h instanceof F)xt(h,a,o,d,m);return{styleRulesByMedia:r,supportsRulesByCondition:n,keyframeBlocksByMedia:i,atRules:a}};var Vr=(e,t)=>{if(e.length!==t.length)return!1;return e.every((r,n)=>r===t[n])},Rt=(e)=>{let t=[];for(let r of e){let n=t[t.length-1];if(n&&Vr(n.declarations,r.declarations))n.selectors.add(r.selector);else t.push({selectors:new Set([r.selector]),declarations:[...r.declarations]})}return t},vt=(e,t)=>{let r={};return t.forEach((n)=>{r[n]??=[]}),Object.entries(e).forEach(([n,i])=>{(r[n]??=[]).push(...Rt(i))}),r},At=(e)=>{let t={};return Object.entries(e).forEach(([r,n])=>{let i=`@supports(${r})`;Object.entries(n).forEach(([s,a])=>{let o=t[s]??={};(o[i]??=[]).push(...Rt(a))})}),t};class je{shweet;shaker;include;CID=new w;css="";onDiagnostic;constructor(e,t=[],r=[],n){this.shweet=e;this.shaker=t;this.include=r;this.onDiagnostic=n??e.onDiagnostic}load(e,t={}){let r=x.default;this.CID.clear();let n={...x.prop,...x.extra,...t},i=Mt(this.shweet,{shaker:this.shaker,include:this.include,exportMap:e,cid:this.CID,sourcePath:this.shweet.path,onDiagnostic:this.onDiagnostic}),s=vt(i.styleRulesByMedia,Object.keys(n)),a=At(i.supportsRulesByCondition);return this.css=mt({groupedRulesByMedia:s,groupedSupportsByMedia:a,keyframeBlocksByMedia:i.keyframeBlocksByMedia,atRules:i.atRules},n,r),this}}import{writeFileSync as xr}from"fs";var Mr=(e)=>{let t=[...e.entries()].map(([r,n])=>`${r}="${[...n].join(" ")}"`).sort((r,n)=>r.localeCompare(n,void 0,{numeric:!0}));return t.length?`export const ${t.join()};`:"export {}"},Nt=(e,t)=>{xr(e,Mr(t))};var Oe=(e)=>e!==void 0&&/\s/.test(e),U=(e)=>e!==void 0&&(/[a-zA-Z0-9_-]/.test(e)||e.charCodeAt(0)>=128),Te=(e)=>e!==void 0&&e>="0"&&e<="9",Rr=(e)=>e!==void 0&&(/[a-zA-Z_-]/.test(e)||e.charCodeAt(0)>=128),$t=(e,t)=>{let r=t;while(r<e.length){let n=e[r];if(n==="\\"){r+=Math.min(2,e.length-r);continue}if(!U(n))break;r+=1}return r},jt=new Set(["{","}",":",";",",",">","~"]),vr=/^(?:calc|min|max|clamp|hypot|round|mod|rem|abs|sign|sqrt|pow|log|exp|sin|cos|tan|asin|acos|atan|atan2)\(/i,Ar=/^url\(/i,Nr=(e,t)=>{if(e===void 0||t===void 0)return!1;if(U(e)&&U(t))return!0;if(Te(e)&&t===".")return!0;if(e==="."&&Te(t))return!0;if(e==="#"&&U(t))return!0;if(e==="@"&&U(t))return!0;if(U(e)&&t==="(")return!0;if(Te(e)&&t==="%")return!0;if(e==="/"&&t==="*")return!0;return!1},$r=(e,t,r)=>{if(r&&(e==="+"||e==="-"))return!1;if(r&&(t==="+"||t==="-"))return!1;if(t==="+")return!0;if(e==="+")return!0;return jt.has(e)||jt.has(t)},Ot=(e)=>{let t="",r=0,n=!1,i=!1,s=0,a=[],o=0,p=(d)=>{if(!n)return;if(n=!1,t.length===0)return;let m=t[t.length-1];if(!$r(m,d,o>0))t+=" "},g=(d)=>{let m=e[d],f=d+1;while(f<e.length){let h=e[f];if(h==="\\"){f+=Math.min(2,e.length-f);continue}if(f+=1,h===m)break}return t+=e.slice(d,f),f},S=(d,m)=>{let f=m+1,h=1,y;while(f<e.length){let b=e[f];if(y!==void 0){if(b==="\\"){f+=Math.min(2,e.length-f);continue}if(f+=1,b===y)y=void 0;continue}if(b==="\\"){f+=Math.min(2,e.length-f);continue}if(b==='"'||b==="'"){y=b,f+=1;continue}if(b==="(")h+=1;else if(b===")"){if(h-=1,f+=1,h===0)break;continue}f+=1}return t+=e.slice(d,f),f},c=(d,m)=>{let f=d,h=0;while(f<e.length){let y=e[f];if(y==="\\"){f+=Math.min(2,e.length-f);continue}if(y==='"'||y==="'"){let b=y;f+=1;while(f<e.length){let V=e[f];if(V==="\\"){f+=Math.min(2,e.length-f);continue}if(f+=1,V===b)break}continue}if(y==="/"&&e[f+1]==="*"){let b=e.indexOf("*/",f+2);f=b===-1?e.length:b+2;continue}if(h===0){if(y===";"||y==="}")break;if(m&&y===")")break}if(y==="("||y==="["||y==="{")h+=1;else if(y===")"||y==="]"||y==="}")h=Math.max(0,h-1);f+=1}return f};while(r<e.length){let d=e[r];if(Oe(d)){n=!0,r+=1;continue}if(d==="/"&&e[r+1]==="*"){let m=e.indexOf("*/",r+2),f=m===-1?e.length:m+2,h=e.slice(r,f);if(/^\/\*[!#@]/.test(h))p("/"),t+=h;else if(!n){let b=e[f];if(b!==void 0&&!Oe(b)&&Nr(t[t.length-1],b))n=!0}r=f;continue}if(d==='"'||d==="'"){p(d),r=g(r),i=!1;continue}if(d==="-"&&e[r+1]==="-"&&s===0&&(i||t.endsWith("("))){let m=$t(e,r),f=m;while(Oe(e[f]))f+=1;if(e[f]===":"){let h=c(f+1,!i);p(":"),t+=e.slice(r,m)+":",t+=e.slice(f+1,h),r=h,i=!1;continue}}if(Rr(d)){let m=$t(e,r),f=e.slice(r,m),h=e[m]==="(";if(h&&Ar.test(f+"(")){p(f[0]),r=S(r,m),i=!1;continue}if(h&&vr.test(f+"(")){p("("),t+=f+"(",a.push(!0),o+=1,r=m+1,i=!1;continue}p(f[0]),t+=f,r=m,i=!1;continue}if(d==="{"){p(d),t+=d,i=!0,r+=1;continue}if(d==="}"){p(d),t+=d,i=!1,r+=1;continue}if(d===";"){p(d),t+=d,i=!0,r+=1;continue}if(d==="("){p(d),t+=d,a.push(!1),r+=1,i=!1;continue}if(d===")"){if(p(d),t+=d,a.pop())o-=1;r+=1,i=!1;continue}if(d==="[")s+=1;else if(d==="]")s=Math.max(0,s-1);p(d),t+=d,r+=1,i=!1}return t.trimEnd()};var Tt=(e,t,r,n={})=>{let{dir:i,mapDir:s=[],mapName:a="index",minify:o=!0,shaker:p=[],include:g=[],name:S}=n,c=N(r)?r:!!s,d=S??e.name,m=new je(e,p,g,e.onDiagnostic).load(c,t),f=C(i)?i:[i],h=o?Ot(m.css):m.css;f.forEach((b)=>{if(!b)return;let V=b.endsWith("/")?"":"/",A=`${b}${V}${d}.css`;be(b+V),Ce(A),jr(A,h||"/* --------------*/")});let y=C(s)?s:[s];for(let b of y){let V=b.endsWith("/")?"":"/",A=`${b}${V}${a}.js`;be(b+V),Ce(A),Nt(A,m.CID)}return e};var se,Et;class kt{static{se=Pe(void 0);Ie(se,1,"med",Et,this);ue(se,this)}path=(Fe(se,5,this),void 0);name;prefix;exportMap;onDiagnostic;mediaFeatures;_imported=new Set;save;constructor({__filename:e,name:t,prefix:r,shweets:n=[],exportMap:i,webkitKeyframes:s,mediaFeature:a={},unit:o="rem",onDiagnostic:p}){this.path=e,this.name=t||Dt(e),this.prefix=r??"",this.exportMap=i,this.onDiagnostic=p;let g=C(n)?n:[n];this.mediaFeatures=a;let S=ct(this.prefix,s,i,o,this.path);ft(S,g,this._imported),Object.assign(this,pt(S));let c=this;Object.assign(this,{get shweet(){return c}}),this.save=(d={})=>(Tt(this,this.mediaFeatures,i,d),this)}get imported(){return[...this._imported]}[(Et=[Ye],"med")](e,t){if(t)return new x(e,t);if(typeof e==="object")return new x(void 0,e);return new x(e,{})}}function Dt(e){return e.split("/").slice(-1)[0].split(".")[0]}var Or=(e,t)=>{for(let[r,[n,i]]of Object.entries(t)){e[r]=n;for(let[s,a]of Object.entries(i)){let o=s.startsWith("$")?s.slice(1):`${r}_${s}`;e[o]=a}}},Bt=(e,t,r)=>{for(let[n,i]of Object.entries(t)){let s=Array.isArray(i)?i:[i],a=[];for(let p of s)if(p instanceof ae)p.$(n,e);else a.push(p);let o=r?`${r}_${n}`:n;e[o]=a}};class ae{__;merge;constructor(e,t=!1){this.__=e;this.merge=t}$(e,t){Bt(t,this.__,this.merge?e:void 0)}}var Tr=(e)=>new ae(e),Er=(e)=>new ae(e,!0);export{te as Medyas,kt as Shweet,u as Value,Zt as Var,Jt as Vars,Bt as X,Tr as XX,Er as XY,Or as Z,we as __,Qe as f,Dt as fileName,j as med,x as media,Ze as ps,er as supports,Qt as v};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shweet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"description": "TypeScript-first CSS authoring: Proxy-based class, id, and selector declarations compiled to CSS with prefixing, media/supports conditions, keyframes, export maps, and optional minification.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|