UNPKG

@abw/badger-react-ui

Version:
1,945 lines 303 kB
var sc = Object.defineProperty; var rc = (e, t, n) => t in e ? sc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var I = (e, t, n) => (rc(e, typeof t != "symbol" ? t + "" : t, n), n); import { jsx as l, jsxs as S, Fragment as be } from "react/jsx-runtime"; import * as P from "react"; import W, { createContext as Tt, forwardRef as Or, isValidElement as Ti, useState as B, useRef as U, useEffect as V, useMemo as H, useLayoutEffect as Tr, useCallback as le, memo as oc, useReducer as ic, useContext as ht, cloneElement as ac, useId as ki, createRef as Io } from "react"; import * as lc from "react-dom"; import { unstable_batchedUpdates as es, createPortal as cc } from "react-dom"; var uc = Object.defineProperty, dc = (e, t, n) => t in e ? uc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, lt = (e, t, n) => dc(e, typeof t != "symbol" ? t + "" : t, n); function hc(e) { return typeof e == "string"; } function fc(e) { return Array.isArray(e); } function kr(e) { return typeof e == "function"; } function Eo(...e) { throw new Error(e.join("")); } const Po = (e, ...t) => kr(e) ? e(...t) : e; function gc() { return Intl.DateTimeFormat().resolvedOptions().locale; } gc(); function pc(e = {}, t = {}, n = {}) { return Object.entries(t).reduce( (s, [r, o]) => { const i = n[o]; return i !== null && typeof i < "u" && (s[r] = i), s; }, { ...e } ); } function mc(e, t = []) { return (hc(t) ? t.split(/,\s*|\s+/) : t).reduce( (n, s) => { const r = e[s] || Eo(`Cannot expose non-existent action method: ${s}`); return kr(r) ? n[s] = r.bind(e) : Eo(`Cannot bind to non-function method: ${s}`), n; }, {} ); } function bc(e, t) { const n = e.debug ?? t.debug, s = Po(e.debugPrefix ?? t.debugPrefix, e), r = Po(e.debugColor ?? t.debugColor, e); return n ? s ? (o, ...i) => console.log( `%c${s}%c${o}`, `color: ${r}`, "color:black", ...i ) : console.log.bind(console) : () => { }; } const vc = (e) => fc(e) ? e : [e], Ge = (e, t = {}) => { const n = t.defaultState || {}, s = t.context || W.createContext(n); return { Context: s, Provider: (r) => /* @__PURE__ */ l( e, { ...r, render: (o) => /* @__PURE__ */ l(s.Provider, { value: o, children: r.children }) } ), Consumer: (r) => (o) => /* @__PURE__ */ l(s.Consumer, { children: (i) => /* @__PURE__ */ l(r, { ...i, ...o }) }), Children: ({ children: r }) => vc(r).map( (o, i) => kr(o) ? /* @__PURE__ */ l(s.Consumer, { children: o }, i) : o ), Use: () => W.useContext(s) }; }; let Ae = class extends W.Component { constructor(t) { super(t), lt(this, "debug"), lt(this, "actions"); const n = this.constructor, s = n.debug, r = n.debugPrefix, o = n.debugColor; this.debug = bc( t, { debug: s, debugPrefix: r, debugColor: o } ), this.state = pc( n.initialState, n.initialProps, t ), this.actions = this.initActions(n.actions); } initActions(t) { return mc(this, t); } getContext() { return { ...this.props, // properties passed to the context ...this.state, // internal state ...this.actions // callable action functions mapped to methods }; } getRenderProps() { return this.getContext(); } render() { return this.props.render( this.getRenderProps() ); } }; lt(Ae, "initialState", {}), lt(Ae, "initialProps", {}), lt(Ae, "actions", []), lt(Ae, "debug", !1), lt(Ae, "debugPrefix"), lt(Ae, "debugColor"); const Cc = ({ render: e, open: t }) => { const [n, s] = W.useState(t), r = () => s((a) => !a), o = () => s(!0), i = () => s(!1); return W.useEffect( () => { s(t); }, [t] ), e({ isOpen: n, open: o, close: i, toggleOpen: r }); }, Ir = Ge(Cc), CC = Ir.Use, yc = "svg", Ii = "-", Ei = "fill", xc = "path", wc = "line", Sc = "rect", fr = "array", Rc = "circle", Lc = "ellipse", Nc = "polygon", Mc = "polyline", Er = /-(?!\d)/, Ao = "currentColor", Pr = 512, Ar = 512, Fr = { defaults: { width: 512, height: 512, type: "line" }, icons: { alpha: "M102,448L256,64L410,448 M152,333L360,333", angle: "M448,336L256,144L64,336", angles: "M448,448L256,256L64,448M448,256L256,64L64,256", arrow: "M96,224L256,64L416,224M256,86L256,448", arrows: "M160,128L256,32L352,128M352,384L256,480L160,384M256,48L256,464", arrowhead: "M176,112L256,32L336,112M256,48L256,192", asterisk: "M76,152L436,360M76,360L436,152M256,48L256,464", at: "M256,160C309,160 352,203 352,256C352,309 309,352 256,352C203,352 160,309 160,256C160,203 203,160 256,160M256,480C132,480 32,380 32,256C32,132 132,32 256,32C380,32 480,132 480,256L480,288C480,323 451,352 416,352C381,352 352,323 352,288L352,176", ban: "M100,412L412,100 M256,32C380,32 480,132 480,255C480,379 380,480 256,480C132,480 32,379 32,255C32,132 132,32 256,32Z", bars: "M64,96L448,96M64,256L448,256M64,416L448,416", card: "rect:32 96 448 320 32 32", caret: "M448,336L256,144L64,336L448,336Z", check: "M48,248L192,392L464,120", circle: "circle:256 256 224", clipboard: "M192,80L80,80L80,496L432,496L432,80L320,80L320,112L192,112L192,80ZM256,16C282,16 304,38 304,64C304,90 282,112 256,112C230,112 208,90 208,64C208,38 230,16 256,16Z", clone: "M304,416L304,444C304,468 284,488 260,488L68,488C44,488 24,468 24,444L24,252C24,228 44,208 68,208L96,208M480,75L480,277C480,301 461,320 437,320L235,320C211,320 192,301 192,277L192,75C192,51 211,32 235,32L437,32C461,32 480,51 480,75Z", cloud: "M480,293C480,234 437,177 362,196C346,161 319,116 240,120C180,124 139,165 125,224C121,223 116,223 111,223C68,223 32,260 32,307C32,354 68,392 111,392C120,392 366,392 380,392C462,392 480,335 480,293Z", cog: "M306,21L206,21L187,91L147,114L78,95L28,182L78,233L78,279L28,330L78,417L147,398L187,421L206,491L306,491L325,421L365,398L434,417L484,330L434,279L434,233L484,182L434,95L365,114L325,91L306,21Z M256,176C300,176 336,212 336,256C336,300 300,336 256,336C212,336 176,300 176,256C176,212 212,176 256,176Z", columns: [ "rect:32 32 448 448 45 45", "line:180,32 180,480", "line:332,32 332,480" ], comment: "M256,64C371,64 464,139 464,232C464,325 371,400 256,400C236,400 217,398 199,394C184,390 163,448 80,464C111,426 118,358 110,352C72,321 48,279 48,232C48,139 141,64 256,64Z", crop: "M32,80L288,80 M80,32L80,288M432,480L432,224M480,432L224,432M80,428L432,80", cross: "M112,112L400,400M400,112L112,400", crosshairs: [ "circle:256 256 192", "M256,16L256,112 M496,256L400,256 M16,256L112,256 M256,496L256,400" ], diamond: "M256,32L480,256L256,480L32,256L256,32", download: "M256,64L256,320L352,224M256,320L160,224M384,320L425,320C438,320 448,330 448,342L448,426C448,438 438,448 425,448L86,448C74,448 64,438 64,426L64,342C64,330 74,320 86,320L128,320", drag: "M96,128L256,32L416,128M96,384L256,480L416,384M144,256L368,256", envelope: [ "rect:32 96 448 320 32 32", "M32,144C32,144 158.906,243.712 221.676,293.031C241.821,308.86 270.179,308.86 290.324,293.031C353.094,243.712 480,144 480,144" ], equals: "M96,320L416,320 M96,192L416,192", exclamation: "M256,96L256,310M254,416L258,416", eye: [ "M21,256C131,42 381,43 493,256 M21,256C130,470 383,469 493,256", "circle:256 256 80" ], eyeshut: "M21,256C131,42 381,43 493,256M21,256C130,320 383,320 493,256M21,256C130,470 383,469 493,256", filter: "M64,32L448,32L448,128L320,256L320,432L192,480L192,256L64,128L64,32Z", folder: "M480,128L480,448L32,448L32,64L176,64L240,128L480,128Z", globe: [ "circle:256 256 224", "ellipse:256 256 116 224", "M32,255.997L480,256.115M53.867,160L458.413,160M53.867,352.587L458.413,352M256.14,32L256.14,480" ], heart: "M256,128C298,48 382,48 424,88C466,128 466,208 424,288C394,348 319,408 256,448C193,408 118,348 88,288C46,208 46,128 88,88C130,48 214,48 256,128Z", hourglass: "M80,32L432,32M80,480L432,480M128,32C128,256 384,256 384,480M384,32C384,256 128,256 128,480", image: [ "rect:32 80 448 366 32", "M32,304L128,240L384,432M272,345L367,281L480,366", "circle:288 192 16" ], info: "M212,202L256,202L256,416M182,416L330,416M252,96L256,96", key: [ "M189,246C183,229 180,212 180,194C180,118 242,56 318,56C394,56 456,118 456,194C456,270 394,332 318,332C300,332 283,329 266,323L232,360L184,360L184,408L136,408L136,456L56,456L56,379L189,246Z", "circle:344 168 8" ], list: "M176,96L448,96M176,256L448,256M176,416L448,416M64,96L80,96M64,256L80,256M64,416L80,416", locked: [ "M144,224L144,166C144,105 195,54 256,54C317,54 368,105 368,166L368,224M256,320L256,368", "rect:80 224 352 240 32 32" ], login: "M192,128L320,256L192,384M304,256L64,256M320,64L448,64L448,448L320,448", logout: "M320,128L448,256L320,384M432,256L192,256M192,448L64,448L64,64L192,64", minus: "M96,256L416,256", mobile: [ "rect:128 48 256 416 32 32", "M128,120L384,120M128,392L384,392" ], move: "M192,96L256,32L320,96M416,192L480,256L416,320M320,416L256,480L192,416M96,192L32,256L96,320M48,256L464,256M256,48L256,464", number: "M256,448L256,64L176,128 M160,448L336,449", page: "M416,170L416,480L96,480L96,32L288,32L416,170M288,32L288,176L416,176", pen: "M482,143C491,134 491,120 482,112L401,30C392,21 378,21 369,30L72,326L22,489L186,439L482,143M305,93L418,206", phone: "M51,59C40,62 32,72 32,84C41,321 192,472 428,480C440,480 451,471 453,459C459,435 469,395 475,371C478,360 472,348 462,343C438,331 395,309 370,297C360,292 347,295 339,304C325,323 303,352 304,352C255,352 160,257 160,208C160,207 188,186 207,172C217,165 220,152 215,141C202,117 181,74 169,50C164,39 152,34 141,37C116,43 75,53 51,59Z", plus: "M256,96L256,416M96,256L416,256", point: "M448,224L256,16L64,224L160,224L160,480L352,480L352,224L448,224Z", prime: "M256,128L256,256", question: "M160,160C160,126 197,80 255,80C314,80 336,128 336,160C336,236 255,235 255,320 M255,416L256,416", rotate: "M392,120C356,84 307,64 256,64C150,64 64,150 64,256C64,362 150,448 256,448C303,448 349,430 384,399C349,430 303,448 256,448C150,448 64,362 64,256C64,150 150,64 256,64C307,64 356,84 392,120Z M352,208L480,208L480,80", search: "M204,32C300,32 384,111 384,208C384,305 305,384 208,384C111,384 32,305 32,208C32,111 107,32 204,32M480,480L332,332", slash: "M64,448L448,64", square: "rect:32 32 448 448", square10: "rect:32 32 448 448 45 45", square20: "rect:32 32 448 448 90 90", square30: "rect:32 32 448 448 135 135", square40: "rect:32 32 448 448 180 180", star: "M256,32L324,183L489,202L367,313L400,476L256,394L112,476L145,313L23,202L188,183L256,32Z", thumb: "M149,174L32,174L32,448L149,448L149,184 M149,217C277,160 246,36 282,38C372,44 324,192 324,192L440,192C462,192 480,210 480,232C480,254 462,272 440,272L368,272M424,272C446,272 464,290 464,312C464,334 446,352 424,352L352,352M392,352C414,352 432,370 432,392C432,414 414,432 392,432L256,432C220,432 149,409 149,409", time: "M256,128L256,256L336,336", trash: "M32,80L480,80 M80,80C80,80 100,344 109,452C111,477 131,496 156,496C211,496 301,496 356,496C381,496 401,477 403,452C412,344 432,80 432,80 M160,80L208,16L304,16L352,74", triangle: "M256,64L32,448L480,448L256,64Z", unlocked: [ "M144,224L144,166C144,105 195,54 256,54C304,54 346,85 361,128M256,320L256,368", "rect:80 224 352 240 32 32" ], upload: "M256,320L256,64L160,160M256,64L352,160M384,320L425,320C438,320 448,330 448,342L448,426C448,438 438,448 425,448L86,448C74,448 64,438 64,426L64,342C64,330 74,320 86,320L128,320", user: [ "M448,400C448,349 410,308 364,308L149,308C102,308 64,349 64,400C64,424 64,480 64,480L448,480C448,480 448,423 448,400Z", "circle:256,144,96" ], vertical: "line:256,48 256,464", wrench: "M486,108C493,124 496,142 496,160C496,239 431,304 352,304C330,304 309,299 290,290L98,482C79,501 49,501 30,482C11,463 11,433 30,414L222,222C213,203 208,182 208,160C208,81 273,16 352,16C370,16 388,19 404,26L336,96L352,160L416,176L486,108Z" } }; function $c(e, t, n = Fr) { n.icons[e] = t; } function yC(e, t = Fr) { Object.entries(e).forEach( ([n, s]) => $c(n, s, t) ); } function Pi(e) { return Array.isArray(e); } function Dc(e) { return typeof e == "function"; } function Fo(e) { return typeof e == "object" && !Pi(e) && !Oc(e); } function Oc(e) { return e === null; } function Tc() { return Intl.DateTimeFormat().resolvedOptions().locale; } Tc(); const kc = () => { const e = Tt({}); return { Context: e, Provider: ({ children: t, ...n }) => /* @__PURE__ */ l(e.Provider, { value: n, children: t }), Themed: (t, n = t.displayName || t.name) => Or( (s, r) => /* @__PURE__ */ l(e.Consumer, { children: (o) => { let i = t; const a = o[n]; let c; if (!a) return /* @__PURE__ */ l( t, { ref: r, ...s } ); if (Pi(a) ? (i = a[0], c = a[1]) : c = a, Dc(c)) { const u = c( s, r, o ); if (Ti(u)) return u; if (Fo(u)) return /* @__PURE__ */ l( i, { ref: r, ...u } ); } return Fo(c) ? /* @__PURE__ */ l( i, { ref: r, ...c, ...s } ) : /* @__PURE__ */ l( i, { ref: r, ...s } ); } }) ) }; }, Ic = kc(), Ec = Ic.Themed; function Re(e) { return typeof e == "string"; } function Pn(e) { return Array.isArray(e); } function rn(e) { return typeof e == "object" && !Pn(e) && !Fi(e); } function Ai(e) { return typeof e > "u"; } function Fi(e) { return e === null; } function Ns(e) { return !(Ai(e) || Fi(e)); } function Pc(e) { return !Ns(e); } function Ye(...e) { throw new Error(e.join("")); } function Ac() { return Intl.DateTimeFormat().resolvedOptions().locale; } Ac(); function gr(e, t = /,\s*|\s+/) { return Pc(e) ? [] : Re(e) ? e.length ? e.split(t) : [] : Pn(e) ? e : [e]; } function An(e) { return e.split(/\s*[;&]\s*/).filter((t) => t.length > 0).reduce( (t, n) => { const [s, r] = n.split(/\s*[:=]\s*/); return t[s] = Ai(r) ? !0 : r, t; }, {} ); } const Vr = (e) => e.filter(Ns).join(" "), Fc = (e) => Object.entries(e).filter(([, t]) => t).map(([t]) => t), Vc = (...e) => Vr( e.flatMap( (t) => rn(t) ? Fc(t) : t ) ), Bc = 4.42, qe = (e) => `${Bc * e}%`, jc = { // fill: 'currentColor', // stroke: 'currentColor', /* strokeWidth: widthMultiple(2), strokeLinecap: 'round', strokeLinejoin: 'round', strokeMiterlimit: '1.5' */ }, pr = { outline: { fill: "none", stroke: "currentColor", strokeWidth: qe(2), strokeLinecap: "round", strokeLinejoin: "round", strokeMiterlimit: "1.5" }, solid: { fill: "currentColor", stroke: "none" }, round: { strokeLinecap: "round", strokeLinejoin: "round", strokeMiterlimit: "1.5" }, square: { strokeLinecap: "square", strokeLinejoin: "miter", strokeMiterlimit: "1.5" }, butt: { strokeLinecap: "butt" }, bevel: { strokeLinejoin: "bevel" }, thinnest: { strokeWidth: qe(0.5) }, thinner: { strokeWidth: qe(1) }, thin: { strokeWidth: qe(1.5) }, medium: { strokeWidth: qe(2) }, thick: { strokeWidth: qe(2.5) }, thicker: { strokeWidth: qe(3) }, thickest: { strokeWidth: qe(3.5) }, line: {} }; pr.line = pr.outline; const Wc = { ...Object.entries(pr).reduce( (e, [t, n]) => (e[t] = (s) => Object.assign(s, n), e), {} ), fill: (e, t) => e.fill = t === !0 ? Ao : t, stroke: (e, t) => e.stroke = t === !0 ? Ao : t, nofill: (e) => delete e.fill, nostroke: (e) => delete e.stroke, strokewidth: (e, t) => e.strokeWidth = t.match(/^[\d.]+$/) ? qe(parseFloat(t)) : t, opacity: (e, t) => e.opacity = t, fillopacity: (e, t) => e.fillOpacity = t, strokeopacity: (e, t) => e.strokeOpacity = t, dasharray: (e, t) => e.strokeDasharray = t, drawlength: (e, t) => e["--draw-length"] = t, drawtime: (e, t) => e["--draw-time"] = t, filltime: (e, t) => e["--fill-time"] = t }, it = (e) => Re(e) ? parseFloat(e) : e, Hc = (e) => Re(e) ? parseInt(e) : e, Vi = { x: 0, y: 0, size: 16, scaleX: 1, scaleY: 1, flipX: !1, flipY: !1, rotate: 0 }, ft = { flip: (e, t) => { Re(t) && t.match(/^y$/i) ? e.flipY = !e.flipY : e.flipX = !e.flipX; }, flipx: (e) => e.flipX = !e.flipX, flipy: (e) => e.flipY = !e.flipY, grow: (e, t) => e.size += it(t), shrink: (e, t) => e.size -= it(t), scalex: (e, t) => e.scaleX *= it(t), scaley: (e, t) => e.scaleY *= it(t), left: (e, t) => t === !0 ? e.rotate -= 90 : e.x -= it(t), right: (e, t) => t === !0 ? e.rotate += 90 : e.x += it(t), up: (e, t) => t === !0 ? e.rotate += 0 : e.y -= it(t), down: (e, t) => t === !0 ? e.rotate += 180 : e.y += it(t), rotate: (e, t) => e.rotate += Hc(t) }; ft.flop = ft.flipy; ft["flip-x"] = ft.flipx; ft["flip-y"] = ft.flipy; function Bi(e, t = { ...Vi }) { const n = Re(e) ? An(e) : e || {}; return Object.entries(n).reduce( (s, [r, o]) => { const i = r.toLowerCase(); return (ft[i] || Ye(`Invalid transform: ${i}`))(s, o), s; }, t ); } function hs(e, t) { return (Re(t) ? t.split(Er) : t).forEach( (n) => { const [s, r = !0] = n.split(/[:=]/), o = s.toLowerCase(), i = Wc[o]; if (i) { i(e.style || (e.style = { ...jc }), r); return; } (ft[o] || Ye(`Invalid style or transform: ${o}`))( e.transform || (e.transform = { ...Vi }), r ); } ); } function zc(e) { const t = e.match(/^(.*?):(.*)/); return t ? { path: t[2], type: t[1] } : { path: e }; } function ts(e, t) { const n = Pn(t) ? [...t] : gr(t); return gr(e).reduce( (s, r) => { if (n.length) { const o = n.shift(); s[o] = r; } return s; }, {} ); } const ji = { svg: (e) => ({ element: yc, svg: e }), array: (e) => ({ element: fr, items: e }), path: (e) => ({ element: xc, d: e }), polygon: (e) => ({ element: Nc, points: e }), polyline: (e) => ({ element: Mc, points: e }), circle: (e) => ({ element: Rc, ...ts(e, "cx cy r") }), ellipse: (e) => ({ element: Lc, ...ts(e, "cx cy rx ry") }), line: (e) => ({ element: wc, ...ts(e, "x1 y1 x2 y2") }), rect: (e) => ({ element: Sc, ...ts(e, "x y width height rx ry") }) }, Uc = { width: Pr, height: Ar, type: Ei }, Wi = (e) => { const [t, n = ""] = e.split("?"), [s, ...r] = t.split(/\.(?!\d)/), o = s.split(Er).filter((a) => a.length), i = An(n); return { dashes: o, classes: r, style: i }; }, Kc = (e, t) => { for (let n = e.length; n > 0; n--) { const s = e.slice(0, n).join(Ii); if (t[s]) return [ s, e.slice(n), t[s] ]; } return null; }, Vo = (e, t, n = {}) => { const { icons: s, defaults: r } = t, { dashes: o, classes: i, style: a } = Wi(e), [c, u, d] = Kc(o, s) || Ye(`No icon found matching any leading subset of ${o.join(Ii)}`), h = { ...Uc, ...r, ...n, name: c }; if (qc(h, d), (i.length || n.className) && (h.className = Vr([ ...i || [], n.className || null ])), h.transform && (h.transform = Bi(h.transform)), h.style ? (h.style = Re(h.style) ? An(h.style) : { ...h.style }, a && Object.assign(h.style, a)) : a && (h.style = a), h.type) { const g = h.style && { ...h.style }; hs(h, h.type), delete h.type, g && Object.assign(h.style, g); } return u.length && hs(h, u), Object.keys(a).length && (h.style = Object.assign(h.style || {}, a)), h; }, qc = (e, t) => { if (rn(t) && t.body) { const { body: n, ...s } = t; e.body = mr(n), Object.assign(e, s); } else e.body = mr(t), rn(t) && t.type && (e.type = t.type); return e; }, mr = (e) => { if (Re(e)) return _c(e); if (rn(e)) return Xc(e); if (Pn(e)) return Yc(e); Ye(`Cannot parse icon data: ${e}`); }; function _c(e) { if (e.match(/^\s*</)) return { element: "svg", svg: e.replace(/^\s*/, "") }; const t = e.match(/^(.*?):(.*)/); if (t) { const [, n, s] = t, { dashes: r, classes: o } = Wi(n), i = r.shift(), a = (ji[i] || Ye(`Invalid icon data element: ${i}`))(s); return o.length && (a.className = Vr(o)), r.length && hs(a, r), a; } return { element: "path", d: e }; } function Xc(e) { const t = { ...e }; if (t.element) return t; for (const [n, s] of Object.entries(ji)) { const r = t[n]; if (Ns(r)) return s(r); } Ye(`Cannot parse icon data: ${JSON.stringify(e)}`); } function Yc(e) { return { element: fr, // NOTE: we expand out any nested arrays items: e.flatMap( (t) => { const n = mr(t); return n.element === fr ? n.items : n; } ) /* Old nested array version items: array.map( item => iconBodyType(item) ) */ }; } const Hi = (e) => gr(e, /\s+/), Gc = ({ size: e, ...t }) => { t.width ?? (t.width = e || Pr), t.height ?? (t.height = e || Ar), t.path && Object.assign(t, zc(t.path)); let n; return t.style && (Re(t.style) ? (n = An(t.style), t.style = {}) : n = { ...t.style }), hs( t, t.type ? t.type.split(Er).filter((s) => s.length) : Ei ), delete t.type, t.style && n && Object.assign(t.style, n), t.transform && (t.transform = Bi(t.transform)), t; }, Br = (e) => rn(e) ? Object.entries(e).reduce( (t, [n, s]) => (t[n.replace(/(?!-)-./g, (r) => r[1].toUpperCase())] = s, t), {} ) : e, Zc = (e) => Ns(e) ? Br(An(e)) : null, Ze = ({ style: e, className: t, ...n }) => ({ style: Re(e) ? Zc(e) : Br(e), className: t, ...n }), Jc = (e) => /* @__PURE__ */ l("circle", { ...Ze(e) }), Qc = (e) => /* @__PURE__ */ l("ellipse", { ...Ze(e) }), eu = (e) => /* @__PURE__ */ l("line", { ...Ze(e) }), zi = (e) => /* @__PURE__ */ l("path", { ...Ze(e) }), tu = (e) => /* @__PURE__ */ l("polygon", { ...Ze(e) }), nu = (e) => /* @__PURE__ */ l("polyline", { ...Ze(e) }), su = (e) => /* @__PURE__ */ l("rect", { ...Ze(e) }), ru = (e) => { const { svg: t, ...n } = e; return /* @__PURE__ */ l( "g", { dangerouslySetInnerHTML: { __html: t }, ...Ze(n) } ); }, ou = (e) => { const { items: t, ...n } = e; return /* @__PURE__ */ l("g", { ...Ze(n), children: t.map( (s, r) => /* @__PURE__ */ l(fs, { body: s }, r) ) }); }, iu = { array: ou, circle: Jc, ellipse: Qc, line: eu, path: zi, polygon: tu, polyline: nu, rect: su, svg: ru }, fs = (e) => { const { path: t, body: n } = e; if (t) return /* @__PURE__ */ l(zi, { d: t, ...e }); if (Re(n)) return /* @__PURE__ */ l("g", { dangerouslySetInnerHTML: { __html: n } }); if (rn(n)) { const { element: s, ...r } = n, o = iu[s] || Ye(`Invalid element type: ${s} => `, JSON.stringify(n)); return /* @__PURE__ */ l(o, { ...r }); } if (Pn(n)) return n.map( (s, r) => /* @__PURE__ */ l(fs, { body: s }, r) ); Ye(`Don't know how to handle body: ${n}`); }; function au({ width: e, height: t, transform: n, children: s }) { const r = e / 2, o = t / 2, i = n.x * e / 16, a = n.y * t / 16, c = n.size / 16 * (n.flipX ? -1 : 1) * n.scaleX, u = n.size / 16 * (n.flipY ? -1 : 1) * n.scaleY, d = n.rotate; return /* @__PURE__ */ l("g", { transform: `translate(${r} ${o})`, children: /* @__PURE__ */ l("g", { transform: `translate(${i}, ${a}) scale(${c}, ${u}) rotate(${d} 0 0)`, children: /* @__PURE__ */ l("g", { transform: `translate(-${r} -${o})`, children: s }) }) }); } const er = ({ onClick: e, minx: t = 0, miny: n = 0, width: s = Pr, height: r = Ar, style: o, transform: i, className: a = "", // fill='currentColor' ...c }) => /* @__PURE__ */ l( "svg", { xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false", viewBox: `${t} ${n} ${s} ${r}`, className: `${a} icon`, style: Br(o), onClick: e, children: i ? /* @__PURE__ */ l( au, { width: s, height: r, transform: i, children: /* @__PURE__ */ l(fs, { ...c }) } ) : /* @__PURE__ */ l(fs, { ...c }) } ), lu = ({ name: e, iconsClass: t = "icons", library: n = Fr, ...s }) => { if (!e) return /* @__PURE__ */ l(er, { ...Gc(s) }); try { const r = Hi(e); return r.length === 1 ? /* @__PURE__ */ l( er, { ...s, ...Vo(e, n, s) } ) : /* @__PURE__ */ l("div", { className: Vc(t, s.className), children: r.map( (o) => /* @__PURE__ */ l( er, { ...s, ...Vo(o, n, s) }, o ) ) }); } catch (r) { const o = Re(r) ? r : r.message; Ye(`Badger Icon failed to render icon "${e}". ${o}`); } }, Ui = Ec(lu, "Icon"), cu = ({ names: e, className: t }) => /* @__PURE__ */ l("div", { className: `grid overlap ${t}`, children: Hi(e).map( (n) => /* @__PURE__ */ l(Ui, { name: n }, n) ) }); function kt(e) { return typeof e == "boolean"; } function De(e) { return typeof e == "string"; } function cn(e) { return typeof e == "number"; } function Fn(e) { return Number.isInteger(e); } function Be(e) { return Array.isArray(e); } function It(e) { return typeof e == "function"; } function uu(e) { return e instanceof RegExp; } function ve(e) { return typeof e == "object" && !Be(e) && !jr(e); } function Ki(e) { return De(e) || cn(e) || kt(e); } function qi(e) { return typeof e > "u"; } function jr(e) { return e === null; } function T(e) { return !(qi(e) || jr(e)); } function Ms(e) { return !T(e); } function $s(...e) { throw new Error(e.join("")); } const re = (e, ...t) => It(e) ? e(...t) : e; function E(...e) { } const Et = (e) => e, Bo = (e) => { const t = e.toString().split("."); return t.length < 2 ? 1 : Math.pow(10, t[1].length); }, Ds = (...e) => e.reduce( (t, n) => { const s = Bo(t), r = Bo(n); return s > r ? s : r; }, -1 / 0 ), dt = (...e) => e.reduce( (t, n) => { const s = Ds(t, n); return t * s * (n * s) / (s * s); }, 1 ), ls = (...e) => e.reduce( (t, n) => { const s = Ds(t, n); return t * s / (n * s); } ), _i = (...e) => { const t = Ds(...e); return e.reduce( (n, s) => n + t * s, 0 ) / t; }, du = (...e) => { const t = Ds(...e), [n, ...s] = e; return s.reduce( (r, o) => r - t * o, n * t ) / t; }, G = (e, t, n) => Math.min(Math.max(e, t), n); function hu() { return Intl.DateTimeFormat().resolvedOptions().locale; } let Xi = { locale: hu(), currency: "GBP", currencySign: "£", thousands: "," }; const Yi = (e, t, n = 1) => { const s = t < e ? -Math.abs(n) : n; return Array(1 + Math.floor(Math.abs((t - e) / n))).fill(e).map((r, o) => r + o * s); }; function Gt(e, t = {}) { return new Intl.NumberFormat( t.locale, t ).format(e); } function fu(e, t = {}) { return Gt( e, { style: "currency", currency: Xi.currency, ...t } ); } function gu(e, t = Xi.thousands) { if (Ms(e)) return ""; const n = e.toString().split("."), s = /(\d+)(\d{3})/; for (; s.test(n[0]); ) n[0] = n[0].replace(s, `$1${t}$2`); return n.join("."); } function un(e, t = /,\s*|\s+/) { return Ms(e) ? [] : De(e) ? e.length ? e.split(t) : [] : Be(e) ? e : [e]; } function Ot(e, t = !0, n = {}) { return ve(e) ? e : un(e).reduce( (s, r) => (s[r] = It(t) ? t(r) : t, s), n ); } function Wr(e) { return e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(); } function pu(e, t = {}) { const n = t[e]; if (T(n)) return n; let s; return e.match(/(ss?|sh|ch|x)$/) ? e + "es" : (s = e.match(/(.*?[^aeiou])y$/)) ? s[1] + "ies" : e.match(/([^s\d\W])$/) ? e + "s" : e; } function mu(e, t, n, s = "no") { return (e ? gu(e) : s) + " " + (e === 1 ? t : n || pu(t)); } const bu = Wr; function vu(e) { if (It(e)) return e; if (uu(e)) return (t) => e.test(t); if (ve(e)) return (t) => !!e[t]; if (Be(e) || De(e)) { const t = Ot(e); return (n) => !!t[n]; } else $s("Invalid selector() specification: " + e); } const Vn = (e, t, n = {}) => { let s = {}; const r = { delete: !1, ...n }, o = vu(t); return Object.keys(e).map( (i) => { if (o(i)) { let a = e[i]; r.delete && delete e[i], r.key && (i = r.key(i)), r.value && (a = r.value(a)), s = { ...s, [i]: a }; } } ), s; }, Hr = (e, t) => It(t) ? t(e) : e[t], jo = (e, t) => { const n = Hr(e, t); return Fn(n) ? n : De(n) && parseInt(n) || 0; }, Wo = (e, t) => { const n = Hr(e, t); return cn(n) ? n : De(n) && parseFloat(n) || 0; }, Ho = (e, t) => (Hr(e, t) || "").toString(), zo = (e) => (t, n) => jo(t, e) - jo(n, e), tr = (e) => (t, n) => Wo(t, e) - Wo(n, e), nr = (e) => (t, n) => { const s = Ho(t, e).toLowerCase(), r = Ho(n, e).toLowerCase(); return s > r ? 1 : r > s ? -1 : 0; }, Cu = (e) => (t, n) => e(n, t); function yu(e, t = 300) { let n; return (...s) => { clearTimeout(n), n = setTimeout( () => e(...s), t ); }; } function zr(e) { return new Promise((t) => setTimeout(t, e)); } const xu = (e) => e.filter(T).join(" "), wu = (e) => Object.entries(e).filter(([, t]) => t).map(([t]) => t), M = (...e) => xu( e.flatMap( (t) => ve(t) ? wu(t) : t ) ), Ur = (e) => { if (!e) return null; const [t, n, s, r, o] = e.split("-"); return M( t, $u(n), Du(s), Ou(r), Tu(o) ); }, Gi = ({ className: e, size: t, color: n, ...s }) => ({ ...s, className: M( e, t, Ur(n) ) }), Su = ({ className: e, size: t, color: n, border: s, radius: r, shadow: o, grid: i, stack: a, gap: c, pad: u, mar: d, padding: h = u, margin: g = d, ...f }, ...m) => ({ ...f, className: M( ...m, e, t, Ur(n), bt(s), Ct(r), vt(o), Ru(i), qr(c), Lu(a), Nu(h), Mu(g) ) }), Kr = (...e) => { const { className: t, ...n } = Su(...e); return M(t, n); }, bt = (e) => Xr(e, "border", (t) => `border bdw-${t}`), vt = (e) => Xr(e, "shadow-1", (t) => `shadow-${t}`), Ru = (e) => _r(e, "grid-1", (t) => `grid-${t}`), Lu = (e) => e ? `stack-${e}` : null, Nu = (e) => Zi(e, "pad"), Mu = (e) => Zi(e, "mar"), Ct = (e) => Xr(e, "bdr-1", (t) => `bdr-${t}`), $u = (e) => Os(e, (t) => `fgc-${t}`), Du = (e) => Os(e, (t) => `bgc-${t}`), Ou = (e) => Os(e, (t) => `fgd-${t}`), Tu = (e) => Os(e, (t) => `bgd-${t}`), qr = (e) => _r( e, "gap-1", (t) => { const n = un(t); return n.length === 2 ? br("gap", ["v", "h"], n) : `gap-${t}`; } ), Os = (e, t) => Fn(parseInt(e)) ? re(t, e) : null, _r = (e, t, n) => e === !0 ? t : T(e) ? re(n, e) : null, Xr = (e, t, n) => e === !0 ? t : Fn(parseInt(e)) ? re(n, e) : null, Zi = (e, t) => _r( e, t, (n) => ku(t, un(n)) ), ku = (e, t) => t.length === 2 ? br(e, ["v", "h"], t) : t.length === 4 ? br(e, ["t", "r", "b", "l"], t) : t.map((n) => `${e}-${n}`).join(" "), br = (e, t, n) => n.map((s, r) => `${e}-${t[r]}-${s}`).join(" "); function Iu(e) { return typeof e == "string"; } function Ji(e) { return Array.isArray(e); } function Eu(e) { return typeof e == "function"; } function Uo(e) { return typeof e == "object" && !Ji(e) && !Pu(e); } function Pu(e) { return e === null; } function Au(...e) { throw new Error(e.join("")); } function Fu() { return Intl.DateTimeFormat().resolvedOptions().locale; } Fu(); const Vu = () => { const e = Tt({}); return { Context: e, Provider: ({ children: t, ...n }) => /* @__PURE__ */ l(e.Provider, { value: n, children: t }), Themed: (t, n = t.displayName || t.name) => Or( (s, r) => /* @__PURE__ */ l(e.Consumer, { children: (o) => { let i = t; const a = o[n]; let c; if (!a) return /* @__PURE__ */ l( t, { ref: r, ...s } ); if (Ji(a) ? (i = a[0], c = a[1]) : c = a, Eu(c)) { const u = c( s, r, o ); if (Ti(u)) return u; if (Uo(u)) return /* @__PURE__ */ l( i, { ref: r, ...u } ); } return Uo(c) ? /* @__PURE__ */ l( i, { ref: r, ...c, ...s } ) : /* @__PURE__ */ l( i, { ref: r, ...s } ); } }) ) }; }, Bu = Vu(), L = Bu.Themed, xC = (e = {}) => (t) => Object.entries(e).reduce( (n, [s, r]) => { const o = n[s]; if (!o || !(Iu(o) || o === !0)) return n; const i = { ...o === !0 ? r : r[o] || Au(`Invalid variants value for ${s}: ${o}`), ...n }; return delete i[s], i; }, t ), ju = (e) => /* @__PURE__ */ l( Ui, { ...Gi(e) } ), _ = L(ju, "Icon"); function Wu(e, t, n = {}) { return T(t) && (n[e] = Fn(t) ? `${t}deg` : t), Object.keys(n).length ? n : null; } const Hu = (e, t, n = {}) => ({ ...Object.entries(e).reduce( (s, [r, o]) => { const i = t[r]; return T(i) && (s[o] = i), s; }, t.style || {} ), ...n }), sr = (e, { side: t = "" } = {}) => { const n = `icon${t}`, s = e[n], r = ve(s) ? s : { name: s }, o = M( r.className, e[`${n}Class`], t ? `on-${t.toLowerCase()}` : null ); o.length && (r.className = o); const i = e[`${n}Rotate`]; return T(i) && (r.style = Wu("--icon-rotate", i, r.style)), r; }, Ko = (e) => De(e) ? { name: e } : e, zu = ({ icon: e, iconLeft: t, iconRight: n, spanText: s, spanClass: r, text: o, children: i, ...a }) => /* @__PURE__ */ S(be, { children: [ !!e && /* @__PURE__ */ l( _, { ...sr({ icon: e, ...a }), fixedWidth: !0 } ), !!t && /* @__PURE__ */ l( _, { ...sr({ iconLeft: t, ...a }, { side: "Left" }), fixedWidth: !0 } ), s ? /* @__PURE__ */ l("span", { className: r ?? "", children: o || i }) : o || i, !!n && /* @__PURE__ */ l( _, { ...sr({ iconRight: n, ...a }, { side: "Right" }), fixedWidth: !0 } ) ] }), yt = L(zu, "WithIcons"), Uu = ({ summary: e, summaryClass: t, toggleOpen: n, detailsSummaryClass: s = "summary", summarySpanClass: r = "summary-text", ...o }) => /* @__PURE__ */ l( "div", { onClick: n, className: M(s, t), children: /* @__PURE__ */ l( yt, { text: e, spanText: !0, spanClass: r, ...Vn(o, /^(icon|text)/) } ) } ), Qi = ({ content: e, children: t, contentClass: n }) => /* @__PURE__ */ l("div", { className: n, children: e || t }), Ku = ({ className: e, size: t, color: n, lined: s, border: r, radius: o, shaded: i, shadow: a, isOpen: c, toggleOpen: u, detailsClass: d = "details", noIconClass: h = "no-icon", wideSummary: g, wideSummaryClass: f = "wide-summary", Summary: m = Uu, Content: p = Qi, ...b }) => /* @__PURE__ */ S( "div", { className: M( d, h, e, n, bt(r), Ct(o), vt(a), { size: t, color: n, lined: s, shaded: i, open: c, [f]: g } ), children: [ /* @__PURE__ */ l(m, { toggleOpen: u, ...b }), !!c && /* @__PURE__ */ l(p, { ...b }) ] } ), qu = Ir.Consumer(Ku), _u = ({ summary: e, summaryClass: t }) => /* @__PURE__ */ l("summary", { className: t, children: e }), Xu = ({ className: e, size: t, color: n, lined: s, border: r, radius: o, shaded: i, shadow: a, open: c, Summary: u = _u, Content: d = Qi, ...h }) => /* @__PURE__ */ S( "details", { className: M( e, n, bt(r), Ct(o), vt(a), { size: t, color: n, lined: s, shaded: i } ), open: c, children: [ /* @__PURE__ */ l(u, { ...h }), /* @__PURE__ */ l(d, { ...h }) ] } ), Yu = { iconLeft: "angle-right", iconLeftRotate: 90, iconRightRotate: -90 }, Gu = ({ native: e, open: t, Container: n = e ? Xu : qu, ...s }) => /* @__PURE__ */ l(Ir.Provider, { open: t, children: /* @__PURE__ */ l(n, { ...Yu, ...s }) }), Zu = L(Gu, "Details"), Ju = ({ items: e, shadow: t, radius: n, className: s, accordionClass: r = "accordion", ...o }) => /* @__PURE__ */ l( "div", { className: M( s, r, vt(t), Ct(n) ), children: e.map( (i, a) => /* @__PURE__ */ l( Zu, { radius: n, ...o, ...i }, i.key ?? i.id ?? a ) ) } ), wC = L(Ju, "Accordion"), Qu = (e) => /* @__PURE__ */ l( cu, { ...Gi(e) } ), SC = L(Qu, "Icons"), ed = ({ dismissable: e, dismiss: t, revealable: n, isRevealed: s, openIcon: r = "angle-down", closedIcon: o = "angle-left", dismissIcon: i = "cross" }) => /* @__PURE__ */ S("div", { className: "on-right", children: [ !!e && /* @__PURE__ */ l( _, { name: i, fixedWidth: !0, className: "dismiss", onClick: () => t(!0) } ), !!n && /* @__PURE__ */ l( _, { name: s ? r : o, fixedWidth: !0, className: "reveal" } ) ] }), ea = L(ed, "AlertControls"), td = ({ headline: e, headIcon: t, headicon: n = t, toggle: s, revealable: r = !1, controlProps: o, Controls: i = ea }) => /* @__PURE__ */ S( "div", { className: "headline flex space", onClick: r ? s : null, children: [ /* @__PURE__ */ S("div", { children: [ !!n && /* @__PURE__ */ l( _, { name: n, fixedWidth: !0, className: "on-left" } ), e ] }), /* @__PURE__ */ l(i, { ...o }) ] } ), nd = L(td, "AlertHeadline"), sd = ({ title: e, text: t, children: n }) => /* @__PURE__ */ S(be, { children: [ e && /* @__PURE__ */ l("h3", { children: e }), t ? /* @__PURE__ */ l("p", { children: t }) : n ] }), ta = L(sd, "AlertContent"), rd = ({ icon: e, Content: t = ta, ...n }) => /* @__PURE__ */ S("div", { className: "side-icon", children: [ /* @__PURE__ */ l(_, { name: e }), /* @__PURE__ */ l("div", { className: "wide", children: /* @__PURE__ */ l(t, { ...n }) }) ] }), od = L(rd, "AlertIcon"); function RC(e) { return e.split(/\s*[;&]\s*/).filter((t) => t.length > 0).reduce( (t, n) => { const [s, r] = n.split(/\s*[:=]\s*/); return t[s] = qi(r) ? !0 : r, t; }, {} ); } const id = "unknown", ad = "mobile", ld = "tablet", cd = "laptop", ud = "desktop", dd = "widescreen", hd = "ultra", Ts = { [id]: 0, [ad]: 480, [ld]: 720, [cd]: 960, [ud]: 1200, [dd]: 1440 }, fd = { breakpoints: Ts, largest: hd }, Yr = (e = 0, t = {}) => { const n = { ...fd, ...t }, s = Object.entries(n.breakpoints).find( ([, r]) => e <= r ); return s ? s[0] : n.largest; }, gd = (e = window) => typeof e > "u" ? !1 : e.innerWidth, LC = (e, t) => Yr(gd(e), t), Bn = (e) => Ki(e) || !e.separator && !e.heading && !e.disabled, na = (e) => Ki(e) ? e : e.value ?? e.id, sa = (e, t, n = na) => { if (Ms(t)) return []; const s = n(t), r = e.findIndex( (o) => s === n(o) ); return r >= 0 ? [e[r], r] : []; }, pd = (e, t) => { const n = e.toLowerCase().split(/\s+/); return t.filter( (s) => { const r = ve(s), o = r ? s.search ?? s.text ?? s.label ?? s.name ?? s.value : s; if (r && s.fixed) return !0; if (T(o)) { const i = o.toString().toLowerCase(); return n.every( (a) => i.indexOf(a) >= 0 ); } return !1; } ); }; function md(e, t = Bn) { const n = e.findIndex(t); return n < 0 ? null : n; } function bd(e, t = Bn) { for (let n = e.length - 1; n >= 0; n--) if (t(e[n])) return n; return null; } function vd(e, t, n = Bn) { for (let s = 1; s <= e.length; s++) { const r = (t + s) % e.length; if (n(e[r])) return r; } return null; } function Cd(e, t, n = Bn) { for (let s = 1; s <= e.length; s++) { const r = (t + e.length - s) % e.length; if (n(e[r])) return r; } return null; } const yd = (e) => e == null ? void 0 : e.stopPropagation(), xd = { ...Ts, cols: !0 }, wd = (e) => { const t = { ...e }; return [Vn( t, xd, { delete: !0 } ), t]; }, Sd = (e, t) => { const [n, s] = wd(e); return [Rd(n, t), s]; }, Rd = (e, t) => { if (!t) return `grid-${e.cols || 1}`; let n = e.cols || 1; const s = Object.keys(Ts), r = s.indexOf(t); if (r >= 0) { const i = s.slice(r).find( (a) => e[a] ); i && (n = e[i]); } return `grid-${n}`; }, Lt = (e) => cn(e) ? e : parseFloat(e), vr = (e, t, n) => un(e).find( (s) => t[s] !== n[s] ), Gr = (e) => (t) => { e.forEach( (n) => { It(n) ? n(t) : n != null && (n.current = t); } ); }, Dt = (e) => { const t = `HINT: define ${e}() to render this value`; return (n) => De(n) || cn(n) ? n : ve(n) ? n.text ?? n.label ?? n.name ?? n.heading ?? t : t; }, Ld = (e) => De(e) || cn(e) ? e : /* @__PURE__ */ l(yt, { ...e }), ra = (e, t) => { if (!e || !t) return; const n = t.offsetTop, s = n + t.offsetHeight, r = e.scrollTop, o = r + e.offsetHeight; n < r ? e.scrollTo({ top: n }) : s > o && e.scrollTo({ top: r + (s - o) }); }, Nd = (e) => { const t = e.match(/^(\d+)px$/); if (t) return parseInt(t[1]); const n = e.match(/^(\d+)rem$/); if (n) return parseInt(n[1] * 16); const s = e.match(/^(\d+)$/); return s ? parseInt(s[1]) : Ts[e] || $s(`Invalid size specified: ${e}`); }; function Md() { let e = {}; return { clear: () => e = {}, getItem: (t) => e[t], setItem: (t, n) => e[t] = n, removeItem: (t) => delete e[t] }; } const ns = typeof window < "u" && window.localStorage || Md(), ss = (e, t) => [e, t].join("-"); function Zr(e) { return { get: (t, n) => { const s = ns.getItem( ss(e, t) ); return T(s) ? JSON.parse(s) : T(n) ? (ns.setItem( ss(e, t), JSON.stringify(n) ), n) : null; }, set: (t, n) => ns.setItem( ss(e, t), JSON.stringify(n) ), delete: (t) => ns.removeItem( ss(e, t) ) }; } const oa = (e) => e.charAt(0).toUpperCase() + e.slice(1), NC = (e = {}, t = {}) => Object.entries(t).reduce( (n, [s, r]) => { const o = n[s]; if (!o) return n; const a = { ...r[o] || $s(`Invalid themedProps() value for ${s}: ${o}`), ...n }; return delete a[s], a; }, e ), MC = (e, t, n = {}) => { const s = e.variant || Object.keys(t).find((r) => e[r]) || "default"; return t[s] || t.default || n; }, Je = ({ title: e, headline: t, headicon: n, headIcon: s = n, type: r, size: o, color: i, compact: a, stripe: c, border: u, radius: d, shadow: h, className: g, text: f, children: m, onDismiss: p, icon: b, dismissable: v = !1, revealable: y = !1, revealed: C = !1, openIcon: x, closedIcon: w, dismissIcon: $, Headline: R = nd, Controls: N = ea, Content: k = ta, Icon: O = od }) => { const [D, j] = B(y ? C : !0), [A, z] = B(!1), Ce = M( "alert", r, o, i, g, { compact: a, revealable: y, dismissable: v, stripe: c }, D ? "revealed" : null, vt(h), bt(u), Ct(d) ), te = () => j((oe) => !oe), Y = { dismissable: v, revealable: y, isRevealed: D, dismiss: () => { z(!0), p && p(); }, openIcon: x, closedIcon: w, dismissIcon: $ }, ne = { title: e, text: f, children: m }, ue = { ...ne, icon: b, Content: k }, Vt = { headline: t, headIcon: s, toggle: te, revealable: y, controlProps: Y, Controls: N }; return A ? null : /* @__PURE__ */ S("div", { className: Ce, children: [ !!t && /* @__PURE__ */ l(R, { ...Vt }), D && (b ? /* @__PURE__ */ l(O, { ...ue }) : /* @__PURE__ */ l(k, { ...ne })) ] }); }, $d = L( (e) => /* @__PURE__ */ l(Je, { ...e, type: "info" }), "Info" ), Dd = L( (e) => /* @__PURE__ */ l(Je, { ...e, type: "success" }), "Success" ), Od = L( (e) => /* @__PURE__ */ l(Je, { ...e, type: "warning" }), "Warning" ), Td = L( (e) => /* @__PURE__ */ l(Je, { ...e, type: "error" }), "Error" ); Je.Info = $d; Je.Success = Dd; Je.Warning = Od; Je.Error = Td; const $C = L(Je, "Alert"), kd = ({ prefix: e, prefixClass: t = "prefix" }) => /* @__PURE__ */ l("div", { className: t, children: e }), Id = ({ suffix: e, suffixClass: t = "suffix" }) => /* @__PURE__ */ l("div", { className: t, children: e }), Ed = ({ size: e, color: t, compact: n, className: s, tag: r, shadow: o, border: i, radius: a, tooltip: c, icon: u, iconClass: d, iconLeft: h, iconLeftClass: g, iconRight: f, iconRightClass: m, label: p, text: b, prefix: v, suffix: y, children: C, Prefix: x = kd, Suffix: w = Id, Content: $ = yt, ...R }) => { const N = M( "badge", e, t, s, { compact: n, tag: r, icon: u }, vt(o), bt(i), Ct(a) ), k = { icon: u, iconClass: d, iconLeft: h, iconLeftClass: g, iconRight: f, iconRightClass: m, text: b, children: C }; return /* @__PURE__ */ S( "div", { className: N, "data-tooltip": c, "aria-label": p, ...R, children: [ !!v && /* @__PURE__ */ l(x, { prefix: v, ...R }), /* @__PURE__ */ l( $, { ...k } ), !!y && /* @__PURE__ */ l(w, { suffix: y, ...R }) ] } ); }, DC = L(Ed, "Badge"), Pd = ({ type: e = "button", size: t, color: n, className: s, disabled: r, bright: o, dark: i, outline: a, bare: c, shaded: u, shadow: d, border: h, radius: g, label: f, tooltip: m, tabIndex: p = 0, icon: b, iconClass: v, iconLeft: y, iconLeftClass: C, iconRight: x, iconRightClass: w, text: $, children: R, Content: N = yt, ...k }) => { const O = M( t, n, s, { bright: o, dark: i, outline: a, bare: c, shaded: u, icon: b }, vt(d), bt(h), Ct(g) ); return /* @__PURE__ */ l( "button", { className: O, "aria-label": f, tabIndex: p, type: e, disabled: r, "aria-disabled": r, "data-tooltip": m, ...k, children: /* @__PURE__ */ l( N, { ...{ icon: b, iconClass: v, iconLeft: y, iconLeftClass: C, iconRight: x, iconRightClass: w, text: $, children: R } } ) } ); }, Se = L(Pd, "Button"), Ad = ({ buttons: e, children: t, className: n = "buttons", buttonClass: s, Button: r = Se, ...o }) => /* @__PURE__ */ l("div", { className: n, children: e ? e.map( (i, a) => /* @__PURE__ */ l( r, { className: s, ...o, ...i }, a ) ) : t }), Cr = L(Ad, "Buttons"), Fd = ({ className: e, disabled: t, children: n, ref: s }) => /* @__PURE__ */ l( "label", { className: M(e, { disabled: t }), ref: s, children: n } ), Vd = L(Fd, "CheckboxLabel"), Bd = ({ disabled: e = !1, tabIndex: t = 0, onChange: n = E, inputClass: s, round: r, square: o, ref: i, switch: a, ...c }) => /* @__PURE__ */ l( "input", { type: "checkbox", ref: i, "aria-disabled": e, tabIndex: e ? -1 : t, onChange: (u) => n(u.target.checked), className: M(s, { round: r, square: o }), role: a ? "switch" : null, ...c } ), jd = L(Bd, "CheckboxInput"), Wd = ({ size: e, color: t, border: n, inline: s, className: r = "checkbox", text: o, ref: i, inputRef: a, checked: c, checkedText: u = o, uncheckedText: d = o, // icon, // checkedIcon=icon, // uncheckedIcon=icon, // iconClass, Label: h = Vd, Input: g = jd, ...f }) => /* @__PURE__ */ S( h, { className: M( e, t, r, bt(n), { inline: s } ), ref: i, checked: c, ...f, children: [ /* @__PURE__ */ l(g, { ref: a, checked: c, ...f }), c ? u : d ] } ), ia = L(Wd, "Checkbox"), Hd = ({ checked: e = !1 } = {}) => { const [t, n] = B(e); return { isChecked: t, setChecked: n, check: () => n(!0), uncheck: () => n(!1) }; }, OC = ({ checked: e = !1, onChange: t, ...n }) => { const { isChecked: s, setChecked: r } = Hd({ checked: e }); return /* @__PURE__ */ l( ia, { checked: s, onChange: (i) => { r(i), t && t(i); }, ...n } ); }, Jr = ({ visible: e = !1 } = {}) => { const [t, n] = B(e); return { isVisible: t, setVisible: n, show: () => n(!0), hide: () => n(!1) }; }, zd = ({ close: e, icon: t = "cross", className: n = "close" }) => /* @__PURE__ */ l("div", { className: n, onClick: e, children: /* @__PURE__ */ l(_, { name: t }) }), Ud = L(zd, "ModalClose"), Kd = ({ title: e, header: t }) => e || t ? /* @__PURE__ */ S("header", { children: [ !!e && /* @__PURE__ */ l("h3", { children: e }), t ] }) : null, qd = L(Kd, "ModalHeader"), _d = ({ footer: e }) => !!e && /* @__PURE__ */ l("footer", { children: e }), Xd = L(_d, "ModalFooter"), Yd = ({ text: e, children: t, Header: n = qd, Footer: s = Xd, ...r }) => /* @__PURE__ */ S("article", { onClick: yd, children: [ /* @__PURE__ */ l(n, { ...r }), e || t, /* @__PURE__ */ l(s, { ...r }) ] }), Gd = L(Yd, "ModalC