@fwkui/x-css 1.0.15 → 1.0.17

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.mts CHANGED
@@ -2,8 +2,6 @@ type XCSSConfig = {
2
2
  base?: string;
3
3
  aliases?: Record<string, string[]>;
4
4
  excludes?: string[];
5
- /** @deprecated Use `excludes` instead. */
6
- exclude?: string[];
7
5
  excludePrefixes?: string[];
8
6
  breakpoints?: Record<string, string>[];
9
7
  theme?: Record<string, string>;
@@ -21,6 +19,7 @@ interface XCSSCacheData {
21
19
  cssText: Record<string, string>;
22
20
  rulesSet: Record<string, string[]>;
23
21
  keys: [string, string][];
22
+ sizeLast: number;
24
23
  }
25
24
  declare const _default: {
26
25
  css: (modules?: XCSSConfig) => {
@@ -41,8 +40,20 @@ type BootloaderScriptOptions = {
41
40
  };
42
41
  declare const getBootloaderScript: (styleIdInput?: string, version?: string, options?: BootloaderScriptOptions) => string;
43
42
 
44
- declare const clsx: any;
45
- declare const setClsxRoot: any;
46
- declare const getCss: any;
43
+ type CssRoot = Document | ShadowRoot;
44
+ interface SharedXCSSInstance {
45
+ clsx: (...args: any[]) => string;
46
+ observe: (root?: CssRoot) => void;
47
+ setClsxRoot: (root: CssRoot) => void;
48
+ getCss: (root?: CssRoot | null) => string;
49
+ ready: (root?: CssRoot | null) => Promise<void>;
50
+ }
51
+ declare const createSharedInstance: (config?: XCSSConfig) => SharedXCSSInstance;
52
+ declare const createSharedClsx: (config?: XCSSConfig) => SharedXCSSInstance;
53
+ declare const clsx: (...args: any[]) => string;
54
+ declare const observe: (root?: CssRoot) => void;
55
+ declare const setClsxRoot: (root: CssRoot) => void;
56
+ declare const getCss: (root?: CssRoot | null) => string;
57
+ declare const ready: (root?: CssRoot | null) => Promise<void>;
47
58
 
48
- export { type BootloaderScriptOptions, type XCSSConfig, clsx, _default as default, getBootloaderScript, getCss, setClsxRoot };
59
+ export { type BootloaderScriptOptions, type SharedXCSSInstance, type XCSSConfig, clsx, createSharedClsx, createSharedInstance, _default as default, getBootloaderScript, getCss, observe, ready, setClsxRoot };
package/dist/index.d.ts CHANGED
@@ -2,8 +2,6 @@ type XCSSConfig = {
2
2
  base?: string;
3
3
  aliases?: Record<string, string[]>;
4
4
  excludes?: string[];
5
- /** @deprecated Use `excludes` instead. */
6
- exclude?: string[];
7
5
  excludePrefixes?: string[];
8
6
  breakpoints?: Record<string, string>[];
9
7
  theme?: Record<string, string>;
@@ -21,6 +19,7 @@ interface XCSSCacheData {
21
19
  cssText: Record<string, string>;
22
20
  rulesSet: Record<string, string[]>;
23
21
  keys: [string, string][];
22
+ sizeLast: number;
24
23
  }
25
24
  declare const _default: {
26
25
  css: (modules?: XCSSConfig) => {
@@ -41,8 +40,20 @@ type BootloaderScriptOptions = {
41
40
  };
42
41
  declare const getBootloaderScript: (styleIdInput?: string, version?: string, options?: BootloaderScriptOptions) => string;
43
42
 
44
- declare const clsx: any;
45
- declare const setClsxRoot: any;
46
- declare const getCss: any;
43
+ type CssRoot = Document | ShadowRoot;
44
+ interface SharedXCSSInstance {
45
+ clsx: (...args: any[]) => string;
46
+ observe: (root?: CssRoot) => void;
47
+ setClsxRoot: (root: CssRoot) => void;
48
+ getCss: (root?: CssRoot | null) => string;
49
+ ready: (root?: CssRoot | null) => Promise<void>;
50
+ }
51
+ declare const createSharedInstance: (config?: XCSSConfig) => SharedXCSSInstance;
52
+ declare const createSharedClsx: (config?: XCSSConfig) => SharedXCSSInstance;
53
+ declare const clsx: (...args: any[]) => string;
54
+ declare const observe: (root?: CssRoot) => void;
55
+ declare const setClsxRoot: (root: CssRoot) => void;
56
+ declare const getCss: (root?: CssRoot | null) => string;
57
+ declare const ready: (root?: CssRoot | null) => Promise<void>;
47
58
 
48
- export { type BootloaderScriptOptions, type XCSSConfig, clsx, _default as default, getBootloaderScript, getCss, setClsxRoot };
59
+ export { type BootloaderScriptOptions, type SharedXCSSInstance, type XCSSConfig, clsx, createSharedClsx, createSharedInstance, _default as default, getBootloaderScript, getCss, observe, ready, setClsxRoot };
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";var xe=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var at=Object.prototype.hasOwnProperty;var ct=(e,t)=>{for(var n in t)xe(e,n,{get:t[n],enumerable:!0})},lt=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of it(t))!at.call(e,i)&&i!==n&&xe(e,i,{get:()=>t[i],enumerable:!(s=ot(t,i))||s.enumerable});return e};var dt=e=>lt(xe({},"__esModule",{value:!0}),e);var Kt={};ct(Kt,{clsx:()=>Ot,default:()=>Xt,getBootloaderScript:()=>Ze,getCss:()=>$t,setClsxRoot:()=>Pt});module.exports=dt(Kt);var je=e=>(e=e||new Map,{all:e,on(t,n){let s=e.get(t);s?s.push(n):e.set(t,[n])},off(t,n){let s=e.get(t);s&&(n?s.splice(s.indexOf(n)>>>0,1):e.set(t,[]))},emit(t,n){let s=e.get(t);s&&s.slice().forEach(u=>{u(n)});let i=e.get("*");i&&i.slice().forEach(u=>{u(t,n)})}});function ut(e,t,n){let s=0;for(let i=t;i<n;i++){let u=e.charCodeAt(i);if(u===91){s++;continue}if(u===93){s>0&&s--;continue}if(u===58&&s===0)return i}return-1}function ft(e,t,n){let s=0;for(let i=n-1;i>=t;i--){let u=e.charCodeAt(i);if(u===93){s++;continue}if(u===91){s>0&&s--;continue}if(u===64&&s===0)return i}return-1}function pt(e,t,n){let s=0;for(let i=t;i<n;i++){let u=e.charCodeAt(i);if(u===91){s++;continue}if(u===93){if(s===0)return!1;s--}}return s===0}function yt(e){return e>=97&&e<=122}function ce(e){if(!e||e.length<2||!pt(e,0,e.length))return null;let t=0,n=e.length,s="",i=ft(e,t,n);i>t&&(s=e.substring(i+1,n),n=i);let u="",b="",w=ut(e,t,n);if(w>0&&w<n){let x=e.substring(t,w);t=w+1,u=x}let T=t;for(;T<n;){let x=e.charCodeAt(T);if(x>=48&&x<=57)T++;else break}if(T>t&&(b=e.substring(t,T),t=T),t>=n||e.charCodeAt(t)===38)return null;if(e.charCodeAt(t)===91){let x=e.indexOf("]",t);if(x>t)return{mq:u,layer:b,prop:e.substring(t,x+1),val:"",selector:s}}let E=t;for(;E<n;){let x=e.charCodeAt(E);if(x===45||x===46){if(E+1<n){let X=e.charCodeAt(E+1);if(x===45&&X===45&&E>t||X>=48&&X<=57)break}E++;continue}if(!yt(x))break;E++}if(E===t)return null;let R=e.substring(t,E),A=e.substring(E,n);return{mq:u,layer:b,prop:R,val:A,selector:s}}var q="xcss_cache_v1",Be=e=>{let t=typeof e?.styleId=="string"&&e.styleId.trim()?e.styleId.trim():"fwkui",n=typeof e?.version=="string"&&e.version.trim()?e.version.trim():"v1",s=e?.compression??!0,i=typeof e?.debounceMs=="number"&&e.debounceMs>=0?e.debounceMs:1e3;return{styleId:t,version:n,compression:s,debounceMs:i}},ht=e=>`${e.styleId}_cache_${e.version}`,He=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===2&&t.compressed===!0&&typeof t.payload=="string"},Ee=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===3&&t.compressed===!0&&t.algorithm==="deflate-raw"&&t.encoding==="base64"&&typeof t.payload=="string"},We=()=>typeof CompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",Ue=()=>typeof DecompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",gt=e=>{if(typeof btoa=="function"){let n="";for(let i=0;i<e.length;i+=32768){let u=e.subarray(i,i+32768);for(let b=0;b<u.length;b++)n+=String.fromCharCode(u[b])}return btoa(n)}let t=globalThis.Buffer;if(typeof t<"u")return t.from(e).toString("base64");throw new Error("XCSS: base64 encoding is not supported in this runtime")},St=e=>{if(typeof atob=="function"){let n=atob(e),s=new Uint8Array(n.length);for(let i=0;i<n.length;i++)s[i]=n.charCodeAt(i);return s}let t=globalThis.Buffer;if(typeof t<"u")return new Uint8Array(t.from(e,"base64"));throw new Error("XCSS: base64 decoding is not supported in this runtime")},mt=async e=>{if(!We())throw new Error("XCSS: CompressionStream is not supported");let t=new Blob([e]).stream().pipeThrough(new CompressionStream("deflate-raw")),n=await new Response(t).arrayBuffer();return gt(new Uint8Array(n))},Ct=async e=>{if(!Ue())throw new Error("XCSS: DecompressionStream is not supported");let t=St(e),n=new Uint8Array(t.length);n.set(t);let s=new Blob([n.buffer]).stream().pipeThrough(new DecompressionStream("deflate-raw"));return await new Response(s).text()},bt=e=>{try{let t=JSON.parse(e);return Ee(t)}catch{return!1}},wt=e=>{if(!e)return"";let t=new Map,n=[],s=256;for(let u=0;u<256;u++)t.set(String.fromCharCode(u),u);let i=e[0];for(let u=1;u<e.length;u++){let b=e[u],w=i+b;t.has(w)?i=w:(n.push(t.get(i)),t.set(w,s++),i=b)}return n.push(t.get(i)),n.map(u=>String.fromCharCode(u)).join("")},Ve=e=>{if(!e)return"";let t=new Map,n=256,s="";for(let w=0;w<256;w++)t.set(w,String.fromCharCode(w));let i=e.split("").map(w=>w.charCodeAt(0)),u=i[0],b=t.get(u)||"";s=b;for(let w=1;w<i.length;w++){let T=i[w],E=t.get(T);E||(E=T===n?b+b[0]:""),s+=E,t.set(n++,b+E[0]),b=E}return s},Re=e=>{if(!e||typeof e!="object")return null;let t=e,n=t.default&&typeof t.default=="object"?t.default:t,s=n.SHORT_PROPERTIES,i=n.COMMON_VALUES,u=n.SPECIFIC_VALUES;return!s||!i||!u||typeof s!="object"||typeof i!="object"||typeof u!="object"?null:{SHORT_PROPERTIES:s,COMMON_VALUES:i,SPECIFIC_VALUES:u}},xt=async e=>{let t=await import(e),n=Re(t);if(!n)throw new Error(Ne);return n},Ne="XCSS: dictionary module must export SHORT_PROPERTIES, COMMON_VALUES and SPECIFIC_VALUES",qe=()=>{let e=typeof require=="function"?require:null;if(!e)return null;for(let t of["./dictionary.js","./dictionary"])try{let n=e(t),s=Re(n);if(s)return s}catch{}return null},vt=async()=>{let e=qe();if(e)return e;let t=["./dictionary.mjs","./dictionary.js","./dictionary"],n=null;for(let s of t)try{let i=await import(s),u=Re(i);if(u)return u}catch(i){n=i}throw n||new Error(Ne)},Et=(e,t)=>{if(!e||typeof document>"u")return;t=t||"fwkui";let n=Array.from({length:24},(s,i)=>"l"+i);if(!e.querySelector('style[id="'+t+'"]')){let s=document.createElement("style");if(s.id=t,!(e instanceof ShadowRoot))document.head.append(s);else try{e.prepend(s)}catch{e.appendChild(s)}let i=`@layer ${n.join(", ")};`,u=setInterval(()=>{if(s.sheet){clearInterval(u);try{s.sheet.insertRule(i,s.sheet.cssRules.length)}catch{}}},10)}},Rt=e=>{let t=Array.isArray(e.excludes)?e.excludes:Array.isArray(e.exclude)?e.exclude:[],n=Be(e.cache),s=JSON.stringify({base:e.base||"",aliases:e.aliases||{},breakpoints:e.breakpoints||[],theme:e.theme||{},prefix:e.prefix||"",excludes:t,excludePrefixes:e.excludePrefixes||[],dictionaryImport:e.dictionaryImport??!0,cache:n}),i=0;if(s.length===0)return i.toString();for(let u=0;u<s.length;u++){let b=s.charCodeAt(u);i=(i<<5)-i+b,i|=0}return i.toString()},ve=e=>{if(!e)return null;try{let t=JSON.parse(e);if(He(t)){let n=Ve(t.payload);return n?JSON.parse(n):null}return Ee(t)?null:t}catch{return null}},Dt=async e=>{if(!e)return null;try{let t=JSON.parse(e);if(He(t)){let n=Ve(t.payload);return n?JSON.parse(n):null}if(Ee(t)){let n=await Ct(t.payload);return n?JSON.parse(n):null}return t}catch{return null}},Le=(e,t)=>{if(e==="root")return t;let n=/@media[^{]+\{\n?([\s\S]+)\n?\}/.exec(t);return n&&n[1]?n[1].trim():t},De=(e={base:"",aliases:{},excludes:[],excludePrefixes:[],breakpoints:[],theme:{},prefix:"",dictionaryImport:!0,cache:{styleId:"fwkui",version:"v1",compression:!0,debounceMs:1e3}})=>{let{base:t=null,breakpoints:n=[],aliases:s={},theme:i={},excludes:u=[],exclude:b=[],excludePrefixes:w=[],prefix:T="",dictionaryImport:E=!0,cache:R={}}=e||{};Array.isArray(n)||(n=[]),Array.isArray(u)||(u=[]),Array.isArray(b)||(b=[]),Array.isArray(w)||(w=[]),(!s||typeof s!="object")&&(s={}),(!i||typeof i!="object")&&(i={});let A=Be(R),x=ht(A),X=[...u,...b],Z=w.filter(r=>typeof r=="string").map(r=>r.trim()).filter(r=>r.length>0),Ae=r=>{let o=r.replace(/[.+?^${}()|[\]\\]/g,"\\$&");return new RegExp("^"+o.replace(/\*/g,".*")+"$")},K=X.filter(r=>typeof r=="string").map(r=>r.trim()).filter(r=>r.length>0).map(r=>{if(r.includes("*")){let o=Ae(r);return l=>o.test(l)}return o=>o===r}),re=r=>Z.some(o=>r.startsWith(o))?!0:K.some(o=>o(r)),ke=r=>!(re(r)||T&&!r.startsWith(T)),Fe=["default","xs","sm","md","lg","xl","2xl","sma","mda","lga","xla"],Je=n.filter(r=>!!r&&typeof r=="object"&&!Array.isArray(r)).map(r=>Object.keys(r)[0]).filter(r=>typeof r=="string"&&r.length>0),ze=new Set([...Fe,...Je]),ue=r=>!r||ze.has(r),Ye=E!==!1,Ge=new Set(["mx","my","px","py","bdx","bdy"]),fe=new Set,pe=r=>r?!Ye||!V||Object.keys(V).length===0?!0:!!V[r]||Ge.has(r)||fe.has(r):!1,V={},ne={},ye={},he={},Ie=()=>{he={...ye,...i}},F=r=>{if(!r){V={},ne={},ye={},fe=new Set,Ie();return}V=r.SHORT_PROPERTIES,ne=r.SPECIFIC_VALUES,ye=r.COMMON_VALUES,fe=new Set(Object.values(V)),Ie()},J=!0,se=Promise.resolve();if(E===!1)F(null);else if(typeof E=="string")J=!1,F(null),se=xt(E).then(r=>{F(r)}).catch(r=>{console.warn("XCSS: Failed to import dictionary from URL",r)}).finally(()=>{J=!0});else{let r=qe();r?F(r):(J=!1,F(null),se=vt().then(o=>{F(o)}).catch(o=>{console.warn("XCSS: Failed to load built-in dictionary module",o)}).finally(()=>{J=!0}))}let G=null,Qe=(r=typeof document<"u"?document:void 0)=>{let o=typeof window<"u"&&typeof document<"u",l=null,g=Array.isArray(t)?t.length>0:!!t;r&&(l="getRootNode"in r?r.getRootNode():r);let p=new Map;o&&l&&Et(l,A.styleId);let v=je(),_=[{default:""},{xs:"screen and (max-width: 575px)"},{sm:"screen and (min-width: 576px)"},{md:"screen and (min-width: 768px)"},{lg:"screen and (min-width: 992px)"},{xl:"screen and (min-width: 1200px)"},{"2xl":"screen and (min-width: 1400px)"},{sma:"screen and (max-width: 768px)"},{mda:"screen and (max-width: 992px)"},{lga:"screen and (max-width: 1200px)"},{xla:"screen and (max-width: 1400px)"},...n],y=_.filter((a,d)=>_.findLastIndex(c=>Object.keys(c)[0]==Object.keys(a)[0])==d),C=y.map(a=>Object.keys(a)[0]),f={},D={},S={root:""},M={root:[]},L={root:!1},Q=Rt(e),z=null,k=0,j=!1,O=null,Y=null,W=[],B=a=>{try{window.localStorage.setItem(x,a)}catch(d){console.warn("XCSS: Failed to save cache",d)}},oe=(a,d)=>{!o||!window.localStorage||typeof d=="string"&&window.localStorage.getItem(a)!==d||window.localStorage.removeItem(a)},N=a=>{if(!o||!window.localStorage)return;G=a;let d=++k;try{let c=JSON.stringify(a),h=()=>{let m={__xcss_cache_v:2,compressed:!0,payload:wt(c)};B(JSON.stringify(m))};if(!A.compression){B(c);return}if(We()&&Ue()){mt(c).then(m=>{if(d!==k)return;B(JSON.stringify({__xcss_cache_v:3,compressed:!0,algorithm:"deflate-raw",encoding:"base64",payload:m}))}).catch(()=>{d===k&&h()});return}h()}catch(c){console.warn("XCSS: Failed to save cache",c)}},ie=()=>{o&&(z&&clearTimeout(z),z=setTimeout(()=>{let a={};for(let h in f)a[h]=Array.from(f[h]);let d={};Object.keys(S).forEach(h=>{if(h==="root")d[h]=S[h];else{let m=_.find($=>Object.keys($)[0]===h)?.[h];m&&S[h]?d[h]=`@media ${m} {
2
- ${S[h]}
3
- }`:d[h]=S[h]||""}});let c={configHash:Q,cssText:d,rulesSet:a,keys:Array.from(p.entries())};N(c)},A.debounceMs))};if(o&&window.localStorage)try{let a=x===q?[x]:[x,q];for(let d of a){let c=window.localStorage.getItem(d);if(!c)continue;let h=ve(c);if(!h){if(bt(c)){W.push({key:d,raw:c});continue}window.localStorage.removeItem(d);continue}if(h.configHash!==Q){window.localStorage.removeItem(d);continue}O=h,Y=d,j=!0;break}if(O){if(O.keys&&O.keys.forEach(([d,c])=>p.set(d,c)),O.cssText)for(let d in O.cssText){let c=O.cssText[d];S[d]=Le(d,c)}G=O}}catch(a){console.error(a)}o&&(D.root=new CSSStyleSheet),C.forEach(a=>{if(f[a]=new Set,o){let d=y.find(c=>Object.keys(c)[0]==a)?.[a]||"";D[a]=new CSSStyleSheet({media:d})}j||(S[a]=""),M[a]=[],L[a]=!1});let I=()=>{if(!l)return;let a=l.querySelector(`style[id="${A.styleId}"]`);a&&a.remove()},ae=(a,d)=>{if(a.keys&&a.keys.forEach(([c,h])=>p.set(c,h)),a.cssText)for(let c in a.cssText){if(c==="root"&&g)continue;let h=Le(c,a.cssText[c]);S[c]=h,o&&D[c]&&D[c].replaceSync(h)}if(a.rulesSet)for(let c in a.rulesSet)f[c]||(f[c]=new Set),a.rulesSet[c].forEach(h=>f[c].add(h));o&&window.localStorage&&d===q&&x!==q&&(N(a),window.localStorage.removeItem(q)),G=a,I()};j&&O&&ae(O,Y),t&&Array.isArray(t)?(S.root=t.join(`
4
- `),o&&D.root&&D.root.replaceSync(S.root)):(S.root=t||"",o&&D.root&&D.root.replaceSync(S.root)),o&&l&&["root",...C].forEach(a=>{D[a]&&l?.adoptedStyleSheets&&(l.adoptedStyleSheets.includes(D[a])||(l.adoptedStyleSheets=[...l.adoptedStyleSheets,D[a]]))}),o&&window.localStorage&&W.length>0&&(async()=>{for(let a of W){let d=await Dt(a.raw);if(!d){oe(a.key,a.raw);continue}if(d.configHash!==Q){oe(a.key,a.raw);continue}if(!j){j=!0,O=d,Y=a.key,ae(d,a.key);break}}})();let me=(a,d)=>{let{media:c,property:h,selector:m,layer:$,className:P}=d,U=S,H=M,be=L;$=Number($)||0;let Xe=p.get(a),st=Xe?`.${Xe}${m}`:`.${P}${m}`;var we=`@layer l${$}{${st}{${h}}}`;f[c]||(f[c]=new Set);let Ke=f[c];if(!Ke.has(we))if(Ke.add(we),H[c]||(H[c]=[]),H[c].push(we),o)be[c]||(be[c]=!0,queueMicrotask(()=>{let te=H[c],Me=D[c];te.length>0&&(U[c]+=(U[c]?`
5
- `:"")+te.join(`
6
- `),Me&&Me.replaceSync(U[c]),H[c]=[],ie()),be[c]=!1}));else{let te=H[c];te.length>0&&(U[c]+=(U[c]?`
7
- `:"")+te.join(`
8
- `),H[c]=[])}},Ce=a=>{a.forEach(d=>{let c=$e(d);c&&me(d,c)})},ee=a=>{if(a.length===0)return;let d=()=>Ce(a);J?d():se.then(d)};return v.on("observeDom",ee),{clsx:(...a)=>{let d=a.map(m=>Array.isArray(m)?m:[m]).flat(1/0).map(m=>typeof m=="string"?m.split(/(\s|\t)+/g):[]).flat(1/0);d=d.filter(m=>typeof m=="string"&&m.trim()),d=[...new Set(d)];let c=m=>{if(!ke(m))return!1;if(J)return!!$e(m);let $=T?m.slice(T.length):m,P=ce($);if(!P||!ue(P.mq))return!1;let U=(P.selector||"").replace(/(';|;)/g,H=>H=="';"?";":" ");return U&&!ge(U)?!1:P.prop.startsWith("[")?!!Oe(P.prop+P.val):pe(P.prop)?(P.prop==="&",P.val.length>0):!1},h=d.map(m=>{let $=m;if(p.has(m))$=p.get(m);else if(c(m)){let P="D"+p.size.toString(32).toUpperCase();p.set(m,P),$=P,ie()}return $});return o?queueMicrotask(()=>v.emit("observeDom",d)):v.emit("observeDom",d),h.join(" ")},observe:()=>{!o||!l||nt(l,a=>{ee(a)})},getCssString:()=>Object.entries(S).map(([a,d])=>{if(!d)return"";if(a==="root"||a==="default")return d;let c=_.find(h=>Object.keys(h)[0]===a)?.[a];return c?`@media ${c} {
9
- ${d}
10
- }`:d}).join(`
11
- `)}};function Oe(r){let o=new RegExp("^(\\[(?<p>[a-zA-Z]+)\\])$"),{p:l=""}=o.exec(r)?.groups??{};if(l&&s[l]&&Array.isArray(s[l])){let g=s[l],p=[],v=!0,_=y=>{let C=y.trim();if(!C)return null;let f=C.endsWith(";")?C.slice(0,-1).trim():C,D=f.indexOf(":");if(D<=0||D>=f.length-1)return null;let S=f.slice(0,D).trim(),M=f.slice(D+1).trim();return!S||!M||!/^(?:--[a-zA-Z0-9-_]+|-?[a-zA-Z][a-zA-Z0-9-]*)$/.test(S)?null:`${S}:${M}`};for(let y of g){if(typeof y!="string"){v=!1;break}let C=_(y);if(C){if(typeof CSS<"u"&&!CSS.supports(C)){v=!1;break}p.push(C);continue}v=!1;break}if(p.length>0&&v)return p.join(";")}return null}function Pe(r,o){let l=Oe(r+o);if(l)return l;if(!r||o===void 0)return null;let g=V[r],p=g||r,v=o[0],_=!1,y=o;if(v==="!"&&(_=!0,y=y.substring(1),v=y[0]),y.startsWith("--"))y="var("+y+")";else if(v==="["&&y.endsWith("]"))y=y.substring(1,y.length-1);else if(y.length>0){let S=y[0].toLowerCase()+y.substring(1),M=ne[r]?.[S]||he[S];if(!M){let L=y.toLowerCase();M=ne[r]?.[L]||he[L]}y=M||y}if(y=y.replace(/(';|;)/g,S=>S=="';"?";":" "),!y)return null;let C=y+(_?" !important":""),f=[p+":"+C];switch(p){case"mx":f=[`margin-left:${C}`,`margin-right:${C}`];break;case"my":f=[`margin-top:${C}`,`margin-bottom:${C}`];break;case"px":f=[`padding-left:${C}`,`padding-right:${C}`];break;case"py":f=[`padding-top:${C}`,`padding-bottom:${C}`];break;case"bdx":f=[`border-left:${C}`,`border-right:${C}`];break;case"bdy":f=[`border-top:${C}`,`border-bottom:${C}`];break}return!(typeof CSS<"u")||f.every(S=>CSS.supports(S))?f.join(";"):null}let et=r=>{let o=0;for(let l=r.length-1;l>=0;l--){let g=r[l];if(g==="]"){o++;continue}if(g==="["){o>0&&o--;continue}if(g==="@"&&o===0)return{body:r.slice(0,l),selector:r.slice(l+1)}}return{body:r,selector:""}},tt=r=>{let o=[],l=0,g=0;for(let p=0;p<r.length;p++){let v=r[p];if(v==="["){g++;continue}if(v==="]"){g>0&&g--;continue}v==="&"&&g===0&&(o.push(r.slice(l,p)),l=p+1)}return o.push(r.slice(l)),o},ge=r=>{if(!r)return!0;let o=r.trim();if(!o)return!0;if(/[{}]/.test(o)||o==="#"||o==="("||o===")"||o===","||o===">"||o==="+"||o==="~"||o.startsWith("(")||o.startsWith(")"))return!1;let l=0;for(let g=0;g<o.length;g++){let p=o[g];if(p==="("){l++;continue}if(p===")"){if(l===0)return!1;l--}}return l===0};function $e(r){if(!ke(r))return null;let o=T?r.slice(T.length):r,l=typeof CSS<"u"?CSS.escape(r):rt(r);if(o.includes("&")&&!o.startsWith("&")){let{body:L,selector:Q}=et(o),z=tt(L).map(k=>k.trim()).filter(k=>k.length>0).map(k=>T&&k.startsWith(T)?k.slice(T.length):k);if(z.length>1){let k="",j="",O=Q,Y=!1,W=[];for(let N of z){let ie=O?`${N}@${O}`:N,I=ce(ie);if(!I||!ue(I.mq)||!I.prop.startsWith("[")&&!pe(I.prop))return null;Y?(!I.mq&&k&&(I.mq=k),!I.layer&&j&&(I.layer=j)):(k=I.mq||"",j=I.layer||"",Y=!0);let ae=I.mq||"",me=I.layer||"",Ce=I.selector||"";if(ae!==k||me!==j||Ce!==O)return null;let ee=Pe(I.prop,I.val);if(!ee)return null;W.push(ee)}if(W.length===0)return null;let B=O.replace(/(';|;)/g,N=>N=="';"?";":" "),oe=`selector(${l}${B})`;if(B){if(typeof CSS<"u"){if(!CSS.supports(oe))return null}else if(!ge(B))return null}return{media:k||"default",layer:j||"0",className:l,property:W.join(";"),selector:B,cssRules:`.${l}${B}{${W.join(";")}}`}}}let g=ce(o);if(!g||!ue(g.mq)||!g.prop.startsWith("[")&&!pe(g.prop))return null;let{mq:p="default",layer:v="0",prop:_,val:y,selector:C=""}=g,f=[],D=Pe(_,y);if(D&&f.push(D),f.length===0)return null;let S=C.replace(/(';|;)/g,L=>L=="';"?";":" "),M=`selector(${l}${S})`;if(S){if(typeof CSS<"u"){if(!CSS.supports(M))return null}else if(!ge(S))return null}return{media:p||"default",layer:v||"0",className:l,property:f.join(";"),selector:S,cssRules:`.${l}${S}{${f.join(";")}}`}}let rt=r=>r.replace(/([^\w-])/g,"\\$1"),Se=r=>{var o=[...r?.classList||[]].filter(l=>{if(l){let g=l.charCodeAt(0)==45?l.charCodeAt(1):l.charCodeAt(0);return g>=97&&g<=122||g>=48&&g<=57}return!1});return r?.children?.length>0&&Array.from(r?.children).forEach(l=>{o.push(...Se(l))}),o.flat(1/0)},nt=(r,o)=>{if(typeof o!="function")throw new Error("Callback is not a function");if(!r)return;let l;"documentElement"in r?l=r.documentElement:(r instanceof Element||"tagName"in r||"host"in r)&&(l=r),l&&(l instanceof Element&&o(Se(l)),typeof MutationObserver<"u"&&new MutationObserver(g=>{for(let p of g)if(p.type=="attributes"&&p.attributeName=="class"){if(p.target.nodeType==1){let v=String(p.target?.className??""),_=String(p?.oldValue??"");if(v||_){let y=v.split(" ").map(f=>f.trim()).filter(f=>f),C=_.split(" ").map(f=>f.trim()).filter(f=>f);y=y.filter(f=>!C.includes(f)),typeof o=="function"&&o([...new Set(y)])}}}else if(p.type=="childList"&&p.addedNodes.length>0){let v=[...p.addedNodes].filter(_=>_.nodeType==1).map(_=>Se(_)).flat(1/0);typeof o=="function"&&o([...new Set(v)])}}).observe(l,{attributes:!0,attributeOldValue:!0,attributeFilter:["class"],childList:!0,subtree:!0}))};return{buildCss:Qe,exportCache:()=>{if(typeof window>"u"||!window.localStorage)return G;let r=ve(window.localStorage.getItem(x));if(r)return r;if(x!==q){let o=ve(window.localStorage.getItem(q));if(o)return o}return G},ready:se}},Tt=(e,t)=>{De(t).buildCss(e).observe()},_t=(e,t)=>De(t).buildCss(e).clsx,le={css:De,cssObserve:Tt,clsx:_t};var At="xcss_cache_v1",kt=(e,t)=>{let n=String(t||"").trim();return n?n===At||n.includes("_cache_")?n:`${e}_cache_${n}`:`${e}_cache_v1`},Ze=(e="fwkui",t="v1",n)=>{let s=String(e||"").trim()||"fwkui",i=kt(s,t),u=JSON.stringify(s),b=JSON.stringify(i),w=`
1
+ "use strict";var we=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var it=Object.prototype.hasOwnProperty;var at=(e,t)=>{for(var n in t)we(e,n,{get:t[n],enumerable:!0})},lt=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ot(t))!it.call(e,o)&&o!==n&&we(e,o,{get:()=>t[o],enumerable:!(s=st(t,o))||s.enumerable});return e};var ct=e=>lt(we({},"__esModule",{value:!0}),e);var Ht={};at(Ht,{clsx:()=>Pt,createSharedClsx:()=>Xt,createSharedInstance:()=>Ot,default:()=>Bt,getBootloaderScript:()=>qe,getCss:()=>Mt,observe:()=>$t,ready:()=>jt,setClsxRoot:()=>Lt});module.exports=ct(Ht);var Le=e=>(e=e||new Map,{all:e,on(t,n){let s=e.get(t);s?s.push(n):e.set(t,[n])},off(t,n){let s=e.get(t);s&&(n?s.splice(s.indexOf(n)>>>0,1):e.set(t,[]))},emit(t,n){let s=e.get(t);s&&s.slice().forEach(d=>{d(n)});let o=e.get("*");o&&o.slice().forEach(d=>{d(t,n)})}});function dt(e,t,n){let s=0;for(let o=t;o<n;o++){let d=e.charCodeAt(o);if(d===91){s++;continue}if(d===93){s>0&&s--;continue}if(d===58&&s===0)return o}return-1}function ut(e,t,n){let s=0;for(let o=n-1;o>=t;o--){let d=e.charCodeAt(o);if(d===93){s++;continue}if(d===91){s>0&&s--;continue}if(d===64&&s===0)return o}return-1}function ft(e,t,n){let s=0;for(let o=t;o<n;o++){let d=e.charCodeAt(o);if(d===91){s++;continue}if(d===93){if(s===0)return!1;s--}}return s===0}function pt(e){return e>=97&&e<=122}function ae(e){if(!e||e.length<2||!ft(e,0,e.length))return null;let t=0,n=e.length,s="",o=ut(e,t,n);o>t&&(s=e.substring(o+1,n),n=o);let d="",h="",f=dt(e,t,n);if(f>0&&f<n){let k=e.substring(t,f);t=f+1,d=k}let _=t;for(;_<n;){let k=e.charCodeAt(_);if(k>=48&&k<=57)_++;else break}if(_>t&&(h=e.substring(t,_),t=_),t>=n||e.charCodeAt(t)===38)return null;if(e.charCodeAt(t)===91){let k=e.indexOf("]",t);if(k>t)return{mq:d,layer:h,prop:e.substring(t,k+1),val:"",selector:s}}let R=t;for(;R<n;){let k=e.charCodeAt(R);if(k===45||k===46){if(R+1<n){let w=e.charCodeAt(R+1);if(k===45&&w===45&&R>t||w>=48&&w<=57)break}R++;continue}if(!pt(k))break;R++}if(R===t)return null;let U=e.substring(t,R),L=e.substring(R,n);return{mq:d,layer:h,prop:U,val:L,selector:s}}var Be=e=>{let t=typeof e?.styleId=="string"&&e.styleId.trim()?e.styleId.trim():"fwkui",n=typeof e?.version=="string"&&e.version.trim()?e.version.trim():"v1",s=e?.compression??!0,o=typeof e?.debounceMs=="number"&&e.debounceMs>=0?e.debounceMs:1e3;return{styleId:t,version:n,compression:s,debounceMs:o}},yt=e=>`${e.styleId}_cache_${e.version}`,He=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===2&&t.compressed===!0&&typeof t.payload=="string"},xe=e=>{if(!e||typeof e!="object")return!1;let t=e;return t.__xcss_cache_v===3&&t.compressed===!0&&t.algorithm==="deflate-raw"&&t.encoding==="base64"&&typeof t.payload=="string"},Ke=()=>typeof CompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",We=()=>typeof DecompressionStream<"u"&&typeof Blob<"u"&&typeof Response<"u",St=e=>{if(typeof btoa=="function"){let n="";for(let o=0;o<e.length;o+=32768){let d=e.subarray(o,o+32768);for(let h=0;h<d.length;h++)n+=String.fromCharCode(d[h])}return btoa(n)}let t=globalThis.Buffer;if(typeof t<"u")return t.from(e).toString("base64");throw new Error("XCSS: base64 encoding is not supported in this runtime")},gt=e=>{if(typeof atob=="function"){let n=atob(e),s=new Uint8Array(n.length);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return s}let t=globalThis.Buffer;if(typeof t<"u")return new Uint8Array(t.from(e,"base64"));throw new Error("XCSS: base64 decoding is not supported in this runtime")},ht=async e=>{if(!Ke())throw new Error("XCSS: CompressionStream is not supported");let t=new Blob([e]).stream().pipeThrough(new CompressionStream("deflate-raw")),n=await new Response(t).arrayBuffer();return St(new Uint8Array(n))},mt=async e=>{if(!We())throw new Error("XCSS: DecompressionStream is not supported");let t=gt(e),n=new Uint8Array(t.length);n.set(t);let s=new Blob([n.buffer]).stream().pipeThrough(new DecompressionStream("deflate-raw"));return await new Response(s).text()},Ct=e=>{try{let t=JSON.parse(e);return xe(t)}catch{return!1}},bt=e=>{if(!e)return"";let t=new Map,n=[],s=256;for(let d=0;d<256;d++)t.set(String.fromCharCode(d),d);let o=e[0];for(let d=1;d<e.length;d++){let h=e[d],f=o+h;t.has(f)?o=f:(n.push(t.get(o)),t.set(f,s++),o=h)}return n.push(t.get(o)),n.map(d=>String.fromCharCode(d)).join("")},Ue=e=>{if(!e)return"";let t=new Map,n=256,s="";for(let f=0;f<256;f++)t.set(f,String.fromCharCode(f));let o=e.split("").map(f=>f.charCodeAt(0)),d=o[0],h=t.get(d)||"";s=h;for(let f=1;f<o.length;f++){let _=o[f],R=t.get(_);R||(R=_===n?h+h[0]:""),s+=R,t.set(n++,h+R[0]),h=R}return s},ve=e=>{if(!e||typeof e!="object")return null;let t=e,n=t.default&&typeof t.default=="object"?t.default:t,s=n.SHORT_PROPERTIES,o=n.COMMON_VALUES,d=n.SPECIFIC_VALUES;return!s||!o||!d||typeof s!="object"||typeof o!="object"||typeof d!="object"?null:{SHORT_PROPERTIES:s,COMMON_VALUES:o,SPECIFIC_VALUES:d}},wt=async e=>{let t=await import(e),n=ve(t);if(!n)throw new Error(Ve);return n},Ve="XCSS: dictionary module must export SHORT_PROPERTIES, COMMON_VALUES and SPECIFIC_VALUES",Ne=()=>{let e=typeof require=="function"?require:null;if(!e)return null;for(let t of["./dictionary.js","./dictionary"])try{let n=e(t),s=ve(n);if(s)return s}catch{}return null},xt=async()=>{let e=Ne();if(e)return e;let t=["./dictionary.mjs","./dictionary.js","./dictionary"],n=null;for(let s of t)try{let o=await import(s),d=ve(o);if(d)return d}catch(o){n=o}throw n||new Error(Ve)},vt=(e,t)=>{if(!e||typeof document>"u")return;t=t||"fwkui";let n=Array.from({length:24},(s,o)=>"l"+o);if(!e.querySelector('style[id="'+t+'"]')){let s=document.createElement("style");if(s.id=t,!(e instanceof ShadowRoot))document.head.append(s);else try{e.prepend(s)}catch{e.appendChild(s)}let o=`@layer ${n.join(", ")};`,d=setInterval(()=>{if(s.sheet){clearInterval(d);try{s.sheet.insertRule(o,s.sheet.cssRules.length)}catch{}}},10)}},Et=e=>{let t=Array.isArray(e.excludes)?e.excludes:[],n=Be(e.cache),s=JSON.stringify({base:e.base||"",aliases:e.aliases||{},breakpoints:e.breakpoints||[],theme:e.theme||{},prefix:e.prefix||"",excludes:t,excludePrefixes:e.excludePrefixes||[],dictionaryImport:e.dictionaryImport??!0,cache:n}),o=0;if(s.length===0)return o.toString();for(let d=0;d<s.length;d++){let h=s.charCodeAt(d);o=(o<<5)-o+h,o|=0}return o.toString()},Me=e=>{if(!e)return null;try{let t=JSON.parse(e);if(He(t)){let n=Ue(t.payload);return n?JSON.parse(n):null}return xe(t)?null:t}catch{return null}},Rt=async e=>{if(!e)return null;try{let t=JSON.parse(e);if(He(t)){let n=Ue(t.payload);return n?JSON.parse(n):null}if(xe(t)){let n=await mt(t.payload);return n?JSON.parse(n):null}return t}catch{return null}},je=(e,t)=>{if(e==="root")return t;let n=/@media[^{]+\{\n?([\s\S]+)\n?\}/.exec(t);return n&&n[1]?n[1].trim():t},Ee=(e={base:"",aliases:{},excludes:[],excludePrefixes:[],breakpoints:[],theme:{},prefix:"",dictionaryImport:!0,cache:{styleId:"fwkui",version:"v1",compression:!0,debounceMs:1e3}})=>{let{base:t=null,breakpoints:n=[],aliases:s={},theme:o={},excludes:d=[],excludePrefixes:h=[],prefix:f="",dictionaryImport:_=!0,cache:R={}}=e||{};Array.isArray(n)||(n=[]),Array.isArray(d)||(d=[]),Array.isArray(h)||(h=[]),(!s||typeof s!="object")&&(s={}),(!o||typeof o!="object")&&(o={});let U=Be(R),L=yt(U),k=d,w=h.filter(r=>typeof r=="string").map(r=>r.trim()).filter(r=>r.length>0),X=r=>{let i=r.replace(/[.+?^${}()|[\]\\]/g,"\\$&");return new RegExp("^"+i.replace(/\*/g,".*")+"$")},G=k.filter(r=>typeof r=="string").map(r=>r.trim()).filter(r=>r.length>0).map(r=>{if(r.includes("*")){let i=X(r);return c=>i.test(c)}return i=>i===r}),le=r=>w.some(i=>r.startsWith(i))?!0:G.some(i=>i(r)),ce=r=>!(le(r)||f&&!r.startsWith(f)),ze=["default","xs","sm","md","lg","xl","2xl","sma","mda","lga","xla"],Fe=n.filter(r=>!!r&&typeof r=="object"&&!Array.isArray(r)).map(r=>Object.keys(r)[0]).filter(r=>typeof r=="string"&&r.length>0),Ze=new Set([...ze,...Fe]),de=r=>!r||Ze.has(r),Je=_!==!1,Ge=new Set(["mx","my","px","py","bdx","bdy"]),ue=new Set,fe=r=>r?!Je||!V||Object.keys(V).length===0?!0:!!V[r]||Ge.has(r)||ue.has(r):!1,V={},te={},pe={},ye={},Ae=()=>{ye={...pe,...o}},q=r=>{if(!r){V={},te={},pe={},ue=new Set,Ae();return}V=r.SHORT_PROPERTIES,te=r.SPECIFIC_VALUES,pe=r.COMMON_VALUES,ue=new Set(Object.values(V)),Ae()},z=!0,re=Promise.resolve();if(_===!1)q(null);else if(typeof _=="string")z=!1,q(null),re=wt(_).then(r=>{q(r)}).catch(r=>{console.warn("XCSS: Failed to import dictionary from URL",r)}).finally(()=>{z=!0});else{let r=Ne();r?q(r):(z=!1,q(null),re=xt().then(i=>{q(i)}).catch(i=>{console.warn("XCSS: Failed to load built-in dictionary module",i)}).finally(()=>{z=!0}))}let Y=null,Ye=(r=typeof document<"u"?document:void 0)=>{let i=typeof window<"u"&&typeof document<"u",c=null,S=Array.isArray(t)?t.length>0:!!t;r&&(c="getRootNode"in r?r.getRootNode():r);let y=new Map,x=1e3;i&&c&&vt(c,U.styleId);let D=Le(),p=[{default:""},{xs:"screen and (max-width: 575px)"},{sm:"screen and (min-width: 576px)"},{md:"screen and (min-width: 768px)"},{lg:"screen and (min-width: 992px)"},{xl:"screen and (min-width: 1200px)"},{"2xl":"screen and (min-width: 1400px)"},{sma:"screen and (max-width: 768px)"},{mda:"screen and (max-width: 992px)"},{lga:"screen and (max-width: 1200px)"},{xla:"screen and (max-width: 1400px)"},...n],C=p.filter((a,l)=>p.findLastIndex(u=>Object.keys(u)[0]==Object.keys(a)[0])==l),g=C.map(a=>Object.keys(a)[0]),T={},b={},E={root:""},B={root:[]},ne={root:!1},F=Et(e),I=null,H=0,M=!1,N=null,j=null,K=a=>{try{window.localStorage.setItem(L,a)}catch(l){console.warn("XCSS: Failed to save cache",l)}},se=a=>{!i||!window.localStorage||typeof a=="string"&&window.localStorage.getItem(L)!==a||window.localStorage.removeItem(L)},Z=a=>{if(!i||!window.localStorage)return;Y=a;let l=++H;try{let u=JSON.stringify(a),v=()=>{let m={__xcss_cache_v:2,compressed:!0,payload:bt(u)};K(JSON.stringify(m))};if(!U.compression){K(u);return}if(Ke()&&We()){ht(u).then(m=>{if(l!==H)return;K(JSON.stringify({__xcss_cache_v:3,compressed:!0,algorithm:"deflate-raw",encoding:"base64",payload:m}))}).catch(()=>{l===H&&v()});return}v()}catch(u){console.warn("XCSS: Failed to save cache",u)}},oe=()=>{i&&(I&&clearTimeout(I),I=setTimeout(()=>{let a={};for(let v in T)a[v]=Array.from(T[v]);let l={};Object.keys(E).forEach(v=>{if(v==="root")l[v]=E[v];else{let m=p.find($=>Object.keys($)[0]===v)?.[v];m&&E[v]?l[v]=`@media ${m} {
2
+ ${E[v]}
3
+ }`:l[v]=E[v]||""}});let u={configHash:F,cssText:l,rulesSet:a,keys:Array.from(y.entries()),sizeLast:x};Z(u)},U.debounceMs))};if(i&&window.localStorage)try{let a=window.localStorage.getItem(L);if(a){let l=Me(a);if(!l)Ct(a)?j={raw:a}:window.localStorage.removeItem(L);else if(l.configHash!==F)window.localStorage.removeItem(L);else{if(N=l,M=!0,l.keys&&l.keys.forEach(([u,v])=>y.set(u,v)),typeof l.sizeLast=="number"&&(x=l.sizeLast),l.cssText)for(let u in l.cssText)E[u]=je(u,l.cssText[u]);Y=l}}}catch(a){console.error(a)}i&&(b.root=new CSSStyleSheet),g.forEach(a=>{if(T[a]=new Set,i){let l=C.find(u=>Object.keys(u)[0]==a)?.[a]||"";b[a]=new CSSStyleSheet({media:l})}M||(E[a]=""),B[a]=[],ne[a]=!1});let A=()=>{if(!c)return;let a=c.querySelector(`style[id="${U.styleId}"]`);a&&a.remove()},ie=a=>{if(a.keys&&a.keys.forEach(([l,u])=>y.set(l,u)),typeof a.sizeLast=="number"&&(x=a.sizeLast),a.cssText)for(let l in a.cssText){if(l==="root"&&S)continue;let u=je(l,a.cssText[l]);E[l]=u,i&&b[l]&&b[l].replaceSync(u)}if(a.rulesSet)for(let l in a.rulesSet)T[l]||(T[l]=new Set),a.rulesSet[l].forEach(u=>T[l].add(u));Y=a,A()};M&&N&&ie(N),t&&Array.isArray(t)?(E.root=t.join(`
4
+ `),i&&b.root&&b.root.replaceSync(E.root)):(E.root=t||"",i&&b.root&&b.root.replaceSync(E.root)),i&&c&&["root",...g].forEach(a=>{b[a]&&c?.adoptedStyleSheets&&(c.adoptedStyleSheets.includes(b[a])||(c.adoptedStyleSheets=[...c.adoptedStyleSheets,b[a]]))}),i&&window.localStorage&&j&&!M&&(async()=>{let a=await Rt(j.raw);if(!a){se(j.raw);return}if(a.configHash!==F){se(j.raw);return}M=!0,N=a,ie(a)})();let he=(a,l)=>{let{media:u,property:v,selector:m,layer:$,className:O}=l,P=E,W=B,Ce=ne;$=Number($)||0;let Xe=y.get(a),nt=Xe?`.${Xe}${m}`:`.${O}${m}`;var be=`@layer l${$}{${nt}{${v}}}`;T[u]||(T[u]=new Set);let Pe=T[u];if(!Pe.has(be))if(Pe.add(be),W[u]||(W[u]=[]),W[u].push(be),i)Ce[u]||(Ce[u]=!0,queueMicrotask(()=>{let ee=W[u],$e=b[u];ee.length>0&&(P[u]+=(P[u]?`
5
+ `:"")+ee.join(`
6
+ `),$e&&$e.replaceSync(P[u]),W[u]=[],oe()),Ce[u]=!1}));else{let ee=W[u];ee.length>0&&(P[u]+=(P[u]?`
7
+ `:"")+ee.join(`
8
+ `),W[u]=[])}},me=a=>{a.forEach(l=>{let u=Oe(l);u&&he(l,u)})},Q=a=>{if(a.length===0)return;let l=()=>me(a);z?l():re.then(l)};return D.on("observeDom",Q),{clsx:(...a)=>{let l=a.map(m=>Array.isArray(m)?m:[m]).flat(1/0).map(m=>typeof m=="string"?m.split(/(\s|\t)+/g):[]).flat(1/0);l=l.filter(m=>typeof m=="string"&&m.trim()),l=[...new Set(l)];let u=m=>{if(!ce(m))return!1;if(z)return!!Oe(m);let $=f?m.slice(f.length):m,O=ae($);if(!O||!de(O.mq))return!1;let P=(O.selector||"").replace(/(';|;)/g,W=>W=="';"?";":" ");return P&&!Se(P)?!1:O.prop.startsWith("[")?!!_e(O.prop+O.val):fe(O.prop)?(O.prop==="&",O.val.length>0):!1},v=l.map(m=>{let $=m;if(y.has(m))$=y.get(m);else if(u(m)){let O=new Set(y.values()),P;do P="D"+(x++).toString(32).toUpperCase();while(O.has(P));y.set(m,P),$=P,oe()}return $});return i?queueMicrotask(()=>D.emit("observeDom",l)):D.emit("observeDom",l),v.join(" ")},observe:()=>{!i||!c||rt(c,a=>{Q(a)})},getCssString:()=>Object.entries(E).map(([a,l])=>{if(!l)return"";if(a==="root"||a==="default")return l;let u=p.find(v=>Object.keys(v)[0]===a)?.[a];return u?`@media ${u} {
9
+ ${l}
10
+ }`:l}).join(`
11
+ `)}};function _e(r){let i=new RegExp("^(\\[(?<p>[a-zA-Z]+)\\])$"),{p:c=""}=i.exec(r)?.groups??{};if(c&&s[c]&&Array.isArray(s[c])){let S=s[c],y=[],x=!0,D=p=>{let C=p.trim();if(!C)return null;let g=C.endsWith(";")?C.slice(0,-1).trim():C,T=g.indexOf(":");if(T<=0||T>=g.length-1)return null;let b=g.slice(0,T).trim(),E=g.slice(T+1).trim();return!b||!E||!/^(?:--[a-zA-Z0-9-_]+|-?[a-zA-Z][a-zA-Z0-9-]*)$/.test(b)?null:`${b}:${E}`};for(let p of S){if(typeof p!="string"){x=!1;break}let C=D(p);if(C){if(typeof CSS<"u"&&!CSS.supports(C)){x=!1;break}y.push(C);continue}x=!1;break}if(y.length>0&&x)return y.join(";")}return null}function ke(r,i){let c=_e(r+i);if(c)return c;if(!r||i===void 0)return null;let S=V[r],y=S||r,x=i[0],D=!1,p=i;if(x==="!"&&(D=!0,p=p.substring(1),x=p[0]),p.startsWith("--"))p="var("+p+")";else if(x==="["&&p.endsWith("]"))p=p.substring(1,p.length-1);else if(p.length>0){let b=p[0].toLowerCase()+p.substring(1),E=te[r]?.[b]||ye[b];if(!E){let B=p.toLowerCase();E=te[r]?.[B]||ye[B]}p=E||p}if(p=p.replace(/(';|;)/g,b=>b=="';"?";":" "),!p)return null;let C=p+(D?" !important":""),g=[y+":"+C];switch(y){case"mx":g=[`margin-left:${C}`,`margin-right:${C}`];break;case"my":g=[`margin-top:${C}`,`margin-bottom:${C}`];break;case"px":g=[`padding-left:${C}`,`padding-right:${C}`];break;case"py":g=[`padding-top:${C}`,`padding-bottom:${C}`];break;case"bdx":g=[`border-left:${C}`,`border-right:${C}`];break;case"bdy":g=[`border-top:${C}`,`border-bottom:${C}`];break}return!(typeof CSS<"u")||g.every(b=>CSS.supports(b))?g.join(";"):null}let Qe=r=>{let i=0;for(let c=r.length-1;c>=0;c--){let S=r[c];if(S==="]"){i++;continue}if(S==="["){i>0&&i--;continue}if(S==="@"&&i===0)return{body:r.slice(0,c),selector:r.slice(c+1)}}return{body:r,selector:""}},et=r=>{let i=[],c=0,S=0;for(let y=0;y<r.length;y++){let x=r[y];if(x==="["){S++;continue}if(x==="]"){S>0&&S--;continue}x==="&"&&S===0&&(i.push(r.slice(c,y)),c=y+1)}return i.push(r.slice(c)),i},Se=r=>{if(!r)return!0;let i=r.trim();if(!i)return!0;if(/[{}]/.test(i)||i==="#"||i==="("||i===")"||i===","||i===">"||i==="+"||i==="~"||i.startsWith("(")||i.startsWith(")"))return!1;let c=0;for(let S=0;S<i.length;S++){let y=i[S];if(y==="("){c++;continue}if(y===")"){if(c===0)return!1;c--}}return c===0};function Oe(r){if(!ce(r))return null;let i=f?r.slice(f.length):r,c=typeof CSS<"u"?CSS.escape(r):tt(r);if(i.includes("&")&&!i.startsWith("&")){let{body:B,selector:ne}=Qe(i),F=et(B).map(I=>I.trim()).filter(I=>I.length>0).map(I=>f&&I.startsWith(f)?I.slice(f.length):I);if(F.length>1){let I="",H="",M=ne,N=!1,j=[];for(let Z of F){let oe=M?`${Z}@${M}`:Z,A=ae(oe);if(!A||!de(A.mq)||!A.prop.startsWith("[")&&!fe(A.prop))return null;N?(!A.mq&&I&&(A.mq=I),!A.layer&&H&&(A.layer=H)):(I=A.mq||"",H=A.layer||"",N=!0);let ie=A.mq||"",he=A.layer||"",me=A.selector||"";if(ie!==I||he!==H||me!==M)return null;let Q=ke(A.prop,A.val);if(!Q)return null;j.push(Q)}if(j.length===0)return null;let K=M.replace(/(';|;)/g,Z=>Z=="';"?";":" "),se=`selector(${c}${K})`;if(K){if(typeof CSS<"u"){if(!CSS.supports(se))return null}else if(!Se(K))return null}return{media:I||"default",layer:H||"0",className:c,property:j.join(";"),selector:K,cssRules:`.${c}${K}{${j.join(";")}}`}}}let S=ae(i);if(!S||!de(S.mq)||!S.prop.startsWith("[")&&!fe(S.prop))return null;let{mq:y="default",layer:x="0",prop:D,val:p,selector:C=""}=S,g=[],T=ke(D,p);if(T&&g.push(T),g.length===0)return null;let b=C.replace(/(';|;)/g,B=>B=="';"?";":" "),E=`selector(${c}${b})`;if(b){if(typeof CSS<"u"){if(!CSS.supports(E))return null}else if(!Se(b))return null}return{media:y||"default",layer:x||"0",className:c,property:g.join(";"),selector:b,cssRules:`.${c}${b}{${g.join(";")}}`}}let tt=r=>r.replace(/([^\w-])/g,"\\$1"),ge=r=>{var i=[...r?.classList||[]].filter(c=>{if(c){let S=c.charCodeAt(0)==45?c.charCodeAt(1):c.charCodeAt(0);return S>=97&&S<=122||S>=48&&S<=57}return!1});return r?.children?.length>0&&Array.from(r?.children).forEach(c=>{i.push(...ge(c))}),i.flat(1/0)},rt=(r,i)=>{if(typeof i!="function")throw new Error("Callback is not a function");if(!r)return;let c;"documentElement"in r?c=r.documentElement:(r instanceof Element||"tagName"in r||"host"in r)&&(c=r),c&&(c instanceof Element&&i(ge(c)),typeof MutationObserver<"u"&&new MutationObserver(S=>{for(let y of S)if(y.type=="attributes"&&y.attributeName=="class"){if(y.target.nodeType==1){let x=String(y.target?.className??""),D=String(y?.oldValue??"");if(x||D){let p=x.split(" ").map(g=>g.trim()).filter(g=>g),C=D.split(" ").map(g=>g.trim()).filter(g=>g);p=p.filter(g=>!C.includes(g)),typeof i=="function"&&i([...new Set(p)])}}}else if(y.type=="childList"&&y.addedNodes.length>0){let x=[...y.addedNodes].filter(D=>D.nodeType==1).map(D=>ge(D)).flat(1/0);typeof i=="function"&&i([...new Set(x)])}}).observe(c,{attributes:!0,attributeOldValue:!0,attributeFilter:["class"],childList:!0,subtree:!0}))};return{buildCss:Ye,exportCache:()=>typeof window>"u"||!window.localStorage?Y:Me(window.localStorage.getItem(L))||Y,ready:re}},Tt=(e,t)=>{Ee(t).buildCss(e).observe()},Dt=(e,t)=>Ee(t).buildCss(e).clsx,Re={css:Ee,cssObserve:Tt,clsx:Dt};var It=(e,t)=>(e=e||"fwkui",t=t||"v1",`${e}_cache_${t}`),qe=(e="fwkui",t="v1",n)=>{let s=String(e||"").trim()||"fwkui",o=It(s,t),d=JSON.stringify(s),h=JSON.stringify(o),f=`
12
12
  (async function () {
13
13
  function decompressLZW(compressed) {
14
14
  if (!compressed) return '';
@@ -93,24 +93,15 @@ ${d}
93
93
  try {
94
94
  if (typeof window === 'undefined' || !window.localStorage) return;
95
95
 
96
- var styleId = ${u};
97
- var primaryKey = ${b};
98
- var keys = primaryKey === 'xcss_cache_v1' ? [primaryKey] : [primaryKey, 'xcss_cache_v1'];
99
- var payload = null;
100
-
101
- for (var i = 0; i < keys.length; i++) {
102
- var key = keys[i];
103
- var raw = localStorage.getItem(key);
104
- if (!raw) continue;
105
- payload = await parseCache(raw);
106
- if (!payload) {
96
+ var styleId = ${d};
97
+ var key = ${h};
98
+ var raw = localStorage.getItem(key);
99
+ if (!raw) return;
100
+ var payload=await parseCache(raw);
101
+ if (!payload) {
107
102
  localStorage.removeItem(key);
108
- continue;
103
+ return;
109
104
  }
110
- if (payload) break;
111
- }
112
-
113
- if (!payload) return;
114
105
 
115
106
  var styleEl = document.getElementById(styleId);
116
107
  if (!styleEl) {
@@ -127,5 +118,5 @@ ${d}
127
118
  styleEl.textContent = css;
128
119
  } catch (_error) {}
129
120
  })();
130
- `.trim();return n?.compact?w.replace(/\s+/g," ").trim():w};var Te="__FWXCSS_SHARED__",It=()=>{let e=new WeakMap,t=null,n=typeof document<"u"?document:null,s=R=>{if(!R)return!1;let A=typeof Document<"u",x=typeof ShadowRoot<"u",X=A&&R instanceof Document,Z=x&&R instanceof ShadowRoot;return X||Z},i=()=>(t||(t=le.css().buildCss(void 0)),t),u=R=>le.css({base:"html,body{font-size:16px;padding:0;margin:0;}"}).buildCss(R),b=R=>{if(!R)return i();let A=e.get(R);return A||(A=u(R),e.set(R,A)),A};return{clsx:(...R)=>{let A,x=R[R.length-1];s(x)&&(A=x,R=R.slice(0,-1));let X=[],Z=K=>{if(K){if(typeof K=="string"||typeof K=="number"){X.push(String(K));return}if(Array.isArray(K)){K.forEach(Z);return}typeof K=="object"&&Object.keys(K).forEach(re=>{K[re]&&X.push(re)})}};return R.forEach(Z),b(A||n).clsx(X.join(" "))},setClsxRoot:R=>{n=R||(typeof document<"u"?document:null)},getCss:()=>i().getCssString()}},_e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:global,de=_e[Te]||It();_e[Te]||(_e[Te]=de);var Ot=de.clsx,Pt=de.setClsxRoot,$t=de.getCss;var Xt=le;0&&(module.exports={clsx,getBootloaderScript,getCss,setClsxRoot});
121
+ `.trim();return n?.compact?f.replace(/\s+/g," ").trim():f};var Te="__FWXCSS_SHARED__",At={base:"html,body{font-size:16px;padding:0;margin:0;}"},_t=e=>{if(!e)return!1;let t=typeof Document<"u",n=typeof ShadowRoot<"u",s=t&&e instanceof Document,o=n&&e instanceof ShadowRoot;return s||o},kt=e=>{let t=[],n=s=>{if(s){if(typeof s=="string"||typeof s=="number"){t.push(String(s));return}if(Array.isArray(s)){s.forEach(n);return}typeof s=="object"&&Object.keys(s).forEach(o=>{s[o]&&t.push(o)})}};return e.forEach(n),t},Ie=e=>{let t=new WeakMap,n=null,s=e??At,o=typeof document<"u"?document:null,d=w=>{let X=Re.css(s);return{...X.buildCss(w??void 0),ready:X.ready}},h=()=>(n||(n=d(null)),n),f=w=>{if(!w)return h();let X=t.get(w);return X||(X=d(w),t.set(w,X)),X};return{clsx:(...w)=>{let X,G=w[w.length-1];_t(G)&&(X=G,w=w.slice(0,-1));let le=kt(w);return f(X||o).clsx(le.join(" "))},observe:w=>{f(w||o).observe()},setClsxRoot:w=>{o=w||(typeof document<"u"?document:null)},getCss:w=>w?f(w).getCssString():o?f(o).getCssString():h().getCssString(),ready:w=>w?f(w).ready:o?f(o).ready:h().ready}},Ot=e=>Ie(e),Xt=e=>Ie(e),De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:global,J=De[Te]||Ie();De[Te]||(De[Te]=J);var Pt=J.clsx,$t=J.observe,Lt=J.setClsxRoot,Mt=J.getCss,jt=J.ready;var Bt=Re;0&&(module.exports={clsx,createSharedClsx,createSharedInstance,getBootloaderScript,getCss,observe,ready,setClsxRoot});
131
122
  //# sourceMappingURL=index.js.map