@africode/core 5.0.0
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/AFRICODE_FRAMEWORK_GUIDE.md +707 -0
- package/LICENSE +623 -0
- package/README.md +442 -0
- package/bin/africode.js +73 -0
- package/bin/africode.js.1758507140 +343 -0
- package/bin/cli.ts +83 -0
- package/bin/create-africode.js +158 -0
- package/bin/scaffold.ts +219 -0
- package/components/accordion.js +183 -0
- package/components/alert.js +131 -0
- package/components/auth.js +172 -0
- package/components/avatar.js +117 -0
- package/components/badge.js +104 -0
- package/components/base.d.ts +139 -0
- package/components/base.js +184 -0
- package/components/button.js +164 -0
- package/components/card.js +137 -0
- package/components/cultural-card.js +243 -0
- package/components/divider.js +83 -0
- package/components/dropdown.js +171 -0
- package/components/error-boundary.js +155 -0
- package/components/form.js +131 -0
- package/components/grid.js +273 -0
- package/components/hero.js +138 -0
- package/components/icon.js +36 -0
- package/components/index.js +57 -0
- package/components/input.js +256 -0
- package/components/kanga-card.js +185 -0
- package/components/language-switcher.js +108 -0
- package/components/loader.js +80 -0
- package/components/modal.js +262 -0
- package/components/motion.js +84 -0
- package/components/navbar.js +236 -0
- package/components/pattern-showcase.js +225 -0
- package/components/progress.js +134 -0
- package/components/react.js +111 -0
- package/components/section.js +54 -0
- package/components/select.js +322 -0
- package/components/sidebar.js +180 -0
- package/components/skeleton.js +85 -0
- package/components/table.js +181 -0
- package/components/tabs.js +202 -0
- package/components/theme-toggle.js +82 -0
- package/components/toast.js +139 -0
- package/components/tooltip.js +167 -0
- package/core/a2ui-schema-manager.js +344 -0
- package/core/a2ui.js +431 -0
- package/core/bun-runtime.js +799 -0
- package/core/cli/commands/add.js +23 -0
- package/core/cli/commands/audit.js +58 -0
- package/core/cli/commands/build.js +137 -0
- package/core/cli/commands/create-plugin.js +241 -0
- package/core/cli/commands/dev.js +228 -0
- package/core/cli/commands/lint.js +23 -0
- package/core/cli/commands/test.js +34 -0
- package/core/cli/migrator.js +71 -0
- package/core/cli/ui.js +46 -0
- package/core/compliance.js +628 -0
- package/core/config.js +263 -0
- package/core/db-advanced.js +481 -0
- package/core/db.js +284 -0
- package/core/enhanced-hmr.js +404 -0
- package/core/errors.js +222 -0
- package/core/file-router.js +290 -0
- package/core/heartbeat.js +64 -0
- package/core/hmr-client.js +204 -0
- package/core/hmr.js +196 -0
- package/core/html.d.ts +116 -0
- package/core/html.js +160 -0
- package/core/hydration.js +52 -0
- package/core/lipa-namba-journey.js +572 -0
- package/core/motion.js +106 -0
- package/core/nida-cig-middleware.js +455 -0
- package/core/patterns.d.ts +124 -0
- package/core/patterns.js +833 -0
- package/core/plugins/index.js +312 -0
- package/core/router.js +387 -0
- package/core/sdk-client.js +62 -0
- package/core/sdk.d.ts +133 -0
- package/core/sdk.js +123 -0
- package/core/seo.js +76 -0
- package/core/server/auth-endpoints.js +339 -0
- package/core/server/auth.js +180 -0
- package/core/server/csrf.js +206 -0
- package/core/server/db.js +39 -0
- package/core/server/middleware.js +324 -0
- package/core/server/rate-limit.js +238 -0
- package/core/server/render.js +69 -0
- package/core/server/router.js +120 -0
- package/core/shim.js +28 -0
- package/core/state.d.ts +86 -0
- package/core/state.js +242 -0
- package/core/store.d.ts +122 -0
- package/core/store.js +61 -0
- package/core/validation.d.ts +233 -0
- package/core/validation.js +590 -0
- package/core/websocket.js +639 -0
- package/dist/africode.js +2905 -0
- package/dist/africode.js.map +61 -0
- package/dist/build-info.json +23 -0
- package/dist/components.js +2888 -0
- package/dist/components.js.map +58 -0
- package/dist/styles/africanity.css +322 -0
- package/dist/styles/typography.css +141 -0
- package/docs/IDE-Guide.md +50 -0
- package/package.json +110 -0
- package/src/index.ts +196 -0
- package/styles/africanity.css +322 -0
- package/styles/typography.css +141 -0
- package/templates/starter/.env.example +15 -0
- package/templates/starter/africode.config.js +40 -0
- package/templates/starter/package.json +14 -0
- package/templates/starter/src/pages/index.html +46 -0
- package/templates/starter/src/pages/index.js +32 -0
- package/templates/starter/src/styles/main.css +4 -0
- package/templates/starter-3d/.env.example +7 -0
- package/templates/starter-3d/africode.config.js +29 -0
- package/templates/starter-3d/components/af-model-viewer.js +125 -0
- package/templates/starter-3d/package.json +15 -0
- package/templates/starter-3d/src/pages/index.html +46 -0
- package/templates/starter-3d/src/pages/index.js +50 -0
- package/templates/starter-3d/src/styles/main.css +4 -0
- package/templates/starter-react/.env.example +15 -0
- package/templates/starter-react/africode.config.js +40 -0
- package/templates/starter-react/package.json +16 -0
- package/templates/starter-react/src/pages/index.html +46 -0
- package/templates/starter-react/src/pages/index.js +68 -0
- package/templates/starter-react/src/styles/main.css +4 -0
- package/templates/starter-tailwind/.env.example +15 -0
- package/templates/starter-tailwind/africode.config.js +40 -0
- package/templates/starter-tailwind/package.json +20 -0
- package/templates/starter-tailwind/src/pages/index.html +46 -0
- package/templates/starter-tailwind/src/pages/index.js +37 -0
- package/templates/starter-tailwind/src/styles/main.css +4 -0
- package/templates/starter-tailwind/src/styles/tailwind.css +1 -0
- package/templates/starter-tailwind/src/tailwind-loader.js +30 -0
package/dist/africode.js
ADDED
|
@@ -0,0 +1,2905 @@
|
|
|
1
|
+
var Oo=Object.defineProperty;var mo=(t)=>t;function Uo(t,n){this[t]=mo.bind(null,n)}var Q=(t,n)=>{for(var o in n)Oo(t,o,{get:n[o],enumerable:!0,configurable:!0,set:Uo.bind(n,o)})};var Y=(t,n)=>()=>(t&&(n=t(t=0)),n);function at(t){if(Wt.has(t))return Wt.get(t);let o=new Proxy(t,{get(b,l,a){let f=Reflect.get(b,l,a);if(f!==null&&typeof f==="object")return at(f);return f},set(b,l,a,f){let h=Reflect.get(b,l,f);if(h!==a){let g=Reflect.set(b,l,a,f);if(g)qn(f,a,h,l);return g}return!0},deleteProperty(b,l){let a=Reflect.get(b,l),f=Reflect.deleteProperty(b,l);if(f){let h=Wt.get(b);qn(h,void 0,a,l)}return f}});return Wt.set(t,o),o}function T(t,n){if(!Ot.has(t))Ot.set(t,new Set);let o=Ot.get(t);return o.add(n),()=>{o.delete(n)}}function qn(t,n,o,b){let l=Ot.get(t);if(!l)return;l.forEach((a)=>{try{a(n,o,b)}catch(f){console.error("[AfriCode State] Subscriber error:",f)}})}function Hn(t){let n=t,o=new Set,b=()=>{return n},l=(a)=>{if(n!==a)n=typeof a==="function"?a(n):a,o.forEach((f)=>f()),qn()};return b.subscribe=(a)=>{return o.add(a),()=>o.delete(a)},[b,l]}function En(t){return t(),T(t)}var Ot,Wt;var z=Y(()=>{Ot=new WeakMap,Wt=new WeakMap});var Vo,W,t0;var kt=Y(()=>{z();Vo={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},W=at(Vo),t0={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 jo(t,n,o=50,b=50){let l=[];for(let a=0;a<t;a++){let f=2*Math.PI*a/t-Math.PI/2,h=o+n*Math.cos(f),g=b+n*Math.sin(f);l.push(`${h.toFixed(2)},${g.toFixed(2)}`)}return l.join(" ")}function Yn({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:o="#8B0000",stripeWidth:b=4,size:l=40}={}){let a=`
|
|
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"/>
|
|
10
|
+
</svg>
|
|
11
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function xn({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}"/>
|
|
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"/>
|
|
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"/>
|
|
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}"/>
|
|
25
|
+
</svg>
|
|
26
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function kn({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}"/>
|
|
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"/>
|
|
33
|
+
</svg>
|
|
34
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function No({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}"/>
|
|
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}"/>
|
|
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>
|
|
45
|
+
</svg>
|
|
46
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Ko({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}"/>
|
|
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}"/>
|
|
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}"/>
|
|
56
|
+
</svg>
|
|
57
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function po({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}"/>
|
|
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}"/>
|
|
70
|
+
</svg>
|
|
71
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Io({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}"/>
|
|
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}"/>
|
|
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"/>
|
|
80
|
+
</svg>
|
|
81
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function uo({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:o="#FFFF00",backgroundColor:b="#FFFFFF",size:l=50}={}){let a=`
|
|
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}"/>
|
|
84
|
+
<!-- Ndebele geometric patterns -->
|
|
85
|
+
<polygon points="${l*0.2},${l*0.2} ${l*0.4},${l*0.2} ${l*0.3},${l*0.4}" fill="${t}"/>
|
|
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}"/>
|
|
88
|
+
<polygon points="${l*0.6},${l*0.6} ${l*0.8},${l*0.6} ${l*0.7},${l*0.8}" fill="${t}"/>
|
|
89
|
+
<!-- Center design -->
|
|
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}"/>
|
|
92
|
+
</svg>
|
|
93
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Xn({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"/>
|
|
102
|
+
</svg>
|
|
103
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Sn({colors:t=["#FFD700","#228B22","#DC143C","#000000"],size:n=60}={}){let[o,b,l,a]=t,f=n/6,h=`
|
|
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="${a}"/>
|
|
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}"/>
|
|
113
|
+
<!-- Vertical accents -->
|
|
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
|
+
<!-- Kente squares -->
|
|
119
|
+
<rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${o}" 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
|
+
</svg>
|
|
122
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Mn({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}"/>
|
|
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}"
|
|
131
|
+
fill="none" stroke="${t}" stroke-width="3"/>
|
|
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"/>
|
|
135
|
+
</svg>
|
|
136
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function Qn({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[o,b,l]=t,a=n/10,f=`
|
|
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}"/>
|
|
139
|
+
<!-- Horizontal stripes -->
|
|
140
|
+
<rect x="0" y="${a}" width="${n}" height="${a*0.5}" fill="${b}"/>
|
|
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="${b}"/>
|
|
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="${b}"/>
|
|
145
|
+
<!-- Vertical accent lines -->
|
|
146
|
+
<rect x="${n*0.48}" y="0" width="${a*0.4}" height="${n}" fill="${b}" opacity="0.7"/>
|
|
147
|
+
<!-- Diamond motifs -->
|
|
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"/>
|
|
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"/>
|
|
152
|
+
</svg>
|
|
153
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Jn({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:o="#FFD700",backgroundColor:b="#FFFFFF",size:l=60}={}){let a=`
|
|
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}"/>
|
|
156
|
+
<!-- Bold circular motifs -->
|
|
157
|
+
<circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.25}" fill="${t}"/>
|
|
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}"/>
|
|
160
|
+
|
|
161
|
+
<circle cx="${l*0.8}" cy="${l*0.8}" r="${l*0.2}" fill="${n}"/>
|
|
162
|
+
<circle cx="${l*0.8}" cy="${l*0.8}" r="${l*0.1}" fill="${t}"/>
|
|
163
|
+
|
|
164
|
+
<!-- Connecting lines -->
|
|
165
|
+
<line x1="${l*0.45}" y1="${l*0.45}" x2="${l*0.65}" y2="${l*0.65}"
|
|
166
|
+
stroke="${t}" stroke-width="4"/>
|
|
167
|
+
|
|
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}"/>
|
|
171
|
+
</svg>
|
|
172
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Gn({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}"/>
|
|
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}"
|
|
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}"
|
|
179
|
+
fill="none" stroke="${n}" stroke-width="3"/>
|
|
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"/>
|
|
185
|
+
<!-- Dots -->
|
|
186
|
+
<circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.08}" fill="${o}"/>
|
|
187
|
+
</svg>
|
|
188
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Ln({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}"/>
|
|
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}"
|
|
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}"
|
|
197
|
+
fill="none" stroke="${n}" stroke-width="4"/>
|
|
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"/>
|
|
201
|
+
</svg>
|
|
202
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function Fn({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}"/>
|
|
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"
|
|
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"
|
|
215
|
+
fill="${n}"/>
|
|
216
|
+
<circle cx="${b*0.5}" cy="${b*0.5}" r="${b*0.1}" fill="${o}"/>
|
|
217
|
+
</svg>
|
|
218
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Bn({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:o=40}={}){let[b,l,a]=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}"/>
|
|
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}"
|
|
225
|
+
fill="${l}"/>
|
|
226
|
+
<rect x="${o*0.4}" y="${o*0.4}" width="${o*0.2}" height="${o*0.2}" fill="${a}"/>
|
|
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"/>
|
|
230
|
+
</svg>
|
|
231
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Rn({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:o=2}={}){let[b,l,a,f]=t,h=`
|
|
232
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
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}"/>
|
|
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}"/>
|
|
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}"/>
|
|
241
|
+
<rect x="${n*0.15}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
|
|
242
|
+
fill="${a}" stroke="#000000" stroke-width="${o/2}"/>
|
|
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}"/>
|
|
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}"/>
|
|
247
|
+
</svg>
|
|
248
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function Dn({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[o,b,l,a,f]=t,h=n/10,g=`
|
|
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}"/>
|
|
251
|
+
<!-- Triangle pattern (isivivane - sacred cairn) -->
|
|
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"/>
|
|
254
|
+
<polygon points="${n*0.5},${n*0.25} ${n*0.75},${n*0.75} ${n*0.25},${n*0.75}"
|
|
255
|
+
fill="${l}"/>
|
|
256
|
+
<!-- Beadwork dots -->
|
|
257
|
+
<circle cx="${n*0.5}" cy="${n*0.35}" r="${h}" fill="${o}"/>
|
|
258
|
+
<circle cx="${n*0.35}" cy="${n*0.6}" r="${h}" fill="${a}"/>
|
|
259
|
+
<circle cx="${n*0.65}" cy="${n*0.6}" r="${h}" fill="${f}"/>
|
|
260
|
+
<circle cx="${n*0.5}" cy="${n*0.8}" r="${h}" fill="${o}"/>
|
|
261
|
+
<!-- Border dots -->
|
|
262
|
+
<circle cx="${n*0.1}" cy="${n*0.1}" r="${h*0.7}" fill="${l}"/>
|
|
263
|
+
<circle cx="${n*0.9}" cy="${n*0.1}" r="${h*0.7}" fill="${a}"/>
|
|
264
|
+
</svg>
|
|
265
|
+
`;return`data:image/svg+xml,${encodeURIComponent(g.trim())}`}function Wn({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[o,b,l,a]=t,f=`
|
|
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}"/>
|
|
268
|
+
<!-- Shield shape (central to Eswatini culture) -->
|
|
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"/>
|
|
271
|
+
<!-- Inner pattern -->
|
|
272
|
+
<ellipse cx="${n*0.5}" cy="${n*0.45}" rx="${n*0.2}" ry="${n*0.25}"
|
|
273
|
+
fill="${l}"/>
|
|
274
|
+
<!-- Feather accents -->
|
|
275
|
+
<line x1="${n*0.5}" y1="${n*0.05}" x2="${n*0.5}" y2="${n*0.2}"
|
|
276
|
+
stroke="${a}" stroke-width="3"/>
|
|
277
|
+
<line x1="${n*0.4}" y1="${n*0.08}" x2="${n*0.45}" y2="${n*0.15}"
|
|
278
|
+
stroke="${a}" stroke-width="2"/>
|
|
279
|
+
<line x1="${n*0.6}" y1="${n*0.08}" x2="${n*0.55}" y2="${n*0.15}"
|
|
280
|
+
stroke="${a}" stroke-width="2"/>
|
|
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="${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
|
+
</svg>
|
|
285
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function On({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}"/>
|
|
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}"/>
|
|
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}"/>
|
|
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}"
|
|
296
|
+
fill="${n}" stroke="${t}" stroke-width="2"/>
|
|
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}"/>
|
|
302
|
+
</svg>
|
|
303
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Po(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function mn({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:o="#FFD700",backgroundColor:b="#F5F5DC",size:l=60}={}){let a=`
|
|
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}"/>
|
|
306
|
+
<!-- Lozenge (Diamond) - universal protective symbol -->
|
|
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
|
+
fill="${t}" stroke="${n}" stroke-width="2"/>
|
|
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"/>
|
|
312
|
+
<!-- X symbols (Fibula/Cross) -->
|
|
313
|
+
<line x1="${l*0.4}" y1="${l*0.4}" x2="${l*0.6}" y2="${l*0.6}" stroke="${n}" stroke-width="2"/>
|
|
314
|
+
<line x1="${l*0.6}" y1="${l*0.4}" x2="${l*0.4}" y2="${l*0.6}" stroke="${n}" stroke-width="2"/>
|
|
315
|
+
</svg>
|
|
316
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Un({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}"/>
|
|
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"/>
|
|
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}"/>
|
|
326
|
+
</svg>
|
|
327
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function io({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}"/>
|
|
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}"/>
|
|
334
|
+
</svg>
|
|
335
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function To({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}"
|
|
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}"
|
|
341
|
+
fill="none" stroke="${t}" stroke-width="3" stroke-linecap="round"/>
|
|
342
|
+
</svg>
|
|
343
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function Co({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"/>
|
|
348
|
+
</svg>
|
|
349
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function n0({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">
|
|
351
|
+
<rect width="100" height="100" fill="${n}"/>
|
|
352
|
+
<path d="M10 10 H90 V90 H10 Z" fill="none" stroke="${t}" stroke-width="0.5" opacity="0.3"/>
|
|
353
|
+
<path d="M20 20 V50 H50 V80 H80" fill="none" stroke="${t}" stroke-width="1"/>
|
|
354
|
+
<circle cx="20" cy="20" r="2" fill="${t}"/>
|
|
355
|
+
<circle cx="80" cy="80" r="2" fill="${t}"/>
|
|
356
|
+
<circle cx="50" cy="50" r="1.5" fill="${t}"/>
|
|
357
|
+
</svg>
|
|
358
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}var Xt;var St=Y(()=>{Xt={generatePolygon:jo,generateShuka:Yn,generateHadzabe:xn,generateKanga:No,generateKangaBorder:kn,generateKitenge:Xn,generateMasaiShield:Io,generateTibeb:Bn,generateImigongo:Fn,generateKente:Sn,generateAdinkra:Mn,generateAsoOke:Qn,generateAnkara:Jn,generateBogolan:Gn,generateAdire:Un,generateKuba:Ln,generateKubaBorder:Ko,generateBerber:mn,generateNdebele:Rn,generateNdebelePaint:uo,generateZulu:Dn,generateZuluBeads:po,generateSwazi:Wn,generateXhosa:On,applyPattern:Po,generateTuareg:io,generateGeez:To,generateBoli:Co,generateCircuit:n0,circuit:n0}});class Vn{constructor(t){this.content=t}toString(){return this.content}valueOf(){return this.content}}function a0(t){if(typeof t!=="string")return t;let n={"&":"&","<":"<",">":">",'"':""","'":"'"};return t.replace(/[&<>"']/g,(o)=>n[o])}function f0(t){if(t instanceof Vn)return t.toString();if(Array.isArray(t))return t.map((n)=>f0(n)).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="function")return a0(String(t));return a0(String(t))}function D(t,...n){let o="";for(let b=0;b<n.length;b++)o+=t[b],o+=f0(n[b]);return o+=t[t.length-1],new Vn(o)}function h0({title:t="AfriCode App",meta:n="",children:o}){return D`<!DOCTYPE html>
|
|
359
|
+
<html lang="en">
|
|
360
|
+
<head>
|
|
361
|
+
<meta charset="UTF-8">
|
|
362
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
363
|
+
<title>${t}</title>
|
|
364
|
+
${n}
|
|
365
|
+
<link rel="stylesheet" href="/styles/africanity.css">
|
|
366
|
+
<script type="module" src="/core/sdk.js"></script>
|
|
367
|
+
<script type="module">
|
|
368
|
+
import { init } from '/core/sdk.js';
|
|
369
|
+
init();
|
|
370
|
+
</script>
|
|
371
|
+
</head>
|
|
372
|
+
<body>
|
|
373
|
+
${o}
|
|
374
|
+
</body>
|
|
375
|
+
</html>`}var Ut=()=>{};function A(t,n){if(!customElements.get(t))customElements.define(t,n)}var c;var M=Y(()=>{Ut();c=class c extends HTMLElement{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=`
|
|
376
|
+
<style>
|
|
377
|
+
.af-local-error {
|
|
378
|
+
padding: 1rem;
|
|
379
|
+
border: 1px dashed rgba(220, 20, 60, 0.4);
|
|
380
|
+
border-radius: 4px;
|
|
381
|
+
color: #DC143C;
|
|
382
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
383
|
+
font-size: 0.85rem;
|
|
384
|
+
display: flex;
|
|
385
|
+
align-items: center;
|
|
386
|
+
gap: 8px;
|
|
387
|
+
background: rgba(220, 20, 60, 0.05);
|
|
388
|
+
}
|
|
389
|
+
</style>
|
|
390
|
+
<div class="af-local-error">
|
|
391
|
+
<span aria-hidden="true">⚠️</span>
|
|
392
|
+
<span>Failed to render</span>
|
|
393
|
+
</div>
|
|
394
|
+
`,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(!(t instanceof CSSStyleSheet)){console.error("[AfriCode] injectGlobalSheet requires a CSSStyleSheet instance.");return}if(!c.globalSheets.includes(t))c.globalSheets.push(t)}async loadStyles(){if(c.styleCache.has("/styles/africanity.css")){this.shadowRoot.adoptedStyleSheets=[c.styleCache.get("/styles/africanity.css"),...c.globalSheets];return}try{let o=await(await fetch("/styles/africanity.css")).text(),b=new CSSStyleSheet;b.replaceSync(o),c.styleCache.set("/styles/africanity.css",b),this.shadowRoot.adoptedStyleSheets=[b,...c.globalSheets]}catch(n){console.warn("AfriCode: Failed to load core styles",n)}}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(([a,f])=>l.setAttribute(a,f)),b)l.textContent=b;return l}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var g0={};Q(g0,{default:()=>eo,AfriButton:()=>dt});var dt,eo;var r0=Y(()=>{M();dt=class dt 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",o=this.getAttribute("theme")||"tanzania",b=this.hasAttribute("disabled"),l=this.hasAttribute("loading"),a=this.getAttribute("icon"),f=this.getAttribute("aria-label"),h={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=h[o]||h.tanzania;this.shadowRoot.innerHTML=`
|
|
395
|
+
<style>
|
|
396
|
+
:host {
|
|
397
|
+
display: inline-block;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
button {
|
|
401
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
402
|
+
font-weight: 600;
|
|
403
|
+
border: none;
|
|
404
|
+
border-radius: 5px;
|
|
405
|
+
cursor: pointer;
|
|
406
|
+
display: inline-flex;
|
|
407
|
+
align-items: center;
|
|
408
|
+
justify-content: center;
|
|
409
|
+
gap: 8px;
|
|
410
|
+
transition: all 200ms ease-out;
|
|
411
|
+
position: relative;
|
|
412
|
+
overflow: hidden;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* Sizes */
|
|
416
|
+
.size-sm { padding: 5px 13px; font-size: 13px; }
|
|
417
|
+
.size-md { padding: 8px 21px; font-size: 15px; }
|
|
418
|
+
.size-lg { padding: 13px 34px; font-size: 17px; }
|
|
419
|
+
|
|
420
|
+
/* Variants */
|
|
421
|
+
.variant-primary {
|
|
422
|
+
background: ${g.primary};
|
|
423
|
+
color: ${g.text};
|
|
424
|
+
}
|
|
425
|
+
.variant-primary:hover:not(:disabled) {
|
|
426
|
+
filter: brightness(1.1);
|
|
427
|
+
transform: translateY(-2px);
|
|
428
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.variant-secondary {
|
|
432
|
+
background: transparent;
|
|
433
|
+
color: ${g.primary};
|
|
434
|
+
border: 2px solid ${g.primary};
|
|
435
|
+
}
|
|
436
|
+
.variant-secondary:hover:not(:disabled) {
|
|
437
|
+
background: ${g.primary};
|
|
438
|
+
color: ${g.text};
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.variant-ghost {
|
|
442
|
+
background: transparent;
|
|
443
|
+
color: ${g.primary};
|
|
444
|
+
}
|
|
445
|
+
.variant-ghost:hover:not(:disabled) {
|
|
446
|
+
background: rgba(0,0,0,0.05);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.variant-gradient {
|
|
450
|
+
background: linear-gradient(135deg, ${g.primary} 0%, ${g.accent} 100%);
|
|
451
|
+
color: ${g.text};
|
|
452
|
+
}
|
|
453
|
+
.variant-gradient:hover:not(:disabled) {
|
|
454
|
+
transform: translateY(-2px);
|
|
455
|
+
box-shadow: 0 6px 20px rgba(0,0,0,0.25);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/* States */
|
|
459
|
+
button:disabled {
|
|
460
|
+
opacity: 0.5;
|
|
461
|
+
cursor: not-allowed;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
button:active:not(:disabled) {
|
|
465
|
+
transform: translateY(0);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/* Loading spinner */
|
|
469
|
+
.spinner {
|
|
470
|
+
width: 16px;
|
|
471
|
+
height: 16px;
|
|
472
|
+
border: 2px solid transparent;
|
|
473
|
+
border-top-color: currentColor;
|
|
474
|
+
border-radius: 50%;
|
|
475
|
+
animation: spin 0.8s linear infinite;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
@keyframes spin {
|
|
479
|
+
to { transform: rotate(360deg); }
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/* Icon */
|
|
483
|
+
.icon {
|
|
484
|
+
font-size: 1.1em;
|
|
485
|
+
}
|
|
486
|
+
</style>
|
|
487
|
+
|
|
488
|
+
<button
|
|
489
|
+
class="variant-${t} size-${n}"
|
|
490
|
+
${b?"disabled":""}
|
|
491
|
+
${f?`aria-label="${f}"`:""}
|
|
492
|
+
${l?'aria-busy="true"':""}
|
|
493
|
+
>
|
|
494
|
+
${l?'<span class="spinner"></span>':""}
|
|
495
|
+
${a&&!l?`<span class="icon">${a}</span>`:""}
|
|
496
|
+
<slot></slot>
|
|
497
|
+
</button>
|
|
498
|
+
`}};A("af-button",dt);eo=dt});var $0={};Q($0,{default:()=>so,AfriCard:()=>Vt});var Vt,so;var v0=Y(()=>{M();Vt=class Vt 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",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`
|
|
499
|
+
<style>
|
|
500
|
+
:host {
|
|
501
|
+
display: block;
|
|
502
|
+
font-family: var(--font-body, 'Inter', sans-serif);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.card {
|
|
506
|
+
background: var(--glass-bg, rgba(15, 23, 42, 0.7));
|
|
507
|
+
backdrop-filter: blur(var(--glass-blur, 12px));
|
|
508
|
+
border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
|
|
509
|
+
border-radius: var(--radius-lg, 16px);
|
|
510
|
+
overflow: hidden;
|
|
511
|
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
512
|
+
position: relative;
|
|
513
|
+
${o?"cursor: pointer;":""}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.card::before {
|
|
517
|
+
content: '';
|
|
518
|
+
position: absolute;
|
|
519
|
+
inset: 0;
|
|
520
|
+
background: radial-gradient(circle at top left, rgba(255,255,255,0.05), transparent);
|
|
521
|
+
pointer-events: none;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
${o?`
|
|
525
|
+
.card:hover {
|
|
526
|
+
transform: translateY(-8px);
|
|
527
|
+
border-color: rgba(252, 209, 22, 0.4);
|
|
528
|
+
box-shadow: 0 20px 40px rgba(0,0,0,0.4);
|
|
529
|
+
}
|
|
530
|
+
`:""}
|
|
531
|
+
|
|
532
|
+
.card-image {
|
|
533
|
+
width: 100%;
|
|
534
|
+
height: 200px;
|
|
535
|
+
object-fit: cover;
|
|
536
|
+
border-bottom: 1px solid var(--glass-border);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.card-body {
|
|
540
|
+
padding: 32px;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
::slotted(h1), ::slotted(h2), ::slotted(h3), ::slotted(h4) {
|
|
544
|
+
margin: 0 0 12px 0;
|
|
545
|
+
font-family: 'Outfit', sans-serif;
|
|
546
|
+
font-weight: 700;
|
|
547
|
+
color: var(--text-primary, #fff);
|
|
548
|
+
letter-spacing: -0.02em;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
::slotted(p) {
|
|
552
|
+
margin: 0;
|
|
553
|
+
color: var(--text-muted, #94a3b8);
|
|
554
|
+
line-height: 1.6;
|
|
555
|
+
font-size: 0.95rem;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.card-footer {
|
|
559
|
+
padding: 20px 32px;
|
|
560
|
+
background: rgba(0,0,0,0.2);
|
|
561
|
+
border-top: 1px solid var(--glass-border);
|
|
562
|
+
}
|
|
563
|
+
</style>
|
|
564
|
+
|
|
565
|
+
<article class="card">
|
|
566
|
+
${b?`<img class="card-image" src="${b}" alt="" />`:""}
|
|
567
|
+
<div class="card-body">
|
|
568
|
+
<slot></slot>
|
|
569
|
+
</div>
|
|
570
|
+
${this.querySelector('[slot="footer"]')?`
|
|
571
|
+
<div class="card-footer">
|
|
572
|
+
<slot name="footer"></slot>
|
|
573
|
+
</div>
|
|
574
|
+
`:""}
|
|
575
|
+
</article>
|
|
576
|
+
`}};A("af-card",Vt);so=Vt});var w0={};Q(w0,{default:()=>zo,AfriNavbar:()=>jt});var jt,zo;var c0=Y(()=>{M();kt();z();jt=class jt 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",o=this.hasAttribute("sticky");this.shadowRoot.innerHTML=`
|
|
577
|
+
<style>
|
|
578
|
+
:host {
|
|
579
|
+
display: block;
|
|
580
|
+
--nav-height: 80px;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
nav {
|
|
584
|
+
height: var(--nav-height);
|
|
585
|
+
display: flex;
|
|
586
|
+
align-items: center;
|
|
587
|
+
justify-content: space-between;
|
|
588
|
+
padding-inline: 5%;
|
|
589
|
+
background: var(--glass-bg);
|
|
590
|
+
backdrop-filter: blur(12px);
|
|
591
|
+
-webkit-backdrop-filter: blur(12px);
|
|
592
|
+
border-bottom: 1px solid var(--glass-border);
|
|
593
|
+
position: fixed;
|
|
594
|
+
top: 0;
|
|
595
|
+
inset-inline: 0;
|
|
596
|
+
z-index: 1000;
|
|
597
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.logo-container {
|
|
601
|
+
display: flex;
|
|
602
|
+
align-items: center;
|
|
603
|
+
gap: 12px;
|
|
604
|
+
text-decoration: none;
|
|
605
|
+
z-index: 1002;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.logo-mark {
|
|
609
|
+
width: 32px;
|
|
610
|
+
height: 32px;
|
|
611
|
+
background: linear-gradient(135deg, var(--afri-green, #1eb53a), var(--afri-gold, #fcd116));
|
|
612
|
+
border-radius: 8px;
|
|
613
|
+
display: flex;
|
|
614
|
+
align-items: center;
|
|
615
|
+
justify-content: center;
|
|
616
|
+
font-weight: 900;
|
|
617
|
+
color: black;
|
|
618
|
+
font-size: 1rem;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.logo-text {
|
|
622
|
+
font-family: 'Outfit', 'Space Grotesk', sans-serif;
|
|
623
|
+
font-size: 1.5rem;
|
|
624
|
+
font-weight: 800;
|
|
625
|
+
color: var(--text-primary);
|
|
626
|
+
letter-spacing: -0.02em;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.nav-links {
|
|
630
|
+
display: flex;
|
|
631
|
+
gap: 32px;
|
|
632
|
+
align-items: center;
|
|
633
|
+
list-style: none;
|
|
634
|
+
margin: 0;
|
|
635
|
+
padding: 0;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.nav-links ::slotted(a) {
|
|
639
|
+
color: var(--text-muted);
|
|
640
|
+
text-decoration: none;
|
|
641
|
+
font-size: 0.95rem;
|
|
642
|
+
font-weight: 500;
|
|
643
|
+
transition: all 0.2s ease;
|
|
644
|
+
position: relative;
|
|
645
|
+
padding: 8px 0;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
.nav-links ::slotted(a:hover),
|
|
649
|
+
.nav-links ::slotted(a.active) {
|
|
650
|
+
color: var(--text-primary);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.nav-links ::slotted(a)::after {
|
|
654
|
+
content: '';
|
|
655
|
+
position: absolute;
|
|
656
|
+
bottom: 0;
|
|
657
|
+
left: 50%;
|
|
658
|
+
width: 0;
|
|
659
|
+
height: 2px;
|
|
660
|
+
background: var(--afri-gold, #fcd116);
|
|
661
|
+
transition: all 0.3s ease;
|
|
662
|
+
transform: translateX(-50%);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
.nav-links ::slotted(a:hover)::after,
|
|
666
|
+
.nav-links ::slotted(a.active)::after {
|
|
667
|
+
width: 100%;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/* Mobile Toggle */
|
|
671
|
+
.menu-toggle {
|
|
672
|
+
display: none;
|
|
673
|
+
flex-direction: column;
|
|
674
|
+
gap: 6px;
|
|
675
|
+
background: none;
|
|
676
|
+
border: none;
|
|
677
|
+
cursor: pointer;
|
|
678
|
+
z-index: 1002;
|
|
679
|
+
padding: 8px;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.menu-toggle span {
|
|
683
|
+
width: 24px;
|
|
684
|
+
height: 2px;
|
|
685
|
+
background: var(--text-primary);
|
|
686
|
+
border-radius: 2px;
|
|
687
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/* Mobile State */
|
|
691
|
+
.menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
|
|
692
|
+
.menu-toggle.open span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
|
|
693
|
+
.menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
|
|
694
|
+
|
|
695
|
+
@media (max-width: 768px) {
|
|
696
|
+
.menu-toggle {
|
|
697
|
+
display: flex;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.nav-links {
|
|
701
|
+
position: fixed;
|
|
702
|
+
top: 0;
|
|
703
|
+
left: 0;
|
|
704
|
+
width: 100%;
|
|
705
|
+
height: 100vh;
|
|
706
|
+
background: var(--bg-base, #020617);
|
|
707
|
+
flex-direction: column;
|
|
708
|
+
justify-content: center;
|
|
709
|
+
align-items: center;
|
|
710
|
+
gap: 24px;
|
|
711
|
+
opacity: 0;
|
|
712
|
+
visibility: hidden;
|
|
713
|
+
transform: translateY(-20px);
|
|
714
|
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
715
|
+
z-index: 1001;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.nav-links.open {
|
|
719
|
+
opacity: 1;
|
|
720
|
+
visibility: visible;
|
|
721
|
+
transform: translateY(0);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.nav-links ::slotted(a) {
|
|
725
|
+
font-size: 1.5rem;
|
|
726
|
+
font-weight: 700;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
</style>
|
|
730
|
+
|
|
731
|
+
<nav>
|
|
732
|
+
<a href="/" class="logo-container">
|
|
733
|
+
<div class="logo-mark">A</div>
|
|
734
|
+
<span class="logo-text">${n}</span>
|
|
735
|
+
</a>
|
|
736
|
+
|
|
737
|
+
<button
|
|
738
|
+
class="menu-toggle"
|
|
739
|
+
aria-label="Toggle menu"
|
|
740
|
+
aria-controls="nav-links"
|
|
741
|
+
aria-expanded="${this._isOpen}"
|
|
742
|
+
>
|
|
743
|
+
<span></span>
|
|
744
|
+
<span></span>
|
|
745
|
+
<span></span>
|
|
746
|
+
</button>
|
|
747
|
+
|
|
748
|
+
<div id="nav-links" class="nav-links ${this._isOpen?"open":""}">
|
|
749
|
+
<slot></slot>
|
|
750
|
+
</div>
|
|
751
|
+
</nav>
|
|
752
|
+
`}};A("af-navbar",jt);zo=jt});var S,Nn,$,N=(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 Mt=Y(()=>{(function(t){t.assertEqual=(l)=>{};function n(l){}t.assertIs=n;function o(l){throw Error()}t.assertNever=o,t.arrayToEnum=(l)=>{let a={};for(let f of l)a[f]=f;return a},t.getValidEnumValues=(l)=>{let a=t.objectKeys(l).filter((h)=>typeof l[l[h]]!=="number"),f={};for(let h of a)f[h]=l[h];return t.objectValues(f)},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 f in l)if(Object.prototype.hasOwnProperty.call(l,f))a.push(f);return a},t.find=(l,a)=>{for(let f of l)if(a(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,a=" | "){return l.map((f)=>typeof f==="string"?`'${f}'`:f).join(a)}t.joinValues=b,t.jsonStringifyReplacer=(l,a)=>{if(typeof a==="bigint")return a.toString();return a}})(S||(S={}));(function(t){t.mergeShapes=(n,o)=>{return{...n,...o}}})(Nn||(Nn={}));$=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var r,tb=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},O;var Nt=Y(()=>{Mt();r=S.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"]);O=class O 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 a of l.issues)if(a.code==="invalid_union")a.unionErrors.map(b);else if(a.code==="invalid_return_type")b(a.returnTypeError);else if(a.code==="invalid_arguments")b(a.argumentsError);else if(a.path.length===0)o._errors.push(n(a));else{let f=o,h=0;while(h<a.path.length){let g=a.path[h];if(h!==a.path.length-1)f[g]=f[g]||{_errors:[]};else f[g]=f[g]||{_errors:[]},f[g]._errors.push(n(a));f=f[g],h++}}};return b(this),o}static assert(t){if(!(t instanceof O))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.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()}};O.create=(t)=>{return new O(t)}});var nb=(t,n)=>{let o;switch(t.code){case r.invalid_type:if(t.received===$.undefined)o="Required";else o=`Expected ${t.expected}, received ${t.received}`;break;case r.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(t.expected,S.jsonStringifyReplacer)}`;break;case r.unrecognized_keys:o=`Unrecognized key(s) in object: ${S.joinValues(t.keys,", ")}`;break;case r.invalid_union:o="Invalid input";break;case r.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${S.joinValues(t.options)}`;break;case r.invalid_enum_value:o=`Invalid enum value. Expected ${S.joinValues(t.options)}, received '${t.received}'`;break;case r.invalid_arguments:o="Invalid function arguments";break;case r.invalid_return_type:o="Invalid function return type";break;case r.invalid_date:o="Invalid date";break;case r.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 S.assertNever(t.validation);else if(t.validation!=="regex")o=`Invalid ${t.validation}`;else o="Invalid";break;case r.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 r.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 r.custom:o="Invalid input";break;case r.invalid_intersection_types:o="Intersection results could not be merged";break;case r.not_multiple_of:o=`Number must be a multiple of ${t.multipleOf}`;break;case r.not_finite:o="Number must be finite";break;default:o=n.defaultError,S.assertNever(t)}return{message:o}},I;var Kn=Y(()=>{Nt();Mt();I=nb});function ob(t){_0=t}function ft(){return _0}var _0;var Kt=Y(()=>{Kn();_0=I});function v(t,n){let o=ft(),b=Qt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o===I?void 0:I].filter((l)=>!!l)});t.common.issues.push(b)}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 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,a=await b.value;o.push({key:l,value:a})}return F.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let b of n){let{key:l,value:a}=b;if(l.status==="aborted")return H;if(a.status==="aborted")return H;if(l.status==="dirty")t.dirty();if(a.status==="dirty")t.dirty();if(l.value!=="__proto__"&&(typeof a.value<"u"||b.alwaysSet))o[l.value]=a.value}return{status:t.value,value:o}}}var Qt=(t)=>{let{data:n,path:o,errorMaps:b,issueData:l}=t,a=[...o,...l.path||[]],f={...l,path:a};if(l.message!==void 0)return{...l,path:a,message:l.message};let h="",g=b.filter((_)=>!!_).slice().reverse();for(let _ of g)h=_(f,{data:n,defaultError:h}).message;return{...l,path:a,message:h}},bb,H,tt=(t)=>({status:"dirty",value:t}),B=(t)=>({status:"valid",value:t}),pt=(t)=>t.status==="aborted",It=(t)=>t.status==="dirty",C=(t)=>t.status==="valid",ht=(t)=>typeof Promise<"u"&&t instanceof Promise;var pn=Y(()=>{Kt();Kn();bb=[];H=Object.freeze({status:"aborted"})});var A0=()=>{};var q;var q0=Y(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(q||(q={}))});class V{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,h)=>{let{message:g}=t;if(f.code==="invalid_enum_value")return{message:g??h.defaultError};if(typeof h.data>"u")return{message:g??b??h.defaultError};if(f.code!=="invalid_type")return{message:h.defaultError};return{message:g??o??h.defaultError}},description:l}}class k{get description(){return this._def.description}_getType(t){return N(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:N(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:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(ht(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:N(t)},b=this._parseSync({data:t,path:o.path,parent:o});return H0(o,b)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return C(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)=>C(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:N(t)},b=this._parse({data:t,path:o.path,parent:o}),l=await(ht(b)?b:Promise.resolve(b));return H0(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 a=t(b),f=()=>l.addIssue({code:r.custom,...o(b)});if(typeof Promise<"u"&&a instanceof Promise)return a.then((h)=>{if(!h)return f(),!1;else return!0});if(!a)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 j({schema:this,typeName:E.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 d.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return U.create(this)}promise(){return lt.create(this,this._def)}or(t){return ct.create([this,t],this._def)}and(t){return _t.create(this,t,this._def)}transform(t){return new j({...x(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new Et({...x(this._def),innerType:this,defaultValue:n,typeName:E.ZodDefault})}brand(){return new Pt({typeName:E.ZodBranded,type:this,...x(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new Yt({...x(this._def),innerType:this,catchValue:n,typeName:E.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Rt.create(this,t)}readonly(){return xt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function x0(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 xb(t){return new RegExp(`^${x0(t)}$`)}function k0(t){let n=`${Y0}T${x0(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 kb(t,n){if((n==="v4"||!n)&&cb.test(t))return!0;if((n==="v6"||!n)&&Ab.test(t))return!0;return!1}function Xb(t,n){if(!rb.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 Sb(t,n){if((n==="v4"||!n)&&_b.test(t))return!0;if((n==="v6"||!n)&&qb.test(t))return!0;return!1}function Mb(t,n){let o=(t.toString().split(".")[1]||"").length,b=(n.toString().split(".")[1]||"").length,l=o>b?o:b,a=Number.parseInt(t.toFixed(l).replace(".","")),f=Number.parseInt(n.toFixed(l).replace(".",""));return a%f/10**l}function gt(t){if(t instanceof J){let n={};for(let o in t.shape){let b=t.shape[o];n[o]=d.create(gt(b))}return new J({...t._def,shape:()=>n})}else if(t instanceof U)return new U({...t._def,type:gt(t.element)});else if(t instanceof d)return d.create(gt(t.unwrap()));else if(t instanceof P)return P.create(gt(t.unwrap()));else if(t instanceof p)return p.create(t.items.map((n)=>gt(n)));else return t}function un(t,n){let o=N(t),b=N(n);if(t===n)return{valid:!0,data:t};else if(o===$.object&&b===$.object){let l=S.objectKeys(n),a=S.objectKeys(t).filter((h)=>l.indexOf(h)!==-1),f={...t,...n};for(let h of a){let g=un(t[h],n[h]);if(!g.valid)return{valid:!1};f[h]=g.data}return{valid:!0,data:f}}else if(o===$.array&&b===$.array){if(t.length!==n.length)return{valid:!1};let l=[];for(let a=0;a<t.length;a++){let f=t[a],h=n[a],g=un(f,h);if(!g.valid)return{valid:!1};l.push(g.data)}return{valid:!0,data:l}}else if(o===$.date&&b===$.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function X0(t,n){return new s({values:t,typeName:E.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 S0(t,n={},o){if(t)return ot.create().superRefine((b,l)=>{let a=t(b);if(a instanceof Promise)return a.then((f)=>{if(!f){let h=E0(n,b),g=h.fatal??o??!0;l.addIssue({code:"custom",...h,fatal:g})}});if(!a){let f=E0(n,b),h=f.fatal??o??!0;l.addIssue({code:"custom",...f,fatal:h})}return});return ot.create()}var H0=(t,n)=>{if(C(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 O(t.common.issues);return this._error=o,this._error}}}},lb,ab,fb,hb,gb,rb,$b,vb,wb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",In,cb,_b,Ab,qb,Hb,Eb,Y0="((\\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])))",Yb,m,Z,e,$t,nt,Jt,vt,wt,ot,y,K,Gt,U,J,ct,u=(t)=>{if(t instanceof At)return u(t.schema);else if(t instanceof j)return u(t.innerType());else if(t instanceof qt)return[t.value];else if(t instanceof s)return t.options;else if(t instanceof Ht)return S.objectValues(t.enum);else if(t instanceof Et)return u(t._def.innerType);else if(t instanceof vt)return[void 0];else if(t instanceof wt)return[null];else if(t instanceof d)return[void 0,...u(t.unwrap())];else if(t instanceof P)return[null,...u(t.unwrap())];else if(t instanceof Pt)return u(t.unwrap());else if(t instanceof xt)return u(t.unwrap());else if(t instanceof Yt)return u(t._def.innerType);else return[]},ut,_t,p,Lt,Ft,bt,rt,At,qt,s,Ht,lt,j,d,P,Et,Yt,Bt,Qb,Pt,Rt,xt,Jb,E,Gb=(t,n={message:`Input not instance of ${t.name}`})=>S0((o)=>o instanceof t,n),M0,Q0,Lb,Fb,J0,Bb,Rb,Db,Wb,Ob,mb,Ub,db,Vb,jb,Nb,Kb,pb,Ib,ub,Pb,ib,Tb,Cb,yb,Zb,eb,sb,zb,tl,nl,ol,bl,ll,al=()=>M0().optional(),fl=()=>Q0().optional(),hl=()=>J0().optional(),gl,rl;var G0=Y(()=>{Nt();Kt();q0();pn();Mt();lb=/^c[^\s-]{8,}$/i,ab=/^[0-9a-z]+$/,fb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hb=/^[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,gb=/^[a-z0-9_-]{21}$/i,rb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$b=/^[-+]?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)?)??$/,vb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cb=/^(?:(?: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])$/,_b=/^(?:(?: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])$/,Ab=/^(([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]))$/,qb=/^(([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])$/,Hb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Eb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yb=new RegExp(`^${Y0}$`);m=class m extends k{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==$.string){let l=this._getOrReturnCtx(t);return v(l,{code:r.invalid_type,expected:$.string,received:l.parsedType}),H}let o=new F,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),v(b,{code:r.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),v(b,{code:r.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="length"){let a=t.data.length>l.value,f=t.data.length<l.value;if(a||f){if(b=this._getOrReturnCtx(t,b),a)v(b,{code:r.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});else if(f)v(b,{code:r.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});o.dirty()}}else if(l.kind==="email"){if(!vb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"email",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="emoji"){if(!In)In=new RegExp(wb,"u");if(!In.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"emoji",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="uuid"){if(!hb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"uuid",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="nanoid"){if(!gb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"nanoid",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid"){if(!lb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"cuid",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid2"){if(!ab.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"cuid2",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ulid"){if(!fb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"ulid",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="url")try{new URL(t.data)}catch{b=this._getOrReturnCtx(t,b),v(b,{validation:"url",code:r.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),v(b,{validation:"regex",code:r.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),v(b,{code:r.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),v(b,{code:r.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),v(b,{code:r.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="datetime"){if(!k0(l).test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:"datetime",message:l.message}),o.dirty()}else if(l.kind==="date"){if(!Yb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:"date",message:l.message}),o.dirty()}else if(l.kind==="time"){if(!xb(l).test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:r.invalid_string,validation:"time",message:l.message}),o.dirty()}else if(l.kind==="duration"){if(!$b.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"duration",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ip"){if(!kb(t.data,l.version))b=this._getOrReturnCtx(t,b),v(b,{validation:"ip",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="jwt"){if(!Xb(t.data,l.alg))b=this._getOrReturnCtx(t,b),v(b,{validation:"jwt",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cidr"){if(!Sb(t.data,l.version))b=this._getOrReturnCtx(t,b),v(b,{validation:"cidr",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64"){if(!Hb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"base64",code:r.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64url"){if(!Eb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"base64url",code:r.invalid_string,message:l.message}),o.dirty()}else S.assertNever(l);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement((b)=>t.test(b),{validation:n,code:r.invalid_string,...q.errToObj(o)})}_addCheck(t){return new m({...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 m({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new m({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new m({...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}};m.create=(t)=>{return new m({checks:[],typeName:E.ZodString,coerce:t?.coerce??!1,...x(t)})};Z=class Z extends k{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 v(l,{code:r.invalid_type,expected:$.number,received:l.parsedType}),H}let o=void 0,b=new F;for(let l of this._def.checks)if(l.kind==="int"){if(!S.isInteger(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:r.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),v(o,{code:r.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),v(o,{code:r.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(Mb(t.data,l.value)!==0)o=this._getOrReturnCtx(t,o),v(o,{code:r.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),v(o,{code:r.not_finite,message:l.message}),b.dirty()}else S.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 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]})}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"&&S.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)}};Z.create=(t)=>{return new Z({checks:[],typeName:E.ZodNumber,coerce:t?.coerce||!1,...x(t)})};e=class e extends k{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 o=void 0,b=new F;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),v(o,{code:r.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),v(o,{code:r.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),v(o,{code:r.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else S.assertNever(l);return{status:b.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return v(n,{code:r.invalid_type,expected:$.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 e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new e({...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}};e.create=(t)=>{return new e({checks:[],typeName:E.ZodBigInt,coerce:t?.coerce??!1,...x(t)})};$t=class $t extends k{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==$.boolean){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.boolean,received:o.parsedType}),H}return B(t.data)}};$t.create=(t)=>{return new $t({typeName:E.ZodBoolean,coerce:t?.coerce||!1,...x(t)})};nt=class nt extends k{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==$.date){let l=this._getOrReturnCtx(t);return v(l,{code:r.invalid_type,expected:$.date,received:l.parsedType}),H}if(Number.isNaN(t.data.getTime())){let l=this._getOrReturnCtx(t);return v(l,{code:r.invalid_date}),H}let o=new F,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),v(b,{code:r.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),v(b,{code:r.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()}else S.assertNever(l);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new nt({...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}};nt.create=(t)=>{return new nt({checks:[],coerce:t?.coerce||!1,typeName:E.ZodDate,...x(t)})};Jt=class Jt extends k{_parse(t){if(this._getType(t)!==$.symbol){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.symbol,received:o.parsedType}),H}return B(t.data)}};Jt.create=(t)=>{return new Jt({typeName:E.ZodSymbol,...x(t)})};vt=class vt extends k{_parse(t){if(this._getType(t)!==$.undefined){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.undefined,received:o.parsedType}),H}return B(t.data)}};vt.create=(t)=>{return new vt({typeName:E.ZodUndefined,...x(t)})};wt=class wt extends k{_parse(t){if(this._getType(t)!==$.null){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.null,received:o.parsedType}),H}return B(t.data)}};wt.create=(t)=>{return new wt({typeName:E.ZodNull,...x(t)})};ot=class ot extends k{constructor(){super(...arguments);this._any=!0}_parse(t){return B(t.data)}};ot.create=(t)=>{return new ot({typeName:E.ZodAny,...x(t)})};y=class y extends k{constructor(){super(...arguments);this._unknown=!0}_parse(t){return B(t.data)}};y.create=(t)=>{return new y({typeName:E.ZodUnknown,...x(t)})};K=class K extends k{_parse(t){let n=this._getOrReturnCtx(t);return v(n,{code:r.invalid_type,expected:$.never,received:n.parsedType}),H}};K.create=(t)=>{return new K({typeName:E.ZodNever,...x(t)})};Gt=class Gt extends k{_parse(t){if(this._getType(t)!==$.undefined){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.void,received:o.parsedType}),H}return B(t.data)}};Gt.create=(t)=>{return new Gt({typeName:E.ZodVoid,...x(t)})};U=class U extends k{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),b=this._def;if(n.parsedType!==$.array)return v(n,{code:r.invalid_type,expected:$.array,received:n.parsedType}),H;if(b.exactLength!==null){let a=n.data.length>b.exactLength.value,f=n.data.length<b.exactLength.value;if(a||f)v(n,{code:a?r.too_big:r.too_small,minimum:f?b.exactLength.value:void 0,maximum:a?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)v(n,{code:r.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)v(n,{code:r.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((a,f)=>{return b.type._parseAsync(new V(n,a,n.path,f))})).then((a)=>{return F.mergeArray(o,a)});let l=[...n.data].map((a,f)=>{return b.type._parseSync(new V(n,a,n.path,f))});return F.mergeArray(o,l)}get element(){return this._def.type}min(t,n){return new U({...this._def,minLength:{value:t,message:q.toString(n)}})}max(t,n){return new U({...this._def,maxLength:{value:t,message:q.toString(n)}})}length(t,n){return new U({...this._def,exactLength:{value:t,message:q.toString(n)}})}nonempty(t){return this.min(1,t)}};U.create=(t,n)=>{return new U({type:t,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...x(n)})};J=class J extends k{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=S.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$.object){let g=this._getOrReturnCtx(t);return v(g,{code:r.invalid_type,expected:$.object,received:g.parsedType}),H}let{status:o,ctx:b}=this._processInputParams(t),{shape:l,keys:a}=this._getCached(),f=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip")){for(let g in b.data)if(!a.includes(g))f.push(g)}let h=[];for(let g of a){let _=l[g],X=b.data[g];h.push({key:{status:"valid",value:g},value:_._parse(new V(b,X,b.path,g)),alwaysSet:g in b.data})}if(this._def.catchall instanceof K){let g=this._def.unknownKeys;if(g==="passthrough")for(let _ of f)h.push({key:{status:"valid",value:_},value:{status:"valid",value:b.data[_]}});else if(g==="strict"){if(f.length>0)v(b,{code:r.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 _ of f){let X=b.data[_];h.push({key:{status:"valid",value:_},value:g._parse(new V(b,X,b.path,_)),alwaysSet:_ in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let g=[];for(let _ of h){let X=await _.key,L=await _.value;g.push({key:X,value:L,alwaysSet:_.alwaysSet})}return g}).then((g)=>{return F.mergeObjectSync(o,g)});else return F.mergeObjectSync(o,h)}get shape(){return this._def.shape()}strict(t){return q.errToObj,new J({...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 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:E.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new J({...this._def,catchall:t})}pick(t){let n={};for(let o of S.objectKeys(t))if(t[o]&&this.shape[o])n[o]=this.shape[o];return new J({...this._def,shape:()=>n})}omit(t){let n={};for(let o of S.objectKeys(this.shape))if(!t[o])n[o]=this.shape[o];return new J({...this._def,shape:()=>n})}deepPartial(){return gt(this)}partial(t){let n={};for(let o of S.objectKeys(this.shape)){let b=this.shape[o];if(t&&!t[o])n[o]=b;else n[o]=b.optional()}return new J({...this._def,shape:()=>n})}required(t){let n={};for(let o of S.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let l=this.shape[o];while(l instanceof d)l=l._def.innerType;n[o]=l}return new J({...this._def,shape:()=>n})}keyof(){return X0(S.objectKeys(this.shape))}};J.create=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strip",catchall:K.create(),typeName:E.ZodObject,...x(n)})};J.strictCreate=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strict",catchall:K.create(),typeName:E.ZodObject,...x(n)})};J.lazycreate=(t,n)=>{return new J({shape:t,unknownKeys:"strip",catchall:K.create(),typeName:E.ZodObject,...x(n)})};ct=class ct extends k{_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 a=l.map((f)=>new O(f.ctx.common.issues));return v(n,{code:r.invalid_union,unionErrors:a}),H}if(n.common.async)return Promise.all(o.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(b);else{let l=void 0,a=[];for(let h of o){let g={...n,common:{...n.common,issues:[]},parent:null},_=h._parseSync({data:n.data,path:n.path,parent:g});if(_.status==="valid")return _;else if(_.status==="dirty"&&!l)l={result:_,ctx:g};if(g.common.issues.length)a.push(g.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;let f=a.map((h)=>new O(h));return v(n,{code:r.invalid_union,unionErrors:f}),H}}get options(){return this._def.options}};ct.create=(t,n)=>{return new ct({options:t,typeName:E.ZodUnion,...x(n)})};ut=class ut extends k{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.object)return v(n,{code:r.invalid_type,expected:$.object,received:n.parsedType}),H;let o=this.discriminator,b=n.data[o],l=this.optionsMap.get(b);if(!l)return v(n,{code:r.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 a=u(l.shape[t]);if(!a.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of a){if(b.has(f))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);b.set(f,l)}}return new ut({typeName:E.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:b,...x(o)})}};_t=class _t extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=(l,a)=>{if(pt(l)||pt(a))return H;let f=un(l.value,a.value);if(!f.valid)return v(o,{code:r.invalid_intersection_types}),H;if(It(l)||It(a))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,a])=>b(l,a));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}))}};_t.create=(t,n,o)=>{return new _t({left:t,right:n,typeName:E.ZodIntersection,...x(o)})};p=class p extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.array)return v(o,{code:r.invalid_type,expected:$.array,received:o.parsedType}),H;if(o.data.length<this._def.items.length)return v(o,{code:r.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)v(o,{code:r.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let l=[...o.data].map((a,f)=>{let h=this._def.items[f]||this._def.rest;if(!h)return null;return h._parse(new V(o,a,o.path,f))}).filter((a)=>!!a);if(o.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 p({...this._def,rest:t})}};p.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new p({items:t,typeName:E.ZodTuple,rest:null,...x(n)})};Lt=class Lt extends k{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!==$.object)return v(o,{code:r.invalid_type,expected:$.object,received:o.parsedType}),H;let b=[],l=this._def.keyType,a=this._def.valueType;for(let f in o.data)b.push({key:l._parse(new V(o,f,o.path,f)),value:a._parse(new V(o,o.data[f],o.path,f)),alwaysSet:f in o.data});if(o.common.async)return F.mergeObjectAsync(n,b);else return F.mergeObjectSync(n,b)}get element(){return this._def.valueType}static create(t,n,o){if(n instanceof k)return new Lt({keyType:t,valueType:n,typeName:E.ZodRecord,...x(o)});return new Lt({keyType:m.create(),valueType:t,typeName:E.ZodRecord,...x(n)})}};Ft=class Ft extends k{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!==$.map)return v(o,{code:r.invalid_type,expected:$.map,received:o.parsedType}),H;let b=this._def.keyType,l=this._def.valueType,a=[...o.data.entries()].map(([f,h],g)=>{return{key:b._parse(new V(o,f,o.path,[g,"key"])),value:l._parse(new V(o,h,o.path,[g,"value"]))}});if(o.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let h of a){let g=await h.key,_=await h.value;if(g.status==="aborted"||_.status==="aborted")return H;if(g.status==="dirty"||_.status==="dirty")n.dirty();f.set(g.value,_.value)}return{status:n.value,value:f}})}else{let f=new Map;for(let h of a){let{key:g,value:_}=h;if(g.status==="aborted"||_.status==="aborted")return H;if(g.status==="dirty"||_.status==="dirty")n.dirty();f.set(g.value,_.value)}return{status:n.value,value:f}}}};Ft.create=(t,n,o)=>{return new Ft({valueType:n,keyType:t,typeName:E.ZodMap,...x(o)})};bt=class bt extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.set)return v(o,{code:r.invalid_type,expected:$.set,received:o.parsedType}),H;let b=this._def;if(b.minSize!==null){if(o.data.size<b.minSize.value)v(o,{code:r.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)v(o,{code:r.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),n.dirty()}let l=this._def.valueType;function a(h){let g=new Set;for(let _ of h){if(_.status==="aborted")return H;if(_.status==="dirty")n.dirty();g.add(_.value)}return{status:n.value,value:g}}let f=[...o.data.values()].map((h,g)=>l._parse(new V(o,h,o.path,g)));if(o.common.async)return Promise.all(f).then((h)=>a(h));else return a(f)}min(t,n){return new bt({...this._def,minSize:{value:t,message:q.toString(n)}})}max(t,n){return new bt({...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)}};bt.create=(t,n)=>{return new bt({valueType:t,minSize:null,maxSize:null,typeName:E.ZodSet,...x(n)})};rt=class rt extends k{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.function)return v(n,{code:r.invalid_type,expected:$.function,received:n.parsedType}),H;function o(f,h){return Qt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ft(),I].filter((g)=>!!g),issueData:{code:r.invalid_arguments,argumentsError:h}})}function b(f,h){return Qt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ft(),I].filter((g)=>!!g),issueData:{code:r.invalid_return_type,returnTypeError:h}})}let l={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof lt){let f=this;return B(async function(...h){let g=new O([]),_=await f._def.args.parseAsync(h,l).catch((G)=>{throw g.addIssue(o(h,G)),g}),X=await Reflect.apply(a,this,_);return await f._def.returns._def.type.parseAsync(X,l).catch((G)=>{throw g.addIssue(b(X,G)),g})})}else{let f=this;return B(function(...h){let g=f._def.args.safeParse(h,l);if(!g.success)throw new O([o(h,g.error)]);let _=Reflect.apply(a,this,g.data),X=f._def.returns.safeParse(_,l);if(!X.success)throw new O([b(_,X.error)]);return X.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new rt({...this._def,args:p.create(t).rest(y.create())})}returns(t){return new rt({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new rt({args:t?t:p.create([]).rest(y.create()),returns:n||y.create(),typeName:E.ZodFunction,...x(o)})}};At=class At extends k{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})}};At.create=(t,n)=>{return new At({getter:t,typeName:E.ZodLazy,...x(n)})};qt=class qt extends k{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return v(n,{received:n.data,code:r.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:E.ZodLiteral,...x(n)})};s=class s extends k{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return v(n,{expected:S.joinValues(o),received:n.parsedType,code:r.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 v(n,{received:n.data,code:r.invalid_enum_value,options:o}),H}return B(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 s.create(t,{...this._def,...n})}exclude(t,n=this._def){return s.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};s.create=X0;Ht=class Ht extends k{_parse(t){let n=S.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==$.string&&o.parsedType!==$.number){let b=S.objectValues(n);return v(o,{expected:S.joinValues(b),received:o.parsedType,code:r.invalid_type}),H}if(!this._cache)this._cache=new Set(S.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let b=S.objectValues(n);return v(o,{received:o.data,code:r.invalid_enum_value,options:b}),H}return B(t.data)}get enum(){return this._def.values}};Ht.create=(t,n)=>{return new Ht({values:t,typeName:E.ZodNativeEnum,...x(n)})};lt=class lt extends k{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.promise&&n.common.async===!1)return v(n,{code:r.invalid_type,expected:$.promise,received:n.parsedType}),H;let o=n.parsedType===$.promise?n.data:Promise.resolve(n.data);return B(o.then((b)=>{return this._def.type.parseAsync(b,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};lt.create=(t,n)=>{return new lt({type:t,typeName:E.ZodPromise,...x(n)})};j=class j extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.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:(a)=>{if(v(o,a),a.fatal)n.abort();else n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),b.type==="preprocess"){let a=b.transform(o.data,l);if(o.common.async)return Promise.resolve(a).then(async(f)=>{if(n.value==="aborted")return H;let h=await this._def.schema._parseAsync({data:f,path:o.path,parent:o});if(h.status==="aborted")return H;if(h.status==="dirty")return tt(h.value);if(n.value==="dirty")return tt(h.value);return h});else{if(n.value==="aborted")return H;let f=this._def.schema._parseSync({data:a,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")return tt(f.value);if(n.value==="dirty")return tt(f.value);return f}}if(b.type==="refinement"){let a=(f)=>{let h=b.refinement(f,l);if(o.common.async)return Promise.resolve(h);if(h 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 a(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 a(f.value).then(()=>{return{status:n.value,value:f.value}})})}if(b.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!C(a))return H;let f=b.transform(a.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((a)=>{if(!C(a))return H;return Promise.resolve(b.transform(a.value,l)).then((f)=>({status:n.value,value:f}))});S.assertNever(b)}};j.create=(t,n,o)=>{return new j({schema:t,typeName:E.ZodEffects,effect:n,...x(o)})};j.createWithPreprocess=(t,n,o)=>{return new j({schema:n,effect:{type:"preprocess",transform:t},typeName:E.ZodEffects,...x(o)})};d=class d extends k{_parse(t){if(this._getType(t)===$.undefined)return B(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};d.create=(t,n)=>{return new d({innerType:t,typeName:E.ZodOptional,...x(n)})};P=class P extends k{_parse(t){if(this._getType(t)===$.null)return B(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};P.create=(t,n)=>{return new P({innerType:t,typeName:E.ZodNullable,...x(n)})};Et=class Et extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;if(n.parsedType===$.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Et.create=(t,n)=>{return new Et({innerType:t,typeName:E.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...x(n)})};Yt=class Yt extends k{_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(ht(b))return b.then((l)=>{return{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new O(o.common.issues)},input:o.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new O(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Yt.create=(t,n)=>{return new Yt({innerType:t,typeName:E.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...x(n)})};Bt=class Bt extends k{_parse(t){if(this._getType(t)!==$.nan){let o=this._getOrReturnCtx(t);return v(o,{code:r.invalid_type,expected:$.nan,received:o.parsedType}),H}return{status:"valid",value:t.data}}};Bt.create=(t)=>{return new Bt({typeName:E.ZodNaN,...x(t)})};Qb=Symbol("zod_brand");Pt=class Pt extends k{_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}};Rt=class Rt extends k{_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(),tt(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 Rt({in:t,out:n,typeName:E.ZodPipeline})}};xt=class xt extends k{_parse(t){let n=this._def.innerType._parse(t),o=(b)=>{if(C(b))b.value=Object.freeze(b.value);return b};return ht(n)?n.then((b)=>o(b)):o(n)}unwrap(){return this._def.innerType}};xt.create=(t,n)=>{return new xt({innerType:t,typeName:E.ZodReadonly,...x(n)})};Jb={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"})(E||(E={}));M0=m.create,Q0=Z.create,Lb=Bt.create,Fb=e.create,J0=$t.create,Bb=nt.create,Rb=Jt.create,Db=vt.create,Wb=wt.create,Ob=ot.create,mb=y.create,Ub=K.create,db=Gt.create,Vb=U.create,jb=J.create,Nb=J.strictCreate,Kb=ct.create,pb=ut.create,Ib=_t.create,ub=p.create,Pb=Lt.create,ib=Ft.create,Tb=bt.create,Cb=rt.create,yb=At.create,Zb=qt.create,eb=s.create,sb=Ht.create,zb=lt.create,tl=j.create,nl=d.create,ol=P.create,bl=j.createWithPreprocess,ll=Rt.create,gl={string:(t)=>m.create({...t,coerce:!0}),number:(t)=>Z.create({...t,coerce:!0}),boolean:(t)=>$t.create({...t,coerce:!0}),bigint:(t)=>e.create({...t,coerce:!0}),date:(t)=>nt.create({...t,coerce:!0})},rl=H});var w={};Q(w,{void:()=>db,util:()=>S,unknown:()=>mb,union:()=>Kb,undefined:()=>Db,tuple:()=>ub,transformer:()=>tl,symbol:()=>Rb,string:()=>M0,strictObject:()=>Nb,setErrorMap:()=>ob,set:()=>Tb,record:()=>Pb,quotelessJson:()=>tb,promise:()=>zb,preprocess:()=>bl,pipeline:()=>ll,ostring:()=>al,optional:()=>nl,onumber:()=>fl,oboolean:()=>hl,objectUtil:()=>Nn,object:()=>jb,number:()=>Q0,nullable:()=>ol,null:()=>Wb,never:()=>Ub,nativeEnum:()=>sb,nan:()=>Lb,map:()=>ib,makeIssue:()=>Qt,literal:()=>Zb,lazy:()=>yb,late:()=>Jb,isValid:()=>C,isDirty:()=>It,isAsync:()=>ht,isAborted:()=>pt,intersection:()=>Ib,instanceof:()=>Gb,getParsedType:()=>N,getErrorMap:()=>ft,function:()=>Cb,enum:()=>eb,effect:()=>tl,discriminatedUnion:()=>pb,defaultErrorMap:()=>I,datetimeRegex:()=>k0,date:()=>Bb,custom:()=>S0,coerce:()=>gl,boolean:()=>J0,bigint:()=>Fb,array:()=>Vb,any:()=>Ob,addIssueToContext:()=>v,ZodVoid:()=>Gt,ZodUnknown:()=>y,ZodUnion:()=>ct,ZodUndefined:()=>vt,ZodType:()=>k,ZodTuple:()=>p,ZodTransformer:()=>j,ZodSymbol:()=>Jt,ZodString:()=>m,ZodSet:()=>bt,ZodSchema:()=>k,ZodRecord:()=>Lt,ZodReadonly:()=>xt,ZodPromise:()=>lt,ZodPipeline:()=>Rt,ZodParsedType:()=>$,ZodOptional:()=>d,ZodObject:()=>J,ZodNumber:()=>Z,ZodNullable:()=>P,ZodNull:()=>wt,ZodNever:()=>K,ZodNativeEnum:()=>Ht,ZodNaN:()=>Bt,ZodMap:()=>Ft,ZodLiteral:()=>qt,ZodLazy:()=>At,ZodIssueCode:()=>r,ZodIntersection:()=>_t,ZodFunction:()=>rt,ZodFirstPartyTypeKind:()=>E,ZodError:()=>O,ZodEnum:()=>s,ZodEffects:()=>j,ZodDiscriminatedUnion:()=>ut,ZodDefault:()=>Et,ZodDate:()=>nt,ZodCatch:()=>Yt,ZodBranded:()=>Pt,ZodBoolean:()=>$t,ZodBigInt:()=>e,ZodArray:()=>U,ZodAny:()=>ot,Schema:()=>k,ParseStatus:()=>F,OK:()=>B,NEVER:()=>rl,INVALID:()=>H,EMPTY_PATH:()=>bb,DIRTY:()=>tt,BRAND:()=>Qb});var Pn=Y(()=>{Kt();pn();A0();Mt();G0();Nt()});var L0=Y(()=>{Pn();Pn()});function Tn(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(Tn);let n={};for(let o of Object.keys(t))n[o]=Tn(t[o]);return n}var $l,Ma;var F0=Y(()=>{$l={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}},Ma=Tn($l)});class Dt{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 a=l.path.join(".");b[a]=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)}}var B0,i;var Cn=Y(()=>{L0();F0();B0={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()})};i={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)}});var R0={};Q(R0,{default:()=>vl,AfriInput:()=>it});var it,vl;var D0=Y(()=>{M();Cn();it=class it 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"),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 a=Dt.validateField(l,o);if(!a.success)this.setAttribute("error",a.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:i.email(),password:i.password(),phone:i.phone(),url:i.url(),required:i.required()};if(t.includes(":")){let[o,b]=t.split(":"),l=parseInt(b);switch(o){case"minLength":return i.minLength(l);case"maxLength":return i.maxLength(l);case"pattern":return i.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")||"",a=this.getAttribute("helper")||"",f=this.getAttribute("theme")||"tanzania",h=this.getAttribute("icon")||"",g=this.hasAttribute("required"),_=this.getAttribute("aria-label"),X=this.getAttribute("aria-describedby"),L={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},G=L[f]||L.tanzania,R=[];if(l)R.push(`error-${this._uniqueId}`);else if(a)R.push(`helper-${this._uniqueId}`);if(X)R.push(...X.split(" "));let An=R.length>0?`aria-describedby="${R.join(" ")}"`:"";this.shadowRoot.innerHTML=`
|
|
753
|
+
<style>
|
|
754
|
+
:host {
|
|
755
|
+
display: block;
|
|
756
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.input-wrapper {
|
|
760
|
+
position: relative;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
label {
|
|
764
|
+
display: block;
|
|
765
|
+
font-weight: 500;
|
|
766
|
+
margin-bottom: 5px;
|
|
767
|
+
color: #333;
|
|
768
|
+
font-size: 14px;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.required-star {
|
|
772
|
+
color: ${G.error};
|
|
773
|
+
margin-left: 2px;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.input-container {
|
|
777
|
+
position: relative;
|
|
778
|
+
display: flex;
|
|
779
|
+
align-items: center;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
input {
|
|
783
|
+
width: 100%;
|
|
784
|
+
padding: 10px 13px;
|
|
785
|
+
${h?"padding-left: 40px;":""}
|
|
786
|
+
font-size: 15px;
|
|
787
|
+
border: 2px solid #ddd;
|
|
788
|
+
border-radius: 5px;
|
|
789
|
+
transition: all 200ms ease;
|
|
790
|
+
font-family: inherit;
|
|
791
|
+
box-sizing: border-box;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
input:focus {
|
|
795
|
+
outline: none;
|
|
796
|
+
border-color: ${l?G.error:G.focus};
|
|
797
|
+
box-shadow: 0 0 0 3px ${l?G.error+"20":G.focus+"20"};
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
input.has-error {
|
|
801
|
+
border-color: ${G.error};
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.icon {
|
|
805
|
+
position: absolute;
|
|
806
|
+
left: 13px;
|
|
807
|
+
color: #888;
|
|
808
|
+
font-size: 16px;
|
|
809
|
+
pointer-events: none;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.helper-text {
|
|
813
|
+
font-size: 12px;
|
|
814
|
+
margin-top: 4px;
|
|
815
|
+
color: #666;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.error-text {
|
|
819
|
+
font-size: 12px;
|
|
820
|
+
margin-top: 4px;
|
|
821
|
+
color: ${G.error};
|
|
822
|
+
}
|
|
823
|
+
</style>
|
|
824
|
+
|
|
825
|
+
<div class="input-wrapper">
|
|
826
|
+
${o?`<label for="input-${this._uniqueId}">${o}${g?'<span class="required-star">*</span>':""}</label>`:""}
|
|
827
|
+
<div class="input-container">
|
|
828
|
+
${h?`<span class="icon">${h}</span>`:""}
|
|
829
|
+
<input
|
|
830
|
+
id="input-${this._uniqueId}"
|
|
831
|
+
name="${n}"
|
|
832
|
+
type="${t}"
|
|
833
|
+
placeholder="${b}"
|
|
834
|
+
class="${l?"has-error":""}"
|
|
835
|
+
${g?"required":""}
|
|
836
|
+
${_?`aria-label="${_}"`:""}
|
|
837
|
+
${l?'aria-invalid="true"':""}
|
|
838
|
+
${An}
|
|
839
|
+
/>
|
|
840
|
+
</div>
|
|
841
|
+
${l?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${l}</div>`:""}
|
|
842
|
+
${a&&!l?`<div id="helper-${this._uniqueId}" class="helper-text">${a}</div>`:""}
|
|
843
|
+
</div>
|
|
844
|
+
`}};A("af-input",it);vl=it});var W0={};Q(W0,{default:()=>wl,AfriAlert:()=>Tt});var Tt,wl;var O0=Y(()=>{M();Tt=class Tt 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")||"",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=`
|
|
845
|
+
<style>
|
|
846
|
+
:host {
|
|
847
|
+
display: block;
|
|
848
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.alert {
|
|
852
|
+
padding: 13px 21px;
|
|
853
|
+
border-radius: 5px;
|
|
854
|
+
border-left: 4px solid ${l.border};
|
|
855
|
+
background: ${l.bg};
|
|
856
|
+
color: ${l.text};
|
|
857
|
+
display: flex;
|
|
858
|
+
align-items: flex-start;
|
|
859
|
+
gap: 13px;
|
|
860
|
+
animation: slideIn 300ms ease-out;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
@keyframes slideIn {
|
|
864
|
+
from {
|
|
865
|
+
opacity: 0;
|
|
866
|
+
transform: translateY(-10px);
|
|
867
|
+
}
|
|
868
|
+
to {
|
|
869
|
+
opacity: 1;
|
|
870
|
+
transform: translateY(0);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
.icon {
|
|
875
|
+
font-size: 18px;
|
|
876
|
+
flex-shrink: 0;
|
|
877
|
+
width: 24px;
|
|
878
|
+
height: 24px;
|
|
879
|
+
display: flex;
|
|
880
|
+
align-items: center;
|
|
881
|
+
justify-content: center;
|
|
882
|
+
background: ${l.border};
|
|
883
|
+
color: white;
|
|
884
|
+
border-radius: 50%;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.content {
|
|
888
|
+
flex: 1;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.title {
|
|
892
|
+
font-weight: 600;
|
|
893
|
+
margin-bottom: 3px;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
.close-btn {
|
|
897
|
+
background: none;
|
|
898
|
+
border: none;
|
|
899
|
+
font-size: 18px;
|
|
900
|
+
cursor: pointer;
|
|
901
|
+
color: ${l.text};
|
|
902
|
+
opacity: 0.7;
|
|
903
|
+
padding: 0;
|
|
904
|
+
line-height: 1;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.close-btn:hover {
|
|
908
|
+
opacity: 1;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
::slotted(*) {
|
|
912
|
+
margin: 0;
|
|
913
|
+
}
|
|
914
|
+
</style>
|
|
915
|
+
|
|
916
|
+
<div class="alert" role="alert">
|
|
917
|
+
<span class="icon">${l.icon}</span>
|
|
918
|
+
<div class="content">
|
|
919
|
+
${n?`<div class="title">${n}</div>`:""}
|
|
920
|
+
<slot></slot>
|
|
921
|
+
</div>
|
|
922
|
+
${o?'<button class="close-btn" aria-label="Dismiss">×</button>':""}
|
|
923
|
+
</div>
|
|
924
|
+
`}};A("af-alert",Tt);wl=Tt});var m0={};Q(m0,{AfriGrid:()=>yn});function cl(t,n){let{sidebarSide:o="left",sidebarWidth:b="280px",minWidth:l="280px",gap:a="24px",columns:f,rows:h,align:g="stretch",justify:_="stretch",dense:X=!1}=n,L=X?"dense":"",G=`
|
|
925
|
+
align-items: ${g};
|
|
926
|
+
justify-items: ${_};
|
|
927
|
+
gap: ${a};
|
|
928
|
+
`;switch(t){case"sidebar":return o==="right"?`display: grid; grid-template-columns: 1fr ${b}; ${G}`:`display: grid; grid-template-columns: ${b} 1fr; ${G}`;case"holy-grail":return`
|
|
929
|
+
display: grid;
|
|
930
|
+
grid-template-columns: ${b} 1fr ${b};
|
|
931
|
+
grid-template-rows: auto 1fr auto;
|
|
932
|
+
${G}
|
|
933
|
+
`;case"bento":return`
|
|
934
|
+
display: grid;
|
|
935
|
+
grid-template-columns: repeat(12, 1fr);
|
|
936
|
+
grid-auto-rows: minmax(120px, auto);
|
|
937
|
+
grid-auto-flow: row ${L};
|
|
938
|
+
${G}
|
|
939
|
+
`;case"masonry":return`
|
|
940
|
+
display: grid;
|
|
941
|
+
grid-template-columns: repeat(auto-fill, minmax(${l}, 1fr));
|
|
942
|
+
grid-template-rows: masonry;
|
|
943
|
+
grid-auto-flow: row ${L};
|
|
944
|
+
${G}
|
|
945
|
+
`;case"auto":default:{let R=f?`repeat(${f}, 1fr)`:`repeat(auto-fit, minmax(${l}, 1fr))`,An=h?`repeat(${h}, 1fr)`:"auto";return`
|
|
946
|
+
display: grid;
|
|
947
|
+
grid-template-columns: ${R};
|
|
948
|
+
${h?`grid-template-rows: ${An};`:""}
|
|
949
|
+
grid-auto-flow: row ${L};
|
|
950
|
+
${G}
|
|
951
|
+
`}}}var yn;var U0=Y(()=>{M();yn=class yn 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`
|
|
952
|
+
@media (max-width: 768px) {
|
|
953
|
+
.grid {
|
|
954
|
+
grid-template-columns: repeat(auto-fit, minmax(min(${t.minWidth}, 100%), 1fr));
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
@media (max-width: 480px) {
|
|
958
|
+
.grid {
|
|
959
|
+
grid-template-columns: 1fr;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
`}_buildSidebarResponsive(t){if(t.layout!=="sidebar"&&t.layout!=="holy-grail")return"";return`
|
|
963
|
+
@media (max-width: 768px) {
|
|
964
|
+
.grid {
|
|
965
|
+
grid-template-columns: 1fr;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
`}render(){let t=this._getAttrs(),n=cl(t.layout,t),o=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=D`
|
|
969
|
+
<style>
|
|
970
|
+
:host {
|
|
971
|
+
display: block;
|
|
972
|
+
width: 100%;
|
|
973
|
+
box-sizing: border-box;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.grid {
|
|
977
|
+
${n}
|
|
978
|
+
width: 100%;
|
|
979
|
+
box-sizing: border-box;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/* Slotted children base styles */
|
|
983
|
+
::slotted(*) {
|
|
984
|
+
min-width: 0; /* Prevent overflow in grid context */
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
${o}
|
|
988
|
+
</style>
|
|
989
|
+
|
|
990
|
+
<div
|
|
991
|
+
class="grid"
|
|
992
|
+
role="list"
|
|
993
|
+
part="grid"
|
|
994
|
+
aria-label="${this.getAttribute("aria-label")||"Grid layout"}"
|
|
995
|
+
>
|
|
996
|
+
<slot></slot>
|
|
997
|
+
</div>
|
|
998
|
+
`}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",yn)});var d0={};Q(d0,{AfriSection:()=>Zn});var Zn;var V0=Y(()=>{M();Zn=class Zn extends c{render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("title");this.shadowRoot.innerHTML=D`
|
|
999
|
+
<style>
|
|
1000
|
+
:host { display: block; width: 100%; }
|
|
1001
|
+
.section {
|
|
1002
|
+
padding: 100px 5%;
|
|
1003
|
+
max-width: var(--page-max-width, 1280px);
|
|
1004
|
+
margin: 0 auto;
|
|
1005
|
+
}
|
|
1006
|
+
.section-header {
|
|
1007
|
+
text-align: center;
|
|
1008
|
+
margin-bottom: 60px;
|
|
1009
|
+
}
|
|
1010
|
+
.section-header h2 {
|
|
1011
|
+
font-size: 3rem;
|
|
1012
|
+
font-family: 'Outfit', sans-serif;
|
|
1013
|
+
margin: 0;
|
|
1014
|
+
color: var(--text-primary);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
:host([variant="muted"]) { background: var(--bg-surface, rgba(30, 41, 59, 0.3)); }
|
|
1018
|
+
:host([variant="brand"]) {
|
|
1019
|
+
background: linear-gradient(135deg, var(--bg-base) 0%, var(--bg-surface) 100%);
|
|
1020
|
+
border-top: 1px solid var(--glass-border);
|
|
1021
|
+
border-bottom: 1px solid var(--glass-border);
|
|
1022
|
+
}
|
|
1023
|
+
</style>
|
|
1024
|
+
<section class="section">
|
|
1025
|
+
${n?D`
|
|
1026
|
+
<div class="section-header">
|
|
1027
|
+
<h2>${n}</h2>
|
|
1028
|
+
</div>
|
|
1029
|
+
`:""}
|
|
1030
|
+
<slot></slot>
|
|
1031
|
+
</section>
|
|
1032
|
+
`}connectedCallback(){this.render()}};A("af-section",Zn)});var j0={};Q(j0,{default:()=>_l,AfriIcon:()=>Ct});var Ct,_l;var N0=Y(()=>{M();Ct=class Ct extends c{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=`
|
|
1033
|
+
<style>
|
|
1034
|
+
:host { display: inline-flex; vertical-align: middle; }
|
|
1035
|
+
svg { width: ${n}px; height: ${n}px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
1036
|
+
</style>
|
|
1037
|
+
<svg viewBox="0 0 24 24">${b}</svg>
|
|
1038
|
+
`}};A("af-icon",Ct);_l=Ct});var K0={};Q(K0,{default:()=>Al,AfriAccordion:()=>yt});var yt,Al;var p0=Y(()=>{M();yt=class yt 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,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=`
|
|
1039
|
+
<style>
|
|
1040
|
+
:host {
|
|
1041
|
+
display: block;
|
|
1042
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.accordion {
|
|
1046
|
+
border-radius: 8px;
|
|
1047
|
+
overflow: hidden;
|
|
1048
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
.accordion-item {
|
|
1052
|
+
border-bottom: 1px solid #eee;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
.accordion-item:last-child {
|
|
1056
|
+
border-bottom: none;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
.accordion-header {
|
|
1060
|
+
width: 100%;
|
|
1061
|
+
padding: 16px 21px;
|
|
1062
|
+
background: white;
|
|
1063
|
+
border: none;
|
|
1064
|
+
text-align: left;
|
|
1065
|
+
font-family: inherit;
|
|
1066
|
+
font-size: 15px;
|
|
1067
|
+
font-weight: 600;
|
|
1068
|
+
color: #333;
|
|
1069
|
+
cursor: pointer;
|
|
1070
|
+
display: flex;
|
|
1071
|
+
justify-content: space-between;
|
|
1072
|
+
align-items: center;
|
|
1073
|
+
transition: all 200ms ease;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.accordion-header:hover {
|
|
1077
|
+
background: #f8f9fa;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
.accordion-header.active {
|
|
1081
|
+
color: ${l.accent};
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
.accordion-icon {
|
|
1085
|
+
font-size: 12px;
|
|
1086
|
+
transition: transform 300ms ease;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
.accordion-header.active .accordion-icon {
|
|
1090
|
+
transform: rotate(180deg);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
.accordion-content {
|
|
1094
|
+
max-height: 0;
|
|
1095
|
+
overflow: hidden;
|
|
1096
|
+
background: #fafafa;
|
|
1097
|
+
transition: max-height 300ms ease-out;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
.accordion-content.open {
|
|
1101
|
+
max-height: 500px;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
.accordion-body {
|
|
1105
|
+
padding: 16px 21px;
|
|
1106
|
+
color: #555;
|
|
1107
|
+
line-height: 1.6;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
::slotted([slot="items"]) {
|
|
1111
|
+
display: none;
|
|
1112
|
+
}
|
|
1113
|
+
</style>
|
|
1114
|
+
|
|
1115
|
+
<div class="accordion">
|
|
1116
|
+
${o.map((a,f)=>{let h=this._openItems.has(f),g=`accordion-header-${this._uniqueId}-${f}`,_=`accordion-panel-${this._uniqueId}-${f}`;return`
|
|
1117
|
+
<div class="accordion-item">
|
|
1118
|
+
<button
|
|
1119
|
+
class="accordion-header ${h?"active":""}"
|
|
1120
|
+
aria-expanded="${h}"
|
|
1121
|
+
aria-controls="${_}"
|
|
1122
|
+
id="${g}"
|
|
1123
|
+
>
|
|
1124
|
+
<span>${a.getAttribute("title")||`Item ${f+1}`}</span>
|
|
1125
|
+
<span class="accordion-icon">▼</span>
|
|
1126
|
+
</button>
|
|
1127
|
+
<div
|
|
1128
|
+
class="accordion-content ${h?"open":""}"
|
|
1129
|
+
id="${_}"
|
|
1130
|
+
role="region"
|
|
1131
|
+
aria-labelledby="${g}"
|
|
1132
|
+
>
|
|
1133
|
+
<div class="accordion-body">
|
|
1134
|
+
${a.innerHTML}
|
|
1135
|
+
</div>
|
|
1136
|
+
</div>
|
|
1137
|
+
</div>
|
|
1138
|
+
`}).join("")}
|
|
1139
|
+
</div>
|
|
1140
|
+
<slot name="items"></slot>
|
|
1141
|
+
`}};A("af-accordion",yt);Al=yt});var I0={};Q(I0,{default:()=>ql,AfriHero:()=>Zt});var Zt,ql;var u0=Y(()=>{M();Ut();kt();z();Zt=class Zt 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")||"",o=this.getAttribute("pattern")||"",b=this.getAttribute("variant")||"default";this.shadowRoot.innerHTML=`
|
|
1142
|
+
<style>
|
|
1143
|
+
:host {
|
|
1144
|
+
display: flex;
|
|
1145
|
+
flex-direction: column;
|
|
1146
|
+
align-items: center;
|
|
1147
|
+
justify-content: center;
|
|
1148
|
+
text-align: center;
|
|
1149
|
+
padding: 120px 5%;
|
|
1150
|
+
min-height: 60vh;
|
|
1151
|
+
background: var(--bg-base, #020617);
|
|
1152
|
+
color: var(--text-main, white);
|
|
1153
|
+
position: relative;
|
|
1154
|
+
overflow: hidden;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
.content {
|
|
1158
|
+
position: relative;
|
|
1159
|
+
z-index: 10;
|
|
1160
|
+
max-width: 900px;
|
|
1161
|
+
opacity: 0;
|
|
1162
|
+
transform: translateY(20px);
|
|
1163
|
+
animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
@keyframes fadeInUp {
|
|
1167
|
+
to { opacity: 1; transform: translateY(0); }
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
h1 {
|
|
1171
|
+
font-family: 'Outfit', 'Space Grotesk', sans-serif;
|
|
1172
|
+
font-size: clamp(3rem, 8vw, 5rem);
|
|
1173
|
+
font-weight: 900;
|
|
1174
|
+
line-height: 1.1;
|
|
1175
|
+
margin-bottom: 24px;
|
|
1176
|
+
letter-spacing: -0.04em;
|
|
1177
|
+
background: linear-gradient(135deg, var(--text-main, #fff) 30%, var(--text-muted, rgba(255,255,255,0.5)) 100%);
|
|
1178
|
+
-webkit-background-clip: text;
|
|
1179
|
+
-webkit-text-fill-color: transparent;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
p {
|
|
1183
|
+
font-family: 'Inter', sans-serif;
|
|
1184
|
+
font-size: clamp(1.1rem, 2vw, 1.5rem);
|
|
1185
|
+
color: var(--text-secondary, #94a3b8);
|
|
1186
|
+
line-height: 1.5;
|
|
1187
|
+
margin-bottom: 40px;
|
|
1188
|
+
max-width: 700px;
|
|
1189
|
+
margin-left: auto;
|
|
1190
|
+
margin-right: auto;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/* Visual Accents */
|
|
1194
|
+
.aura {
|
|
1195
|
+
position: absolute;
|
|
1196
|
+
inset: 0;
|
|
1197
|
+
background: radial-gradient(circle at 50% -20%, rgba(30,181,58,0.15), transparent 70%);
|
|
1198
|
+
z-index: 1;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
.mesh {
|
|
1202
|
+
position: absolute;
|
|
1203
|
+
inset: 0;
|
|
1204
|
+
background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
|
|
1205
|
+
background-size: 40px 40px;
|
|
1206
|
+
z-index: 2;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
${o?`
|
|
1210
|
+
.pattern-bg {
|
|
1211
|
+
position: absolute;
|
|
1212
|
+
inset: 0;
|
|
1213
|
+
background-image: url('${o}');
|
|
1214
|
+
background-size: cover;
|
|
1215
|
+
background-position: center;
|
|
1216
|
+
opacity: 0.15;
|
|
1217
|
+
z-index: 1;
|
|
1218
|
+
}
|
|
1219
|
+
`:""}
|
|
1220
|
+
|
|
1221
|
+
::slotted([slot="actions"]) {
|
|
1222
|
+
display: flex;
|
|
1223
|
+
gap: 16px;
|
|
1224
|
+
justify-content: center;
|
|
1225
|
+
flex-wrap: wrap;
|
|
1226
|
+
}
|
|
1227
|
+
</style>
|
|
1228
|
+
|
|
1229
|
+
<div class="aura"></div>
|
|
1230
|
+
<div class="mesh"></div>
|
|
1231
|
+
${o?'<div class="pattern-bg"></div>':""}
|
|
1232
|
+
|
|
1233
|
+
<div class="content">
|
|
1234
|
+
<h1>${t}</h1>
|
|
1235
|
+
${n?`<p>${n}</p>`:""}
|
|
1236
|
+
<div class="actions">
|
|
1237
|
+
<slot name="actions"></slot>
|
|
1238
|
+
</div>
|
|
1239
|
+
<slot></slot>
|
|
1240
|
+
</div>
|
|
1241
|
+
`}};A("af-hero",Zt);ql=Zt});var P0={};Q(P0,{default:()=>Hl,AfriTable:()=>et});var et,Hl;var i0=Y(()=>{M();et=class et 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 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,a=this._getSortedData();this.shadowRoot.innerHTML=`
|
|
1242
|
+
<style>
|
|
1243
|
+
:host {
|
|
1244
|
+
display: block;
|
|
1245
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
.table-container {
|
|
1249
|
+
overflow-x: auto;
|
|
1250
|
+
border-radius: 8px;
|
|
1251
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
table {
|
|
1255
|
+
width: 100%;
|
|
1256
|
+
border-collapse: collapse;
|
|
1257
|
+
background: white;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
th {
|
|
1261
|
+
background: ${l.header};
|
|
1262
|
+
color: ${l.text};
|
|
1263
|
+
padding: 13px;
|
|
1264
|
+
text-align: left;
|
|
1265
|
+
font-weight: 600;
|
|
1266
|
+
cursor: pointer;
|
|
1267
|
+
user-select: none;
|
|
1268
|
+
white-space: nowrap;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
th:hover {
|
|
1272
|
+
filter: brightness(1.1);
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
th .sort-icon {
|
|
1276
|
+
margin-left: 5px;
|
|
1277
|
+
opacity: 0.7;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
td {
|
|
1281
|
+
padding: 13px;
|
|
1282
|
+
border-bottom: 1px solid #eee;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
${n?`
|
|
1286
|
+
tbody tr:nth-child(even) {
|
|
1287
|
+
background: #f8f9fa;
|
|
1288
|
+
}
|
|
1289
|
+
`:""}
|
|
1290
|
+
|
|
1291
|
+
${o?`
|
|
1292
|
+
tbody tr:hover {
|
|
1293
|
+
background: ${l.accent}20;
|
|
1294
|
+
}
|
|
1295
|
+
`:""}
|
|
1296
|
+
|
|
1297
|
+
.empty-state {
|
|
1298
|
+
text-align: center;
|
|
1299
|
+
padding: 34px;
|
|
1300
|
+
color: #888;
|
|
1301
|
+
}
|
|
1302
|
+
</style>
|
|
1303
|
+
|
|
1304
|
+
<div class="table-container">
|
|
1305
|
+
<table>
|
|
1306
|
+
<thead>
|
|
1307
|
+
<tr>
|
|
1308
|
+
${this._columns.map((f)=>`
|
|
1309
|
+
<th data-column="${f.key}">
|
|
1310
|
+
${f.label}
|
|
1311
|
+
<span class="sort-icon">
|
|
1312
|
+
${this._sortColumn===f.key?this._sortDirection==="asc"?"↑":"↓":"↕"}
|
|
1313
|
+
</span>
|
|
1314
|
+
</th>
|
|
1315
|
+
`).join("")}
|
|
1316
|
+
</tr>
|
|
1317
|
+
</thead>
|
|
1318
|
+
<tbody>
|
|
1319
|
+
${a.length?a.map((f)=>`
|
|
1320
|
+
<tr>
|
|
1321
|
+
${this._columns.map((h)=>`<td>${f[h.key]??""}</td>`).join("")}
|
|
1322
|
+
</tr>
|
|
1323
|
+
`).join(""):`
|
|
1324
|
+
<tr>
|
|
1325
|
+
<td colspan="${this._columns.length}" class="empty-state">No data available</td>
|
|
1326
|
+
</tr>
|
|
1327
|
+
`}
|
|
1328
|
+
</tbody>
|
|
1329
|
+
</table>
|
|
1330
|
+
</div>
|
|
1331
|
+
`,this.shadowRoot.querySelectorAll("th").forEach((f)=>{f.addEventListener("click",()=>{this._handleSort(f.dataset.column)})})}};A("af-table",et);Hl=et});var T0={};Q(T0,{default:()=>El,AfriModal:()=>st});var st,El;var C0=Y(()=>{M();st=class st 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"])',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,a={sm:"400px",md:"560px",lg:"720px",full:"95vw"},f=this.getAttribute("aria-label"),h=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
|
|
1332
|
+
<style>
|
|
1333
|
+
:host {
|
|
1334
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
.backdrop {
|
|
1338
|
+
position: fixed;
|
|
1339
|
+
inset: 0;
|
|
1340
|
+
background: rgba(0, 0, 0, 0.5);
|
|
1341
|
+
display: ${t?"flex":"none"};
|
|
1342
|
+
align-items: center;
|
|
1343
|
+
justify-content: center;
|
|
1344
|
+
z-index: 10000;
|
|
1345
|
+
animation: fadeIn 200ms ease-out;
|
|
1346
|
+
padding: 21px;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
@keyframes fadeIn {
|
|
1350
|
+
from { opacity: 0; }
|
|
1351
|
+
to { opacity: 1; }
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
.modal {
|
|
1355
|
+
background: white;
|
|
1356
|
+
border-radius: 8px;
|
|
1357
|
+
width: 100%;
|
|
1358
|
+
max-width: ${a[o]||a.md};
|
|
1359
|
+
max-height: 90vh;
|
|
1360
|
+
overflow: hidden;
|
|
1361
|
+
display: flex;
|
|
1362
|
+
flex-direction: column;
|
|
1363
|
+
animation: slideUp 300ms ease-out;
|
|
1364
|
+
box-shadow: 0 10px 40px rgba(0,0,0,0.3);
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
@keyframes slideUp {
|
|
1368
|
+
from {
|
|
1369
|
+
opacity: 0;
|
|
1370
|
+
transform: translateY(20px);
|
|
1371
|
+
}
|
|
1372
|
+
to {
|
|
1373
|
+
opacity: 1;
|
|
1374
|
+
transform: translateY(0);
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
.modal-header {
|
|
1379
|
+
padding: 13px 21px;
|
|
1380
|
+
border-bottom: 1px solid #eee;
|
|
1381
|
+
display: flex;
|
|
1382
|
+
align-items: center;
|
|
1383
|
+
justify-content: space-between;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
.modal-header ::slotted(*) {
|
|
1387
|
+
margin: 0;
|
|
1388
|
+
font-size: 18px;
|
|
1389
|
+
font-weight: 600;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
.close-btn {
|
|
1393
|
+
background: none;
|
|
1394
|
+
border: none;
|
|
1395
|
+
font-size: 24px;
|
|
1396
|
+
cursor: pointer;
|
|
1397
|
+
color: #666;
|
|
1398
|
+
padding: 0;
|
|
1399
|
+
line-height: 1;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
.close-btn:hover {
|
|
1403
|
+
color: ${l.accent};
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
.modal-body {
|
|
1407
|
+
padding: 21px;
|
|
1408
|
+
overflow-y: auto;
|
|
1409
|
+
flex: 1;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
.modal-footer {
|
|
1413
|
+
padding: 13px 21px;
|
|
1414
|
+
border-top: 1px solid #eee;
|
|
1415
|
+
display: flex;
|
|
1416
|
+
gap: 8px;
|
|
1417
|
+
justify-content: flex-end;
|
|
1418
|
+
}
|
|
1419
|
+
</style>
|
|
1420
|
+
|
|
1421
|
+
<div class="backdrop">
|
|
1422
|
+
<div class="modal" role="dialog" aria-modal="true" ${f?`aria-label="${f}"`:`aria-labelledby="${h}"`}>
|
|
1423
|
+
<div class="modal-header">
|
|
1424
|
+
<slot name="header" id="modal-title"></slot>
|
|
1425
|
+
<button class="close-btn" aria-label="Close modal">×</button>
|
|
1426
|
+
</div>
|
|
1427
|
+
<div class="modal-body">
|
|
1428
|
+
<slot></slot>
|
|
1429
|
+
</div>
|
|
1430
|
+
<div class="modal-footer">
|
|
1431
|
+
<slot name="footer"></slot>
|
|
1432
|
+
</div>
|
|
1433
|
+
</div>
|
|
1434
|
+
</div>
|
|
1435
|
+
`}};A("af-modal",st);El=st});var y0={};Q(y0,{default:()=>Yl,AfriTabs:()=>zt});var zt,Yl;var Z0=Y(()=>{M();zt=class zt 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"]'),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=`
|
|
1436
|
+
<style>
|
|
1437
|
+
:host {
|
|
1438
|
+
display: block;
|
|
1439
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
.tabs-container {
|
|
1443
|
+
border-radius: 8px;
|
|
1444
|
+
overflow: hidden;
|
|
1445
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
.tab-list {
|
|
1449
|
+
display: flex;
|
|
1450
|
+
background: #f5f5f5;
|
|
1451
|
+
border-bottom: 2px solid #eee;
|
|
1452
|
+
overflow-x: auto;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
.tab-button {
|
|
1456
|
+
padding: 13px 21px;
|
|
1457
|
+
background: none;
|
|
1458
|
+
border: none;
|
|
1459
|
+
font-family: inherit;
|
|
1460
|
+
font-size: 14px;
|
|
1461
|
+
font-weight: 500;
|
|
1462
|
+
color: #666;
|
|
1463
|
+
cursor: pointer;
|
|
1464
|
+
white-space: nowrap;
|
|
1465
|
+
transition: all 200ms ease;
|
|
1466
|
+
border-bottom: 2px solid transparent;
|
|
1467
|
+
margin-bottom: -2px;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.tab-button:hover {
|
|
1471
|
+
color: ${l.active};
|
|
1472
|
+
background: rgba(0,0,0,0.03);
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
.tab-button.active {
|
|
1476
|
+
color: ${l.active};
|
|
1477
|
+
border-bottom-color: ${l.active};
|
|
1478
|
+
background: white;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
.tab-panels {
|
|
1482
|
+
background: white;
|
|
1483
|
+
padding: 21px;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
.tab-panel {
|
|
1487
|
+
display: none;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.tab-panel.active {
|
|
1491
|
+
display: block;
|
|
1492
|
+
animation: fadeIn 200ms ease-out;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
@keyframes fadeIn {
|
|
1496
|
+
from { opacity: 0; }
|
|
1497
|
+
to { opacity: 1; }
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
::slotted([slot="tabs"]) {
|
|
1501
|
+
display: none;
|
|
1502
|
+
}
|
|
1503
|
+
</style>
|
|
1504
|
+
|
|
1505
|
+
<div class="tabs-container">
|
|
1506
|
+
<div class="tab-list" role="tablist">
|
|
1507
|
+
${o.map((a,f)=>`
|
|
1508
|
+
<button class="tab-button ${f===this._activeTab?"active":""}"
|
|
1509
|
+
role="tab"
|
|
1510
|
+
aria-selected="${f===this._activeTab}"
|
|
1511
|
+
aria-controls="panel-${f}"
|
|
1512
|
+
tabindex="${f===this._activeTab?"0":"-1"}"
|
|
1513
|
+
id="tab-${f}">
|
|
1514
|
+
${a.getAttribute("label")||`Tab ${f+1}`}
|
|
1515
|
+
</button>
|
|
1516
|
+
`).join("")}
|
|
1517
|
+
</div>
|
|
1518
|
+
<div class="tab-panels">
|
|
1519
|
+
${o.map((a,f)=>`
|
|
1520
|
+
<div class="tab-panel ${f===this._activeTab?"active":""}"
|
|
1521
|
+
role="tabpanel"
|
|
1522
|
+
id="panel-${f}"
|
|
1523
|
+
aria-labelledby="tab-${f}">
|
|
1524
|
+
${a.innerHTML}
|
|
1525
|
+
</div>
|
|
1526
|
+
`).join("")}
|
|
1527
|
+
</div>
|
|
1528
|
+
</div>
|
|
1529
|
+
<slot name="tabs"></slot>
|
|
1530
|
+
`}};A("af-tabs",zt);Yl=zt});var e0={};Q(e0,{default:()=>xl,AfriSidebar:()=>tn});var tn,xl;var s0=Y(()=>{M();kt();z();tn=class tn extends c{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=T(()=>{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=`
|
|
1531
|
+
<style>
|
|
1532
|
+
:host {
|
|
1533
|
+
display: block;
|
|
1534
|
+
position: fixed;
|
|
1535
|
+
top: 0;
|
|
1536
|
+
${t}: 0;
|
|
1537
|
+
height: 100vh;
|
|
1538
|
+
z-index: 900;
|
|
1539
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
.sidebar {
|
|
1543
|
+
width: ${n?"60px":"260px"};
|
|
1544
|
+
height: 100%;
|
|
1545
|
+
background: #121212;
|
|
1546
|
+
border-${t==="left"?"right":"left"}: 1px solid #1e1e1e;
|
|
1547
|
+
display: flex;
|
|
1548
|
+
flex-direction: column;
|
|
1549
|
+
transition: width 0.3s var(--ease-drum, ease);
|
|
1550
|
+
overflow: hidden;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
.sidebar-header {
|
|
1554
|
+
padding: 20px;
|
|
1555
|
+
border-bottom: 1px solid #1e1e1e;
|
|
1556
|
+
display: flex;
|
|
1557
|
+
align-items: center;
|
|
1558
|
+
gap: 12px;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
.sidebar-logo {
|
|
1562
|
+
width: 32px;
|
|
1563
|
+
height: 32px;
|
|
1564
|
+
background: linear-gradient(135deg, #1EB53A, #FCD116);
|
|
1565
|
+
border-radius: 8px;
|
|
1566
|
+
flex-shrink: 0;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
.sidebar-title {
|
|
1570
|
+
font-weight: 700;
|
|
1571
|
+
font-size: 1.1rem;
|
|
1572
|
+
color: #FCD116;
|
|
1573
|
+
white-space: nowrap;
|
|
1574
|
+
opacity: ${n?0:1};
|
|
1575
|
+
transition: opacity 0.2s;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
.sidebar-content {
|
|
1579
|
+
flex: 1;
|
|
1580
|
+
padding: ${n?"12px":"20px"};
|
|
1581
|
+
overflow-y: auto;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
.sidebar-footer {
|
|
1585
|
+
padding: 16px;
|
|
1586
|
+
border-top: 1px solid #1e1e1e;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
.toggle-btn {
|
|
1590
|
+
width: 100%;
|
|
1591
|
+
padding: 10px;
|
|
1592
|
+
background: #1e1e1e;
|
|
1593
|
+
border: none;
|
|
1594
|
+
border-radius: 8px;
|
|
1595
|
+
color: #a0a0a0;
|
|
1596
|
+
cursor: pointer;
|
|
1597
|
+
font-size: 0.85rem;
|
|
1598
|
+
transition: all 0.2s;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
.toggle-btn:hover {
|
|
1602
|
+
background: #2a2a2a;
|
|
1603
|
+
color: #1EB53A;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
/* Slotted Content Styles */
|
|
1607
|
+
::slotted(a), ::slotted(button) {
|
|
1608
|
+
display: flex;
|
|
1609
|
+
align-items: center;
|
|
1610
|
+
gap: 12px;
|
|
1611
|
+
padding: 12px 16px;
|
|
1612
|
+
color: #a0a0a0;
|
|
1613
|
+
text-decoration: none;
|
|
1614
|
+
border-radius: 8px;
|
|
1615
|
+
margin-bottom: 4px;
|
|
1616
|
+
transition: all 0.2s;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
::slotted(a:hover), ::slotted(button:hover) {
|
|
1620
|
+
background: #1e1e1e;
|
|
1621
|
+
color: #1EB53A;
|
|
1622
|
+
}
|
|
1623
|
+
</style>
|
|
1624
|
+
|
|
1625
|
+
<aside class="sidebar">
|
|
1626
|
+
<div class="sidebar-header">
|
|
1627
|
+
<div class="sidebar-logo"></div>
|
|
1628
|
+
<span class="sidebar-title">AfriCode</span>
|
|
1629
|
+
</div>
|
|
1630
|
+
<nav class="sidebar-content">
|
|
1631
|
+
<slot></slot>
|
|
1632
|
+
</nav>
|
|
1633
|
+
<div class="sidebar-footer">
|
|
1634
|
+
<button class="toggle-btn" id="toggle">
|
|
1635
|
+
${n?"→":"← Collapse"}
|
|
1636
|
+
</button>
|
|
1637
|
+
</div>
|
|
1638
|
+
</aside>
|
|
1639
|
+
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};A("af-sidebar",tn);xl=tn});var z0={};Q(z0,{default:()=>kl,AfriDropdown:()=>nn});var nn,kl;var to=Y(()=>{M();nn=class nn 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=`
|
|
1640
|
+
<style>
|
|
1641
|
+
:host {
|
|
1642
|
+
display: inline-block;
|
|
1643
|
+
position: relative;
|
|
1644
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
.dropdown-trigger {
|
|
1648
|
+
display: flex;
|
|
1649
|
+
align-items: center;
|
|
1650
|
+
gap: 8px;
|
|
1651
|
+
padding: 10px 16px;
|
|
1652
|
+
background: #1e1e1e;
|
|
1653
|
+
border: 1px solid #2a2a2a;
|
|
1654
|
+
border-radius: 8px;
|
|
1655
|
+
color: #ffffff;
|
|
1656
|
+
font-size: 0.9rem;
|
|
1657
|
+
cursor: pointer;
|
|
1658
|
+
transition: all 0.2s;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
.dropdown-trigger:hover {
|
|
1662
|
+
border-color: #1EB53A;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
.dropdown-arrow {
|
|
1666
|
+
transition: transform 0.2s;
|
|
1667
|
+
${n?"transform: rotate(180deg);":""}
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
.dropdown-menu {
|
|
1671
|
+
position: absolute;
|
|
1672
|
+
top: 100%;
|
|
1673
|
+
left: 0;
|
|
1674
|
+
min-width: 180px;
|
|
1675
|
+
margin-top: 4px;
|
|
1676
|
+
background: #121212;
|
|
1677
|
+
border: 1px solid #1e1e1e;
|
|
1678
|
+
border-radius: 8px;
|
|
1679
|
+
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
|
|
1680
|
+
opacity: ${n?1:0};
|
|
1681
|
+
visibility: ${n?"visible":"hidden"};
|
|
1682
|
+
transform: translateY(${n?0:"-10px"});
|
|
1683
|
+
transition: all 0.2s ease;
|
|
1684
|
+
z-index: 1000;
|
|
1685
|
+
overflow: hidden;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
::slotted(a), ::slotted(button), ::slotted(div) {
|
|
1689
|
+
display: block;
|
|
1690
|
+
padding: 12px 16px;
|
|
1691
|
+
color: #a0a0a0;
|
|
1692
|
+
text-decoration: none;
|
|
1693
|
+
border: none;
|
|
1694
|
+
background: none;
|
|
1695
|
+
width: 100%;
|
|
1696
|
+
text-align: left;
|
|
1697
|
+
font-size: 0.9rem;
|
|
1698
|
+
cursor: pointer;
|
|
1699
|
+
transition: all 0.15s;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
::slotted(a:hover), ::slotted(button:hover), ::slotted(div:hover) {
|
|
1703
|
+
background: #1e1e1e;
|
|
1704
|
+
color: #1EB53A;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
::slotted(hr) {
|
|
1708
|
+
border: none;
|
|
1709
|
+
border-top: 1px solid #1e1e1e;
|
|
1710
|
+
margin: 4px 0;
|
|
1711
|
+
}
|
|
1712
|
+
</style>
|
|
1713
|
+
|
|
1714
|
+
<button class="dropdown-trigger" id="trigger" aria-expanded="${n}" aria-haspopup="menu">
|
|
1715
|
+
${t}
|
|
1716
|
+
<span class="dropdown-arrow" aria-hidden="true">▼</span>
|
|
1717
|
+
</button>
|
|
1718
|
+
<div class="dropdown-menu" role="menu" ${n?"":'aria-hidden="true"'}>
|
|
1719
|
+
<slot></slot>
|
|
1720
|
+
</div>
|
|
1721
|
+
`,this.shadowRoot.getElementById("trigger").addEventListener("click",(o)=>{o.stopPropagation(),this.toggle()})}};A("af-dropdown",nn);kl=nn});var no={};Q(no,{default:()=>Xl,AfriSelect:()=>on});var on,Xl;var oo=Y(()=>{M();on=class on 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",(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"),a=this.getAttribute("aria-label"),f=this.getAttribute("aria-describedby"),h={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},g=h[o]||h.tanzania,_=[];if(b)_.push(`error-${this._uniqueId}`);if(f)_.push(...f.split(" "));let X=_.length>0?`aria-describedby="${_.join(" ")}"`:"",L=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
|
|
1722
|
+
<style>
|
|
1723
|
+
:host {
|
|
1724
|
+
display: block;
|
|
1725
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1726
|
+
position: relative;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
label {
|
|
1730
|
+
display: block;
|
|
1731
|
+
font-weight: 500;
|
|
1732
|
+
margin-bottom: 5px;
|
|
1733
|
+
color: #333;
|
|
1734
|
+
font-size: 14px;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
.required-star {
|
|
1738
|
+
color: ${g.error};
|
|
1739
|
+
margin-left: 2px;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
.select-container {
|
|
1743
|
+
position: relative;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
.select-trigger {
|
|
1747
|
+
width: 100%;
|
|
1748
|
+
padding: 10px 40px 10px 13px;
|
|
1749
|
+
font-size: 15px;
|
|
1750
|
+
border: 2px solid ${b?g.error:"#ddd"};
|
|
1751
|
+
border-radius: 5px;
|
|
1752
|
+
background: white;
|
|
1753
|
+
cursor: pointer;
|
|
1754
|
+
text-align: left;
|
|
1755
|
+
font-family: inherit;
|
|
1756
|
+
transition: all 200ms ease;
|
|
1757
|
+
color: ${this._selectedIndex>=0?"#333":"#888"};
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
.select-trigger:focus,
|
|
1761
|
+
.select-trigger.open {
|
|
1762
|
+
outline: none;
|
|
1763
|
+
border-color: ${b?g.error:g.focus};
|
|
1764
|
+
box-shadow: 0 0 0 3px ${b?g.error+"20":g.focus+"20"};
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
.select-arrow {
|
|
1768
|
+
position: absolute;
|
|
1769
|
+
right: 13px;
|
|
1770
|
+
top: 50%;
|
|
1771
|
+
transform: translateY(-50%);
|
|
1772
|
+
pointer-events: none;
|
|
1773
|
+
transition: transform 200ms ease;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
.select-trigger.open + .select-arrow {
|
|
1777
|
+
transform: translateY(-50%) rotate(180deg);
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
.select-dropdown {
|
|
1781
|
+
position: absolute;
|
|
1782
|
+
top: 100%;
|
|
1783
|
+
left: 0;
|
|
1784
|
+
right: 0;
|
|
1785
|
+
background: white;
|
|
1786
|
+
border: 2px solid #ddd;
|
|
1787
|
+
border-radius: 5px;
|
|
1788
|
+
margin-top: 4px;
|
|
1789
|
+
max-height: 0;
|
|
1790
|
+
overflow: hidden;
|
|
1791
|
+
opacity: 0;
|
|
1792
|
+
transition: all 200ms ease;
|
|
1793
|
+
z-index: 1000;
|
|
1794
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
.select-dropdown.open {
|
|
1798
|
+
max-height: 200px;
|
|
1799
|
+
overflow-y: auto;
|
|
1800
|
+
opacity: 1;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
.select-option {
|
|
1804
|
+
padding: 10px 13px;
|
|
1805
|
+
cursor: pointer;
|
|
1806
|
+
transition: background 150ms ease;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
.select-option:hover {
|
|
1810
|
+
background: ${g.focus}15;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
.select-option.selected {
|
|
1814
|
+
background: ${g.focus};
|
|
1815
|
+
color: white;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
.error-text {
|
|
1819
|
+
font-size: 12px;
|
|
1820
|
+
margin-top: 4px;
|
|
1821
|
+
color: ${g.error};
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
::slotted(option) {
|
|
1825
|
+
display: none;
|
|
1826
|
+
}
|
|
1827
|
+
</style>
|
|
1828
|
+
|
|
1829
|
+
${t?`<label for="select-${this._uniqueId}">${t}${l?'<span class="required-star">*</span>':""}</label>`:""}
|
|
1830
|
+
<div class="select-container">
|
|
1831
|
+
<button type="button"
|
|
1832
|
+
id="select-${this._uniqueId}"
|
|
1833
|
+
class="select-trigger ${this._isOpen?"open":""}"
|
|
1834
|
+
aria-expanded="${this._isOpen}"
|
|
1835
|
+
aria-haspopup="listbox"
|
|
1836
|
+
${a?`aria-label="${a}"`:""}
|
|
1837
|
+
${b?'aria-invalid="true"':""}
|
|
1838
|
+
${X}>
|
|
1839
|
+
${L}
|
|
1840
|
+
</button>
|
|
1841
|
+
<span class="select-arrow" aria-hidden="true">▼</span>
|
|
1842
|
+
<div class="select-dropdown ${this._isOpen?"open":""}"
|
|
1843
|
+
role="listbox"
|
|
1844
|
+
aria-hidden="${!this._isOpen}">
|
|
1845
|
+
${this._options.map((G,R)=>`
|
|
1846
|
+
<div class="select-option ${R===this._selectedIndex?"selected":""}"
|
|
1847
|
+
data-index="${R}"
|
|
1848
|
+
role="option"
|
|
1849
|
+
aria-selected="${R===this._selectedIndex}">
|
|
1850
|
+
${G.label}
|
|
1851
|
+
</div>
|
|
1852
|
+
`).join("")}
|
|
1853
|
+
</div>
|
|
1854
|
+
</div>
|
|
1855
|
+
${b?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${b}</div>`:""}
|
|
1856
|
+
<slot></slot>
|
|
1857
|
+
`}};A("af-select",on);Xl=on});var bo={};Q(bo,{default:()=>Sl,AfriForm:()=>bn});var bn,Sl;var lo=Y(()=>{M();Cn();bn=class bn 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,o=this.querySelector('[type="submit"]')||this.shadowRoot.querySelector('button[type="submit"]'),b=this.getAttribute("schema"),l=b?this._getSchema(b):null,a=this.getAttribute("action"),f=this.getAttribute("method")||"GET",h=new FormData(n),g=Object.fromEntries(h.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((X)=>{let L=X.getAttribute("name");if(L)g[L]=X.value}),l){let X=Dt.validate(l,g);if(!X.success){this._showValidationErrors(X.errors),this.emit("af-validation-error",{errors:X.errors});return}}if(!a)return;if(o){var _=o.textContent;o.textContent="Wait...",o.disabled=!0}try{let X=await fetch(a,{method:f,headers:{"Content-Type":"application/json"},body:JSON.stringify(g)});if(X.ok)this.emit("success",await X.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let L=await X.text();this.emit("error",L),this.setAttribute("error",L),this.removeAttribute("success")}}catch(X){this.emit("error",X.message),this.setAttribute("error",X.message),this.removeAttribute("success")}finally{if(o)o.textContent=_,o.disabled=!1}}_getSchema(t){return B0[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",bn);Sl=bn});var ao={};Q(ao,{default:()=>Ml,AfriTooltip:()=>ln});var ln,Ml;var fo=Y(()=>{M();ln=class ln 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",o={top:`
|
|
1858
|
+
bottom: 100%;
|
|
1859
|
+
left: 50%;
|
|
1860
|
+
transform: translateX(-50%) translateY(-8px);
|
|
1861
|
+
`,bottom:`
|
|
1862
|
+
top: 100%;
|
|
1863
|
+
left: 50%;
|
|
1864
|
+
transform: translateX(-50%) translateY(8px);
|
|
1865
|
+
`,left:`
|
|
1866
|
+
right: 100%;
|
|
1867
|
+
top: 50%;
|
|
1868
|
+
transform: translateY(-50%) translateX(-8px);
|
|
1869
|
+
`,right:`
|
|
1870
|
+
left: 100%;
|
|
1871
|
+
top: 50%;
|
|
1872
|
+
transform: translateY(-50%) translateX(8px);
|
|
1873
|
+
`};this.shadowRoot.innerHTML=`
|
|
1874
|
+
<style>
|
|
1875
|
+
:host {
|
|
1876
|
+
display: inline-block;
|
|
1877
|
+
position: relative;
|
|
1878
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
.tooltip-trigger {
|
|
1882
|
+
display: inline-block;
|
|
1883
|
+
cursor: help;
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
.tooltip-content {
|
|
1887
|
+
position: absolute;
|
|
1888
|
+
${o[n]}
|
|
1889
|
+
padding: 8px 12px;
|
|
1890
|
+
background: #1e1e1e;
|
|
1891
|
+
border: 1px solid #2a2a2a;
|
|
1892
|
+
border-radius: 6px;
|
|
1893
|
+
color: #ffffff;
|
|
1894
|
+
font-size: 0.85rem;
|
|
1895
|
+
white-space: nowrap;
|
|
1896
|
+
opacity: 0;
|
|
1897
|
+
visibility: hidden;
|
|
1898
|
+
transition: all 0.2s ease;
|
|
1899
|
+
z-index: 1000;
|
|
1900
|
+
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
.tooltip-trigger:hover + .tooltip-content,
|
|
1904
|
+
.tooltip-trigger:focus + .tooltip-content,
|
|
1905
|
+
.tooltip-content:hover {
|
|
1906
|
+
opacity: 1;
|
|
1907
|
+
visibility: visible;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
/* Arrow */
|
|
1911
|
+
.tooltip-content::after {
|
|
1912
|
+
content: '';
|
|
1913
|
+
position: absolute;
|
|
1914
|
+
border: 6px solid transparent;
|
|
1915
|
+
${n==="top"?`
|
|
1916
|
+
top: 100%;
|
|
1917
|
+
left: 50%;
|
|
1918
|
+
transform: translateX(-50%);
|
|
1919
|
+
border-top-color: #1e1e1e;
|
|
1920
|
+
`:""}
|
|
1921
|
+
${n==="bottom"?`
|
|
1922
|
+
bottom: 100%;
|
|
1923
|
+
left: 50%;
|
|
1924
|
+
transform: translateX(-50%);
|
|
1925
|
+
border-bottom-color: #1e1e1e;
|
|
1926
|
+
`:""}
|
|
1927
|
+
${n==="left"?`
|
|
1928
|
+
left: 100%;
|
|
1929
|
+
top: 50%;
|
|
1930
|
+
transform: translateY(-50%);
|
|
1931
|
+
border-left-color: #1e1e1e;
|
|
1932
|
+
`:""}
|
|
1933
|
+
${n==="right"?`
|
|
1934
|
+
right: 100%;
|
|
1935
|
+
top: 50%;
|
|
1936
|
+
transform: translateY(-50%);
|
|
1937
|
+
border-right-color: #1e1e1e;
|
|
1938
|
+
`:""}
|
|
1939
|
+
}
|
|
1940
|
+
</style>
|
|
1941
|
+
|
|
1942
|
+
<span class="tooltip-trigger" tabindex="0" aria-describedby="${this._tooltipId}">
|
|
1943
|
+
<slot></slot>
|
|
1944
|
+
</span>
|
|
1945
|
+
<div class="tooltip-content" id="${this._tooltipId}" role="tooltip" aria-hidden="true">${t}</div>
|
|
1946
|
+
`}};A("af-tooltip",ln);Ml=ln});var ho={};Q(ho,{default:()=>Ql,AfriToast:()=>an});var an,Ql;var go=Y(()=>{M();an=class an extends c{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=`
|
|
1947
|
+
<style>
|
|
1948
|
+
:host {
|
|
1949
|
+
position: fixed;
|
|
1950
|
+
bottom: 20px;
|
|
1951
|
+
right: 20px;
|
|
1952
|
+
z-index: 9999;
|
|
1953
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
.toast {
|
|
1957
|
+
display: flex;
|
|
1958
|
+
align-items: center;
|
|
1959
|
+
gap: 12px;
|
|
1960
|
+
padding: 16px 20px;
|
|
1961
|
+
background: #121212;
|
|
1962
|
+
border: 1px solid #1e1e1e;
|
|
1963
|
+
border-left: 4px solid ${b[t]};
|
|
1964
|
+
border-radius: 8px;
|
|
1965
|
+
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
|
|
1966
|
+
transform: translateX(120%);
|
|
1967
|
+
opacity: 0;
|
|
1968
|
+
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
.toast.show {
|
|
1972
|
+
transform: translateX(0);
|
|
1973
|
+
opacity: 1;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
.toast-icon {
|
|
1977
|
+
width: 28px;
|
|
1978
|
+
height: 28px;
|
|
1979
|
+
border-radius: 50%;
|
|
1980
|
+
background: ${b[t]}20;
|
|
1981
|
+
color: ${b[t]};
|
|
1982
|
+
display: flex;
|
|
1983
|
+
align-items: center;
|
|
1984
|
+
justify-content: center;
|
|
1985
|
+
font-size: 14px;
|
|
1986
|
+
font-weight: bold;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
.toast-content {
|
|
1990
|
+
flex: 1;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
.toast-message {
|
|
1994
|
+
color: #ffffff;
|
|
1995
|
+
font-size: 0.95rem;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
.toast-close {
|
|
1999
|
+
background: none;
|
|
2000
|
+
border: none;
|
|
2001
|
+
color: #606060;
|
|
2002
|
+
cursor: pointer;
|
|
2003
|
+
padding: 4px;
|
|
2004
|
+
font-size: 18px;
|
|
2005
|
+
line-height: 1;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
.toast-close:hover {
|
|
2009
|
+
color: #ffffff;
|
|
2010
|
+
}
|
|
2011
|
+
</style>
|
|
2012
|
+
|
|
2013
|
+
<div class="toast">
|
|
2014
|
+
<span class="toast-icon">${o[t]}</span>
|
|
2015
|
+
<div class="toast-content">
|
|
2016
|
+
<div class="toast-message">${n}</div>
|
|
2017
|
+
</div>
|
|
2018
|
+
<button class="toast-close" id="close">×</button>
|
|
2019
|
+
</div>
|
|
2020
|
+
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};A("af-toast",an);Ql=an});var ro={};Q(ro,{default:()=>Jl,AfriBadge:()=>fn});var fn,Jl;var $o=Y(()=>{M();fn=class fn 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",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,a={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},f=a[n]||a.md;this.shadowRoot.innerHTML=`
|
|
2021
|
+
<style>
|
|
2022
|
+
:host {
|
|
2023
|
+
display: inline-block;
|
|
2024
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
.badge {
|
|
2028
|
+
display: inline-flex;
|
|
2029
|
+
align-items: center;
|
|
2030
|
+
gap: 5px;
|
|
2031
|
+
padding: ${f.padding};
|
|
2032
|
+
font-size: ${f.fontSize};
|
|
2033
|
+
font-weight: 600;
|
|
2034
|
+
background: ${l.bg};
|
|
2035
|
+
color: ${l.text};
|
|
2036
|
+
border-radius: 100px;
|
|
2037
|
+
white-space: nowrap;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
.remove-btn {
|
|
2041
|
+
background: none;
|
|
2042
|
+
border: none;
|
|
2043
|
+
cursor: pointer;
|
|
2044
|
+
padding: 0;
|
|
2045
|
+
font-size: 14px;
|
|
2046
|
+
line-height: 1;
|
|
2047
|
+
color: inherit;
|
|
2048
|
+
opacity: 0.7;
|
|
2049
|
+
margin-left: 2px;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
.remove-btn:hover {
|
|
2053
|
+
opacity: 1;
|
|
2054
|
+
}
|
|
2055
|
+
</style>
|
|
2056
|
+
|
|
2057
|
+
<span class="badge">
|
|
2058
|
+
<slot></slot>
|
|
2059
|
+
${o?'<button class="remove-btn" aria-label="Remove">×</button>':""}
|
|
2060
|
+
</span>
|
|
2061
|
+
`}};A("af-badge",fn);Jl=fn});var vo={};Q(vo,{default:()=>Gl,AfriAvatar:()=>hn});var hn,Gl;var wo=Y(()=>{M();hn=class hn 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")||"",o=this.getAttribute("size")||"md",b=this.getAttribute("status"),l=this.getAttribute("theme")||"tanzania",a={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},f=a[l]||a.tanzania,h={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=h[o]||h.md,_={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
|
|
2062
|
+
<style>
|
|
2063
|
+
:host {
|
|
2064
|
+
display: inline-block;
|
|
2065
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
.avatar {
|
|
2069
|
+
position: relative;
|
|
2070
|
+
width: ${g.size};
|
|
2071
|
+
height: ${g.size};
|
|
2072
|
+
border-radius: 50%;
|
|
2073
|
+
display: flex;
|
|
2074
|
+
align-items: center;
|
|
2075
|
+
justify-content: center;
|
|
2076
|
+
background: ${f};
|
|
2077
|
+
color: white;
|
|
2078
|
+
font-weight: 600;
|
|
2079
|
+
font-size: ${g.font};
|
|
2080
|
+
overflow: hidden;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
.avatar img {
|
|
2084
|
+
width: 100%;
|
|
2085
|
+
height: 100%;
|
|
2086
|
+
object-fit: cover;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
.status {
|
|
2090
|
+
position: absolute;
|
|
2091
|
+
bottom: 0;
|
|
2092
|
+
right: 0;
|
|
2093
|
+
width: ${g.status};
|
|
2094
|
+
height: ${g.status};
|
|
2095
|
+
border-radius: 50%;
|
|
2096
|
+
border: 2px solid white;
|
|
2097
|
+
background: ${b?_[b]||_.offline:"transparent"};
|
|
2098
|
+
}
|
|
2099
|
+
</style>
|
|
2100
|
+
|
|
2101
|
+
<div class="avatar" title="${n}">
|
|
2102
|
+
${t?`<img src="${t}" alt="${n}" />`:this._getInitials(n)}
|
|
2103
|
+
${b?'<span class="status"></span>':""}
|
|
2104
|
+
</div>
|
|
2105
|
+
`}};A("af-avatar",hn);Gl=hn});var co={};Q(co,{default:()=>Ll,AfriProgress:()=>gn});var gn,Ll;var _o=Y(()=>{M();gn=class gn 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,o=this.getAttribute("theme")||"tanzania",b=this.getAttribute("size")||"md",l=this.getAttribute("label"),a=this.hasAttribute("animated"),f=Math.min(100,Math.max(0,t/n*100)),h={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=h[o]||h.tanzania,_={sm:"6px",md:"10px",lg:"16px"},X=_[b]||_.md;this.shadowRoot.innerHTML=`
|
|
2106
|
+
<style>
|
|
2107
|
+
:host {
|
|
2108
|
+
display: block;
|
|
2109
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
.progress-container {
|
|
2113
|
+
width: 100%;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
.progress-header {
|
|
2117
|
+
display: flex;
|
|
2118
|
+
justify-content: space-between;
|
|
2119
|
+
margin-bottom: 5px;
|
|
2120
|
+
font-size: 13px;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
.progress-label {
|
|
2124
|
+
color: #333;
|
|
2125
|
+
font-weight: 500;
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
.progress-value {
|
|
2129
|
+
color: #666;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
.progress-track {
|
|
2133
|
+
width: 100%;
|
|
2134
|
+
height: ${X};
|
|
2135
|
+
background: ${g.track};
|
|
2136
|
+
border-radius: 100px;
|
|
2137
|
+
overflow: hidden;
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
.progress-bar {
|
|
2141
|
+
height: 100%;
|
|
2142
|
+
width: ${f}%;
|
|
2143
|
+
background: ${g.bar};
|
|
2144
|
+
border-radius: 100px;
|
|
2145
|
+
transition: width 500ms ease-out;
|
|
2146
|
+
${a?`
|
|
2147
|
+
background-size: 30px 30px;
|
|
2148
|
+
background-image: linear-gradient(
|
|
2149
|
+
135deg,
|
|
2150
|
+
rgba(255,255,255,0.2) 25%,
|
|
2151
|
+
transparent 25%,
|
|
2152
|
+
transparent 50%,
|
|
2153
|
+
rgba(255,255,255,0.2) 50%,
|
|
2154
|
+
rgba(255,255,255,0.2) 75%,
|
|
2155
|
+
transparent 75%,
|
|
2156
|
+
transparent
|
|
2157
|
+
);
|
|
2158
|
+
animation: stripes 1s linear infinite;
|
|
2159
|
+
`:""}
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
@keyframes stripes {
|
|
2163
|
+
0% { background-position: 0 0; }
|
|
2164
|
+
100% { background-position: 30px 0; }
|
|
2165
|
+
}
|
|
2166
|
+
</style>
|
|
2167
|
+
|
|
2168
|
+
<div class="progress-container">
|
|
2169
|
+
${`
|
|
2170
|
+
<div class="progress-header">
|
|
2171
|
+
<span class="progress-label">${l||""}</span>
|
|
2172
|
+
<span class="progress-value">${f.toFixed(0)}%</span>
|
|
2173
|
+
</div>
|
|
2174
|
+
`}
|
|
2175
|
+
<div class="progress-track">
|
|
2176
|
+
<div class="progress-bar" role="progressbar"
|
|
2177
|
+
aria-valuenow="${t}"
|
|
2178
|
+
aria-valuemin="0"
|
|
2179
|
+
aria-valuemax="${n}"></div>
|
|
2180
|
+
</div>
|
|
2181
|
+
</div>
|
|
2182
|
+
`}};A("af-progress",gn);Ll=gn});var Ao={};Q(Ao,{default:()=>Fl,AfriLoader:()=>rn});var rn,Fl;var qo=Y(()=>{M();rn=class rn 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",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
|
|
2183
|
+
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=`
|
|
2184
|
+
<style>
|
|
2185
|
+
:host {
|
|
2186
|
+
display: inline-block;
|
|
2187
|
+
color: ${n};
|
|
2188
|
+
}
|
|
2189
|
+
.loader {
|
|
2190
|
+
width: ${t}px;
|
|
2191
|
+
height: ${t}px;
|
|
2192
|
+
animation: spin 1.5s linear infinite;
|
|
2193
|
+
}
|
|
2194
|
+
svg {
|
|
2195
|
+
width: 100%;
|
|
2196
|
+
height: 100%;
|
|
2197
|
+
}
|
|
2198
|
+
@keyframes spin {
|
|
2199
|
+
100% { transform: rotate(360deg); }
|
|
2200
|
+
}
|
|
2201
|
+
circle {
|
|
2202
|
+
opacity: 0.25;
|
|
2203
|
+
}
|
|
2204
|
+
path, line, rect {
|
|
2205
|
+
opacity: 0.75;
|
|
2206
|
+
}
|
|
2207
|
+
</style>
|
|
2208
|
+
<div class="loader">
|
|
2209
|
+
<svg viewBox="0 0 50 50">
|
|
2210
|
+
${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" />`}
|
|
2211
|
+
</svg>
|
|
2212
|
+
</div>
|
|
2213
|
+
`}};A("af-loader",rn);Fl=rn});var Ho={};Q(Ho,{default:()=>Bl,AfriSkeleton:()=>$n});var $n,Bl;var Eo=Y(()=>{M();$n=class $n 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%",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"}},a=l[t]||l.text;this.shadowRoot.innerHTML=`
|
|
2214
|
+
<style>
|
|
2215
|
+
:host {
|
|
2216
|
+
display: block;
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
.skeleton {
|
|
2220
|
+
background: linear-gradient(
|
|
2221
|
+
90deg,
|
|
2222
|
+
#1e1e1e 0%,
|
|
2223
|
+
#2a2a2a 50%,
|
|
2224
|
+
#1e1e1e 100%
|
|
2225
|
+
);
|
|
2226
|
+
background-size: 200% 100%;
|
|
2227
|
+
animation: shimmer 1.5s infinite;
|
|
2228
|
+
border-radius: ${a.borderRadius};
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
@keyframes shimmer {
|
|
2232
|
+
0% { background-position: 200% 0; }
|
|
2233
|
+
100% { background-position: -200% 0; }
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
.skeleton-line {
|
|
2237
|
+
width: ${t==="text"?n:a.width||n};
|
|
2238
|
+
height: ${a.height};
|
|
2239
|
+
margin-bottom: 8px;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
.skeleton-line:last-child {
|
|
2243
|
+
margin-bottom: 0;
|
|
2244
|
+
width: ${t==="text"?"70%":"100%"};
|
|
2245
|
+
}
|
|
2246
|
+
</style>
|
|
2247
|
+
|
|
2248
|
+
${t==="text"||t==="title"?Array(b).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${a.width||n}; height: ${a.height||o};"></div>`}
|
|
2249
|
+
`}};A("af-skeleton",$n);Bl=$n});var Yo={};Q(Yo,{default:()=>Rl,AfriDivider:()=>vn});var vn,Rl;var xo=Y(()=>{M();vn=class vn extends c{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}
|
|
2250
|
+
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}
|
|
2251
|
+
L${n*0.9},${o} L${n*0.8},${o/2}
|
|
2252
|
+
L${n*0.7},${o} L${n*0.6},${o/2}
|
|
2253
|
+
L${n*0.5},${o} L${n*0.4},${o/2}
|
|
2254
|
+
L${n*0.3},${o} L${n*0.2},${o/2}
|
|
2255
|
+
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=`
|
|
2256
|
+
<style>
|
|
2257
|
+
:host {
|
|
2258
|
+
display: block;
|
|
2259
|
+
line-height: 0;
|
|
2260
|
+
width: 100%;
|
|
2261
|
+
overflow: hidden;
|
|
2262
|
+
color: ${o};
|
|
2263
|
+
}
|
|
2264
|
+
svg {
|
|
2265
|
+
display: block;
|
|
2266
|
+
width: 100%;
|
|
2267
|
+
height: ${n}px;
|
|
2268
|
+
${b?"transform: rotate(180deg);":""}
|
|
2269
|
+
}
|
|
2270
|
+
</style>
|
|
2271
|
+
<svg viewBox="0 0 100 ${n}" preserveAspectRatio="none">
|
|
2272
|
+
<path d="${this._getPatternPath(t,100,parseInt(n))}" fill="currentColor" />
|
|
2273
|
+
</svg>
|
|
2274
|
+
`}};A("af-divider",vn);Rl=vn});var ko={};Q(ko,{default:()=>Dl,KangaCard:()=>wn});var wn,Dl;var Xo=Y(()=>{M();St();wn=class wn extends c{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=`
|
|
2275
|
+
<style>
|
|
2276
|
+
:host {
|
|
2277
|
+
display: block;
|
|
2278
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
.kanga-card {
|
|
2282
|
+
border-radius: var(--radius-lg, 8px);
|
|
2283
|
+
overflow: hidden;
|
|
2284
|
+
box-shadow: var(--shadow-lg, 0 5px 21px rgba(0, 0, 0, 0.2));
|
|
2285
|
+
transition: transform var(--transition-base, 250ms ease-out),
|
|
2286
|
+
box-shadow var(--transition-base, 250ms ease-out);
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
.kanga-card:hover {
|
|
2290
|
+
transform: translateY(-3px);
|
|
2291
|
+
box-shadow: 0 8px 34px rgba(0, 0, 0, 0.25);
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
/* Pindo - Decorative Border */
|
|
2295
|
+
.pindo {
|
|
2296
|
+
padding: var(--space-13, 13px);
|
|
2297
|
+
background-color: ${o.primary};
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
/* Mji - Central Content Area */
|
|
2301
|
+
.mji {
|
|
2302
|
+
background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 100%);
|
|
2303
|
+
padding: var(--space-21, 21px);
|
|
2304
|
+
min-height: 120px;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
/* Jina - Proverb Inscription */
|
|
2308
|
+
.jina {
|
|
2309
|
+
background-color: ${o.border};
|
|
2310
|
+
color: ${o.text};
|
|
2311
|
+
padding: var(--space-8, 8px) var(--space-13, 13px);
|
|
2312
|
+
text-align: center;
|
|
2313
|
+
font-style: italic;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
.jina .swahili {
|
|
2317
|
+
font-weight: 600;
|
|
2318
|
+
font-size: 1rem;
|
|
2319
|
+
margin-bottom: var(--space-3, 3px);
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
.jina .translation {
|
|
2323
|
+
font-size: 0.85rem;
|
|
2324
|
+
opacity: 0.9;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
.jina:empty {
|
|
2328
|
+
display: none;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
/* Content slot styles */
|
|
2332
|
+
::slotted(*) {
|
|
2333
|
+
margin: 0;
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
::slotted(h1), ::slotted(h2), ::slotted(h3) {
|
|
2337
|
+
color: ${o.primary};
|
|
2338
|
+
margin-bottom: var(--space-8, 8px);
|
|
2339
|
+
}
|
|
2340
|
+
</style>
|
|
2341
|
+
|
|
2342
|
+
<article class="kanga-card">
|
|
2343
|
+
<div class="pindo">
|
|
2344
|
+
<div class="mji">
|
|
2345
|
+
<slot></slot>
|
|
2346
|
+
</div>
|
|
2347
|
+
</div>
|
|
2348
|
+
|
|
2349
|
+
${t?`
|
|
2350
|
+
<div class="jina">
|
|
2351
|
+
<p class="swahili">${t}</p>
|
|
2352
|
+
${n?`<p class="translation">${n}</p>`:""}
|
|
2353
|
+
</div>
|
|
2354
|
+
`:'<div class="jina"><slot name="proverb"></slot></div>'}
|
|
2355
|
+
</article>
|
|
2356
|
+
`,this.applyTheme()}};A("af-kanga-card",wn);Dl=wn});var So={};Q(So,{default:()=>Wl,CulturalCard:()=>cn});var cn,Wl;var Mo=Y(()=>{M();St();cn=class cn 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"),o=this._cultures[t]||this._cultures.maasai,b=Xt[o.pattern],l=b?b():"";this.shadowRoot.innerHTML=`
|
|
2357
|
+
<style>
|
|
2358
|
+
:host {
|
|
2359
|
+
display: block;
|
|
2360
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
.cultural-card {
|
|
2364
|
+
border-radius: 12px;
|
|
2365
|
+
overflow: hidden;
|
|
2366
|
+
box-shadow: 0 4px 20px rgba(0,0,0,0.15);
|
|
2367
|
+
transition: transform 300ms ease, box-shadow 300ms ease;
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
.cultural-card:hover {
|
|
2371
|
+
transform: translateY(-5px);
|
|
2372
|
+
box-shadow: 0 8px 30px rgba(0,0,0,0.2);
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
.pattern-header {
|
|
2376
|
+
height: 120px;
|
|
2377
|
+
background-image: url("${l}");
|
|
2378
|
+
background-repeat: repeat;
|
|
2379
|
+
position: relative;
|
|
2380
|
+
animation: patternShift 20s linear infinite;
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
@keyframes patternShift {
|
|
2384
|
+
0% { background-position: 0 0; }
|
|
2385
|
+
100% { background-position: 100px 100px; }
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
.pattern-overlay {
|
|
2389
|
+
position: absolute;
|
|
2390
|
+
inset: 0;
|
|
2391
|
+
background: linear-gradient(transparent 0%, rgba(0,0,0,0.3) 100%);
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
.culture-badge {
|
|
2395
|
+
position: absolute;
|
|
2396
|
+
bottom: 10px;
|
|
2397
|
+
left: 10px;
|
|
2398
|
+
background: ${o.colors.primary};
|
|
2399
|
+
color: white;
|
|
2400
|
+
padding: 4px 12px;
|
|
2401
|
+
border-radius: 20px;
|
|
2402
|
+
font-size: 12px;
|
|
2403
|
+
font-weight: 600;
|
|
2404
|
+
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
|
2405
|
+
}
|
|
2406
|
+
|
|
2407
|
+
.region-badge {
|
|
2408
|
+
position: absolute;
|
|
2409
|
+
bottom: 10px;
|
|
2410
|
+
right: 10px;
|
|
2411
|
+
background: rgba(255,255,255,0.9);
|
|
2412
|
+
color: #333;
|
|
2413
|
+
padding: 4px 10px;
|
|
2414
|
+
border-radius: 20px;
|
|
2415
|
+
font-size: 11px;
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
.card-body {
|
|
2419
|
+
background: white;
|
|
2420
|
+
padding: 20px;
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
.card-title {
|
|
2424
|
+
display: flex;
|
|
2425
|
+
align-items: center;
|
|
2426
|
+
gap: 10px;
|
|
2427
|
+
margin-bottom: 12px;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
.card-title h3 {
|
|
2431
|
+
margin: 0;
|
|
2432
|
+
font-size: 18px;
|
|
2433
|
+
color: ${o.colors.primary};
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
.culture-icon {
|
|
2437
|
+
width: 40px;
|
|
2438
|
+
height: 40px;
|
|
2439
|
+
border-radius: 50%;
|
|
2440
|
+
background-image: url("${l}");
|
|
2441
|
+
background-size: cover;
|
|
2442
|
+
border: 2px solid ${o.colors.accent};
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
.card-content {
|
|
2446
|
+
color: #555;
|
|
2447
|
+
line-height: 1.6;
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
.culture-selector {
|
|
2451
|
+
width: 100%;
|
|
2452
|
+
padding: 10px;
|
|
2453
|
+
margin-top: 15px;
|
|
2454
|
+
border: 2px solid ${o.colors.primary};
|
|
2455
|
+
border-radius: 6px;
|
|
2456
|
+
font-family: inherit;
|
|
2457
|
+
font-size: 14px;
|
|
2458
|
+
cursor: pointer;
|
|
2459
|
+
background: white;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
.culture-selector:focus {
|
|
2463
|
+
outline: none;
|
|
2464
|
+
box-shadow: 0 0 0 3px ${o.colors.primary}30;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
select option {
|
|
2468
|
+
padding: 8px;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
optgroup {
|
|
2472
|
+
font-weight: 600;
|
|
2473
|
+
color: #333;
|
|
2474
|
+
}
|
|
2475
|
+
</style>
|
|
2476
|
+
|
|
2477
|
+
<article class="cultural-card">
|
|
2478
|
+
<div class="pattern-header">
|
|
2479
|
+
<div class="pattern-overlay"></div>
|
|
2480
|
+
<span class="culture-badge">${o.name}</span>
|
|
2481
|
+
<span class="region-badge">\uD83D\uDCCD ${o.region}</span>
|
|
2482
|
+
</div>
|
|
2483
|
+
<div class="card-body">
|
|
2484
|
+
<div class="card-title">
|
|
2485
|
+
<div class="culture-icon"></div>
|
|
2486
|
+
<h3>${o.name} Pattern</h3>
|
|
2487
|
+
</div>
|
|
2488
|
+
<div class="card-content">
|
|
2489
|
+
<slot></slot>
|
|
2490
|
+
</div>
|
|
2491
|
+
${n?`
|
|
2492
|
+
<select class="culture-selector">
|
|
2493
|
+
<optgroup label="\uD83C\uDF0D East Africa">
|
|
2494
|
+
<option value="maasai" ${t==="maasai"?"selected":""}>Maasai (Tanzania/Kenya)</option>
|
|
2495
|
+
<option value="hadzabe" ${t==="hadzabe"?"selected":""}>Hadzabe (Tanzania)</option>
|
|
2496
|
+
<option value="swahili" ${t==="swahili"?"selected":""}>Swahili Kanga</option>
|
|
2497
|
+
<option value="kitenge" ${t==="kitenge"?"selected":""}>Kitenge</option>
|
|
2498
|
+
<option value="tibeb" ${t==="tibeb"?"selected":""}>Ethiopian Tibeb</option>
|
|
2499
|
+
</optgroup>
|
|
2500
|
+
<optgroup label="\uD83C\uDF0D West Africa">
|
|
2501
|
+
<option value="ashanti" ${t==="ashanti"?"selected":""}>Ashanti Kente (Ghana)</option>
|
|
2502
|
+
<option value="adinkra" ${t==="adinkra"?"selected":""}>Adinkra (Ghana)</option>
|
|
2503
|
+
<option value="bogolan" ${t==="bogolan"?"selected":""}>Mali Bogolan (Mud Cloth)</option>
|
|
2504
|
+
<option value="yoruba" ${t==="yoruba"?"selected":""}>Yoruba Aso-Oke (Nigeria)</option>
|
|
2505
|
+
<option value="ankara" ${t==="ankara"?"selected":""}>Ankara Wax Print</option>
|
|
2506
|
+
</optgroup>
|
|
2507
|
+
<optgroup label="\uD83C\uDF0D Central Africa">
|
|
2508
|
+
<option value="kuba" ${t==="kuba"?"selected":""}>Kuba Shoowa (DRC)</option>
|
|
2509
|
+
<option value="imigongo" ${t==="imigongo"?"selected":""}>Imigongo (Rwanda)</option>
|
|
2510
|
+
</optgroup>
|
|
2511
|
+
<optgroup label="\uD83C\uDF0D Southern Africa">
|
|
2512
|
+
<option value="ndebele" ${t==="ndebele"?"selected":""}>Ndebele (South Africa)</option>
|
|
2513
|
+
<option value="zulu" ${t==="zulu"?"selected":""}>Zulu (South Africa)</option>
|
|
2514
|
+
<option value="swazi" ${t==="swazi"?"selected":""}>Swazi (Eswatini)</option>
|
|
2515
|
+
<option value="xhosa" ${t==="xhosa"?"selected":""}>Xhosa (South Africa)</option>
|
|
2516
|
+
</optgroup>
|
|
2517
|
+
</select>
|
|
2518
|
+
`:""}
|
|
2519
|
+
</div>
|
|
2520
|
+
</article>
|
|
2521
|
+
`}};A("af-cultural-card",cn);Wl=cn});var Qo={};Q(Qo,{default:()=>Ol,PatternShowcase:()=>_n});var _n,Ol;var Jo=Y(()=>{M();St();_n=class _n extends c{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:Yn,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:xn,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:kn,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:Xn,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:Bn,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:Sn,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:Mn,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:Gn,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:Qn,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:Un,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:Jn,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:Ln,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:Fn,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:mn,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:Rn,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:Dn,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:Wn,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:On,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((a)=>a.region===t),b={sm:80,md:120,lg:160},l=b[n]||b.md;this.shadowRoot.innerHTML=`
|
|
2522
|
+
<style>
|
|
2523
|
+
:host {
|
|
2524
|
+
display: block;
|
|
2525
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
.showcase-container {
|
|
2529
|
+
padding: 10px;
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
.region-tabs {
|
|
2533
|
+
display: flex;
|
|
2534
|
+
gap: 8px;
|
|
2535
|
+
margin-block-end: 20px;
|
|
2536
|
+
flex-wrap: wrap;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
.region-tab {
|
|
2540
|
+
padding: 8px 16px;
|
|
2541
|
+
border: none;
|
|
2542
|
+
border-radius: 20px;
|
|
2543
|
+
font-family: inherit;
|
|
2544
|
+
font-size: 13px;
|
|
2545
|
+
font-weight: 500;
|
|
2546
|
+
cursor: pointer;
|
|
2547
|
+
background: #e9ecef;
|
|
2548
|
+
color: #495057;
|
|
2549
|
+
transition: all 200ms ease;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
.region-tab:hover {
|
|
2553
|
+
background: #dee2e6;
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
.region-tab.active {
|
|
2557
|
+
background: linear-gradient(135deg, #1EB53A 0%, #00A3DD 100%);
|
|
2558
|
+
color: white;
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
.pattern-grid {
|
|
2562
|
+
display: grid;
|
|
2563
|
+
grid-template-columns: repeat(auto-fill, minmax(${l+40}px, 1fr));
|
|
2564
|
+
gap: 16px;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
.pattern-item {
|
|
2568
|
+
background: white;
|
|
2569
|
+
border-radius: 12px;
|
|
2570
|
+
overflow: hidden;
|
|
2571
|
+
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
2572
|
+
cursor: pointer;
|
|
2573
|
+
transition: all 300ms ease;
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
.pattern-item:hover {
|
|
2577
|
+
transform: scale(1.05);
|
|
2578
|
+
box-shadow: 0 8px 25px rgba(0,0,0,0.2);
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
.pattern-preview {
|
|
2582
|
+
inline-size: 100%;
|
|
2583
|
+
block-size: ${l}px;
|
|
2584
|
+
background-repeat: repeat;
|
|
2585
|
+
transition: background-position 10s linear;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
.pattern-item:hover .pattern-preview {
|
|
2589
|
+
background-position: 50px 50px;
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
.pattern-info {
|
|
2593
|
+
padding: 12px;
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
.pattern-name {
|
|
2597
|
+
font-weight: 600;
|
|
2598
|
+
font-size: 14px;
|
|
2599
|
+
margin-block-end: 4px;
|
|
2600
|
+
color: #333;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
.pattern-country {
|
|
2604
|
+
font-size: 11px;
|
|
2605
|
+
color: #888;
|
|
2606
|
+
margin-block-end: 6px;
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
.pattern-meaning {
|
|
2610
|
+
font-size: 11px;
|
|
2611
|
+
color: #666;
|
|
2612
|
+
font-style: italic;
|
|
2613
|
+
line-height: 1.4;
|
|
2614
|
+
margin-block-end: 6px;
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2617
|
+
.region-label {
|
|
2618
|
+
font-size: 12px;
|
|
2619
|
+
padding: 3px 8px;
|
|
2620
|
+
border-radius: 10px;
|
|
2621
|
+
display: inline-block;
|
|
2622
|
+
margin-block-end: 6px;
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
.region-east { background: #d4edda; color: #155724; }
|
|
2626
|
+
.region-west { background: #fff3cd; color: #856404; }
|
|
2627
|
+
.region-central { background: #e2e3ff; color: #3e2723; }
|
|
2628
|
+
.region-south { background: #d1ecf1; color: #0c5460; }
|
|
2629
|
+
</style>
|
|
2630
|
+
|
|
2631
|
+
<div class="showcase-container">
|
|
2632
|
+
<div class="region-tabs">
|
|
2633
|
+
<button class="region-tab ${t==="all"?"active":""}" data-region="all">All Regions</button>
|
|
2634
|
+
<button class="region-tab ${t==="east"?"active":""}" data-region="east">East Africa</button>
|
|
2635
|
+
<button class="region-tab ${t==="west"?"active":""}" data-region="west">West Africa</button>
|
|
2636
|
+
<button class="region-tab ${t==="central"?"active":""}" data-region="central">Central Africa</button>
|
|
2637
|
+
<button class="region-tab ${t==="south"?"active":""}" data-region="south">Southern Africa</button>
|
|
2638
|
+
</div>
|
|
2639
|
+
|
|
2640
|
+
<div class="pattern-grid">
|
|
2641
|
+
${o.map((a)=>`
|
|
2642
|
+
<div class="pattern-item" data-key="${a.key}">
|
|
2643
|
+
<div class="pattern-preview" style="background-image: url('${a.fn()}')"></div>
|
|
2644
|
+
<div class="pattern-info">
|
|
2645
|
+
<span class="region-label region-${a.region}">${a.region.charAt(0).toUpperCase()+a.region.slice(1)}</span>
|
|
2646
|
+
<div class="pattern-name">${a.name}</div>
|
|
2647
|
+
<div class="pattern-country">${a.country}</div>
|
|
2648
|
+
<div class="pattern-meaning">${a.meaning}</div>
|
|
2649
|
+
</div>
|
|
2650
|
+
</div>
|
|
2651
|
+
`).join("")}
|
|
2652
|
+
</div>
|
|
2653
|
+
</div>
|
|
2654
|
+
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((a)=>{a.addEventListener("click",()=>{this.setAttribute("region",a.dataset.region)})})}};A("af-pattern-showcase",_n);Ol=_n});var Go={};Q(Go,{AfriLanguageSwitcher:()=>en});var en;var Lo=Y(()=>{M();en=class en 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",o=t.find((b)=>b.code===n)||t[0];this.shadowRoot.innerHTML=D`
|
|
2655
|
+
<style>
|
|
2656
|
+
:host { display: inline-block; position: relative; font-family: var(--font-body); }
|
|
2657
|
+
.switcher-btn {
|
|
2658
|
+
padding: 8px 16px;
|
|
2659
|
+
background: var(--glass-bg);
|
|
2660
|
+
border: 1px solid var(--glass-border);
|
|
2661
|
+
border-radius: var(--radius-md);
|
|
2662
|
+
color: var(--text-primary);
|
|
2663
|
+
cursor: pointer;
|
|
2664
|
+
display: flex;
|
|
2665
|
+
align-items: center;
|
|
2666
|
+
gap: 8px;
|
|
2667
|
+
transition: all 0.3s ease;
|
|
2668
|
+
}
|
|
2669
|
+
.switcher-btn:hover { background: rgba(255,255,255,0.1); }
|
|
2670
|
+
.dropdown {
|
|
2671
|
+
position: absolute;
|
|
2672
|
+
top: calc(100% + 8px);
|
|
2673
|
+
right: 0;
|
|
2674
|
+
background: var(--afri-void);
|
|
2675
|
+
border: 1px solid var(--glass-border);
|
|
2676
|
+
border-radius: var(--radius-md);
|
|
2677
|
+
padding: 8px;
|
|
2678
|
+
display: none;
|
|
2679
|
+
min-width: 150px;
|
|
2680
|
+
z-index: 1000;
|
|
2681
|
+
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
|
|
2682
|
+
}
|
|
2683
|
+
:host([open]) .dropdown { display: block; }
|
|
2684
|
+
.lang-option {
|
|
2685
|
+
padding: 8px 12px;
|
|
2686
|
+
border-radius: var(--radius-sm);
|
|
2687
|
+
cursor: pointer;
|
|
2688
|
+
transition: all 0.2s ease;
|
|
2689
|
+
}
|
|
2690
|
+
.lang-option:hover { background: var(--glass-bg); color: var(--accent-gold); }
|
|
2691
|
+
</style>
|
|
2692
|
+
|
|
2693
|
+
<button class="switcher-btn">
|
|
2694
|
+
<span>🌍</span>
|
|
2695
|
+
<span>${o.name}</span>
|
|
2696
|
+
</button>
|
|
2697
|
+
|
|
2698
|
+
<div class="dropdown">
|
|
2699
|
+
${t.map((b)=>D`
|
|
2700
|
+
<div class="lang-option" data-code="${b.code}" dir="${b.dir||"ltr"}">
|
|
2701
|
+
${b.name}
|
|
2702
|
+
</div>
|
|
2703
|
+
`)}
|
|
2704
|
+
</div>
|
|
2705
|
+
`,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",en)});var Fo={};Q(Fo,{AfriAuth:()=>sn});var sn;var Bo=Y(()=>{M();sn=class sn 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",(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,a=this.shadowRoot.querySelector(".feedback");a.textContent="Processing...";try{let h=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:b,password:l})})).json();if(h.error)a.textContent=h.error,a.style.color="#ef4444";else a.textContent="Success! Redirecting...",a.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch(f){a.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
|
|
2706
|
+
<style>
|
|
2707
|
+
:host {
|
|
2708
|
+
display: block;
|
|
2709
|
+
font-family: 'Inter', system-ui;
|
|
2710
|
+
max-width: 400px;
|
|
2711
|
+
margin: 0 auto;
|
|
2712
|
+
}
|
|
2713
|
+
.auth-card {
|
|
2714
|
+
background: #1e293b;
|
|
2715
|
+
border: 1px solid #334155;
|
|
2716
|
+
border-radius: 12px;
|
|
2717
|
+
padding: 32px;
|
|
2718
|
+
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
|
2719
|
+
}
|
|
2720
|
+
h2 {
|
|
2721
|
+
margin-top: 0;
|
|
2722
|
+
color: white;
|
|
2723
|
+
text-align: center;
|
|
2724
|
+
font-weight: 800;
|
|
2725
|
+
}
|
|
2726
|
+
.input-group {
|
|
2727
|
+
margin-bottom: 20px;
|
|
2728
|
+
}
|
|
2729
|
+
label {
|
|
2730
|
+
display: block;
|
|
2731
|
+
color: #94a3b8;
|
|
2732
|
+
font-size: 0.9rem;
|
|
2733
|
+
margin-bottom: 8px;
|
|
2734
|
+
}
|
|
2735
|
+
input {
|
|
2736
|
+
width: 100%;
|
|
2737
|
+
padding: 12px;
|
|
2738
|
+
background: #0f172a;
|
|
2739
|
+
border: 1px solid #334155;
|
|
2740
|
+
border-radius: 6px;
|
|
2741
|
+
color: white;
|
|
2742
|
+
font-size: 1rem;
|
|
2743
|
+
box-sizing: border-box;
|
|
2744
|
+
}
|
|
2745
|
+
input:focus {
|
|
2746
|
+
border-color: #1EB53A;
|
|
2747
|
+
outline: none;
|
|
2748
|
+
}
|
|
2749
|
+
button {
|
|
2750
|
+
width: 100%;
|
|
2751
|
+
padding: 12px;
|
|
2752
|
+
background: #1EB53A;
|
|
2753
|
+
color: white;
|
|
2754
|
+
border: none;
|
|
2755
|
+
border-radius: 6px;
|
|
2756
|
+
font-weight: 700;
|
|
2757
|
+
cursor: pointer;
|
|
2758
|
+
font-size: 1rem;
|
|
2759
|
+
transition: all 0.2s;
|
|
2760
|
+
}
|
|
2761
|
+
button:hover {
|
|
2762
|
+
opacity: 0.9;
|
|
2763
|
+
transform: translateY(-1px);
|
|
2764
|
+
}
|
|
2765
|
+
.footer {
|
|
2766
|
+
margin-top: 20px;
|
|
2767
|
+
text-align: center;
|
|
2768
|
+
font-size: 0.9rem;
|
|
2769
|
+
color: #94a3b8;
|
|
2770
|
+
}
|
|
2771
|
+
.toggle-mode {
|
|
2772
|
+
color: #FCD116;
|
|
2773
|
+
cursor: pointer;
|
|
2774
|
+
text-decoration: underline;
|
|
2775
|
+
}
|
|
2776
|
+
.feedback {
|
|
2777
|
+
text-align: center;
|
|
2778
|
+
margin-bottom: 16px;
|
|
2779
|
+
min-height: 20px;
|
|
2780
|
+
font-size: 0.9rem;
|
|
2781
|
+
}
|
|
2782
|
+
</style>
|
|
2783
|
+
|
|
2784
|
+
<div class="auth-card">
|
|
2785
|
+
<h2>${t?"Welcome Back":"Create Account"}</h2>
|
|
2786
|
+
<div class="feedback"></div>
|
|
2787
|
+
<form>
|
|
2788
|
+
<div class="input-group">
|
|
2789
|
+
<label for="email">Email Address</label>
|
|
2790
|
+
<input type="email" id="email" required placeholder="you@example.com">
|
|
2791
|
+
</div>
|
|
2792
|
+
<div class="input-group">
|
|
2793
|
+
<label for="password">Password</label>
|
|
2794
|
+
<input type="password" id="password" required placeholder="••••••••">
|
|
2795
|
+
</div>
|
|
2796
|
+
<button type="submit">${t?"Sign In":"Sign Up"}</button>
|
|
2797
|
+
</form>
|
|
2798
|
+
<div class="footer">
|
|
2799
|
+
${t?"New here?":"Already have an account?"}
|
|
2800
|
+
<span class="toggle-mode">${t?"Create an account":"Sign in"}</span>
|
|
2801
|
+
</div>
|
|
2802
|
+
</div>
|
|
2803
|
+
`}};A("af-auth",sn)});var Ro={};Q(Ro,{default:()=>ml});var zn,ml;var Do=Y(()=>{M();zn=class zn 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=D`
|
|
2804
|
+
<style>
|
|
2805
|
+
.toggle-btn {
|
|
2806
|
+
background: var(--bg-surface-elevated, var(--afri-obsidian));
|
|
2807
|
+
border: 1px solid var(--border-color);
|
|
2808
|
+
color: var(--text-main);
|
|
2809
|
+
padding: var(--space-8) var(--space-13);
|
|
2810
|
+
border-radius: var(--radius-lg);
|
|
2811
|
+
cursor: pointer;
|
|
2812
|
+
display: flex;
|
|
2813
|
+
align-items: center;
|
|
2814
|
+
gap: 8px;
|
|
2815
|
+
font-family: var(--font-body);
|
|
2816
|
+
font-size: 0.9rem;
|
|
2817
|
+
transition: all 0.3s var(--ease-snap);
|
|
2818
|
+
}
|
|
2819
|
+
.toggle-btn:hover {
|
|
2820
|
+
border-color: var(--brand-green);
|
|
2821
|
+
transform: translateY(-2px);
|
|
2822
|
+
}
|
|
2823
|
+
.icon {
|
|
2824
|
+
font-size: 1.1rem;
|
|
2825
|
+
}
|
|
2826
|
+
</style>
|
|
2827
|
+
|
|
2828
|
+
<button class="toggle-btn" @click="\${() => this.toggleTheme()}">
|
|
2829
|
+
<span class="icon">\${isDark ? '🌙' : '☀️'}</span>
|
|
2830
|
+
<span>\${isDark ? 'Dark Mode' : 'Light Mode'}</span>
|
|
2831
|
+
</button>
|
|
2832
|
+
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};A("af-theme-toggle",zn);ml=zn});z();kt();St();var dn={};Q(dn,{transitionPage:()=>b0,default:()=>Zo,animateStaggered:()=>o0,Easing:()=>mt});var mt={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 o0(t,{delay:n=50,duration:o=600,easing:b=mt.DrumBeat,y:l=20,scale:a=0.95}={}){let f=typeof t==="string"?document.querySelectorAll(t):t;if(!f||f.length===0)return;let h=new IntersectionObserver((g)=>{g.forEach((_,X)=>{if(_.isIntersecting){let L=Math.random()*10,G=X*n+L,R=_.target;R.animate([{opacity:0,transform:`translateY(${l}px) scale(${a})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:o,delay:G,easing:b,fill:"forwards"}),h.unobserve(R),R.style.opacity="1"}})},{threshold:0.1});f.forEach((g)=>{g.style.opacity="0",h.observe(g)})}function b0(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:mt.DrumBeat})}}var Zo={Easing:mt,animateStaggered:o0,transitionPage:b0};function l0(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(),a=t[l];if(a)console.log(`\uD83C\uDFDD️ Hydrating Island: <${l}>`),a().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))})}Ut();M();M();class jn 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.",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=`
|
|
2833
|
+
<style>
|
|
2834
|
+
:host { display: block; width: 100%; font-family: 'Inter', system-ui, sans-serif; }
|
|
2835
|
+
.boundary-error {
|
|
2836
|
+
background: ${b.bg};
|
|
2837
|
+
border-left: 4px solid ${b.border};
|
|
2838
|
+
color: ${b.text};
|
|
2839
|
+
padding: 16px 20px;
|
|
2840
|
+
border-radius: 4px;
|
|
2841
|
+
margin: 12px 0;
|
|
2842
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
|
2843
|
+
}
|
|
2844
|
+
.boundary-header {
|
|
2845
|
+
display: flex;
|
|
2846
|
+
align-items: center;
|
|
2847
|
+
gap: 12px;
|
|
2848
|
+
font-weight: 600;
|
|
2849
|
+
margin-bottom: 8px;
|
|
2850
|
+
font-size: 16px;
|
|
2851
|
+
}
|
|
2852
|
+
.boundary-message {
|
|
2853
|
+
font-size: 14px;
|
|
2854
|
+
opacity: 0.9;
|
|
2855
|
+
margin-bottom: 12px;
|
|
2856
|
+
}
|
|
2857
|
+
.boundary-dev-detail {
|
|
2858
|
+
font-family: monospace;
|
|
2859
|
+
font-size: 12px;
|
|
2860
|
+
background: rgba(0,0,0,0.05);
|
|
2861
|
+
padding: 8px;
|
|
2862
|
+
border-radius: 4px;
|
|
2863
|
+
overflow-x: auto;
|
|
2864
|
+
white-space: pre-wrap;
|
|
2865
|
+
}
|
|
2866
|
+
.boundary-action {
|
|
2867
|
+
margin-top: 12px;
|
|
2868
|
+
}
|
|
2869
|
+
button {
|
|
2870
|
+
background: transparent;
|
|
2871
|
+
border: 1px solid ${b.border};
|
|
2872
|
+
color: ${b.text};
|
|
2873
|
+
padding: 6px 12px;
|
|
2874
|
+
border-radius: 4px;
|
|
2875
|
+
cursor: pointer;
|
|
2876
|
+
font-weight: 500;
|
|
2877
|
+
transition: background 0.2s;
|
|
2878
|
+
}
|
|
2879
|
+
button:hover {
|
|
2880
|
+
background: rgba(0,0,0,0.05);
|
|
2881
|
+
}
|
|
2882
|
+
</style>
|
|
2883
|
+
<div class="boundary-error" role="alert">
|
|
2884
|
+
<div class="boundary-header">
|
|
2885
|
+
<span aria-hidden="true">\uD83D\uDD04</span>
|
|
2886
|
+
<span>Component Recovery</span>
|
|
2887
|
+
</div>
|
|
2888
|
+
<div class="boundary-message">${n}</div>
|
|
2889
|
+
|
|
2890
|
+
${this._errorDetail?`
|
|
2891
|
+
<div class="boundary-dev-detail">
|
|
2892
|
+
<code><${this._errorDetail.component}>: ${this._errorDetail.message}</code>
|
|
2893
|
+
</div>
|
|
2894
|
+
`:""}
|
|
2895
|
+
|
|
2896
|
+
<div class="boundary-action">
|
|
2897
|
+
<button id="retry-btn">Try Again</button>
|
|
2898
|
+
</div>
|
|
2899
|
+
</div>
|
|
2900
|
+
`,this.shadowRoot.getElementById("retry-btn").addEventListener("click",()=>{this.reset()});return}this.shadowRoot.innerHTML=`
|
|
2901
|
+
<style>:host { display: block; }</style>
|
|
2902
|
+
<slot></slot>
|
|
2903
|
+
`}}A("af-error-boundary",jn);var Wo={"af-button":()=>Promise.resolve().then(() => (r0(),g0)),"af-card":()=>Promise.resolve().then(() => (v0(),$0)),"af-navbar":()=>Promise.resolve().then(() => (c0(),w0)),"af-input":()=>Promise.resolve().then(() => (D0(),R0)),"af-alert":()=>Promise.resolve().then(() => (O0(),W0)),"af-grid":()=>Promise.resolve().then(() => (U0(),m0)),"af-section":()=>Promise.resolve().then(() => (V0(),d0)),"af-icon":()=>Promise.resolve().then(() => (N0(),j0)),"af-accordion":()=>Promise.resolve().then(() => (p0(),K0)),"af-hero":()=>Promise.resolve().then(() => (u0(),I0)),"af-table":()=>Promise.resolve().then(() => (i0(),P0)),"af-modal":()=>Promise.resolve().then(() => (C0(),T0)),"af-tabs":()=>Promise.resolve().then(() => (Z0(),y0)),"af-sidebar":()=>Promise.resolve().then(() => (s0(),e0)),"af-dropdown":()=>Promise.resolve().then(() => (to(),z0)),"af-select":()=>Promise.resolve().then(() => (oo(),no)),"af-form":()=>Promise.resolve().then(() => (lo(),bo)),"af-tooltip":()=>Promise.resolve().then(() => (fo(),ao)),"af-toast":()=>Promise.resolve().then(() => (go(),ho)),"af-badge":()=>Promise.resolve().then(() => ($o(),ro)),"af-avatar":()=>Promise.resolve().then(() => (wo(),vo)),"af-progress":()=>Promise.resolve().then(() => (_o(),co)),"af-loader":()=>Promise.resolve().then(() => (qo(),Ao)),"af-skeleton":()=>Promise.resolve().then(() => (Eo(),Ho)),"af-divider":()=>Promise.resolve().then(() => (xo(),Yo)),"af-kanga-card":()=>Promise.resolve().then(() => (Xo(),ko)),"af-cultural-card":()=>Promise.resolve().then(() => (Mo(),So)),"af-pattern-showcase":()=>Promise.resolve().then(() => (Jo(),Qo)),"af-language-switcher":()=>Promise.resolve().then(() => (Lo(),Go)),"af-auth":()=>Promise.resolve().then(() => (Bo(),Fo)),"af-theme-toggle":()=>Promise.resolve().then(() => (Do(),Ro))};z();function Ul(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Client SDK Initialized (Zero-Config Mode)");let n={...Wo,...t};if(Object.keys(n).length>0)l0(n)}}var Xf={createReactiveState:at,subscribe:T,createSignal:Hn,createEffect:En,store:W,actions:t0,patterns:Xt,motion:dn,html:D,Layout:h0,init:Ul};export{T as subscribe,W as store,Xt as patterns,dn as motion,Ul as init,D as html,Xf as default,Hn as createSignal,at as createReactiveState,En as createEffect,t0 as actions,h0 as Layout};
|
|
2904
|
+
|
|
2905
|
+
//# debugId=E59F2706CA9FA53664756E2164756E21
|