@africode/core 5.0.4 → 5.0.5

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/africode.js CHANGED
@@ -1,162 +1,162 @@
1
- var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null,n)}var L=(t,n)=>{for(var o in n)Ao(t,o,{get:n[o],enumerable:!0,configurable:!0,set:Ho.bind(n,o)})};var Y=(t,n)=>()=>(t&&(n=t(t=0)),n);function vt(t){if(Kt.has(t))return Kt.get(t);let o=new Proxy(t,{get(b,l,h){let f=Reflect.get(b,l,h);if(f!==null&&typeof f==="object")return vt(f);return f},set(b,l,h,f){let a=Reflect.get(b,l,f);if(a!==h){let g=Reflect.set(b,l,h,f);if(g)Bn(f,h,a,l);return g}return!0},deleteProperty(b,l){let h=Reflect.get(b,l),f=Reflect.deleteProperty(b,l);if(f){let a=Kt.get(b);Bn(a,void 0,h,l)}return f}});return Kt.set(t,o),o}function y(t,n){if(!mt.has(t))mt.set(t,new Set);let o=mt.get(t);return o.add(n),()=>{o.delete(n)}}function Bn(t,n,o,b){let l=mt.get(t);if(!l)return;l.forEach((h)=>{try{h(n,o,b)}catch(f){console.error("[AfriCode State] Subscriber error:",f)}})}class J0{constructor(){this.store={}}get(t){return t.split("/").reduce((n,o)=>n?.[o],this.store)}set(t,n){let o=t.split("/"),b=this.store;while(o.length>1){let l=o.shift();if(!b[l]||typeof b[l]!=="object")b[l]={};b=b[l]}b[o[0]]=n}getAll(){return this.store}}function Rn(t){let n=t,o=new Set,b=()=>{return n},l=(h)=>{if(n!==h)n=typeof h==="function"?h(n):h,o.forEach((f)=>f()),Bn()};return b.subscribe=(h)=>{return o.add(h),()=>o.delete(h)},[b,l]}function Dn(t){return t(),y(t)}var mt,Kt,Mh;var ot=Y(()=>{mt=new WeakMap,Kt=new WeakMap;Mh=new J0});var Xo,W,G0;var kt=Y(()=>{ot();Xo={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},W=vt(Xo),G0={setTheme(t){if(["dark","light","system"].includes(t))W.theme=t,W.ui.theme=t},setLanguage(t){W.language=t},toggleSidebar(t){if(typeof t==="boolean")W.ui.sidebarCollapsed=t;else W.ui.sidebarCollapsed=!W.ui.sidebarCollapsed},setActivePage(t){W.ui.activePage=t}}});function Yo(t,n,o=50,b=50){let l=[];for(let h=0;h<t;h++){let f=2*Math.PI*h/t-Math.PI/2,a=o+n*Math.cos(f),g=b+n*Math.sin(f);l.push(`${a.toFixed(2)},${g.toFixed(2)}`)}return l.join(" ")}function On({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:o="#8B0000",stripeWidth:b=4,size:l=40}={}){let h=`
1
+ var Rb=Object.defineProperty;var Bb=(t)=>t;function Db(t,n){this[t]=Bb.bind(null,n)}var i=(t,n)=>{for(var b in n)Rb(t,b,{get:n[b],enumerable:!0,configurable:!0,set:Db.bind(n,b)})};var x=(t,n)=>()=>(t&&(n=t(t=0)),n);function $t(t){if(jt.has(t))return jt.get(t);let b=new Proxy(t,{get(o,l,a){let h=Reflect.get(o,l,a);if(h!==null&&typeof h==="object")return $t(h);return h},set(o,l,a,h){let f=Reflect.get(o,l,h);if(f!==a){let r=Reflect.set(o,l,a,h);if(r)On(h,a,f,l);return r}return!0},deleteProperty(o,l){let a=Reflect.get(o,l),h=Reflect.deleteProperty(o,l);if(h){let f=jt.get(o);On(f,void 0,a,l)}return h}});return jt.set(t,b),b}function y(t,n){if(!It.has(t))It.set(t,new Set);let b=It.get(t);return b.add(n),()=>{b.delete(n)}}function On(t,n,b,o){let l=It.get(t);if(!l)return;l.forEach((a)=>{try{a(n,b,o)}catch(h){console.error("[AfriCode State] Subscriber error:",h)}})}class Do{constructor(){this.store={}}get(t){return t.split("/").reduce((n,b)=>n?.[b],this.store)}set(t,n){let b=t.split("/"),o=this.store;while(b.length>1){let l=b.shift();if(!o[l]||typeof o[l]!=="object")o[l]={};o=o[l]}o[b[0]]=n}getAll(){return this.store}}function Wn(t){let n=t,b=new Set,o=()=>{return n},l=(a)=>{if(n!==a)n=typeof a==="function"?a(n):a,b.forEach((h)=>h()),On()};return o.subscribe=(a)=>{return b.add(a),()=>b.delete(a)},[o,l]}function mn(t){return t(),y(t)}var It,jt,ja;var bt=x(()=>{It=new WeakMap,jt=new WeakMap;ja=new Do});var Eb,D,Eo;var Qt=x(()=>{bt();Eb={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},D=$t(Eb),Eo={setTheme(t){if(["dark","light","system"].includes(t))D.theme=t,D.ui.theme=t},setLanguage(t){D.language=t},toggleSidebar(t){if(typeof t==="boolean")D.ui.sidebarCollapsed=t;else D.ui.sidebarCollapsed=!D.ui.sidebarCollapsed},setActivePage(t){D.ui.activePage=t}}});function Ob(t,n,b=50,o=50){let l=[];for(let a=0;a<t;a++){let h=2*Math.PI*a/t-Math.PI/2,f=b+n*Math.cos(h),r=o+n*Math.sin(h);l.push(`${f.toFixed(2)},${r.toFixed(2)}`)}return l.join(" ")}function pn({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:b="#8B0000",stripeWidth:o=4,size:l=40}={}){let a=`
2
2
  <svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
3
- <rect width="${l}" height="${l}" fill="${o}"/>
4
- <rect x="0" y="0" width="${l}" height="${b}" fill="${t}" opacity="0.8"/>
5
- <rect x="0" y="${l/2-b/2}" width="${l}" height="${b}" fill="${n}" opacity="0.6"/>
6
- <rect x="0" y="${l-b}" width="${l}" height="${b}" fill="${t}" opacity="0.8"/>
7
- <rect x="0" y="0" width="${b}" height="${l}" fill="${t}" opacity="0.5"/>
8
- <rect x="${l/2-b/2}" y="0" width="${b}" height="${l}" fill="${n}" opacity="0.4"/>
9
- <rect x="${l-b}" y="0" width="${b}" height="${l}" fill="${t}" opacity="0.5"/>
3
+ <rect width="${l}" height="${l}" fill="${b}"/>
4
+ <rect x="0" y="0" width="${l}" height="${o}" fill="${t}" opacity="0.8"/>
5
+ <rect x="0" y="${l/2-o/2}" width="${l}" height="${o}" fill="${n}" opacity="0.6"/>
6
+ <rect x="0" y="${l-o}" width="${l}" height="${o}" fill="${t}" opacity="0.8"/>
7
+ <rect x="0" y="0" width="${o}" height="${l}" fill="${t}" opacity="0.5"/>
8
+ <rect x="${l/2-o/2}" y="0" width="${o}" height="${l}" fill="${n}" opacity="0.4"/>
9
+ <rect x="${l-o}" y="0" width="${o}" height="${l}" fill="${t}" opacity="0.5"/>
10
10
  </svg>
11
- `;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Wn({earthColor:t="#8B4513",ochreColor:n="#CD853F",charcoalColor:o="#2F2F2F",size:b=50}={}){let l=`
12
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
13
- <rect width="${b}" height="${b}" fill="${t}"/>
11
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function un({earthColor:t="#8B4513",ochreColor:n="#CD853F",charcoalColor:b="#2F2F2F",size:o=50}={}){let l=`
12
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
13
+ <rect width="${o}" height="${o}" fill="${t}"/>
14
14
  <!-- Cave art inspired figures -->
15
- <circle cx="${b*0.3}" cy="${b*0.3}" r="${b*0.08}" fill="${n}"/>
16
- <line x1="${b*0.3}" y1="${b*0.38}" x2="${b*0.3}" y2="${b*0.6}" stroke="${o}" stroke-width="2"/>
17
- <line x1="${b*0.2}" y1="${b*0.45}" x2="${b*0.4}" y2="${b*0.45}" stroke="${o}" stroke-width="2"/>
15
+ <circle cx="${o*0.3}" cy="${o*0.3}" r="${o*0.08}" fill="${n}"/>
16
+ <line x1="${o*0.3}" y1="${o*0.38}" x2="${o*0.3}" y2="${o*0.6}" stroke="${b}" stroke-width="2"/>
17
+ <line x1="${o*0.2}" y1="${o*0.45}" x2="${o*0.4}" y2="${o*0.45}" stroke="${b}" stroke-width="2"/>
18
18
  <!-- Animal figure -->
19
- <ellipse cx="${b*0.7}" cy="${b*0.5}" rx="${b*0.15}" ry="${b*0.08}" fill="${n}"/>
20
- <line x1="${b*0.6}" y1="${b*0.58}" x2="${b*0.6}" y2="${b*0.7}" stroke="${o}" stroke-width="2"/>
21
- <line x1="${b*0.8}" y1="${b*0.58}" x2="${b*0.8}" y2="${b*0.7}" stroke="${o}" stroke-width="2"/>
19
+ <ellipse cx="${o*0.7}" cy="${o*0.5}" rx="${o*0.15}" ry="${o*0.08}" fill="${n}"/>
20
+ <line x1="${o*0.6}" y1="${o*0.58}" x2="${o*0.6}" y2="${o*0.7}" stroke="${b}" stroke-width="2"/>
21
+ <line x1="${o*0.8}" y1="${o*0.58}" x2="${o*0.8}" y2="${o*0.7}" stroke="${b}" stroke-width="2"/>
22
22
  <!-- Dots like ancient markings -->
23
- <circle cx="${b*0.15}" cy="${b*0.8}" r="3" fill="${n}"/>
24
- <circle cx="${b*0.85}" cy="${b*0.2}" r="3" fill="${n}"/>
23
+ <circle cx="${o*0.15}" cy="${o*0.8}" r="3" fill="${n}"/>
24
+ <circle cx="${o*0.85}" cy="${o*0.2}" r="3" fill="${n}"/>
25
25
  </svg>
26
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function En({primaryColor:t="#1EB53A",accentColor:n="#FCD116",size:o=30}={}){let b=`
27
- <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
28
- <rect width="${o}" height="${o}" fill="${t}"/>
26
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Un({primaryColor:t="#1EB53A",accentColor:n="#FCD116",size:b=30}={}){let o=`
27
+ <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
28
+ <rect width="${b}" height="${b}" fill="${t}"/>
29
29
  <!-- Pindo (Border) Motifs: Cashew/Triangle -->
30
- <path d="M0,0 L${o/2},${o/2} L0,${o} Z" fill="${n}"/>
31
- <path d="M${o},0 L${o/2},${o/2} L${o},${o} Z" fill="${n}"/>
32
- <circle cx="${o/2}" cy="${o/2}" r="${o*0.15}" fill="none" stroke="${n}" stroke-width="2"/>
30
+ <path d="M0,0 L${b/2},${b/2} L0,${b} Z" fill="${n}"/>
31
+ <path d="M${b},0 L${b/2},${b/2} L${b},${b} Z" fill="${n}"/>
32
+ <circle cx="${b/2}" cy="${b/2}" r="${b*0.15}" fill="none" stroke="${n}" stroke-width="2"/>
33
33
  </svg>
34
- `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function xo({primaryColor:t="#FF6B00",secondaryColor:n="#002B5C",backgroundColor:o="#FFFFFF",size:b=40}={}){let l=`
35
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
36
- <rect width="${b}" height="${b}" fill="${o}"/>
34
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function Wb({primaryColor:t="#FF6B00",secondaryColor:n="#002B5C",backgroundColor:b="#FFFFFF",size:o=40}={}){let l=`
35
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
36
+ <rect width="${o}" height="${o}" fill="${b}"/>
37
37
  <!-- Border pattern -->
38
- <rect x="0" y="0" width="${b}" height="${b*0.1}" fill="${t}"/>
39
- <rect x="0" y="${b*0.9}" width="${b}" height="${b*0.1}" fill="${t}"/>
40
- <rect x="0" y="0" width="${b*0.1}" height="${b}" fill="${t}"/>
41
- <rect x="${b*0.9}" y="0" width="${b*0.1}" height="${b}" fill="${t}"/>
38
+ <rect x="0" y="0" width="${o}" height="${o*0.1}" fill="${t}"/>
39
+ <rect x="0" y="${o*0.9}" width="${o}" height="${o*0.1}" fill="${t}"/>
40
+ <rect x="0" y="0" width="${o*0.1}" height="${o}" fill="${t}"/>
41
+ <rect x="${o*0.9}" y="0" width="${o*0.1}" height="${o}" fill="${t}"/>
42
42
  <!-- Center motif -->
43
- <circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.15}" fill="${n}"/>
44
- <text x="${b*0.5}" y="${b*0.55}" text-anchor="middle" fill="${t}" font-size="${b*0.08}">KANGA</text>
43
+ <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.15}" fill="${n}"/>
44
+ <text x="${o*0.5}" y="${o*0.55}" text-anchor="middle" fill="${t}" font-size="${o*0.08}">KANGA</text>
45
45
  </svg>
46
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Qo({primaryColor:t="#8B4513",secondaryColor:n="#DAA520",backgroundColor:o="#F5F5DC",size:b=30}={}){let l=`
47
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
48
- <rect width="${b}" height="${b}" fill="${o}"/>
46
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function mb({primaryColor:t="#8B4513",secondaryColor:n="#DAA520",backgroundColor:b="#F5F5DC",size:o=30}={}){let l=`
47
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
48
+ <rect width="${o}" height="${o}" fill="${b}"/>
49
49
  <!-- Kuba geometric border -->
50
- <polygon points="0,0 ${b*0.3},0 0,${b*0.3}" fill="${t}"/>
51
- <polygon points="${b},0 ${b*0.7},0 ${b},${b*0.3}" fill="${t}"/>
52
- <polygon points="0,${b} ${b*0.3},${b} 0,${b*0.7}" fill="${t}"/>
53
- <polygon points="${b},${b} ${b*0.7},${b} ${b},${b*0.7}" fill="${t}"/>
50
+ <polygon points="0,0 ${o*0.3},0 0,${o*0.3}" fill="${t}"/>
51
+ <polygon points="${o},0 ${o*0.7},0 ${o},${o*0.3}" fill="${t}"/>
52
+ <polygon points="0,${o} ${o*0.3},${o} 0,${o*0.7}" fill="${t}"/>
53
+ <polygon points="${o},${o} ${o*0.7},${o} ${o},${o*0.7}" fill="${t}"/>
54
54
  <!-- Center diamond -->
55
- <polygon points="${b*0.5},${b*0.3} ${b*0.7},${b*0.5} ${b*0.5},${b*0.7} ${b*0.3},${b*0.5}" fill="${n}"/>
55
+ <polygon points="${o*0.5},${o*0.3} ${o*0.7},${o*0.5} ${o*0.5},${o*0.7} ${o*0.3},${o*0.5}" fill="${n}"/>
56
56
  </svg>
57
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Jo({primaryColor:t="#FF0000",secondaryColor:n="#000000",accentColor:o="#FFFFFF",size:b=40}={}){let l=`
58
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
59
- <rect width="${b}" height="${b}" fill="${o}"/>
57
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function pb({primaryColor:t="#FF0000",secondaryColor:n="#000000",accentColor:b="#FFFFFF",size:o=40}={}){let l=`
58
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
59
+ <rect width="${o}" height="${o}" fill="${b}"/>
60
60
  <!-- Bead pattern -->
61
- <circle cx="${b*0.2}" cy="${b*0.2}" r="${b*0.08}" fill="${t}"/>
62
- <circle cx="${b*0.5}" cy="${b*0.2}" r="${b*0.08}" fill="${n}"/>
63
- <circle cx="${b*0.8}" cy="${b*0.2}" r="${b*0.08}" fill="${t}"/>
64
- <circle cx="${b*0.2}" cy="${b*0.5}" r="${b*0.08}" fill="${n}"/>
65
- <circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.08}" fill="${t}"/>
66
- <circle cx="${b*0.8}" cy="${b*0.5}" r="${b*0.08}" fill="${n}"/>
67
- <circle cx="${b*0.2}" cy="${b*0.8}" r="${b*0.08}" fill="${t}"/>
68
- <circle cx="${b*0.5}" cy="${b*0.8}" r="${b*0.08}" fill="${n}"/>
69
- <circle cx="${b*0.8}" cy="${b*0.8}" r="${b*0.08}" fill="${t}"/>
61
+ <circle cx="${o*0.2}" cy="${o*0.2}" r="${o*0.08}" fill="${t}"/>
62
+ <circle cx="${o*0.5}" cy="${o*0.2}" r="${o*0.08}" fill="${n}"/>
63
+ <circle cx="${o*0.8}" cy="${o*0.2}" r="${o*0.08}" fill="${t}"/>
64
+ <circle cx="${o*0.2}" cy="${o*0.5}" r="${o*0.08}" fill="${n}"/>
65
+ <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.08}" fill="${t}"/>
66
+ <circle cx="${o*0.8}" cy="${o*0.5}" r="${o*0.08}" fill="${n}"/>
67
+ <circle cx="${o*0.2}" cy="${o*0.8}" r="${o*0.08}" fill="${t}"/>
68
+ <circle cx="${o*0.5}" cy="${o*0.8}" r="${o*0.08}" fill="${n}"/>
69
+ <circle cx="${o*0.8}" cy="${o*0.8}" r="${o*0.08}" fill="${t}"/>
70
70
  </svg>
71
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Go({primaryColor:t="#8B0000",secondaryColor:n="#FFD700",backgroundColor:o="#654321",size:b=50}={}){let l=`
72
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
73
- <ellipse cx="${b*0.5}" cy="${b*0.5}" rx="${b*0.4}" ry="${b*0.45}" fill="${o}"/>
71
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function ub({primaryColor:t="#8B0000",secondaryColor:n="#FFD700",backgroundColor:b="#654321",size:o=50}={}){let l=`
72
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
73
+ <ellipse cx="${o*0.5}" cy="${o*0.5}" rx="${o*0.4}" ry="${o*0.45}" fill="${b}"/>
74
74
  <!-- Shield patterns -->
75
- <ellipse cx="${b*0.5}" cy="${b*0.3}" rx="${b*0.2}" ry="${b*0.15}" fill="${t}"/>
76
- <rect x="${b*0.4}" y="${b*0.5}" width="${b*0.2}" height="${b*0.3}" fill="${n}"/>
75
+ <ellipse cx="${o*0.5}" cy="${o*0.3}" rx="${o*0.2}" ry="${o*0.15}" fill="${t}"/>
76
+ <rect x="${o*0.4}" y="${o*0.5}" width="${o*0.2}" height="${o*0.3}" fill="${n}"/>
77
77
  <!-- Decorative lines -->
78
- <line x1="${b*0.3}" y1="${b*0.2}" x2="${b*0.7}" y2="${b*0.2}" stroke="${t}" stroke-width="3"/>
79
- <line x1="${b*0.3}" y1="${b*0.8}" x2="${b*0.7}" y2="${b*0.8}" stroke="${t}" stroke-width="3"/>
78
+ <line x1="${o*0.3}" y1="${o*0.2}" x2="${o*0.7}" y2="${o*0.2}" stroke="${t}" stroke-width="3"/>
79
+ <line x1="${o*0.3}" y1="${o*0.8}" x2="${o*0.7}" y2="${o*0.8}" stroke="${t}" stroke-width="3"/>
80
80
  </svg>
81
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Mo({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:o="#FFFF00",backgroundColor:b="#FFFFFF",size:l=50}={}){let h=`
81
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Ub({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:b="#FFFF00",backgroundColor:o="#FFFFFF",size:l=50}={}){let a=`
82
82
  <svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
83
- <rect width="${l}" height="${l}" fill="${b}"/>
83
+ <rect width="${l}" height="${l}" fill="${o}"/>
84
84
  <!-- Ndebele geometric patterns -->
85
85
  <polygon points="${l*0.2},${l*0.2} ${l*0.4},${l*0.2} ${l*0.3},${l*0.4}" fill="${t}"/>
86
86
  <polygon points="${l*0.6},${l*0.2} ${l*0.8},${l*0.2} ${l*0.7},${l*0.4}" fill="${n}"/>
87
- <polygon points="${l*0.2},${l*0.6} ${l*0.4},${l*0.6} ${l*0.3},${l*0.8}" fill="${o}"/>
87
+ <polygon points="${l*0.2},${l*0.6} ${l*0.4},${l*0.6} ${l*0.3},${l*0.8}" fill="${b}"/>
88
88
  <polygon points="${l*0.6},${l*0.6} ${l*0.8},${l*0.6} ${l*0.7},${l*0.8}" fill="${t}"/>
89
89
  <!-- Center design -->
90
90
  <circle cx="${l*0.5}" cy="${l*0.5}" r="${l*0.15}" fill="${n}"/>
91
- <rect x="${l*0.45}" y="${l*0.45}" width="${l*0.1}" height="${l*0.1}" fill="${o}"/>
91
+ <rect x="${l*0.45}" y="${l*0.45}" width="${l*0.1}" height="${l*0.1}" fill="${b}"/>
92
92
  </svg>
93
- `;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Un({primaryColor:t="#00A3DD",secondaryColor:n="#FCD116",backgroundColor:o="#1EB53A",size:b=50}={}){let l=`
94
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
95
- <rect width="${b}" height="${b}" fill="${o}"/>
96
- <circle cx="${b*0.25}" cy="${b*0.25}" r="${b*0.2}" fill="${t}" opacity="0.8"/>
97
- <circle cx="${b*0.75}" cy="${b*0.75}" r="${b*0.2}" fill="${t}" opacity="0.8"/>
98
- <circle cx="${b*0.25}" cy="${b*0.25}" r="${b*0.1}" fill="${n}"/>
99
- <circle cx="${b*0.75}" cy="${b*0.75}" r="${b*0.1}" fill="${n}"/>
100
- <circle cx="${b*0.75}" cy="${b*0.25}" r="${b*0.08}" fill="${n}" opacity="0.6"/>
101
- <circle cx="${b*0.25}" cy="${b*0.75}" r="${b*0.08}" fill="${n}" opacity="0.6"/>
93
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Vn({primaryColor:t="#00A3DD",secondaryColor:n="#FCD116",backgroundColor:b="#1EB53A",size:o=50}={}){let l=`
94
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
95
+ <rect width="${o}" height="${o}" fill="${b}"/>
96
+ <circle cx="${o*0.25}" cy="${o*0.25}" r="${o*0.2}" fill="${t}" opacity="0.8"/>
97
+ <circle cx="${o*0.75}" cy="${o*0.75}" r="${o*0.2}" fill="${t}" opacity="0.8"/>
98
+ <circle cx="${o*0.25}" cy="${o*0.25}" r="${o*0.1}" fill="${n}"/>
99
+ <circle cx="${o*0.75}" cy="${o*0.75}" r="${o*0.1}" fill="${n}"/>
100
+ <circle cx="${o*0.75}" cy="${o*0.25}" r="${o*0.08}" fill="${n}" opacity="0.6"/>
101
+ <circle cx="${o*0.25}" cy="${o*0.75}" r="${o*0.08}" fill="${n}" opacity="0.6"/>
102
102
  </svg>
103
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Vn({colors:t=["#FFD700","#228B22","#DC143C","#000000"],size:n=60}={}){let[o,b,l,h]=t,f=n/6,a=`
103
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Nn({colors:t=["#FFD700","#228B22","#DC143C","#000000"],size:n=60}={}){let[b,o,l,a]=t,h=n/6,f=`
104
104
  <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
105
- <rect width="${n}" height="${n}" fill="${h}"/>
105
+ <rect width="${n}" height="${n}" fill="${a}"/>
106
106
  <!-- Horizontal bands -->
107
- <rect x="0" y="0" width="${n}" height="${f}" fill="${o}"/>
108
- <rect x="0" y="${f}" width="${n}" height="${f}" fill="${b}"/>
109
- <rect x="0" y="${f*2}" width="${n}" height="${f}" fill="${l}"/>
110
- <rect x="0" y="${f*3}" width="${n}" height="${f}" fill="${o}"/>
111
- <rect x="0" y="${f*4}" width="${n}" height="${f}" fill="${b}"/>
112
- <rect x="0" y="${f*5}" width="${n}" height="${f}" fill="${l}"/>
107
+ <rect x="0" y="0" width="${n}" height="${h}" fill="${b}"/>
108
+ <rect x="0" y="${h}" width="${n}" height="${h}" fill="${o}"/>
109
+ <rect x="0" y="${h*2}" width="${n}" height="${h}" fill="${l}"/>
110
+ <rect x="0" y="${h*3}" width="${n}" height="${h}" fill="${b}"/>
111
+ <rect x="0" y="${h*4}" width="${n}" height="${h}" fill="${o}"/>
112
+ <rect x="0" y="${h*5}" width="${n}" height="${h}" fill="${l}"/>
113
113
  <!-- Vertical accents -->
114
- <rect x="${n*0.2}" y="0" width="3" height="${n}" fill="${h}" opacity="0.5"/>
115
- <rect x="${n*0.4}" y="0" width="3" height="${n}" fill="${h}" opacity="0.5"/>
116
- <rect x="${n*0.6}" y="0" width="3" height="${n}" fill="${h}" opacity="0.5"/>
117
- <rect x="${n*0.8}" y="0" width="3" height="${n}" fill="${h}" opacity="0.5"/>
114
+ <rect x="${n*0.2}" y="0" width="3" height="${n}" fill="${a}" opacity="0.5"/>
115
+ <rect x="${n*0.4}" y="0" width="3" height="${n}" fill="${a}" opacity="0.5"/>
116
+ <rect x="${n*0.6}" y="0" width="3" height="${n}" fill="${a}" opacity="0.5"/>
117
+ <rect x="${n*0.8}" y="0" width="3" height="${n}" fill="${a}" opacity="0.5"/>
118
118
  <!-- Kente squares -->
119
- <rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${o}" stroke="${h}" stroke-width="1"/>
120
- <rect x="${n*0.75}" y="${n*0.75}" width="${n*0.15}" height="${n*0.15}" fill="${l}" stroke="${h}" stroke-width="1"/>
119
+ <rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${b}" stroke="${a}" stroke-width="1"/>
120
+ <rect x="${n*0.75}" y="${n*0.75}" width="${n*0.15}" height="${n*0.15}" fill="${l}" stroke="${a}" stroke-width="1"/>
121
121
  </svg>
122
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Nn({symbolColor:t="#000000",backgroundColor:n="#CD853F",size:o=50}={}){let b=`
123
- <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
124
- <rect width="${o}" height="${o}" fill="${n}"/>
122
+ `;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Kn({symbolColor:t="#000000",backgroundColor:n="#CD853F",size:b=50}={}){let o=`
123
+ <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
124
+ <rect width="${b}" height="${b}" fill="${n}"/>
125
125
  <!-- Sankofa-inspired heart shape (go back and get it) -->
126
- <path d="M${o*0.5} ${o*0.2}
127
- C${o*0.3} ${o*0.1} ${o*0.15} ${o*0.3} ${o*0.25} ${o*0.5}
128
- L${o*0.5} ${o*0.8}
129
- L${o*0.75} ${o*0.5}
130
- C${o*0.85} ${o*0.3} ${o*0.7} ${o*0.1} ${o*0.5} ${o*0.2}"
126
+ <path d="M${b*0.5} ${b*0.2}
127
+ C${b*0.3} ${b*0.1} ${b*0.15} ${b*0.3} ${b*0.25} ${b*0.5}
128
+ L${b*0.5} ${b*0.8}
129
+ L${b*0.75} ${b*0.5}
130
+ C${b*0.85} ${b*0.3} ${b*0.7} ${b*0.1} ${b*0.5} ${b*0.2}"
131
131
  fill="none" stroke="${t}" stroke-width="3"/>
132
132
  <!-- Spiral detail -->
133
- <circle cx="${o*0.35}" cy="${o*0.45}" r="${o*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
134
- <circle cx="${o*0.65}" cy="${o*0.45}" r="${o*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
133
+ <circle cx="${b*0.35}" cy="${b*0.45}" r="${b*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
134
+ <circle cx="${b*0.65}" cy="${b*0.45}" r="${b*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
135
135
  </svg>
136
- `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function jn({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[o,b,l]=t,h=n/10,f=`
136
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function jn({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[b,o,l]=t,a=n/10,h=`
137
137
  <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
138
- <rect width="${n}" height="${n}" fill="${o}"/>
138
+ <rect width="${n}" height="${n}" fill="${b}"/>
139
139
  <!-- Horizontal stripes -->
140
- <rect x="0" y="${h}" width="${n}" height="${h*0.5}" fill="${b}"/>
141
- <rect x="0" y="${h*3}" width="${n}" height="${h*0.5}" fill="${l}"/>
142
- <rect x="0" y="${h*5}" width="${n}" height="${h*0.5}" fill="${b}"/>
143
- <rect x="0" y="${h*7}" width="${n}" height="${h*0.5}" fill="${l}"/>
144
- <rect x="0" y="${h*9}" width="${n}" height="${h*0.5}" fill="${b}"/>
140
+ <rect x="0" y="${a}" width="${n}" height="${a*0.5}" fill="${o}"/>
141
+ <rect x="0" y="${a*3}" width="${n}" height="${a*0.5}" fill="${l}"/>
142
+ <rect x="0" y="${a*5}" width="${n}" height="${a*0.5}" fill="${o}"/>
143
+ <rect x="0" y="${a*7}" width="${n}" height="${a*0.5}" fill="${l}"/>
144
+ <rect x="0" y="${a*9}" width="${n}" height="${a*0.5}" fill="${o}"/>
145
145
  <!-- Vertical accent lines -->
146
- <rect x="${n*0.48}" y="0" width="${h*0.4}" height="${n}" fill="${b}" opacity="0.7"/>
146
+ <rect x="${n*0.48}" y="0" width="${a*0.4}" height="${n}" fill="${o}" opacity="0.7"/>
147
147
  <!-- Diamond motifs -->
148
148
  <polygon points="${n*0.25},${n*0.3} ${n*0.35},${n*0.5} ${n*0.25},${n*0.7} ${n*0.15},${n*0.5}"
149
- fill="${b}" stroke="${l}" stroke-width="1"/>
149
+ fill="${o}" stroke="${l}" stroke-width="1"/>
150
150
  <polygon points="${n*0.75},${n*0.3} ${n*0.85},${n*0.5} ${n*0.75},${n*0.7} ${n*0.65},${n*0.5}"
151
- fill="${b}" stroke="${l}" stroke-width="1"/>
151
+ fill="${o}" stroke="${l}" stroke-width="1"/>
152
152
  </svg>
153
- `;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Kn({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:o="#FFD700",backgroundColor:b="#FFFFFF",size:l=60}={}){let h=`
153
+ `;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function In({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:b="#FFD700",backgroundColor:o="#FFFFFF",size:l=60}={}){let a=`
154
154
  <svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
155
- <rect width="${l}" height="${l}" fill="${b}"/>
155
+ <rect width="${l}" height="${l}" fill="${o}"/>
156
156
  <!-- Bold circular motifs -->
157
157
  <circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.25}" fill="${t}"/>
158
158
  <circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.15}" fill="${n}"/>
159
- <circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.08}" fill="${o}"/>
159
+ <circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.08}" fill="${b}"/>
160
160
 
161
161
  <circle cx="${l*0.8}" cy="${l*0.8}" r="${l*0.2}" fill="${n}"/>
162
162
  <circle cx="${l*0.8}" cy="${l*0.8}" r="${l*0.1}" fill="${t}"/>
@@ -166,188 +166,188 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
166
166
  stroke="${t}" stroke-width="4"/>
167
167
 
168
168
  <!-- Small dots -->
169
- <circle cx="${l*0.1}" cy="${l*0.8}" r="${l*0.05}" fill="${o}"/>
170
- <circle cx="${l*0.9}" cy="${l*0.2}" r="${l*0.05}" fill="${o}"/>
169
+ <circle cx="${l*0.1}" cy="${l*0.8}" r="${l*0.05}" fill="${b}"/>
170
+ <circle cx="${l*0.9}" cy="${l*0.2}" r="${l*0.05}" fill="${b}"/>
171
171
  </svg>
172
- `;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function mn({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:o="#8B4513",size:b=60}={}){let l=`
173
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
174
- <rect width="${b}" height="${b}" fill="${t}"/>
172
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Pn({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:b="#8B4513",size:o=60}={}){let l=`
173
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
174
+ <rect width="${o}" height="${o}" fill="${t}"/>
175
175
  <!-- Zigzags -->
176
- <polyline points="0,${b*0.2} ${b*0.25},0 ${b*0.5},${b*0.2} ${b*0.75},0 ${b},${b*0.2}"
176
+ <polyline points="0,${o*0.2} ${o*0.25},0 ${o*0.5},${o*0.2} ${o*0.75},0 ${o},${o*0.2}"
177
177
  fill="none" stroke="${n}" stroke-width="3"/>
178
- <polyline points="0,${b*0.8} ${b*0.25},${b} ${b*0.5},${b*0.8} ${b*0.75},${b} ${b},${b*0.8}"
178
+ <polyline points="0,${o*0.8} ${o*0.25},${o} ${o*0.5},${o*0.8} ${o*0.75},${o} ${o},${o*0.8}"
179
179
  fill="none" stroke="${n}" stroke-width="3"/>
180
180
  <!-- Crosses -->
181
- <line x1="${b*0.25}" y1="${b*0.4}" x2="${b*0.25}" y2="${b*0.6}" stroke="${n}" stroke-width="2"/>
182
- <line x1="${b*0.15}" y1="${b*0.5}" x2="${b*0.35}" y2="${b*0.5}" stroke="${n}" stroke-width="2"/>
183
- <line x1="${b*0.75}" y1="${b*0.4}" x2="${b*0.75}" y2="${b*0.6}" stroke="${n}" stroke-width="2"/>
184
- <line x1="${b*0.65}" y1="${b*0.5}" x2="${b*0.85}" y2="${b*0.5}" stroke="${n}" stroke-width="2"/>
181
+ <line x1="${o*0.25}" y1="${o*0.4}" x2="${o*0.25}" y2="${o*0.6}" stroke="${n}" stroke-width="2"/>
182
+ <line x1="${o*0.15}" y1="${o*0.5}" x2="${o*0.35}" y2="${o*0.5}" stroke="${n}" stroke-width="2"/>
183
+ <line x1="${o*0.75}" y1="${o*0.4}" x2="${o*0.75}" y2="${o*0.6}" stroke="${n}" stroke-width="2"/>
184
+ <line x1="${o*0.65}" y1="${o*0.5}" x2="${o*0.85}" y2="${o*0.5}" stroke="${n}" stroke-width="2"/>
185
185
  <!-- Dots -->
186
- <circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.08}" fill="${o}"/>
186
+ <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.08}" fill="${b}"/>
187
187
  </svg>
188
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function pn({primaryColor:t="#D2B48C",secondaryColor:n="#3E2723",size:o=60}={}){let b=`
189
- <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
190
- <rect width="${o}" height="${o}" fill="${t}"/>
188
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Tn({primaryColor:t="#D2B48C",secondaryColor:n="#3E2723",size:b=60}={}){let o=`
189
+ <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
190
+ <rect width="${b}" height="${b}" fill="${t}"/>
191
191
  <!-- Interlocking diamonds/rectangles -->
192
- <rect x="${o*0.1}" y="${o*0.1}" width="${o*0.3}" height="${o*0.3}" fill="${n}"/>
193
- <rect x="${o*0.6}" y="${o*0.6}" width="${o*0.3}" height="${o*0.3}" fill="${n}"/>
194
- <rect x="${o*0.6}" y="${o*0.1}" width="${o*0.3}" height="${o*0.3}"
192
+ <rect x="${b*0.1}" y="${b*0.1}" width="${b*0.3}" height="${b*0.3}" fill="${n}"/>
193
+ <rect x="${b*0.6}" y="${b*0.6}" width="${b*0.3}" height="${b*0.3}" fill="${n}"/>
194
+ <rect x="${b*0.6}" y="${b*0.1}" width="${b*0.3}" height="${b*0.3}"
195
195
  fill="none" stroke="${n}" stroke-width="4"/>
196
- <rect x="${o*0.1}" y="${o*0.6}" width="${o*0.3}" height="${o*0.3}"
196
+ <rect x="${b*0.1}" y="${b*0.6}" width="${b*0.3}" height="${b*0.3}"
197
197
  fill="none" stroke="${n}" stroke-width="4"/>
198
198
  <!-- Center lines -->
199
- <line x1="${o*0.4}" y1="${o*0.5}" x2="${o*0.6}" y2="${o*0.5}" stroke="${n}" stroke-width="2"/>
200
- <line x1="${o*0.5}" y1="${o*0.4}" x2="${o*0.5}" y2="${o*0.6}" stroke="${n}" stroke-width="2"/>
199
+ <line x1="${b*0.4}" y1="${b*0.5}" x2="${b*0.6}" y2="${b*0.5}" stroke="${n}" stroke-width="2"/>
200
+ <line x1="${b*0.5}" y1="${b*0.4}" x2="${b*0.5}" y2="${b*0.6}" stroke="${n}" stroke-width="2"/>
201
201
  </svg>
202
- `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function dn({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:o="#B22222",size:b=60}={}){let l=`
203
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
204
- <rect width="${b}" height="${b}" fill="${n}"/>
202
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function Cn({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:b="#B22222",size:o=60}={}){let l=`
203
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
204
+ <rect width="${o}" height="${o}" fill="${n}"/>
205
205
  <!-- Spiral/Diamond Motif -->
206
- <path d="M${b*0.5} ${b*0.1}
207
- L${b*0.9} ${b*0.5}
208
- L${b*0.5} ${b*0.9}
209
- L${b*0.1} ${b*0.5} Z"
206
+ <path d="M${o*0.5} ${o*0.1}
207
+ L${o*0.9} ${o*0.5}
208
+ L${o*0.5} ${o*0.9}
209
+ L${o*0.1} ${o*0.5} Z"
210
210
  fill="${t}"/>
211
- <path d="M${b*0.5} ${b*0.3}
212
- L${b*0.7} ${b*0.5}
213
- L${b*0.5} ${b*0.7}
214
- L${b*0.3} ${b*0.5} Z"
211
+ <path d="M${o*0.5} ${o*0.3}
212
+ L${o*0.7} ${o*0.5}
213
+ L${o*0.5} ${o*0.7}
214
+ L${o*0.3} ${o*0.5} Z"
215
215
  fill="${n}"/>
216
- <circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.1}" fill="${o}"/>
216
+ <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${b}"/>
217
217
  </svg>
218
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function un({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:o=40}={}){let[b,l,h]=t,f=`
219
- <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
220
- <rect width="${o}" height="${o}" fill="${n}"/>
218
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function yn({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:b=40}={}){let[o,l,a]=t,h=`
219
+ <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
220
+ <rect width="${b}" height="${b}" fill="${n}"/>
221
221
  <!-- Diamond Chain -->
222
- <polygon points="${o*0.5},0 ${o},${o*0.5} ${o*0.5},${o} 0,${o*0.5}"
223
- fill="${b}" opacity="0.2"/>
224
- <polygon points="${o*0.5},${o*0.2} ${o*0.8},${o*0.5} ${o*0.5},${o*0.8} ${o*0.2},${o*0.5}"
222
+ <polygon points="${b*0.5},0 ${b},${b*0.5} ${b*0.5},${b} 0,${b*0.5}"
223
+ fill="${o}" opacity="0.2"/>
224
+ <polygon points="${b*0.5},${b*0.2} ${b*0.8},${b*0.5} ${b*0.5},${b*0.8} ${b*0.2},${b*0.5}"
225
225
  fill="${l}"/>
226
- <rect x="${o*0.4}" y="${o*0.4}" width="${o*0.2}" height="${o*0.2}" fill="${h}"/>
226
+ <rect x="${b*0.4}" y="${b*0.4}" width="${b*0.2}" height="${b*0.2}" fill="${a}"/>
227
227
  <!-- Side accents -->
228
- <line x1="0" y1="0" x2="0" y2="${o}" stroke="${b}" stroke-width="4"/>
229
- <line x1="${o}" y1="0" x2="${o}" y2="${o}" stroke="${b}" stroke-width="4"/>
228
+ <line x1="0" y1="0" x2="0" y2="${b}" stroke="${o}" stroke-width="4"/>
229
+ <line x1="${b}" y1="0" x2="${b}" y2="${b}" stroke="${o}" stroke-width="4"/>
230
230
  </svg>
231
- `;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function In({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:o=2}={}){let[b,l,h,f]=t,a=`
231
+ `;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function en({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:b=2}={}){let[o,l,a,h]=t,f=`
232
232
  <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
233
233
  <rect width="${n}" height="${n}" fill="#FFFFFF"/>
234
- <rect x="${o}" y="${o}"
235
- width="${n-o*2}" height="${n-o*2}"
236
- fill="none" stroke="#000000" stroke-width="${o}"/>
234
+ <rect x="${b}" y="${b}"
235
+ width="${n-b*2}" height="${n-b*2}"
236
+ fill="none" stroke="#000000" stroke-width="${b}"/>
237
237
  <rect x="${n*0.15}" y="${n*0.15}" width="${n*0.35}" height="${n*0.35}"
238
- fill="${b}" stroke="#000000" stroke-width="${o/2}"/>
238
+ fill="${o}" stroke="#000000" stroke-width="${b/2}"/>
239
239
  <rect x="${n*0.5}" y="${n*0.15}" width="${n*0.35}" height="${n*0.35}"
240
- fill="${l}" stroke="#000000" stroke-width="${o/2}"/>
240
+ fill="${l}" stroke="#000000" stroke-width="${b/2}"/>
241
241
  <rect x="${n*0.15}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
242
- fill="${h}" stroke="#000000" stroke-width="${o/2}"/>
242
+ fill="${a}" stroke="#000000" stroke-width="${b/2}"/>
243
243
  <rect x="${n*0.5}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
244
- fill="${f}" stroke="#000000" stroke-width="${o/2}"/>
244
+ fill="${h}" stroke="#000000" stroke-width="${b/2}"/>
245
245
  <polygon points="${n/2},${n*0.3} ${n*0.7},${n/2} ${n/2},${n*0.7} ${n*0.3},${n/2}"
246
- fill="#FFFFFF" stroke="#000000" stroke-width="${o}"/>
246
+ fill="#FFFFFF" stroke="#000000" stroke-width="${b}"/>
247
247
  </svg>
248
- `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Pn({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[o,b,l,h,f]=t,a=n/10,g=`
248
+ `;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Zn({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[b,o,l,a,h]=t,f=n/10,r=`
249
249
  <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
250
- <rect width="${n}" height="${n}" fill="${b}"/>
250
+ <rect width="${n}" height="${n}" fill="${o}"/>
251
251
  <!-- Triangle pattern (isivivane - sacred cairn) -->
252
252
  <polygon points="${n*0.5},${n*0.1} ${n*0.9},${n*0.9} ${n*0.1},${n*0.9}"
253
- fill="none" stroke="${o}" stroke-width="2"/>
253
+ fill="none" stroke="${b}" stroke-width="2"/>
254
254
  <polygon points="${n*0.5},${n*0.25} ${n*0.75},${n*0.75} ${n*0.25},${n*0.75}"
255
255
  fill="${l}"/>
256
256
  <!-- Beadwork dots -->
257
- <circle cx="${n*0.5}" cy="${n*0.35}" r="${a}" fill="${o}"/>
258
- <circle cx="${n*0.35}" cy="${n*0.6}" r="${a}" fill="${h}"/>
259
- <circle cx="${n*0.65}" cy="${n*0.6}" r="${a}" fill="${f}"/>
260
- <circle cx="${n*0.5}" cy="${n*0.8}" r="${a}" fill="${o}"/>
257
+ <circle cx="${n*0.5}" cy="${n*0.35}" r="${f}" fill="${b}"/>
258
+ <circle cx="${n*0.35}" cy="${n*0.6}" r="${f}" fill="${a}"/>
259
+ <circle cx="${n*0.65}" cy="${n*0.6}" r="${f}" fill="${h}"/>
260
+ <circle cx="${n*0.5}" cy="${n*0.8}" r="${f}" fill="${b}"/>
261
261
  <!-- Border dots -->
262
- <circle cx="${n*0.1}" cy="${n*0.1}" r="${a*0.7}" fill="${l}"/>
263
- <circle cx="${n*0.9}" cy="${n*0.1}" r="${a*0.7}" fill="${h}"/>
262
+ <circle cx="${n*0.1}" cy="${n*0.1}" r="${f*0.7}" fill="${l}"/>
263
+ <circle cx="${n*0.9}" cy="${n*0.1}" r="${f*0.7}" fill="${a}"/>
264
264
  </svg>
265
- `;return`data:image/svg+xml,${encodeURIComponent(g.trim())}`}function Tn({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[o,b,l,h]=t,f=`
265
+ `;return`data:image/svg+xml,${encodeURIComponent(r.trim())}`}function sn({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[b,o,l,a]=t,h=`
266
266
  <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
267
- <rect width="${n}" height="${n}" fill="${o}"/>
267
+ <rect width="${n}" height="${n}" fill="${b}"/>
268
268
  <!-- Shield shape (central to Eswatini culture) -->
269
269
  <ellipse cx="${n*0.5}" cy="${n*0.45}" rx="${n*0.35}" ry="${n*0.4}"
270
- fill="${b}" stroke="${l}" stroke-width="3"/>
270
+ fill="${o}" stroke="${l}" stroke-width="3"/>
271
271
  <!-- Inner pattern -->
272
272
  <ellipse cx="${n*0.5}" cy="${n*0.45}" rx="${n*0.2}" ry="${n*0.25}"
273
273
  fill="${l}"/>
274
274
  <!-- Feather accents -->
275
275
  <line x1="${n*0.5}" y1="${n*0.05}" x2="${n*0.5}" y2="${n*0.2}"
276
- stroke="${h}" stroke-width="3"/>
276
+ stroke="${a}" stroke-width="3"/>
277
277
  <line x1="${n*0.4}" y1="${n*0.08}" x2="${n*0.45}" y2="${n*0.15}"
278
- stroke="${h}" stroke-width="2"/>
278
+ stroke="${a}" stroke-width="2"/>
279
279
  <line x1="${n*0.6}" y1="${n*0.08}" x2="${n*0.55}" y2="${n*0.15}"
280
- stroke="${h}" stroke-width="2"/>
280
+ stroke="${a}" stroke-width="2"/>
281
281
  <!-- Spear points -->
282
- <polygon points="${n*0.1},${n*0.3} ${n*0.05},${n*0.5} ${n*0.15},${n*0.5}" fill="${h}"/>
283
- <polygon points="${n*0.9},${n*0.3} ${n*0.85},${n*0.5} ${n*0.95},${n*0.5}" fill="${h}"/>
282
+ <polygon points="${n*0.1},${n*0.3} ${n*0.05},${n*0.5} ${n*0.15},${n*0.5}" fill="${a}"/>
283
+ <polygon points="${n*0.9},${n*0.3} ${n*0.85},${n*0.5} ${n*0.95},${n*0.5}" fill="${a}"/>
284
284
  </svg>
285
- `;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Cn({primaryColor:t="#FFFFFF",accentColor:n="#00A86B",backgroundColor:o="#1a1a2e",size:b=50}={}){let l=`
286
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
287
- <rect width="${b}" height="${b}" fill="${o}"/>
285
+ `;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function zn({primaryColor:t="#FFFFFF",accentColor:n="#00A86B",backgroundColor:b="#1a1a2e",size:o=50}={}){let l=`
286
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
287
+ <rect width="${o}" height="${o}" fill="${b}"/>
288
288
  <!-- Horizontal bands -->
289
- <rect x="0" y="${b*0.2}" width="${b}" height="${b*0.1}" fill="${t}"/>
290
- <rect x="0" y="${b*0.7}" width="${b}" height="${b*0.1}" fill="${t}"/>
289
+ <rect x="0" y="${o*0.2}" width="${o}" height="${o*0.1}" fill="${t}"/>
290
+ <rect x="0" y="${o*0.7}" width="${o}" height="${o*0.1}" fill="${t}"/>
291
291
  <!-- Vertical bands -->
292
- <rect x="${b*0.2}" y="0" width="${b*0.1}" height="${b}" fill="${n}"/>
293
- <rect x="${b*0.7}" y="0" width="${b*0.1}" height="${b}" fill="${n}"/>
292
+ <rect x="${o*0.2}" y="0" width="${o*0.1}" height="${o}" fill="${n}"/>
293
+ <rect x="${o*0.7}" y="0" width="${o*0.1}" height="${o}" fill="${n}"/>
294
294
  <!-- Central diamond -->
295
- <polygon points="${b*0.5},${b*0.35} ${b*0.65},${b*0.5} ${b*0.5},${b*0.65} ${b*0.35},${b*0.5}"
295
+ <polygon points="${o*0.5},${o*0.35} ${o*0.65},${o*0.5} ${o*0.5},${o*0.65} ${o*0.35},${o*0.5}"
296
296
  fill="${n}" stroke="${t}" stroke-width="2"/>
297
297
  <!-- Corner triangles -->
298
- <polygon points="0,0 ${b*0.15},0 0,${b*0.15}" fill="${n}"/>
299
- <polygon points="${b},0 ${b*0.85},0 ${b},${b*0.15}" fill="${n}"/>
300
- <polygon points="0,${b} ${b*0.15},${b} 0,${b*0.85}" fill="${n}"/>
301
- <polygon points="${b},${b} ${b*0.85},${b} ${b},${b*0.85}" fill="${n}"/>
298
+ <polygon points="0,0 ${o*0.15},0 0,${o*0.15}" fill="${n}"/>
299
+ <polygon points="${o},0 ${o*0.85},0 ${o},${o*0.15}" fill="${n}"/>
300
+ <polygon points="0,${o} ${o*0.15},${o} 0,${o*0.85}" fill="${n}"/>
301
+ <polygon points="${o},${o} ${o*0.85},${o} ${o},${o*0.85}" fill="${n}"/>
302
302
  </svg>
303
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Lo(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function yn({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:o="#FFD700",backgroundColor:b="#F5F5DC",size:l=60}={}){let h=`
303
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Vb(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function to({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:b="#FFD700",backgroundColor:o="#F5F5DC",size:l=60}={}){let a=`
304
304
  <svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
305
- <rect width="${l}" height="${l}" fill="${b}"/>
305
+ <rect width="${l}" height="${l}" fill="${o}"/>
306
306
  <!-- Lozenge (Diamond) - universal protective symbol -->
307
307
  <polygon points="${l*0.5},${l*0.1} ${l*0.9},${l*0.5} ${l*0.5},${l*0.9} ${l*0.1},${l*0.5}"
308
308
  fill="${t}" stroke="${n}" stroke-width="2"/>
309
309
  <!-- Inner geometric details -->
310
- <line x1="${l*0.5}" y1="${l*0.1}" x2="${l*0.5}" y2="${l*0.9}" stroke="${o}" stroke-width="2"/>
311
- <line x1="${l*0.1}" y1="${l*0.5}" x2="${l*0.9}" y2="${l*0.5}" stroke="${o}" stroke-width="2"/>
310
+ <line x1="${l*0.5}" y1="${l*0.1}" x2="${l*0.5}" y2="${l*0.9}" stroke="${b}" stroke-width="2"/>
311
+ <line x1="${l*0.1}" y1="${l*0.5}" x2="${l*0.9}" y2="${l*0.5}" stroke="${b}" stroke-width="2"/>
312
312
  <!-- X symbols (Fibula/Cross) -->
313
313
  <line x1="${l*0.4}" y1="${l*0.4}" x2="${l*0.6}" y2="${l*0.6}" stroke="${n}" stroke-width="2"/>
314
314
  <line x1="${l*0.6}" y1="${l*0.4}" x2="${l*0.4}" y2="${l*0.6}" stroke="${n}" stroke-width="2"/>
315
315
  </svg>
316
- `;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Zn({primaryColor:t="#4B0082",secondaryColor:n="#8A2BE2",accentColor:o="#FFFFFF",size:b=50}={}){let l=`
317
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
318
- <rect width="${b}" height="${b}" fill="${t}"/>
316
+ `;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function no({primaryColor:t="#4B0082",secondaryColor:n="#8A2BE2",accentColor:b="#FFFFFF",size:o=50}={}){let l=`
317
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
318
+ <rect width="${o}" height="${o}" fill="${t}"/>
319
319
  <!-- Resist circles (Oniko) -->
320
- <circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.35}" fill="none" stroke="${n}" stroke-width="3"/>
321
- <circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.25}" fill="none" stroke="${o}" stroke-width="2" stroke-dasharray="4 2"/>
322
- <circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.1}" fill="${o}" opacity="0.8"/>
320
+ <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.35}" fill="none" stroke="${n}" stroke-width="3"/>
321
+ <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.25}" fill="none" stroke="${b}" stroke-width="2" stroke-dasharray="4 2"/>
322
+ <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${b}" opacity="0.8"/>
323
323
  <!-- Corner ripples -->
324
- <path d="M0,0 Q${b*0.2},0 ${b*0.2},${b*0.2} Q0,${b*0.2} 0,0" fill="${n}"/>
325
- <path d="M${b},${b} Q${b*0.8},${b} ${b*0.8},${b*0.8} Q${b},${b*0.8} ${b},${b}" fill="${n}"/>
324
+ <path d="M0,0 Q${o*0.2},0 ${o*0.2},${o*0.2} Q0,${o*0.2} 0,0" fill="${n}"/>
325
+ <path d="M${o},${o} Q${o*0.8},${o} ${o*0.8},${o*0.8} Q${o},${o*0.8} ${o},${o}" fill="${n}"/>
326
326
  </svg>
327
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function ko({primaryColor:t="#2D3D6B",secondaryColor:n="#6B8CC7",accentColor:o="#FFFFFF",size:b=60}={}){let l=`
328
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
329
- <rect width="${b}" height="${b}" fill="${t}"/>
327
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Nb({primaryColor:t="#2D3D6B",secondaryColor:n="#6B8CC7",accentColor:b="#FFFFFF",size:o=60}={}){let l=`
328
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
329
+ <rect width="${o}" height="${o}" fill="${t}"/>
330
330
  <!-- Southern Cross / Tuareg Star -->
331
- <path d="M${b*0.5} 0 L${b*0.6} ${b*0.4} L${b} ${b*0.5} L${b*0.6} ${b*0.6} L${b*0.5} ${b} L${b*0.4} ${b*0.6} L0 ${b*0.5} L${b*0.4} ${b*0.4} Z"
332
- fill="none" stroke="${o}" stroke-width="2"/>
333
- <circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.1}" fill="${n}"/>
331
+ <path d="M${o*0.5} 0 L${o*0.6} ${o*0.4} L${o} ${o*0.5} L${o*0.6} ${o*0.6} L${o*0.5} ${o} L${o*0.4} ${o*0.6} L0 ${o*0.5} L${o*0.4} ${o*0.4} Z"
332
+ fill="none" stroke="${b}" stroke-width="2"/>
333
+ <circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${n}"/>
334
334
  </svg>
335
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function So({inkColor:t="#3A2E2C",parchmentColor:n="#F4E4BC",size:o=50}={}){let b=`
336
- <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
337
- <rect width="${o}" height="${o}" fill="${n}"/>
338
- <path d="M${o*0.2} ${o*0.2} L${o*0.4} ${o*0.2} M${o*0.3} ${o*0.2} L${o*0.3} ${o*0.5} Q${o*0.4} ${o*0.6} ${o*0.2} ${o*0.7}"
335
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Kb({inkColor:t="#3A2E2C",parchmentColor:n="#F4E4BC",size:b=50}={}){let o=`
336
+ <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
337
+ <rect width="${b}" height="${b}" fill="${n}"/>
338
+ <path d="M${b*0.2} ${b*0.2} L${b*0.4} ${b*0.2} M${b*0.3} ${b*0.2} L${b*0.3} ${b*0.5} Q${b*0.4} ${b*0.6} ${b*0.2} ${b*0.7}"
339
339
  fill="none" stroke="${t}" stroke-width="3" stroke-linecap="round"/>
340
- <path d="M${o*0.6} ${o*0.3} C${o*0.8} ${o*0.3} ${o*0.8} ${o*0.6} ${o*0.6} ${o*0.6} L${o*0.8} ${o*0.8}"
340
+ <path d="M${b*0.6} ${b*0.3} C${b*0.8} ${b*0.3} ${b*0.8} ${b*0.6} ${b*0.6} ${b*0.6} L${b*0.8} ${b*0.8}"
341
341
  fill="none" stroke="${t}" stroke-width="3" stroke-linecap="round"/>
342
342
  </svg>
343
- `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function Fo({clayColor:t="#4E342E",earthColor:n="#3E2723",accentColor:o="#BCAAA4",size:b=60}={}){let l=`
344
- <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
345
- <rect width="${b}" height="${b}" fill="${n}"/>
346
- <path d="M${b*0.2} ${b*0.5} Q${b*0.3} ${b*0.2} ${b*0.5} ${b*0.3} T${b*0.8} ${b*0.5} Q${b*0.7} ${b*0.8} ${b*0.5} ${b*0.7} T${b*0.2} ${b*0.5}"
347
- fill="${t}" stroke="${o}" stroke-width="2"/>
343
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function jb({clayColor:t="#4E342E",earthColor:n="#3E2723",accentColor:b="#BCAAA4",size:o=60}={}){let l=`
344
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
345
+ <rect width="${o}" height="${o}" fill="${n}"/>
346
+ <path d="M${o*0.2} ${o*0.5} Q${o*0.3} ${o*0.2} ${o*0.5} ${o*0.3} T${o*0.8} ${o*0.5} Q${o*0.7} ${o*0.8} ${o*0.5} ${o*0.7} T${o*0.2} ${o*0.5}"
347
+ fill="${t}" stroke="${b}" stroke-width="2"/>
348
348
  </svg>
349
- `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function M0({primaryColor:t="#334155",secondaryColor:n="#1e293b",size:o=100}={}){let b=`
350
- <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 100 100">
349
+ `;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Oo({primaryColor:t="#334155",secondaryColor:n="#1e293b",size:b=100}={}){let o=`
350
+ <svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 100 100">
351
351
  <rect width="100" height="100" fill="${n}"/>
352
352
  <path d="M10 10 H90 V90 H10 Z" fill="none" stroke="${t}" stroke-width="0.5" opacity="0.3"/>
353
353
  <path d="M20 20 V50 H50 V80 H80" fill="none" stroke="${t}" stroke-width="1"/>
@@ -355,20 +355,20 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
355
355
  <circle cx="80" cy="80" r="2" fill="${t}"/>
356
356
  <circle cx="50" cy="50" r="1.5" fill="${t}"/>
357
357
  </svg>
358
- `;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}var St;var Ft=Y(()=>{St={generatePolygon:Yo,generateShuka:On,generateHadzabe:Wn,generateKanga:xo,generateKangaBorder:En,generateKitenge:Un,generateMasaiShield:Go,generateTibeb:un,generateImigongo:dn,generateKente:Vn,generateAdinkra:Nn,generateAsoOke:jn,generateAnkara:Kn,generateBogolan:mn,generateAdire:Zn,generateKuba:pn,generateKubaBorder:Qo,generateBerber:yn,generateNdebele:In,generateNdebelePaint:Mo,generateZulu:Pn,generateZuluBeads:Jo,generateSwazi:Tn,generateXhosa:Cn,applyPattern:Lo,generateTuareg:ko,generateGeez:So,generateBoli:Fo,generateCircuit:M0,circuit:M0}});class zn{constructor(t){this.value=t,this.__type="RawHtml",Object.freeze(this)}toString(){return this.value}valueOf(){return this.value}}function Do(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function F0({title:t="AfriCode App",meta:n="",stylesheet:o="/styles/africanity.css",children:b}={}){return R`<!DOCTYPE html>
358
+ `;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}var Jt;var Gt=x(()=>{Jt={generatePolygon:Ob,generateShuka:pn,generateHadzabe:un,generateKanga:Wb,generateKangaBorder:Un,generateKitenge:Vn,generateMasaiShield:ub,generateTibeb:yn,generateImigongo:Cn,generateKente:Nn,generateAdinkra:Kn,generateAsoOke:jn,generateAnkara:In,generateBogolan:Pn,generateAdire:no,generateKuba:Tn,generateKubaBorder:mb,generateBerber:to,generateNdebele:en,generateNdebelePaint:Ub,generateZulu:Zn,generateZuluBeads:pb,generateSwazi:sn,generateXhosa:zn,applyPattern:Vb,generateTuareg:Nb,generateGeez:Kb,generateBoli:jb,generateCircuit:Oo,circuit:Oo}});class lo{constructor(t){this.value=t,this.__type="RawHtml",Object.freeze(this)}toString(){return this.value}valueOf(){return this.value}}function Tb(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function uo({title:t="AfriCode App",meta:n="",stylesheet:b="/styles/africanity.css",children:o}={}){return Q`<!DOCTYPE html>
359
359
  <html lang="en">
360
360
  <head>
361
361
  <meta charset="UTF-8">
362
362
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
363
363
  <title>${t}</title>
364
364
  ${n}
365
- ${o?R`<link rel="stylesheet" href="${o}">`:""}
365
+ ${b?Q`<link rel="stylesheet" href="${b}">`:""}
366
366
  <script type="module" src="/core/sdk.js"></script>
367
367
  </head>
368
368
  <body>
369
- ${b}
369
+ ${o}
370
370
  </body>
371
- </html>`}function B0(t){if(t instanceof zn)return t.toString();if(Array.isArray(t))return t.map(B0).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return Do(t)}var R=(t,...n)=>{let o="";for(let b=0;b<t.length;b++)if(o+=t[b],b<n.length)o+=B0(n[b]);return new zn(o)};var G,t0,v,p=(t)=>{switch(typeof t){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(t)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":if(Array.isArray(t))return v.array;if(t===null)return v.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return v.promise;if(typeof Map<"u"&&t instanceof Map)return v.map;if(typeof Set<"u"&&t instanceof Set)return v.set;if(typeof Date<"u"&&t instanceof Date)return v.date;return v.object;default:return v.unknown}};var Bt=Y(()=>{(function(t){t.assertEqual=(l)=>{};function n(l){}t.assertIs=n;function o(l){throw Error()}t.assertNever=o,t.arrayToEnum=(l)=>{let h={};for(let f of l)h[f]=f;return h},t.getValidEnumValues=(l)=>{let h=t.objectKeys(l).filter((a)=>typeof l[l[a]]!=="number"),f={};for(let a of h)f[a]=l[a];return t.objectValues(f)},t.objectValues=(l)=>{return t.objectKeys(l).map(function(h){return l[h]})},t.objectKeys=typeof Object.keys==="function"?(l)=>Object.keys(l):(l)=>{let h=[];for(let f in l)if(Object.prototype.hasOwnProperty.call(l,f))h.push(f);return h},t.find=(l,h)=>{for(let f of l)if(h(f))return f;return},t.isInteger=typeof Number.isInteger==="function"?(l)=>Number.isInteger(l):(l)=>typeof l==="number"&&Number.isFinite(l)&&Math.floor(l)===l;function b(l,h=" | "){return l.map((f)=>typeof f==="string"?`'${f}'`:f).join(h)}t.joinValues=b,t.jsonStringifyReplacer=(l,h)=>{if(typeof h==="bigint")return h.toString();return h}})(G||(G={}));(function(t){t.mergeShapes=(n,o)=>{return{...n,...o}}})(t0||(t0={}));v=G.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var $,Oo=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},E;var dt=Y(()=>{Bt();$=G.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);E=class E extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,n);else this.__proto__=n;this.name="ZodError",this.issues=t}format(t){let n=t||function(l){return l.message},o={_errors:[]},b=(l)=>{for(let h of l.issues)if(h.code==="invalid_union")h.unionErrors.map(b);else if(h.code==="invalid_return_type")b(h.returnTypeError);else if(h.code==="invalid_arguments")b(h.argumentsError);else if(h.path.length===0)o._errors.push(n(h));else{let f=o,a=0;while(a<h.path.length){let g=h.path[a];if(a!==h.path.length-1)f[g]=f[g]||{_errors:[]};else f[g]=f[g]||{_errors:[]},f[g]._errors.push(n(h));f=f[g],a++}}};return b(this),o}static assert(t){if(!(t instanceof E))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,G.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let b of this.issues)if(b.path.length>0){let l=b.path[0];n[l]=n[l]||[],n[l].push(t(b))}else o.push(t(b));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};E.create=(t)=>{return new E(t)}});var Wo=(t,n)=>{let o;switch(t.code){case $.invalid_type:if(t.received===v.undefined)o="Required";else o=`Expected ${t.expected}, received ${t.received}`;break;case $.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(t.expected,G.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:o=`Unrecognized key(s) in object: ${G.joinValues(t.keys,", ")}`;break;case $.invalid_union:o="Invalid input";break;case $.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${G.joinValues(t.options)}`;break;case $.invalid_enum_value:o=`Invalid enum value. Expected ${G.joinValues(t.options)}, received '${t.received}'`;break;case $.invalid_arguments:o="Invalid function arguments";break;case $.invalid_return_type:o="Invalid function return type";break;case $.invalid_date:o="Invalid date";break;case $.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(o=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)o=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)o=`Invalid input: must end with "${t.validation.endsWith}"`;else G.assertNever(t.validation);else if(t.validation!=="regex")o=`Invalid ${t.validation}`;else o="Invalid";break;case $.too_small:if(t.type==="array")o=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")o=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")o=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else o="Invalid input";break;case $.too_big:if(t.type==="array")o=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")o=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")o=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")o=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")o=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else o="Invalid input";break;case $.custom:o="Invalid input";break;case $.invalid_intersection_types:o="Intersection results could not be merged";break;case $.not_multiple_of:o=`Number must be a multiple of ${t.multipleOf}`;break;case $.not_finite:o="Number must be finite";break;default:o=n.defaultError,G.assertNever(t)}return{message:o}},T;var n0=Y(()=>{dt();Bt();T=Wo});function Eo(t){R0=t}function wt(){return R0}var R0;var ut=Y(()=>{n0();R0=T});function _(t,n){let o=wt(),b=Rt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o===T?void 0:T].filter((l)=>!!l)});t.common.issues.push(b)}class B{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,n){let o=[];for(let b of n){if(b.status==="aborted")return H;if(b.status==="dirty")t.dirty();o.push(b.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let b of n){let l=await b.key,h=await b.value;o.push({key:l,value:h})}return B.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let b of n){let{key:l,value:h}=b;if(l.status==="aborted")return H;if(h.status==="aborted")return H;if(l.status==="dirty")t.dirty();if(h.status==="dirty")t.dirty();if(l.value!=="__proto__"&&(typeof h.value<"u"||b.alwaysSet))o[l.value]=h.value}return{status:t.value,value:o}}}var Rt=(t)=>{let{data:n,path:o,errorMaps:b,issueData:l}=t,h=[...o,...l.path||[]],f={...l,path:h};if(l.message!==void 0)return{...l,path:h,message:l.message};let a="",g=b.filter((c)=>!!c).slice().reverse();for(let c of g)a=c(f,{data:n,defaultError:a}).message;return{...l,path:h,message:a}},Uo,H,lt=(t)=>({status:"dirty",value:t}),D=(t)=>({status:"valid",value:t}),It=(t)=>t.status==="aborted",Pt=(t)=>t.status==="dirty",Z=(t)=>t.status==="valid",_t=(t)=>typeof Promise<"u"&&t instanceof Promise;var b0=Y(()=>{ut();n0();Uo=[];H=Object.freeze({status:"aborted"})});var D0=()=>{};var q;var O0=Y(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(q||(q={}))});class j{constructor(t,n,o,b){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=b}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function x(t){if(!t)return{};let{errorMap:n,invalid_type_error:o,required_error:b,description:l}=t;if(n&&(o||b))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:l};return{errorMap:(f,a)=>{let{message:g}=t;if(f.code==="invalid_enum_value")return{message:g??a.defaultError};if(typeof a.data>"u")return{message:g??b??a.defaultError};if(f.code!=="invalid_type")return{message:a.defaultError};return{message:g??o??a.defaultError}},description:l}}class Q{get description(){return this._def.description}_getType(t){return p(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:p(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new B,ctx:{common:t.parent.common,data:t.data,parsedType:p(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(_t(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:p(t)},b=this._parseSync({data:t,path:o.path,parent:o});return W0(o,b)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:p(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return Z(o)?{value:o.value}:{issues:n.common.issues}}catch(o){if(o?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((o)=>Z(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:p(t)},b=this._parse({data:t,path:o.path,parent:o}),l=await(_t(b)?b:Promise.resolve(b));return W0(o,l)}refine(t,n){let o=(b)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(b);else return n};return this._refinement((b,l)=>{let h=t(b),f=()=>l.addIssue({code:$.custom,...o(b)});if(typeof Promise<"u"&&h instanceof Promise)return h.then((a)=>{if(!a)return f(),!1;else return!0});if(!h)return f(),!1;else return!0})}refinement(t,n){return this._refinement((o,b)=>{if(!t(o))return b.addIssue(typeof n==="function"?n(o,b):n),!1;else return!0})}_refinement(t){return new K({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(n)=>this["~validate"](n)}}optional(){return N.create(this,this._def)}nullable(){return C.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return gt.create(this,this._def)}or(t){return Xt.create([this,t],this._def)}and(t){return Yt.create(this,t,this._def)}transform(t){return new K({...x(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new Gt({...x(this._def),innerType:this,defaultValue:n,typeName:X.ZodDefault})}brand(){return new it({typeName:X.ZodBranded,type:this,...x(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new Mt({...x(this._def),innerType:this,catchValue:n,typeName:X.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Vt.create(this,t)}readonly(){return Lt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function V0(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let o=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${o}`}function zo(t){return new RegExp(`^${V0(t)}$`)}function N0(t){let n=`${U0}T${V0(t)}`,o=[];if(o.push(t.local?"Z?":"Z"),t.offset)o.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${o.join("|")})`,new RegExp(`^${n}$`)}function tl(t,n){if((n==="v4"||!n)&&To.test(t))return!0;if((n==="v6"||!n)&&Co.test(t))return!0;return!1}function nl(t,n){if(!po.test(t))return!1;try{let[o]=t.split(".");if(!o)return!1;let b=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),l=JSON.parse(atob(b));if(typeof l!=="object"||l===null)return!1;if("typ"in l&&l?.typ!=="JWT")return!1;if(!l.alg)return!1;if(n&&l.alg!==n)return!1;return!0}catch{return!1}}function bl(t,n){if((n==="v4"||!n)&&io.test(t))return!0;if((n==="v6"||!n)&&yo.test(t))return!0;return!1}function ol(t,n){let o=(t.toString().split(".")[1]||"").length,b=(n.toString().split(".")[1]||"").length,l=o>b?o:b,h=Number.parseInt(t.toFixed(l).replace(".","")),f=Number.parseInt(n.toFixed(l).replace(".",""));return h%f/10**l}function rt(t){if(t instanceof k){let n={};for(let o in t.shape){let b=t.shape[o];n[o]=N.create(rt(b))}return new k({...t._def,shape:()=>n})}else if(t instanceof V)return new V({...t._def,type:rt(t.element)});else if(t instanceof N)return N.create(rt(t.unwrap()));else if(t instanceof C)return C.create(rt(t.unwrap()));else if(t instanceof u)return u.create(t.items.map((n)=>rt(n)));else return t}function l0(t,n){let o=p(t),b=p(n);if(t===n)return{valid:!0,data:t};else if(o===v.object&&b===v.object){let l=G.objectKeys(n),h=G.objectKeys(t).filter((a)=>l.indexOf(a)!==-1),f={...t,...n};for(let a of h){let g=l0(t[a],n[a]);if(!g.valid)return{valid:!1};f[a]=g.data}return{valid:!0,data:f}}else if(o===v.array&&b===v.array){if(t.length!==n.length)return{valid:!1};let l=[];for(let h=0;h<t.length;h++){let f=t[h],a=n[h],g=l0(f,a);if(!g.valid)return{valid:!1};l.push(g.data)}return{valid:!0,data:l}}else if(o===v.date&&b===v.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function j0(t,n){return new tt({values:t,typeName:X.ZodEnum,...x(n)})}function E0(t,n){let o=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof o==="string"?{message:o}:o}function K0(t,n={},o){if(t)return ft.create().superRefine((b,l)=>{let h=t(b);if(h instanceof Promise)return h.then((f)=>{if(!f){let a=E0(n,b),g=a.fatal??o??!0;l.addIssue({code:"custom",...a,fatal:g})}});if(!h){let f=E0(n,b),a=f.fatal??o??!0;l.addIssue({code:"custom",...f,fatal:a})}return});return ft.create()}var W0=(t,n)=>{if(Z(n))return{success:!0,data:n.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new E(t.common.issues);return this._error=o,this._error}}}},Vo,No,jo,Ko,mo,po,uo,Io,Po="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",o0,To,io,Co,yo,Zo,eo,U0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",so,U,s,z,At,ht,Dt,qt,Ht,ft,e,d,Ot,V,k,Xt,i=(t)=>{if(t instanceof xt)return i(t.schema);else if(t instanceof K)return i(t.innerType());else if(t instanceof Qt)return[t.value];else if(t instanceof tt)return t.options;else if(t instanceof Jt)return G.objectValues(t.enum);else if(t instanceof Gt)return i(t._def.innerType);else if(t instanceof qt)return[void 0];else if(t instanceof Ht)return[null];else if(t instanceof N)return[void 0,...i(t.unwrap())];else if(t instanceof C)return[null,...i(t.unwrap())];else if(t instanceof it)return i(t.unwrap());else if(t instanceof Lt)return i(t.unwrap());else if(t instanceof Mt)return i(t._def.innerType);else return[]},Tt,Yt,u,Wt,Et,at,ct,xt,Qt,tt,Jt,gt,K,N,C,Gt,Mt,Ut,ll,it,Vt,Lt,hl,X,fl=(t,n={message:`Input not instance of ${t.name}`})=>K0((o)=>o instanceof t,n),m0,p0,al,gl,d0,$l,vl,wl,_l,rl,cl,Al,ql,Hl,Xl,Yl,xl,Ql,Jl,Gl,Ml,Ll,kl,Sl,Fl,Bl,Rl,Dl,Ol,Wl,El,Ul,Vl,Nl,jl=()=>m0().optional(),Kl=()=>p0().optional(),ml=()=>d0().optional(),pl,dl;var u0=Y(()=>{dt();ut();O0();b0();Bt();Vo=/^c[^\s-]{8,}$/i,No=/^[0-9a-z]+$/,jo=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ko=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,mo=/^[a-z0-9_-]{21}$/i,po=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,uo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Io=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,To=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,io=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Co=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zo=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,so=new RegExp(`^${U0}$`);U=class U extends Q{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==v.string){let l=this._getOrReturnCtx(t);return _(l,{code:$.invalid_type,expected:v.string,received:l.parsedType}),H}let o=new B,b=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.length<l.value)b=this._getOrReturnCtx(t,b),_(b,{code:$.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="max"){if(t.data.length>l.value)b=this._getOrReturnCtx(t,b),_(b,{code:$.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="length"){let h=t.data.length>l.value,f=t.data.length<l.value;if(h||f){if(b=this._getOrReturnCtx(t,b),h)_(b,{code:$.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});else if(f)_(b,{code:$.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});o.dirty()}}else if(l.kind==="email"){if(!Io.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"email",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="emoji"){if(!o0)o0=new RegExp(Po,"u");if(!o0.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"emoji",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="uuid"){if(!Ko.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"uuid",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="nanoid"){if(!mo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"nanoid",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid"){if(!Vo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"cuid",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid2"){if(!No.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"cuid2",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ulid"){if(!jo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"ulid",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="url")try{new URL(t.data)}catch{b=this._getOrReturnCtx(t,b),_(b,{validation:"url",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="regex"){if(l.regex.lastIndex=0,!l.regex.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"regex",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="trim")t.data=t.data.trim();else if(l.kind==="includes"){if(!t.data.includes(l.value,l.position))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()}else if(l.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(l.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(l.kind==="startsWith"){if(!t.data.startsWith(l.value))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="endsWith"){if(!t.data.endsWith(l.value))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="datetime"){if(!N0(l).test(t.data))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:"datetime",message:l.message}),o.dirty()}else if(l.kind==="date"){if(!so.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:"date",message:l.message}),o.dirty()}else if(l.kind==="time"){if(!zo(l).test(t.data))b=this._getOrReturnCtx(t,b),_(b,{code:$.invalid_string,validation:"time",message:l.message}),o.dirty()}else if(l.kind==="duration"){if(!uo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"duration",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ip"){if(!tl(t.data,l.version))b=this._getOrReturnCtx(t,b),_(b,{validation:"ip",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="jwt"){if(!nl(t.data,l.alg))b=this._getOrReturnCtx(t,b),_(b,{validation:"jwt",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cidr"){if(!bl(t.data,l.version))b=this._getOrReturnCtx(t,b),_(b,{validation:"cidr",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64"){if(!Zo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"base64",code:$.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64url"){if(!eo.test(t.data))b=this._getOrReturnCtx(t,b),_(b,{validation:"base64url",code:$.invalid_string,message:l.message}),o.dirty()}else G.assertNever(l);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement((b)=>t.test(b),{validation:n,code:$.invalid_string,...q.errToObj(o)})}_addCheck(t){return new U({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...q.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...q.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...q.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...q.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...q.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...q.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...q.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...q.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...q.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...q.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...q.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...q.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...q.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...q.errToObj(n)})}nonempty(t){return this.min(1,q.errToObj(t))}trim(){return new U({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new U({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxLength(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};U.create=(t)=>{return new U({checks:[],typeName:X.ZodString,coerce:t?.coerce??!1,...x(t)})};s=class s extends Q{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==v.number){let l=this._getOrReturnCtx(t);return _(l,{code:$.invalid_type,expected:v.number,received:l.parsedType}),H}let o=void 0,b=new B;for(let l of this._def.checks)if(l.kind==="int"){if(!G.isInteger(t.data))o=this._getOrReturnCtx(t,o),_(o,{code:$.invalid_type,expected:"integer",received:"float",message:l.message}),b.dirty()}else if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)o=this._getOrReturnCtx(t,o),_(o,{code:$.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)o=this._getOrReturnCtx(t,o),_(o,{code:$.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(ol(t.data,l.value)!==0)o=this._getOrReturnCtx(t,o),_(o,{code:$.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else if(l.kind==="finite"){if(!Number.isFinite(t.data))o=this._getOrReturnCtx(t,o),_(o,{code:$.not_finite,message:l.message}),b.dirty()}else G.assertNever(l);return{status:b.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,q.toString(n))}setLimit(t,n,o,b){return new s({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new s({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&G.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(n===null||o.value>n)n=o.value}else if(o.kind==="max"){if(t===null||o.value<t)t=o.value}return Number.isFinite(n)&&Number.isFinite(t)}};s.create=(t)=>{return new s({checks:[],typeName:X.ZodNumber,coerce:t?.coerce||!1,...x(t)})};z=class z extends Q{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==v.bigint)return this._getInvalidInput(t);let o=void 0,b=new B;for(let l of this._def.checks)if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)o=this._getOrReturnCtx(t,o),_(o,{code:$.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),b.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)o=this._getOrReturnCtx(t,o),_(o,{code:$.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(t.data%l.value!==BigInt(0))o=this._getOrReturnCtx(t,o),_(o,{code:$.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else G.assertNever(l);return{status:b.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return _(n,{code:$.invalid_type,expected:v.bigint,received:n.parsedType}),H}gte(t,n){return this.setLimit("min",t,!0,q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,q.toString(n))}setLimit(t,n,o,b){return new z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new z({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};z.create=(t)=>{return new z({checks:[],typeName:X.ZodBigInt,coerce:t?.coerce??!1,...x(t)})};At=class At extends Q{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==v.boolean){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.boolean,received:o.parsedType}),H}return D(t.data)}};At.create=(t)=>{return new At({typeName:X.ZodBoolean,coerce:t?.coerce||!1,...x(t)})};ht=class ht extends Q{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==v.date){let l=this._getOrReturnCtx(t);return _(l,{code:$.invalid_type,expected:v.date,received:l.parsedType}),H}if(Number.isNaN(t.data.getTime())){let l=this._getOrReturnCtx(t);return _(l,{code:$.invalid_date}),H}let o=new B,b=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.getTime()<l.value)b=this._getOrReturnCtx(t,b),_(b,{code:$.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()}else if(l.kind==="max"){if(t.data.getTime()>l.value)b=this._getOrReturnCtx(t,b),_(b,{code:$.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()}else G.assertNever(l);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ht({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:q.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:q.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t!=null?new Date(t):null}};ht.create=(t)=>{return new ht({checks:[],coerce:t?.coerce||!1,typeName:X.ZodDate,...x(t)})};Dt=class Dt extends Q{_parse(t){if(this._getType(t)!==v.symbol){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.symbol,received:o.parsedType}),H}return D(t.data)}};Dt.create=(t)=>{return new Dt({typeName:X.ZodSymbol,...x(t)})};qt=class qt extends Q{_parse(t){if(this._getType(t)!==v.undefined){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.undefined,received:o.parsedType}),H}return D(t.data)}};qt.create=(t)=>{return new qt({typeName:X.ZodUndefined,...x(t)})};Ht=class Ht extends Q{_parse(t){if(this._getType(t)!==v.null){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.null,received:o.parsedType}),H}return D(t.data)}};Ht.create=(t)=>{return new Ht({typeName:X.ZodNull,...x(t)})};ft=class ft extends Q{constructor(){super(...arguments);this._any=!0}_parse(t){return D(t.data)}};ft.create=(t)=>{return new ft({typeName:X.ZodAny,...x(t)})};e=class e extends Q{constructor(){super(...arguments);this._unknown=!0}_parse(t){return D(t.data)}};e.create=(t)=>{return new e({typeName:X.ZodUnknown,...x(t)})};d=class d extends Q{_parse(t){let n=this._getOrReturnCtx(t);return _(n,{code:$.invalid_type,expected:v.never,received:n.parsedType}),H}};d.create=(t)=>{return new d({typeName:X.ZodNever,...x(t)})};Ot=class Ot extends Q{_parse(t){if(this._getType(t)!==v.undefined){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.void,received:o.parsedType}),H}return D(t.data)}};Ot.create=(t)=>{return new Ot({typeName:X.ZodVoid,...x(t)})};V=class V extends Q{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),b=this._def;if(n.parsedType!==v.array)return _(n,{code:$.invalid_type,expected:v.array,received:n.parsedType}),H;if(b.exactLength!==null){let h=n.data.length>b.exactLength.value,f=n.data.length<b.exactLength.value;if(h||f)_(n,{code:h?$.too_big:$.too_small,minimum:f?b.exactLength.value:void 0,maximum:h?b.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:b.exactLength.message}),o.dirty()}if(b.minLength!==null){if(n.data.length<b.minLength.value)_(n,{code:$.too_small,minimum:b.minLength.value,type:"array",inclusive:!0,exact:!1,message:b.minLength.message}),o.dirty()}if(b.maxLength!==null){if(n.data.length>b.maxLength.value)_(n,{code:$.too_big,maximum:b.maxLength.value,type:"array",inclusive:!0,exact:!1,message:b.maxLength.message}),o.dirty()}if(n.common.async)return Promise.all([...n.data].map((h,f)=>{return b.type._parseAsync(new j(n,h,n.path,f))})).then((h)=>{return B.mergeArray(o,h)});let l=[...n.data].map((h,f)=>{return b.type._parseSync(new j(n,h,n.path,f))});return B.mergeArray(o,l)}get element(){return this._def.type}min(t,n){return new V({...this._def,minLength:{value:t,message:q.toString(n)}})}max(t,n){return new V({...this._def,maxLength:{value:t,message:q.toString(n)}})}length(t,n){return new V({...this._def,exactLength:{value:t,message:q.toString(n)}})}nonempty(t){return this.min(1,t)}};V.create=(t,n)=>{return new V({type:t,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...x(n)})};k=class k extends Q{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=G.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==v.object){let g=this._getOrReturnCtx(t);return _(g,{code:$.invalid_type,expected:v.object,received:g.parsedType}),H}let{status:o,ctx:b}=this._processInputParams(t),{shape:l,keys:h}=this._getCached(),f=[];if(!(this._def.catchall instanceof d&&this._def.unknownKeys==="strip")){for(let g in b.data)if(!h.includes(g))f.push(g)}let a=[];for(let g of h){let c=l[g],J=b.data[g];a.push({key:{status:"valid",value:g},value:c._parse(new j(b,J,b.path,g)),alwaysSet:g in b.data})}if(this._def.catchall instanceof d){let g=this._def.unknownKeys;if(g==="passthrough")for(let c of f)a.push({key:{status:"valid",value:c},value:{status:"valid",value:b.data[c]}});else if(g==="strict"){if(f.length>0)_(b,{code:$.unrecognized_keys,keys:f}),o.dirty()}else if(g==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let c of f){let J=b.data[c];a.push({key:{status:"valid",value:c},value:g._parse(new j(b,J,b.path,c)),alwaysSet:c in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let g=[];for(let c of a){let J=await c.key,F=await c.value;g.push({key:J,value:F,alwaysSet:c.alwaysSet})}return g}).then((g)=>{return B.mergeObjectSync(o,g)});else return B.mergeObjectSync(o,a)}get shape(){return this._def.shape()}strict(t){return q.errToObj,new k({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let b=this._def.errorMap?.(n,o).message??o.defaultError;if(n.code==="unrecognized_keys")return{message:q.errToObj(t).message??b};return{message:b}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(t){return new k({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new k({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:X.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new k({...this._def,catchall:t})}pick(t){let n={};for(let o of G.objectKeys(t))if(t[o]&&this.shape[o])n[o]=this.shape[o];return new k({...this._def,shape:()=>n})}omit(t){let n={};for(let o of G.objectKeys(this.shape))if(!t[o])n[o]=this.shape[o];return new k({...this._def,shape:()=>n})}deepPartial(){return rt(this)}partial(t){let n={};for(let o of G.objectKeys(this.shape)){let b=this.shape[o];if(t&&!t[o])n[o]=b;else n[o]=b.optional()}return new k({...this._def,shape:()=>n})}required(t){let n={};for(let o of G.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let l=this.shape[o];while(l instanceof N)l=l._def.innerType;n[o]=l}return new k({...this._def,shape:()=>n})}keyof(){return j0(G.objectKeys(this.shape))}};k.create=(t,n)=>{return new k({shape:()=>t,unknownKeys:"strip",catchall:d.create(),typeName:X.ZodObject,...x(n)})};k.strictCreate=(t,n)=>{return new k({shape:()=>t,unknownKeys:"strict",catchall:d.create(),typeName:X.ZodObject,...x(n)})};k.lazycreate=(t,n)=>{return new k({shape:t,unknownKeys:"strip",catchall:d.create(),typeName:X.ZodObject,...x(n)})};Xt=class Xt extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function b(l){for(let f of l)if(f.result.status==="valid")return f.result;for(let f of l)if(f.result.status==="dirty")return n.common.issues.push(...f.ctx.common.issues),f.result;let h=l.map((f)=>new E(f.ctx.common.issues));return _(n,{code:$.invalid_union,unionErrors:h}),H}if(n.common.async)return Promise.all(o.map(async(l)=>{let h={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:h}),ctx:h}})).then(b);else{let l=void 0,h=[];for(let a of o){let g={...n,common:{...n.common,issues:[]},parent:null},c=a._parseSync({data:n.data,path:n.path,parent:g});if(c.status==="valid")return c;else if(c.status==="dirty"&&!l)l={result:c,ctx:g};if(g.common.issues.length)h.push(g.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;let f=h.map((a)=>new E(a));return _(n,{code:$.invalid_union,unionErrors:f}),H}}get options(){return this._def.options}};Xt.create=(t,n)=>{return new Xt({options:t,typeName:X.ZodUnion,...x(n)})};Tt=class Tt extends Q{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==v.object)return _(n,{code:$.invalid_type,expected:v.object,received:n.parsedType}),H;let o=this.discriminator,b=n.data[o],l=this.optionsMap.get(b);if(!l)return _(n,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),H;if(n.common.async)return l._parseAsync({data:n.data,path:n.path,parent:n});else return l._parseSync({data:n.data,path:n.path,parent:n})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let b=new Map;for(let l of n){let h=i(l.shape[t]);if(!h.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of h){if(b.has(f))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);b.set(f,l)}}return new Tt({typeName:X.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:b,...x(o)})}};Yt=class Yt extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=(l,h)=>{if(It(l)||It(h))return H;let f=l0(l.value,h.value);if(!f.valid)return _(o,{code:$.invalid_intersection_types}),H;if(Pt(l)||Pt(h))n.dirty();return{status:n.value,value:f.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,h])=>b(l,h));else return b(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};Yt.create=(t,n,o)=>{return new Yt({left:t,right:n,typeName:X.ZodIntersection,...x(o)})};u=class u extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==v.array)return _(o,{code:$.invalid_type,expected:v.array,received:o.parsedType}),H;if(o.data.length<this._def.items.length)return _(o,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),H;if(!this._def.rest&&o.data.length>this._def.items.length)_(o,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let l=[...o.data].map((h,f)=>{let a=this._def.items[f]||this._def.rest;if(!a)return null;return a._parse(new j(o,h,o.path,f))}).filter((h)=>!!h);if(o.common.async)return Promise.all(l).then((h)=>{return B.mergeArray(n,h)});else return B.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new u({...this._def,rest:t})}};u.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new u({items:t,typeName:X.ZodTuple,rest:null,...x(n)})};Wt=class Wt extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==v.object)return _(o,{code:$.invalid_type,expected:v.object,received:o.parsedType}),H;let b=[],l=this._def.keyType,h=this._def.valueType;for(let f in o.data)b.push({key:l._parse(new j(o,f,o.path,f)),value:h._parse(new j(o,o.data[f],o.path,f)),alwaysSet:f in o.data});if(o.common.async)return B.mergeObjectAsync(n,b);else return B.mergeObjectSync(n,b)}get element(){return this._def.valueType}static create(t,n,o){if(n instanceof Q)return new Wt({keyType:t,valueType:n,typeName:X.ZodRecord,...x(o)});return new Wt({keyType:U.create(),valueType:t,typeName:X.ZodRecord,...x(n)})}};Et=class Et extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==v.map)return _(o,{code:$.invalid_type,expected:v.map,received:o.parsedType}),H;let b=this._def.keyType,l=this._def.valueType,h=[...o.data.entries()].map(([f,a],g)=>{return{key:b._parse(new j(o,f,o.path,[g,"key"])),value:l._parse(new j(o,a,o.path,[g,"value"]))}});if(o.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let a of h){let g=await a.key,c=await a.value;if(g.status==="aborted"||c.status==="aborted")return H;if(g.status==="dirty"||c.status==="dirty")n.dirty();f.set(g.value,c.value)}return{status:n.value,value:f}})}else{let f=new Map;for(let a of h){let{key:g,value:c}=a;if(g.status==="aborted"||c.status==="aborted")return H;if(g.status==="dirty"||c.status==="dirty")n.dirty();f.set(g.value,c.value)}return{status:n.value,value:f}}}};Et.create=(t,n,o)=>{return new Et({valueType:n,keyType:t,typeName:X.ZodMap,...x(o)})};at=class at extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==v.set)return _(o,{code:$.invalid_type,expected:v.set,received:o.parsedType}),H;let b=this._def;if(b.minSize!==null){if(o.data.size<b.minSize.value)_(o,{code:$.too_small,minimum:b.minSize.value,type:"set",inclusive:!0,exact:!1,message:b.minSize.message}),n.dirty()}if(b.maxSize!==null){if(o.data.size>b.maxSize.value)_(o,{code:$.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),n.dirty()}let l=this._def.valueType;function h(a){let g=new Set;for(let c of a){if(c.status==="aborted")return H;if(c.status==="dirty")n.dirty();g.add(c.value)}return{status:n.value,value:g}}let f=[...o.data.values()].map((a,g)=>l._parse(new j(o,a,o.path,g)));if(o.common.async)return Promise.all(f).then((a)=>h(a));else return h(f)}min(t,n){return new at({...this._def,minSize:{value:t,message:q.toString(n)}})}max(t,n){return new at({...this._def,maxSize:{value:t,message:q.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};at.create=(t,n)=>{return new at({valueType:t,minSize:null,maxSize:null,typeName:X.ZodSet,...x(n)})};ct=class ct extends Q{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==v.function)return _(n,{code:$.invalid_type,expected:v.function,received:n.parsedType}),H;function o(f,a){return Rt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wt(),T].filter((g)=>!!g),issueData:{code:$.invalid_arguments,argumentsError:a}})}function b(f,a){return Rt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wt(),T].filter((g)=>!!g),issueData:{code:$.invalid_return_type,returnTypeError:a}})}let l={errorMap:n.common.contextualErrorMap},h=n.data;if(this._def.returns instanceof gt){let f=this;return D(async function(...a){let g=new E([]),c=await f._def.args.parseAsync(a,l).catch((S)=>{throw g.addIssue(o(a,S)),g}),J=await Reflect.apply(h,this,c);return await f._def.returns._def.type.parseAsync(J,l).catch((S)=>{throw g.addIssue(b(J,S)),g})})}else{let f=this;return D(function(...a){let g=f._def.args.safeParse(a,l);if(!g.success)throw new E([o(a,g.error)]);let c=Reflect.apply(h,this,g.data),J=f._def.returns.safeParse(c,l);if(!J.success)throw new E([b(c,J.error)]);return J.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ct({...this._def,args:u.create(t).rest(e.create())})}returns(t){return new ct({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new ct({args:t?t:u.create([]).rest(e.create()),returns:n||e.create(),typeName:X.ZodFunction,...x(o)})}};xt=class xt extends Q{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};xt.create=(t,n)=>{return new xt({getter:t,typeName:X.ZodLazy,...x(n)})};Qt=class Qt extends Q{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return _(n,{received:n.data,code:$.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:t.data}}get value(){return this._def.value}};Qt.create=(t,n)=>{return new Qt({value:t,typeName:X.ZodLiteral,...x(n)})};tt=class tt extends Q{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return _(n,{expected:G.joinValues(o),received:n.parsedType,code:$.invalid_type}),H}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return _(n,{received:n.data,code:$.invalid_enum_value,options:o}),H}return D(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return tt.create(t,{...this._def,...n})}exclude(t,n=this._def){return tt.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};tt.create=j0;Jt=class Jt extends Q{_parse(t){let n=G.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==v.string&&o.parsedType!==v.number){let b=G.objectValues(n);return _(o,{expected:G.joinValues(b),received:o.parsedType,code:$.invalid_type}),H}if(!this._cache)this._cache=new Set(G.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let b=G.objectValues(n);return _(o,{received:o.data,code:$.invalid_enum_value,options:b}),H}return D(t.data)}get enum(){return this._def.values}};Jt.create=(t,n)=>{return new Jt({values:t,typeName:X.ZodNativeEnum,...x(n)})};gt=class gt extends Q{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==v.promise&&n.common.async===!1)return _(n,{code:$.invalid_type,expected:v.promise,received:n.parsedType}),H;let o=n.parsedType===v.promise?n.data:Promise.resolve(n.data);return D(o.then((b)=>{return this._def.type.parseAsync(b,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};gt.create=(t,n)=>{return new gt({type:t,typeName:X.ZodPromise,...x(n)})};K=class K extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=this._def.effect||null,l={addIssue:(h)=>{if(_(o,h),h.fatal)n.abort();else n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),b.type==="preprocess"){let h=b.transform(o.data,l);if(o.common.async)return Promise.resolve(h).then(async(f)=>{if(n.value==="aborted")return H;let a=await this._def.schema._parseAsync({data:f,path:o.path,parent:o});if(a.status==="aborted")return H;if(a.status==="dirty")return lt(a.value);if(n.value==="dirty")return lt(a.value);return a});else{if(n.value==="aborted")return H;let f=this._def.schema._parseSync({data:h,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")return lt(f.value);if(n.value==="dirty")return lt(f.value);return f}}if(b.type==="refinement"){let h=(f)=>{let a=b.refinement(f,l);if(o.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(o.common.async===!1){let f=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")n.dirty();return h(f.value),{status:n.value,value:f.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((f)=>{if(f.status==="aborted")return H;if(f.status==="dirty")n.dirty();return h(f.value).then(()=>{return{status:n.value,value:f.value}})})}if(b.type==="transform")if(o.common.async===!1){let h=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Z(h))return H;let f=b.transform(h.value,l);if(f instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((h)=>{if(!Z(h))return H;return Promise.resolve(b.transform(h.value,l)).then((f)=>({status:n.value,value:f}))});G.assertNever(b)}};K.create=(t,n,o)=>{return new K({schema:t,typeName:X.ZodEffects,effect:n,...x(o)})};K.createWithPreprocess=(t,n,o)=>{return new K({schema:n,effect:{type:"preprocess",transform:t},typeName:X.ZodEffects,...x(o)})};N=class N extends Q{_parse(t){if(this._getType(t)===v.undefined)return D(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};N.create=(t,n)=>{return new N({innerType:t,typeName:X.ZodOptional,...x(n)})};C=class C extends Q{_parse(t){if(this._getType(t)===v.null)return D(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};C.create=(t,n)=>{return new C({innerType:t,typeName:X.ZodNullable,...x(n)})};Gt=class Gt extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;if(n.parsedType===v.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Gt.create=(t,n)=>{return new Gt({innerType:t,typeName:X.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...x(n)})};Mt=class Mt extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},b=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(_t(b))return b.then((l)=>{return{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new E(o.common.issues)},input:o.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new E(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Mt.create=(t,n)=>{return new Mt({innerType:t,typeName:X.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...x(n)})};Ut=class Ut extends Q{_parse(t){if(this._getType(t)!==v.nan){let o=this._getOrReturnCtx(t);return _(o,{code:$.invalid_type,expected:v.nan,received:o.parsedType}),H}return{status:"valid",value:t.data}}};Ut.create=(t)=>{return new Ut({typeName:X.ZodNaN,...x(t)})};ll=Symbol("zod_brand");it=class it extends Q{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}};Vt=class Vt extends Q{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(l.status==="aborted")return H;if(l.status==="dirty")return n.dirty(),lt(l.value);else return this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();else{let b=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(b.status==="aborted")return H;if(b.status==="dirty")return n.dirty(),{status:"dirty",value:b.value};else return this._def.out._parseSync({data:b.value,path:o.path,parent:o})}}static create(t,n){return new Vt({in:t,out:n,typeName:X.ZodPipeline})}};Lt=class Lt extends Q{_parse(t){let n=this._def.innerType._parse(t),o=(b)=>{if(Z(b))b.value=Object.freeze(b.value);return b};return _t(n)?n.then((b)=>o(b)):o(n)}unwrap(){return this._def.innerType}};Lt.create=(t,n)=>{return new Lt({innerType:t,typeName:X.ZodReadonly,...x(n)})};hl={object:k.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(X||(X={}));m0=U.create,p0=s.create,al=Ut.create,gl=z.create,d0=At.create,$l=ht.create,vl=Dt.create,wl=qt.create,_l=Ht.create,rl=ft.create,cl=e.create,Al=d.create,ql=Ot.create,Hl=V.create,Xl=k.create,Yl=k.strictCreate,xl=Xt.create,Ql=Tt.create,Jl=Yt.create,Gl=u.create,Ml=Wt.create,Ll=Et.create,kl=at.create,Sl=ct.create,Fl=xt.create,Bl=Qt.create,Rl=tt.create,Dl=Jt.create,Ol=gt.create,Wl=K.create,El=N.create,Ul=C.create,Vl=K.createWithPreprocess,Nl=Vt.create,pl={string:(t)=>U.create({...t,coerce:!0}),number:(t)=>s.create({...t,coerce:!0}),boolean:(t)=>At.create({...t,coerce:!0}),bigint:(t)=>z.create({...t,coerce:!0}),date:(t)=>ht.create({...t,coerce:!0})},dl=H});var w={};L(w,{void:()=>ql,util:()=>G,unknown:()=>cl,union:()=>xl,undefined:()=>wl,tuple:()=>Gl,transformer:()=>Wl,symbol:()=>vl,string:()=>m0,strictObject:()=>Yl,setErrorMap:()=>Eo,set:()=>kl,record:()=>Ml,quotelessJson:()=>Oo,promise:()=>Ol,preprocess:()=>Vl,pipeline:()=>Nl,ostring:()=>jl,optional:()=>El,onumber:()=>Kl,oboolean:()=>ml,objectUtil:()=>t0,object:()=>Xl,number:()=>p0,nullable:()=>Ul,null:()=>_l,never:()=>Al,nativeEnum:()=>Dl,nan:()=>al,map:()=>Ll,makeIssue:()=>Rt,literal:()=>Bl,lazy:()=>Fl,late:()=>hl,isValid:()=>Z,isDirty:()=>Pt,isAsync:()=>_t,isAborted:()=>It,intersection:()=>Jl,instanceof:()=>fl,getParsedType:()=>p,getErrorMap:()=>wt,function:()=>Sl,enum:()=>Rl,effect:()=>Wl,discriminatedUnion:()=>Ql,defaultErrorMap:()=>T,datetimeRegex:()=>N0,date:()=>$l,custom:()=>K0,coerce:()=>pl,boolean:()=>d0,bigint:()=>gl,array:()=>Hl,any:()=>rl,addIssueToContext:()=>_,ZodVoid:()=>Ot,ZodUnknown:()=>e,ZodUnion:()=>Xt,ZodUndefined:()=>qt,ZodType:()=>Q,ZodTuple:()=>u,ZodTransformer:()=>K,ZodSymbol:()=>Dt,ZodString:()=>U,ZodSet:()=>at,ZodSchema:()=>Q,ZodRecord:()=>Wt,ZodReadonly:()=>Lt,ZodPromise:()=>gt,ZodPipeline:()=>Vt,ZodParsedType:()=>v,ZodOptional:()=>N,ZodObject:()=>k,ZodNumber:()=>s,ZodNullable:()=>C,ZodNull:()=>Ht,ZodNever:()=>d,ZodNativeEnum:()=>Jt,ZodNaN:()=>Ut,ZodMap:()=>Et,ZodLiteral:()=>Qt,ZodLazy:()=>xt,ZodIssueCode:()=>$,ZodIntersection:()=>Yt,ZodFunction:()=>ct,ZodFirstPartyTypeKind:()=>X,ZodError:()=>E,ZodEnum:()=>tt,ZodEffects:()=>K,ZodDiscriminatedUnion:()=>Tt,ZodDefault:()=>Gt,ZodDate:()=>ht,ZodCatch:()=>Mt,ZodBranded:()=>it,ZodBoolean:()=>At,ZodBigInt:()=>z,ZodArray:()=>V,ZodAny:()=>ft,Schema:()=>Q,ParseStatus:()=>B,OK:()=>D,NEVER:()=>dl,INVALID:()=>H,EMPTY_PATH:()=>Uo,DIRTY:()=>lt,BRAND:()=>ll});var h0=Y(()=>{ut();b0();D0();Bt();u0();dt()});var I0=Y(()=>{h0();h0()});function f0(t,...n){if(ul())return;(console[t]||console.log).call(console,...n)}var ul=()=>Boolean(globalThis.__AFRICODE_TEST__||globalThis.__AFRICODE_SILENT_LOGS__);function Ct(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(Ct);let n={};for(let o of Object.keys(t))n[o]=Ct(t[o]);return n}function i0(t,n){let o={...t};for(let b of Object.keys(n))if(n[b]!==null&&typeof n[b]==="object"&&!Array.isArray(n[b])&&typeof t[b]==="object"&&!Array.isArray(t[b]))o[b]=i0(t[b]||{},n[b]);else o[b]=n[b];return o}function C0(t={}){return T0=i0(P0,t),Il=!0,Nt()}function Nt(){return Object.freeze(Ct(T0))}var P0,T0,Il=!1;var a0=Y(()=>{P0={validation:{trimStrings:!1,emptyAsNullDefault:!1},security:{csrf:{enabled:!0,excludePaths:[],sameSite:"Strict",secure:!1},rateLimit:{enabled:!0,windowMs:60000,maxRequests:60,excludePaths:[]}},hooks:{onValidationError:null,onSecurityViolation:null,onRateLimit:null,onDatabaseError:null,onRequest:null}},T0=Ct(P0)});class $t{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(o){if(o instanceof w.ZodError){let b={};return o.errors.forEach((l)=>{let h=l.path.join(".");b[h]=l.message}),{success:!1,errors:b}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(o){if(o instanceof w.ZodError)return{success:!1,error:o.errors[0]?.message||"Invalid value"};return{success:!1,error:"Validation failed"}}}static getFieldError(t,n){if(t.success)return null;return t.errors?.[n]||null}static hasFieldError(t,n){return!!this.getFieldError(t,n)}}class I{constructor(t,n="string"){this._baseSchema=t,this._fieldType=n,this._isNullable=!1,this._isOptional=!1,this._emptyAsNull=!1,this._trim=!1,this._customMessage=null}nullable(){return this._isNullable=!0,this}optional(){return this._isOptional=!0,this}emptyAsNull(){if(!this._isNullable)throw Error(`[AfriCode] .emptyAsNull() requires .nullable() to be called first. Use: afri.${this._fieldType}().nullable().emptyAsNull()`);return this._emptyAsNull=!0,this}trim(){return this._trim=!0,this}message(t){return this._customMessage=t,this}build(){let t=this._baseSchema;if(this._isNullable)t=t.nullable();if(this._isOptional)t=t.optional();return t}getMeta(){return{fieldType:this._fieldType,isNullable:this._isNullable,isOptional:this._isOptional,emptyAsNull:this._emptyAsNull,trim:this._trim}}}function Z0(t,n){let o={...n},b=!1;try{b=Nt().validation?.trimStrings===!0}catch{}for(let[l,h]of Object.entries(t)){if(!(h instanceof I))continue;let f=h.getMeta(),a=o[l];if(typeof a==="string"&&(f.trim||b))o[l]=a.trim();if(f.emptyAsNull&&o[l]==="")o[l]=null}return o}function e0(t){let n={};for(let[o,b]of Object.entries(t))if(b instanceof I)n[o]=b.build();else n[o]=b;return w.object(n)}var yt,m,y0;var Zt=Y(()=>{I0();a0();yt={login:w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain at least one uppercase letter, one lowercase letter, and one number")}),register:w.object({name:w.string().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s'-]+$/,"Name can only contain letters, spaces, hyphens, and apostrophes"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])/,"Password must contain uppercase, lowercase, number, and special character"),confirmPassword:w.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:w.object({action:w.literal("register"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),username:w.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:w.string().min(8,"Password must be at least 8 characters"),full_name:w.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:w.object({action:w.literal("login"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters")}),logout:w.object({action:w.literal("logout")}),action:w.discriminatedUnion("action",[w.object({action:w.literal("register")}).merge(w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),username:w.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:w.string().min(8,"Password must be at least 8 characters"),full_name:w.string().min(2,"Full name is required").max(100,"Full name is too long")})),w.object({action:w.literal("login")}).merge(w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters")})),w.object({action:w.literal("logout")})])},contact:w.object({name:w.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:w.string().email("Please enter a valid email address"),message:w.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:w.string().min(1,"URL is required").url("Please enter a valid URL"),required:w.string().min(1,"This field is required"),positiveNumber:w.number().positive("Must be a positive number"),integer:w.number().int("Must be a whole number"),futureDate:w.date().min(new Date,"Date must be in the future"),imageFile:w.instanceof(File).refine((t)=>t.size<=5242880,"File size must be less than 5MB").refine((t)=>["image/jpeg","image/png","image/gif","image/webp"].includes(t.type),"File must be a JPEG, PNG, GIF, or WebP image"),userProfile:w.object({full_name:w.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:w.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:w.string().url("Please enter a valid URL").nullable().optional(),theme:w.enum(["africanity","dark","light","system"]).optional(),language:w.string().min(2).max(10).optional()}),project:w.object({name:w.string().min(1,"Project name is required").max(100,"Project name is too long"),description:w.string().max(1000,"Description is too long").nullable().optional(),repository_url:w.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:w.string().url("Please enter a valid demo URL").nullable().optional(),tags:w.array(w.string()).optional(),is_public:w.boolean().optional()})};m={required:(t="This field is required")=>w.string().min(1,t),email:(t="Please enter a valid email address")=>w.string().email(t),minLength:(t,n)=>w.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>w.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>w.string().regex(t,n),numeric:(t="Must be a number")=>w.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>w.string().min(1,"URL is required").url(t)};y0={url(t="Please enter a valid URL"){return new I(w.string().min(1,"URL cannot be empty").url(t),"url")},email(t="Please enter a valid email address"){return new I(w.string().min(1,"Email cannot be empty").email(t),"email")},string(t={}){let n=w.string();if(t.min!==void 0)n=n.min(t.min,t.message||`Must be at least ${t.min} characters`);if(t.max!==void 0)n=n.max(t.max,t.message||`Must be less than ${t.max} characters`);return new I(n,"string")},number(t={}){let n=w.number();if(t.min!==void 0)n=n.min(t.min);if(t.max!==void 0)n=n.max(t.max);if(t.int)n=n.int("Must be a whole number");return new I(n,"number")},phone(t="Please enter a valid phone number"){return new I(w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),"phone")}}});function A(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var Tl,lb,r;var M=Y(()=>{Tl=globalThis.HTMLElement??class{},lb=typeof CSSStyleSheet<"u";r=class r extends Tl{constructor(){super();this.attachShadow({mode:"open"});let t=this.render;if(t&&typeof t==="function")this.render=()=>{try{t.call(this),this.removeAttribute("has-error")}catch(n){console.error(`[AfriCode] Rendering error in <${this.localName}>:`,n),this.setAttribute("has-error","true"),this.shadowRoot.innerHTML=`
371
+ </html>`}function Uo(t){if(t instanceof lo)return t.toString();if(Array.isArray(t))return t.map(Uo).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return Tb(t)}var Q=(t,...n)=>{let b="";for(let o=0;o<t.length;o++)if(b+=t[o],o<n.length)b+=Uo(n[o]);return new lo(b)};var M,ao,$,V=(t)=>{switch(typeof t){case"undefined":return $.undefined;case"string":return $.string;case"number":return Number.isNaN(t)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":if(Array.isArray(t))return $.array;if(t===null)return $.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return $.promise;if(typeof Map<"u"&&t instanceof Map)return $.map;if(typeof Set<"u"&&t instanceof Set)return $.set;if(typeof Date<"u"&&t instanceof Date)return $.date;return $.object;default:return $.unknown}};var St=x(()=>{(function(t){t.assertEqual=(l)=>{};function n(l){}t.assertIs=n;function b(l){throw Error()}t.assertNever=b,t.arrayToEnum=(l)=>{let a={};for(let h of l)a[h]=h;return a},t.getValidEnumValues=(l)=>{let a=t.objectKeys(l).filter((f)=>typeof l[l[f]]!=="number"),h={};for(let f of a)h[f]=l[f];return t.objectValues(h)},t.objectValues=(l)=>{return t.objectKeys(l).map(function(a){return l[a]})},t.objectKeys=typeof Object.keys==="function"?(l)=>Object.keys(l):(l)=>{let a=[];for(let h in l)if(Object.prototype.hasOwnProperty.call(l,h))a.push(h);return a},t.find=(l,a)=>{for(let h of l)if(a(h))return h;return},t.isInteger=typeof Number.isInteger==="function"?(l)=>Number.isInteger(l):(l)=>typeof l==="number"&&Number.isFinite(l)&&Math.floor(l)===l;function o(l,a=" | "){return l.map((h)=>typeof h==="string"?`'${h}'`:h).join(a)}t.joinValues=o,t.jsonStringifyReplacer=(l,a)=>{if(typeof a==="bigint")return a.toString();return a}})(M||(M={}));(function(t){t.mergeShapes=(n,b)=>{return{...n,...b}}})(ao||(ao={}));$=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var g,Cb=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},E;var Tt=x(()=>{St();g=M.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);E=class E extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(b)=>{this.issues=[...this.issues,b]},this.addIssues=(b=[])=>{this.issues=[...this.issues,...b]};let n=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,n);else this.__proto__=n;this.name="ZodError",this.issues=t}format(t){let n=t||function(l){return l.message},b={_errors:[]},o=(l)=>{for(let a of l.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)b._errors.push(n(a));else{let h=b,f=0;while(f<a.path.length){let r=a.path[f];if(f!==a.path.length-1)h[r]=h[r]||{_errors:[]};else h[r]=h[r]||{_errors:[]},h[r]._errors.push(n(a));h=h[r],f++}}};return o(this),b}static assert(t){if(!(t instanceof E))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},b=[];for(let o of this.issues)if(o.path.length>0){let l=o.path[0];n[l]=n[l]||[],n[l].push(t(o))}else b.push(t(o));return{formErrors:b,fieldErrors:n}}get formErrors(){return this.flatten()}};E.create=(t)=>{return new E(t)}});var yb=(t,n)=>{let b;switch(t.code){case g.invalid_type:if(t.received===$.undefined)b="Required";else b=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:b=`Invalid literal value, expected ${JSON.stringify(t.expected,M.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:b=`Unrecognized key(s) in object: ${M.joinValues(t.keys,", ")}`;break;case g.invalid_union:b="Invalid input";break;case g.invalid_union_discriminator:b=`Invalid discriminator value. Expected ${M.joinValues(t.options)}`;break;case g.invalid_enum_value:b=`Invalid enum value. Expected ${M.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:b="Invalid function arguments";break;case g.invalid_return_type:b="Invalid function return type";break;case g.invalid_date:b="Invalid date";break;case g.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(b=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")b=`${b} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)b=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)b=`Invalid input: must end with "${t.validation.endsWith}"`;else M.assertNever(t.validation);else if(t.validation!=="regex")b=`Invalid ${t.validation}`;else b="Invalid";break;case g.too_small:if(t.type==="array")b=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")b=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")b=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")b=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")b=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else b="Invalid input";break;case g.too_big:if(t.type==="array")b=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")b=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")b=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")b=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")b=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else b="Invalid input";break;case g.custom:b="Invalid input";break;case g.invalid_intersection_types:b="Intersection results could not be merged";break;case g.not_multiple_of:b=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:b="Number must be finite";break;default:b=n.defaultError,M.assertNever(t)}return{message:b}},P;var ho=x(()=>{Tt();St();P=yb});function eb(t){Vo=t}function ct(){return Vo}var Vo;var Ct=x(()=>{ho();Vo=P});function w(t,n){let b=ct(),o=Ft({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,b,b===P?void 0:P].filter((l)=>!!l)});t.common.issues.push(o)}class F{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,n){let b=[];for(let o of n){if(o.status==="aborted")return q;if(o.status==="dirty")t.dirty();b.push(o.value)}return{status:t.value,value:b}}static async mergeObjectAsync(t,n){let b=[];for(let o of n){let l=await o.key,a=await o.value;b.push({key:l,value:a})}return F.mergeObjectSync(t,b)}static mergeObjectSync(t,n){let b={};for(let o of n){let{key:l,value:a}=o;if(l.status==="aborted")return q;if(a.status==="aborted")return q;if(l.status==="dirty")t.dirty();if(a.status==="dirty")t.dirty();if(l.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet))b[l.value]=a.value}return{status:t.value,value:b}}}var Ft=(t)=>{let{data:n,path:b,errorMaps:o,issueData:l}=t,a=[...b,...l.path||[]],h={...l,path:a};if(l.message!==void 0)return{...l,path:a,message:l.message};let f="",r=o.filter((A)=>!!A).slice().reverse();for(let A of r)f=A(h,{data:n,defaultError:f}).message;return{...l,path:a,message:f}},Zb,q,lt=(t)=>({status:"dirty",value:t}),R=(t)=>({status:"valid",value:t}),yt=(t)=>t.status==="aborted",et=(t)=>t.status==="dirty",e=(t)=>t.status==="valid",vt=(t)=>typeof Promise<"u"&&t instanceof Promise;var fo=x(()=>{Ct();ho();Zb=[];q=Object.freeze({status:"aborted"})});var No=()=>{};var d;var Ko=x(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(d||(d={}))});class p{constructor(t,n,b,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=b,this._key=o}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function H(t){if(!t)return{};let{errorMap:n,invalid_type_error:b,required_error:o,description:l}=t;if(n&&(b||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:l};return{errorMap:(h,f)=>{let{message:r}=t;if(h.code==="invalid_enum_value")return{message:r??f.defaultError};if(typeof f.data>"u")return{message:r??o??f.defaultError};if(h.code!=="invalid_type")return{message:f.defaultError};return{message:r??b??f.defaultError}},description:l}}class Y{get description(){return this._def.description}_getType(t){return V(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:V(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new F,ctx:{common:t.parent.common,data:t.data,parsedType:V(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(vt(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let b=this.safeParse(t,n);if(b.success)return b.data;throw b.error}safeParse(t,n){let b={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:V(t)},o=this._parseSync({data:t,path:b.path,parent:b});return jo(b,o)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:V(t)};if(!this["~standard"].async)try{let b=this._parseSync({data:t,path:[],parent:n});return e(b)?{value:b.value}:{issues:n.common.issues}}catch(b){if(b?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((b)=>e(b)?{value:b.value}:{issues:n.common.issues})}async parseAsync(t,n){let b=await this.safeParseAsync(t,n);if(b.success)return b.data;throw b.error}async safeParseAsync(t,n){let b={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:V(t)},o=this._parse({data:t,path:b.path,parent:b}),l=await(vt(o)?o:Promise.resolve(o));return jo(b,l)}refine(t,n){let b=(o)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(o);else return n};return this._refinement((o,l)=>{let a=t(o),h=()=>l.addIssue({code:g.custom,...b(o)});if(typeof Promise<"u"&&a instanceof Promise)return a.then((f)=>{if(!f)return h(),!1;else return!0});if(!a)return h(),!1;else return!0})}refinement(t,n){return this._refinement((b,o)=>{if(!t(b))return o.addIssue(typeof n==="function"?n(b,o):n),!1;else return!0})}_refinement(t){return new u({schema:this,typeName:k.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(n)=>this["~validate"](n)}}optional(){return m.create(this,this._def)}nullable(){return C.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return rt.create(this,this._def)}or(t){return qt.create([this,t],this._def)}and(t){return kt.create(this,t,this._def)}transform(t){return new u({...H(this._def),schema:this,typeName:k.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new it({...H(this._def),innerType:this,defaultValue:n,typeName:k.ZodDefault})}brand(){return new st({typeName:k.ZodBranded,type:this,...H(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new Lt({...H(this._def),innerType:this,catchValue:n,typeName:k.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Wt.create(this,t)}readonly(){return Mt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function To(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let b=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${b}`}function _l(t){return new RegExp(`^${To(t)}$`)}function Co(t){let n=`${Po}T${To(t)}`,b=[];if(b.push(t.local?"Z?":"Z"),t.offset)b.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${b.join("|")})`,new RegExp(`^${n}$`)}function Al(t,n){if((n==="v4"||!n)&&fl.test(t))return!0;if((n==="v6"||!n)&&gl.test(t))return!0;return!1}function dl(t,n){if(!bl.test(t))return!1;try{let[b]=t.split(".");if(!b)return!1;let o=b.replace(/-/g,"+").replace(/_/g,"/").padEnd(b.length+(4-b.length%4)%4,"="),l=JSON.parse(atob(o));if(typeof l!=="object"||l===null)return!1;if("typ"in l&&l?.typ!=="JWT")return!1;if(!l.alg)return!1;if(n&&l.alg!==n)return!1;return!0}catch{return!1}}function xl(t,n){if((n==="v4"||!n)&&rl.test(t))return!0;if((n==="v6"||!n)&&$l.test(t))return!0;return!1}function ql(t,n){let b=(t.toString().split(".")[1]||"").length,o=(n.toString().split(".")[1]||"").length,l=b>o?b:o,a=Number.parseInt(t.toFixed(l).replace(".","")),h=Number.parseInt(n.toFixed(l).replace(".",""));return a%h/10**l}function wt(t){if(t instanceof J){let n={};for(let b in t.shape){let o=t.shape[b];n[b]=m.create(wt(o))}return new J({...t._def,shape:()=>n})}else if(t instanceof W)return new W({...t._def,type:wt(t.element)});else if(t instanceof m)return m.create(wt(t.unwrap()));else if(t instanceof C)return C.create(wt(t.unwrap()));else if(t instanceof K)return K.create(t.items.map((n)=>wt(n)));else return t}function go(t,n){let b=V(t),o=V(n);if(t===n)return{valid:!0,data:t};else if(b===$.object&&o===$.object){let l=M.objectKeys(n),a=M.objectKeys(t).filter((f)=>l.indexOf(f)!==-1),h={...t,...n};for(let f of a){let r=go(t[f],n[f]);if(!r.valid)return{valid:!1};h[f]=r.data}return{valid:!0,data:h}}else if(b===$.array&&o===$.array){if(t.length!==n.length)return{valid:!1};let l=[];for(let a=0;a<t.length;a++){let h=t[a],f=n[a],r=go(h,f);if(!r.valid)return{valid:!1};l.push(r.data)}return{valid:!0,data:l}}else if(b===$.date&&o===$.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function yo(t,n){return new tt({values:t,typeName:k.ZodEnum,...H(n)})}function Io(t,n){let b=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof b==="string"?{message:b}:b}function eo(t,n={},b){if(t)return ht.create().superRefine((o,l)=>{let a=t(o);if(a instanceof Promise)return a.then((h)=>{if(!h){let f=Io(n,o),r=f.fatal??b??!0;l.addIssue({code:"custom",...f,fatal:r})}});if(!a){let h=Io(n,o),f=h.fatal??b??!0;l.addIssue({code:"custom",...h,fatal:f})}return});return ht.create()}var jo=(t,n)=>{if(e(n))return{success:!0,data:n.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let b=new E(t.common.issues);return this._error=b,this._error}}}},sb,zb,tl,nl,ol,bl,ll,al,hl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ro,fl,rl,gl,$l,cl,vl,Po="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wl,O,s,z,At,at,Rt,dt,xt,ht,Z,N,Bt,W,J,qt,T=(t)=>{if(t instanceof Ht)return T(t.schema);else if(t instanceof u)return T(t.innerType());else if(t instanceof Yt)return[t.value];else if(t instanceof tt)return t.options;else if(t instanceof Xt)return M.objectValues(t.enum);else if(t instanceof it)return T(t._def.innerType);else if(t instanceof dt)return[void 0];else if(t instanceof xt)return[null];else if(t instanceof m)return[void 0,...T(t.unwrap())];else if(t instanceof C)return[null,...T(t.unwrap())];else if(t instanceof st)return T(t.unwrap());else if(t instanceof Mt)return T(t.unwrap());else if(t instanceof Lt)return T(t._def.innerType);else return[]},Zt,kt,K,Dt,Et,ft,_t,Ht,Yt,tt,Xt,rt,u,m,C,it,Lt,Ot,kl,st,Wt,Mt,Hl,k,Yl=(t,n={message:`Input not instance of ${t.name}`})=>eo((b)=>b instanceof t,n),Zo,so,Xl,il,zo,Ll,Ml,Ql,Jl,Gl,Sl,Fl,Rl,Bl,Dl,El,Ol,Wl,ml,pl,ul,Ul,Vl,Nl,Kl,jl,Il,Pl,Tl,Cl,yl,el,Zl,sl,zl=()=>Zo().optional(),ta=()=>so().optional(),na=()=>zo().optional(),oa,ba;var t0=x(()=>{Tt();Ct();Ko();fo();St();sb=/^c[^\s-]{8,}$/i,zb=/^[0-9a-z]+$/,tl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nl=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ol=/^[a-z0-9_-]{21}$/i,bl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ll=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,al=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$l=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wl=new RegExp(`^${Po}$`);O=class O extends Y{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==$.string){let l=this._getOrReturnCtx(t);return w(l,{code:g.invalid_type,expected:$.string,received:l.parsedType}),q}let b=new F,o=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.length<l.value)o=this._getOrReturnCtx(t,o),w(o,{code:g.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="max"){if(t.data.length>l.value)o=this._getOrReturnCtx(t,o),w(o,{code:g.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="length"){let a=t.data.length>l.value,h=t.data.length<l.value;if(a||h){if(o=this._getOrReturnCtx(t,o),a)w(o,{code:g.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});else if(h)w(o,{code:g.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});b.dirty()}}else if(l.kind==="email"){if(!al.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"email",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="emoji"){if(!ro)ro=new RegExp(hl,"u");if(!ro.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"emoji",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="uuid"){if(!nl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"uuid",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="nanoid"){if(!ol.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"nanoid",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="cuid"){if(!sb.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"cuid",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="cuid2"){if(!zb.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"cuid2",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="ulid"){if(!tl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"ulid",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),w(o,{validation:"url",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="regex"){if(l.regex.lastIndex=0,!l.regex.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"regex",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="trim")t.data=t.data.trim();else if(l.kind==="includes"){if(!t.data.includes(l.value,l.position))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),b.dirty()}else if(l.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(l.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(l.kind==="startsWith"){if(!t.data.startsWith(l.value))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:{startsWith:l.value},message:l.message}),b.dirty()}else if(l.kind==="endsWith"){if(!t.data.endsWith(l.value))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:{endsWith:l.value},message:l.message}),b.dirty()}else if(l.kind==="datetime"){if(!Co(l).test(t.data))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:"datetime",message:l.message}),b.dirty()}else if(l.kind==="date"){if(!wl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:"date",message:l.message}),b.dirty()}else if(l.kind==="time"){if(!_l(l).test(t.data))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:"time",message:l.message}),b.dirty()}else if(l.kind==="duration"){if(!ll.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"duration",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="ip"){if(!Al(t.data,l.version))o=this._getOrReturnCtx(t,o),w(o,{validation:"ip",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="jwt"){if(!dl(t.data,l.alg))o=this._getOrReturnCtx(t,o),w(o,{validation:"jwt",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="cidr"){if(!xl(t.data,l.version))o=this._getOrReturnCtx(t,o),w(o,{validation:"cidr",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="base64"){if(!cl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"base64",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="base64url"){if(!vl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"base64url",code:g.invalid_string,message:l.message}),b.dirty()}else M.assertNever(l);return{status:b.value,value:t.data}}_regex(t,n,b){return this.refinement((o)=>t.test(o),{validation:n,code:g.invalid_string,...d.errToObj(b)})}_addCheck(t){return new O({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...d.errToObj(t)})}url(t){return this._addCheck({kind:"url",...d.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...d.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...d.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...d.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...d.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...d.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...d.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...d.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...d.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...d.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...d.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...d.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...d.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...d.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...d.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...d.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...d.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...d.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...d.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...d.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...d.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...d.errToObj(n)})}nonempty(t){return this.min(1,d.errToObj(t))}trim(){return new O({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxLength(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};O.create=(t)=>{return new O({checks:[],typeName:k.ZodString,coerce:t?.coerce??!1,...H(t)})};s=class s extends Y{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==$.number){let l=this._getOrReturnCtx(t);return w(l,{code:g.invalid_type,expected:$.number,received:l.parsedType}),q}let b=void 0,o=new F;for(let l of this._def.checks)if(l.kind==="int"){if(!M.isInteger(t.data))b=this._getOrReturnCtx(t,b),w(b,{code:g.invalid_type,expected:"integer",received:"float",message:l.message}),o.dirty()}else if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)b=this._getOrReturnCtx(t,b),w(b,{code:g.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)b=this._getOrReturnCtx(t,b),w(b,{code:g.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="multipleOf"){if(ql(t.data,l.value)!==0)b=this._getOrReturnCtx(t,b),w(b,{code:g.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()}else if(l.kind==="finite"){if(!Number.isFinite(t.data))b=this._getOrReturnCtx(t,b),w(b,{code:g.not_finite,message:l.message}),o.dirty()}else M.assertNever(l);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,d.toString(n))}gt(t,n){return this.setLimit("min",t,!1,d.toString(n))}lte(t,n){return this.setLimit("max",t,!0,d.toString(n))}lt(t,n){return this.setLimit("max",t,!1,d.toString(n))}setLimit(t,n,b,o){return new s({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:b,message:d.toString(o)}]})}_addCheck(t){return new s({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:d.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:d.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:d.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:d.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:d.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:d.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:d.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:d.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:d.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&M.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let b of this._def.checks)if(b.kind==="finite"||b.kind==="int"||b.kind==="multipleOf")return!0;else if(b.kind==="min"){if(n===null||b.value>n)n=b.value}else if(b.kind==="max"){if(t===null||b.value<t)t=b.value}return Number.isFinite(n)&&Number.isFinite(t)}};s.create=(t)=>{return new s({checks:[],typeName:k.ZodNumber,coerce:t?.coerce||!1,...H(t)})};z=class z extends Y{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==$.bigint)return this._getInvalidInput(t);let b=void 0,o=new F;for(let l of this._def.checks)if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)b=this._getOrReturnCtx(t,b),w(b,{code:g.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)b=this._getOrReturnCtx(t,b),w(b,{code:g.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()}else if(l.kind==="multipleOf"){if(t.data%l.value!==BigInt(0))b=this._getOrReturnCtx(t,b),w(b,{code:g.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()}else M.assertNever(l);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return w(n,{code:g.invalid_type,expected:$.bigint,received:n.parsedType}),q}gte(t,n){return this.setLimit("min",t,!0,d.toString(n))}gt(t,n){return this.setLimit("min",t,!1,d.toString(n))}lte(t,n){return this.setLimit("max",t,!0,d.toString(n))}lt(t,n){return this.setLimit("max",t,!1,d.toString(n))}setLimit(t,n,b,o){return new z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:b,message:d.toString(o)}]})}_addCheck(t){return new z({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:d.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:d.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:d.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:d.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:d.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};z.create=(t)=>{return new z({checks:[],typeName:k.ZodBigInt,coerce:t?.coerce??!1,...H(t)})};At=class At extends Y{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==$.boolean){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.boolean,received:b.parsedType}),q}return R(t.data)}};At.create=(t)=>{return new At({typeName:k.ZodBoolean,coerce:t?.coerce||!1,...H(t)})};at=class at extends Y{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==$.date){let l=this._getOrReturnCtx(t);return w(l,{code:g.invalid_type,expected:$.date,received:l.parsedType}),q}if(Number.isNaN(t.data.getTime())){let l=this._getOrReturnCtx(t);return w(l,{code:g.invalid_date}),q}let b=new F,o=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.getTime()<l.value)o=this._getOrReturnCtx(t,o),w(o,{code:g.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),b.dirty()}else if(l.kind==="max"){if(t.data.getTime()>l.value)o=this._getOrReturnCtx(t,o),w(o,{code:g.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),b.dirty()}else M.assertNever(l);return{status:b.value,value:new Date(t.data.getTime())}}_addCheck(t){return new at({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:d.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:d.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t!=null?new Date(t):null}};at.create=(t)=>{return new at({checks:[],coerce:t?.coerce||!1,typeName:k.ZodDate,...H(t)})};Rt=class Rt extends Y{_parse(t){if(this._getType(t)!==$.symbol){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.symbol,received:b.parsedType}),q}return R(t.data)}};Rt.create=(t)=>{return new Rt({typeName:k.ZodSymbol,...H(t)})};dt=class dt extends Y{_parse(t){if(this._getType(t)!==$.undefined){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.undefined,received:b.parsedType}),q}return R(t.data)}};dt.create=(t)=>{return new dt({typeName:k.ZodUndefined,...H(t)})};xt=class xt extends Y{_parse(t){if(this._getType(t)!==$.null){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.null,received:b.parsedType}),q}return R(t.data)}};xt.create=(t)=>{return new xt({typeName:k.ZodNull,...H(t)})};ht=class ht extends Y{constructor(){super(...arguments);this._any=!0}_parse(t){return R(t.data)}};ht.create=(t)=>{return new ht({typeName:k.ZodAny,...H(t)})};Z=class Z extends Y{constructor(){super(...arguments);this._unknown=!0}_parse(t){return R(t.data)}};Z.create=(t)=>{return new Z({typeName:k.ZodUnknown,...H(t)})};N=class N extends Y{_parse(t){let n=this._getOrReturnCtx(t);return w(n,{code:g.invalid_type,expected:$.never,received:n.parsedType}),q}};N.create=(t)=>{return new N({typeName:k.ZodNever,...H(t)})};Bt=class Bt extends Y{_parse(t){if(this._getType(t)!==$.undefined){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.void,received:b.parsedType}),q}return R(t.data)}};Bt.create=(t)=>{return new Bt({typeName:k.ZodVoid,...H(t)})};W=class W extends Y{_parse(t){let{ctx:n,status:b}=this._processInputParams(t),o=this._def;if(n.parsedType!==$.array)return w(n,{code:g.invalid_type,expected:$.array,received:n.parsedType}),q;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,h=n.data.length<o.exactLength.value;if(a||h)w(n,{code:a?g.too_big:g.too_small,minimum:h?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),b.dirty()}if(o.minLength!==null){if(n.data.length<o.minLength.value)w(n,{code:g.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),b.dirty()}if(o.maxLength!==null){if(n.data.length>o.maxLength.value)w(n,{code:g.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),b.dirty()}if(n.common.async)return Promise.all([...n.data].map((a,h)=>{return o.type._parseAsync(new p(n,a,n.path,h))})).then((a)=>{return F.mergeArray(b,a)});let l=[...n.data].map((a,h)=>{return o.type._parseSync(new p(n,a,n.path,h))});return F.mergeArray(b,l)}get element(){return this._def.type}min(t,n){return new W({...this._def,minLength:{value:t,message:d.toString(n)}})}max(t,n){return new W({...this._def,maxLength:{value:t,message:d.toString(n)}})}length(t,n){return new W({...this._def,exactLength:{value:t,message:d.toString(n)}})}nonempty(t){return this.min(1,t)}};W.create=(t,n)=>{return new W({type:t,minLength:null,maxLength:null,exactLength:null,typeName:k.ZodArray,...H(n)})};J=class J extends Y{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=M.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$.object){let r=this._getOrReturnCtx(t);return w(r,{code:g.invalid_type,expected:$.object,received:r.parsedType}),q}let{status:b,ctx:o}=this._processInputParams(t),{shape:l,keys:a}=this._getCached(),h=[];if(!(this._def.catchall instanceof N&&this._def.unknownKeys==="strip")){for(let r in o.data)if(!a.includes(r))h.push(r)}let f=[];for(let r of a){let A=l[r],L=o.data[r];f.push({key:{status:"valid",value:r},value:A._parse(new p(o,L,o.path,r)),alwaysSet:r in o.data})}if(this._def.catchall instanceof N){let r=this._def.unknownKeys;if(r==="passthrough")for(let A of h)f.push({key:{status:"valid",value:A},value:{status:"valid",value:o.data[A]}});else if(r==="strict"){if(h.length>0)w(o,{code:g.unrecognized_keys,keys:h}),b.dirty()}else if(r==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let r=this._def.catchall;for(let A of h){let L=o.data[A];f.push({key:{status:"valid",value:A},value:r._parse(new p(o,L,o.path,A)),alwaysSet:A in o.data})}}if(o.common.async)return Promise.resolve().then(async()=>{let r=[];for(let A of f){let L=await A.key,S=await A.value;r.push({key:L,value:S,alwaysSet:A.alwaysSet})}return r}).then((r)=>{return F.mergeObjectSync(b,r)});else return F.mergeObjectSync(b,f)}get shape(){return this._def.shape()}strict(t){return d.errToObj,new J({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,b)=>{let o=this._def.errorMap?.(n,b).message??b.defaultError;if(n.code==="unrecognized_keys")return{message:d.errToObj(t).message??o};return{message:o}}}:{}})}strip(){return new J({...this._def,unknownKeys:"strip"})}passthrough(){return new J({...this._def,unknownKeys:"passthrough"})}extend(t){return new J({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new J({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:k.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new J({...this._def,catchall:t})}pick(t){let n={};for(let b of M.objectKeys(t))if(t[b]&&this.shape[b])n[b]=this.shape[b];return new J({...this._def,shape:()=>n})}omit(t){let n={};for(let b of M.objectKeys(this.shape))if(!t[b])n[b]=this.shape[b];return new J({...this._def,shape:()=>n})}deepPartial(){return wt(this)}partial(t){let n={};for(let b of M.objectKeys(this.shape)){let o=this.shape[b];if(t&&!t[b])n[b]=o;else n[b]=o.optional()}return new J({...this._def,shape:()=>n})}required(t){let n={};for(let b of M.objectKeys(this.shape))if(t&&!t[b])n[b]=this.shape[b];else{let l=this.shape[b];while(l instanceof m)l=l._def.innerType;n[b]=l}return new J({...this._def,shape:()=>n})}keyof(){return yo(M.objectKeys(this.shape))}};J.create=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strip",catchall:N.create(),typeName:k.ZodObject,...H(n)})};J.strictCreate=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strict",catchall:N.create(),typeName:k.ZodObject,...H(n)})};J.lazycreate=(t,n)=>{return new J({shape:t,unknownKeys:"strip",catchall:N.create(),typeName:k.ZodObject,...H(n)})};qt=class qt extends Y{_parse(t){let{ctx:n}=this._processInputParams(t),b=this._def.options;function o(l){for(let h of l)if(h.result.status==="valid")return h.result;for(let h of l)if(h.result.status==="dirty")return n.common.issues.push(...h.ctx.common.issues),h.result;let a=l.map((h)=>new E(h.ctx.common.issues));return w(n,{code:g.invalid_union,unionErrors:a}),q}if(n.common.async)return Promise.all(b.map(async(l)=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);else{let l=void 0,a=[];for(let f of b){let r={...n,common:{...n.common,issues:[]},parent:null},A=f._parseSync({data:n.data,path:n.path,parent:r});if(A.status==="valid")return A;else if(A.status==="dirty"&&!l)l={result:A,ctx:r};if(r.common.issues.length)a.push(r.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;let h=a.map((f)=>new E(f));return w(n,{code:g.invalid_union,unionErrors:h}),q}}get options(){return this._def.options}};qt.create=(t,n)=>{return new qt({options:t,typeName:k.ZodUnion,...H(n)})};Zt=class Zt extends Y{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.object)return w(n,{code:g.invalid_type,expected:$.object,received:n.parsedType}),q;let b=this.discriminator,o=n.data[b],l=this.optionsMap.get(o);if(!l)return w(n,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[b]}),q;if(n.common.async)return l._parseAsync({data:n.data,path:n.path,parent:n});else return l._parseSync({data:n.data,path:n.path,parent:n})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,b){let o=new Map;for(let l of n){let a=T(l.shape[t]);if(!a.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let h of a){if(o.has(h))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(h)}`);o.set(h,l)}}return new Zt({typeName:k.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...H(b)})}};kt=class kt extends Y{_parse(t){let{status:n,ctx:b}=this._processInputParams(t),o=(l,a)=>{if(yt(l)||yt(a))return q;let h=go(l.value,a.value);if(!h.valid)return w(b,{code:g.invalid_intersection_types}),q;if(et(l)||et(a))n.dirty();return{status:n.value,value:h.data}};if(b.common.async)return Promise.all([this._def.left._parseAsync({data:b.data,path:b.path,parent:b}),this._def.right._parseAsync({data:b.data,path:b.path,parent:b})]).then(([l,a])=>o(l,a));else return o(this._def.left._parseSync({data:b.data,path:b.path,parent:b}),this._def.right._parseSync({data:b.data,path:b.path,parent:b}))}};kt.create=(t,n,b)=>{return new kt({left:t,right:n,typeName:k.ZodIntersection,...H(b)})};K=class K extends Y{_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.parsedType!==$.array)return w(b,{code:g.invalid_type,expected:$.array,received:b.parsedType}),q;if(b.data.length<this._def.items.length)return w(b,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;if(!this._def.rest&&b.data.length>this._def.items.length)w(b,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let l=[...b.data].map((a,h)=>{let f=this._def.items[h]||this._def.rest;if(!f)return null;return f._parse(new p(b,a,b.path,h))}).filter((a)=>!!a);if(b.common.async)return Promise.all(l).then((a)=>{return F.mergeArray(n,a)});else return F.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new K({...this._def,rest:t})}};K.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new K({items:t,typeName:k.ZodTuple,rest:null,...H(n)})};Dt=class Dt extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.parsedType!==$.object)return w(b,{code:g.invalid_type,expected:$.object,received:b.parsedType}),q;let o=[],l=this._def.keyType,a=this._def.valueType;for(let h in b.data)o.push({key:l._parse(new p(b,h,b.path,h)),value:a._parse(new p(b,b.data[h],b.path,h)),alwaysSet:h in b.data});if(b.common.async)return F.mergeObjectAsync(n,o);else return F.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,b){if(n instanceof Y)return new Dt({keyType:t,valueType:n,typeName:k.ZodRecord,...H(b)});return new Dt({keyType:O.create(),valueType:t,typeName:k.ZodRecord,...H(n)})}};Et=class Et extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.parsedType!==$.map)return w(b,{code:g.invalid_type,expected:$.map,received:b.parsedType}),q;let o=this._def.keyType,l=this._def.valueType,a=[...b.data.entries()].map(([h,f],r)=>{return{key:o._parse(new p(b,h,b.path,[r,"key"])),value:l._parse(new p(b,f,b.path,[r,"value"]))}});if(b.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let f of a){let r=await f.key,A=await f.value;if(r.status==="aborted"||A.status==="aborted")return q;if(r.status==="dirty"||A.status==="dirty")n.dirty();h.set(r.value,A.value)}return{status:n.value,value:h}})}else{let h=new Map;for(let f of a){let{key:r,value:A}=f;if(r.status==="aborted"||A.status==="aborted")return q;if(r.status==="dirty"||A.status==="dirty")n.dirty();h.set(r.value,A.value)}return{status:n.value,value:h}}}};Et.create=(t,n,b)=>{return new Et({valueType:n,keyType:t,typeName:k.ZodMap,...H(b)})};ft=class ft extends Y{_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.parsedType!==$.set)return w(b,{code:g.invalid_type,expected:$.set,received:b.parsedType}),q;let o=this._def;if(o.minSize!==null){if(b.data.size<o.minSize.value)w(b,{code:g.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()}if(o.maxSize!==null){if(b.data.size>o.maxSize.value)w(b,{code:g.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty()}let l=this._def.valueType;function a(f){let r=new Set;for(let A of f){if(A.status==="aborted")return q;if(A.status==="dirty")n.dirty();r.add(A.value)}return{status:n.value,value:r}}let h=[...b.data.values()].map((f,r)=>l._parse(new p(b,f,b.path,r)));if(b.common.async)return Promise.all(h).then((f)=>a(f));else return a(h)}min(t,n){return new ft({...this._def,minSize:{value:t,message:d.toString(n)}})}max(t,n){return new ft({...this._def,maxSize:{value:t,message:d.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ft.create=(t,n)=>{return new ft({valueType:t,minSize:null,maxSize:null,typeName:k.ZodSet,...H(n)})};_t=class _t extends Y{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.function)return w(n,{code:g.invalid_type,expected:$.function,received:n.parsedType}),q;function b(h,f){return Ft({data:h,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ct(),P].filter((r)=>!!r),issueData:{code:g.invalid_arguments,argumentsError:f}})}function o(h,f){return Ft({data:h,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ct(),P].filter((r)=>!!r),issueData:{code:g.invalid_return_type,returnTypeError:f}})}let l={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof rt){let h=this;return R(async function(...f){let r=new E([]),A=await h._def.args.parseAsync(f,l).catch((G)=>{throw r.addIssue(b(f,G)),r}),L=await Reflect.apply(a,this,A);return await h._def.returns._def.type.parseAsync(L,l).catch((G)=>{throw r.addIssue(o(L,G)),r})})}else{let h=this;return R(function(...f){let r=h._def.args.safeParse(f,l);if(!r.success)throw new E([b(f,r.error)]);let A=Reflect.apply(a,this,r.data),L=h._def.returns.safeParse(A,l);if(!L.success)throw new E([o(A,L.error)]);return L.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new _t({...this._def,args:K.create(t).rest(Z.create())})}returns(t){return new _t({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,b){return new _t({args:t?t:K.create([]).rest(Z.create()),returns:n||Z.create(),typeName:k.ZodFunction,...H(b)})}};Ht=class Ht extends Y{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ht.create=(t,n)=>{return new Ht({getter:t,typeName:k.ZodLazy,...H(n)})};Yt=class Yt extends Y{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return w(n,{received:n.data,code:g.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}};Yt.create=(t,n)=>{return new Yt({value:t,typeName:k.ZodLiteral,...H(n)})};tt=class tt extends Y{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),b=this._def.values;return w(n,{expected:M.joinValues(b),received:n.parsedType,code:g.invalid_type}),q}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),b=this._def.values;return w(n,{received:n.data,code:g.invalid_enum_value,options:b}),q}return R(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return tt.create(t,{...this._def,...n})}exclude(t,n=this._def){return tt.create(this.options.filter((b)=>!t.includes(b)),{...this._def,...n})}};tt.create=yo;Xt=class Xt extends Y{_parse(t){let n=M.getValidEnumValues(this._def.values),b=this._getOrReturnCtx(t);if(b.parsedType!==$.string&&b.parsedType!==$.number){let o=M.objectValues(n);return w(b,{expected:M.joinValues(o),received:b.parsedType,code:g.invalid_type}),q}if(!this._cache)this._cache=new Set(M.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let o=M.objectValues(n);return w(b,{received:b.data,code:g.invalid_enum_value,options:o}),q}return R(t.data)}get enum(){return this._def.values}};Xt.create=(t,n)=>{return new Xt({values:t,typeName:k.ZodNativeEnum,...H(n)})};rt=class rt extends Y{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.promise&&n.common.async===!1)return w(n,{code:g.invalid_type,expected:$.promise,received:n.parsedType}),q;let b=n.parsedType===$.promise?n.data:Promise.resolve(n.data);return R(b.then((o)=>{return this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};rt.create=(t,n)=>{return new rt({type:t,typeName:k.ZodPromise,...H(n)})};u=class u extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===k.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:b}=this._processInputParams(t),o=this._def.effect||null,l={addIssue:(a)=>{if(w(b,a),a.fatal)n.abort();else n.dirty()},get path(){return b.path}};if(l.addIssue=l.addIssue.bind(l),o.type==="preprocess"){let a=o.transform(b.data,l);if(b.common.async)return Promise.resolve(a).then(async(h)=>{if(n.value==="aborted")return q;let f=await this._def.schema._parseAsync({data:h,path:b.path,parent:b});if(f.status==="aborted")return q;if(f.status==="dirty")return lt(f.value);if(n.value==="dirty")return lt(f.value);return f});else{if(n.value==="aborted")return q;let h=this._def.schema._parseSync({data:a,path:b.path,parent:b});if(h.status==="aborted")return q;if(h.status==="dirty")return lt(h.value);if(n.value==="dirty")return lt(h.value);return h}}if(o.type==="refinement"){let a=(h)=>{let f=o.refinement(h,l);if(b.common.async)return Promise.resolve(f);if(f instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(b.common.async===!1){let h=this._def.schema._parseSync({data:b.data,path:b.path,parent:b});if(h.status==="aborted")return q;if(h.status==="dirty")n.dirty();return a(h.value),{status:n.value,value:h.value}}else return this._def.schema._parseAsync({data:b.data,path:b.path,parent:b}).then((h)=>{if(h.status==="aborted")return q;if(h.status==="dirty")n.dirty();return a(h.value).then(()=>{return{status:n.value,value:h.value}})})}if(o.type==="transform")if(b.common.async===!1){let a=this._def.schema._parseSync({data:b.data,path:b.path,parent:b});if(!e(a))return q;let h=o.transform(a.value,l);if(h instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:h}}else return this._def.schema._parseAsync({data:b.data,path:b.path,parent:b}).then((a)=>{if(!e(a))return q;return Promise.resolve(o.transform(a.value,l)).then((h)=>({status:n.value,value:h}))});M.assertNever(o)}};u.create=(t,n,b)=>{return new u({schema:t,typeName:k.ZodEffects,effect:n,...H(b)})};u.createWithPreprocess=(t,n,b)=>{return new u({schema:n,effect:{type:"preprocess",transform:t},typeName:k.ZodEffects,...H(b)})};m=class m extends Y{_parse(t){if(this._getType(t)===$.undefined)return R(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};m.create=(t,n)=>{return new m({innerType:t,typeName:k.ZodOptional,...H(n)})};C=class C extends Y{_parse(t){if(this._getType(t)===$.null)return R(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};C.create=(t,n)=>{return new C({innerType:t,typeName:k.ZodNullable,...H(n)})};it=class it extends Y{_parse(t){let{ctx:n}=this._processInputParams(t),b=n.data;if(n.parsedType===$.undefined)b=this._def.defaultValue();return this._def.innerType._parse({data:b,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};it.create=(t,n)=>{return new it({innerType:t,typeName:k.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...H(n)})};Lt=class Lt extends Y{_parse(t){let{ctx:n}=this._processInputParams(t),b={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:b.data,path:b.path,parent:{...b}});if(vt(o))return o.then((l)=>{return{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new E(b.common.issues)},input:b.data})}});else return{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new E(b.common.issues)},input:b.data})}}removeCatch(){return this._def.innerType}};Lt.create=(t,n)=>{return new Lt({innerType:t,typeName:k.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...H(n)})};Ot=class Ot extends Y{_parse(t){if(this._getType(t)!==$.nan){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.nan,received:b.parsedType}),q}return{status:"valid",value:t.data}}};Ot.create=(t)=>{return new Ot({typeName:k.ZodNaN,...H(t)})};kl=Symbol("zod_brand");st=class st extends Y{_parse(t){let{ctx:n}=this._processInputParams(t),b=n.data;return this._def.type._parse({data:b,path:n.path,parent:n})}unwrap(){return this._def.type}};Wt=class Wt extends Y{_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.common.async)return(async()=>{let l=await this._def.in._parseAsync({data:b.data,path:b.path,parent:b});if(l.status==="aborted")return q;if(l.status==="dirty")return n.dirty(),lt(l.value);else return this._def.out._parseAsync({data:l.value,path:b.path,parent:b})})();else{let o=this._def.in._parseSync({data:b.data,path:b.path,parent:b});if(o.status==="aborted")return q;if(o.status==="dirty")return n.dirty(),{status:"dirty",value:o.value};else return this._def.out._parseSync({data:o.value,path:b.path,parent:b})}}static create(t,n){return new Wt({in:t,out:n,typeName:k.ZodPipeline})}};Mt=class Mt extends Y{_parse(t){let n=this._def.innerType._parse(t),b=(o)=>{if(e(o))o.value=Object.freeze(o.value);return o};return vt(n)?n.then((o)=>b(o)):b(n)}unwrap(){return this._def.innerType}};Mt.create=(t,n)=>{return new Mt({innerType:t,typeName:k.ZodReadonly,...H(n)})};Hl={object:J.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(k||(k={}));Zo=O.create,so=s.create,Xl=Ot.create,il=z.create,zo=At.create,Ll=at.create,Ml=Rt.create,Ql=dt.create,Jl=xt.create,Gl=ht.create,Sl=Z.create,Fl=N.create,Rl=Bt.create,Bl=W.create,Dl=J.create,El=J.strictCreate,Ol=qt.create,Wl=Zt.create,ml=kt.create,pl=K.create,ul=Dt.create,Ul=Et.create,Vl=ft.create,Nl=_t.create,Kl=Ht.create,jl=Yt.create,Il=tt.create,Pl=Xt.create,Tl=rt.create,Cl=u.create,yl=m.create,el=C.create,Zl=u.createWithPreprocess,sl=Wt.create,oa={string:(t)=>O.create({...t,coerce:!0}),number:(t)=>s.create({...t,coerce:!0}),boolean:(t)=>At.create({...t,coerce:!0}),bigint:(t)=>z.create({...t,coerce:!0}),date:(t)=>at.create({...t,coerce:!0})},ba=q});var v={};i(v,{void:()=>Rl,util:()=>M,unknown:()=>Sl,union:()=>Ol,undefined:()=>Ql,tuple:()=>pl,transformer:()=>Cl,symbol:()=>Ml,string:()=>Zo,strictObject:()=>El,setErrorMap:()=>eb,set:()=>Vl,record:()=>ul,quotelessJson:()=>Cb,promise:()=>Tl,preprocess:()=>Zl,pipeline:()=>sl,ostring:()=>zl,optional:()=>yl,onumber:()=>ta,oboolean:()=>na,objectUtil:()=>ao,object:()=>Dl,number:()=>so,nullable:()=>el,null:()=>Jl,never:()=>Fl,nativeEnum:()=>Pl,nan:()=>Xl,map:()=>Ul,makeIssue:()=>Ft,literal:()=>jl,lazy:()=>Kl,late:()=>Hl,isValid:()=>e,isDirty:()=>et,isAsync:()=>vt,isAborted:()=>yt,intersection:()=>ml,instanceof:()=>Yl,getParsedType:()=>V,getErrorMap:()=>ct,function:()=>Nl,enum:()=>Il,effect:()=>Cl,discriminatedUnion:()=>Wl,defaultErrorMap:()=>P,datetimeRegex:()=>Co,date:()=>Ll,custom:()=>eo,coerce:()=>oa,boolean:()=>zo,bigint:()=>il,array:()=>Bl,any:()=>Gl,addIssueToContext:()=>w,ZodVoid:()=>Bt,ZodUnknown:()=>Z,ZodUnion:()=>qt,ZodUndefined:()=>dt,ZodType:()=>Y,ZodTuple:()=>K,ZodTransformer:()=>u,ZodSymbol:()=>Rt,ZodString:()=>O,ZodSet:()=>ft,ZodSchema:()=>Y,ZodRecord:()=>Dt,ZodReadonly:()=>Mt,ZodPromise:()=>rt,ZodPipeline:()=>Wt,ZodParsedType:()=>$,ZodOptional:()=>m,ZodObject:()=>J,ZodNumber:()=>s,ZodNullable:()=>C,ZodNull:()=>xt,ZodNever:()=>N,ZodNativeEnum:()=>Xt,ZodNaN:()=>Ot,ZodMap:()=>Et,ZodLiteral:()=>Yt,ZodLazy:()=>Ht,ZodIssueCode:()=>g,ZodIntersection:()=>kt,ZodFunction:()=>_t,ZodFirstPartyTypeKind:()=>k,ZodError:()=>E,ZodEnum:()=>tt,ZodEffects:()=>u,ZodDiscriminatedUnion:()=>Zt,ZodDefault:()=>it,ZodDate:()=>at,ZodCatch:()=>Lt,ZodBranded:()=>st,ZodBoolean:()=>At,ZodBigInt:()=>z,ZodArray:()=>W,ZodAny:()=>ht,Schema:()=>Y,ParseStatus:()=>F,OK:()=>R,NEVER:()=>ba,INVALID:()=>q,EMPTY_PATH:()=>Zb,DIRTY:()=>lt,BRAND:()=>kl});var $o=x(()=>{Ct();fo();No();St();t0();Tt()});var n0=x(()=>{$o();$o()});function co(t,...n){if(la())return;(console[t]||console.log).call(console,...n)}var la=()=>Boolean(globalThis.__AFRICODE_TEST__||globalThis.__AFRICODE_SILENT_LOGS__);function zt(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(zt);let n={};for(let b of Object.keys(t))n[b]=zt(t[b]);return n}function l0(t,n){let b={...t};for(let o of Object.keys(n))if(n[o]!==null&&typeof n[o]==="object"&&!Array.isArray(n[o])&&typeof t[o]==="object"&&!Array.isArray(t[o]))b[o]=l0(t[o]||{},n[o]);else b[o]=n[o];return b}function a0(t={}){return b0=l0(o0,t),aa=!0,mt()}function mt(){return Object.freeze(zt(b0))}var o0,b0,aa=!1;var vo=x(()=>{o0={validation:{trimStrings:!1,emptyAsNullDefault:!1},security:{csrf:{enabled:!0,excludePaths:[],sameSite:"Strict",secure:!1},rateLimit:{enabled:!0,windowMs:60000,maxRequests:60,excludePaths:[]}},hooks:{onValidationError:null,onSecurityViolation:null,onRateLimit:null,onDatabaseError:null,onRequest:null}},b0=zt(o0)});class gt{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(b){if(b instanceof v.ZodError){let o={};return b.errors.forEach((l)=>{let a=l.path.join(".");o[a]=l.message}),{success:!1,errors:o}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(b){if(b instanceof v.ZodError)return{success:!1,error:b.errors[0]?.message||"Invalid value"};return{success:!1,error:"Validation failed"}}}static getFieldError(t,n){if(t.success)return null;return t.errors?.[n]||null}static hasFieldError(t,n){return!!this.getFieldError(t,n)}}class j{constructor(t,n="string"){this._baseSchema=t,this._fieldType=n,this._isNullable=!1,this._isOptional=!1,this._emptyAsNull=!1,this._trim=!1,this._customMessage=null}nullable(){return this._isNullable=!0,this}optional(){return this._isOptional=!0,this}emptyAsNull(){if(!this._isNullable)throw Error(`[AfriCode] .emptyAsNull() requires .nullable() to be called first. Use: afri.${this._fieldType}().nullable().emptyAsNull()`);return this._emptyAsNull=!0,this}trim(){return this._trim=!0,this}message(t){return this._customMessage=t,this}build(){let t=this._baseSchema;if(this._isNullable)t=t.nullable();if(this._isOptional)t=t.optional();return t}getMeta(){return{fieldType:this._fieldType,isNullable:this._isNullable,isOptional:this._isOptional,emptyAsNull:this._emptyAsNull,trim:this._trim}}}function f0(t,n){let b={...n},o=!1;try{o=mt().validation?.trimStrings===!0}catch{}for(let[l,a]of Object.entries(t)){if(!(a instanceof j))continue;let h=a.getMeta(),f=b[l];if(typeof f==="string"&&(h.trim||o))b[l]=f.trim();if(h.emptyAsNull&&b[l]==="")b[l]=null}return b}function r0(t){let n={};for(let[b,o]of Object.entries(t))if(o instanceof j)n[b]=o.build();else n[b]=o;return v.object(n)}var tn,U,h0;var nn=x(()=>{n0();vo();tn={login:v.object({email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain at least one uppercase letter, one lowercase letter, and one number")}),register:v.object({name:v.string().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s'-]+$/,"Name can only contain letters, spaces, hyphens, and apostrophes"),email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])/,"Password must contain uppercase, lowercase, number, and special character"),confirmPassword:v.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:v.object({action:v.literal("register"),email:v.string().min(1,"Email is required").email("Please enter a valid email address"),username:v.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:v.string().min(8,"Password must be at least 8 characters"),full_name:v.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:v.object({action:v.literal("login"),email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters")}),logout:v.object({action:v.literal("logout")}),action:v.discriminatedUnion("action",[v.object({action:v.literal("register")}).merge(v.object({email:v.string().min(1,"Email is required").email("Please enter a valid email address"),username:v.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:v.string().min(8,"Password must be at least 8 characters"),full_name:v.string().min(2,"Full name is required").max(100,"Full name is too long")})),v.object({action:v.literal("login")}).merge(v.object({email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters")})),v.object({action:v.literal("logout")})])},contact:v.object({name:v.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:v.string().email("Please enter a valid email address"),message:v.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:v.string().regex(/^[\+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:v.string().min(1,"URL is required").url("Please enter a valid URL"),required:v.string().min(1,"This field is required"),positiveNumber:v.number().positive("Must be a positive number"),integer:v.number().int("Must be a whole number"),futureDate:v.date().min(new Date,"Date must be in the future"),imageFile:v.instanceof(File).refine((t)=>t.size<=5242880,"File size must be less than 5MB").refine((t)=>["image/jpeg","image/png","image/gif","image/webp"].includes(t.type),"File must be a JPEG, PNG, GIF, or WebP image"),userProfile:v.object({full_name:v.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:v.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:v.string().url("Please enter a valid URL").nullable().optional(),theme:v.enum(["africanity","dark","light","system"]).optional(),language:v.string().min(2).max(10).optional()}),project:v.object({name:v.string().min(1,"Project name is required").max(100,"Project name is too long"),description:v.string().max(1000,"Description is too long").nullable().optional(),repository_url:v.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:v.string().url("Please enter a valid demo URL").nullable().optional(),tags:v.array(v.string()).optional(),is_public:v.boolean().optional()})};U={required:(t="This field is required")=>v.string().min(1,t),email:(t="Please enter a valid email address")=>v.string().email(t),minLength:(t,n)=>v.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>v.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>v.string().regex(t,n),numeric:(t="Must be a number")=>v.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>v.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>v.string().min(1,"URL is required").url(t)};h0={url(t="Please enter a valid URL"){return new j(v.string().min(1,"URL cannot be empty").url(t),"url")},email(t="Please enter a valid email address"){return new j(v.string().min(1,"Email cannot be empty").email(t),"email")},string(t={}){let n=v.string();if(t.min!==void 0)n=n.min(t.min,t.message||`Must be at least ${t.min} characters`);if(t.max!==void 0)n=n.max(t.max,t.message||`Must be less than ${t.max} characters`);return new j(n,"string")},number(t={}){let n=v.number();if(t.min!==void 0)n=n.min(t.min);if(t.max!==void 0)n=n.max(t.max);if(t.int)n=n.int("Must be a whole number");return new j(n,"number")},phone(t="Please enter a valid phone number"){return new j(v.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),"phone")}}});function _(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var fa,A0,c;var X=x(()=>{fa=globalThis.HTMLElement??class{},A0=typeof CSSStyleSheet<"u";c=class c extends fa{constructor(){super();this.attachShadow({mode:"open"});let t=this.render;if(t&&typeof t==="function")this.render=()=>{try{t.call(this),this.removeAttribute("has-error")}catch(n){console.error(`[AfriCode] Rendering error in <${this.localName}>:`,n),this.setAttribute("has-error","true"),this.shadowRoot.innerHTML=`
372
372
  <style>
373
373
  .af-local-error {
374
374
  padding: 1rem;
@@ -387,7 +387,257 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
387
387
  <span aria-hidden="true">⚠️</span>
388
388
  <span>Failed to render</span>
389
389
  </div>
390
- `,this.emit("af-component-error",{component:this.localName,message:n.message,stack:n.stack})}}}connectedCallback(){}static styleCache=new Map;static globalSheets=[];static injectGlobalSheet(t){if(!lb)return;if(!(t instanceof CSSStyleSheet))return;if(!r.globalSheets.includes(t))r.globalSheets.push(t)}async loadStyles(t=""){if(!this.shadowRoot)return;let o=lb&&"adoptedStyleSheets"in this.shadowRoot,b=typeof t==="string"&&t.length>0?t:"/styles/africanity.css",l=typeof t==="string"&&t.length>0?t:null;if(r.styleCache.has(b)){let h=r.styleCache.get(b);if(o)this.shadowRoot.adoptedStyleSheets=[h,...r.globalSheets];else this._applyFallbackStyle(h?.cssText||h?.text||h||"");return}try{let h=l;if(!h){let f=await fetch("/styles/africanity.css");if(!f.ok)throw Error(`Unable to load stylesheet: ${f.status}`);h=await f.text()}if(o){let f=new CSSStyleSheet;f.replaceSync(h),r.styleCache.set(b,f),this.shadowRoot.adoptedStyleSheets=[f,...r.globalSheets];return}this._applyFallbackStyle(h),r.styleCache.set(b,{text:h})}catch(h){this._applyFallbackStyle(l||"")}}_applyFallbackStyle(t){if(!this.shadowRoot)return;let n=this.shadowRoot.querySelector("style[data-africode-core-styles]");if(!n)n=document.createElement("style"),n.setAttribute("data-africode-core-styles",""),this.shadowRoot.prepend(n);n.textContent=t}spacing(t){return`var(--space-${t})`}createElement(t,{classes:n=[],attributes:o={},text:b=""}={}){let l=document.createElement(t);if(n.length)l.classList.add(...n);if(Object.entries(o).forEach(([h,f])=>l.setAttribute(h,f)),b)l.textContent=b;return l}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var hb={};L(hb,{default:()=>il,AfriButton:()=>st});var st,il;var fb=Y(()=>{M();st=class st extends r{static get observedAttributes(){return["variant","size","theme","disabled","loading","icon","aria-label"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(n)=>{if(this.hasAttribute("disabled")||this.hasAttribute("loading")){n.preventDefault();return}this.emit("af-click",{originalEvent:n})})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"primary",n=this.getAttribute("size")||"md",o=this.getAttribute("theme")||"tanzania",b=this.hasAttribute("disabled"),l=this.hasAttribute("loading"),h=this.getAttribute("icon"),f=this.getAttribute("aria-label"),a={tanzania:{primary:"#1EB53A",accent:"#FCD116",text:"#FFFFFF"},maasai:{primary:"#FF0000",accent:"#8B0000",text:"#FFFFFF"},ndebele:{primary:"#4169E1",accent:"#FFD700",text:"#FFFFFF"},ocean:{primary:"#00A3DD",accent:"#0077BE",text:"#FFFFFF"}},g=a[o]||a.tanzania;this.shadowRoot.innerHTML=`
390
+ `,this.emit("af-component-error",{component:this.localName,message:n.message,stack:n.stack})}}}connectedCallback(){}static styleCache=new Map;static globalSheets=[];static injectGlobalSheet(t){if(!A0)return;if(!(t instanceof CSSStyleSheet))return;if(!c.globalSheets.includes(t))c.globalSheets.push(t)}async loadStyles(t=""){if(!this.shadowRoot)return;let b=A0&&"adoptedStyleSheets"in this.shadowRoot,o=typeof t==="string"&&t.length>0?t:"/styles/africanity.css",l=typeof t==="string"&&t.length>0?t:null;if(c.styleCache.has(o)){let a=c.styleCache.get(o);if(b)this.shadowRoot.adoptedStyleSheets=[a,...c.globalSheets];else this._applyFallbackStyle(a?.cssText||a?.text||a||"");return}try{let a=l;if(!a){let h=await fetch("/styles/africanity.css");if(!h.ok)throw Error(`Unable to load stylesheet: ${h.status}`);a=await h.text()}if(b){let h=new CSSStyleSheet;h.replaceSync(a),c.styleCache.set(o,h),this.shadowRoot.adoptedStyleSheets=[h,...c.globalSheets];return}this._applyFallbackStyle(a),c.styleCache.set(o,{text:a})}catch(a){this._applyFallbackStyle(l||"")}}_applyFallbackStyle(t){if(!this.shadowRoot)return;let n=this.shadowRoot.querySelector("style[data-africode-core-styles]");if(!n)n=document.createElement("style"),n.setAttribute("data-africode-core-styles",""),this.shadowRoot.prepend(n);n.textContent=t}spacing(t){return`var(--space-${t})`}createElement(t,{classes:n=[],attributes:b={},text:o=""}={}){let l=document.createElement(t);if(n.length)l.classList.add(...n);if(Object.entries(b).forEach(([a,h])=>l.setAttribute(a,h)),o)l.textContent=o;return l}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var d0={};i(d0,{default:()=>ra,AfriUIButton:()=>ut});var ut,ra;var io=x(()=>{X();ut=class ut extends c{static get observedAttributes(){return["variant","size","disabled","loading","full-width","aria-label"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(n)=>{if(this.hasAttribute("disabled")||this.hasAttribute("loading")){n.preventDefault();return}this.emit("af-ui-button-click",{originalEvent:n})})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"primary",n=this.getAttribute("size")||"md",b=this.hasAttribute("disabled"),o=this.hasAttribute("loading"),l=this.getAttribute("aria-label")||"";this.shadowRoot.innerHTML=Q`
391
+ <style>
392
+ :host { display: inline-block; }
393
+
394
+ button {
395
+ all: unset;
396
+ box-sizing: border-box;
397
+ min-height: 42px;
398
+ padding: 0 18px;
399
+ border-radius: 999px;
400
+ font-family: 'Inter', system-ui, sans-serif;
401
+ font-weight: 600;
402
+ cursor: pointer;
403
+ display: inline-flex;
404
+ align-items: center;
405
+ justify-content: center;
406
+ gap: 0.5rem;
407
+ transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
408
+ text-decoration: none;
409
+ border: 1px solid transparent;
410
+ user-select: none;
411
+ white-space: nowrap;
412
+ }
413
+
414
+ :host([full-width]) button { width: 100%; }
415
+
416
+ button.primary {
417
+ background: #2563eb;
418
+ color: #fff;
419
+ box-shadow: 0 8px 24px rgba(37, 99, 235, 0.24);
420
+ }
421
+
422
+ button.primary:hover:not(:disabled) {
423
+ transform: translateY(-1px);
424
+ background: #1d4ed8;
425
+ }
426
+
427
+ button.secondary {
428
+ background: #f8fafc;
429
+ color: #1f2937;
430
+ border-color: #cbd5e1;
431
+ }
432
+
433
+ button.secondary:hover:not(:disabled) {
434
+ background: #e2e8f0;
435
+ }
436
+
437
+ button.ghost {
438
+ background: transparent;
439
+ color: #0f172a;
440
+ }
441
+
442
+ button.ghost:hover:not(:disabled) {
443
+ background: rgba(15, 23, 42, 0.05);
444
+ }
445
+
446
+ button.link {
447
+ background: transparent;
448
+ color: #2563eb;
449
+ box-shadow: none;
450
+ padding: 0;
451
+ border-radius: 0;
452
+ }
453
+
454
+ button.link:hover:not(:disabled) {
455
+ text-decoration: underline;
456
+ }
457
+
458
+ button.size-sm { min-height: 34px; padding: 0 14px; font-size: 0.85rem; }
459
+ button.size-md { min-height: 42px; padding: 0 18px; font-size: 0.95rem; }
460
+ button.size-lg { min-height: 50px; padding: 0 22px; font-size: 1rem; }
461
+
462
+ button:disabled {
463
+ opacity: 0.55;
464
+ cursor: not-allowed;
465
+ transform: none;
466
+ box-shadow: none;
467
+ }
468
+
469
+ .spinner {
470
+ width: 18px;
471
+ height: 18px;
472
+ border: 2px solid currentColor;
473
+ border-bottom-color: transparent;
474
+ border-radius: 999px;
475
+ animation: spin 0.8s linear infinite;
476
+ }
477
+
478
+ @keyframes spin { to { transform: rotate(360deg); } }
479
+ </style>
480
+
481
+ <button
482
+ class="${t} ${n}"
483
+ ${b?"disabled":""}
484
+ ${l?`aria-label="${l}"`:""}
485
+ ${o?'aria-busy="true"':""}
486
+ >
487
+ ${o?Q`<span class="spinner"></span>`:""}
488
+ <slot></slot>
489
+ </button>
490
+ `}};_("af-ui-button",ut);ra=ut});var x0={};i(x0,{default:()=>ga,AfriUICard:()=>Ut});var Ut,ga;var Lo=x(()=>{X();Ut=class Ut extends c{static get observedAttributes(){return["variant","bordered","clickable"]}constructor(){super();this.render()}connectedCallback(){if(this.loadStyles(),this.hasAttribute("clickable"))this.shadowRoot.querySelector(".card")?.addEventListener("click",()=>{this.emit("af-ui-card-click")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"elevated",n=this.hasAttribute("bordered"),b=this.hasAttribute("clickable");this.shadowRoot.innerHTML=Q`
491
+ <style>
492
+ :host { display: block; }
493
+
494
+ .card {
495
+ border-radius: 1rem;
496
+ padding: 1.5rem;
497
+ background: #ffffff;
498
+ color: #0f172a;
499
+ transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
500
+ border: 1px solid transparent;
501
+ box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
502
+ }
503
+
504
+ .card.elevated { background: #fff; }
505
+ .card.flat { background: #f8fafc; box-shadow: none; }
506
+ .card.outlined { background: #fff; border-color: #e2e8f0; box-shadow: none; }
507
+
508
+ .card:hover:not(.disabled) {
509
+ transform: translateY(-2px);
510
+ }
511
+
512
+ :host([bordered]) .card { border-color: #cbd5e1; }
513
+
514
+ :host([clickable]) .card { cursor: pointer; }
515
+ </style>
516
+
517
+ <article class="card ${t}">
518
+ <slot></slot>
519
+ </article>
520
+ `}};_("af-ui-card",Ut);ga=Ut});var q0={};i(q0,{default:()=>$a,AfriUIInput:()=>Vt});var Vt,$a;var Mo=x(()=>{X();Vt=class Vt extends c{static get observedAttributes(){return["label","placeholder","type","value","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",()=>{this.emit("af-ui-input",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"",b=this.getAttribute("type")||"text",o=this.getAttribute("value")||"",l=this.hasAttribute("disabled"),a=this.getAttribute("error")||"";this.shadowRoot.innerHTML=Q`
521
+ <style>
522
+ :host { display: block; font-family: 'Inter', system-ui, sans-serif; }
523
+
524
+ label {
525
+ display: block;
526
+ font-size: 0.85rem;
527
+ font-weight: 600;
528
+ margin-bottom: 0.5rem;
529
+ color: #111827;
530
+ }
531
+
532
+ .field {
533
+ display: grid;
534
+ gap: 0.45rem;
535
+ }
536
+
537
+ input {
538
+ width: 100%;
539
+ border: 1px solid #d1d5db;
540
+ border-radius: 0.75rem;
541
+ padding: 0.95rem 1rem;
542
+ font-size: 0.95rem;
543
+ color: #111827;
544
+ background: #ffffff;
545
+ transition: border-color 150ms ease, box-shadow 150ms ease;
546
+ }
547
+
548
+ input:focus {
549
+ outline: none;
550
+ border-color: #2563eb;
551
+ box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
552
+ }
553
+
554
+ input:disabled {
555
+ opacity: 0.65;
556
+ cursor: not-allowed;
557
+ background: #f8fafc;
558
+ }
559
+
560
+ .error {
561
+ color: #dc2626;
562
+ font-size: 0.8rem;
563
+ min-height: 1rem;
564
+ }
565
+ </style>
566
+
567
+ <div class="field">
568
+ ${t?Q`<label>${t}</label>`:""}
569
+ <input
570
+ type="${b}"
571
+ placeholder="${n}"
572
+ value="${o}"
573
+ ${l?"disabled":""}
574
+ aria-invalid="${Boolean(a)}"
575
+ />
576
+ <div class="error">${a}</div>
577
+ </div>
578
+ `}};_("af-ui-input",Vt);$a=Vt});var k0={};i(k0,{default:()=>ca,AfriUIBadge:()=>Nt});var Nt,ca;var Qo=x(()=>{X();Nt=class Nt extends c{static get observedAttributes(){return["variant","size","pill"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"secondary",n=this.getAttribute("size")||"md",b=this.hasAttribute("pill");this.shadowRoot.innerHTML=Q`
579
+ <style>
580
+ :host { display: inline-block; font-family: 'Inter', system-ui, sans-serif; }
581
+
582
+ .badge {
583
+ display: inline-flex;
584
+ align-items: center;
585
+ justify-content: center;
586
+ gap: 0.4rem;
587
+ border-radius: ${b?"999px":"0.6rem"};
588
+ padding: ${n==="sm"?"0.25rem 0.65rem":n==="lg"?"0.55rem 1rem":"0.4rem 0.8rem"};
589
+ font-size: ${n==="sm"?"0.75rem":n==="lg"?"0.95rem":"0.85rem"};
590
+ font-weight: 700;
591
+ color: #111827;
592
+ background: var(--af-ui-badge-bg, #e2e8f0);
593
+ border: 1px solid transparent;
594
+ white-space: nowrap;
595
+ }
596
+
597
+ .badge.primary { background: #2563eb; color: #ffffff; }
598
+ .badge.success { background: #16a34a; color: #ffffff; }
599
+ .badge.warning { background: #f59e0b; color: #0f172a; }
600
+ .badge.danger { background: #dc2626; color: #ffffff; }
601
+ .badge.secondary { background: #f8fafc; color: #0f172a; }
602
+ </style>
603
+
604
+ <span class="badge ${t}"><slot></slot></span>
605
+ `}};_("af-ui-badge",Nt);ca=Nt});var H0={};i(H0,{default:()=>va,AfriUISwitch:()=>Kt});var Kt,va;var Jo=x(()=>{X();Kt=class Kt extends c{static get observedAttributes(){return["checked","disabled","size"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(t)=>{if(this.hasAttribute("disabled"))return;let n=!this.hasAttribute("checked");if(n)this.setAttribute("checked","");else this.removeAttribute("checked");this.emit("af-ui-switch-toggle",{checked:n,originalEvent:t})})}attributeChangedCallback(){this.render()}render(){let t=this.hasAttribute("checked"),n=this.hasAttribute("disabled"),b=this.getAttribute("size")||"md",o=b==="sm"?{width:36,height:20,knob:14}:b==="lg"?{width:56,height:32,knob:24}:{width:48,height:28,knob:20},l=t?"true":"false";this.shadowRoot.innerHTML=Q`
606
+ <style>
607
+ :host { display: inline-block; }
608
+
609
+ button {
610
+ all: unset;
611
+ position: relative;
612
+ width: ${o.width}px;
613
+ height: ${o.height}px;
614
+ border-radius: ${o.height/2}px;
615
+ background: ${t?"#2563eb":"#e5e7eb"};
616
+ cursor: ${n?"not-allowed":"pointer"};
617
+ transition: background 180ms ease;
618
+ box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
619
+ }
620
+
621
+ .knob {
622
+ position: absolute;
623
+ top: 50%;
624
+ left: ${t?`${o.width-o.knob-4}px`:"4px"};
625
+ transform: translateY(-50%);
626
+ width: ${o.knob}px;
627
+ height: ${o.knob}px;
628
+ border-radius: 999px;
629
+ background: #ffffff;
630
+ transition: left 180ms ease;
631
+ box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
632
+ }
633
+
634
+ button:disabled { opacity: 0.65; }
635
+ </style>
636
+
637
+ <button role="switch" aria-checked="${l}" ${n?"disabled":""}>
638
+ <span class="knob"></span>
639
+ </button>
640
+ `}};_("af-ui-switch",Kt);va=Kt});var Y0={};i(Y0,{default:()=>wa,AfriButton:()=>bn});var bn,wa;var X0=x(()=>{X();bn=class bn extends c{static get observedAttributes(){return["variant","size","theme","disabled","loading","icon","aria-label"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(n)=>{if(this.hasAttribute("disabled")||this.hasAttribute("loading")){n.preventDefault();return}this.emit("af-click",{originalEvent:n})})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"primary",n=this.getAttribute("size")||"md",b=this.getAttribute("theme")||"tanzania",o=this.hasAttribute("disabled"),l=this.hasAttribute("loading"),a=this.getAttribute("icon"),h=this.getAttribute("aria-label"),f={tanzania:{primary:"#1EB53A",accent:"#FCD116",text:"#FFFFFF"},maasai:{primary:"#FF0000",accent:"#8B0000",text:"#FFFFFF"},ndebele:{primary:"#4169E1",accent:"#FFD700",text:"#FFFFFF"},ocean:{primary:"#00A3DD",accent:"#0077BE",text:"#FFFFFF"}},r=f[b]||f.tanzania;this.shadowRoot.innerHTML=`
391
641
  <style>
392
642
  :host {
393
643
  display: inline-block;
@@ -415,8 +665,8 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
415
665
 
416
666
  /* Variants */
417
667
  .variant-primary {
418
- background: ${g.primary};
419
- color: ${g.text};
668
+ background: ${r.primary};
669
+ color: ${r.text};
420
670
  }
421
671
  .variant-primary:hover:not(:disabled) {
422
672
  filter: brightness(1.1);
@@ -426,25 +676,25 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
426
676
 
427
677
  .variant-secondary {
428
678
  background: transparent;
429
- color: ${g.primary};
430
- border: 2px solid ${g.primary};
679
+ color: ${r.primary};
680
+ border: 2px solid ${r.primary};
431
681
  }
432
682
  .variant-secondary:hover:not(:disabled) {
433
- background: ${g.primary};
434
- color: ${g.text};
683
+ background: ${r.primary};
684
+ color: ${r.text};
435
685
  }
436
686
 
437
687
  .variant-ghost {
438
688
  background: transparent;
439
- color: ${g.primary};
689
+ color: ${r.primary};
440
690
  }
441
691
  .variant-ghost:hover:not(:disabled) {
442
692
  background: rgba(0,0,0,0.05);
443
693
  }
444
694
 
445
695
  .variant-gradient {
446
- background: linear-gradient(135deg, ${g.primary} 0%, ${g.accent} 100%);
447
- color: ${g.text};
696
+ background: linear-gradient(135deg, ${r.primary} 0%, ${r.accent} 100%);
697
+ color: ${r.text};
448
698
  }
449
699
  .variant-gradient:hover:not(:disabled) {
450
700
  transform: translateY(-2px);
@@ -483,15 +733,15 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
483
733
 
484
734
  <button
485
735
  class="variant-${t} size-${n}"
486
- ${b?"disabled":""}
487
- ${f?`aria-label="${f}"`:""}
736
+ ${o?"disabled":""}
737
+ ${h?`aria-label="${h}"`:""}
488
738
  ${l?'aria-busy="true"':""}
489
739
  >
490
740
  ${l?'<span class="spinner"></span>':""}
491
- ${h&&!l?`<span class="icon">${h}</span>`:""}
741
+ ${a&&!l?`<span class="icon">${a}</span>`:""}
492
742
  <slot></slot>
493
743
  </button>
494
- `}};A("af-button",st);il=st});var ab={};L(ab,{default:()=>Cl,AfriCard:()=>zt});var zt,Cl;var gb=Y(()=>{M();zt=class zt extends r{static get observedAttributes(){return["theme","variant","clickable","image"]}constructor(){super();this.render()}connectedCallback(){if(this.hasAttribute("clickable"))this.shadowRoot.querySelector(".card").addEventListener("click",()=>{this.emit("af-click")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"default",n=this.getAttribute("variant")||"elevated",o=this.hasAttribute("clickable"),b=this.getAttribute("image"),l={default:{accent:"#333",border:"#eee"},tanzania:{accent:"#1EB53A",border:"#1EB53A"},maasai:{accent:"#FF0000",border:"#8B0000"},ndebele:{accent:"#4169E1",border:"#4169E1"}},f={elevated:"box-shadow: 0 2px 12px rgba(0,0,0,0.1);",outlined:`border: 2px solid ${(l[t]||l.default).border};`,flat:"background: #f8f9fa;"};this.shadowRoot.innerHTML=html`
744
+ `}};_("af-button",bn);wa=bn});var i0={};i(i0,{default:()=>_a,AfriCard:()=>ln});var ln,_a;var L0=x(()=>{X();ln=class ln extends c{static get observedAttributes(){return["theme","variant","clickable","image"]}constructor(){super();this.render()}connectedCallback(){if(this.hasAttribute("clickable"))this.shadowRoot.querySelector(".card").addEventListener("click",()=>{this.emit("af-click")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"default",n=this.getAttribute("variant")||"elevated",b=this.hasAttribute("clickable"),o=this.getAttribute("image"),l={default:{accent:"#333",border:"#eee"},tanzania:{accent:"#1EB53A",border:"#1EB53A"},maasai:{accent:"#FF0000",border:"#8B0000"},ndebele:{accent:"#4169E1",border:"#4169E1"}},h={elevated:"box-shadow: 0 2px 12px rgba(0,0,0,0.1);",outlined:`border: 2px solid ${(l[t]||l.default).border};`,flat:"background: #f8f9fa;"};this.shadowRoot.innerHTML=html`
495
745
  <style>
496
746
  :host {
497
747
  display: block;
@@ -506,7 +756,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
506
756
  overflow: hidden;
507
757
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
508
758
  position: relative;
509
- ${o?"cursor: pointer;":""}
759
+ ${b?"cursor: pointer;":""}
510
760
  }
511
761
 
512
762
  .card::before {
@@ -517,7 +767,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
517
767
  pointer-events: none;
518
768
  }
519
769
 
520
- ${o?`
770
+ ${b?`
521
771
  .card:hover {
522
772
  transform: translateY(-8px);
523
773
  border-color: rgba(252, 209, 22, 0.4);
@@ -559,7 +809,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
559
809
  </style>
560
810
 
561
811
  <article class="card">
562
- ${b?`<img class="card-image" src="${b}" alt="" />`:""}
812
+ ${o?`<img class="card-image" src="${o}" alt="" />`:""}
563
813
  <div class="card-body">
564
814
  <slot></slot>
565
815
  </div>
@@ -569,7 +819,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
569
819
  </div>
570
820
  `:""}
571
821
  </article>
572
- `}};A("af-card",zt);Cl=zt});var $b={};L($b,{default:()=>yl,AfriNavbar:()=>tn});var tn,yl;var vb=Y(()=>{M();kt();ot();tn=class tn extends r{static get observedAttributes(){return["theme","logo","sticky"]}constructor(){super();this._isOpen=!1,this._unsubscribe=null,this.render()}connectedCallback(){super.connectedCallback(),this.shadowRoot.querySelector(".menu-toggle")?.addEventListener("click",()=>{this._isOpen=!this._isOpen;let t=this.shadowRoot.querySelector(".nav-links"),n=this.shadowRoot.querySelector(".menu-toggle");if(t)t.classList.toggle("open",this._isOpen);if(n)n.classList.toggle("open",this._isOpen),n.setAttribute("aria-expanded",String(this._isOpen))})}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"dark",n=this.getAttribute("logo")||"AfriCode",o=this.hasAttribute("sticky");this.shadowRoot.innerHTML=`
822
+ `}};_("af-card",ln);_a=ln});var M0={};i(M0,{default:()=>Aa,AfriNavbar:()=>an});var an,Aa;var Q0=x(()=>{X();Qt();bt();an=class an extends c{static get observedAttributes(){return["theme","logo","sticky"]}constructor(){super();this._isOpen=!1,this._unsubscribe=null,this.render()}connectedCallback(){super.connectedCallback(),this.shadowRoot.querySelector(".menu-toggle")?.addEventListener("click",()=>{this._isOpen=!this._isOpen;let t=this.shadowRoot.querySelector(".nav-links"),n=this.shadowRoot.querySelector(".menu-toggle");if(t)t.classList.toggle("open",this._isOpen);if(n)n.classList.toggle("open",this._isOpen),n.setAttribute("aria-expanded",String(this._isOpen))})}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"dark",n=this.getAttribute("logo")||"AfriCode",b=this.hasAttribute("sticky");this.shadowRoot.innerHTML=`
573
823
  <style>
574
824
  :host {
575
825
  display: block;
@@ -745,7 +995,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
745
995
  <slot></slot>
746
996
  </div>
747
997
  </nav>
748
- `}};A("af-navbar",tn);yl=tn});var wb={};L(wb,{default:()=>Zl,AfriInput:()=>nn});var nn,Zl;var _b=Y(()=>{M();Zt();nn=class nn extends r{static get observedAttributes(){return["type","name","label","placeholder","error","helper","theme","icon","required","aria-label","aria-describedby","validation"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}get value(){return this.shadowRoot.querySelector("input")?.value||""}set value(t){let n=this.shadowRoot.querySelector("input");if(n)n.value=t}connectedCallback(){this._attachInputListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachInputListeners()}_attachInputListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",(n)=>{if(this.emit("af-input",{value:n.target.value}),this.hasAttribute("error"))this.removeAttribute("error")}),t.addEventListener("blur",()=>{this.emit("af-blur",{value:this.value}),this._validateInput()})}_setupValidation(){if(!this.getAttribute("validation"))return;let n=this.shadowRoot.querySelector("input");if(!n)return;n.addEventListener("input",()=>{if(this.hasAttribute("error"))this.removeAttribute("error")})}_validateInput(){let t=this.shadowRoot.querySelector("input");if(!t)return;let n=this.getAttribute("validation"),o=t.value;if(this.hasAttribute("required")&&!o.trim()){this.setAttribute("error","This field is required");return}if(n&&o.trim()){let l=this._getValidationSchema(n);if(l){let h=$t.validateField(l,o);if(!h.success)this.setAttribute("error",h.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:m.email(),password:m.password(),phone:m.phone(),url:m.url(),required:m.required()};if(t.includes(":")){let[o,b]=t.split(":"),l=parseInt(b);switch(o){case"minLength":return m.minLength(l);case"maxLength":return m.maxLength(l);case"pattern":return m.pattern(new RegExp(b),"Invalid format")}}return n[t]||null}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",o=this.getAttribute("label")||"",b=this.getAttribute("placeholder")||"",l=this.getAttribute("error")||"",h=this.getAttribute("helper")||"",f=this.getAttribute("theme")||"tanzania",a=this.getAttribute("icon")||"",g=this.hasAttribute("required"),c=this.getAttribute("aria-label"),J=this.getAttribute("aria-describedby"),F={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},S=F[f]||F.tanzania,O=[];if(l)O.push(`error-${this._uniqueId}`);else if(h)O.push(`helper-${this._uniqueId}`);if(J)O.push(...J.split(" "));let Fn=O.length>0?`aria-describedby="${O.join(" ")}"`:"";this.shadowRoot.innerHTML=`
998
+ `}};_("af-navbar",an);Aa=an});var J0={};i(J0,{default:()=>da,AfriInput:()=>hn});var hn,da;var G0=x(()=>{X();nn();hn=class hn extends c{static get observedAttributes(){return["type","name","label","placeholder","error","helper","theme","icon","required","aria-label","aria-describedby","validation"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}get value(){return this.shadowRoot.querySelector("input")?.value||""}set value(t){let n=this.shadowRoot.querySelector("input");if(n)n.value=t}connectedCallback(){this._attachInputListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachInputListeners()}_attachInputListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",(n)=>{if(this.emit("af-input",{value:n.target.value}),this.hasAttribute("error"))this.removeAttribute("error")}),t.addEventListener("blur",()=>{this.emit("af-blur",{value:this.value}),this._validateInput()})}_setupValidation(){if(!this.getAttribute("validation"))return;let n=this.shadowRoot.querySelector("input");if(!n)return;n.addEventListener("input",()=>{if(this.hasAttribute("error"))this.removeAttribute("error")})}_validateInput(){let t=this.shadowRoot.querySelector("input");if(!t)return;let n=this.getAttribute("validation"),b=t.value;if(this.hasAttribute("required")&&!b.trim()){this.setAttribute("error","This field is required");return}if(n&&b.trim()){let l=this._getValidationSchema(n);if(l){let a=gt.validateField(l,b);if(!a.success)this.setAttribute("error",a.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:U.email(),password:U.password(),phone:U.phone(),url:U.url(),required:U.required()};if(t.includes(":")){let[b,o]=t.split(":"),l=parseInt(o);switch(b){case"minLength":return U.minLength(l);case"maxLength":return U.maxLength(l);case"pattern":return U.pattern(new RegExp(o),"Invalid format")}}return n[t]||null}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",b=this.getAttribute("label")||"",o=this.getAttribute("placeholder")||"",l=this.getAttribute("error")||"",a=this.getAttribute("helper")||"",h=this.getAttribute("theme")||"tanzania",f=this.getAttribute("icon")||"",r=this.hasAttribute("required"),A=this.getAttribute("aria-label"),L=this.getAttribute("aria-describedby"),S={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},G=S[h]||S.tanzania,B=[];if(l)B.push(`error-${this._uniqueId}`);else if(a)B.push(`helper-${this._uniqueId}`);if(L)B.push(...L.split(" "));let En=B.length>0?`aria-describedby="${B.join(" ")}"`:"";this.shadowRoot.innerHTML=`
749
999
  <style>
750
1000
  :host {
751
1001
  display: block;
@@ -765,7 +1015,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
765
1015
  }
766
1016
 
767
1017
  .required-star {
768
- color: ${S.error};
1018
+ color: ${G.error};
769
1019
  margin-left: 2px;
770
1020
  }
771
1021
 
@@ -778,7 +1028,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
778
1028
  input {
779
1029
  width: 100%;
780
1030
  padding: 10px 13px;
781
- ${a?"padding-left: 40px;":""}
1031
+ ${f?"padding-left: 40px;":""}
782
1032
  font-size: 15px;
783
1033
  border: 2px solid #ddd;
784
1034
  border-radius: 5px;
@@ -789,12 +1039,12 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
789
1039
 
790
1040
  input:focus {
791
1041
  outline: none;
792
- border-color: ${l?S.error:S.focus};
793
- box-shadow: 0 0 0 3px ${l?S.error+"20":S.focus+"20"};
1042
+ border-color: ${l?G.error:G.focus};
1043
+ box-shadow: 0 0 0 3px ${l?G.error+"20":G.focus+"20"};
794
1044
  }
795
1045
 
796
1046
  input.has-error {
797
- border-color: ${S.error};
1047
+ border-color: ${G.error};
798
1048
  }
799
1049
 
800
1050
  .icon {
@@ -814,30 +1064,30 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
814
1064
  .error-text {
815
1065
  font-size: 12px;
816
1066
  margin-top: 4px;
817
- color: ${S.error};
1067
+ color: ${G.error};
818
1068
  }
819
1069
  </style>
820
1070
 
821
1071
  <div class="input-wrapper">
822
- ${o?`<label for="input-${this._uniqueId}">${o}${g?'<span class="required-star">*</span>':""}</label>`:""}
1072
+ ${b?`<label for="input-${this._uniqueId}">${b}${r?'<span class="required-star">*</span>':""}</label>`:""}
823
1073
  <div class="input-container">
824
- ${a?`<span class="icon">${a}</span>`:""}
1074
+ ${f?`<span class="icon">${f}</span>`:""}
825
1075
  <input
826
1076
  id="input-${this._uniqueId}"
827
1077
  name="${n}"
828
1078
  type="${t}"
829
- placeholder="${b}"
1079
+ placeholder="${o}"
830
1080
  class="${l?"has-error":""}"
831
- ${g?"required":""}
832
- ${c?`aria-label="${c}"`:""}
1081
+ ${r?"required":""}
1082
+ ${A?`aria-label="${A}"`:""}
833
1083
  ${l?'aria-invalid="true"':""}
834
- ${Fn}
1084
+ ${En}
835
1085
  />
836
1086
  </div>
837
1087
  ${l?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${l}</div>`:""}
838
- ${h&&!l?`<div id="helper-${this._uniqueId}" class="helper-text">${h}</div>`:""}
1088
+ ${a&&!l?`<div id="helper-${this._uniqueId}" class="helper-text">${a}</div>`:""}
839
1089
  </div>
840
- `}};A("af-input",nn);Zl=nn});var rb={};L(rb,{default:()=>el,AfriAlert:()=>bn});var bn,el;var cb=Y(()=>{M();bn=class bn extends r{static get observedAttributes(){return["type","title","dismissible"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector(".close-btn")?.addEventListener("click",()=>{this.remove(),this.emit("af-dismiss")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"info",n=this.getAttribute("title")||"",o=this.hasAttribute("dismissible"),b={success:{bg:"#d4edda",border:"#1EB53A",text:"#155724",icon:"✓"},warning:{bg:"#fff3cd",border:"#FCD116",text:"#856404",icon:"⚠"},error:{bg:"#f8d7da",border:"#DC3545",text:"#721c24",icon:"✕"},info:{bg:"#d1ecf1",border:"#00A3DD",text:"#0c5460",icon:"ℹ"}},l=b[t]||b.info;this.shadowRoot.innerHTML=`
1090
+ `}};_("af-input",hn);da=hn});var S0={};i(S0,{default:()=>xa,AfriAlert:()=>fn});var fn,xa;var F0=x(()=>{X();fn=class fn extends c{static get observedAttributes(){return["type","title","dismissible"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector(".close-btn")?.addEventListener("click",()=>{this.remove(),this.emit("af-dismiss")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"info",n=this.getAttribute("title")||"",b=this.hasAttribute("dismissible"),o={success:{bg:"#d4edda",border:"#1EB53A",text:"#155724",icon:"✓"},warning:{bg:"#fff3cd",border:"#FCD116",text:"#856404",icon:"⚠"},error:{bg:"#f8d7da",border:"#DC3545",text:"#721c24",icon:"✕"},info:{bg:"#d1ecf1",border:"#00A3DD",text:"#0c5460",icon:"ℹ"}},l=o[t]||o.info;this.shadowRoot.innerHTML=`
841
1091
  <style>
842
1092
  :host {
843
1093
  display: block;
@@ -915,36 +1165,36 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
915
1165
  ${n?`<div class="title">${n}</div>`:""}
916
1166
  <slot></slot>
917
1167
  </div>
918
- ${o?'<button class="close-btn" aria-label="Dismiss">×</button>':""}
1168
+ ${b?'<button class="close-btn" aria-label="Dismiss">×</button>':""}
919
1169
  </div>
920
- `}};A("af-alert",bn);el=bn});var Ab={};L(Ab,{AfriGrid:()=>H0});function sl(t,n){let{sidebarSide:o="left",sidebarWidth:b="280px",minWidth:l="280px",gap:h="24px",columns:f,rows:a,align:g="stretch",justify:c="stretch",dense:J=!1}=n,F=J?"dense":"",S=`
921
- align-items: ${g};
922
- justify-items: ${c};
923
- gap: ${h};
924
- `;switch(t){case"sidebar":return o==="right"?`display: grid; grid-template-columns: 1fr ${b}; ${S}`:`display: grid; grid-template-columns: ${b} 1fr; ${S}`;case"holy-grail":return`
1170
+ `}};_("af-alert",fn);xa=fn});var R0={};i(R0,{AfriGrid:()=>Go});function qa(t,n){let{sidebarSide:b="left",sidebarWidth:o="280px",minWidth:l="280px",gap:a="24px",columns:h,rows:f,align:r="stretch",justify:A="stretch",dense:L=!1}=n,S=L?"dense":"",G=`
1171
+ align-items: ${r};
1172
+ justify-items: ${A};
1173
+ gap: ${a};
1174
+ `;switch(t){case"sidebar":return b==="right"?`display: grid; grid-template-columns: 1fr ${o}; ${G}`:`display: grid; grid-template-columns: ${o} 1fr; ${G}`;case"holy-grail":return`
925
1175
  display: grid;
926
- grid-template-columns: ${b} 1fr ${b};
1176
+ grid-template-columns: ${o} 1fr ${o};
927
1177
  grid-template-rows: auto 1fr auto;
928
- ${S}
1178
+ ${G}
929
1179
  `;case"bento":return`
930
1180
  display: grid;
931
1181
  grid-template-columns: repeat(12, 1fr);
932
1182
  grid-auto-rows: minmax(120px, auto);
933
- grid-auto-flow: row ${F};
934
- ${S}
1183
+ grid-auto-flow: row ${S};
1184
+ ${G}
935
1185
  `;case"masonry":return`
936
1186
  display: grid;
937
1187
  grid-template-columns: repeat(auto-fill, minmax(${l}, 1fr));
938
1188
  grid-template-rows: masonry;
939
- grid-auto-flow: row ${F};
940
- ${S}
941
- `;case"auto":default:{let O=f?`repeat(${f}, 1fr)`:`repeat(auto-fit, minmax(${l}, 1fr))`,Fn=a?`repeat(${a}, 1fr)`:"auto";return`
1189
+ grid-auto-flow: row ${S};
1190
+ ${G}
1191
+ `;case"auto":default:{let B=h?`repeat(${h}, 1fr)`:`repeat(auto-fit, minmax(${l}, 1fr))`,En=f?`repeat(${f}, 1fr)`:"auto";return`
942
1192
  display: grid;
943
- grid-template-columns: ${O};
944
- ${a?`grid-template-rows: ${Fn};`:""}
945
- grid-auto-flow: row ${F};
946
- ${S}
947
- `}}}var H0;var qb=Y(()=>{M();H0=class H0 extends r{static get observedAttributes(){return["min-width","gap","columns","rows","layout","align","justify","dense","sidebar-side","sidebar-width"]}attributeChangedCallback(){if(this.isConnected)this.render()}_getAttrs(){return{minWidth:this.getAttribute("min-width")||"280px",gap:this.getAttribute("gap")||"24px",columns:this.getAttribute("columns")||null,rows:this.getAttribute("rows")||null,layout:this.getAttribute("layout")||"auto",align:this.getAttribute("align")||"stretch",justify:this.getAttribute("justify")||"stretch",dense:this.hasAttribute("dense"),sidebarSide:this.getAttribute("sidebar-side")||"left",sidebarWidth:this.getAttribute("sidebar-width")||"280px"}}_buildResponsiveBreakpoints(t){if(t.layout!=="auto"&&t.layout!=="masonry")return"";return`
1193
+ grid-template-columns: ${B};
1194
+ ${f?`grid-template-rows: ${En};`:""}
1195
+ grid-auto-flow: row ${S};
1196
+ ${G}
1197
+ `}}}var Go;var B0=x(()=>{X();Go=class Go extends c{static get observedAttributes(){return["min-width","gap","columns","rows","layout","align","justify","dense","sidebar-side","sidebar-width"]}attributeChangedCallback(){if(this.isConnected)this.render()}_getAttrs(){return{minWidth:this.getAttribute("min-width")||"280px",gap:this.getAttribute("gap")||"24px",columns:this.getAttribute("columns")||null,rows:this.getAttribute("rows")||null,layout:this.getAttribute("layout")||"auto",align:this.getAttribute("align")||"stretch",justify:this.getAttribute("justify")||"stretch",dense:this.hasAttribute("dense"),sidebarSide:this.getAttribute("sidebar-side")||"left",sidebarWidth:this.getAttribute("sidebar-width")||"280px"}}_buildResponsiveBreakpoints(t){if(t.layout!=="auto"&&t.layout!=="masonry")return"";return`
948
1198
  @media (max-width: 768px) {
949
1199
  .grid {
950
1200
  grid-template-columns: repeat(auto-fit, minmax(min(${t.minWidth}, 100%), 1fr));
@@ -961,7 +1211,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
961
1211
  grid-template-columns: 1fr;
962
1212
  }
963
1213
  }
964
- `}render(){let t=this._getAttrs(),n=sl(t.layout,t),o=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=R`
1214
+ `}render(){let t=this._getAttrs(),n=qa(t.layout,t),b=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=Q`
965
1215
  <style>
966
1216
  :host {
967
1217
  display: block;
@@ -980,7 +1230,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
980
1230
  min-width: 0; /* Prevent overflow in grid context */
981
1231
  }
982
1232
 
983
- ${o}
1233
+ ${b}
984
1234
  </style>
985
1235
 
986
1236
  <div
@@ -991,7 +1241,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
991
1241
  >
992
1242
  <slot></slot>
993
1243
  </div>
994
- `}connectedCallback(){this.render(),this._setupResizeObserver()}disconnectedCallback(){if(this._resizeObserver)this._resizeObserver.disconnect()}_setupResizeObserver(){if(typeof ResizeObserver>"u")return;let t=this.offsetWidth;this._resizeObserver=new ResizeObserver((n)=>{for(let o of n){let b=o.contentRect.width;if(Math.abs(b-t)>10)t=b,this.emit("af-grid-resize",{width:b,height:o.contentRect.height,layout:this.getAttribute("layout")||"auto"})}}),this._resizeObserver.observe(this)}setLayout(t){this.setAttribute("layout",t)}setColumns(t){this.setAttribute("columns",String(t))}setDense(t){if(t)this.setAttribute("dense","");else this.removeAttribute("dense")}};A("af-grid",H0)});var Hb={};L(Hb,{AfriSection:()=>X0});var X0;var Xb=Y(()=>{M();X0=class X0 extends r{render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("title");this.shadowRoot.innerHTML=R`
1244
+ `}connectedCallback(){this.render(),this._setupResizeObserver()}disconnectedCallback(){if(this._resizeObserver)this._resizeObserver.disconnect()}_setupResizeObserver(){if(typeof ResizeObserver>"u")return;let t=this.offsetWidth;this._resizeObserver=new ResizeObserver((n)=>{for(let b of n){let o=b.contentRect.width;if(Math.abs(o-t)>10)t=o,this.emit("af-grid-resize",{width:o,height:b.contentRect.height,layout:this.getAttribute("layout")||"auto"})}}),this._resizeObserver.observe(this)}setLayout(t){this.setAttribute("layout",t)}setColumns(t){this.setAttribute("columns",String(t))}setDense(t){if(t)this.setAttribute("dense","");else this.removeAttribute("dense")}};_("af-grid",Go)});var D0={};i(D0,{AfriSection:()=>So});var So;var E0=x(()=>{X();So=class So extends c{render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("title");this.shadowRoot.innerHTML=Q`
995
1245
  <style>
996
1246
  :host { display: block; width: 100%; }
997
1247
  .section {
@@ -1018,20 +1268,20 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1018
1268
  }
1019
1269
  </style>
1020
1270
  <section class="section">
1021
- ${n?R`
1271
+ ${n?Q`
1022
1272
  <div class="section-header">
1023
1273
  <h2>${n}</h2>
1024
1274
  </div>
1025
1275
  `:""}
1026
1276
  <slot></slot>
1027
1277
  </section>
1028
- `}connectedCallback(){this.render()}};A("af-section",X0)});var Yb={};L(Yb,{default:()=>zl,AfriIcon:()=>on});var on,zl;var xb=Y(()=>{M();on=class on extends r{static get observedAttributes(){return["name","size"]}connectedCallback(){this.render()}render(){let t=this.getAttribute("name")||"circle",n=this.getAttribute("size")||"24",b={check:'<path d="M20 6L9 17l-5-5" />',x:'<path d="M18 6L6 18M6 6l12 12" />',"arrow-right":'<path d="M5 12h14M12 5l7 7-7 7" />',menu:'<path d="M3 12h18M3 6h18M3 18h18" />',search:'<circle cx="11" cy="11" r="8" /><path d="M21 21l-4.35-4.35" />'}[t]||"";this.shadowRoot.innerHTML=`
1278
+ `}connectedCallback(){this.render()}};_("af-section",So)});var O0={};i(O0,{default:()=>ka,AfriIcon:()=>rn});var rn,ka;var W0=x(()=>{X();rn=class rn extends c{static get observedAttributes(){return["name","size"]}connectedCallback(){this.render()}render(){let t=this.getAttribute("name")||"circle",n=this.getAttribute("size")||"24",o={check:'<path d="M20 6L9 17l-5-5" />',x:'<path d="M18 6L6 18M6 6l12 12" />',"arrow-right":'<path d="M5 12h14M12 5l7 7-7 7" />',menu:'<path d="M3 12h18M3 6h18M3 18h18" />',search:'<circle cx="11" cy="11" r="8" /><path d="M21 21l-4.35-4.35" />'}[t]||"";this.shadowRoot.innerHTML=`
1029
1279
  <style>
1030
1280
  :host { display: inline-flex; vertical-align: middle; }
1031
1281
  svg { width: ${n}px; height: ${n}px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
1032
1282
  </style>
1033
- <svg viewBox="0 0 24 24">${b}</svg>
1034
- `}};A("af-icon",on);zl=on});var Qb={};L(Qb,{default:()=>th,AfriAccordion:()=>ln});var ln,th;var Jb=Y(()=>{M();ln=class ln extends r{static get observedAttributes(){return["theme","multiple"]}constructor(){super();this._openItems=new Set,this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}connectedCallback(){this._setupAccordion()}_setupAccordion(){this.shadowRoot.querySelectorAll(".accordion-header").forEach((n,o)=>{n.addEventListener("click",()=>{this._toggleItem(o)})})}_toggleItem(t){let n=this.hasAttribute("multiple");if(this._openItems.has(t))this._openItems.delete(t);else{if(!n)this._openItems.clear();this._openItems.add(t)}this.render(),this._setupAccordion(),this.emit("af-toggle",{index:t,open:this._openItems.has(t)})}attributeChangedCallback(){this.render(),this._setupAccordion()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="items"]'),o=n?Array.from(n.children):[],b={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},l=b[t]||b.tanzania;this.shadowRoot.innerHTML=`
1283
+ <svg viewBox="0 0 24 24">${o}</svg>
1284
+ `}};_("af-icon",rn);ka=rn});var m0={};i(m0,{default:()=>Ha,AfriAccordion:()=>gn});var gn,Ha;var p0=x(()=>{X();gn=class gn extends c{static get observedAttributes(){return["theme","multiple"]}constructor(){super();this._openItems=new Set,this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}connectedCallback(){this._setupAccordion()}_setupAccordion(){this.shadowRoot.querySelectorAll(".accordion-header").forEach((n,b)=>{n.addEventListener("click",()=>{this._toggleItem(b)})})}_toggleItem(t){let n=this.hasAttribute("multiple");if(this._openItems.has(t))this._openItems.delete(t);else{if(!n)this._openItems.clear();this._openItems.add(t)}this.render(),this._setupAccordion(),this.emit("af-toggle",{index:t,open:this._openItems.has(t)})}attributeChangedCallback(){this.render(),this._setupAccordion()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="items"]'),b=n?Array.from(n.children):[],o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},l=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
1035
1285
  <style>
1036
1286
  :host {
1037
1287
  display: block;
@@ -1109,32 +1359,32 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1109
1359
  </style>
1110
1360
 
1111
1361
  <div class="accordion">
1112
- ${o.map((h,f)=>{let a=this._openItems.has(f),g=`accordion-header-${this._uniqueId}-${f}`,c=`accordion-panel-${this._uniqueId}-${f}`;return`
1362
+ ${b.map((a,h)=>{let f=this._openItems.has(h),r=`accordion-header-${this._uniqueId}-${h}`,A=`accordion-panel-${this._uniqueId}-${h}`;return`
1113
1363
  <div class="accordion-item">
1114
1364
  <button
1115
- class="accordion-header ${a?"active":""}"
1116
- aria-expanded="${a}"
1117
- aria-controls="${c}"
1118
- id="${g}"
1365
+ class="accordion-header ${f?"active":""}"
1366
+ aria-expanded="${f}"
1367
+ aria-controls="${A}"
1368
+ id="${r}"
1119
1369
  >
1120
- <span>${h.getAttribute("title")||`Item ${f+1}`}</span>
1370
+ <span>${a.getAttribute("title")||`Item ${h+1}`}</span>
1121
1371
  <span class="accordion-icon">▼</span>
1122
1372
  </button>
1123
1373
  <div
1124
- class="accordion-content ${a?"open":""}"
1125
- id="${c}"
1374
+ class="accordion-content ${f?"open":""}"
1375
+ id="${A}"
1126
1376
  role="region"
1127
- aria-labelledby="${g}"
1377
+ aria-labelledby="${r}"
1128
1378
  >
1129
1379
  <div class="accordion-body">
1130
- ${h.innerHTML}
1380
+ ${a.innerHTML}
1131
1381
  </div>
1132
1382
  </div>
1133
1383
  </div>
1134
1384
  `}).join("")}
1135
1385
  </div>
1136
1386
  <slot name="items"></slot>
1137
- `}};A("af-accordion",ln);th=ln});var Gb={};L(Gb,{default:()=>nh,AfriHero:()=>hn});var hn,nh;var Mb=Y(()=>{M();kt();ot();hn=class hn extends r{static get observedAttributes(){return["title","subtitle","pattern","overlay"]}connectedCallback(){super.connectedCallback(),this.render(),this.loadStyles()}render(){let t=this.getAttribute("title")||"AfriCode",n=this.getAttribute("subtitle")||"",o=this.getAttribute("pattern")||"",b=this.getAttribute("variant")||"default";this.shadowRoot.innerHTML=`
1387
+ `}};_("af-accordion",gn);Ha=gn});var u0={};i(u0,{default:()=>Ya,AfriHero:()=>$n});var $n,Ya;var U0=x(()=>{X();Qt();bt();$n=class $n extends c{static get observedAttributes(){return["title","subtitle","pattern","overlay"]}connectedCallback(){super.connectedCallback(),this.render(),this.loadStyles()}render(){let t=this.getAttribute("title")||"AfriCode",n=this.getAttribute("subtitle")||"",b=this.getAttribute("pattern")||"",o=this.getAttribute("variant")||"default";this.shadowRoot.innerHTML=`
1138
1388
  <style>
1139
1389
  :host {
1140
1390
  display: flex;
@@ -1202,11 +1452,11 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1202
1452
  z-index: 2;
1203
1453
  }
1204
1454
 
1205
- ${o?`
1455
+ ${b?`
1206
1456
  .pattern-bg {
1207
1457
  position: absolute;
1208
1458
  inset: 0;
1209
- background-image: url('${o}');
1459
+ background-image: url('${b}');
1210
1460
  background-size: cover;
1211
1461
  background-position: center;
1212
1462
  opacity: 0.15;
@@ -1224,7 +1474,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1224
1474
 
1225
1475
  <div class="aura"></div>
1226
1476
  <div class="mesh"></div>
1227
- ${o?'<div class="pattern-bg"></div>':""}
1477
+ ${b?'<div class="pattern-bg"></div>':""}
1228
1478
 
1229
1479
  <div class="content">
1230
1480
  <h1>${t}</h1>
@@ -1234,7 +1484,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1234
1484
  </div>
1235
1485
  <slot></slot>
1236
1486
  </div>
1237
- `}};A("af-hero",hn);nh=hn});var Lb={};L(Lb,{default:()=>bh,AfriTable:()=>fn});var fn,bh;var kb=Y(()=>{M();fn=class fn extends r{static get observedAttributes(){return["theme","striped","hoverable"]}constructor(){super();this._columns=[],this._data=[],this._sortColumn=null,this._sortDirection="asc",this.render()}set columns(t){this._columns=t,this.render()}set data(t){this._data=t,this.render()}attributeChangedCallback(){this.render()}_handleSort(t){if(this._sortColumn===t)this._sortDirection=this._sortDirection==="asc"?"desc":"asc";else this._sortColumn=t,this._sortDirection="asc";this.emit("af-sort",{column:t,direction:this._sortDirection}),this.render()}_getSortedData(){if(!this._sortColumn)return this._data;return[...this._data].sort((t,n)=>{let o=t[this._sortColumn],b=n[this._sortColumn],l=this._sortDirection==="asc"?1:-1;if(typeof o==="number")return(o-b)*l;return String(o).localeCompare(String(b))*l})}render(){let t=this.getAttribute("theme")||"tanzania",n=this.hasAttribute("striped"),o=this.hasAttribute("hoverable"),b={tanzania:{header:"#1EB53A",text:"#FFFFFF",accent:"#FCD116"},maasai:{header:"#8B0000",text:"#FFFFFF",accent:"#FF0000"},ndebele:{header:"#4169E1",text:"#FFFFFF",accent:"#FFD700"}},l=b[t]||b.tanzania,h=this._getSortedData();this.shadowRoot.innerHTML=`
1487
+ `}};_("af-hero",$n);Ya=$n});var V0={};i(V0,{default:()=>Xa,AfriTable:()=>cn});var cn,Xa;var N0=x(()=>{X();cn=class cn extends c{static get observedAttributes(){return["theme","striped","hoverable"]}constructor(){super();this._columns=[],this._data=[],this._sortColumn=null,this._sortDirection="asc",this.render()}set columns(t){this._columns=t,this.render()}set data(t){this._data=t,this.render()}attributeChangedCallback(){this.render()}_handleSort(t){if(this._sortColumn===t)this._sortDirection=this._sortDirection==="asc"?"desc":"asc";else this._sortColumn=t,this._sortDirection="asc";this.emit("af-sort",{column:t,direction:this._sortDirection}),this.render()}_getSortedData(){if(!this._sortColumn)return this._data;return[...this._data].sort((t,n)=>{let b=t[this._sortColumn],o=n[this._sortColumn],l=this._sortDirection==="asc"?1:-1;if(typeof b==="number")return(b-o)*l;return String(b).localeCompare(String(o))*l})}render(){let t=this.getAttribute("theme")||"tanzania",n=this.hasAttribute("striped"),b=this.hasAttribute("hoverable"),o={tanzania:{header:"#1EB53A",text:"#FFFFFF",accent:"#FCD116"},maasai:{header:"#8B0000",text:"#FFFFFF",accent:"#FF0000"},ndebele:{header:"#4169E1",text:"#FFFFFF",accent:"#FFD700"}},l=o[t]||o.tanzania,a=this._getSortedData();this.shadowRoot.innerHTML=`
1238
1488
  <style>
1239
1489
  :host {
1240
1490
  display: block;
@@ -1284,7 +1534,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1284
1534
  }
1285
1535
  `:""}
1286
1536
 
1287
- ${o?`
1537
+ ${b?`
1288
1538
  tbody tr:hover {
1289
1539
  background: ${l.accent}20;
1290
1540
  }
@@ -1301,20 +1551,20 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1301
1551
  <table>
1302
1552
  <thead>
1303
1553
  <tr>
1304
- ${this._columns.map((f)=>`
1305
- <th data-column="${f.key}">
1306
- ${f.label}
1554
+ ${this._columns.map((h)=>`
1555
+ <th data-column="${h.key}">
1556
+ ${h.label}
1307
1557
  <span class="sort-icon">
1308
- ${this._sortColumn===f.key?this._sortDirection==="asc"?"↑":"↓":"↕"}
1558
+ ${this._sortColumn===h.key?this._sortDirection==="asc"?"↑":"↓":"↕"}
1309
1559
  </span>
1310
1560
  </th>
1311
1561
  `).join("")}
1312
1562
  </tr>
1313
1563
  </thead>
1314
1564
  <tbody>
1315
- ${h.length?h.map((f)=>`
1565
+ ${a.length?a.map((h)=>`
1316
1566
  <tr>
1317
- ${this._columns.map((a)=>`<td>${f[a.key]??""}</td>`).join("")}
1567
+ ${this._columns.map((f)=>`<td>${h[f.key]??""}</td>`).join("")}
1318
1568
  </tr>
1319
1569
  `).join(""):`
1320
1570
  <tr>
@@ -1324,7 +1574,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1324
1574
  </tbody>
1325
1575
  </table>
1326
1576
  </div>
1327
- `,this.shadowRoot.querySelectorAll("th").forEach((f)=>{f.addEventListener("click",()=>{this._handleSort(f.dataset.column)})})}};A("af-table",fn);bh=fn});var Sb={};L(Sb,{default:()=>oh,AfriModal:()=>an});var an,oh;var Fb=Y(()=>{M();an=class an extends r{static get observedAttributes(){return["open","theme","size","aria-label","aria-labelledby"]}constructor(){super();this.render()}connectedCallback(){this._setupListeners()}_setupListeners(){this.shadowRoot.querySelector(".backdrop")?.addEventListener("click",(t)=>{if(t.target.classList.contains("backdrop"))this.close()}),this.shadowRoot.querySelector(".close-btn")?.addEventListener("click",()=>{this.close()}),document.addEventListener("keydown",(t)=>{if(t.key==="Escape"&&this.hasAttribute("open"))this.close()}),this.shadowRoot.addEventListener("keydown",(t)=>{if(t.key==="Tab"&&this.hasAttribute("open"))this._handleTabKey(t)})}_getFocusableElements(){let t=this.shadowRoot.querySelector(".modal"),n='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',o=Array.from(t?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')||[]),b=Array.from(this.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));return[...o,...b]}_focusFirstFocusableElement(){let t=this._getFocusableElements();if(t.length>0)t[0].focus();else this.shadowRoot.querySelector(".close-btn")?.focus()}_handleTabKey(t){let n=this._getFocusableElements();if(n.length===0){t.preventDefault();return}let o=n[0],b=n[n.length-1];if(t.shiftKey){if(document.activeElement===o)t.preventDefault(),b.focus()}else if(document.activeElement===b)t.preventDefault(),o.focus()}open(){this.setAttribute("open",""),document.body.style.overflow="hidden",this._previousFocus=document.activeElement,this._focusFirstFocusableElement(),this.emit("af-open")}close(){if(this.removeAttribute("open"),document.body.style.overflow="",this._previousFocus&&this._previousFocus.focus)this._previousFocus.focus();this.emit("af-close")}attributeChangedCallback(t,n,o){if(this.render(),t==="open")this._setupListeners()}render(){let t=this.hasAttribute("open"),n=this.getAttribute("theme")||"tanzania",o=this.getAttribute("size")||"md",b={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},l=b[n]||b.tanzania,h={sm:"400px",md:"560px",lg:"720px",full:"95vw"},f=this.getAttribute("aria-label"),a=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
1577
+ `,this.shadowRoot.querySelectorAll("th").forEach((h)=>{h.addEventListener("click",()=>{this._handleSort(h.dataset.column)})})}};_("af-table",cn);Xa=cn});var K0={};i(K0,{default:()=>ia,AfriModal:()=>vn});var vn,ia;var j0=x(()=>{X();vn=class vn extends c{static get observedAttributes(){return["open","theme","size","aria-label","aria-labelledby"]}constructor(){super();this.render()}connectedCallback(){this._setupListeners()}_setupListeners(){this.shadowRoot.querySelector(".backdrop")?.addEventListener("click",(t)=>{if(t.target.classList.contains("backdrop"))this.close()}),this.shadowRoot.querySelector(".close-btn")?.addEventListener("click",()=>{this.close()}),document.addEventListener("keydown",(t)=>{if(t.key==="Escape"&&this.hasAttribute("open"))this.close()}),this.shadowRoot.addEventListener("keydown",(t)=>{if(t.key==="Tab"&&this.hasAttribute("open"))this._handleTabKey(t)})}_getFocusableElements(){let t=this.shadowRoot.querySelector(".modal"),n='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',b=Array.from(t?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')||[]),o=Array.from(this.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));return[...b,...o]}_focusFirstFocusableElement(){let t=this._getFocusableElements();if(t.length>0)t[0].focus();else this.shadowRoot.querySelector(".close-btn")?.focus()}_handleTabKey(t){let n=this._getFocusableElements();if(n.length===0){t.preventDefault();return}let b=n[0],o=n[n.length-1];if(t.shiftKey){if(document.activeElement===b)t.preventDefault(),o.focus()}else if(document.activeElement===o)t.preventDefault(),b.focus()}open(){this.setAttribute("open",""),document.body.style.overflow="hidden",this._previousFocus=document.activeElement,this._focusFirstFocusableElement(),this.emit("af-open")}close(){if(this.removeAttribute("open"),document.body.style.overflow="",this._previousFocus&&this._previousFocus.focus)this._previousFocus.focus();this.emit("af-close")}attributeChangedCallback(t,n,b){if(this.render(),t==="open")this._setupListeners()}render(){let t=this.hasAttribute("open"),n=this.getAttribute("theme")||"tanzania",b=this.getAttribute("size")||"md",o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},l=o[n]||o.tanzania,a={sm:"400px",md:"560px",lg:"720px",full:"95vw"},h=this.getAttribute("aria-label"),f=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
1328
1578
  <style>
1329
1579
  :host {
1330
1580
  font-family: 'Inter', system-ui, sans-serif;
@@ -1351,7 +1601,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1351
1601
  background: white;
1352
1602
  border-radius: 8px;
1353
1603
  width: 100%;
1354
- max-width: ${h[o]||h.md};
1604
+ max-width: ${a[b]||a.md};
1355
1605
  max-height: 90vh;
1356
1606
  overflow: hidden;
1357
1607
  display: flex;
@@ -1415,7 +1665,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1415
1665
  </style>
1416
1666
 
1417
1667
  <div class="backdrop">
1418
- <div class="modal" role="dialog" aria-modal="true" ${f?`aria-label="${f}"`:`aria-labelledby="${a}"`}>
1668
+ <div class="modal" role="dialog" aria-modal="true" ${h?`aria-label="${h}"`:`aria-labelledby="${f}"`}>
1419
1669
  <div class="modal-header">
1420
1670
  <slot name="header" id="modal-title"></slot>
1421
1671
  <button class="close-btn" aria-label="Close modal">×</button>
@@ -1428,7 +1678,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1428
1678
  </div>
1429
1679
  </div>
1430
1680
  </div>
1431
- `}};A("af-modal",an);oh=an});var Bb={};L(Bb,{default:()=>lh,AfriTabs:()=>gn});var gn,lh;var Rb=Y(()=>{M();gn=class gn extends r{static get observedAttributes(){return["theme"]}constructor(){super();this._activeTab=0,this.render()}connectedCallback(){this._setupTabs(),this.addEventListener("keydown",this._handleKeydown.bind(this))}_handleKeydown(t){let n=this.querySelector('[slot="tabs"]'),o=n?Array.from(n.children):[];if(o.length===0)return;switch(t.key){case"ArrowLeft":t.preventDefault(),this._activeTab=this._activeTab>0?this._activeTab-1:o.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break;case"ArrowRight":t.preventDefault(),this._activeTab=this._activeTab<o.length-1?this._activeTab+1:0,this.render(),this._setupTabs(),this._focusActiveTab();break;case"Home":t.preventDefault(),this._activeTab=0,this.render(),this._setupTabs(),this._focusActiveTab();break;case"End":t.preventDefault(),this._activeTab=o.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break}}_focusActiveTab(){let t=this.shadowRoot.querySelectorAll(".tab-button");if(t[this._activeTab])t[this._activeTab].focus()}_setupTabs(){this.shadowRoot.querySelectorAll(".tab-button").forEach((n,o)=>{n.addEventListener("click",()=>{this._activeTab=o,this.render(),this._setupTabs(),this.emit("af-tab-change",{index:o,tab:n.textContent})})})}attributeChangedCallback(){this.render(),this._setupTabs()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="tabs"]'),o=n?Array.from(n.children):[],b={tanzania:{active:"#1EB53A",text:"#FFFFFF"},maasai:{active:"#FF0000",text:"#FFFFFF"},ndebele:{active:"#4169E1",text:"#FFFFFF"}},l=b[t]||b.tanzania;this.shadowRoot.innerHTML=`
1681
+ `}};_("af-modal",vn);ia=vn});var I0={};i(I0,{default:()=>La,AfriTabs:()=>wn});var wn,La;var P0=x(()=>{X();wn=class wn extends c{static get observedAttributes(){return["theme"]}constructor(){super();this._activeTab=0,this.render()}connectedCallback(){this._setupTabs(),this.addEventListener("keydown",this._handleKeydown.bind(this))}_handleKeydown(t){let n=this.querySelector('[slot="tabs"]'),b=n?Array.from(n.children):[];if(b.length===0)return;switch(t.key){case"ArrowLeft":t.preventDefault(),this._activeTab=this._activeTab>0?this._activeTab-1:b.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break;case"ArrowRight":t.preventDefault(),this._activeTab=this._activeTab<b.length-1?this._activeTab+1:0,this.render(),this._setupTabs(),this._focusActiveTab();break;case"Home":t.preventDefault(),this._activeTab=0,this.render(),this._setupTabs(),this._focusActiveTab();break;case"End":t.preventDefault(),this._activeTab=b.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break}}_focusActiveTab(){let t=this.shadowRoot.querySelectorAll(".tab-button");if(t[this._activeTab])t[this._activeTab].focus()}_setupTabs(){this.shadowRoot.querySelectorAll(".tab-button").forEach((n,b)=>{n.addEventListener("click",()=>{this._activeTab=b,this.render(),this._setupTabs(),this.emit("af-tab-change",{index:b,tab:n.textContent})})})}attributeChangedCallback(){this.render(),this._setupTabs()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="tabs"]'),b=n?Array.from(n.children):[],o={tanzania:{active:"#1EB53A",text:"#FFFFFF"},maasai:{active:"#FF0000",text:"#FFFFFF"},ndebele:{active:"#4169E1",text:"#FFFFFF"}},l=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
1432
1682
  <style>
1433
1683
  :host {
1434
1684
  display: block;
@@ -1500,30 +1750,30 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1500
1750
 
1501
1751
  <div class="tabs-container">
1502
1752
  <div class="tab-list" role="tablist">
1503
- ${o.map((h,f)=>`
1504
- <button class="tab-button ${f===this._activeTab?"active":""}"
1753
+ ${b.map((a,h)=>`
1754
+ <button class="tab-button ${h===this._activeTab?"active":""}"
1505
1755
  role="tab"
1506
- aria-selected="${f===this._activeTab}"
1507
- aria-controls="panel-${f}"
1508
- tabindex="${f===this._activeTab?"0":"-1"}"
1509
- id="tab-${f}">
1510
- ${h.getAttribute("label")||`Tab ${f+1}`}
1756
+ aria-selected="${h===this._activeTab}"
1757
+ aria-controls="panel-${h}"
1758
+ tabindex="${h===this._activeTab?"0":"-1"}"
1759
+ id="tab-${h}">
1760
+ ${a.getAttribute("label")||`Tab ${h+1}`}
1511
1761
  </button>
1512
1762
  `).join("")}
1513
1763
  </div>
1514
1764
  <div class="tab-panels">
1515
- ${o.map((h,f)=>`
1516
- <div class="tab-panel ${f===this._activeTab?"active":""}"
1765
+ ${b.map((a,h)=>`
1766
+ <div class="tab-panel ${h===this._activeTab?"active":""}"
1517
1767
  role="tabpanel"
1518
- id="panel-${f}"
1519
- aria-labelledby="tab-${f}">
1520
- ${h.innerHTML}
1768
+ id="panel-${h}"
1769
+ aria-labelledby="tab-${h}">
1770
+ ${a.innerHTML}
1521
1771
  </div>
1522
1772
  `).join("")}
1523
1773
  </div>
1524
1774
  </div>
1525
1775
  <slot name="tabs"></slot>
1526
- `}};A("af-tabs",gn);lh=gn});var Db={};L(Db,{default:()=>hh,AfriSidebar:()=>$n});var $n,hh;var Ob=Y(()=>{M();kt();ot();$n=class $n extends r{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=y(()=>{this.updateUI()}),this.render()}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}updateUI(){let t=W.ui.sidebarCollapsed,n=this.shadowRoot.querySelector(".sidebar"),o=this.shadowRoot.querySelector(".sidebar-title"),b=this.shadowRoot.getElementById("toggle"),l=this.shadowRoot.querySelector(".sidebar-content");if(n)n.style.width=t?"60px":"260px";if(o)o.style.opacity=t?"0":"1";if(l)l.style.padding=t?"12px":"20px";if(b)b.innerHTML=t?"→":"← Collapse"}render(){let t=this.getAttribute("position")||"left",n=W.ui.sidebarCollapsed;this.shadowRoot.innerHTML=`
1776
+ `}};_("af-tabs",wn);La=wn});var T0={};i(T0,{default:()=>Ma,AfriSidebar:()=>_n});var _n,Ma;var C0=x(()=>{X();Qt();bt();_n=class _n extends c{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=y(()=>{this.updateUI()}),this.render()}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}updateUI(){let t=D.ui.sidebarCollapsed,n=this.shadowRoot.querySelector(".sidebar"),b=this.shadowRoot.querySelector(".sidebar-title"),o=this.shadowRoot.getElementById("toggle"),l=this.shadowRoot.querySelector(".sidebar-content");if(n)n.style.width=t?"60px":"260px";if(b)b.style.opacity=t?"0":"1";if(l)l.style.padding=t?"12px":"20px";if(o)o.innerHTML=t?"→":"← Collapse"}render(){let t=this.getAttribute("position")||"left",n=D.ui.sidebarCollapsed;this.shadowRoot.innerHTML=`
1527
1777
  <style>
1528
1778
  :host {
1529
1779
  display: block;
@@ -1632,7 +1882,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1632
1882
  </button>
1633
1883
  </div>
1634
1884
  </aside>
1635
- `,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};A("af-sidebar",$n);hh=$n});var Wb={};L(Wb,{default:()=>fh,AfriDropdown:()=>vn});var vn,fh;var Eb=Y(()=>{M();vn=class vn extends r{static get observedAttributes(){return["label","open"]}constructor(){super();this._open=!1,this.render()}toggle(){if(this._open=!this._open,this._open)this.setAttribute("open","");else this.removeAttribute("open");this.render()}close(){this._open=!1,this.removeAttribute("open"),this.render()}connectedCallback(){document.addEventListener("click",(t)=>{if(!this.contains(t.target))this.close()}),this.addEventListener("keydown",this._handleKeydown.bind(this))}_handleKeydown(t){let n=this.shadowRoot.getElementById("trigger");switch(t.key){case"Enter":case" ":t.preventDefault(),this.toggle();break;case"Escape":if(this._open)t.preventDefault(),this.close(),n.focus();break;case"ArrowDown":if(!this._open)t.preventDefault(),this.toggle();break}}render(){let t=this.getAttribute("label")||"Menu",n=this.hasAttribute("open");this.shadowRoot.innerHTML=`
1885
+ `,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};_("af-sidebar",_n);Ma=_n});var y0={};i(y0,{default:()=>Qa,AfriDropdown:()=>An});var An,Qa;var e0=x(()=>{X();An=class An extends c{static get observedAttributes(){return["label","open"]}constructor(){super();this._open=!1,this.render()}toggle(){if(this._open=!this._open,this._open)this.setAttribute("open","");else this.removeAttribute("open");this.render()}close(){this._open=!1,this.removeAttribute("open"),this.render()}connectedCallback(){document.addEventListener("click",(t)=>{if(!this.contains(t.target))this.close()}),this.addEventListener("keydown",this._handleKeydown.bind(this))}_handleKeydown(t){let n=this.shadowRoot.getElementById("trigger");switch(t.key){case"Enter":case" ":t.preventDefault(),this.toggle();break;case"Escape":if(this._open)t.preventDefault(),this.close(),n.focus();break;case"ArrowDown":if(!this._open)t.preventDefault(),this.toggle();break}}render(){let t=this.getAttribute("label")||"Menu",n=this.hasAttribute("open");this.shadowRoot.innerHTML=`
1636
1886
  <style>
1637
1887
  :host {
1638
1888
  display: inline-block;
@@ -1714,7 +1964,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1714
1964
  <div class="dropdown-menu" role="menu" ${n?"":'aria-hidden="true"'}>
1715
1965
  <slot></slot>
1716
1966
  </div>
1717
- `,this.shadowRoot.getElementById("trigger").addEventListener("click",(o)=>{o.stopPropagation(),this.toggle()})}};A("af-dropdown",vn);fh=vn});var Ub={};L(Ub,{default:()=>ah,AfriSelect:()=>wn});var wn,ah;var Vb=Y(()=>{M();wn=class wn extends r{static get observedAttributes(){return["label","placeholder","theme","error","required","aria-label","aria-describedby"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this._isOpen=!1,this._selectedIndex=-1,this._options=[],this.render()}get value(){return this._selectedIndex>=0?this._options[this._selectedIndex]?.value:""}connectedCallback(){this._options=Array.from(this.querySelectorAll("option")).map((t)=>({value:t.value,label:t.textContent})),this.render(),this._setupListeners()}_setupListeners(){let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");t?.addEventListener("click",()=>{this._toggleDropdown()}),t?.addEventListener("keydown",(o)=>{this._handleKeydown(o)}),this.shadowRoot.querySelectorAll(".select-option").forEach((o,b)=>{o.addEventListener("click",()=>{this._selectOption(b)})}),document.addEventListener("click",(o)=>{if(!this.contains(o.target)&&this._isOpen)this._closeDropdown()})}_toggleDropdown(){this._isOpen=!this._isOpen;let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");if(n?.classList.toggle("open",this._isOpen),t?.classList.toggle("open",this._isOpen),this._isOpen)t?.setAttribute("aria-expanded","true"),n?.setAttribute("aria-hidden","false");else t?.setAttribute("aria-expanded","false"),n?.setAttribute("aria-hidden","true")}_closeDropdown(){this._isOpen=!1;let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");n?.classList.remove("open"),t?.classList.remove("open"),t?.setAttribute("aria-expanded","false"),n?.setAttribute("aria-hidden","true")}_selectOption(t){this._selectedIndex=t,this._closeDropdown(),this.render(),this._setupListeners(),this.emit("af-change",{value:this.value,label:this._options[t].label})}_handleKeydown(t){let n=this.shadowRoot.querySelector(".select-trigger");switch(t.key){case"Enter":case" ":t.preventDefault(),this._toggleDropdown();break;case"Escape":if(this._isOpen)t.preventDefault(),this._closeDropdown(),n.focus();break;case"ArrowDown":if(!this._isOpen)t.preventDefault(),this._toggleDropdown();else t.preventDefault(),this._navigateOptions(1);break;case"ArrowUp":if(this._isOpen)t.preventDefault(),this._navigateOptions(-1);break}}_navigateOptions(t){let n=this.shadowRoot.querySelectorAll(".select-option");if(n.length===0)return;let o=this._selectedIndex+t;if(o<0)o=n.length-1;if(o>=n.length)o=0;this._selectedIndex=o,this.render(),this._setupListeners(),this.shadowRoot.querySelector(".select-option.selected")?.scrollIntoView({block:"nearest"})}attributeChangedCallback(){this.render(),this._setupListeners()}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"Select an option",o=this.getAttribute("theme")||"tanzania",b=this.getAttribute("error")||"",l=this.hasAttribute("required"),h=this.getAttribute("aria-label"),f=this.getAttribute("aria-describedby"),a={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},g=a[o]||a.tanzania,c=[];if(b)c.push(`error-${this._uniqueId}`);if(f)c.push(...f.split(" "));let J=c.length>0?`aria-describedby="${c.join(" ")}"`:"",F=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
1967
+ `,this.shadowRoot.getElementById("trigger").addEventListener("click",(b)=>{b.stopPropagation(),this.toggle()})}};_("af-dropdown",An);Qa=An});var Z0={};i(Z0,{default:()=>Ja,AfriSelect:()=>dn});var dn,Ja;var s0=x(()=>{X();dn=class dn extends c{static get observedAttributes(){return["label","placeholder","theme","error","required","aria-label","aria-describedby"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this._isOpen=!1,this._selectedIndex=-1,this._options=[],this.render()}get value(){return this._selectedIndex>=0?this._options[this._selectedIndex]?.value:""}connectedCallback(){this._options=Array.from(this.querySelectorAll("option")).map((t)=>({value:t.value,label:t.textContent})),this.render(),this._setupListeners()}_setupListeners(){let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");t?.addEventListener("click",()=>{this._toggleDropdown()}),t?.addEventListener("keydown",(b)=>{this._handleKeydown(b)}),this.shadowRoot.querySelectorAll(".select-option").forEach((b,o)=>{b.addEventListener("click",()=>{this._selectOption(o)})}),document.addEventListener("click",(b)=>{if(!this.contains(b.target)&&this._isOpen)this._closeDropdown()})}_toggleDropdown(){this._isOpen=!this._isOpen;let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");if(n?.classList.toggle("open",this._isOpen),t?.classList.toggle("open",this._isOpen),this._isOpen)t?.setAttribute("aria-expanded","true"),n?.setAttribute("aria-hidden","false");else t?.setAttribute("aria-expanded","false"),n?.setAttribute("aria-hidden","true")}_closeDropdown(){this._isOpen=!1;let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");n?.classList.remove("open"),t?.classList.remove("open"),t?.setAttribute("aria-expanded","false"),n?.setAttribute("aria-hidden","true")}_selectOption(t){this._selectedIndex=t,this._closeDropdown(),this.render(),this._setupListeners(),this.emit("af-change",{value:this.value,label:this._options[t].label})}_handleKeydown(t){let n=this.shadowRoot.querySelector(".select-trigger");switch(t.key){case"Enter":case" ":t.preventDefault(),this._toggleDropdown();break;case"Escape":if(this._isOpen)t.preventDefault(),this._closeDropdown(),n.focus();break;case"ArrowDown":if(!this._isOpen)t.preventDefault(),this._toggleDropdown();else t.preventDefault(),this._navigateOptions(1);break;case"ArrowUp":if(this._isOpen)t.preventDefault(),this._navigateOptions(-1);break}}_navigateOptions(t){let n=this.shadowRoot.querySelectorAll(".select-option");if(n.length===0)return;let b=this._selectedIndex+t;if(b<0)b=n.length-1;if(b>=n.length)b=0;this._selectedIndex=b,this.render(),this._setupListeners(),this.shadowRoot.querySelector(".select-option.selected")?.scrollIntoView({block:"nearest"})}attributeChangedCallback(){this.render(),this._setupListeners()}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"Select an option",b=this.getAttribute("theme")||"tanzania",o=this.getAttribute("error")||"",l=this.hasAttribute("required"),a=this.getAttribute("aria-label"),h=this.getAttribute("aria-describedby"),f={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},r=f[b]||f.tanzania,A=[];if(o)A.push(`error-${this._uniqueId}`);if(h)A.push(...h.split(" "));let L=A.length>0?`aria-describedby="${A.join(" ")}"`:"",S=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
1718
1968
  <style>
1719
1969
  :host {
1720
1970
  display: block;
@@ -1731,7 +1981,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1731
1981
  }
1732
1982
 
1733
1983
  .required-star {
1734
- color: ${g.error};
1984
+ color: ${r.error};
1735
1985
  margin-left: 2px;
1736
1986
  }
1737
1987
 
@@ -1743,7 +1993,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1743
1993
  width: 100%;
1744
1994
  padding: 10px 40px 10px 13px;
1745
1995
  font-size: 15px;
1746
- border: 2px solid ${b?g.error:"#ddd"};
1996
+ border: 2px solid ${o?r.error:"#ddd"};
1747
1997
  border-radius: 5px;
1748
1998
  background: white;
1749
1999
  cursor: pointer;
@@ -1756,8 +2006,8 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1756
2006
  .select-trigger:focus,
1757
2007
  .select-trigger.open {
1758
2008
  outline: none;
1759
- border-color: ${b?g.error:g.focus};
1760
- box-shadow: 0 0 0 3px ${b?g.error+"20":g.focus+"20"};
2009
+ border-color: ${o?r.error:r.focus};
2010
+ box-shadow: 0 0 0 3px ${o?r.error+"20":r.focus+"20"};
1761
2011
  }
1762
2012
 
1763
2013
  .select-arrow {
@@ -1803,18 +2053,18 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1803
2053
  }
1804
2054
 
1805
2055
  .select-option:hover {
1806
- background: ${g.focus}15;
2056
+ background: ${r.focus}15;
1807
2057
  }
1808
2058
 
1809
2059
  .select-option.selected {
1810
- background: ${g.focus};
2060
+ background: ${r.focus};
1811
2061
  color: white;
1812
2062
  }
1813
2063
 
1814
2064
  .error-text {
1815
2065
  font-size: 12px;
1816
2066
  margin-top: 4px;
1817
- color: ${g.error};
2067
+ color: ${r.error};
1818
2068
  }
1819
2069
 
1820
2070
  ::slotted(option) {
@@ -1829,28 +2079,28 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1829
2079
  class="select-trigger ${this._isOpen?"open":""}"
1830
2080
  aria-expanded="${this._isOpen}"
1831
2081
  aria-haspopup="listbox"
1832
- ${h?`aria-label="${h}"`:""}
1833
- ${b?'aria-invalid="true"':""}
1834
- ${J}>
1835
- ${F}
2082
+ ${a?`aria-label="${a}"`:""}
2083
+ ${o?'aria-invalid="true"':""}
2084
+ ${L}>
2085
+ ${S}
1836
2086
  </button>
1837
2087
  <span class="select-arrow" aria-hidden="true">▼</span>
1838
2088
  <div class="select-dropdown ${this._isOpen?"open":""}"
1839
2089
  role="listbox"
1840
2090
  aria-hidden="${!this._isOpen}">
1841
- ${this._options.map((S,O)=>`
1842
- <div class="select-option ${O===this._selectedIndex?"selected":""}"
1843
- data-index="${O}"
2091
+ ${this._options.map((G,B)=>`
2092
+ <div class="select-option ${B===this._selectedIndex?"selected":""}"
2093
+ data-index="${B}"
1844
2094
  role="option"
1845
- aria-selected="${O===this._selectedIndex}">
1846
- ${S.label}
2095
+ aria-selected="${B===this._selectedIndex}">
2096
+ ${G.label}
1847
2097
  </div>
1848
2098
  `).join("")}
1849
2099
  </div>
1850
2100
  </div>
1851
- ${b?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${b}</div>`:""}
2101
+ ${o?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${o}</div>`:""}
1852
2102
  <slot></slot>
1853
- `}};A("af-select",wn);ah=wn});var Nb={};L(Nb,{default:()=>gh,AfriForm:()=>_n});var _n,gh;var jb=Y(()=>{M();Zt();_n=class _n extends r{static get observedAttributes(){return["action","method","error","success","schema"]}constructor(){super();this.handleSubmit=this.handleSubmit.bind(this)}connectedCallback(){this.render(),this.shadowRoot.querySelector("form").addEventListener("submit",this.handleSubmit),this.loadStyles()}async handleSubmit(t){t.preventDefault();let n=t.target,o=this.querySelector('[type="submit"]')||this.shadowRoot.querySelector('button[type="submit"]'),b=this.getAttribute("schema"),l=b?this._getSchema(b):null,h=this.getAttribute("action"),f=this.getAttribute("method")||"GET",a=new FormData(n),g=Object.fromEntries(a.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((J)=>{let F=J.getAttribute("name");if(F)g[F]=J.value}),l){let J=$t.validate(l,g);if(!J.success){this._showValidationErrors(J.errors),this.emit("af-validation-error",{errors:J.errors});return}}if(!h)return;if(o){var c=o.textContent;o.textContent="Wait...",o.disabled=!0}try{let J=await fetch(h,{method:f,headers:{"Content-Type":"application/json"},body:JSON.stringify(g)});if(J.ok)this.emit("success",await J.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let F=await J.text();this.emit("error",F),this.setAttribute("error",F),this.removeAttribute("success")}}catch(J){this.emit("error",J.message),this.setAttribute("error",J.message),this.removeAttribute("success")}finally{if(o)o.textContent=c,o.disabled=!1}}_getSchema(t){return yt[t]||null}_showValidationErrors(t){this.shadowRoot.querySelectorAll(".field-error").forEach((n)=>n.remove()),Object.entries(t).forEach(([n,o])=>{let b=this.querySelector(`[name="${n}"]`);if(b)if(b.tagName==="AF-INPUT")b.setAttribute("error",o);else{let l=document.createElement("div");l.className="field-error",l.textContent=o,l.style.color="red",l.style.fontSize="12px",l.style.marginTop="4px",b.parentNode.insertBefore(l,b.nextSibling)}})}};A("af-form",_n);gh=_n});var Kb={};L(Kb,{default:()=>$h,AfriTooltip:()=>rn});var rn,$h;var mb=Y(()=>{M();rn=class rn extends r{static get observedAttributes(){return["text","position"]}constructor(){super();this._tooltipId=`af-tooltip-${Math.random().toString(36).substr(2,9)}`,this.render()}connectedCallback(){this._setupTooltipListeners()}attributeChangedCallback(){this.render(),this._setupTooltipListeners()}_setupTooltipListeners(){let t=this.shadowRoot.querySelector(".tooltip-trigger"),n=this.shadowRoot.querySelector(".tooltip-content");if(!t||!n)return;t.addEventListener("focus",()=>{n.style.opacity="1",n.style.visibility="visible",n.setAttribute("aria-hidden","false")}),t.addEventListener("blur",()=>{n.style.opacity="0",n.style.visibility="hidden",n.setAttribute("aria-hidden","true")}),t.addEventListener("mouseenter",()=>{n.style.opacity="1",n.style.visibility="visible",n.setAttribute("aria-hidden","false")}),t.addEventListener("mouseleave",()=>{n.style.opacity="0",n.style.visibility="hidden",n.setAttribute("aria-hidden","true")})}render(){let t=this.getAttribute("text")||"Tooltip",n=this.getAttribute("position")||"top",o={top:`
2103
+ `}};_("af-select",dn);Ja=dn});var z0={};i(z0,{default:()=>Ga,AfriForm:()=>xn});var xn,Ga;var tb=x(()=>{X();nn();xn=class xn extends c{static get observedAttributes(){return["action","method","error","success","schema"]}constructor(){super();this.handleSubmit=this.handleSubmit.bind(this)}connectedCallback(){this.render(),this.shadowRoot.querySelector("form").addEventListener("submit",this.handleSubmit),this.loadStyles()}async handleSubmit(t){t.preventDefault();let n=t.target,b=this.querySelector('[type="submit"]')||this.shadowRoot.querySelector('button[type="submit"]'),o=this.getAttribute("schema"),l=o?this._getSchema(o):null,a=this.getAttribute("action"),h=this.getAttribute("method")||"GET",f=new FormData(n),r=Object.fromEntries(f.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((L)=>{let S=L.getAttribute("name");if(S)r[S]=L.value}),l){let L=gt.validate(l,r);if(!L.success){this._showValidationErrors(L.errors),this.emit("af-validation-error",{errors:L.errors});return}}if(!a)return;if(b){var A=b.textContent;b.textContent="Wait...",b.disabled=!0}try{let L=await fetch(a,{method:h,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(L.ok)this.emit("success",await L.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let S=await L.text();this.emit("error",S),this.setAttribute("error",S),this.removeAttribute("success")}}catch(L){this.emit("error",L.message),this.setAttribute("error",L.message),this.removeAttribute("success")}finally{if(b)b.textContent=A,b.disabled=!1}}_getSchema(t){return tn[t]||null}_showValidationErrors(t){this.shadowRoot.querySelectorAll(".field-error").forEach((n)=>n.remove()),Object.entries(t).forEach(([n,b])=>{let o=this.querySelector(`[name="${n}"]`);if(o)if(o.tagName==="AF-INPUT")o.setAttribute("error",b);else{let l=document.createElement("div");l.className="field-error",l.textContent=b,l.style.color="red",l.style.fontSize="12px",l.style.marginTop="4px",o.parentNode.insertBefore(l,o.nextSibling)}})}};_("af-form",xn);Ga=xn});var nb={};i(nb,{default:()=>Sa,AfriTooltip:()=>qn});var qn,Sa;var ob=x(()=>{X();qn=class qn extends c{static get observedAttributes(){return["text","position"]}constructor(){super();this._tooltipId=`af-tooltip-${Math.random().toString(36).substr(2,9)}`,this.render()}connectedCallback(){this._setupTooltipListeners()}attributeChangedCallback(){this.render(),this._setupTooltipListeners()}_setupTooltipListeners(){let t=this.shadowRoot.querySelector(".tooltip-trigger"),n=this.shadowRoot.querySelector(".tooltip-content");if(!t||!n)return;t.addEventListener("focus",()=>{n.style.opacity="1",n.style.visibility="visible",n.setAttribute("aria-hidden","false")}),t.addEventListener("blur",()=>{n.style.opacity="0",n.style.visibility="hidden",n.setAttribute("aria-hidden","true")}),t.addEventListener("mouseenter",()=>{n.style.opacity="1",n.style.visibility="visible",n.setAttribute("aria-hidden","false")}),t.addEventListener("mouseleave",()=>{n.style.opacity="0",n.style.visibility="hidden",n.setAttribute("aria-hidden","true")})}render(){let t=this.getAttribute("text")||"Tooltip",n=this.getAttribute("position")||"top",b={top:`
1854
2104
  bottom: 100%;
1855
2105
  left: 50%;
1856
2106
  transform: translateX(-50%) translateY(-8px);
@@ -1881,7 +2131,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1881
2131
 
1882
2132
  .tooltip-content {
1883
2133
  position: absolute;
1884
- ${o[n]}
2134
+ ${b[n]}
1885
2135
  padding: 8px 12px;
1886
2136
  background: #1e1e1e;
1887
2137
  border: 1px solid #2a2a2a;
@@ -1939,7 +2189,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1939
2189
  <slot></slot>
1940
2190
  </span>
1941
2191
  <div class="tooltip-content" id="${this._tooltipId}" role="tooltip" aria-hidden="true">${t}</div>
1942
- `}};A("af-tooltip",rn);$h=rn});var pb={};L(pb,{default:()=>vh,AfriToast:()=>cn});var cn,vh;var db=Y(()=>{M();cn=class cn extends r{static get observedAttributes(){return["type","message","duration"]}constructor(){super();this.render()}show(t,n="info",o=4000){if(this.setAttribute("message",t),this.setAttribute("type",n),this.render(),this.shadowRoot.querySelector(".toast").classList.add("show"),o>0)setTimeout(()=>this.hide(),o)}hide(){this.shadowRoot.querySelector(".toast").classList.remove("show"),setTimeout(()=>this.emit("af-toast-close"),300)}render(){let t=this.getAttribute("type")||"info",n=this.getAttribute("message")||"",o={success:"✓",error:"✗",warning:"⚠",info:"ℹ"},b={success:"#1EB53A",error:"#EF3340",warning:"#FCD116",info:"#00A3DD"};this.shadowRoot.innerHTML=`
2192
+ `}};_("af-tooltip",qn);Sa=qn});var bb={};i(bb,{default:()=>Fa,AfriToast:()=>kn});var kn,Fa;var lb=x(()=>{X();kn=class kn extends c{static get observedAttributes(){return["type","message","duration"]}constructor(){super();this.render()}show(t,n="info",b=4000){if(this.setAttribute("message",t),this.setAttribute("type",n),this.render(),this.shadowRoot.querySelector(".toast").classList.add("show"),b>0)setTimeout(()=>this.hide(),b)}hide(){this.shadowRoot.querySelector(".toast").classList.remove("show"),setTimeout(()=>this.emit("af-toast-close"),300)}render(){let t=this.getAttribute("type")||"info",n=this.getAttribute("message")||"",b={success:"✓",error:"✗",warning:"⚠",info:"ℹ"},o={success:"#1EB53A",error:"#EF3340",warning:"#FCD116",info:"#00A3DD"};this.shadowRoot.innerHTML=`
1943
2193
  <style>
1944
2194
  :host {
1945
2195
  position: fixed;
@@ -1956,7 +2206,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1956
2206
  padding: 16px 20px;
1957
2207
  background: #121212;
1958
2208
  border: 1px solid #1e1e1e;
1959
- border-left: 4px solid ${b[t]};
2209
+ border-left: 4px solid ${o[t]};
1960
2210
  border-radius: 8px;
1961
2211
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
1962
2212
  transform: translateX(120%);
@@ -1973,8 +2223,8 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
1973
2223
  width: 28px;
1974
2224
  height: 28px;
1975
2225
  border-radius: 50%;
1976
- background: ${b[t]}20;
1977
- color: ${b[t]};
2226
+ background: ${o[t]}20;
2227
+ color: ${o[t]};
1978
2228
  display: flex;
1979
2229
  align-items: center;
1980
2230
  justify-content: center;
@@ -2007,13 +2257,13 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2007
2257
  </style>
2008
2258
 
2009
2259
  <div class="toast">
2010
- <span class="toast-icon">${o[t]}</span>
2260
+ <span class="toast-icon">${b[t]}</span>
2011
2261
  <div class="toast-content">
2012
2262
  <div class="toast-message">${n}</div>
2013
2263
  </div>
2014
2264
  <button class="toast-close" id="close">×</button>
2015
2265
  </div>
2016
- `,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};A("af-toast",cn);vh=cn});var ub={};L(ub,{default:()=>wh,AfriBadge:()=>An});var An,wh;var Ib=Y(()=>{M();An=class An extends r{static get observedAttributes(){return["variant","size","removable"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector(".remove-btn")?.addEventListener("click",()=>{this.emit("af-remove"),this.remove()})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("size")||"md",o=this.hasAttribute("removable"),b={default:{bg:"#e9ecef",text:"#495057"},success:{bg:"#d4edda",text:"#155724"},warning:{bg:"#fff3cd",text:"#856404"},error:{bg:"#f8d7da",text:"#721c24"},info:{bg:"#d1ecf1",text:"#0c5460"},tanzania:{bg:"#1EB53A",text:"#FFFFFF"},maasai:{bg:"#FF0000",text:"#FFFFFF"},ndebele:{bg:"#4169E1",text:"#FFFFFF"},gold:{bg:"#FCD116",text:"#000000"}},l=b[t]||b.default,h={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},f=h[n]||h.md;this.shadowRoot.innerHTML=`
2266
+ `,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};_("af-toast",kn);Fa=kn});var ab={};i(ab,{default:()=>Ra,AfriBadge:()=>Hn});var Hn,Ra;var hb=x(()=>{X();Hn=class Hn extends c{static get observedAttributes(){return["variant","size","removable"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector(".remove-btn")?.addEventListener("click",()=>{this.emit("af-remove"),this.remove()})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("size")||"md",b=this.hasAttribute("removable"),o={default:{bg:"#e9ecef",text:"#495057"},success:{bg:"#d4edda",text:"#155724"},warning:{bg:"#fff3cd",text:"#856404"},error:{bg:"#f8d7da",text:"#721c24"},info:{bg:"#d1ecf1",text:"#0c5460"},tanzania:{bg:"#1EB53A",text:"#FFFFFF"},maasai:{bg:"#FF0000",text:"#FFFFFF"},ndebele:{bg:"#4169E1",text:"#FFFFFF"},gold:{bg:"#FCD116",text:"#000000"}},l=o[t]||o.default,a={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},h=a[n]||a.md;this.shadowRoot.innerHTML=`
2017
2267
  <style>
2018
2268
  :host {
2019
2269
  display: inline-block;
@@ -2024,8 +2274,8 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2024
2274
  display: inline-flex;
2025
2275
  align-items: center;
2026
2276
  gap: 5px;
2027
- padding: ${f.padding};
2028
- font-size: ${f.fontSize};
2277
+ padding: ${h.padding};
2278
+ font-size: ${h.fontSize};
2029
2279
  font-weight: 600;
2030
2280
  background: ${l.bg};
2031
2281
  color: ${l.text};
@@ -2052,9 +2302,9 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2052
2302
 
2053
2303
  <span class="badge">
2054
2304
  <slot></slot>
2055
- ${o?'<button class="remove-btn" aria-label="Remove">×</button>':""}
2305
+ ${b?'<button class="remove-btn" aria-label="Remove">×</button>':""}
2056
2306
  </span>
2057
- `}};A("af-badge",An);wh=An});var Pb={};L(Pb,{default:()=>_h,AfriAvatar:()=>qn});var qn,_h;var Tb=Y(()=>{M();qn=class qn extends r{static get observedAttributes(){return["src","name","size","status","theme"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getInitials(t){if(!t)return"?";let n=t.trim().split(" ");if(n.length>=2)return(n[0][0]+n[n.length-1][0]).toUpperCase();return t.substring(0,2).toUpperCase()}render(){let t=this.getAttribute("src"),n=this.getAttribute("name")||"",o=this.getAttribute("size")||"md",b=this.getAttribute("status"),l=this.getAttribute("theme")||"tanzania",h={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},f=h[l]||h.tanzania,a={sm:{size:"32px",font:"12px",status:"8px"},md:{size:"44px",font:"16px",status:"10px"},lg:{size:"64px",font:"22px",status:"14px"},xl:{size:"96px",font:"32px",status:"18px"}},g=a[o]||a.md,c={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
2307
+ `}};_("af-badge",Hn);Ra=Hn});var fb={};i(fb,{default:()=>Ba,AfriAvatar:()=>Yn});var Yn,Ba;var rb=x(()=>{X();Yn=class Yn extends c{static get observedAttributes(){return["src","name","size","status","theme"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getInitials(t){if(!t)return"?";let n=t.trim().split(" ");if(n.length>=2)return(n[0][0]+n[n.length-1][0]).toUpperCase();return t.substring(0,2).toUpperCase()}render(){let t=this.getAttribute("src"),n=this.getAttribute("name")||"",b=this.getAttribute("size")||"md",o=this.getAttribute("status"),l=this.getAttribute("theme")||"tanzania",a={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},h=a[l]||a.tanzania,f={sm:{size:"32px",font:"12px",status:"8px"},md:{size:"44px",font:"16px",status:"10px"},lg:{size:"64px",font:"22px",status:"14px"},xl:{size:"96px",font:"32px",status:"18px"}},r=f[b]||f.md,A={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
2058
2308
  <style>
2059
2309
  :host {
2060
2310
  display: inline-block;
@@ -2063,16 +2313,16 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2063
2313
 
2064
2314
  .avatar {
2065
2315
  position: relative;
2066
- width: ${g.size};
2067
- height: ${g.size};
2316
+ width: ${r.size};
2317
+ height: ${r.size};
2068
2318
  border-radius: 50%;
2069
2319
  display: flex;
2070
2320
  align-items: center;
2071
2321
  justify-content: center;
2072
- background: ${f};
2322
+ background: ${h};
2073
2323
  color: white;
2074
2324
  font-weight: 600;
2075
- font-size: ${g.font};
2325
+ font-size: ${r.font};
2076
2326
  overflow: hidden;
2077
2327
  }
2078
2328
 
@@ -2086,19 +2336,19 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2086
2336
  position: absolute;
2087
2337
  bottom: 0;
2088
2338
  right: 0;
2089
- width: ${g.status};
2090
- height: ${g.status};
2339
+ width: ${r.status};
2340
+ height: ${r.status};
2091
2341
  border-radius: 50%;
2092
2342
  border: 2px solid white;
2093
- background: ${b?c[b]||c.offline:"transparent"};
2343
+ background: ${o?A[o]||A.offline:"transparent"};
2094
2344
  }
2095
2345
  </style>
2096
2346
 
2097
2347
  <div class="avatar" title="${n}">
2098
2348
  ${t?`<img src="${t}" alt="${n}" />`:this._getInitials(n)}
2099
- ${b?'<span class="status"></span>':""}
2349
+ ${o?'<span class="status"></span>':""}
2100
2350
  </div>
2101
- `}};A("af-avatar",qn);_h=qn});var ib={};L(ib,{default:()=>rh,AfriProgress:()=>Hn});var Hn,rh;var Cb=Y(()=>{M();Hn=class Hn extends r{static get observedAttributes(){return["value","max","theme","size","label","animated"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=parseFloat(this.getAttribute("value"))||0,n=parseFloat(this.getAttribute("max"))||100,o=this.getAttribute("theme")||"tanzania",b=this.getAttribute("size")||"md",l=this.getAttribute("label"),h=this.hasAttribute("animated"),f=Math.min(100,Math.max(0,t/n*100)),a={tanzania:{bar:"#1EB53A",track:"#e9ecef"},maasai:{bar:"#FF0000",track:"#e9ecef"},ndebele:{bar:"#4169E1",track:"#e9ecef"},gold:{bar:"#FCD116",track:"#e9ecef"},gradient:{bar:"linear-gradient(90deg, #1EB53A 0%, #FCD116 50%, #00A3DD 100%)",track:"#e9ecef"}},g=a[o]||a.tanzania,c={sm:"6px",md:"10px",lg:"16px"},J=c[b]||c.md;this.shadowRoot.innerHTML=`
2351
+ `}};_("af-avatar",Yn);Ba=Yn});var gb={};i(gb,{default:()=>Da,AfriProgress:()=>Xn});var Xn,Da;var $b=x(()=>{X();Xn=class Xn extends c{static get observedAttributes(){return["value","max","theme","size","label","animated"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=parseFloat(this.getAttribute("value"))||0,n=parseFloat(this.getAttribute("max"))||100,b=this.getAttribute("theme")||"tanzania",o=this.getAttribute("size")||"md",l=this.getAttribute("label"),a=this.hasAttribute("animated"),h=Math.min(100,Math.max(0,t/n*100)),f={tanzania:{bar:"#1EB53A",track:"#e9ecef"},maasai:{bar:"#FF0000",track:"#e9ecef"},ndebele:{bar:"#4169E1",track:"#e9ecef"},gold:{bar:"#FCD116",track:"#e9ecef"},gradient:{bar:"linear-gradient(90deg, #1EB53A 0%, #FCD116 50%, #00A3DD 100%)",track:"#e9ecef"}},r=f[b]||f.tanzania,A={sm:"6px",md:"10px",lg:"16px"},L=A[o]||A.md;this.shadowRoot.innerHTML=`
2102
2352
  <style>
2103
2353
  :host {
2104
2354
  display: block;
@@ -2127,19 +2377,19 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2127
2377
 
2128
2378
  .progress-track {
2129
2379
  width: 100%;
2130
- height: ${J};
2131
- background: ${g.track};
2380
+ height: ${L};
2381
+ background: ${r.track};
2132
2382
  border-radius: 100px;
2133
2383
  overflow: hidden;
2134
2384
  }
2135
2385
 
2136
2386
  .progress-bar {
2137
2387
  height: 100%;
2138
- width: ${f}%;
2139
- background: ${g.bar};
2388
+ width: ${h}%;
2389
+ background: ${r.bar};
2140
2390
  border-radius: 100px;
2141
2391
  transition: width 500ms ease-out;
2142
- ${h?`
2392
+ ${a?`
2143
2393
  background-size: 30px 30px;
2144
2394
  background-image: linear-gradient(
2145
2395
  135deg,
@@ -2165,7 +2415,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2165
2415
  ${`
2166
2416
  <div class="progress-header">
2167
2417
  <span class="progress-label">${l||""}</span>
2168
- <span class="progress-value">${f.toFixed(0)}%</span>
2418
+ <span class="progress-value">${h.toFixed(0)}%</span>
2169
2419
  </div>
2170
2420
  `}
2171
2421
  <div class="progress-track">
@@ -2175,7 +2425,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2175
2425
  aria-valuemax="${n}"></div>
2176
2426
  </div>
2177
2427
  </div>
2178
- `}};A("af-progress",Hn);rh=Hn});var yb={};L(yb,{default:()=>ch,AfriLoader:()=>Xn});var Xn,ch;var Zb=Y(()=>{M();Xn=class Xn extends r{static get observedAttributes(){return["size","color","type"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("size")||"40",n=this.getAttribute("color")||"currentColor",o=this.getAttribute("type")||"spiral",b={spiral:`M25,25 m0,-20 a20,20 0 1,1 0,40 a20,20 0 1,1 0,-40
2428
+ `}};_("af-progress",Xn);Da=Xn});var cb={};i(cb,{default:()=>Ea,AfriLoader:()=>Ln});var Ln,Ea;var vb=x(()=>{X();Ln=class Ln extends c{static get observedAttributes(){return["size","color","type"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("size")||"40",n=this.getAttribute("color")||"currentColor",b=this.getAttribute("type")||"spiral",o={spiral:`M25,25 m0,-20 a20,20 0 1,1 0,40 a20,20 0 1,1 0,-40
2179
2429
  M25,25 m0,-15 a15,15 0 1,0 0,30 a15,15 0 1,0 0,-30`,sun:"M25,5 L25,45 M5,25 L45,25 M11,11 L39,39 M39,11 L11,39",diamond:"M25,5 L45,25 L25,45 L5,25 Z"};this.shadowRoot.innerHTML=`
2180
2430
  <style>
2181
2431
  :host {
@@ -2203,10 +2453,10 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2203
2453
  </style>
2204
2454
  <div class="loader">
2205
2455
  <svg viewBox="0 0 50 50">
2206
- ${o==="spiral"?`<path d="${b.spiral}" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:o==="sun"?`<path d="${b.sun}" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:`<path d="${b.diamond}" fill="none" stroke="currentColor" stroke-width="4" />`}
2456
+ ${b==="spiral"?`<path d="${o.spiral}" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:b==="sun"?`<path d="${o.sun}" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:`<path d="${o.diamond}" fill="none" stroke="currentColor" stroke-width="4" />`}
2207
2457
  </svg>
2208
2458
  </div>
2209
- `}};A("af-loader",Xn);ch=Xn});var eb={};L(eb,{default:()=>Ah,AfriSkeleton:()=>Yn});var Yn,Ah;var sb=Y(()=>{M();Yn=class Yn extends r{static get observedAttributes(){return["variant","width","height","lines"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"text",n=this.getAttribute("width")||"100%",o=this.getAttribute("height")||"auto",b=parseInt(this.getAttribute("lines"))||1,l={text:{height:"16px",borderRadius:"4px"},title:{height:"28px",borderRadius:"4px"},avatar:{width:"48px",height:"48px",borderRadius:"50%"},card:{height:"200px",borderRadius:"12px"},button:{height:"40px",borderRadius:"6px",width:"120px"}},h=l[t]||l.text;this.shadowRoot.innerHTML=`
2459
+ `}};_("af-loader",Ln);Ea=Ln});var wb={};i(wb,{default:()=>Oa,AfriSkeleton:()=>Mn});var Mn,Oa;var _b=x(()=>{X();Mn=class Mn extends c{static get observedAttributes(){return["variant","width","height","lines"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"text",n=this.getAttribute("width")||"100%",b=this.getAttribute("height")||"auto",o=parseInt(this.getAttribute("lines"))||1,l={text:{height:"16px",borderRadius:"4px"},title:{height:"28px",borderRadius:"4px"},avatar:{width:"48px",height:"48px",borderRadius:"50%"},card:{height:"200px",borderRadius:"12px"},button:{height:"40px",borderRadius:"6px",width:"120px"}},a=l[t]||l.text;this.shadowRoot.innerHTML=`
2210
2460
  <style>
2211
2461
  :host {
2212
2462
  display: block;
@@ -2221,7 +2471,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2221
2471
  );
2222
2472
  background-size: 200% 100%;
2223
2473
  animation: shimmer 1.5s infinite;
2224
- border-radius: ${h.borderRadius};
2474
+ border-radius: ${a.borderRadius};
2225
2475
  }
2226
2476
 
2227
2477
  @keyframes shimmer {
@@ -2230,8 +2480,8 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2230
2480
  }
2231
2481
 
2232
2482
  .skeleton-line {
2233
- width: ${t==="text"?n:h.width||n};
2234
- height: ${h.height};
2483
+ width: ${t==="text"?n:a.width||n};
2484
+ height: ${a.height};
2235
2485
  margin-bottom: 8px;
2236
2486
  }
2237
2487
 
@@ -2241,33 +2491,33 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2241
2491
  }
2242
2492
  </style>
2243
2493
 
2244
- ${t==="text"||t==="title"?Array(b).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${h.width||n}; height: ${h.height||o};"></div>`}
2245
- `}};A("af-skeleton",Yn);Ah=Yn});var zb={};L(zb,{default:()=>qh,AfriDivider:()=>xn});var xn,qh;var to=Y(()=>{M();xn=class xn extends r{static get observedAttributes(){return["pattern","height","color","flip"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getPatternPath(t,n,o){switch(t||"zigzag"){case"zigzag":return`M0,${o} L${n/4},0 L${n/2},${o} L${n*0.75},0 L${n},${o} V${o+10} H0 Z`;case"waves":return`M0,${o/2} Q${n/4},0 ${n/2},${o/2} T${n},${o/2} V${o} H0 Z`;case"triangles":return`M0,${o} L${n/8},0 L${n/4},${o} L${n*0.375},0 L${n/2},${o}
2246
- L${n*0.625},0 L${n*0.75},${o} L${n*0.875},0 L${n},${o} V${o+10} H0 Z`;case"diamonds":return`M0,0 H${n} V${o/2}
2247
- L${n*0.9},${o} L${n*0.8},${o/2}
2248
- L${n*0.7},${o} L${n*0.6},${o/2}
2249
- L${n*0.5},${o} L${n*0.4},${o/2}
2250
- L${n*0.3},${o} L${n*0.2},${o/2}
2251
- L${n*0.1},${o} L0,${o/2} Z`;default:return`M0,0 H${n} V${o} H0 Z`}}render(){let t=this.getAttribute("pattern")||"zigzag",n=this.getAttribute("height")||"50",o=this.getAttribute("color")||"currentColor",b=this.hasAttribute("flip");this.shadowRoot.innerHTML=`
2494
+ ${t==="text"||t==="title"?Array(o).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${a.width||n}; height: ${a.height||b};"></div>`}
2495
+ `}};_("af-skeleton",Mn);Oa=Mn});var Ab={};i(Ab,{default:()=>Wa,AfriDivider:()=>Qn});var Qn,Wa;var db=x(()=>{X();Qn=class Qn extends c{static get observedAttributes(){return["pattern","height","color","flip"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getPatternPath(t,n,b){switch(t||"zigzag"){case"zigzag":return`M0,${b} L${n/4},0 L${n/2},${b} L${n*0.75},0 L${n},${b} V${b+10} H0 Z`;case"waves":return`M0,${b/2} Q${n/4},0 ${n/2},${b/2} T${n},${b/2} V${b} H0 Z`;case"triangles":return`M0,${b} L${n/8},0 L${n/4},${b} L${n*0.375},0 L${n/2},${b}
2496
+ L${n*0.625},0 L${n*0.75},${b} L${n*0.875},0 L${n},${b} V${b+10} H0 Z`;case"diamonds":return`M0,0 H${n} V${b/2}
2497
+ L${n*0.9},${b} L${n*0.8},${b/2}
2498
+ L${n*0.7},${b} L${n*0.6},${b/2}
2499
+ L${n*0.5},${b} L${n*0.4},${b/2}
2500
+ L${n*0.3},${b} L${n*0.2},${b/2}
2501
+ L${n*0.1},${b} L0,${b/2} Z`;default:return`M0,0 H${n} V${b} H0 Z`}}render(){let t=this.getAttribute("pattern")||"zigzag",n=this.getAttribute("height")||"50",b=this.getAttribute("color")||"currentColor",o=this.hasAttribute("flip");this.shadowRoot.innerHTML=`
2252
2502
  <style>
2253
2503
  :host {
2254
2504
  display: block;
2255
2505
  line-height: 0;
2256
2506
  width: 100%;
2257
2507
  overflow: hidden;
2258
- color: ${o};
2508
+ color: ${b};
2259
2509
  }
2260
2510
  svg {
2261
2511
  display: block;
2262
2512
  width: 100%;
2263
2513
  height: ${n}px;
2264
- ${b?"transform: rotate(180deg);":""}
2514
+ ${o?"transform: rotate(180deg);":""}
2265
2515
  }
2266
2516
  </style>
2267
2517
  <svg viewBox="0 0 100 ${n}" preserveAspectRatio="none">
2268
2518
  <path d="${this._getPatternPath(t,100,parseInt(n))}" fill="currentColor" />
2269
2519
  </svg>
2270
- `}};A("af-divider",xn);qh=xn});var no={};L(no,{default:()=>Hh,KangaCard:()=>Qn});var Qn,Hh;var bo=Y(()=>{M();Ft();Qn=class Qn extends r{static get observedAttributes(){return["theme","proverb","proverb-translation"]}constructor(){super();this.render()}connectedCallback(){this.loadStyles(),this.applyTheme()}attributeChangedCallback(t,n,o){if(n!==o)if(t==="theme")this.applyTheme();else this.render()}getThemeColors(){let t=this.getAttribute("theme")||"tanzania",n={tanzania:{primary:"#1EB53A",accent:"#FCD116",border:"#00A3DD",text:"#000000"},maasai:{primary:"#8B0000",accent:"#FF0000",border:"#000000",text:"#FFFFFF"},ndebele:{primary:"#4169E1",accent:"#FFD700",border:"#FF69B4",text:"#000000"}};return n[t]||n.tanzania}applyTheme(){let t=this.getThemeColors(),n=this.shadowRoot.querySelector(".pindo");if(n){let o=generateKangaBorder({primaryColor:t.primary,accentColor:t.accent});n.style.backgroundImage=`url("${o}")`,n.style.backgroundRepeat="repeat"}}render(){let t=this.getAttribute("proverb")||"",n=this.getAttribute("proverb-translation")||"",o=this.getThemeColors();this.shadowRoot.innerHTML=`
2520
+ `}};_("af-divider",Qn);Wa=Qn});var xb={};i(xb,{default:()=>ma,KangaCard:()=>Jn});var Jn,ma;var qb=x(()=>{X();Gt();Jn=class Jn extends c{static get observedAttributes(){return["theme","proverb","proverb-translation"]}constructor(){super();this.render()}connectedCallback(){this.loadStyles(),this.applyTheme()}attributeChangedCallback(t,n,b){if(n!==b)if(t==="theme")this.applyTheme();else this.render()}getThemeColors(){let t=this.getAttribute("theme")||"tanzania",n={tanzania:{primary:"#1EB53A",accent:"#FCD116",border:"#00A3DD",text:"#000000"},maasai:{primary:"#8B0000",accent:"#FF0000",border:"#000000",text:"#FFFFFF"},ndebele:{primary:"#4169E1",accent:"#FFD700",border:"#FF69B4",text:"#000000"}};return n[t]||n.tanzania}applyTheme(){let t=this.getThemeColors(),n=this.shadowRoot.querySelector(".pindo");if(n){let b=generateKangaBorder({primaryColor:t.primary,accentColor:t.accent});n.style.backgroundImage=`url("${b}")`,n.style.backgroundRepeat="repeat"}}render(){let t=this.getAttribute("proverb")||"",n=this.getAttribute("proverb-translation")||"",b=this.getThemeColors();this.shadowRoot.innerHTML=`
2271
2521
  <style>
2272
2522
  :host {
2273
2523
  display: block;
@@ -2290,7 +2540,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2290
2540
  /* Pindo - Decorative Border */
2291
2541
  .pindo {
2292
2542
  padding: var(--space-13, 13px);
2293
- background-color: ${o.primary};
2543
+ background-color: ${b.primary};
2294
2544
  }
2295
2545
 
2296
2546
  /* Mji - Central Content Area */
@@ -2302,8 +2552,8 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2302
2552
 
2303
2553
  /* Jina - Proverb Inscription */
2304
2554
  .jina {
2305
- background-color: ${o.border};
2306
- color: ${o.text};
2555
+ background-color: ${b.border};
2556
+ color: ${b.text};
2307
2557
  padding: var(--space-8, 8px) var(--space-13, 13px);
2308
2558
  text-align: center;
2309
2559
  font-style: italic;
@@ -2330,7 +2580,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2330
2580
  }
2331
2581
 
2332
2582
  ::slotted(h1), ::slotted(h2), ::slotted(h3) {
2333
- color: ${o.primary};
2583
+ color: ${b.primary};
2334
2584
  margin-bottom: var(--space-8, 8px);
2335
2585
  }
2336
2586
  </style>
@@ -2349,7 +2599,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2349
2599
  </div>
2350
2600
  `:'<div class="jina"><slot name="proverb"></slot></div>'}
2351
2601
  </article>
2352
- `,this.applyTheme()}};A("af-kanga-card",Qn);Hh=Qn});var oo={};L(oo,{default:()=>Xh,CulturalCard:()=>Jn});var Jn,Xh;var lo=Y(()=>{M();Ft();Jn=class Jn extends r{static get observedAttributes(){return["culture","interactive"]}constructor(){super();this._cultures={maasai:{name:"Maasai",region:"Tanzania/Kenya",pattern:"generateShuka",colors:{primary:"#FF0000",accent:"#000000"}},hadzabe:{name:"Hadzabe",region:"Tanzania",pattern:"generateHadzabe",colors:{primary:"#8B4513",accent:"#CD853F"}},swahili:{name:"Swahili",region:"East Africa",pattern:"generateKangaBorder",colors:{primary:"#1EB53A",accent:"#FCD116"}},kitenge:{name:"Kitenge",region:"East Africa",pattern:"generateKitenge",colors:{primary:"#00A3DD",accent:"#1EB53A"}},tibeb:{name:"Tibeb",region:"Ethiopia",pattern:"generateTibeb",colors:{primary:"#009E60",accent:"#FCDD09"}},ashanti:{name:"Ashanti/Akan",region:"Ghana",pattern:"generateKente",colors:{primary:"#FFD700",accent:"#228B22"}},adinkra:{name:"Adinkra",region:"Ghana",pattern:"generateAdinkra",colors:{primary:"#000000",accent:"#CD853F"}},bogolan:{name:"Bogolan",region:"Mali",pattern:"generateBogolan",colors:{primary:"#3E2723",accent:"#D7CCC8"}},yoruba:{name:"Yoruba",region:"Nigeria",pattern:"generateAsoOke",colors:{primary:"#4B0082",accent:"#FFD700"}},ankara:{name:"Ankara",region:"West Africa",pattern:"generateAnkara",colors:{primary:"#FF6B00",accent:"#00A86B"}},kuba:{name:"Kuba Shoowa",region:"DRC",pattern:"generateKuba",colors:{primary:"#D2B48C",accent:"#3E2723"}},imigongo:{name:"Imigongo",region:"Rwanda",pattern:"generateImigongo",colors:{primary:"#000000",accent:"#B22222"}},ndebele:{name:"Ndebele",region:"South Africa",pattern:"generateNdebele",colors:{primary:"#4169E1",accent:"#FFD700"}},zulu:{name:"Zulu",region:"South Africa",pattern:"generateZulu",colors:{primary:"#FF0000",accent:"#000000"}},swazi:{name:"Swazi",region:"Eswatini",pattern:"generateSwazi",colors:{primary:"#3E5EB9",accent:"#FECD00"}},xhosa:{name:"Xhosa",region:"South Africa",pattern:"generateXhosa",colors:{primary:"#00A86B",accent:"#1a1a2e"}}},this.render()}connectedCallback(){this._setupInteraction()}_setupInteraction(){if(!this.hasAttribute("interactive"))return;this.shadowRoot.querySelector(".culture-selector")?.addEventListener("change",(n)=>{this.setAttribute("culture",n.target.value),this.emit("af-culture-change",{culture:n.target.value})})}attributeChangedCallback(){this.render(),this._setupInteraction()}render(){let t=this.getAttribute("culture")||"maasai",n=this.hasAttribute("interactive"),o=this._cultures[t]||this._cultures.maasai,b=St[o.pattern],l=b?b():"";this.shadowRoot.innerHTML=`
2602
+ `,this.applyTheme()}};_("af-kanga-card",Jn);ma=Jn});var kb={};i(kb,{default:()=>pa,CulturalCard:()=>Gn});var Gn,pa;var Hb=x(()=>{X();Gt();Gn=class Gn extends c{static get observedAttributes(){return["culture","interactive"]}constructor(){super();this._cultures={maasai:{name:"Maasai",region:"Tanzania/Kenya",pattern:"generateShuka",colors:{primary:"#FF0000",accent:"#000000"}},hadzabe:{name:"Hadzabe",region:"Tanzania",pattern:"generateHadzabe",colors:{primary:"#8B4513",accent:"#CD853F"}},swahili:{name:"Swahili",region:"East Africa",pattern:"generateKangaBorder",colors:{primary:"#1EB53A",accent:"#FCD116"}},kitenge:{name:"Kitenge",region:"East Africa",pattern:"generateKitenge",colors:{primary:"#00A3DD",accent:"#1EB53A"}},tibeb:{name:"Tibeb",region:"Ethiopia",pattern:"generateTibeb",colors:{primary:"#009E60",accent:"#FCDD09"}},ashanti:{name:"Ashanti/Akan",region:"Ghana",pattern:"generateKente",colors:{primary:"#FFD700",accent:"#228B22"}},adinkra:{name:"Adinkra",region:"Ghana",pattern:"generateAdinkra",colors:{primary:"#000000",accent:"#CD853F"}},bogolan:{name:"Bogolan",region:"Mali",pattern:"generateBogolan",colors:{primary:"#3E2723",accent:"#D7CCC8"}},yoruba:{name:"Yoruba",region:"Nigeria",pattern:"generateAsoOke",colors:{primary:"#4B0082",accent:"#FFD700"}},ankara:{name:"Ankara",region:"West Africa",pattern:"generateAnkara",colors:{primary:"#FF6B00",accent:"#00A86B"}},kuba:{name:"Kuba Shoowa",region:"DRC",pattern:"generateKuba",colors:{primary:"#D2B48C",accent:"#3E2723"}},imigongo:{name:"Imigongo",region:"Rwanda",pattern:"generateImigongo",colors:{primary:"#000000",accent:"#B22222"}},ndebele:{name:"Ndebele",region:"South Africa",pattern:"generateNdebele",colors:{primary:"#4169E1",accent:"#FFD700"}},zulu:{name:"Zulu",region:"South Africa",pattern:"generateZulu",colors:{primary:"#FF0000",accent:"#000000"}},swazi:{name:"Swazi",region:"Eswatini",pattern:"generateSwazi",colors:{primary:"#3E5EB9",accent:"#FECD00"}},xhosa:{name:"Xhosa",region:"South Africa",pattern:"generateXhosa",colors:{primary:"#00A86B",accent:"#1a1a2e"}}},this.render()}connectedCallback(){this._setupInteraction()}_setupInteraction(){if(!this.hasAttribute("interactive"))return;this.shadowRoot.querySelector(".culture-selector")?.addEventListener("change",(n)=>{this.setAttribute("culture",n.target.value),this.emit("af-culture-change",{culture:n.target.value})})}attributeChangedCallback(){this.render(),this._setupInteraction()}render(){let t=this.getAttribute("culture")||"maasai",n=this.hasAttribute("interactive"),b=this._cultures[t]||this._cultures.maasai,o=Jt[b.pattern],l=o?o():"";this.shadowRoot.innerHTML=`
2353
2603
  <style>
2354
2604
  :host {
2355
2605
  display: block;
@@ -2391,7 +2641,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2391
2641
  position: absolute;
2392
2642
  bottom: 10px;
2393
2643
  left: 10px;
2394
- background: ${o.colors.primary};
2644
+ background: ${b.colors.primary};
2395
2645
  color: white;
2396
2646
  padding: 4px 12px;
2397
2647
  border-radius: 20px;
@@ -2426,7 +2676,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2426
2676
  .card-title h3 {
2427
2677
  margin: 0;
2428
2678
  font-size: 18px;
2429
- color: ${o.colors.primary};
2679
+ color: ${b.colors.primary};
2430
2680
  }
2431
2681
 
2432
2682
  .culture-icon {
@@ -2435,7 +2685,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2435
2685
  border-radius: 50%;
2436
2686
  background-image: url("${l}");
2437
2687
  background-size: cover;
2438
- border: 2px solid ${o.colors.accent};
2688
+ border: 2px solid ${b.colors.accent};
2439
2689
  }
2440
2690
 
2441
2691
  .card-content {
@@ -2447,7 +2697,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2447
2697
  width: 100%;
2448
2698
  padding: 10px;
2449
2699
  margin-top: 15px;
2450
- border: 2px solid ${o.colors.primary};
2700
+ border: 2px solid ${b.colors.primary};
2451
2701
  border-radius: 6px;
2452
2702
  font-family: inherit;
2453
2703
  font-size: 14px;
@@ -2457,7 +2707,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2457
2707
 
2458
2708
  .culture-selector:focus {
2459
2709
  outline: none;
2460
- box-shadow: 0 0 0 3px ${o.colors.primary}30;
2710
+ box-shadow: 0 0 0 3px ${b.colors.primary}30;
2461
2711
  }
2462
2712
 
2463
2713
  select option {
@@ -2473,13 +2723,13 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2473
2723
  <article class="cultural-card">
2474
2724
  <div class="pattern-header">
2475
2725
  <div class="pattern-overlay"></div>
2476
- <span class="culture-badge">${o.name}</span>
2477
- <span class="region-badge">\uD83D\uDCCD ${o.region}</span>
2726
+ <span class="culture-badge">${b.name}</span>
2727
+ <span class="region-badge">\uD83D\uDCCD ${b.region}</span>
2478
2728
  </div>
2479
2729
  <div class="card-body">
2480
2730
  <div class="card-title">
2481
2731
  <div class="culture-icon"></div>
2482
- <h3>${o.name} Pattern</h3>
2732
+ <h3>${b.name} Pattern</h3>
2483
2733
  </div>
2484
2734
  <div class="card-content">
2485
2735
  <slot></slot>
@@ -2514,7 +2764,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2514
2764
  `:""}
2515
2765
  </div>
2516
2766
  </article>
2517
- `}};A("af-cultural-card",Jn);Xh=Jn});var ho={};L(ho,{default:()=>Yh,PatternShowcase:()=>Gn});var Gn,Yh;var fo=Y(()=>{M();Ft();Gn=class Gn extends r{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:On,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:Wn,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:En,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:Un,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:un,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:Vn,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:Nn,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:mn,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:jn,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:Zn,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:Kn,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:pn,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:dn,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:yn,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:In,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:Pn,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:Tn,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:Cn,meaning:"Dignity, Coming of age"}],this.render()}connectedCallback(){this._setupHovers()}_setupHovers(){this.shadowRoot.querySelectorAll(".pattern-item").forEach((t)=>{t.addEventListener("click",()=>{let n=t.dataset.key,o=this._allPatterns.find((b)=>b.key===n);if(o)this.emit("af-pattern-select",{pattern:o})})})}attributeChangedCallback(){this.render(),this._setupHovers()}render(){let t=this.getAttribute("region")||"all",n=this.getAttribute("size")||"md",o=t==="all"?this._allPatterns:this._allPatterns.filter((h)=>h.region===t),b={sm:80,md:120,lg:160},l=b[n]||b.md;this.shadowRoot.innerHTML=`
2767
+ `}};_("af-cultural-card",Gn);pa=Gn});var Yb={};i(Yb,{default:()=>ua,PatternShowcase:()=>Sn});var Sn,ua;var Xb=x(()=>{X();Gt();Sn=class Sn extends c{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:pn,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:un,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:Un,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:Vn,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:yn,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:Nn,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:Kn,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:Pn,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:jn,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:no,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:In,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:Tn,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:Cn,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:to,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:en,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:Zn,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:sn,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:zn,meaning:"Dignity, Coming of age"}],this.render()}connectedCallback(){this._setupHovers()}_setupHovers(){this.shadowRoot.querySelectorAll(".pattern-item").forEach((t)=>{t.addEventListener("click",()=>{let n=t.dataset.key,b=this._allPatterns.find((o)=>o.key===n);if(b)this.emit("af-pattern-select",{pattern:b})})})}attributeChangedCallback(){this.render(),this._setupHovers()}render(){let t=this.getAttribute("region")||"all",n=this.getAttribute("size")||"md",b=t==="all"?this._allPatterns:this._allPatterns.filter((a)=>a.region===t),o={sm:80,md:120,lg:160},l=o[n]||o.md;this.shadowRoot.innerHTML=`
2518
2768
  <style>
2519
2769
  :host {
2520
2770
  display: block;
@@ -2634,20 +2884,20 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2634
2884
  </div>
2635
2885
 
2636
2886
  <div class="pattern-grid">
2637
- ${o.map((h)=>`
2638
- <div class="pattern-item" data-key="${h.key}">
2639
- <div class="pattern-preview" style="background-image: url('${h.fn()}')"></div>
2887
+ ${b.map((a)=>`
2888
+ <div class="pattern-item" data-key="${a.key}">
2889
+ <div class="pattern-preview" style="background-image: url('${a.fn()}')"></div>
2640
2890
  <div class="pattern-info">
2641
- <span class="region-label region-${h.region}">${h.region.charAt(0).toUpperCase()+h.region.slice(1)}</span>
2642
- <div class="pattern-name">${h.name}</div>
2643
- <div class="pattern-country">${h.country}</div>
2644
- <div class="pattern-meaning">${h.meaning}</div>
2891
+ <span class="region-label region-${a.region}">${a.region.charAt(0).toUpperCase()+a.region.slice(1)}</span>
2892
+ <div class="pattern-name">${a.name}</div>
2893
+ <div class="pattern-country">${a.country}</div>
2894
+ <div class="pattern-meaning">${a.meaning}</div>
2645
2895
  </div>
2646
2896
  </div>
2647
2897
  `).join("")}
2648
2898
  </div>
2649
2899
  </div>
2650
- `,this.shadowRoot.querySelectorAll(".region-tab").forEach((h)=>{h.addEventListener("click",()=>{this.setAttribute("region",h.dataset.region)})})}};A("af-pattern-showcase",Gn);Yh=Gn});var ao={};L(ao,{AfriLanguageSwitcher:()=>Y0});var Y0;var go=Y(()=>{M();Y0=class Y0 extends r{static get observedAttributes(){return["current"]}render(){let t=[{code:"en",name:"English"},{code:"sw",name:"Kiswahili"},{code:"fr",name:"Français"},{code:"ar",name:"العربية",dir:"rtl"},{code:"am",name:"አማርኛ"},{code:"yo",name:"Yorùbá"}],n=this.getAttribute("current")||"en",o=t.find((b)=>b.code===n)||t[0];this.shadowRoot.innerHTML=R`
2900
+ `,this.shadowRoot.querySelectorAll(".region-tab").forEach((a)=>{a.addEventListener("click",()=>{this.setAttribute("region",a.dataset.region)})})}};_("af-pattern-showcase",Sn);ua=Sn});var ib={};i(ib,{AfriLanguageSwitcher:()=>Fo});var Fo;var Lb=x(()=>{X();Fo=class Fo extends c{static get observedAttributes(){return["current"]}render(){let t=[{code:"en",name:"English"},{code:"sw",name:"Kiswahili"},{code:"fr",name:"Français"},{code:"ar",name:"العربية",dir:"rtl"},{code:"am",name:"አማርኛ"},{code:"yo",name:"Yorùbá"}],n=this.getAttribute("current")||"en",b=t.find((o)=>o.code===n)||t[0];this.shadowRoot.innerHTML=Q`
2651
2901
  <style>
2652
2902
  :host { display: inline-block; position: relative; font-family: var(--font-body); }
2653
2903
  .switcher-btn {
@@ -2688,17 +2938,17 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2688
2938
 
2689
2939
  <button class="switcher-btn">
2690
2940
  <span>🌍</span>
2691
- <span>${o.name}</span>
2941
+ <span>${b.name}</span>
2692
2942
  </button>
2693
2943
 
2694
2944
  <div class="dropdown">
2695
- ${t.map((b)=>R`
2696
- <div class="lang-option" data-code="${b.code}" dir="${b.dir||"ltr"}">
2697
- ${b.name}
2945
+ ${t.map((o)=>Q`
2946
+ <div class="lang-option" data-code="${o.code}" dir="${o.dir||"ltr"}">
2947
+ ${o.name}
2698
2948
  </div>
2699
2949
  `)}
2700
2950
  </div>
2701
- `,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((b)=>{b.onclick=()=>{let l=b.dataset.code;if(this.setAttribute("current",l),this.removeAttribute("open"),this.emit("lang-change",{code:l}),l==="ar")document.documentElement.dir="rtl";else document.documentElement.dir="ltr"}})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}};A("af-language-switcher",Y0)});var $o={};L($o,{AfriAuth:()=>x0});var x0;var vo=Y(()=>{M();x0=class x0 extends r{constructor(){super();this.mode="login"}connectedCallback(){this.render(),this.setupEvents()}setupEvents(){let t=this.shadowRoot.querySelector("form"),n=this.shadowRoot.querySelector(".toggle-mode");if(n)n.addEventListener("click",(o)=>{o.preventDefault(),this.mode=this.mode==="login"?"register":"login",this.render(),this.setupEvents()});if(t)t.addEventListener("submit",async(o)=>{o.preventDefault();let b=this.shadowRoot.querySelector("#email").value,l=this.shadowRoot.querySelector("#password").value,h=this.shadowRoot.querySelector(".feedback");h.textContent="Processing...";try{let a=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:b,password:l})})).json();if(a.error)h.textContent=a.error,h.style.color="#ef4444";else h.textContent="Success! Redirecting...",h.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch(f){h.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
2951
+ `,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((o)=>{o.onclick=()=>{let l=o.dataset.code;if(this.setAttribute("current",l),this.removeAttribute("open"),this.emit("lang-change",{code:l}),l==="ar")document.documentElement.dir="rtl";else document.documentElement.dir="ltr"}})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}};_("af-language-switcher",Fo)});var Mb={};i(Mb,{AfriAuth:()=>Ro});var Ro;var Qb=x(()=>{X();Ro=class Ro extends c{constructor(){super();this.mode="login"}connectedCallback(){this.render(),this.setupEvents()}setupEvents(){let t=this.shadowRoot.querySelector("form"),n=this.shadowRoot.querySelector(".toggle-mode");if(n)n.addEventListener("click",(b)=>{b.preventDefault(),this.mode=this.mode==="login"?"register":"login",this.render(),this.setupEvents()});if(t)t.addEventListener("submit",async(b)=>{b.preventDefault();let o=this.shadowRoot.querySelector("#email").value,l=this.shadowRoot.querySelector("#password").value,a=this.shadowRoot.querySelector(".feedback");a.textContent="Processing...";try{let f=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:o,password:l})})).json();if(f.error)a.textContent=f.error,a.style.color="#ef4444";else a.textContent="Success! Redirecting...",a.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch(h){a.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
2702
2952
  <style>
2703
2953
  :host {
2704
2954
  display: block;
@@ -2796,7 +3046,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2796
3046
  <span class="toggle-mode">${t?"Create an account":"Sign in"}</span>
2797
3047
  </div>
2798
3048
  </div>
2799
- `}};A("af-auth",x0)});var wo={};L(wo,{default:()=>xh});var Q0,xh;var _o=Y(()=>{M();Q0=class Q0 extends r{constructor(){super();this.currentTheme="dark"}connectedCallback(){this.loadStyles();let t=localStorage.getItem("africode-theme");if(t)this.currentTheme=t,document.documentElement.setAttribute("data-theme",t);else{let n=window.matchMedia("(prefers-color-scheme: light)").matches;this.currentTheme=n?"light":"dark",document.documentElement.setAttribute("data-theme",this.currentTheme)}this.render()}toggleTheme(){this.currentTheme=this.currentTheme==="dark"?"light":"dark",document.documentElement.setAttribute("data-theme",this.currentTheme),localStorage.setItem("africode-theme",this.currentTheme),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{theme:this.currentTheme}})),this.render()}render(){let t=this.currentTheme==="dark";this.shadowRoot.innerHTML=R`
3049
+ `}};_("af-auth",Ro)});var Jb={};i(Jb,{default:()=>Ua});var Bo,Ua;var Gb=x(()=>{X();Bo=class Bo extends c{constructor(){super();this.currentTheme="dark"}connectedCallback(){this.loadStyles();let t=localStorage.getItem("africode-theme");if(t)this.currentTheme=t,document.documentElement.setAttribute("data-theme",t);else{let n=window.matchMedia("(prefers-color-scheme: light)").matches;this.currentTheme=n?"light":"dark",document.documentElement.setAttribute("data-theme",this.currentTheme)}this.render()}toggleTheme(){this.currentTheme=this.currentTheme==="dark"?"light":"dark",document.documentElement.setAttribute("data-theme",this.currentTheme),localStorage.setItem("africode-theme",this.currentTheme),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{theme:this.currentTheme}})),this.render()}render(){let t=this.currentTheme==="dark";this.shadowRoot.innerHTML=Q`
2800
3050
  <style>
2801
3051
  .toggle-btn {
2802
3052
  background: var(--bg-surface-elevated, var(--afri-obsidian));
@@ -2825,13 +3075,13 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2825
3075
  <span class="icon">\${isDark ? '🌙' : '☀️'}</span>
2826
3076
  <span>\${isDark ? 'Dark Mode' : 'Light Mode'}</span>
2827
3077
  </button>
2828
- `;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};A("af-theme-toggle",Q0);xh=Q0});ot();kt();Ft();var en={};L(en,{transitionPage:()=>k0,default:()=>Ro,animateStaggered:()=>L0,Easing:()=>pt});var pt={DrumBeat:"cubic-bezier(0.1, 0.9, 0.2, 1.0)",KoraPluck:"cubic-bezier(0.34, 1.56, 0.64, 1)",RiverFlow:"cubic-bezier(0.4, 0.0, 0.2, 1)"};function L0(t,{delay:n=50,duration:o=600,easing:b=pt.DrumBeat,y:l=20,scale:h=0.95}={}){let f=typeof t==="string"?document.querySelectorAll(t):t;if(!f||f.length===0)return;let a=new IntersectionObserver((g)=>{g.forEach((c,J)=>{if(c.isIntersecting){let F=Math.random()*10,S=J*n+F,O=c.target;O.animate([{opacity:0,transform:`translateY(${l}px) scale(${h})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:o,delay:S,easing:b,fill:"forwards"}),a.unobserve(O),O.style.opacity="1"}})},{threshold:0.1});f.forEach((g)=>{g.style.opacity="0",a.observe(g)})}function k0(t){document.body.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.98)"}],{duration:200,easing:"ease-in"}).onfinish=()=>{t(),document.body.animate([{opacity:0,transform:"scale(1.02)"},{opacity:1,transform:"scale(1)"}],{duration:400,easing:pt.DrumBeat})}}var Ro={Easing:pt,animateStaggered:L0,transitionPage:k0};function S0(t){if(typeof window>"u")return;if(!("IntersectionObserver"in window)){Object.values(t).forEach((o)=>o());return}let n=new IntersectionObserver((o)=>{o.forEach((b)=>{if(b.isIntersecting){let l=b.target.tagName.toLowerCase(),h=t[l];if(h)console.log(`\uD83C\uDFDD️ Hydrating Island: <${l}>`),h().then(()=>{delete t[l]}).catch((f)=>console.error(`Failed to hydrate <${l}>`,f));n.unobserve(b.target)}})},{rootMargin:"50px 0px"});Object.keys(t).forEach((o)=>{document.querySelectorAll(o).forEach((b)=>n.observe(b))})}Zt();a0();var s0="afri_session",Pl=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function g0(t=""){return t.split(";").map((n)=>n.trim()).filter(Boolean).reduce((n,o)=>{let b=o.indexOf("=");if(b===-1)return n;let l=o.slice(0,b).trim(),h=o.slice(b+1).trim();return n[l]=h,n},{})}function $0(){return crypto.randomUUID()}function z0(t){let n=t?.headers?.get?.("cookie")||"",b=g0(n).afri_session;if(b&&Pl.test(b))return b;return $0()}class tb{constructor(){this.sessions=new Map}ensure(t){if(!this.sessions.has(t))this.sessions.set(t,{data:{counter:{value:0}},meta:{createdAt:new Date,lastSeenAt:new Date}});return this.sessions.get(t)}touch(t){let n=this.ensure(t);return n.meta.lastSeenAt=new Date,n}has(t){return this.sessions.has(t)}get(t){return this.touch(t).data}set(t,n,o){let b=this.get(t),l=n.split("/"),h=b;while(l.length>1){let f=l.shift();if(!h[f]||typeof h[f]!=="object")h[f]={};h=h[f]}return h[l[0]]=o,o}delete(t){return this.sessions.delete(t)}clear(){this.sessions.clear()}}var P=new tb;var nb={incrementCounter(t){let b=(P.get(t).counter?.value||0)+1;return P.set(t,"counter/value",b),b},resetCounter(t){return P.set(t,"counter/value",0),0},getCounter(t){return P.get(t).counter?.value||0}};class v0{constructor(){this.middlewares=[]}use(t){if(typeof t!=="function")throw Error("Middleware must be a function");return this.middlewares.push(t),this}async run(t){for(let n of this.middlewares){let o=await n(t);if(o instanceof Response)return o;if(o?.response)return o.response;if(o?.context)Object.assign(t,o.context)}return null}}function bb(){return async(t)=>{return f0("log",`[AfriCode] ${t.req.method} ${t.pathname}`),{}}}function ob(t={}){return async(n)=>{let{protectedPaths:o=[],authorize:b=()=>!1,unauthorizedResponse:l=()=>new Response("Unauthorized",{status:401})}=t;if(o.some((f)=>n.pathname.startsWith(f))){if(!await b(n))return{response:l(n)}}return{}}}class nt extends Error{constructor(t,n="INTERNAL_ERROR",o={},b=500){super(t);this.name="AfriCodeError",this.code=n,this.context=o,this.statusCode=b,this.timestamp=new Date().toISOString()}toJSON(){return{error:{code:this.code,message:this.message,...this.context.field?{field:this.context.field}:{},...Object.keys(this.context).length>0?{context:this.context}:{}}}}toResponse(){return new Response(JSON.stringify(this.toJSON()),{status:this.statusCode,headers:{"Content-Type":"application/json"}})}}class et extends nt{constructor(t,n=null,o={}){super(t,"VALIDATION_FAILED",{field:n,...o},422);this.name="ValidationError"}static fromZodError(t){let n=t.issues[0],o=n?.path?.join(".")||null,b=n?.message||"Validation failed";return new et(b,o,{issues:t.issues.map((l)=>({field:l.path.join("."),message:l.message,code:l.code}))})}}class w0 extends nt{constructor(t,n){let o=n===""?"an empty string":`"${n}"`;super(`Field '${t}' must be a valid URL or null. Got ${o}.`,"INVALID_URL",{field:t,received:n},422);this.name="InvalidUrlError"}}class jt extends nt{constructor(t,n="SECURITY_VIOLATION",o={},b=403){super(t,n,o,b);this.name="SecurityError"}}class _0 extends jt{constructor(t="missing"){let n={missing:"CSRF token missing. Include the token in both the cookie and the X-CSRF-Token header.",mismatch:"CSRF token mismatch. The header token does not match the cookie token."};super(n[t]||n.missing,"CSRF_FAILURE",{reason:t});this.name="CsrfError"}}class r0 extends jt{constructor(t,n="Too many requests. Please try again later."){super(n,"RATE_LIMIT_EXCEEDED",{retryAfter:t},429);this.name="RateLimitError"}}class c0 extends nt{constructor(t,n=null,o={}){super(t,"DATABASE_ERROR",{operation:n,...o},500);this.name="DatabaseError"}}class A0 extends nt{constructor(t,n,o={}){super(`Component Error in <${n}>: ${t}`,"COMPONENT_ERROR",{componentName:n,...o},500);this.name="ComponentError"}}M();M();class q0 extends r{static get observedAttributes(){return["theme","fallback-message"]}constructor(){super();this._hasError=!1,this._errorDetail=null,this.render()}connectedCallback(){this.addEventListener("af-component-error",this._handleError.bind(this))}disconnectedCallback(){this.removeEventListener("af-component-error",this._handleError.bind(this))}_handleError(t){t.stopPropagation(),this._hasError=!0,this._errorDetail=t.detail,console.warn("[AfriCode Boundary] Caught error:",this._errorDetail),this.render()}reset(){this._hasError=!1,this._errorDetail=null,this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.getAttribute("fallback-message")||"A part of this page failed to load.",o={tanzania:{bg:"#FFF9E6",border:"#FCD116",text:"#5A4A00"},maasai:{bg:"#FFEEEE",border:"#FF0000",text:"#8B0000"},ndebele:{bg:"#EBF0FF",border:"#4169E1",text:"#002B5C"},ocean:{bg:"#E6FAFF",border:"#00A3DD",text:"#004A66"}},b=o[t]||o.tanzania;if(this._hasError){this.shadowRoot.innerHTML=`
3078
+ `;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};_("af-theme-toggle",Bo);Ua=Bo});bt();Qt();Gt();var oo={};i(oo,{transitionPage:()=>mo,default:()=>Pb,animateStaggered:()=>Wo,Easing:()=>Pt});var Pt={DrumBeat:"cubic-bezier(0.1, 0.9, 0.2, 1.0)",KoraPluck:"cubic-bezier(0.34, 1.56, 0.64, 1)",RiverFlow:"cubic-bezier(0.4, 0.0, 0.2, 1)"};function Wo(t,{delay:n=50,duration:b=600,easing:o=Pt.DrumBeat,y:l=20,scale:a=0.95}={}){let h=typeof t==="string"?document.querySelectorAll(t):t;if(!h||h.length===0)return;let f=new IntersectionObserver((r)=>{r.forEach((A,L)=>{if(A.isIntersecting){let S=Math.random()*10,G=L*n+S,B=A.target;B.animate([{opacity:0,transform:`translateY(${l}px) scale(${a})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:b,delay:G,easing:o,fill:"forwards"}),f.unobserve(B),B.style.opacity="1"}})},{threshold:0.1});h.forEach((r)=>{r.style.opacity="0",f.observe(r)})}function mo(t){document.body.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.98)"}],{duration:200,easing:"ease-in"}).onfinish=()=>{t(),document.body.animate([{opacity:0,transform:"scale(1.02)"},{opacity:1,transform:"scale(1)"}],{duration:400,easing:Pt.DrumBeat})}}var Pb={Easing:Pt,animateStaggered:Wo,transitionPage:mo};function po(t){if(typeof window>"u")return;if(!("IntersectionObserver"in window)){Object.values(t).forEach((b)=>b());return}let n=new IntersectionObserver((b)=>{b.forEach((o)=>{if(o.isIntersecting){let l=o.target.tagName.toLowerCase(),a=t[l];if(a)console.log(`\uD83C\uDFDD️ Hydrating Island: <${l}>`),a().then(()=>{delete t[l]}).catch((h)=>console.error(`Failed to hydrate <${l}>`,h));n.unobserve(o.target)}})},{rootMargin:"50px 0px"});Object.keys(t).forEach((b)=>{document.querySelectorAll(b).forEach((o)=>n.observe(o))})}nn();vo();var g0="afri_session",ha=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function wo(t=""){return t.split(";").map((n)=>n.trim()).filter(Boolean).reduce((n,b)=>{let o=b.indexOf("=");if(o===-1)return n;let l=b.slice(0,o).trim(),a=b.slice(o+1).trim();return n[l]=a,n},{})}function _o(){return crypto.randomUUID()}function $0(t){let n=t?.headers?.get?.("cookie")||"",o=wo(n).afri_session;if(o&&ha.test(o))return o;return _o()}class c0{constructor(){this.sessions=new Map}ensure(t){if(!this.sessions.has(t))this.sessions.set(t,{data:{counter:{value:0}},meta:{createdAt:new Date,lastSeenAt:new Date}});return this.sessions.get(t)}touch(t){let n=this.ensure(t);return n.meta.lastSeenAt=new Date,n}has(t){return this.sessions.has(t)}get(t){return this.touch(t).data}set(t,n,b){let o=this.get(t),l=n.split("/"),a=o;while(l.length>1){let h=l.shift();if(!a[h]||typeof a[h]!=="object")a[h]={};a=a[h]}return a[l[0]]=b,b}delete(t){return this.sessions.delete(t)}clear(){this.sessions.clear()}}var I=new c0;var v0={incrementCounter(t){let o=(I.get(t).counter?.value||0)+1;return I.set(t,"counter/value",o),o},resetCounter(t){return I.set(t,"counter/value",0),0},getCounter(t){return I.get(t).counter?.value||0}};class Ao{constructor(){this.middlewares=[]}use(t){if(typeof t!=="function")throw Error("Middleware must be a function");return this.middlewares.push(t),this}async run(t){for(let n of this.middlewares){let b=await n(t);if(b instanceof Response)return b;if(b?.response)return b.response;if(b?.context)Object.assign(t,b.context)}return null}}function w0(){return async(t)=>{return co("log",`[AfriCode] ${t.req.method} ${t.pathname}`),{}}}function _0(t={}){return async(n)=>{let{protectedPaths:b=[],authorize:o=()=>!1,unauthorizedResponse:l=()=>new Response("Unauthorized",{status:401})}=t;if(b.some((h)=>n.pathname.startsWith(h))){if(!await o(n))return{response:l(n)}}return{}}}class nt extends Error{constructor(t,n="INTERNAL_ERROR",b={},o=500){super(t);this.name="AfriCodeError",this.code=n,this.context=b,this.statusCode=o,this.timestamp=new Date().toISOString()}toJSON(){return{error:{code:this.code,message:this.message,...this.context.field?{field:this.context.field}:{},...Object.keys(this.context).length>0?{context:this.context}:{}}}}toResponse(){return new Response(JSON.stringify(this.toJSON()),{status:this.statusCode,headers:{"Content-Type":"application/json"}})}}class on extends nt{constructor(t,n=null,b={}){super(t,"VALIDATION_FAILED",{field:n,...b},422);this.name="ValidationError"}static fromZodError(t){let n=t.issues[0],b=n?.path?.join(".")||null,o=n?.message||"Validation failed";return new on(o,b,{issues:t.issues.map((l)=>({field:l.path.join("."),message:l.message,code:l.code}))})}}class xo extends nt{constructor(t,n){let b=n===""?"an empty string":`"${n}"`;super(`Field '${t}' must be a valid URL or null. Got ${b}.`,"INVALID_URL",{field:t,received:n},422);this.name="InvalidUrlError"}}class pt extends nt{constructor(t,n="SECURITY_VIOLATION",b={},o=403){super(t,n,b,o);this.name="SecurityError"}}class qo extends pt{constructor(t="missing"){let n={missing:"CSRF token missing. Include the token in both the cookie and the X-CSRF-Token header.",mismatch:"CSRF token mismatch. The header token does not match the cookie token."};super(n[t]||n.missing,"CSRF_FAILURE",{reason:t});this.name="CsrfError"}}class ko extends pt{constructor(t,n="Too many requests. Please try again later."){super(n,"RATE_LIMIT_EXCEEDED",{retryAfter:t},429);this.name="RateLimitError"}}class Ho extends nt{constructor(t,n=null,b={}){super(t,"DATABASE_ERROR",{operation:n,...b},500);this.name="DatabaseError"}}class Yo extends nt{constructor(t,n,b={}){super(`Component Error in <${n}>: ${t}`,"COMPONENT_ERROR",{componentName:n,...b},500);this.name="ComponentError"}}X();X();class Xo extends c{static get observedAttributes(){return["theme","fallback-message"]}constructor(){super();this._hasError=!1,this._errorDetail=null,this.render()}connectedCallback(){this.addEventListener("af-component-error",this._handleError.bind(this))}disconnectedCallback(){this.removeEventListener("af-component-error",this._handleError.bind(this))}_handleError(t){t.stopPropagation(),this._hasError=!0,this._errorDetail=t.detail,console.warn("[AfriCode Boundary] Caught error:",this._errorDetail),this.render()}reset(){this._hasError=!1,this._errorDetail=null,this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.getAttribute("fallback-message")||"A part of this page failed to load.",b={tanzania:{bg:"#FFF9E6",border:"#FCD116",text:"#5A4A00"},maasai:{bg:"#FFEEEE",border:"#FF0000",text:"#8B0000"},ndebele:{bg:"#EBF0FF",border:"#4169E1",text:"#002B5C"},ocean:{bg:"#E6FAFF",border:"#00A3DD",text:"#004A66"}},o=b[t]||b.tanzania;if(this._hasError){this.shadowRoot.innerHTML=`
2829
3079
  <style>
2830
3080
  :host { display: block; width: 100%; font-family: 'Inter', system-ui, sans-serif; }
2831
3081
  .boundary-error {
2832
- background: ${b.bg};
2833
- border-left: 4px solid ${b.border};
2834
- color: ${b.text};
3082
+ background: ${o.bg};
3083
+ border-left: 4px solid ${o.border};
3084
+ color: ${o.text};
2835
3085
  padding: 16px 20px;
2836
3086
  border-radius: 4px;
2837
3087
  margin: 12px 0;
@@ -2864,8 +3114,8 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2864
3114
  }
2865
3115
  button {
2866
3116
  background: transparent;
2867
- border: 1px solid ${b.border};
2868
- color: ${b.text};
3117
+ border: 1px solid ${o.border};
3118
+ color: ${o.text};
2869
3119
  padding: 6px 12px;
2870
3120
  border-radius: 4px;
2871
3121
  cursor: pointer;
@@ -2896,7 +3146,7 @@ var Ao=Object.defineProperty;var qo=(t)=>t;function Ho(t,n){this[t]=qo.bind(null
2896
3146
  `,this.shadowRoot.getElementById("retry-btn").addEventListener("click",()=>{this.reset()});return}this.shadowRoot.innerHTML=`
2897
3147
  <style>:host { display: block; }</style>
2898
3148
  <slot></slot>
2899
- `}}A("af-error-boundary",q0);var Mn={"af-button":()=>Promise.resolve().then(() => (fb(),hb)),"af-card":()=>Promise.resolve().then(() => (gb(),ab)),"af-navbar":()=>Promise.resolve().then(() => (vb(),$b)),"af-input":()=>Promise.resolve().then(() => (_b(),wb)),"af-alert":()=>Promise.resolve().then(() => (cb(),rb)),"af-grid":()=>Promise.resolve().then(() => (qb(),Ab)),"af-section":()=>Promise.resolve().then(() => (Xb(),Hb)),"af-icon":()=>Promise.resolve().then(() => (xb(),Yb)),"af-accordion":()=>Promise.resolve().then(() => (Jb(),Qb)),"af-hero":()=>Promise.resolve().then(() => (Mb(),Gb)),"af-table":()=>Promise.resolve().then(() => (kb(),Lb)),"af-modal":()=>Promise.resolve().then(() => (Fb(),Sb)),"af-tabs":()=>Promise.resolve().then(() => (Rb(),Bb)),"af-sidebar":()=>Promise.resolve().then(() => (Ob(),Db)),"af-dropdown":()=>Promise.resolve().then(() => (Eb(),Wb)),"af-select":()=>Promise.resolve().then(() => (Vb(),Ub)),"af-form":()=>Promise.resolve().then(() => (jb(),Nb)),"af-tooltip":()=>Promise.resolve().then(() => (mb(),Kb)),"af-toast":()=>Promise.resolve().then(() => (db(),pb)),"af-badge":()=>Promise.resolve().then(() => (Ib(),ub)),"af-avatar":()=>Promise.resolve().then(() => (Tb(),Pb)),"af-progress":()=>Promise.resolve().then(() => (Cb(),ib)),"af-loader":()=>Promise.resolve().then(() => (Zb(),yb)),"af-skeleton":()=>Promise.resolve().then(() => (sb(),eb)),"af-divider":()=>Promise.resolve().then(() => (to(),zb)),"af-kanga-card":()=>Promise.resolve().then(() => (bo(),no)),"af-cultural-card":()=>Promise.resolve().then(() => (lo(),oo)),"af-pattern-showcase":()=>Promise.resolve().then(() => (fo(),ho)),"af-language-switcher":()=>Promise.resolve().then(() => (go(),ao)),"af-auth":()=>Promise.resolve().then(() => (vo(),$o)),"af-theme-toggle":()=>Promise.resolve().then(() => (_o(),wo))};var bt={COMPONENT:"component",FORM:"form",LIST:"list",CARD:"card",MODAL:"modal",TOAST:"toast",PROGRESS:"progress"},r1={component:{type:"object",properties:{id:{type:"string"},type:{type:"string",enum:Object.values(bt)},props:{type:"object"},children:{type:"array",items:{$ref:"#"}}},required:["id","type"]}};function ro(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ln(t){if(Array.isArray(t))return t.map(Ln).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")return ro(t);if(typeof t!=="object")return"";let n=t.tag||t.tagName;if(!n)return"";let o=t.props||{},b=Object.entries(o).filter(([,h])=>h!==null&&h!==void 0&&h!==!1).map(([h,f])=>f===!0?h:`${h}="${ro(f)}"`).join(" "),l=Ln(t.children??t.content??"");return`<${n}${b?` ${b}`:""}>${l}</${n}>`}function Qh(t){return/<\s*script\b|on\w+\s*=|javascript:/i.test(String(t))}class kn{constructor(t){this.root=t,this.components=new Map}render(t){if(!t||!t.type)throw Error("Invalid A2UI message");if(t.html!==void 0){if(Qh(t.html))throw Error("Unsafe HTML is not allowed in A2UI render messages");throw Error("Raw HTML payloads are not supported in A2UI render messages")}let n=Array.isArray(t.components)?t.components.map(Ln).join(""):Ln(t.component||t);if(t.id)this.components.set(t.id,{id:t.id,type:t.type,props:t.props||{},children:t.children||t.components||[]});if(this.root&&typeof this.root.appendChild==="function"&&typeof document<"u"&&n){let b=document.createElement("div");b.innerHTML=n;while(b.firstChild)this.root.appendChild(b.firstChild)}return n}createElement(t){let{type:n,props:o={},children:b=[]}=t,l;switch(n){case bt.COMPONENT:l=this.createCustomComponent(o);break;case bt.FORM:l=this.createForm(o);break;case bt.LIST:l=this.createList(o);break;case bt.CARD:l=this.createCard(o);break;case bt.MODAL:l=this.createModal(o);break;case bt.TOAST:l=this.createToast(o);break;case bt.PROGRESS:l=this.createProgress(o);break;default:throw Error(`Unknown A2UI component type: ${n}`)}if(b.length>0)for(let h of b){let f=this.createElement(h);l.appendChild(f)}return l}createCustomComponent({tag:t,...n}){let o=document.createElement(t||"div");return Object.assign(o,n),o}createForm({fields:t=[],onSubmit:n}){let o=document.createElement("af-form");for(let b of t){let l=document.createElement("af-input");l.setAttribute("name",b.name),l.setAttribute("placeholder",b.placeholder||""),l.setAttribute("type",b.type||"text"),o.appendChild(l)}if(n)o.addEventListener("submit",n);return o}createList({items:t=[]}){let n=document.createElement("af-grid");for(let o of t){let b=this.createCard(o);n.appendChild(b)}return n}createCard({title:t,content:n,image:o}){let b=document.createElement("af-card");if(t){let l=document.createElement("h3");l.textContent=t,b.appendChild(l)}if(n){let l=document.createElement("p");l.textContent=n,b.appendChild(l)}if(o){let l=document.createElement("img");l.src=o,l.alt=t||"Card image",b.appendChild(l)}return b}createModal({title:t,content:n,actions:o=[]}){let b=document.createElement("af-modal");if(b.setAttribute("open",""),t){let h=document.createElement("h2");h.slot="header",h.textContent=t,b.appendChild(h)}if(n){let h=document.createElement("p");h.textContent=n,b.appendChild(h)}let l=document.createElement("div");l.slot="footer";for(let h of o){let f=document.createElement("af-button");if(f.textContent=h.label,h.primary)f.setAttribute("variant","primary");if(h.onClick)f.addEventListener("click",h.onClick);l.appendChild(f)}return b.appendChild(l),b}createToast({message:t,type:n="info",duration:o=3000}){let b=document.createElement("af-toast");return b.setAttribute("type",n),b.textContent=t,setTimeout(()=>{b.remove()},o),b}createProgress({value:t=0,max:n=100,label:o}){let b=document.createElement("af-progress");if(b.setAttribute("value",t),b.setAttribute("max",n),o)b.setAttribute("label",o);return b}update(t,n){let o=this.components.get(t);if(o)Object.assign(o,n)}remove(t){let n=this.components.get(t);if(n)n.remove(),this.components.delete(t)}}class Sn{constructor(t){this.renderer=t,this.messageQueue=[],this.messageHandlers=[],this.isProcessing=!1}onMessage(t){if(typeof t==="function")this.messageHandlers.push(t)}sendMessage(t){return this.processMessage(t)}processMessage(t){if(typeof t==="string")try{t=JSON.parse(t)}catch{return console.warn("Invalid A2UI message format:",t),null}if(t?.type==="render"&&this.renderer)return this.renderer.render(t);for(let n of this.messageHandlers)n(t);return t}processQueue(){if(this.isProcessing||this.messageQueue.length===0)return;this.isProcessing=!0;while(this.messageQueue.length>0){let t=this.messageQueue.shift();try{this.renderer.render(t)}catch(n){console.error("A2UI render error:",n)}}this.isProcessing=!1}async handleStream(t){let n=t.getReader(),o=new TextDecoder,b="";while(!0){let{done:l,value:h}=await n.read();if(l)break;b+=o.decode(h,{stream:!0});let f=b.split(`
2900
- `);b=f.pop();for(let a of f)if(a.trim())this.processMessage(a.trim())}if(b.trim())this.processMessage(b.trim())}createStream(){let t=new Set;return{subscribe(n){if(typeof n!=="function")return()=>{};return t.add(n),()=>t.delete(n)},push(n){for(let o of t)o(n)}}}validateAgainstSchema(t){let n=t?.tag||t?.tagName;return Promise.resolve(Boolean(n&&Mn[n]))}}function co(t){if(typeof document>"u")t=null;else t=t||document.body;let n=new kn(t),o=new Sn(n);if(typeof window<"u")window.a2ui={render:(b)=>o.processMessage(b),handleStream:(b)=>o.handleStream(b),update:(b,l)=>n.update(b,l),remove:(b)=>n.remove(b),sendMessage:(b)=>o.sendMessage(b),onMessage:(b)=>o.onMessage(b),createStream:()=>o.createStream(),validateAgainstSchema:(b)=>o.validateAgainstSchema(b)};return{renderer:n,protocol:o}}ot();function Jh(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Browser SDK Initialized");let n={...Mn,...t};if(Object.keys(n).length>0)S0(n)}}var B1={createReactiveState:vt,subscribe:y,createSignal:Rn,createEffect:Dn,store:W,actions:G0,patterns:St,motion:en,html:R,Layout:F0,schemas:yt,Validation:$t,rules:m,afri:y0,AfriFieldBuilder:I,normalizeInput:Z0,buildSchema:e0,createFramework:C0,getConfig:Nt,getRequestIdentity:z0,parseCookieHeader:g0,createSessionId:$0,SESSION_COOKIE_NAME:s0,sessionStore:P,runtimeActions:nb,MiddlewareManager:v0,loggerMiddleware:bb,authMiddleware:ob,AfriCodeError:nt,ValidationError:et,InvalidUrlError:w0,SecurityError:jt,CsrfError:_0,RateLimitError:r0,DatabaseError:c0,ComponentError:A0,initA2UI:co,A2UIRenderer:kn,A2UIProtocol:Sn,init:Jh};export{y as subscribe,W as store,P as sessionStore,yt as schemas,nb as runtimeActions,m as rules,St as patterns,g0 as parseCookieHeader,Z0 as normalizeInput,en as motion,bb as loggerMiddleware,co as initA2UI,Jh as init,R as html,z0 as getRequestIdentity,Nt as getConfig,B1 as default,Rn as createSignal,$0 as createSessionId,vt as createReactiveState,C0 as createFramework,Dn as createEffect,e0 as buildSchema,ob as authMiddleware,y0 as afri,G0 as actions,et as ValidationError,$t as Validation,jt as SecurityError,s0 as SESSION_COOKIE_NAME,r0 as RateLimitError,v0 as MiddlewareManager,F0 as Layout,w0 as InvalidUrlError,c0 as DatabaseError,_0 as CsrfError,A0 as ComponentError,I as AfriFieldBuilder,nt as AfriCodeError,kn as A2UIRenderer,Sn as A2UIProtocol};
3149
+ `}}_("af-error-boundary",Xo);io();Lo();Mo();Qo();Jo();var Fn={"af-button":()=>Promise.resolve().then(() => (X0(),Y0)),"af-card":()=>Promise.resolve().then(() => (L0(),i0)),"af-navbar":()=>Promise.resolve().then(() => (Q0(),M0)),"af-input":()=>Promise.resolve().then(() => (G0(),J0)),"af-alert":()=>Promise.resolve().then(() => (F0(),S0)),"af-grid":()=>Promise.resolve().then(() => (B0(),R0)),"af-section":()=>Promise.resolve().then(() => (E0(),D0)),"af-icon":()=>Promise.resolve().then(() => (W0(),O0)),"af-ui-button":()=>Promise.resolve().then(() => (io(),d0)),"af-ui-card":()=>Promise.resolve().then(() => (Lo(),x0)),"af-ui-input":()=>Promise.resolve().then(() => (Mo(),q0)),"af-ui-badge":()=>Promise.resolve().then(() => (Qo(),k0)),"af-ui-switch":()=>Promise.resolve().then(() => (Jo(),H0)),"af-accordion":()=>Promise.resolve().then(() => (p0(),m0)),"af-hero":()=>Promise.resolve().then(() => (U0(),u0)),"af-table":()=>Promise.resolve().then(() => (N0(),V0)),"af-modal":()=>Promise.resolve().then(() => (j0(),K0)),"af-tabs":()=>Promise.resolve().then(() => (P0(),I0)),"af-sidebar":()=>Promise.resolve().then(() => (C0(),T0)),"af-dropdown":()=>Promise.resolve().then(() => (e0(),y0)),"af-select":()=>Promise.resolve().then(() => (s0(),Z0)),"af-form":()=>Promise.resolve().then(() => (tb(),z0)),"af-tooltip":()=>Promise.resolve().then(() => (ob(),nb)),"af-toast":()=>Promise.resolve().then(() => (lb(),bb)),"af-badge":()=>Promise.resolve().then(() => (hb(),ab)),"af-avatar":()=>Promise.resolve().then(() => (rb(),fb)),"af-progress":()=>Promise.resolve().then(() => ($b(),gb)),"af-loader":()=>Promise.resolve().then(() => (vb(),cb)),"af-skeleton":()=>Promise.resolve().then(() => (_b(),wb)),"af-divider":()=>Promise.resolve().then(() => (db(),Ab)),"af-kanga-card":()=>Promise.resolve().then(() => (qb(),xb)),"af-cultural-card":()=>Promise.resolve().then(() => (Hb(),kb)),"af-pattern-showcase":()=>Promise.resolve().then(() => (Xb(),Yb)),"af-language-switcher":()=>Promise.resolve().then(() => (Lb(),ib)),"af-auth":()=>Promise.resolve().then(() => (Qb(),Mb)),"af-theme-toggle":()=>Promise.resolve().then(() => (Gb(),Jb))};var ot={COMPONENT:"component",FORM:"form",LIST:"list",CARD:"card",MODAL:"modal",TOAST:"toast",PROGRESS:"progress"},Kf={component:{type:"object",properties:{id:{type:"string"},type:{type:"string",enum:Object.values(ot)},props:{type:"object"},children:{type:"array",items:{$ref:"#"}}},required:["id","type"]}};function Sb(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Rn(t){if(Array.isArray(t))return t.map(Rn).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")return Sb(t);if(typeof t!=="object")return"";let n=t.tag||t.tagName;if(!n)return"";let b=t.props||{},o=Object.entries(b).filter(([,a])=>a!==null&&a!==void 0&&a!==!1).map(([a,h])=>h===!0?a:`${a}="${Sb(h)}"`).join(" "),l=Rn(t.children??t.content??"");return`<${n}${o?` ${o}`:""}>${l}</${n}>`}function Va(t){return/<\s*script\b|on\w+\s*=|javascript:/i.test(String(t))}class Bn{constructor(t){this.root=t,this.components=new Map}render(t){if(!t||!t.type)throw Error("Invalid A2UI message");if(t.html!==void 0){if(Va(t.html))throw Error("Unsafe HTML is not allowed in A2UI render messages");throw Error("Raw HTML payloads are not supported in A2UI render messages")}let n=Array.isArray(t.components)?t.components.map(Rn).join(""):Rn(t.component||t);if(t.id)this.components.set(t.id,{id:t.id,type:t.type,props:t.props||{},children:t.children||t.components||[]});if(this.root&&typeof this.root.appendChild==="function"&&typeof document<"u"&&n){let o=document.createElement("div");o.innerHTML=n;while(o.firstChild)this.root.appendChild(o.firstChild)}return n}createElement(t){let{type:n,props:b={},children:o=[]}=t,l;switch(n){case ot.COMPONENT:l=this.createCustomComponent(b);break;case ot.FORM:l=this.createForm(b);break;case ot.LIST:l=this.createList(b);break;case ot.CARD:l=this.createCard(b);break;case ot.MODAL:l=this.createModal(b);break;case ot.TOAST:l=this.createToast(b);break;case ot.PROGRESS:l=this.createProgress(b);break;default:throw Error(`Unknown A2UI component type: ${n}`)}if(o.length>0)for(let a of o){let h=this.createElement(a);l.appendChild(h)}return l}createCustomComponent({tag:t,...n}){let b=document.createElement(t||"div");return Object.assign(b,n),b}createForm({fields:t=[],onSubmit:n}){let b=document.createElement("af-form");for(let o of t){let l=document.createElement("af-input");l.setAttribute("name",o.name),l.setAttribute("placeholder",o.placeholder||""),l.setAttribute("type",o.type||"text"),b.appendChild(l)}if(n)b.addEventListener("submit",n);return b}createList({items:t=[]}){let n=document.createElement("af-grid");for(let b of t){let o=this.createCard(b);n.appendChild(o)}return n}createCard({title:t,content:n,image:b}){let o=document.createElement("af-card");if(t){let l=document.createElement("h3");l.textContent=t,o.appendChild(l)}if(n){let l=document.createElement("p");l.textContent=n,o.appendChild(l)}if(b){let l=document.createElement("img");l.src=b,l.alt=t||"Card image",o.appendChild(l)}return o}createModal({title:t,content:n,actions:b=[]}){let o=document.createElement("af-modal");if(o.setAttribute("open",""),t){let a=document.createElement("h2");a.slot="header",a.textContent=t,o.appendChild(a)}if(n){let a=document.createElement("p");a.textContent=n,o.appendChild(a)}let l=document.createElement("div");l.slot="footer";for(let a of b){let h=document.createElement("af-button");if(h.textContent=a.label,a.primary)h.setAttribute("variant","primary");if(a.onClick)h.addEventListener("click",a.onClick);l.appendChild(h)}return o.appendChild(l),o}createToast({message:t,type:n="info",duration:b=3000}){let o=document.createElement("af-toast");return o.setAttribute("type",n),o.textContent=t,setTimeout(()=>{o.remove()},b),o}createProgress({value:t=0,max:n=100,label:b}){let o=document.createElement("af-progress");if(o.setAttribute("value",t),o.setAttribute("max",n),b)o.setAttribute("label",b);return o}update(t,n){let b=this.components.get(t);if(b)Object.assign(b,n)}remove(t){let n=this.components.get(t);if(n)n.remove(),this.components.delete(t)}}class Dn{constructor(t){this.renderer=t,this.messageQueue=[],this.messageHandlers=[],this.isProcessing=!1}onMessage(t){if(typeof t==="function")this.messageHandlers.push(t)}sendMessage(t){return this.processMessage(t)}processMessage(t){if(typeof t==="string")try{t=JSON.parse(t)}catch{return console.warn("Invalid A2UI message format:",t),null}if(t?.type==="render"&&this.renderer)return this.renderer.render(t);for(let n of this.messageHandlers)n(t);return t}processQueue(){if(this.isProcessing||this.messageQueue.length===0)return;this.isProcessing=!0;while(this.messageQueue.length>0){let t=this.messageQueue.shift();try{this.renderer.render(t)}catch(n){console.error("A2UI render error:",n)}}this.isProcessing=!1}async handleStream(t){let n=t.getReader(),b=new TextDecoder,o="";while(!0){let{done:l,value:a}=await n.read();if(l)break;o+=b.decode(a,{stream:!0});let h=o.split(`
3150
+ `);o=h.pop();for(let f of h)if(f.trim())this.processMessage(f.trim())}if(o.trim())this.processMessage(o.trim())}createStream(){let t=new Set;return{subscribe(n){if(typeof n!=="function")return()=>{};return t.add(n),()=>t.delete(n)},push(n){for(let b of t)b(n)}}}validateAgainstSchema(t){let n=t?.tag||t?.tagName;return Promise.resolve(Boolean(n&&Fn[n]))}}function Fb(t){if(typeof document>"u")t=null;else t=t||document.body;let n=new Bn(t),b=new Dn(n);if(typeof window<"u")window.a2ui={render:(o)=>b.processMessage(o),handleStream:(o)=>b.handleStream(o),update:(o,l)=>n.update(o,l),remove:(o)=>n.remove(o),sendMessage:(o)=>b.sendMessage(o),onMessage:(o)=>b.onMessage(o),createStream:()=>b.createStream(),validateAgainstSchema:(o)=>b.validateAgainstSchema(o)};return{renderer:n,protocol:b}}bt();function Na(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Browser SDK Initialized");let n={...Fn,...t};if(Object.keys(n).length>0)po(n)}}var ar={createReactiveState:$t,subscribe:y,createSignal:Wn,createEffect:mn,store:D,actions:Eo,patterns:Jt,motion:oo,html:Q,Layout:uo,schemas:tn,Validation:gt,rules:U,afri:h0,AfriFieldBuilder:j,normalizeInput:f0,buildSchema:r0,createFramework:a0,getConfig:mt,getRequestIdentity:$0,parseCookieHeader:wo,createSessionId:_o,SESSION_COOKIE_NAME:g0,sessionStore:I,runtimeActions:v0,MiddlewareManager:Ao,loggerMiddleware:w0,authMiddleware:_0,AfriCodeError:nt,ValidationError:on,InvalidUrlError:xo,SecurityError:pt,CsrfError:qo,RateLimitError:ko,DatabaseError:Ho,ComponentError:Yo,initA2UI:Fb,A2UIRenderer:Bn,A2UIProtocol:Dn,init:Na};export{y as subscribe,D as store,I as sessionStore,tn as schemas,v0 as runtimeActions,U as rules,Jt as patterns,wo as parseCookieHeader,f0 as normalizeInput,oo as motion,w0 as loggerMiddleware,Fb as initA2UI,Na as init,Q as html,$0 as getRequestIdentity,mt as getConfig,ar as default,Wn as createSignal,_o as createSessionId,$t as createReactiveState,a0 as createFramework,mn as createEffect,r0 as buildSchema,_0 as authMiddleware,h0 as afri,Eo as actions,on as ValidationError,gt as Validation,pt as SecurityError,g0 as SESSION_COOKIE_NAME,ko as RateLimitError,Ao as MiddlewareManager,uo as Layout,xo as InvalidUrlError,Ho as DatabaseError,qo as CsrfError,Yo as ComponentError,j as AfriFieldBuilder,nt as AfriCodeError,Bn as A2UIRenderer,Dn as A2UIProtocol};
2901
3151
 
2902
- //# debugId=047013451C9EB27464756E2164756E21
3152
+ //# debugId=93BD7AC2977DAFC264756E2164756E21