vex-ui-kit 1.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.
Files changed (44) hide show
  1. package/README.md +830 -0
  2. package/dist/adapters/react.cjs.js +17 -0
  3. package/dist/adapters/react.cjs.js.map +1 -0
  4. package/dist/adapters/react.d.mts +37 -0
  5. package/dist/adapters/react.d.ts +37 -0
  6. package/dist/adapters/react.esm.js +17 -0
  7. package/dist/adapters/react.esm.js.map +1 -0
  8. package/dist/adapters/react.umd.js +63 -0
  9. package/dist/adapters/react.umd.js.map +1 -0
  10. package/dist/adapters/svelte.cjs.js +17 -0
  11. package/dist/adapters/svelte.cjs.js.map +1 -0
  12. package/dist/adapters/svelte.d.mts +21 -0
  13. package/dist/adapters/svelte.d.ts +21 -0
  14. package/dist/adapters/svelte.esm.js +17 -0
  15. package/dist/adapters/svelte.esm.js.map +1 -0
  16. package/dist/adapters/svelte.umd.js +44 -0
  17. package/dist/adapters/svelte.umd.js.map +1 -0
  18. package/dist/adapters/vue.cjs.js +17 -0
  19. package/dist/adapters/vue.cjs.js.map +1 -0
  20. package/dist/adapters/vue.d.mts +35 -0
  21. package/dist/adapters/vue.d.ts +35 -0
  22. package/dist/adapters/vue.esm.js +17 -0
  23. package/dist/adapters/vue.esm.js.map +1 -0
  24. package/dist/adapters/vue.umd.js +147 -0
  25. package/dist/adapters/vue.umd.js.map +1 -0
  26. package/dist/index-CpFq7Lxe.d.mts +213 -0
  27. package/dist/index-CpFq7Lxe.d.ts +213 -0
  28. package/dist/themes/flat.css +47 -0
  29. package/dist/themes/glass.css +22 -0
  30. package/dist/themes/minimal.css +35 -0
  31. package/dist/themes/neon.css +45 -0
  32. package/dist/themes/outline.css +18 -0
  33. package/dist/themes/pastel.css +21 -0
  34. package/dist/themes/tokens.css +329 -0
  35. package/dist/vex-ui-kit.css +329 -0
  36. package/dist/vexui.cjs.js +17 -0
  37. package/dist/vexui.cjs.js.map +1 -0
  38. package/dist/vexui.d.mts +1 -0
  39. package/dist/vexui.d.ts +1 -0
  40. package/dist/vexui.esm.js +17 -0
  41. package/dist/vexui.esm.js.map +1 -0
  42. package/dist/vexui.umd.js +17 -0
  43. package/dist/vexui.umd.js.map +1 -0
  44. package/package.json +63 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/react.ts","../../src/core/queue.ts","../../src/core/history.ts","../../src/core/a11y.ts","../../src/core/alert.ts","../../src/core/modal.ts","../../src/core/drawer.ts","../../src/core/flow.ts","../../src/core/theme.ts","../../src/index.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\nimport vex from '../index'\nimport type { AlertOptions } from '../core/alert'\n\nexport function useVex() {\n const ids = useRef<string[]>([])\n \n // Wrap alert methods to track IDs\n const wrappedAlert = {\n ...vex.alert,\n success: (msg: string, opts?: Partial<AlertOptions>) => { const id = vex.alert.success(msg, opts); ids.current.push(id); return id; },\n error: (msg: string, opts?: Partial<AlertOptions>) => { const id = vex.alert.error(msg, opts); ids.current.push(id); return id; },\n warning: (msg: string, opts?: Partial<AlertOptions>) => { const id = vex.alert.warning(msg, opts); ids.current.push(id); return id; },\n info: (msg: string, opts?: Partial<AlertOptions>) => { const id = vex.alert.info(msg, opts); ids.current.push(id); return id; },\n neutral: (msg: string, opts?: Partial<AlertOptions>) => { const id = vex.alert.neutral(msg, opts); ids.current.push(id); return id; },\n loading: (msg: string, opts?: Partial<AlertOptions>) => { const id = vex.alert.loading(msg, opts); ids.current.push(id); return id; },\n upload: (msg: string, opts?: Partial<AlertOptions>) => { const id = vex.alert.upload(msg, opts); ids.current.push(id); return id; },\n inline: (selector: string | HTMLElement, opts: AlertOptions) => { const id = vex.alert.inline(selector, opts); ids.current.push(id); return id; },\n fixed: (opts: AlertOptions) => { const id = vex.alert.fixed(opts); ids.current.push(id); return id; },\n attach: (selector: string | HTMLElement, opts: AlertOptions) => { const id = vex.alert.attach(selector, opts); ids.current.push(id); return id; },\n show: (opts: AlertOptions) => { const id = vex.alert.show(opts); ids.current.push(id); return id; }\n };\n\n useEffect(() => {\n return () => {\n ids.current.forEach(id => vex.dismiss(id));\n }\n }, [])\n\n return {\n ...vex,\n alert: wrappedAlert\n }\n}\n\nexport const VexProvider = ({ children, config }: { children: React.ReactNode, config?: any }) => {\n useEffect(() => {\n if (config) vex.configure(config);\n }, [config]);\n return children; // Logicless provider mostly for config\n}\n","export type Priority = 'critical' | 'high' | 'normal' | 'low';\n\nexport interface QueueItem {\n id: string;\n priority: Priority;\n show: () => void;\n close: () => void;\n}\n\nexport class AlertQueue {\n private active: QueueItem[] = [];\n private pending: QueueItem[] = [];\n private maxStack: number = 5;\n\n public setMaxStack(max: number) {\n this.maxStack = max;\n }\n\n public add(item: QueueItem) {\n // If we have space, show immediately\n if (this.active.length < this.maxStack) {\n this.active.push(item);\n item.show();\n return;\n }\n\n // If full, check priority\n if (item.priority === 'critical') {\n // Find the oldest item with lower priority\n // We sort active by arrival (index) and filter by priority < critical\n const victimIndex = this.active.findIndex(i => this.getPriorityValue(i.priority) < this.getPriorityValue('critical'));\n \n if (victimIndex !== -1) {\n const victim = this.active[victimIndex];\n victim.close();\n \n // Optimistically remove from active to allow immediate show of critical alert\n this.active.splice(victimIndex, 1);\n \n this.pending.unshift(item);\n } else {\n this.pending.unshift(item);\n }\n } else if (item.priority === 'high') {\n // Enqueue at front of pending\n this.pending.unshift(item);\n } else {\n // Enqueue at end\n this.pending.push(item);\n }\n \n // Sort pending to ensure high/critical are always first if multiple are waiting\n this.sortPending();\n this.process();\n }\n\n public remove(id: string) {\n const index = this.active.findIndex(i => i.id === id);\n if (index !== -1) {\n this.active.splice(index, 1);\n this.process();\n }\n }\n\n private process() {\n if (this.active.length < this.maxStack && this.pending.length > 0) {\n const next = this.pending.shift();\n if (next) {\n this.active.push(next);\n next.show();\n }\n }\n }\n \n private sortPending() {\n this.pending.sort((a, b) => this.getPriorityValue(b.priority) - this.getPriorityValue(a.priority));\n }\n\n private getPriorityValue(p: Priority): number {\n switch (p) {\n case 'critical': return 4;\n case 'high': return 3;\n case 'normal': return 2;\n case 'low': return 1;\n default: return 2;\n }\n }\n}\n","export interface HistoryEntry {\n id: string;\n type: string;\n title?: string;\n message: string;\n timestamp: Date;\n read: boolean;\n}\n\nexport class HistoryManager {\n private entries: HistoryEntry[] = [];\n private limit = 100;\n private storageKey = 'vex_history';\n\n constructor() {\n this.load();\n }\n\n public add(entry: Omit<HistoryEntry, 'timestamp' | 'read'>) {\n const fullEntry: HistoryEntry = {\n ...entry,\n timestamp: new Date(),\n read: false\n };\n \n this.entries.unshift(fullEntry);\n if (this.entries.length > this.limit) {\n this.entries = this.entries.slice(0, this.limit);\n }\n this.save();\n }\n\n public get(): HistoryEntry[] {\n return this.entries;\n }\n\n public clear() {\n this.entries = [];\n this.save();\n }\n\n public markAllRead() {\n this.entries.forEach(e => e.read = true);\n this.save();\n }\n\n public markRead(id: string) {\n const entry = this.entries.find(e => e.id === id);\n if (entry) {\n entry.read = true;\n this.save();\n }\n }\n \n // Basic implementation of open - renders a dropdown\n public open(anchorSelector: string) {\n if (typeof document === 'undefined') return;\n \n const anchor = document.querySelector(anchorSelector);\n if (!anchor) {\n console.warn(`VexUI: History anchor ${anchorSelector} not found`);\n return;\n }\n\n // Remove existing if any\n const existing = document.getElementById('vex-history-dropdown');\n if (existing) existing.remove();\n\n const dropdown = document.createElement('div');\n dropdown.id = 'vex-history-dropdown';\n dropdown.className = 'vex-history-dropdown';\n \n // Position it relative to anchor\n const rect = anchor.getBoundingClientRect();\n dropdown.style.position = 'absolute';\n dropdown.style.top = `${rect.bottom + 8 + window.scrollY}px`;\n dropdown.style.left = `${rect.left + window.scrollX}px`;\n dropdown.style.zIndex = '9999';\n \n // Content\n const list = this.entries.map(e => `\n <div class=\"vex-hist-item ${e.read ? 'read' : 'unread'}\" data-id=\"${e.id}\">\n <div class=\"vex-hist-icon ${e.type}\"></div>\n <div class=\"vex-hist-content\">\n <div class=\"vex-hist-title\">${e.title || e.type}</div>\n <div class=\"vex-hist-msg\">${e.message}</div>\n <div class=\"vex-hist-time\">${e.timestamp.toLocaleTimeString()}</div>\n </div>\n </div>\n `).join('') || '<div class=\"vex-hist-empty\">No notifications</div>';\n\n dropdown.innerHTML = `\n <div class=\"vex-hist-header\">\n <span>Notifications</span>\n <button id=\"vex-hist-clear\">Clear</button>\n </div>\n <div class=\"vex-hist-list\">${list}</div>\n `;\n\n document.body.appendChild(dropdown);\n \n // Close on click outside\n const closeHandler = (e: MouseEvent) => {\n if (!dropdown.contains(e.target as Node) && e.target !== anchor) {\n dropdown.remove();\n document.removeEventListener('click', closeHandler);\n }\n };\n setTimeout(() => document.addEventListener('click', closeHandler), 0);\n \n // Clear handler\n dropdown.querySelector('#vex-hist-clear')?.addEventListener('click', () => {\n this.clear();\n dropdown.remove();\n });\n }\n\n private save() {\n if (typeof localStorage !== 'undefined') {\n try {\n localStorage.setItem(this.storageKey, JSON.stringify(this.entries));\n } catch (e) {\n // ignore quota errors\n }\n }\n }\n\n private load() {\n if (typeof localStorage !== 'undefined') {\n const stored = localStorage.getItem(this.storageKey);\n if (stored) {\n try {\n this.entries = JSON.parse(stored, (key, value) => {\n if (key === 'timestamp') return new Date(value);\n return value;\n });\n } catch (e) {\n console.error('Failed to load VexUI history', e);\n }\n }\n }\n }\n}\n\nexport const historyManager = new HistoryManager();\n","/**\n * VexUI Accessibility Utilities\n *\n * Implements focus trapping, focus restoration, and ARIA attributes management\n * for modals, drawers, and alerts.\n */\n\n// Helper to get all focusable elements within a container\nexport function getFocusableElements(container: HTMLElement): HTMLElement[] {\n const selector = 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n return Array.from(container.querySelectorAll<HTMLElement>(selector)).filter(\n (el) => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden')\n );\n}\n\n// Trap focus within a container\nexport function trapFocus(container: HTMLElement, event: KeyboardEvent): void {\n const focusable = getFocusableElements(container);\n if (focusable.length === 0) return;\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n\n if (event.shiftKey) {\n if (document.activeElement === first) {\n last.focus();\n event.preventDefault();\n }\n } else {\n if (document.activeElement === last) {\n first.focus();\n event.preventDefault();\n }\n }\n}\n\n// Store previously focused element to restore later\nlet previousFocus: HTMLElement | null = null;\n\nexport function saveFocus(): void {\n if (typeof document !== 'undefined' && document.activeElement) {\n previousFocus = document.activeElement as HTMLElement;\n }\n}\n\nexport function restoreFocus(): void {\n if (previousFocus && typeof document !== 'undefined' && document.body.contains(previousFocus)) {\n previousFocus.focus();\n previousFocus = null;\n }\n}\n\n// Set ARIA attributes for alerts\nexport function setupAlertA11y(element: HTMLElement, priority: 'critical' | 'high' | 'normal' | 'low'): void {\n element.setAttribute('role', 'alert');\n // Critical/High should be assertive, others polite\n const liveMode = (priority === 'critical' || priority === 'high') ? 'assertive' : 'polite';\n element.setAttribute('aria-live', liveMode);\n element.setAttribute('aria-atomic', 'true');\n}\n\n// Set ARIA attributes for modals\nexport function setupModalA11y(element: HTMLElement, titleId: string, descId?: string): void {\n element.setAttribute('role', 'dialog');\n element.setAttribute('aria-modal', 'true');\n element.setAttribute('aria-labelledby', titleId);\n if (descId) {\n element.setAttribute('aria-describedby', descId);\n }\n}\n","import { AlertQueue, QueueItem } from './queue';\nimport { historyManager } from './history';\nimport { setupAlertA11y } from './a11y';\nimport { themeManager, ThemeTokens } from './theme';\n\nexport interface AlertAction {\n label: string;\n variant?: 'primary' | 'danger' | 'default';\n onClick?: (close: () => void) => void;\n}\n\nexport interface AlertOptions {\n type?: 'success' | 'error' | 'warning' | 'info' | 'neutral' | 'loading' | 'upload';\n title?: string;\n message: string;\n duration?: number; // ms, 0 = permanent\n dismissible?: boolean;\n icon?: string | null;\n progress?: boolean; // time bar\n actions?: AlertAction[];\n priority?: 'critical' | 'high' | 'normal' | 'low';\n position?: 'top' | 'bottom';\n align?: 'center' | 'left' | 'right';\n animate?: 'slide' | 'fade' | 'scale' | 'bounce';\n maxStack?: number;\n theme?: Partial<ThemeTokens>;\n onClose?: () => void;\n // Internal/Advanced\n renderer?: 'fixed' | 'inline' | 'attach';\n selector?: string | HTMLElement;\n placement?: 'top' | 'bottom' | 'left' | 'right' | 'auto';\n // Upload specific\n total?: number;\n}\n\nexport class AlertEngine {\n private queue = new AlertQueue();\n private activeAlerts = new Map<string, { element: HTMLElement, options: AlertOptions }>();\n\n constructor() {\n // Lazy init\n }\n\n // Public API methods\n public success(message: string, opts?: Partial<AlertOptions>) { return this.create({ ...opts, type: 'success', message }); }\n public error(message: string, opts?: Partial<AlertOptions>) { return this.create({ ...opts, type: 'error', message }); }\n public warning(message: string, opts?: Partial<AlertOptions>) { return this.create({ ...opts, type: 'warning', message }); }\n public info(message: string, opts?: Partial<AlertOptions>) { return this.create({ ...opts, type: 'info', message }); }\n public neutral(message: string, opts?: Partial<AlertOptions>) { return this.create({ ...opts, type: 'neutral', message }); }\n public loading(message: string, opts?: Partial<AlertOptions>) { return this.create({ ...opts, type: 'loading', message, duration: 0 }); }\n \n public upload(message: string, opts?: Partial<AlertOptions>) {\n return this.create({ ...opts, type: 'loading', message, duration: 0, icon: 'upload' });\n }\n\n public inline(selector: string | HTMLElement, opts: AlertOptions) {\n return this.create({ ...opts, renderer: 'inline', selector });\n }\n\n public fixed(opts: AlertOptions) {\n return this.create({ ...opts, renderer: 'fixed' });\n }\n\n public attach(selector: string | HTMLElement, opts: AlertOptions) {\n return this.create({ ...opts, renderer: 'attach', selector });\n }\n \n public show(opts: AlertOptions) {\n return this.create(opts);\n }\n\n // Main create method\n private create(opts: AlertOptions): string {\n const id = this.generateId();\n const fullOpts = this.processOptions(opts);\n \n // Add to queue\n this.queue.add({\n id,\n priority: fullOpts.priority || 'normal',\n show: () => this.render(id, fullOpts),\n close: () => this.dismiss(id)\n });\n\n // Log to history\n historyManager.add({\n id,\n type: fullOpts.type || 'info',\n title: fullOpts.title,\n message: fullOpts.message\n });\n\n return id;\n }\n\n private processOptions(opts: AlertOptions): AlertOptions {\n return {\n type: 'info',\n duration: 6000,\n dismissible: true,\n position: 'top',\n align: 'center',\n animate: 'slide',\n priority: 'normal',\n maxStack: 5,\n progress: true,\n ...opts\n };\n }\n\n private render(id: string, opts: AlertOptions) {\n if (typeof document === 'undefined') return;\n\n // Create element\n const el = document.createElement('div');\n el.setAttribute('data-id', id);\n el.className = `vex-alert vex-${opts.type}`;\n setupAlertA11y(el, opts.priority || 'normal');\n \n // Icon\n const iconEl = document.createElement('div');\n iconEl.className = 'vx-icon';\n if (opts.type === 'loading') {\n iconEl.innerHTML = '<div class=\"vx-spinner\"></div>';\n } else {\n iconEl.innerHTML = this.getIcon(opts.type || 'info', opts.icon);\n }\n el.appendChild(iconEl);\n\n // Body\n const body = document.createElement('div');\n body.className = 'vx-body';\n \n if (opts.title) {\n const title = document.createElement('div');\n title.className = 'vx-title';\n title.textContent = opts.title;\n body.appendChild(title);\n }\n\n const msg = document.createElement('div');\n msg.className = 'vx-msg';\n msg.textContent = opts.message;\n body.appendChild(msg);\n\n // Actions\n if (opts.actions && opts.actions.length > 0) {\n const actionsEl = document.createElement('div');\n actionsEl.className = 'vx-actions';\n opts.actions.forEach(action => {\n const btn = document.createElement('button');\n btn.className = `vx-act-btn vx-${action.variant || 'default'}`;\n btn.textContent = action.label;\n btn.onclick = (e) => {\n e.stopPropagation();\n if (action.onClick) action.onClick(() => this.dismiss(id));\n else this.dismiss(id);\n };\n actionsEl.appendChild(btn);\n });\n body.appendChild(actionsEl);\n }\n el.appendChild(body);\n\n // Close button\n if (opts.dismissible) {\n const closeBtn = document.createElement('button');\n closeBtn.className = 'vx-close';\n closeBtn.ariaLabel = 'Fechar';\n closeBtn.innerHTML = '✕';\n closeBtn.onclick = (e) => {\n e.stopPropagation();\n this.dismiss(id);\n };\n el.appendChild(closeBtn);\n }\n\n // Progress bar (duration)\n if (opts.progress && opts.duration && opts.duration > 0) {\n const prog = document.createElement('div');\n prog.className = 'vx-progress';\n prog.style.animationDuration = `${opts.duration}ms`;\n el.appendChild(prog);\n }\n \n // Upload progress placeholder\n if (opts.type === 'loading' && opts.icon === 'upload') {\n const upProg = document.createElement('div');\n upProg.className = 'vx-upload-bar';\n // hidden initially until updated\n el.appendChild(upProg);\n }\n\n // Theme overrides\n if (opts.theme) {\n Object.entries(opts.theme).forEach(([k, v]) => {\n if (v) el.style.setProperty(k, v);\n });\n }\n\n // Mount\n this.mount(el, opts);\n this.activeAlerts.set(id, { element: el, options: opts });\n\n // Auto dismiss\n if (opts.duration && opts.duration > 0) {\n setTimeout(() => this.dismiss(id), opts.duration);\n }\n }\n\n private mount(el: HTMLElement, opts: AlertOptions) {\n if (opts.renderer === 'inline' && opts.selector) {\n const container = typeof opts.selector === 'string' \n ? document.querySelector(opts.selector) \n : opts.selector;\n if (container instanceof HTMLElement) {\n // Remove previous if needed? Prompt: \"Alerts inline removem o anterior do mesmo container antes de inserir\"\n const existing = container.querySelector('.vex-alert');\n if (existing) existing.remove();\n container.appendChild(el);\n }\n } else if (opts.renderer === 'attach' && opts.selector) {\n const target = typeof opts.selector === 'string' \n ? document.querySelector(opts.selector) \n : opts.selector;\n \n if (target instanceof HTMLElement) {\n document.body.appendChild(el);\n this.positionAttached(el, target, opts.placement || 'top');\n // Handle resize?\n }\n } else {\n // Fixed\n const pos = opts.position || 'top';\n let container = document.getElementById(`vex-fixed-${pos}`);\n if (!container) {\n container = document.createElement('div');\n container.id = `vex-fixed-${pos}`;\n container.className = 'vex-fixed-container'; // For easier styling if needed\n // Inline styles for zero-config\n container.style.position = 'fixed';\n container.style.zIndex = '9000';\n container.style.display = 'flex';\n container.style.flexDirection = 'column';\n container.style.gap = '10px';\n container.style.pointerEvents = 'none';\n container.style.width = '100%';\n container.style.maxWidth = '420px';\n container.style.left = '50%';\n container.style.transform = 'translateX(-50%)';\n \n if (pos === 'top') {\n container.style.top = '20px';\n } else {\n container.style.bottom = '20px';\n }\n document.body.appendChild(container);\n }\n \n el.style.pointerEvents = 'all';\n \n if (pos === 'top') {\n container.appendChild(el);\n } else {\n // For bottom, usually we want new items at the bottom pushing up, or at top of stack?\n // Standard toast behavior: append.\n container.appendChild(el);\n }\n }\n }\n \n private positionAttached(el: HTMLElement, target: HTMLElement, placement: string) {\n const rect = target.getBoundingClientRect();\n const elRect = el.getBoundingClientRect(); // Might be 0 if not rendered yet\n \n el.style.position = 'absolute';\n el.style.zIndex = '9000';\n el.style.width = 'max-content';\n el.style.maxWidth = '300px';\n \n const scrollX = window.scrollX;\n const scrollY = window.scrollY;\n \n // Simple positioning logic\n let top = 0;\n let left = 0;\n \n // We might need to wait for render to get el width/height\n // For now, approximate or assume loaded\n \n switch (placement) {\n case 'top':\n top = rect.top + scrollY - el.offsetHeight - 8;\n left = rect.left + scrollX + (rect.width - el.offsetWidth) / 2;\n break;\n case 'bottom':\n top = rect.bottom + scrollY + 8;\n left = rect.left + scrollX + (rect.width - el.offsetWidth) / 2;\n break;\n // ... others\n default: // auto/top\n top = rect.top + scrollY - 50; // approximate\n left = rect.left + scrollX;\n }\n \n el.style.top = `${top}px`;\n el.style.left = `${left}px`;\n }\n\n public dismiss(id: string) {\n const alert = this.activeAlerts.get(id);\n if (alert) {\n const { element, options } = alert;\n element.classList.add('removing');\n \n const onRemove = () => {\n if (element.parentNode) element.parentNode.removeChild(element);\n this.activeAlerts.delete(id);\n this.queue.remove(id);\n if (options.onClose) options.onClose();\n };\n\n element.addEventListener('animationend', onRemove);\n // Fallback\n setTimeout(() => {\n if (this.activeAlerts.has(id)) onRemove();\n }, 400);\n }\n }\n\n public dismissAll(filter?: { type?: string, position?: string }) {\n // Collect IDs first to avoid iteration issues\n const idsToRemove: string[] = [];\n this.activeAlerts.forEach((val, id) => {\n if (filter) {\n if (filter.type && val.options.type !== filter.type) return;\n if (filter.position && val.options.position !== filter.position) return;\n }\n idsToRemove.push(id);\n });\n idsToRemove.forEach(id => this.dismiss(id));\n }\n\n public update(id: string, opts: Partial<AlertOptions>) {\n const alert = this.activeAlerts.get(id);\n if (!alert) return;\n \n const { element, options } = alert;\n const newOpts = { ...options, ...opts };\n \n // Update classes\n if (opts.type && opts.type !== options.type) {\n element.classList.remove(`vex-${options.type}`);\n element.classList.add(`vex-${opts.type}`);\n \n const iconEl = element.querySelector('.vx-icon');\n if (iconEl) {\n if (opts.type === 'loading') {\n iconEl.innerHTML = '<div class=\"vx-spinner\"></div>';\n } else {\n iconEl.innerHTML = this.getIcon(opts.type, opts.icon);\n }\n }\n }\n \n if (opts.message) {\n const msgEl = element.querySelector('.vx-msg');\n if (msgEl) msgEl.textContent = opts.message;\n }\n \n if (opts.title) {\n let titleEl = element.querySelector('.vx-title');\n if (!titleEl) {\n titleEl = document.createElement('div');\n titleEl.className = 'vx-title';\n element.querySelector('.vx-body')?.prepend(titleEl);\n }\n if (titleEl) titleEl.textContent = opts.title;\n }\n \n this.activeAlerts.set(id, { element, options: newOpts });\n }\n \n public progress(id: string, value: number | { loaded: number, total: number }) {\n const alert = this.activeAlerts.get(id);\n if (!alert) return;\n \n let percent = 0;\n if (typeof value === 'number') percent = value;\n else if (value.total > 0) percent = (value.loaded / value.total) * 100;\n \n let prog = alert.element.querySelector('.vx-upload-prog') as HTMLElement;\n if (!prog) {\n const wrapper = document.createElement('div');\n wrapper.className = 'vx-upload-bar';\n // Style needs to be defined in CSS or here\n wrapper.style.height = '4px';\n wrapper.style.width = '100%';\n wrapper.style.backgroundColor = 'rgba(255,255,255,0.1)';\n wrapper.style.borderRadius = '2px';\n wrapper.style.marginTop = '8px';\n wrapper.style.overflow = 'hidden';\n \n prog = document.createElement('div');\n prog.className = 'vx-upload-prog';\n prog.style.height = '100%';\n prog.style.backgroundColor = 'var(--vex-info-accent, #6366f1)'; // Default color\n prog.style.transition = 'width 0.2s linear';\n \n wrapper.appendChild(prog);\n \n // Append to body or main element?\n // Prompt says \"barra de progresso de upload\".\n // Let's put it in body.\n const body = alert.element.querySelector('.vx-body');\n if (body) body.appendChild(wrapper);\n else alert.element.appendChild(wrapper);\n }\n prog.style.width = `${percent}%`;\n }\n\n private generateId(): string {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n return Math.random().toString(36).slice(2, 9);\n }\n\n private getIcon(type: string, custom?: string | null): string {\n if (custom) return custom;\n switch (type) {\n case 'success': return '✓';\n case 'error': return '✕';\n case 'warning': return '⚠';\n case 'info': return 'ℹ';\n case 'neutral': return '·';\n default: return '';\n }\n }\n}\n","import { setupModalA11y, trapFocus, saveFocus, restoreFocus } from './a11y';\nimport { themeManager } from './theme';\n\nexport interface ModalOptions {\n type?: 'danger' | 'warning' | 'info' | 'success';\n title?: string;\n message?: string;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmDelay?: number; // ms\n closeOnBackdrop?: boolean;\n closeOnEscape?: boolean;\n width?: number;\n animate?: 'scale' | 'slide' | 'fade';\n showClose?: boolean;\n stackable?: boolean;\n onOpen?: () => void;\n onClose?: () => void;\n \n // Internal/Custom\n content?: string | HTMLElement;\n footer?: boolean; // false to hide footer\n}\n\nexport interface FormField {\n name: string;\n label: string;\n type: 'text'|'email'|'password'|'number'|'textarea'|'select'|'radio'|'checkbox'|'date'|'file'|'range'|'color';\n options?: string[];\n required?: boolean;\n placeholder?: string;\n defaultValue?: any;\n validate?: (value: any) => string | null;\n}\n\nexport interface FormOptions extends ModalOptions {\n fields: FormField[];\n submitLabel?: string;\n validate?: (data: Record<string, any>) => Record<string, string> | null;\n}\n\ntype ConfirmCallback = () => boolean | Promise<boolean> | void;\n\nexport class ModalEngine {\n private activeModals: HTMLElement[] = [];\n \n public confirm(opts: ModalOptions): Promise<boolean> {\n return new Promise((resolve) => {\n this.create({\n type: 'warning',\n ...opts,\n confirmLabel: opts.confirmLabel || 'Confirmar',\n cancelLabel: opts.cancelLabel || 'Cancelar',\n }, () => resolve(true), () => resolve(false));\n });\n }\n\n public alert(opts: ModalOptions): Promise<void> {\n return new Promise((resolve) => {\n this.create({\n type: 'info',\n ...opts,\n confirmLabel: opts.confirmLabel || 'OK',\n cancelLabel: undefined,\n }, () => resolve(), () => resolve());\n });\n }\n\n public async form(opts: FormOptions): Promise<Record<string, any> | null> {\n return new Promise((resolve) => {\n const inputs: Record<string, HTMLElement> = {};\n \n const formContent = document.createElement('div');\n formContent.className = 'modal-form';\n \n opts.fields.forEach(field => {\n const grp = document.createElement('div');\n grp.className = 'form-grp';\n \n const lbl = document.createElement('label');\n lbl.className = 'form-lbl';\n lbl.textContent = field.label;\n grp.appendChild(lbl);\n \n let input: HTMLElement;\n \n if (field.type === 'select') {\n input = document.createElement('select');\n input.className = 'form-sel';\n // (input as HTMLSelectElement).required = !!field.required;\n if (field.options) {\n field.options.forEach(opt => {\n const op = document.createElement('option');\n op.value = opt;\n op.textContent = opt;\n (input as HTMLSelectElement).appendChild(op);\n });\n }\n if (field.defaultValue) (input as HTMLSelectElement).value = field.defaultValue;\n } else if (field.type === 'textarea') {\n input = document.createElement('textarea');\n input.className = 'form-tex';\n // (input as HTMLTextAreaElement).required = !!field.required;\n if (field.placeholder) (input as HTMLTextAreaElement).placeholder = field.placeholder;\n if (field.defaultValue) (input as HTMLTextAreaElement).value = field.defaultValue;\n } else if (field.type === 'radio') {\n // Special handling for radio group\n input = document.createElement('div');\n input.className = 'form-radio-grp';\n if (field.options) {\n field.options.forEach(opt => {\n const wrap = document.createElement('label');\n wrap.style.display = 'flex';\n wrap.style.gap = '6px';\n wrap.style.alignItems = 'center';\n \n const rad = document.createElement('input');\n rad.type = 'radio';\n rad.name = field.name;\n rad.value = opt;\n if (field.defaultValue === opt) rad.checked = true;\n \n wrap.appendChild(rad);\n wrap.appendChild(document.createTextNode(opt));\n input.appendChild(wrap);\n });\n }\n } else {\n input = document.createElement('input');\n input.className = 'form-inp';\n (input as HTMLInputElement).type = field.type;\n // (input as HTMLInputElement).required = !!field.required;\n if (field.placeholder) (input as HTMLInputElement).placeholder = field.placeholder;\n if (field.defaultValue) (input as HTMLInputElement).value = field.defaultValue;\n }\n \n inputs[field.name] = input;\n grp.appendChild(input);\n \n const err = document.createElement('div');\n err.className = 'form-err';\n err.style.color = 'var(--vex-error-text, #f87171)';\n err.style.fontSize = '11px';\n err.style.display = 'none';\n err.style.marginTop = '4px';\n grp.appendChild(err);\n \n formContent.appendChild(grp);\n });\n\n this.create({\n ...opts,\n content: formContent,\n confirmLabel: opts.submitLabel || 'Enviar',\n cancelLabel: opts.cancelLabel || 'Cancelar',\n }, () => {\n // Validate\n let isValid = true;\n const data: Record<string, any> = {};\n \n opts.fields.forEach(field => {\n const inputEl = inputs[field.name];\n let val: any;\n \n if (field.type === 'radio') {\n const checked = inputEl.querySelector('input:checked') as HTMLInputElement;\n val = checked ? checked.value : null;\n } else {\n val = (inputEl as HTMLInputElement).value;\n }\n \n data[field.name] = val;\n \n // Reset error\n const errEl = inputEl.parentElement?.querySelector('.form-err') as HTMLElement;\n if (errEl) errEl.style.display = 'none';\n\n let error = null;\n if (field.required && !val) error = 'Campo obrigatório';\n else if (field.validate) error = field.validate(val);\n \n if (error) {\n isValid = false;\n if (errEl) {\n errEl.textContent = error;\n errEl.style.display = 'block';\n }\n }\n });\n\n if (isValid && opts.validate) {\n const errors = opts.validate(data);\n if (errors) {\n isValid = false;\n Object.entries(errors).forEach(([key, msg]) => {\n const inputEl = inputs[key];\n const errEl = inputEl?.parentElement?.querySelector('.form-err') as HTMLElement;\n if (errEl) {\n errEl.textContent = msg;\n errEl.style.display = 'block';\n }\n });\n }\n }\n\n if (isValid) {\n resolve(data);\n return true; // Close\n }\n return false; // Keep open\n }, () => resolve(null));\n });\n }\n\n public async prompt(opts: ModalOptions & { defaultValue?: string, placeholder?: string, validate?: (v: string) => string | null }): Promise<string | null> {\n const { validate, ...restOpts } = opts;\n const data = await this.form({\n ...restOpts,\n fields: [{\n name: 'value',\n label: '',\n type: 'text',\n defaultValue: opts.defaultValue,\n placeholder: opts.placeholder,\n validate: validate,\n required: true\n }],\n submitLabel: opts.confirmLabel || 'OK',\n });\n return data ? data.value : null;\n }\n\n public preview(opts: ModalOptions & { src: string, meta?: string[], gallery?: string[] }) {\n const content = document.createElement('div');\n content.className = 'vx-preview-body';\n content.style.textAlign = 'center';\n \n const img = document.createElement('img');\n img.src = opts.src;\n img.style.maxWidth = '100%';\n img.style.maxHeight = '70vh';\n img.style.borderRadius = '8px';\n img.style.boxShadow = '0 8px 30px rgba(0,0,0,0.5)';\n content.appendChild(img);\n \n if (opts.meta) {\n const meta = document.createElement('div');\n meta.className = 'vx-meta';\n meta.textContent = opts.meta.join(' · ');\n meta.style.marginTop = '16px';\n meta.style.color = 'var(--vex-text-muted, rgba(255,255,255,0.6))';\n meta.style.fontSize = '13px';\n content.appendChild(meta);\n }\n \n // Gallery thumbs?\n if (opts.gallery) {\n const gal = document.createElement('div');\n gal.className = 'vx-gallery';\n gal.style.display = 'flex';\n gal.style.gap = '8px';\n gal.style.justifyContent = 'center';\n gal.style.marginTop = '16px';\n \n opts.gallery.forEach(src => {\n const thumb = document.createElement('img');\n thumb.src = src;\n thumb.style.width = '48px';\n thumb.style.height = '48px';\n thumb.style.objectFit = 'cover';\n thumb.style.borderRadius = '6px';\n thumb.style.cursor = 'pointer';\n thumb.style.opacity = src === opts.src ? '1' : '0.5';\n thumb.style.border = src === opts.src ? '2px solid var(--vex-primary, #6366f1)' : '2px solid transparent';\n thumb.onclick = () => {\n img.src = src;\n // Update active state\n Array.from(gal.children).forEach((c: any) => {\n c.style.opacity = '0.5';\n c.style.border = '2px solid transparent';\n });\n thumb.style.opacity = '1';\n thumb.style.border = '2px solid var(--vex-primary, #6366f1)';\n };\n gal.appendChild(thumb);\n });\n content.appendChild(gal);\n }\n \n this.create({\n ...opts,\n content: content,\n width: opts.width || 800,\n footer: false\n });\n }\n\n public custom(opts: ModalOptions): { close: () => void } {\n return this.create(opts);\n }\n\n // --- Core Implementation ---\n\n private create(opts: ModalOptions, onConfirm?: ConfirmCallback, onCancel?: ConfirmCallback): { close: () => void } {\n if (typeof document === 'undefined') return { close: () => {} };\n\n saveFocus();\n\n const backdrop = document.createElement('div');\n backdrop.className = 'vex-backdrop';\n const titleId = `vex-modal-title-${Math.random().toString(36).slice(2)}`;\n const descId = `vex-modal-desc-${Math.random().toString(36).slice(2)}`;\n setupModalA11y(backdrop, titleId, descId);\n\n const modal = document.createElement('div');\n modal.className = 'vex-modal';\n if (opts.width) modal.style.maxWidth = `${opts.width}px`;\n if (opts.animate) modal.classList.add(`vex-anim-${opts.animate}`);\n \n // Header\n const hdr = document.createElement('div');\n hdr.className = 'modal-hdr';\n hdr.appendChild(document.createElement('div')); // spacer\n \n if (opts.showClose !== false) {\n const closeBtn = document.createElement('button');\n closeBtn.className = 'modal-x';\n closeBtn.ariaLabel = 'Fechar';\n closeBtn.innerHTML = '✕';\n closeBtn.onclick = () => {\n if (onCancel) onCancel();\n this.close(backdrop);\n };\n hdr.appendChild(closeBtn);\n }\n modal.appendChild(hdr);\n\n // Body\n const body = document.createElement('div');\n body.className = 'modal-bdy';\n \n if (opts.type) {\n const icon = document.createElement('div');\n icon.className = `modal-icon ${opts.type}`;\n icon.innerHTML = this.getIcon(opts.type);\n body.appendChild(icon);\n }\n\n if (opts.title) {\n const title = document.createElement('div');\n title.id = titleId;\n title.className = 'modal-title';\n title.textContent = opts.title;\n body.appendChild(title);\n }\n\n if (opts.message) {\n const desc = document.createElement('div');\n desc.id = descId;\n desc.className = 'modal-desc';\n desc.textContent = opts.message;\n body.appendChild(desc);\n }\n \n if (opts.content) {\n const customContent = document.createElement('div');\n customContent.className = 'modal-custom';\n if (typeof opts.content === 'string') customContent.innerHTML = opts.content;\n else customContent.appendChild(opts.content);\n body.appendChild(customContent);\n }\n\n modal.appendChild(body);\n\n // Footer\n if (opts.footer !== false && (opts.confirmLabel || opts.cancelLabel)) {\n const ftr = document.createElement('div');\n ftr.className = 'modal-ftr';\n \n if (opts.cancelLabel) {\n const cancelBtn = document.createElement('button');\n cancelBtn.className = 'modal-btn cancel';\n cancelBtn.textContent = opts.cancelLabel;\n cancelBtn.onclick = () => {\n if (onCancel) onCancel();\n this.close(backdrop);\n };\n ftr.appendChild(cancelBtn);\n }\n \n if (opts.confirmLabel) {\n const confirmBtn = document.createElement('button');\n confirmBtn.className = `modal-btn ${opts.type || 'primary'}`;\n confirmBtn.textContent = opts.confirmLabel;\n \n if (opts.confirmDelay && opts.confirmDelay > 0) {\n confirmBtn.disabled = true;\n let remaining = Math.ceil(opts.confirmDelay / 1000);\n const originalLabel = opts.confirmLabel;\n confirmBtn.textContent = `${originalLabel} (${remaining})`;\n \n const interval = setInterval(() => {\n remaining--;\n if (remaining <= 0) {\n clearInterval(interval);\n confirmBtn.disabled = false;\n confirmBtn.textContent = originalLabel;\n } else {\n confirmBtn.textContent = `${originalLabel} (${remaining})`;\n }\n }, 1000);\n \n // Cleanup interval on close\n (backdrop as any)._interval = interval;\n }\n\n confirmBtn.onclick = async () => {\n if (onConfirm) {\n const shouldClose = await onConfirm();\n if (shouldClose !== false) this.close(backdrop);\n } else {\n this.close(backdrop);\n }\n };\n ftr.appendChild(confirmBtn);\n }\n modal.appendChild(ftr);\n }\n\n backdrop.appendChild(modal);\n document.body.appendChild(backdrop);\n this.activeModals.push(backdrop);\n\n // Events\n if (opts.closeOnBackdrop !== false) {\n backdrop.onclick = (e) => {\n if (e.target === backdrop) {\n if (onCancel) onCancel();\n this.close(backdrop);\n }\n };\n }\n \n const escHandler = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && opts.closeOnEscape !== false) {\n if (this.activeModals[this.activeModals.length - 1] === backdrop) {\n if (onCancel) onCancel();\n this.close(backdrop);\n }\n }\n if (e.key === 'Tab') {\n trapFocus(backdrop, e);\n }\n };\n document.addEventListener('keydown', escHandler);\n \n (backdrop as any)._cleanup = () => {\n document.removeEventListener('keydown', escHandler);\n if ((backdrop as any)._interval) clearInterval((backdrop as any)._interval);\n };\n\n if (opts.onOpen) opts.onOpen();\n\n return {\n close: () => this.close(backdrop, onCancel)\n };\n }\n\n private close(backdrop: HTMLElement, callback?: () => void) {\n if (backdrop.classList.contains('closing')) return; // Already closing\n \n backdrop.classList.add('closing');\n const modal = backdrop.querySelector('.vex-modal');\n if (modal) modal.classList.add('closing');\n \n const onRemove = () => {\n if ((backdrop as any)._cleanup) (backdrop as any)._cleanup();\n if (backdrop.parentNode) backdrop.parentNode.removeChild(backdrop);\n this.activeModals = this.activeModals.filter(m => m !== backdrop);\n restoreFocus();\n // Only call callback if it wasn't called by the trigger action (handled by caller mostly, but for forced close)\n // Actually onCancel/onConfirm are handled before close.\n // options.onClose is what we want here.\n // I didn't pass options.onClose to create.\n // For now, minimal.\n };\n\n backdrop.addEventListener('animationend', onRemove);\n // Fallback\n setTimeout(() => {\n if (document.body.contains(backdrop)) onRemove();\n }, 300);\n }\n\n private getIcon(type: string): string {\n switch (type) {\n case 'danger': return '✕';\n case 'warning': return '!';\n case 'success': return '✓';\n case 'info': return 'i';\n default: return '';\n }\n }\n}\n","import { trapFocus, saveFocus, restoreFocus } from './a11y';\n\nexport interface DrawerAction {\n label: string;\n variant?: 'primary' | 'danger' | 'default';\n onClick?: (close: () => void) => void;\n}\n\nexport interface DrawerOptions {\n title?: string;\n position: 'right' | 'left' | 'top' | 'bottom';\n width?: number; // for right/left\n height?: number; // for top/bottom\n content: string | HTMLElement;\n persistent?: boolean; // false = fecha ao clicar fora\n footer?: DrawerAction[];\n onClose?: () => void;\n // Internal\n className?: string;\n}\n\nexport function drawer(opts: DrawerOptions): { close: () => void } {\n if (typeof document === 'undefined') return { close: () => {} };\n\n saveFocus();\n\n const panel = document.createElement('div');\n panel.className = `vex-drawer vex-drawer-${opts.position}`;\n if (opts.className) panel.classList.add(opts.className);\n \n // Size\n if (opts.width && (opts.position === 'left' || opts.position === 'right')) {\n panel.style.width = `${opts.width}px`;\n }\n if (opts.height && (opts.position === 'top' || opts.position === 'bottom')) {\n panel.style.height = `${opts.height}px`;\n }\n \n // Structure\n const hdr = document.createElement('div');\n hdr.className = 'drawer-hdr';\n if (opts.title) {\n const title = document.createElement('div');\n title.className = 'drawer-title';\n title.textContent = opts.title;\n hdr.appendChild(title);\n }\n \n const closeBtn = document.createElement('button');\n closeBtn.className = 'drawer-close';\n closeBtn.innerHTML = '✕';\n closeBtn.onclick = () => close();\n hdr.appendChild(closeBtn);\n panel.appendChild(hdr);\n \n const body = document.createElement('div');\n body.className = 'drawer-body';\n \n let originalParent: ParentNode | null = null;\n let nextSibling: Node | null = null;\n let contentEl: HTMLElement | null = null;\n\n if (typeof opts.content === 'string') {\n // Check if it's a selector\n if (opts.content.startsWith('#') || opts.content.startsWith('.')) {\n const el = document.querySelector(opts.content) as HTMLElement;\n if (el) {\n contentEl = el;\n originalParent = el.parentNode;\n nextSibling = el.nextSibling;\n body.appendChild(el); \n // Ensure it's visible if it was hidden\n el.style.display = 'block';\n } else {\n body.innerHTML = opts.content;\n }\n } else {\n body.innerHTML = opts.content;\n }\n } else {\n contentEl = opts.content;\n originalParent = opts.content.parentNode;\n nextSibling = opts.content.nextSibling;\n body.appendChild(opts.content);\n opts.content.style.display = 'block';\n }\n panel.appendChild(body);\n \n if (opts.footer && opts.footer.length > 0) {\n const ftr = document.createElement('div');\n ftr.className = 'drawer-ftr';\n opts.footer.forEach(action => {\n const btn = document.createElement('button');\n btn.className = `drawer-btn ${action.variant || 'default'}`;\n btn.textContent = action.label;\n btn.onclick = () => {\n if (action.onClick) action.onClick(() => close());\n else close();\n };\n ftr.appendChild(btn);\n });\n panel.appendChild(ftr);\n }\n \n document.body.appendChild(panel);\n \n // Animate in\n requestAnimationFrame(() => {\n panel.classList.add('open');\n });\n \n const close = () => {\n panel.classList.remove('open');\n panel.addEventListener('transitionend', () => {\n if (contentEl && originalParent) {\n // Restore content to original place\n contentEl.style.display = ''; // Reset display\n originalParent.insertBefore(contentEl, nextSibling);\n }\n \n if (panel.parentNode) panel.parentNode.removeChild(panel);\n restoreFocus();\n if (opts.onClose) opts.onClose();\n }, { once: true });\n \n document.removeEventListener('click', outsideClickHandler);\n };\n \n const outsideClickHandler = (e: MouseEvent) => {\n if (opts.persistent) return;\n // If click is not inside panel and panel is open\n if (panel.classList.contains('open') && !panel.contains(e.target as Node)) {\n close();\n }\n };\n \n setTimeout(() => {\n document.addEventListener('click', outsideClickHandler);\n }, 100);\n \n return { close };\n}\n","import { ModalEngine, FormField } from './modal';\n\nexport interface FlowStep {\n title: string;\n type?: 'info' | 'success' | 'warning' | 'danger';\n description?: string;\n fields?: FormField[];\n condition?: (accumulatedData: Record<string, any>) => boolean;\n beforeNext?: (stepData: Record<string, any>) => Promise<Record<string, string> | null>;\n}\n\nexport async function flow(steps: FlowStep[]): Promise<Record<string, any> | null> {\n const modalEngine = new ModalEngine();\n \n return new Promise((resolve) => {\n let currentStepIndex = 0;\n const data: Record<string, any> = {};\n let modalInstance: { close: () => void } | null = null;\n let modalEl: HTMLElement | null = null;\n\n // Find first valid step\n const findNextValidStep = (start: number): number => {\n let idx = start;\n while (idx < steps.length) {\n const step = steps[idx];\n if (!step.condition || step.condition!(data)) {\n return idx;\n }\n idx++;\n }\n return -1; // End\n };\n \n currentStepIndex = findNextValidStep(0);\n if (currentStepIndex === -1) {\n resolve(data);\n return;\n }\n\n const container = document.createElement('div');\n container.className = 'vex-flow-container';\n \n const renderStep = () => {\n container.innerHTML = '';\n const step = steps[currentStepIndex];\n \n // Update Modal Title if possible\n if (modalEl) {\n const titleEl = modalEl.querySelector('.modal-title');\n if (titleEl) titleEl.textContent = step.title;\n \n // Update Icon if type changes\n const iconEl = modalEl.querySelector('.modal-icon');\n if (iconEl && step.type) {\n iconEl.className = `modal-icon ${step.type}`;\n // We need to update icon content too. \n // This implies we need getIcon logic here or duplication.\n // For simplicity, let's just update class and assume icon content is generic enough or update it manually.\n const icons: Record<string, string> = {\n 'danger': '✕', 'warning': '!', 'success': '✓', 'info': 'i'\n };\n iconEl.innerHTML = icons[step.type] || 'i';\n }\n }\n\n // 1. Steps Bar\n const bar = document.createElement('div');\n bar.className = 'modal-steps';\n \n steps.forEach((s, i) => {\n // Only show if condition matches or if it's past/current?\n // Usually wizards show all steps or at least known ones.\n // If condition depends on future data, we might not know.\n // Let's just show all steps, maybe dim conditional ones?\n // Or just show 1, 2, 3...\n \n const dot = document.createElement('div');\n dot.className = 'step-dot';\n if (i < currentStepIndex) dot.classList.add('done');\n if (i === currentStepIndex) dot.classList.add('active');\n \n const circle = document.createElement('div');\n circle.className = 'step-circle';\n circle.textContent = (i + 1).toString();\n if (i < currentStepIndex) circle.textContent = '✓';\n \n const name = document.createElement('div');\n name.className = 'step-name';\n name.textContent = s.title; // Short title?\n \n dot.appendChild(circle);\n dot.appendChild(name);\n bar.appendChild(dot);\n });\n container.appendChild(bar);\n \n // 2. Content\n const content = document.createElement('div');\n content.className = 'flow-content';\n \n if (step.description) {\n const desc = document.createElement('div');\n desc.className = 'modal-desc';\n desc.textContent = step.description;\n desc.style.marginBottom = '16px';\n content.appendChild(desc);\n }\n \n const inputs: Record<string, HTMLElement> = {};\n \n if (step.fields) {\n step.fields.forEach(field => {\n const grp = document.createElement('div');\n grp.className = 'form-grp';\n \n const lbl = document.createElement('label');\n lbl.className = 'form-lbl';\n lbl.textContent = field.label;\n grp.appendChild(lbl);\n \n let input: HTMLElement;\n // Simplified field creation (duplicated from modal.ts, ideally shared)\n if (field.type === 'select') {\n input = document.createElement('select');\n input.className = 'form-sel';\n if (field.options) {\n field.options.forEach(opt => {\n const op = document.createElement('option');\n op.value = opt;\n op.textContent = opt;\n (input as HTMLSelectElement).appendChild(op);\n });\n }\n if (data[field.name]) (input as HTMLSelectElement).value = data[field.name];\n } else {\n input = document.createElement('input');\n input.className = 'form-inp';\n (input as HTMLInputElement).type = field.type;\n if (data[field.name]) (input as HTMLInputElement).value = data[field.name];\n }\n \n inputs[field.name] = input;\n grp.appendChild(input);\n \n const err = document.createElement('div');\n err.className = 'form-err';\n err.style.color = 'var(--vex-error-text, #f87171)';\n err.style.fontSize = '11px';\n err.style.display = 'none';\n grp.appendChild(err);\n \n content.appendChild(grp);\n });\n }\n container.appendChild(content);\n \n // 3. Footer (Custom)\n const ftr = document.createElement('div');\n ftr.className = 'flow-btns';\n ftr.style.marginTop = '24px';\n ftr.style.display = 'flex';\n ftr.style.justifyContent = 'flex-end';\n ftr.style.gap = '10px';\n \n if (currentStepIndex > 0) {\n const backBtn = document.createElement('button');\n backBtn.className = 'modal-btn cancel';\n backBtn.textContent = '← Voltar';\n backBtn.onclick = () => {\n // Find prev valid step\n let prev = currentStepIndex - 1;\n while (prev >= 0) {\n const prevStep = steps[prev];\n if (!prevStep.condition || prevStep.condition!(data)) break;\n prev--;\n }\n if (prev >= 0) {\n currentStepIndex = prev;\n renderStep();\n }\n };\n ftr.appendChild(backBtn);\n }\n \n const nextBtn = document.createElement('button');\n nextBtn.className = 'modal-btn primary';\n const isLast = findNextValidStep(currentStepIndex + 1) === -1;\n nextBtn.textContent = isLast ? 'Concluir' : 'Próximo →';\n \n nextBtn.onclick = async () => {\n // Collect data\n const stepData: Record<string, any> = {};\n let isValid = true;\n \n if (step.fields) {\n step.fields.forEach(field => {\n const val = (inputs[field.name] as HTMLInputElement).value;\n stepData[field.name] = val;\n data[field.name] = val; // Update global data\n \n if (field.required && !val) {\n isValid = false;\n // Show error...\n }\n });\n }\n \n if (!isValid) return; // Show errors\n \n if (step.beforeNext) {\n nextBtn.disabled = true;\n nextBtn.textContent = 'Aguarde...';\n const errors = await step.beforeNext!(stepData);\n nextBtn.disabled = false;\n nextBtn.textContent = isLast ? 'Concluir' : 'Próximo →';\n \n if (errors) {\n Object.keys(errors).forEach(key => {\n const input = inputs[key];\n if (input && input.nextElementSibling) {\n const err = input.nextElementSibling as HTMLElement;\n err.textContent = errors[key];\n err.style.display = 'block';\n }\n });\n return;\n }\n }\n \n const next = findNextValidStep(currentStepIndex + 1);\n if (next !== -1) {\n currentStepIndex = next;\n renderStep();\n } else {\n // Finish\n if (modalInstance) modalInstance.close();\n resolve(data);\n }\n };\n \n ftr.appendChild(nextBtn);\n container.appendChild(ftr);\n };\n\n // Initialize modal\n const step = steps[currentStepIndex];\n modalInstance = modalEngine.custom({\n title: step.title,\n type: step.type || 'info',\n content: container,\n footer: false,\n width: 600,\n onClose: () => {\n // If closed by user (X or backdrop), resolve null\n // But if closed by code (finish), we already resolved.\n // We can check if resolved? No easy way.\n // We can assume if we didn't resolve data, it's a cancel.\n // For now, simple resolve null.\n // (If logic finished, resolve was called, this secondary resolve(null) is ignored by Promise)\n resolve(null);\n }\n });\n \n // Get element\n setTimeout(() => {\n modalEl = document.querySelector('.vex-modal:last-child') as HTMLElement;\n renderStep();\n }, 0);\n });\n}\n","/**\n * VexUI Theme Manager\n *\n * Handles CSS variables, theme switching (dark/light/auto), and reduced motion.\n */\n\nexport type ThemeMode = 'dark' | 'light' | 'auto';\n\nexport interface ThemeTokens {\n [key: string]: string;\n}\n\nexport class ThemeManager {\n private currentTheme: ThemeMode = 'auto';\n private mediaQuery: MediaQueryList | null = null;\n\n constructor() {\n if (typeof window !== 'undefined') {\n this.mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n this.init();\n }\n }\n\n private init() {\n this.mediaQuery?.addEventListener('change', () => {\n if (this.currentTheme === 'auto') {\n this.applyTheme();\n }\n });\n }\n\n public setTheme(theme: ThemeMode) {\n this.currentTheme = theme;\n this.applyTheme();\n }\n\n public getTheme(): ThemeMode {\n return this.currentTheme;\n }\n\n private applyTheme() {\n if (typeof document === 'undefined') return;\n\n const root = document.documentElement;\n const isDark = this.currentTheme === 'dark' || (this.currentTheme === 'auto' && this.mediaQuery?.matches);\n\n // We toggle a class on html element to allow CSS overrides\n if (isDark) {\n root.classList.add('vex-dark');\n root.classList.remove('vex-light');\n } else {\n root.classList.add('vex-light');\n root.classList.remove('vex-dark');\n }\n \n // Also set data-theme attribute for easier styling\n root.setAttribute('data-vex-theme', isDark ? 'dark' : 'light');\n }\n\n public setTokens(tokens: ThemeTokens) {\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n Object.entries(tokens).forEach(([key, value]) => {\n root.style.setProperty(key, value);\n });\n }\n \n public isReducedMotion(): boolean {\n if (typeof window === 'undefined') return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n}\n\nexport const themeManager = new ThemeManager();\n","import { AlertEngine, AlertOptions } from './core/alert';\r\nimport { ModalEngine, ModalOptions, FormOptions } from './core/modal';\r\nimport { drawer, DrawerOptions } from './core/drawer';\r\nimport { flow, FlowStep } from './core/flow';\r\nimport { historyManager } from './core/history';\r\nimport { themeManager } from './core/theme';\r\n\r\n// Instantiate singletons\r\nexport const alert = new AlertEngine();\r\nexport const modal = new ModalEngine();\r\nexport const history = historyManager;\r\n\r\n// Export types\r\nexport type { AlertOptions, ModalOptions, FormOptions, DrawerOptions, FlowStep };\r\n\r\n// Export standalone functions\r\nexport { drawer, flow };\r\n\r\nexport interface VexConfig {\r\n duration?: number;\r\n position?: 'top' | 'bottom';\r\n maxStack?: number;\r\n theme?: 'dark' | 'light' | 'auto';\r\n // ...\r\n}\r\n\r\n// Global configuration\r\nexport function configure(opts: VexConfig) {\r\n if (opts.theme) themeManager.setTheme(opts.theme);\r\n // Pass config to alert engine if needed\r\n // alert.configure(opts);\r\n}\r\n\r\nexport function setTheme(theme: 'dark' | 'light' | 'auto') {\r\n themeManager.setTheme(theme);\r\n}\r\n\r\nexport function dismiss(id: string) {\r\n alert.dismiss(id);\r\n}\r\n\r\nexport function dismissAll(filter?: { type?: string, position?: string }) {\r\n alert.dismissAll(filter);\r\n}\r\n\r\nexport function update(id: string, opts: Partial<AlertOptions>) {\r\n alert.update(id, opts);\r\n}\r\n\r\nexport function progress(id: string, value: number | { loaded: number, total: number }) {\r\n alert.progress(id, value);\r\n}\r\n\r\n// Default export object\r\nconst vex = {\r\n alert,\r\n modal,\r\n drawer,\r\n flow,\r\n history,\r\n configure,\r\n setTheme,\r\n dismiss,\r\n dismissAll,\r\n update,\r\n progress,\r\n // Helper for inline prompts\r\n prompt: {\r\n inline: async (selector: string | HTMLElement, opts: any) => {\r\n // Implementation of inline prompt\r\n // \"Substitui um elemento de texto por um input diretamente no DOM\"\r\n // This is a \"power feature\".\r\n // I'll implement a basic version here or in a separate file if needed.\r\n // Given \"Phase 2\" includes \"index.ts\", I can add it here.\r\n \r\n const el = typeof selector === 'string' ? document.querySelector(selector) : selector;\r\n if (!el) return null;\r\n \r\n const originalText = el.textContent;\r\n const originalDisplay = (el as HTMLElement).style.display;\r\n \r\n const input = document.createElement('input');\r\n input.type = 'text';\r\n input.value = originalText || '';\r\n input.placeholder = opts.placeholder || '';\r\n input.className = 'vex-inline-prompt';\r\n // Style to match element?\r\n input.style.fontSize = getComputedStyle(el as Element).fontSize;\r\n input.style.fontFamily = getComputedStyle(el as Element).fontFamily;\r\n input.style.border = '1px solid var(--vex-primary, #6366f1)';\r\n input.style.borderRadius = '4px';\r\n input.style.padding = '2px 4px';\r\n input.style.background = 'var(--vex-bg, #000)';\r\n input.style.color = 'var(--vex-text, #fff)';\r\n \r\n (el as HTMLElement).style.display = 'none';\r\n el.parentNode?.insertBefore(input, el);\r\n input.focus();\r\n \r\n return new Promise((resolve) => {\r\n const finish = (val: string | null) => {\r\n if (val !== null && opts.validate) {\r\n const err = opts.validate(val);\r\n if (err) {\r\n // Show error tooltip?\r\n input.style.borderColor = 'red';\r\n return; \r\n }\r\n }\r\n \r\n input.remove();\r\n (el as HTMLElement).style.display = originalDisplay;\r\n if (val !== null) (el as HTMLElement).textContent = val;\r\n resolve(val);\r\n };\r\n \r\n input.onblur = () => finish(input.value); // Confirm on blur? Or cancel? Usually confirm.\r\n input.onkeydown = (e) => {\r\n if (e.key === 'Enter') finish(input.value);\r\n if (e.key === 'Escape') finish(null);\r\n };\r\n });\r\n }\r\n }\r\n};\r\n\r\nexport default vex;\r\n"],"mappings":"AAAA,OAAS,aAAAA,EAAW,UAAAC,MAAc,QCS3B,IAAMC,EAAN,KAAiB,CAAjB,cACL,KAAQ,OAAsB,CAAC,EAC/B,KAAQ,QAAuB,CAAC,EAChC,KAAQ,SAAmB,EAEpB,YAAYC,EAAa,CAC9B,KAAK,SAAWA,CAClB,CAEO,IAAIC,EAAiB,CAE1B,GAAI,KAA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AAM,CAAC,EACJD","names":["useEffect","useRef","AlertQueue","max","item","victimIndex","id","index","next","a","b","p","HistoryManager","entry","fullEntry","id","e","anchorSelector","anchor","existing","dropdown","rect","list","closeHandler","stored","key","value","historyManager","getFocusableElements","container","el","trapFocus","event","focusable","first","last","previousFocus","saveFocus","restoreFocus","setupAlertA11y","element","priority","liveMode","setupModalA11y","titleId","descId","AlertEngine","AlertQueue","message","opts","selector","id","fullOpts","historyManager","el","setupAlertA11y","iconEl","body","title","msg","actionsEl","action","btn","e","closeBtn","prog","upProg","k","v","container","existing","target","pos","placement","rect","elRect","scrollX","scrollY","top","left","alert","element","options","onRemove","filter","idsToRemove","val","newOpts","msgEl","titleEl","value","percent","wrapper","type","custom","ModalEngine","opts","resolve","inputs","formContent","field","grp","lbl","input","opt","op","wrap","rad","err","isValid","data","inputEl","val","checked","errEl","error","errors","key","msg","validate","restOpts","content","img","meta","gal","src","thumb","c","onConfirm","onCancel","saveFocus","backdrop","titleId","descId","setupModalA11y","modal","hdr","closeBtn","body","icon","title","desc","customContent","ftr","cancelBtn","confirmBtn","remaining","originalLabel","interval","e","escHandler","trapFocus","callback","onRemove","m","restoreFocus","type","drawer","opts","saveFocus","panel","hdr","title","closeBtn","close","body","originalParent","nextSibling","contentEl","el","ftr","action","btn","restoreFocus","outsideClickHandler","e","flow","steps","modalEngine","ModalEngine","resolve","currentStepIndex","data","modalInstance","modalEl","findNextValidStep","start","idx","step","container","renderStep","titleEl","iconEl","icons","bar","s","i","dot","circle","name","content","desc","inputs","field","grp","lbl","input","opt","op","err","ftr","backBtn","prev","prevStep","nextBtn","isLast","stepData","isValid","val","errors","key","next","ThemeManager","theme","root","isDark","tokens","key","value","themeManager","alert","AlertEngine","modal","ModalEngine","history","historyManager","configure","opts","themeManager","setTheme","theme","dismiss","id","alert","dismissAll","filter","update","progress","value","vex","modal","drawer","flow","history","selector","el","originalText","originalDisplay","input","resolve","finish","val","e","src_default","useVex","ids","useRef","wrappedAlert","src_default","msg","opts","id","selector","useEffect","VexProvider","children","config"]}
@@ -0,0 +1,63 @@
1
+ "use strict";var VexUI=(()=>{var wr=Object.create;var Ee=Object.defineProperty;var _r=Object.getOwnPropertyDescriptor;var Tr=Object.getOwnPropertyNames;var Rr=Object.getPrototypeOf,Sr=Object.prototype.hasOwnProperty;var Ke=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Or=(n,t)=>{for(var r in t)Ee(n,r,{get:t[r],enumerable:!0})},Bt=(n,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tr(t))!Sr.call(n,a)&&a!==r&&Ee(n,a,{get:()=>t[a],enumerable:!(o=_r(t,a))||o.enumerable});return n};var kr=(n,t,r)=>(r=n!=null?wr(Rr(n)):{},Bt(t||!n||!n.__esModule?Ee(r,"default",{value:n,enumerable:!0}):r,n)),Lr=n=>Bt(Ee({},"__esModule",{value:!0}),n);var rn=Ke(C=>{"use strict";var ae=Symbol.for("react.element"),Ar=Symbol.for("react.portal"),Mr=Symbol.for("react.fragment"),Pr=Symbol.for("react.strict_mode"),Nr=Symbol.for("react.profiler"),Ir=Symbol.for("react.provider"),$r=Symbol.for("react.context"),Hr=Symbol.for("react.forward_ref"),Fr=Symbol.for("react.suspense"),Dr=Symbol.for("react.memo"),jr=Symbol.for("react.lazy"),Yt=Symbol.iterator;function Vr(n){return n===null||typeof n!="object"?null:(n=Yt&&n[Yt]||n["@@iterator"],typeof n=="function"?n:null)}var Qt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Gt=Object.assign,Xt={};function Z(n,t,r){this.props=n,this.context=t,this.refs=Xt,this.updater=r||Qt}Z.prototype.isReactComponent={};Z.prototype.setState=function(n,t){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,t,"setState")};Z.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Jt(){}Jt.prototype=Z.prototype;function Ge(n,t,r){this.props=n,this.context=t,this.refs=Xt,this.updater=r||Qt}var Xe=Ge.prototype=new Jt;Xe.constructor=Ge;Gt(Xe,Z.prototype);Xe.isPureReactComponent=!0;var zt=Array.isArray,Zt=Object.prototype.hasOwnProperty,Je={current:null},en={key:!0,ref:!0,__self:!0,__source:!0};function tn(n,t,r){var o,a={},c=null,p=null;if(t!=null)for(o in t.ref!==void 0&&(p=t.ref),t.key!==void 0&&(c=""+t.key),t)Zt.call(t,o)&&!en.hasOwnProperty(o)&&(a[o]=t[o]);var u=arguments.length-2;if(u===1)a.children=r;else if(1<u){for(var d=Array(u),h=0;h<u;h++)d[h]=arguments[h+2];a.children=d}if(n&&n.defaultProps)for(o in u=n.defaultProps,u)a[o]===void 0&&(a[o]=u[o]);return{$$typeof:ae,type:n,key:c,ref:p,props:a,_owner:Je.current}}function Ur(n,t){return{$$typeof:ae,type:n.type,key:t,ref:n.ref,props:n.props,_owner:n._owner}}function Ze(n){return typeof n=="object"&&n!==null&&n.$$typeof===ae}function qr(n){var t={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(r){return t[r]})}var Kt=/\/+/g;function Qe(n,t){return typeof n=="object"&&n!==null&&n.key!=null?qr(""+n.key):t.toString(36)}function Ce(n,t,r,o,a){var c=typeof n;(c==="undefined"||c==="boolean")&&(n=null);var p=!1;if(n===null)p=!0;else switch(c){case"string":case"number":p=!0;break;case"object":switch(n.$$typeof){case ae:case Ar:p=!0}}if(p)return p=n,a=a(p),n=o===""?"."+Qe(p,0):o,zt(a)?(r="",n!=null&&(r=n.replace(Kt,"$&/")+"/"),Ce(a,t,r,"",function(h){return h})):a!=null&&(Ze(a)&&(a=Ur(a,r+(!a.key||p&&p.key===a.key?"":(""+a.key).replace(Kt,"$&/")+"/")+n)),t.push(a)),1;if(p=0,o=o===""?".":o+":",zt(n))for(var u=0;u<n.length;u++){c=n[u];var d=o+Qe(c,u);p+=Ce(c,t,r,d,a)}else if(d=Vr(n),typeof d=="function")for(n=d.call(n),u=0;!(c=n.next()).done;)c=c.value,d=o+Qe(c,u++),p+=Ce(c,t,r,d,a);else if(c==="object")throw t=String(n),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return p}function xe(n,t,r){if(n==null)return n;var o=[],a=0;return Ce(n,o,"","",function(c){return t.call(r,c,a++)}),o}function Wr(n){if(n._status===-1){var t=n._result;t=t(),t.then(function(r){(n._status===0||n._status===-1)&&(n._status=1,n._result=r)},function(r){(n._status===0||n._status===-1)&&(n._status=2,n._result=r)}),n._status===-1&&(n._status=0,n._result=t)}if(n._status===1)return n._result.default;throw n._result}var D={current:null},we={transition:null},Br={ReactCurrentDispatcher:D,ReactCurrentBatchConfig:we,ReactCurrentOwner:Je};function nn(){throw Error("act(...) is not supported in production builds of React.")}C.Children={map:xe,forEach:function(n,t,r){xe(n,function(){t.apply(this,arguments)},r)},count:function(n){var t=0;return xe(n,function(){t++}),t},toArray:function(n){return xe(n,function(t){return t})||[]},only:function(n){if(!Ze(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};C.Component=Z;C.Fragment=Mr;C.Profiler=Nr;C.PureComponent=Ge;C.StrictMode=Pr;C.Suspense=Fr;C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Br;C.act=nn;C.cloneElement=function(n,t,r){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var o=Gt({},n.props),a=n.key,c=n.ref,p=n._owner;if(t!=null){if(t.ref!==void 0&&(c=t.ref,p=Je.current),t.key!==void 0&&(a=""+t.key),n.type&&n.type.defaultProps)var u=n.type.defaultProps;for(d in t)Zt.call(t,d)&&!en.hasOwnProperty(d)&&(o[d]=t[d]===void 0&&u!==void 0?u[d]:t[d])}var d=arguments.length-2;if(d===1)o.children=r;else if(1<d){u=Array(d);for(var h=0;h<d;h++)u[h]=arguments[h+2];o.children=u}return{$$typeof:ae,type:n.type,key:a,ref:c,props:o,_owner:p}};C.createContext=function(n){return n={$$typeof:$r,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:Ir,_context:n},n.Consumer=n};C.createElement=tn;C.createFactory=function(n){var t=tn.bind(null,n);return t.type=n,t};C.createRef=function(){return{current:null}};C.forwardRef=function(n){return{$$typeof:Hr,render:n}};C.isValidElement=Ze;C.lazy=function(n){return{$$typeof:jr,_payload:{_status:-1,_result:n},_init:Wr}};C.memo=function(n,t){return{$$typeof:Dr,type:n,compare:t===void 0?null:t}};C.startTransition=function(n){var t=we.transition;we.transition={};try{n()}finally{we.transition=t}};C.unstable_act=nn;C.useCallback=function(n,t){return D.current.useCallback(n,t)};C.useContext=function(n){return D.current.useContext(n)};C.useDebugValue=function(){};C.useDeferredValue=function(n){return D.current.useDeferredValue(n)};C.useEffect=function(n,t){return D.current.useEffect(n,t)};C.useId=function(){return D.current.useId()};C.useImperativeHandle=function(n,t,r){return D.current.useImperativeHandle(n,t,r)};C.useInsertionEffect=function(n,t){return D.current.useInsertionEffect(n,t)};C.useLayoutEffect=function(n,t){return D.current.useLayoutEffect(n,t)};C.useMemo=function(n,t){return D.current.useMemo(n,t)};C.useReducer=function(n,t,r){return D.current.useReducer(n,t,r)};C.useRef=function(n){return D.current.useRef(n)};C.useState=function(n){return D.current.useState(n)};C.useSyncExternalStore=function(n,t,r){return D.current.useSyncExternalStore(n,t,r)};C.useTransition=function(){return D.current.useTransition()};C.version="18.3.1"});var an=Ke((w,_e)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.3.1",t=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),U=Symbol.iterator,j="@@iterator";function V(e){if(e===null||typeof e!="object")return null;var i=U&&e[U]||e[j];return typeof i=="function"?i:null}var te={current:null},_={transition:null},x={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},O={current:null},S={},P=null;function q(e){P=e}S.setExtraStackFrame=function(e){P=e},S.getCurrentStack=null,S.getStackAddendum=function(){var e="";P&&(e+=P);var i=S.getCurrentStack;return i&&(e+=i()||""),e};var B=!1,fn=!1,pn=!1,mn=!1,vn=!1,K={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:_,ReactCurrentOwner:O};K.ReactDebugCurrentFrame=S,K.ReactCurrentActQueue=x;function Q(e){{for(var i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];it("warn",e,s)}}function R(e){{for(var i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];it("error",e,s)}}function it(e,i,s){{var l=K.ReactDebugCurrentFrame,f=l.getStackAddendum();f!==""&&(i+="%s",s=s.concat([f]));var y=s.map(function(v){return String(v)});y.unshift("Warning: "+i),Function.prototype.apply.call(console[e],console,y)}}var at={};function Le(e,i){{var s=e.constructor,l=s&&(s.displayName||s.name)||"ReactClass",f=l+"."+i;if(at[f])return;R("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",i,l),at[f]=!0}}var ot={isMounted:function(e){return!1},enqueueForceUpdate:function(e,i,s){Le(e,"forceUpdate")},enqueueReplaceState:function(e,i,s,l){Le(e,"replaceState")},enqueueSetState:function(e,i,s,l){Le(e,"setState")}},W=Object.assign,Ae={};Object.freeze(Ae);function z(e,i,s){this.props=e,this.context=i,this.refs=Ae,this.updater=s||ot}z.prototype.isReactComponent={},z.prototype.setState=function(e,i){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,i,"setState")},z.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};{var Me={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},hn=function(e,i){Object.defineProperty(z.prototype,e,{get:function(){Q("%s(...) is deprecated in plain JavaScript React classes. %s",i[0],i[1])}})};for(var Pe in Me)Me.hasOwnProperty(Pe)&&hn(Pe,Me[Pe])}function st(){}st.prototype=z.prototype;function Ne(e,i,s){this.props=e,this.context=i,this.refs=Ae,this.updater=s||ot}var Ie=Ne.prototype=new st;Ie.constructor=Ne,W(Ie,z.prototype),Ie.isPureReactComponent=!0;function yn(){var e={current:null};return Object.seal(e),e}var gn=Array.isArray;function ce(e){return gn(e)}function bn(e){{var i=typeof Symbol=="function"&&Symbol.toStringTag,s=i&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s}}function En(e){try{return lt(e),!1}catch{return!0}}function lt(e){return""+e}function ue(e){if(En(e))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bn(e)),lt(e)}function xn(e,i,s){var l=e.displayName;if(l)return l;var f=i.displayName||i.name||"";return f!==""?s+"("+f+")":s}function ct(e){return e.displayName||"Context"}function Y(e){if(e==null)return null;if(typeof e.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case r:return"Portal";case c:return"Profiler";case a:return"StrictMode";case h:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case u:var i=e;return ct(i)+".Consumer";case p:var s=e;return ct(s._context)+".Provider";case d:return xn(e,e.render,"ForwardRef");case m:var l=e.displayName||null;return l!==null?l:Y(e.type)||"Memo";case E:{var f=e,y=f._payload,v=f._init;try{return Y(v(y))}catch{return null}}}return null}var ne=Object.prototype.hasOwnProperty,ut={key:!0,ref:!0,__self:!0,__source:!0},dt,ft,$e;$e={};function pt(e){if(ne.call(e,"ref")){var i=Object.getOwnPropertyDescriptor(e,"ref").get;if(i&&i.isReactWarning)return!1}return e.ref!==void 0}function mt(e){if(ne.call(e,"key")){var i=Object.getOwnPropertyDescriptor(e,"key").get;if(i&&i.isReactWarning)return!1}return e.key!==void 0}function Cn(e,i){var s=function(){dt||(dt=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",i))};s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function wn(e,i){var s=function(){ft||(ft=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",i))};s.isReactWarning=!0,Object.defineProperty(e,"ref",{get:s,configurable:!0})}function _n(e){if(typeof e.ref=="string"&&O.current&&e.__self&&O.current.stateNode!==e.__self){var i=Y(O.current.type);$e[i]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',i,e.ref),$e[i]=!0)}}var He=function(e,i,s,l,f,y,v){var g={$$typeof:t,type:e,key:i,ref:s,props:v,_owner:y};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function Tn(e,i,s){var l,f={},y=null,v=null,g=null,T=null;if(i!=null){pt(i)&&(v=i.ref,_n(i)),mt(i)&&(ue(i.key),y=""+i.key),g=i.__self===void 0?null:i.__self,T=i.__source===void 0?null:i.__source;for(l in i)ne.call(i,l)&&!ut.hasOwnProperty(l)&&(f[l]=i[l])}var k=arguments.length-2;if(k===1)f.children=s;else if(k>1){for(var L=Array(k),A=0;A<k;A++)L[A]=arguments[A+2];Object.freeze&&Object.freeze(L),f.children=L}if(e&&e.defaultProps){var M=e.defaultProps;for(l in M)f[l]===void 0&&(f[l]=M[l])}if(y||v){var N=typeof e=="function"?e.displayName||e.name||"Unknown":e;y&&Cn(f,N),v&&wn(f,N)}return He(e,y,v,g,T,O.current,f)}function Rn(e,i){var s=He(e.type,i,e.ref,e._self,e._source,e._owner,e.props);return s}function Sn(e,i,s){if(e==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var l,f=W({},e.props),y=e.key,v=e.ref,g=e._self,T=e._source,k=e._owner;if(i!=null){pt(i)&&(v=i.ref,k=O.current),mt(i)&&(ue(i.key),y=""+i.key);var L;e.type&&e.type.defaultProps&&(L=e.type.defaultProps);for(l in i)ne.call(i,l)&&!ut.hasOwnProperty(l)&&(i[l]===void 0&&L!==void 0?f[l]=L[l]:f[l]=i[l])}var A=arguments.length-2;if(A===1)f.children=s;else if(A>1){for(var M=Array(A),N=0;N<A;N++)M[N]=arguments[N+2];f.children=M}return He(e.type,y,v,g,T,k,f)}function G(e){return typeof e=="object"&&e!==null&&e.$$typeof===t}var vt=".",On=":";function kn(e){var i=/[=:]/g,s={"=":"=0",":":"=2"},l=e.replace(i,function(f){return s[f]});return"$"+l}var ht=!1,Ln=/\/+/g;function yt(e){return e.replace(Ln,"$&/")}function Fe(e,i){return typeof e=="object"&&e!==null&&e.key!=null?(ue(e.key),kn(""+e.key)):i.toString(36)}function de(e,i,s,l,f){var y=typeof e;(y==="undefined"||y==="boolean")&&(e=null);var v=!1;if(e===null)v=!0;else switch(y){case"string":case"number":v=!0;break;case"object":switch(e.$$typeof){case t:case r:v=!0}}if(v){var g=e,T=f(g),k=l===""?vt+Fe(g,0):l;if(ce(T)){var L="";k!=null&&(L=yt(k)+"/"),de(T,i,L,"",function(Cr){return Cr})}else T!=null&&(G(T)&&(T.key&&(!g||g.key!==T.key)&&ue(T.key),T=Rn(T,s+(T.key&&(!g||g.key!==T.key)?yt(""+T.key)+"/":"")+k)),i.push(T));return 1}var A,M,N=0,I=l===""?vt:l+On;if(ce(e))for(var be=0;be<e.length;be++)A=e[be],M=I+Fe(A,be),N+=de(A,i,s,M,f);else{var ze=V(e);if(typeof ze=="function"){var Ut=e;ze===Ut.entries&&(ht||Q("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ht=!0);for(var Er=ze.call(Ut),qt,xr=0;!(qt=Er.next()).done;)A=qt.value,M=I+Fe(A,xr++),N+=de(A,i,s,M,f)}else if(y==="object"){var Wt=String(e);throw new Error("Objects are not valid as a React child (found: "+(Wt==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":Wt)+"). If you meant to render a collection of children, use an array instead.")}}return N}function fe(e,i,s){if(e==null)return e;var l=[],f=0;return de(e,l,"","",function(y){return i.call(s,y,f++)}),l}function An(e){var i=0;return fe(e,function(){i++}),i}function Mn(e,i,s){fe(e,function(){i.apply(this,arguments)},s)}function Pn(e){return fe(e,function(i){return i})||[]}function Nn(e){if(!G(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}function In(e){var i={$$typeof:u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};i.Provider={$$typeof:p,_context:i};var s=!1,l=!1,f=!1;{var y={$$typeof:u,_context:i};Object.defineProperties(y,{Provider:{get:function(){return l||(l=!0,R("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),i.Provider},set:function(v){i.Provider=v}},_currentValue:{get:function(){return i._currentValue},set:function(v){i._currentValue=v}},_currentValue2:{get:function(){return i._currentValue2},set:function(v){i._currentValue2=v}},_threadCount:{get:function(){return i._threadCount},set:function(v){i._threadCount=v}},Consumer:{get:function(){return s||(s=!0,R("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),i.Consumer}},displayName:{get:function(){return i.displayName},set:function(v){f||(Q("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",v),f=!0)}}}),i.Consumer=y}return i._currentRenderer=null,i._currentRenderer2=null,i}var re=-1,De=0,gt=1,$n=2;function Hn(e){if(e._status===re){var i=e._result,s=i();if(s.then(function(y){if(e._status===De||e._status===re){var v=e;v._status=gt,v._result=y}},function(y){if(e._status===De||e._status===re){var v=e;v._status=$n,v._result=y}}),e._status===re){var l=e;l._status=De,l._result=s}}if(e._status===gt){var f=e._result;return f===void 0&&R(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
+
3
+ Your code should look like:
4
+ const MyComponent = lazy(() => import('./MyComponent'))
5
+
6
+ Did you accidentally put curly braces around the import?`,f),"default"in f||R(`lazy: Expected the result of a dynamic import() call. Instead received: %s
7
+
8
+ Your code should look like:
9
+ const MyComponent = lazy(() => import('./MyComponent'))`,f),f.default}else throw e._result}function Fn(e){var i={_status:re,_result:e},s={$$typeof:E,_payload:i,_init:Hn};{var l,f;Object.defineProperties(s,{defaultProps:{configurable:!0,get:function(){return l},set:function(y){R("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),l=y,Object.defineProperty(s,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return f},set:function(y){R("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),f=y,Object.defineProperty(s,"propTypes",{enumerable:!0})}}})}return s}function Dn(e){e!=null&&e.$$typeof===m?R("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?R("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&R("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&(e.defaultProps!=null||e.propTypes!=null)&&R("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var i={$$typeof:d,render:e};{var s;Object.defineProperty(i,"displayName",{enumerable:!1,configurable:!0,get:function(){return s},set:function(l){s=l,!e.name&&!e.displayName&&(e.displayName=l)}})}return i}var bt;bt=Symbol.for("react.module.reference");function Et(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===c||vn||e===a||e===h||e===b||mn||e===H||B||fn||pn||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===m||e.$$typeof===p||e.$$typeof===u||e.$$typeof===d||e.$$typeof===bt||e.getModuleId!==void 0))}function jn(e,i){Et(e)||R("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e);var s={$$typeof:m,type:e,compare:i===void 0?null:i};{var l;Object.defineProperty(s,"displayName",{enumerable:!1,configurable:!0,get:function(){return l},set:function(f){l=f,!e.name&&!e.displayName&&(e.displayName=f)}})}return s}function F(){var e=te.current;return e===null&&R(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
10
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
11
+ 2. You might be breaking the Rules of Hooks
12
+ 3. You might have more than one copy of React in the same app
13
+ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function Vn(e){var i=F();if(e._context!==void 0){var s=e._context;s.Consumer===e?R("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):s.Provider===e&&R("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return i.useContext(e)}function Un(e){var i=F();return i.useState(e)}function qn(e,i,s){var l=F();return l.useReducer(e,i,s)}function Wn(e){var i=F();return i.useRef(e)}function Bn(e,i){var s=F();return s.useEffect(e,i)}function Yn(e,i){var s=F();return s.useInsertionEffect(e,i)}function zn(e,i){var s=F();return s.useLayoutEffect(e,i)}function Kn(e,i){var s=F();return s.useCallback(e,i)}function Qn(e,i){var s=F();return s.useMemo(e,i)}function Gn(e,i,s){var l=F();return l.useImperativeHandle(e,i,s)}function Xn(e,i){{var s=F();return s.useDebugValue(e,i)}}function Jn(){var e=F();return e.useTransition()}function Zn(e){var i=F();return i.useDeferredValue(e)}function er(){var e=F();return e.useId()}function tr(e,i,s){var l=F();return l.useSyncExternalStore(e,i,s)}var ie=0,xt,Ct,wt,_t,Tt,Rt,St;function Ot(){}Ot.__reactDisabledLog=!0;function nr(){{if(ie===0){xt=console.log,Ct=console.info,wt=console.warn,_t=console.error,Tt=console.group,Rt=console.groupCollapsed,St=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ot,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ie++}}function rr(){{if(ie--,ie===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},e,{value:xt}),info:W({},e,{value:Ct}),warn:W({},e,{value:wt}),error:W({},e,{value:_t}),group:W({},e,{value:Tt}),groupCollapsed:W({},e,{value:Rt}),groupEnd:W({},e,{value:St})})}ie<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var je=K.ReactCurrentDispatcher,Ve;function pe(e,i,s){{if(Ve===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);Ve=l&&l[1]||""}return`
14
+ `+Ve+e}}var Ue=!1,me;{var ir=typeof WeakMap=="function"?WeakMap:Map;me=new ir}function kt(e,i){if(!e||Ue)return"";{var s=me.get(e);if(s!==void 0)return s}var l;Ue=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var y;y=je.current,je.current=null,nr();try{if(i){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(I){l=I}Reflect.construct(e,[],v)}else{try{v.call()}catch(I){l=I}e.call(v.prototype)}}else{try{throw Error()}catch(I){l=I}e()}}catch(I){if(I&&l&&typeof I.stack=="string"){for(var g=I.stack.split(`
15
+ `),T=l.stack.split(`
16
+ `),k=g.length-1,L=T.length-1;k>=1&&L>=0&&g[k]!==T[L];)L--;for(;k>=1&&L>=0;k--,L--)if(g[k]!==T[L]){if(k!==1||L!==1)do if(k--,L--,L<0||g[k]!==T[L]){var A=`
17
+ `+g[k].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),typeof e=="function"&&me.set(e,A),A}while(k>=1&&L>=0);break}}}finally{Ue=!1,je.current=y,rr(),Error.prepareStackTrace=f}var M=e?e.displayName||e.name:"",N=M?pe(M):"";return typeof e=="function"&&me.set(e,N),N}function ar(e,i,s){return kt(e,!1)}function or(e){var i=e.prototype;return!!(i&&i.isReactComponent)}function ve(e,i,s){if(e==null)return"";if(typeof e=="function")return kt(e,or(e));if(typeof e=="string")return pe(e);switch(e){case h:return pe("Suspense");case b:return pe("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return ar(e.render);case m:return ve(e.type,i,s);case E:{var l=e,f=l._payload,y=l._init;try{return ve(y(f),i,s)}catch{}}}return""}var Lt={},At=K.ReactDebugCurrentFrame;function he(e){if(e){var i=e._owner,s=ve(e.type,e._source,i?i.type:null);At.setExtraStackFrame(s)}else At.setExtraStackFrame(null)}function sr(e,i,s,l,f){{var y=Function.call.bind(ne);for(var v in e)if(y(e,v)){var g=void 0;try{if(typeof e[v]!="function"){var T=Error((l||"React class")+": "+s+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}g=e[v](i,v,l,s,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(k){g=k}g&&!(g instanceof Error)&&(he(f),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",s,v,typeof g),he(null)),g instanceof Error&&!(g.message in Lt)&&(Lt[g.message]=!0,he(f),R("Failed %s type: %s",s,g.message),he(null))}}}function X(e){if(e){var i=e._owner,s=ve(e.type,e._source,i?i.type:null);q(s)}else q(null)}var qe;qe=!1;function Mt(){if(O.current){var e=Y(O.current.type);if(e)return`
18
+
19
+ Check the render method of \``+e+"`."}return""}function lr(e){if(e!==void 0){var i=e.fileName.replace(/^.*[\\\/]/,""),s=e.lineNumber;return`
20
+
21
+ Check your code at `+i+":"+s+"."}return""}function cr(e){return e!=null?lr(e.__source):""}var Pt={};function ur(e){var i=Mt();if(!i){var s=typeof e=="string"?e:e.displayName||e.name;s&&(i=`
22
+
23
+ Check the top-level render call using <`+s+">.")}return i}function Nt(e,i){if(!(!e._store||e._store.validated||e.key!=null)){e._store.validated=!0;var s=ur(i);if(!Pt[s]){Pt[s]=!0;var l="";e&&e._owner&&e._owner!==O.current&&(l=" It was passed a child from "+Y(e._owner.type)+"."),X(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',s,l),X(null)}}}function It(e,i){if(typeof e=="object"){if(ce(e))for(var s=0;s<e.length;s++){var l=e[s];G(l)&&Nt(l,i)}else if(G(e))e._store&&(e._store.validated=!0);else if(e){var f=V(e);if(typeof f=="function"&&f!==e.entries)for(var y=f.call(e),v;!(v=y.next()).done;)G(v.value)&&Nt(v.value,i)}}}function $t(e){{var i=e.type;if(i==null||typeof i=="string")return;var s;if(typeof i=="function")s=i.propTypes;else if(typeof i=="object"&&(i.$$typeof===d||i.$$typeof===m))s=i.propTypes;else return;if(s){var l=Y(i);sr(s,e.props,"prop",l,e)}else if(i.PropTypes!==void 0&&!qe){qe=!0;var f=Y(i);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",f||"Unknown")}typeof i.getDefaultProps=="function"&&!i.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function dr(e){{for(var i=Object.keys(e.props),s=0;s<i.length;s++){var l=i[s];if(l!=="children"&&l!=="key"){X(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),X(null);break}}e.ref!==null&&(X(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),X(null))}}function Ht(e,i,s){var l=Et(e);if(!l){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=cr(i);y?f+=y:f+=Mt();var v;e===null?v="null":ce(e)?v="array":e!==void 0&&e.$$typeof===t?(v="<"+(Y(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,R("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,f)}var g=Tn.apply(this,arguments);if(g==null)return g;if(l)for(var T=2;T<arguments.length;T++)It(arguments[T],e);return e===o?dr(g):$t(g),g}var Ft=!1;function fr(e){var i=Ht.bind(null,e);return i.type=e,Ft||(Ft=!0,Q("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(i,"type",{enumerable:!1,get:function(){return Q("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),i}function pr(e,i,s){for(var l=Sn.apply(this,arguments),f=2;f<arguments.length;f++)It(arguments[f],l.type);return $t(l),l}function mr(e,i){var s=_.transition;_.transition={};var l=_.transition;_.transition._updatedFibers=new Set;try{e()}finally{if(_.transition=s,s===null&&l._updatedFibers){var f=l._updatedFibers.size;f>10&&Q("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),l._updatedFibers.clear()}}}var Dt=!1,ye=null;function vr(e){if(ye===null)try{var i=("require"+Math.random()).slice(0,7),s=_e&&_e[i];ye=s.call(_e,"timers").setImmediate}catch{ye=function(f){Dt===!1&&(Dt=!0,typeof MessageChannel>"u"&&R("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var y=new MessageChannel;y.port1.onmessage=f,y.port2.postMessage(void 0)}}return ye(e)}var J=0,jt=!1;function Vt(e){{var i=J;J++,x.current===null&&(x.current=[]);var s=x.isBatchingLegacy,l;try{if(x.isBatchingLegacy=!0,l=e(),!s&&x.didScheduleLegacyUpdate){var f=x.current;f!==null&&(x.didScheduleLegacyUpdate=!1,Ye(f))}}catch(M){throw ge(i),M}finally{x.isBatchingLegacy=s}if(l!==null&&typeof l=="object"&&typeof l.then=="function"){var y=l,v=!1,g={then:function(M,N){v=!0,y.then(function(I){ge(i),J===0?We(I,M,N):M(I)},function(I){ge(i),N(I)})}};return!jt&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){v||(jt=!0,R("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),g}else{var T=l;if(ge(i),J===0){var k=x.current;k!==null&&(Ye(k),x.current=null);var L={then:function(M,N){x.current===null?(x.current=[],We(T,M,N)):M(T)}};return L}else{var A={then:function(M,N){M(T)}};return A}}}}function ge(e){e!==J-1&&R("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),J=e}function We(e,i,s){{var l=x.current;if(l!==null)try{Ye(l),vr(function(){l.length===0?(x.current=null,i(e)):We(e,i,s)})}catch(f){s(f)}else i(e)}}var Be=!1;function Ye(e){if(!Be){Be=!0;var i=0;try{for(;i<e.length;i++){var s=e[i];do s=s(!0);while(s!==null)}e.length=0}catch(l){throw e=e.slice(i+1),l}finally{Be=!1}}}var hr=Ht,yr=pr,gr=fr,br={map:fe,forEach:Mn,count:An,toArray:Pn,only:Nn};w.Children=br,w.Component=z,w.Fragment=o,w.Profiler=c,w.PureComponent=Ne,w.StrictMode=a,w.Suspense=h,w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K,w.act=Vt,w.cloneElement=yr,w.createContext=In,w.createElement=hr,w.createFactory=gr,w.createRef=yn,w.forwardRef=Dn,w.isValidElement=G,w.lazy=Fn,w.memo=jn,w.startTransition=mr,w.unstable_act=Vt,w.useCallback=Kn,w.useContext=Vn,w.useDebugValue=Xn,w.useDeferredValue=Zn,w.useEffect=Bn,w.useId=er,w.useImperativeHandle=Gn,w.useInsertionEffect=Yn,w.useLayoutEffect=zn,w.useMemo=Qn,w.useReducer=qn,w.useRef=Wn,w.useState=Un,w.useSyncExternalStore=tr,w.useTransition=Jn,w.version=n,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()});var on=Ke((si,et)=>{"use strict";process.env.NODE_ENV==="production"?et.exports=rn():et.exports=an()});var ii={};Or(ii,{VexProvider:()=>ri,useVex:()=>ni});var le=kr(on());var Te=class{constructor(){this.active=[];this.pending=[];this.maxStack=5}setMaxStack(t){this.maxStack=t}add(t){if(this.active.length<this.maxStack){this.active.push(t),t.show();return}if(t.priority==="critical"){let r=this.active.findIndex(o=>this.getPriorityValue(o.priority)<this.getPriorityValue("critical"));r!==-1?(this.active[r].close(),this.active.splice(r,1),this.pending.unshift(t)):this.pending.unshift(t)}else t.priority==="high"?this.pending.unshift(t):this.pending.push(t);this.sortPending(),this.process()}remove(t){let r=this.active.findIndex(o=>o.id===t);r!==-1&&(this.active.splice(r,1),this.process())}process(){if(this.active.length<this.maxStack&&this.pending.length>0){let t=this.pending.shift();t&&(this.active.push(t),t.show())}}sortPending(){this.pending.sort((t,r)=>this.getPriorityValue(r.priority)-this.getPriorityValue(t.priority))}getPriorityValue(t){switch(t){case"critical":return 4;case"high":return 3;case"normal":return 2;case"low":return 1;default:return 2}}};var tt=class{constructor(){this.entries=[];this.limit=100;this.storageKey="vex_history";this.load()}add(t){let r={...t,timestamp:new Date,read:!1};this.entries.unshift(r),this.entries.length>this.limit&&(this.entries=this.entries.slice(0,this.limit)),this.save()}get(){return this.entries}clear(){this.entries=[],this.save()}markAllRead(){this.entries.forEach(t=>t.read=!0),this.save()}markRead(t){let r=this.entries.find(o=>o.id===t);r&&(r.read=!0,this.save())}open(t){if(typeof document>"u")return;let r=document.querySelector(t);if(!r){console.warn(`VexUI: History anchor ${t} not found`);return}let o=document.getElementById("vex-history-dropdown");o&&o.remove();let a=document.createElement("div");a.id="vex-history-dropdown",a.className="vex-history-dropdown";let c=r.getBoundingClientRect();a.style.position="absolute",a.style.top=`${c.bottom+8+window.scrollY}px`,a.style.left=`${c.left+window.scrollX}px`,a.style.zIndex="9999";let p=this.entries.map(d=>`
24
+ <div class="vex-hist-item ${d.read?"read":"unread"}" data-id="${d.id}">
25
+ <div class="vex-hist-icon ${d.type}"></div>
26
+ <div class="vex-hist-content">
27
+ <div class="vex-hist-title">${d.title||d.type}</div>
28
+ <div class="vex-hist-msg">${d.message}</div>
29
+ <div class="vex-hist-time">${d.timestamp.toLocaleTimeString()}</div>
30
+ </div>
31
+ </div>
32
+ `).join("")||'<div class="vex-hist-empty">No notifications</div>';a.innerHTML=`
33
+ <div class="vex-hist-header">
34
+ <span>Notifications</span>
35
+ <button id="vex-hist-clear">Clear</button>
36
+ </div>
37
+ <div class="vex-hist-list">${p}</div>
38
+ `,document.body.appendChild(a);let u=d=>{!a.contains(d.target)&&d.target!==r&&(a.remove(),document.removeEventListener("click",u))};setTimeout(()=>document.addEventListener("click",u),0),a.querySelector("#vex-hist-clear")?.addEventListener("click",()=>{this.clear(),a.remove()})}save(){if(typeof localStorage<"u")try{localStorage.setItem(this.storageKey,JSON.stringify(this.entries))}catch{}}load(){if(typeof localStorage<"u"){let t=localStorage.getItem(this.storageKey);if(t)try{this.entries=JSON.parse(t,(r,o)=>r==="timestamp"?new Date(o):o)}catch(r){console.error("Failed to load VexUI history",r)}}}},Re=new tt;function Yr(n){return Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled")&&!r.getAttribute("aria-hidden"))}function sn(n,t){let r=Yr(n);if(r.length===0)return;let o=r[0],a=r[r.length-1];t.shiftKey?document.activeElement===o&&(a.focus(),t.preventDefault()):document.activeElement===a&&(o.focus(),t.preventDefault())}var oe=null;function Se(){typeof document<"u"&&document.activeElement&&(oe=document.activeElement)}function Oe(){oe&&typeof document<"u"&&document.body.contains(oe)&&(oe.focus(),oe=null)}function ln(n,t){n.setAttribute("role","alert");let r=t==="critical"||t==="high"?"assertive":"polite";n.setAttribute("aria-live",r),n.setAttribute("aria-atomic","true")}function cn(n,t,r){n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-labelledby",t),r&&n.setAttribute("aria-describedby",r)}var ke=class{constructor(){this.queue=new Te;this.activeAlerts=new Map}success(t,r){return this.create({...r,type:"success",message:t})}error(t,r){return this.create({...r,type:"error",message:t})}warning(t,r){return this.create({...r,type:"warning",message:t})}info(t,r){return this.create({...r,type:"info",message:t})}neutral(t,r){return this.create({...r,type:"neutral",message:t})}loading(t,r){return this.create({...r,type:"loading",message:t,duration:0})}upload(t,r){return this.create({...r,type:"loading",message:t,duration:0,icon:"upload"})}inline(t,r){return this.create({...r,renderer:"inline",selector:t})}fixed(t){return this.create({...t,renderer:"fixed"})}attach(t,r){return this.create({...r,renderer:"attach",selector:t})}show(t){return this.create(t)}create(t){let r=this.generateId(),o=this.processOptions(t);return this.queue.add({id:r,priority:o.priority||"normal",show:()=>this.render(r,o),close:()=>this.dismiss(r)}),Re.add({id:r,type:o.type||"info",title:o.title,message:o.message}),r}processOptions(t){return{type:"info",duration:6e3,dismissible:!0,position:"top",align:"center",animate:"slide",priority:"normal",maxStack:5,progress:!0,...t}}render(t,r){if(typeof document>"u")return;let o=document.createElement("div");o.setAttribute("data-id",t),o.className=`vex-alert vex-${r.type}`,ln(o,r.priority||"normal");let a=document.createElement("div");a.className="vx-icon",r.type==="loading"?a.innerHTML='<div class="vx-spinner"></div>':a.innerHTML=this.getIcon(r.type||"info",r.icon),o.appendChild(a);let c=document.createElement("div");if(c.className="vx-body",r.title){let u=document.createElement("div");u.className="vx-title",u.textContent=r.title,c.appendChild(u)}let p=document.createElement("div");if(p.className="vx-msg",p.textContent=r.message,c.appendChild(p),r.actions&&r.actions.length>0){let u=document.createElement("div");u.className="vx-actions",r.actions.forEach(d=>{let h=document.createElement("button");h.className=`vx-act-btn vx-${d.variant||"default"}`,h.textContent=d.label,h.onclick=b=>{b.stopPropagation(),d.onClick?d.onClick(()=>this.dismiss(t)):this.dismiss(t)},u.appendChild(h)}),c.appendChild(u)}if(o.appendChild(c),r.dismissible){let u=document.createElement("button");u.className="vx-close",u.ariaLabel="Fechar",u.innerHTML="\u2715",u.onclick=d=>{d.stopPropagation(),this.dismiss(t)},o.appendChild(u)}if(r.progress&&r.duration&&r.duration>0){let u=document.createElement("div");u.className="vx-progress",u.style.animationDuration=`${r.duration}ms`,o.appendChild(u)}if(r.type==="loading"&&r.icon==="upload"){let u=document.createElement("div");u.className="vx-upload-bar",o.appendChild(u)}r.theme&&Object.entries(r.theme).forEach(([u,d])=>{d&&o.style.setProperty(u,d)}),this.mount(o,r),this.activeAlerts.set(t,{element:o,options:r}),r.duration&&r.duration>0&&setTimeout(()=>this.dismiss(t),r.duration)}mount(t,r){if(r.renderer==="inline"&&r.selector){let o=typeof r.selector=="string"?document.querySelector(r.selector):r.selector;if(o instanceof HTMLElement){let a=o.querySelector(".vex-alert");a&&a.remove(),o.appendChild(t)}}else if(r.renderer==="attach"&&r.selector){let o=typeof r.selector=="string"?document.querySelector(r.selector):r.selector;o instanceof HTMLElement&&(document.body.appendChild(t),this.positionAttached(t,o,r.placement||"top"))}else{let o=r.position||"top",a=document.getElementById(`vex-fixed-${o}`);a||(a=document.createElement("div"),a.id=`vex-fixed-${o}`,a.className="vex-fixed-container",a.style.position="fixed",a.style.zIndex="9000",a.style.display="flex",a.style.flexDirection="column",a.style.gap="10px",a.style.pointerEvents="none",a.style.width="100%",a.style.maxWidth="420px",a.style.left="50%",a.style.transform="translateX(-50%)",o==="top"?a.style.top="20px":a.style.bottom="20px",document.body.appendChild(a)),t.style.pointerEvents="all",a.appendChild(t)}}positionAttached(t,r,o){let a=r.getBoundingClientRect(),c=t.getBoundingClientRect();t.style.position="absolute",t.style.zIndex="9000",t.style.width="max-content",t.style.maxWidth="300px";let p=window.scrollX,u=window.scrollY,d=0,h=0;switch(o){case"top":d=a.top+u-t.offsetHeight-8,h=a.left+p+(a.width-t.offsetWidth)/2;break;case"bottom":d=a.bottom+u+8,h=a.left+p+(a.width-t.offsetWidth)/2;break;default:d=a.top+u-50,h=a.left+p}t.style.top=`${d}px`,t.style.left=`${h}px`}dismiss(t){let r=this.activeAlerts.get(t);if(r){let{element:o,options:a}=r;o.classList.add("removing");let c=()=>{o.parentNode&&o.parentNode.removeChild(o),this.activeAlerts.delete(t),this.queue.remove(t),a.onClose&&a.onClose()};o.addEventListener("animationend",c),setTimeout(()=>{this.activeAlerts.has(t)&&c()},400)}}dismissAll(t){let r=[];this.activeAlerts.forEach((o,a)=>{t&&(t.type&&o.options.type!==t.type||t.position&&o.options.position!==t.position)||r.push(a)}),r.forEach(o=>this.dismiss(o))}update(t,r){let o=this.activeAlerts.get(t);if(!o)return;let{element:a,options:c}=o,p={...c,...r};if(r.type&&r.type!==c.type){a.classList.remove(`vex-${c.type}`),a.classList.add(`vex-${r.type}`);let u=a.querySelector(".vx-icon");u&&(r.type==="loading"?u.innerHTML='<div class="vx-spinner"></div>':u.innerHTML=this.getIcon(r.type,r.icon))}if(r.message){let u=a.querySelector(".vx-msg");u&&(u.textContent=r.message)}if(r.title){let u=a.querySelector(".vx-title");u||(u=document.createElement("div"),u.className="vx-title",a.querySelector(".vx-body")?.prepend(u)),u&&(u.textContent=r.title)}this.activeAlerts.set(t,{element:a,options:p})}progress(t,r){let o=this.activeAlerts.get(t);if(!o)return;let a=0;typeof r=="number"?a=r:r.total>0&&(a=r.loaded/r.total*100);let c=o.element.querySelector(".vx-upload-prog");if(!c){let p=document.createElement("div");p.className="vx-upload-bar",p.style.height="4px",p.style.width="100%",p.style.backgroundColor="rgba(255,255,255,0.1)",p.style.borderRadius="2px",p.style.marginTop="8px",p.style.overflow="hidden",c=document.createElement("div"),c.className="vx-upload-prog",c.style.height="100%",c.style.backgroundColor="var(--vex-info-accent, #6366f1)",c.style.transition="width 0.2s linear",p.appendChild(c);let u=o.element.querySelector(".vx-body");u?u.appendChild(p):o.element.appendChild(p)}c.style.width=`${a}%`}generateId(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,9)}getIcon(t,r){if(r)return r;switch(t){case"success":return"\u2713";case"error":return"\u2715";case"warning":return"\u26A0";case"info":return"\u2139";case"neutral":return"\xB7";default:return""}}};var ee=class{constructor(){this.activeModals=[]}confirm(t){return new Promise(r=>{this.create({type:"warning",...t,confirmLabel:t.confirmLabel||"Confirmar",cancelLabel:t.cancelLabel||"Cancelar"},()=>r(!0),()=>r(!1))})}alert(t){return new Promise(r=>{this.create({type:"info",...t,confirmLabel:t.confirmLabel||"OK",cancelLabel:void 0},()=>r(),()=>r())})}async form(t){return new Promise(r=>{let o={},a=document.createElement("div");a.className="modal-form",t.fields.forEach(c=>{let p=document.createElement("div");p.className="form-grp";let u=document.createElement("label");u.className="form-lbl",u.textContent=c.label,p.appendChild(u);let d;c.type==="select"?(d=document.createElement("select"),d.className="form-sel",c.options&&c.options.forEach(b=>{let m=document.createElement("option");m.value=b,m.textContent=b,d.appendChild(m)}),c.defaultValue&&(d.value=c.defaultValue)):c.type==="textarea"?(d=document.createElement("textarea"),d.className="form-tex",c.placeholder&&(d.placeholder=c.placeholder),c.defaultValue&&(d.value=c.defaultValue)):c.type==="radio"?(d=document.createElement("div"),d.className="form-radio-grp",c.options&&c.options.forEach(b=>{let m=document.createElement("label");m.style.display="flex",m.style.gap="6px",m.style.alignItems="center";let E=document.createElement("input");E.type="radio",E.name=c.name,E.value=b,c.defaultValue===b&&(E.checked=!0),m.appendChild(E),m.appendChild(document.createTextNode(b)),d.appendChild(m)})):(d=document.createElement("input"),d.className="form-inp",d.type=c.type,c.placeholder&&(d.placeholder=c.placeholder),c.defaultValue&&(d.value=c.defaultValue)),o[c.name]=d,p.appendChild(d);let h=document.createElement("div");h.className="form-err",h.style.color="var(--vex-error-text, #f87171)",h.style.fontSize="11px",h.style.display="none",h.style.marginTop="4px",p.appendChild(h),a.appendChild(p)}),this.create({...t,content:a,confirmLabel:t.submitLabel||"Enviar",cancelLabel:t.cancelLabel||"Cancelar"},()=>{let c=!0,p={};if(t.fields.forEach(u=>{let d=o[u.name],h;if(u.type==="radio"){let E=d.querySelector("input:checked");h=E?E.value:null}else h=d.value;p[u.name]=h;let b=d.parentElement?.querySelector(".form-err");b&&(b.style.display="none");let m=null;u.required&&!h?m="Campo obrigat\xF3rio":u.validate&&(m=u.validate(h)),m&&(c=!1,b&&(b.textContent=m,b.style.display="block"))}),c&&t.validate){let u=t.validate(p);u&&(c=!1,Object.entries(u).forEach(([d,h])=>{let m=o[d]?.parentElement?.querySelector(".form-err");m&&(m.textContent=h,m.style.display="block")}))}return c?(r(p),!0):!1},()=>r(null))})}async prompt(t){let{validate:r,...o}=t,a=await this.form({...o,fields:[{name:"value",label:"",type:"text",defaultValue:t.defaultValue,placeholder:t.placeholder,validate:r,required:!0}],submitLabel:t.confirmLabel||"OK"});return a?a.value:null}preview(t){let r=document.createElement("div");r.className="vx-preview-body",r.style.textAlign="center";let o=document.createElement("img");if(o.src=t.src,o.style.maxWidth="100%",o.style.maxHeight="70vh",o.style.borderRadius="8px",o.style.boxShadow="0 8px 30px rgba(0,0,0,0.5)",r.appendChild(o),t.meta){let a=document.createElement("div");a.className="vx-meta",a.textContent=t.meta.join(" \xB7 "),a.style.marginTop="16px",a.style.color="var(--vex-text-muted, rgba(255,255,255,0.6))",a.style.fontSize="13px",r.appendChild(a)}if(t.gallery){let a=document.createElement("div");a.className="vx-gallery",a.style.display="flex",a.style.gap="8px",a.style.justifyContent="center",a.style.marginTop="16px",t.gallery.forEach(c=>{let p=document.createElement("img");p.src=c,p.style.width="48px",p.style.height="48px",p.style.objectFit="cover",p.style.borderRadius="6px",p.style.cursor="pointer",p.style.opacity=c===t.src?"1":"0.5",p.style.border=c===t.src?"2px solid var(--vex-primary, #6366f1)":"2px solid transparent",p.onclick=()=>{o.src=c,Array.from(a.children).forEach(u=>{u.style.opacity="0.5",u.style.border="2px solid transparent"}),p.style.opacity="1",p.style.border="2px solid var(--vex-primary, #6366f1)"},a.appendChild(p)}),r.appendChild(a)}this.create({...t,content:r,width:t.width||800,footer:!1})}custom(t){return this.create(t)}create(t,r,o){if(typeof document>"u")return{close:()=>{}};Se();let a=document.createElement("div");a.className="vex-backdrop";let c=`vex-modal-title-${Math.random().toString(36).slice(2)}`,p=`vex-modal-desc-${Math.random().toString(36).slice(2)}`;cn(a,c,p);let u=document.createElement("div");u.className="vex-modal",t.width&&(u.style.maxWidth=`${t.width}px`),t.animate&&u.classList.add(`vex-anim-${t.animate}`);let d=document.createElement("div");if(d.className="modal-hdr",d.appendChild(document.createElement("div")),t.showClose!==!1){let m=document.createElement("button");m.className="modal-x",m.ariaLabel="Fechar",m.innerHTML="\u2715",m.onclick=()=>{o&&o(),this.close(a)},d.appendChild(m)}u.appendChild(d);let h=document.createElement("div");if(h.className="modal-bdy",t.type){let m=document.createElement("div");m.className=`modal-icon ${t.type}`,m.innerHTML=this.getIcon(t.type),h.appendChild(m)}if(t.title){let m=document.createElement("div");m.id=c,m.className="modal-title",m.textContent=t.title,h.appendChild(m)}if(t.message){let m=document.createElement("div");m.id=p,m.className="modal-desc",m.textContent=t.message,h.appendChild(m)}if(t.content){let m=document.createElement("div");m.className="modal-custom",typeof t.content=="string"?m.innerHTML=t.content:m.appendChild(t.content),h.appendChild(m)}if(u.appendChild(h),t.footer!==!1&&(t.confirmLabel||t.cancelLabel)){let m=document.createElement("div");if(m.className="modal-ftr",t.cancelLabel){let E=document.createElement("button");E.className="modal-btn cancel",E.textContent=t.cancelLabel,E.onclick=()=>{o&&o(),this.close(a)},m.appendChild(E)}if(t.confirmLabel){let E=document.createElement("button");if(E.className=`modal-btn ${t.type||"primary"}`,E.textContent=t.confirmLabel,t.confirmDelay&&t.confirmDelay>0){E.disabled=!0;let H=Math.ceil(t.confirmDelay/1e3),U=t.confirmLabel;E.textContent=`${U} (${H})`;let j=setInterval(()=>{H--,H<=0?(clearInterval(j),E.disabled=!1,E.textContent=U):E.textContent=`${U} (${H})`},1e3);a._interval=j}E.onclick=async()=>{r?await r()!==!1&&this.close(a):this.close(a)},m.appendChild(E)}u.appendChild(m)}a.appendChild(u),document.body.appendChild(a),this.activeModals.push(a),t.closeOnBackdrop!==!1&&(a.onclick=m=>{m.target===a&&(o&&o(),this.close(a))});let b=m=>{m.key==="Escape"&&t.closeOnEscape!==!1&&this.activeModals[this.activeModals.length-1]===a&&(o&&o(),this.close(a)),m.key==="Tab"&&sn(a,m)};return document.addEventListener("keydown",b),a._cleanup=()=>{document.removeEventListener("keydown",b),a._interval&&clearInterval(a._interval)},t.onOpen&&t.onOpen(),{close:()=>this.close(a,o)}}close(t,r){if(t.classList.contains("closing"))return;t.classList.add("closing");let o=t.querySelector(".vex-modal");o&&o.classList.add("closing");let a=()=>{t._cleanup&&t._cleanup(),t.parentNode&&t.parentNode.removeChild(t),this.activeModals=this.activeModals.filter(c=>c!==t),Oe()};t.addEventListener("animationend",a),setTimeout(()=>{document.body.contains(t)&&a()},300)}getIcon(t){switch(t){case"danger":return"\u2715";case"warning":return"!";case"success":return"\u2713";case"info":return"i";default:return""}}};function un(n){if(typeof document>"u")return{close:()=>{}};Se();let t=document.createElement("div");t.className=`vex-drawer vex-drawer-${n.position}`,n.className&&t.classList.add(n.className),n.width&&(n.position==="left"||n.position==="right")&&(t.style.width=`${n.width}px`),n.height&&(n.position==="top"||n.position==="bottom")&&(t.style.height=`${n.height}px`);let r=document.createElement("div");if(r.className="drawer-hdr",n.title){let b=document.createElement("div");b.className="drawer-title",b.textContent=n.title,r.appendChild(b)}let o=document.createElement("button");o.className="drawer-close",o.innerHTML="\u2715",o.onclick=()=>d(),r.appendChild(o),t.appendChild(r);let a=document.createElement("div");a.className="drawer-body";let c=null,p=null,u=null;if(typeof n.content=="string")if(n.content.startsWith("#")||n.content.startsWith(".")){let b=document.querySelector(n.content);b?(u=b,c=b.parentNode,p=b.nextSibling,a.appendChild(b),b.style.display="block"):a.innerHTML=n.content}else a.innerHTML=n.content;else u=n.content,c=n.content.parentNode,p=n.content.nextSibling,a.appendChild(n.content),n.content.style.display="block";if(t.appendChild(a),n.footer&&n.footer.length>0){let b=document.createElement("div");b.className="drawer-ftr",n.footer.forEach(m=>{let E=document.createElement("button");E.className=`drawer-btn ${m.variant||"default"}`,E.textContent=m.label,E.onclick=()=>{m.onClick?m.onClick(()=>d()):d()},b.appendChild(E)}),t.appendChild(b)}document.body.appendChild(t),requestAnimationFrame(()=>{t.classList.add("open")});let d=()=>{t.classList.remove("open"),t.addEventListener("transitionend",()=>{u&&c&&(u.style.display="",c.insertBefore(u,p)),t.parentNode&&t.parentNode.removeChild(t),Oe(),n.onClose&&n.onClose()},{once:!0}),document.removeEventListener("click",h)},h=b=>{n.persistent||t.classList.contains("open")&&!t.contains(b.target)&&d()};return setTimeout(()=>{document.addEventListener("click",h)},100),{close:d}}async function dn(n){let t=new ee;return new Promise(r=>{let o=0,a={},c=null,p=null,u=m=>{let E=m;for(;E<n.length;){let H=n[E];if(!H.condition||H.condition(a))return E;E++}return-1};if(o=u(0),o===-1){r(a);return}let d=document.createElement("div");d.className="vex-flow-container";let h=()=>{d.innerHTML="";let m=n[o];if(p){let _=p.querySelector(".modal-title");_&&(_.textContent=m.title);let x=p.querySelector(".modal-icon");if(x&&m.type){x.className=`modal-icon ${m.type}`;let O={danger:"\u2715",warning:"!",success:"\u2713",info:"i"};x.innerHTML=O[m.type]||"i"}}let E=document.createElement("div");E.className="modal-steps",n.forEach((_,x)=>{let O=document.createElement("div");O.className="step-dot",x<o&&O.classList.add("done"),x===o&&O.classList.add("active");let S=document.createElement("div");S.className="step-circle",S.textContent=(x+1).toString(),x<o&&(S.textContent="\u2713");let P=document.createElement("div");P.className="step-name",P.textContent=_.title,O.appendChild(S),O.appendChild(P),E.appendChild(O)}),d.appendChild(E);let H=document.createElement("div");if(H.className="flow-content",m.description){let _=document.createElement("div");_.className="modal-desc",_.textContent=m.description,_.style.marginBottom="16px",H.appendChild(_)}let U={};m.fields&&m.fields.forEach(_=>{let x=document.createElement("div");x.className="form-grp";let O=document.createElement("label");O.className="form-lbl",O.textContent=_.label,x.appendChild(O);let S;_.type==="select"?(S=document.createElement("select"),S.className="form-sel",_.options&&_.options.forEach(q=>{let B=document.createElement("option");B.value=q,B.textContent=q,S.appendChild(B)}),a[_.name]&&(S.value=a[_.name])):(S=document.createElement("input"),S.className="form-inp",S.type=_.type,a[_.name]&&(S.value=a[_.name])),U[_.name]=S,x.appendChild(S);let P=document.createElement("div");P.className="form-err",P.style.color="var(--vex-error-text, #f87171)",P.style.fontSize="11px",P.style.display="none",x.appendChild(P),H.appendChild(x)}),d.appendChild(H);let j=document.createElement("div");if(j.className="flow-btns",j.style.marginTop="24px",j.style.display="flex",j.style.justifyContent="flex-end",j.style.gap="10px",o>0){let _=document.createElement("button");_.className="modal-btn cancel",_.textContent="\u2190 Voltar",_.onclick=()=>{let x=o-1;for(;x>=0;){let O=n[x];if(!O.condition||O.condition(a))break;x--}x>=0&&(o=x,h())},j.appendChild(_)}let V=document.createElement("button");V.className="modal-btn primary";let te=u(o+1)===-1;V.textContent=te?"Concluir":"Pr\xF3ximo \u2192",V.onclick=async()=>{let _={},x=!0;if(m.fields&&m.fields.forEach(S=>{let P=U[S.name].value;_[S.name]=P,a[S.name]=P,S.required&&!P&&(x=!1)}),!x)return;if(m.beforeNext){V.disabled=!0,V.textContent="Aguarde...";let S=await m.beforeNext(_);if(V.disabled=!1,V.textContent=te?"Concluir":"Pr\xF3ximo \u2192",S){Object.keys(S).forEach(P=>{let q=U[P];if(q&&q.nextElementSibling){let B=q.nextElementSibling;B.textContent=S[P],B.style.display="block"}});return}}let O=u(o+1);O!==-1?(o=O,h()):(c&&c.close(),r(a))},j.appendChild(V),d.appendChild(j)},b=n[o];c=t.custom({title:b.title,type:b.type||"info",content:d,footer:!1,width:600,onClose:()=>{r(null)}}),setTimeout(()=>{p=document.querySelector(".vex-modal:last-child"),h()},0)})}var nt=class{constructor(){this.currentTheme="auto";this.mediaQuery=null;typeof window<"u"&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.init())}init(){this.mediaQuery?.addEventListener("change",()=>{this.currentTheme==="auto"&&this.applyTheme()})}setTheme(t){this.currentTheme=t,this.applyTheme()}getTheme(){return this.currentTheme}applyTheme(){if(typeof document>"u")return;let t=document.documentElement,r=this.currentTheme==="dark"||this.currentTheme==="auto"&&this.mediaQuery?.matches;r?(t.classList.add("vex-dark"),t.classList.remove("vex-light")):(t.classList.add("vex-light"),t.classList.remove("vex-dark")),t.setAttribute("data-vex-theme",r?"dark":"light")}setTokens(t){if(typeof document>"u")return;let r=document.documentElement;Object.entries(t).forEach(([o,a])=>{r.style.setProperty(o,a)})}isReducedMotion(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}},rt=new nt;var se=new ke,zr=new ee,Kr=Re;function Qr(n){n.theme&&rt.setTheme(n.theme)}function Gr(n){rt.setTheme(n)}function Xr(n){se.dismiss(n)}function Jr(n){se.dismissAll(n)}function Zr(n,t){se.update(n,t)}function ei(n,t){se.progress(n,t)}var ti={alert:se,modal:zr,drawer:un,flow:dn,history:Kr,configure:Qr,setTheme:Gr,dismiss:Xr,dismissAll:Jr,update:Zr,progress:ei,prompt:{inline:async(n,t)=>{let r=typeof n=="string"?document.querySelector(n):n;if(!r)return null;let o=r.textContent,a=r.style.display,c=document.createElement("input");return c.type="text",c.value=o||"",c.placeholder=t.placeholder||"",c.className="vex-inline-prompt",c.style.fontSize=getComputedStyle(r).fontSize,c.style.fontFamily=getComputedStyle(r).fontFamily,c.style.border="1px solid var(--vex-primary, #6366f1)",c.style.borderRadius="4px",c.style.padding="2px 4px",c.style.background="var(--vex-bg, #000)",c.style.color="var(--vex-text, #fff)",r.style.display="none",r.parentNode?.insertBefore(c,r),c.focus(),new Promise(p=>{let u=d=>{if(d!==null&&t.validate&&t.validate(d)){c.style.borderColor="red";return}c.remove(),r.style.display=a,d!==null&&(r.textContent=d),p(d)};c.onblur=()=>u(c.value),c.onkeydown=d=>{d.key==="Enter"&&u(c.value),d.key==="Escape"&&u(null)}})}}},$=ti;function ni(){let n=(0,le.useRef)([]),t={...$.alert,success:(r,o)=>{let a=$.alert.success(r,o);return n.current.push(a),a},error:(r,o)=>{let a=$.alert.error(r,o);return n.current.push(a),a},warning:(r,o)=>{let a=$.alert.warning(r,o);return n.current.push(a),a},info:(r,o)=>{let a=$.alert.info(r,o);return n.current.push(a),a},neutral:(r,o)=>{let a=$.alert.neutral(r,o);return n.current.push(a),a},loading:(r,o)=>{let a=$.alert.loading(r,o);return n.current.push(a),a},upload:(r,o)=>{let a=$.alert.upload(r,o);return n.current.push(a),a},inline:(r,o)=>{let a=$.alert.inline(r,o);return n.current.push(a),a},fixed:r=>{let o=$.alert.fixed(r);return n.current.push(o),o},attach:(r,o)=>{let a=$.alert.attach(r,o);return n.current.push(a),a},show:r=>{let o=$.alert.show(r);return n.current.push(o),o}};return(0,le.useEffect)(()=>()=>{n.current.forEach(r=>$.dismiss(r))},[]),{...$,alert:t}}var ri=({children:n,config:t})=>((0,le.useEffect)(()=>{t&&$.configure(t)},[t]),n);return Lr(ii);})();
39
+ /*! Bundled license information:
40
+
41
+ react/cjs/react.production.min.js:
42
+ (**
43
+ * @license React
44
+ * react.production.min.js
45
+ *
46
+ * Copyright (c) Facebook, Inc. and its affiliates.
47
+ *
48
+ * This source code is licensed under the MIT license found in the
49
+ * LICENSE file in the root directory of this source tree.
50
+ *)
51
+
52
+ react/cjs/react.development.js:
53
+ (**
54
+ * @license React
55
+ * react.development.js
56
+ *
57
+ * Copyright (c) Facebook, Inc. and its affiliates.
58
+ *
59
+ * This source code is licensed under the MIT license found in the
60
+ * LICENSE file in the root directory of this source tree.
61
+ *)
62
+ */
63
+ //# sourceMappingURL=react.umd.js.map