@object-ui/components 6.2.3 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +175 -0
- package/README.md +0 -13
- package/dist/SchemaRenderer.d.ts +4 -0
- package/dist/{packages/components/src/custom → custom}/action-param-dialog.d.ts +1 -1
- package/dist/{packages/components/src/custom → custom}/button-group.d.ts +3 -3
- package/dist/{packages/components/src/custom → custom}/combobox.d.ts +2 -1
- package/dist/{packages/components/src/custom → custom}/config-field-renderer.d.ts +9 -1
- package/dist/{packages/components/src/custom → custom}/config-panel-renderer.d.ts +1 -1
- package/dist/{packages/components/src/custom → custom}/config-row.d.ts +1 -1
- package/dist/{packages/components/src/custom → custom}/date-picker.d.ts +2 -1
- package/dist/{packages/components/src/custom → custom}/empty.d.ts +7 -7
- package/dist/{packages/components/src/custom → custom}/export-progress-dialog.d.ts +20 -1
- package/dist/{packages/components/src/custom → custom}/filter-builder.d.ts +3 -2
- package/dist/{packages/components/src/custom → custom}/grouping-editor.d.ts +2 -1
- package/dist/{packages/components/src/custom → custom}/item.d.ts +10 -10
- package/dist/{packages/components/src/custom → custom}/kbd.d.ts +2 -2
- package/dist/{packages/components/src/custom → custom}/section-header.d.ts +1 -1
- package/dist/{packages/components/src/custom → custom}/shimmer-skeleton.d.ts +1 -1
- package/dist/{packages/components/src/custom → custom}/sort-builder.d.ts +2 -1
- package/dist/{packages/components/src/custom → custom}/spinner.d.ts +1 -1
- package/dist/{packages/components/src/custom → custom}/view-skeleton.d.ts +6 -6
- package/dist/{packages/components/src/custom → custom}/view-states.d.ts +3 -3
- package/dist/{packages/components/src/debug → debug}/DebugPanel.d.ts +2 -2
- package/dist/{packages/components/src/hooks → hooks}/related-count-store.d.ts +1 -0
- package/dist/{packages/components/src/hooks → hooks}/use-export-job.d.ts +1 -1
- package/dist/index.css +275 -163
- package/dist/index.d.ts +19 -2
- package/dist/index.js +3405 -2725
- package/dist/index.umd.cjs +6 -6
- package/dist/{packages/components/src/renderers → renderers}/action/action-bar.d.ts +1 -1
- package/dist/{packages/components/src/renderers → renderers}/action/action-button.d.ts +1 -1
- package/dist/{packages/components/src/renderers → renderers}/action/action-group.d.ts +1 -1
- package/dist/{packages/components/src/renderers → renderers}/action/action-icon.d.ts +1 -1
- package/dist/{packages/components/src/renderers → renderers}/action/action-menu.d.ts +1 -1
- package/dist/renderers/basic/data-list.d.ts +19 -0
- package/dist/renderers/basic/metadata-viewer.d.ts +23 -0
- package/dist/renderers/data-display/table.d.ts +2 -0
- package/dist/{packages/components/src/renderers → renderers}/layout/page.d.ts +1 -1
- package/dist/renderers/placeholders.d.ts +3 -0
- package/dist/{packages/components/src/share → share}/ShareDialog.d.ts +2 -2
- package/dist/{packages/components/src/ui → ui}/alert-dialog.d.ts +2 -2
- package/dist/{packages/components/src/ui → ui}/badge.d.ts +1 -1
- package/dist/{packages/components/src/ui → ui}/breadcrumb.d.ts +2 -2
- package/dist/{packages/components/src/ui → ui}/calendar.d.ts +2 -2
- package/dist/{packages/components/src/ui → ui}/chart.d.ts +1 -1
- package/dist/{packages/components/src/ui → ui}/command.d.ts +22 -2
- package/dist/{packages/components/src/ui → ui}/context-menu.d.ts +1 -1
- package/dist/{packages/components/src/ui → ui}/dialog.d.ts +2 -2
- package/dist/{packages/components/src/ui → ui}/drawer.d.ts +3 -3
- package/dist/{packages/components/src/ui → ui}/dropdown-menu.d.ts +1 -1
- package/dist/{packages/components/src/ui → ui}/form.d.ts +6 -4
- package/dist/{packages/components/src/ui → ui}/menubar.d.ts +6 -6
- package/dist/{packages/components/src/ui → ui}/pagination.d.ts +5 -5
- package/dist/{packages/components/src/ui → ui}/resizable.d.ts +2 -2
- package/dist/{packages/components/src/ui → ui}/sheet.d.ts +2 -2
- package/dist/{packages/components/src/ui → ui}/skeleton.d.ts +1 -1
- package/dist/{packages/components/src/ui → ui}/sonner.d.ts +3 -3
- package/package.json +41 -48
- package/dist/packages/components/src/SchemaRenderer.d.ts +0 -3
- package/dist/packages/components/src/index.d.ts +0 -19
- package/dist/packages/components/src/renderers/data-display/table.d.ts +0 -8
- package/dist/packages/components/src/renderers/placeholders.d.ts +0 -9
- /package/dist/{packages/components/src/custom → custom}/RecordTitleChip.d.ts +0 -0
- /package/dist/{packages/components/src/custom → custom}/field.d.ts +0 -0
- /package/dist/{packages/components/src/custom → custom}/index.d.ts +0 -0
- /package/dist/{packages/components/src/custom → custom}/input-group.d.ts +0 -0
- /package/dist/{packages/components/src/custom → custom}/mobile-dialog-content.d.ts +0 -0
- /package/dist/{packages/components/src/custom → custom}/native-select.d.ts +0 -0
- /package/dist/{packages/components/src/custom → custom}/navigation-overlay.d.ts +0 -0
- /package/dist/{packages/components/src/custom → custom}/refresh-indicator.d.ts +0 -0
- /package/dist/{packages/components/src/debug → debug}/index.d.ts +0 -0
- /package/dist/{packages/components/src/hooks → hooks}/use-config-draft.d.ts +0 -0
- /package/dist/{packages/components/src/hooks → hooks}/use-mobile.d.ts +0 -0
- /package/dist/{packages/components/src/hooks → hooks}/use-resize-observer.d.ts +0 -0
- /package/dist/{packages/components/src/lib → lib}/lazy-icon.d.ts +0 -0
- /package/dist/{packages/components/src/lib → lib}/use-sync-external-store-shim.d.ts +0 -0
- /package/dist/{packages/components/src/lib → lib}/use-sync-external-store-with-selector-shim.d.ts +0 -0
- /package/dist/{packages/components/src/lib → lib}/utils.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/action/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/action/resolve-icon.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/button-group.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/div.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/elements.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/html.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/icon.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/image.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/navigation-menu.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/pagination.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/separator.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/span.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/basic/text.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/complex/carousel.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/complex/data-table.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/complex/filter-builder.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/complex/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/complex/resizable.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/complex/scroll-area.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/complex/table.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/alert.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/avatar.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/badge.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/breadcrumb.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/kbd.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/list.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/statistic.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/data-display/tree-view.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/disclosure/accordion.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/disclosure/collapsible.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/disclosure/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/disclosure/toggle-group.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/empty.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/loading.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/progress.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/skeleton.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/sonner.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/spinner.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/toast.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/feedback/toaster.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/button.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/calendar.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/checkbox.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/combobox.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/command.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/date-picker.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/file-upload.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/form.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/input-otp.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/input.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/label.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/radio-group.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/select.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/slider.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/switch.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/textarea.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/form/toggle.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/aspect-ratio.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/card.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/container.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/containers.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/flex.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/grid.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/semantic.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/stack.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/layout/tabs.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/navigation/header-bar.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/navigation/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/navigation/sidebar.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/alert-dialog.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/context-menu.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/dialog.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/drawer.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/dropdown-menu.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/hover-card.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/index.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/menubar.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/popover.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/sheet.d.ts +0 -0
- /package/dist/{packages/components/src/renderers → renderers}/overlay/tooltip.d.ts +0 -0
- /package/dist/{packages/components/src/share → share}/index.d.ts +0 -0
- /package/dist/{packages/components/src/types → types}/config-panel.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/accordion.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/alert.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/aspect-ratio.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/avatar.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/button.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/card.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/carousel.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/checkbox.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/collapsible.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/hover-card.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/index.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/input-otp.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/input.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/label.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/navigation-menu.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/popover.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/progress.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/radio-group.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/scroll-area.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/select.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/separator.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/sidebar.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/slider.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/switch.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/table.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/tabs.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/textarea.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/toast.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/toggle-group.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/toggle.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/tooltip.d.ts +0 -0
- /package/dist/{packages/components/src/ui → ui}/typography.d.ts +0 -0
package/dist/index.umd.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@object-ui/core"),require("clsx"),require("tailwind-merge"),require("@object-ui/react"),require("react"),require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("lucide-react"),require("@radix-ui/react-alert-dialog"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-aspect-ratio"),require("@radix-ui/react-avatar"),require("react-day-picker"),require("embla-carousel-react"),require("recharts"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-collapsible"),require("cmdk"),require("@radix-ui/react-dialog"),require("@radix-ui/react-context-menu"),require("vaul"),require("@radix-ui/react-dropdown-menu"),require("react-hook-form"),require("@radix-ui/react-label"),require("@radix-ui/react-hover-card"),require("input-otp"),require("@radix-ui/react-menubar"),require("@radix-ui/react-navigation-menu"),require("@radix-ui/react-popover"),require("@radix-ui/react-progress"),require("@radix-ui/react-radio-group"),require("react-resizable-panels"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-select"),require("@radix-ui/react-separator"),require("@radix-ui/react-tooltip"),require("@radix-ui/react-slider"),require("next-themes"),require("sonner"),require("@radix-ui/react-switch"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("lucide-react/dynamic.mjs"),require("
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@object-ui/core"),require("clsx"),require("tailwind-merge"),require("@object-ui/react"),require("react"),require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("lucide-react"),require("@radix-ui/react-alert-dialog"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-aspect-ratio"),require("@radix-ui/react-avatar"),require("react-day-picker"),require("embla-carousel-react"),require("recharts"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-collapsible"),require("cmdk"),require("@radix-ui/react-dialog"),require("@radix-ui/react-context-menu"),require("vaul"),require("@radix-ui/react-dropdown-menu"),require("react-hook-form"),require("@radix-ui/react-label"),require("@radix-ui/react-hover-card"),require("input-otp"),require("@radix-ui/react-menubar"),require("@radix-ui/react-navigation-menu"),require("@radix-ui/react-popover"),require("@radix-ui/react-progress"),require("@radix-ui/react-radio-group"),require("react-resizable-panels"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-select"),require("@radix-ui/react-separator"),require("@radix-ui/react-tooltip"),require("@radix-ui/react-slider"),require("next-themes"),require("sonner"),require("@radix-ui/react-switch"),require("@radix-ui/react-tabs"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@object-ui/i18n"),require("lucide-react/dynamic.mjs"),require("date-fns"),require("@object-ui/types")):typeof define==`function`&&define.amd?define(`exports,@object-ui/core,clsx,tailwind-merge,@object-ui/react,react,react/jsx-runtime,@radix-ui/react-accordion,lucide-react,@radix-ui/react-alert-dialog,@radix-ui/react-slot,class-variance-authority,@radix-ui/react-aspect-ratio,@radix-ui/react-avatar,react-day-picker,embla-carousel-react,recharts,@radix-ui/react-checkbox,@radix-ui/react-collapsible,cmdk,@radix-ui/react-dialog,@radix-ui/react-context-menu,vaul,@radix-ui/react-dropdown-menu,react-hook-form,@radix-ui/react-label,@radix-ui/react-hover-card,input-otp,@radix-ui/react-menubar,@radix-ui/react-navigation-menu,@radix-ui/react-popover,@radix-ui/react-progress,@radix-ui/react-radio-group,react-resizable-panels,@radix-ui/react-scroll-area,@radix-ui/react-select,@radix-ui/react-separator,@radix-ui/react-tooltip,@radix-ui/react-slider,next-themes,sonner,@radix-ui/react-switch,@radix-ui/react-tabs,@radix-ui/react-toggle-group,@radix-ui/react-toggle,@object-ui/i18n,lucide-react/dynamic.mjs,date-fns,@object-ui/types`.split(`,`),t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIComponents={},e.ObjectUICore,e.clsx,e.tailwind_merge,e.ObjectUIReact,e.React,e.react_jsx_runtime,e._radix_ui_react_accordion,e.lucide_react,e._radix_ui_react_alert_dialog,e._radix_ui_react_slot,e.class_variance_authority,e._radix_ui_react_aspect_ratio,e._radix_ui_react_avatar,e.react_day_picker,e.embla_carousel_react,e.recharts,e._radix_ui_react_checkbox,e._radix_ui_react_collapsible,e.cmdk,e._radix_ui_react_dialog,e._radix_ui_react_context_menu,e.vaul,e._radix_ui_react_dropdown_menu,e.react_hook_form,e._radix_ui_react_label,e._radix_ui_react_hover_card,e.input_otp,e._radix_ui_react_menubar,e._radix_ui_react_navigation_menu,e._radix_ui_react_popover,e._radix_ui_react_progress,e._radix_ui_react_radio_group,e.react_resizable_panels,e._radix_ui_react_scroll_area,e._radix_ui_react_select,e._radix_ui_react_separator,e._radix_ui_react_tooltip,e._radix_ui_react_slider,e.next_themes,e.sonner,e._radix_ui_react_switch,e._radix_ui_react_tabs,e._radix_ui_react_toggle_group,e._radix_ui_react_toggle,e._object_ui_i18n,e.lucide_react_dynamic_mjs,e.date_fns,e._object_ui_types))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,ee,te,M,N,ne,re,ie,ae,P,oe,se,ce,le,F,ue,de,fe){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var pe=Object.create,me=Object.defineProperty,I=Object.getOwnPropertyDescriptor,he=Object.getOwnPropertyNames,L=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty,_e=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=he(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ge.call(e,s)&&s!==n&&me(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=I(t,s))||r.enumerable});return e},R=(e,t,n)=>(n=e==null?{}:pe(L(e)),_e(t||!e||!e.__esModule?me(n,`default`,{value:e,enumerable:!0}):n,e));a=R(a,1),s=R(s,1),l=R(l,1),f=R(f,1),p=R(p,1),h=R(h,1),g=R(g,1),_=R(_,1),v=R(v,1),b=R(b,1),x=R(x,1),C=R(C,1),T=R(T,1),E=R(E,1),O=R(O,1),k=R(k,1),A=R(A,1),j=R(j,1),ee=R(ee,1),M=R(M,1),N=R(N,1),ne=R(ne,1),re=R(re,1),ie=R(ie,1),oe=R(oe,1),se=R(se,1),ce=R(ce,1),le=R(le,1);function z(...e){return(0,r.twMerge)((0,n.clsx)(e))}function B(e){return e?typeof e==`string`||typeof e==`number`?e:Array.isArray(e)?e.length===0?null:e.length===1?(0,o.jsx)(i.SchemaRenderer,{schema:e[0]}):e.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},e.id||t)):(0,o.jsx)(i.SchemaRenderer,{schema:e}):null}var ve=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{process.env.NODE_ENV!==`production`&&console.warn(`[ObjectUI] The "div" component is deprecated. Please use Shadcn components instead:
|
|
2
2
|
- For containers: use "card", "flex", or semantic layout components
|
|
3
3
|
- For simple wrappers: use layout components like "container", "stack", or "grid"
|
|
4
|
-
See documentation at https://www.objectui.org/docs/components for alternatives.`);let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(`div`,{ref:r,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s,children:B(e.children||e.body)})});t.ComponentRegistry.register(`div`,
|
|
4
|
+
See documentation at https://www.objectui.org/docs/components for alternatives.`);let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(`div`,{ref:r,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s,children:B(e.children||e.body)})});t.ComponentRegistry.register(`div`,ve,{namespace:`ui`,label:`Container (Deprecated)`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{className:`p-2 sm:p-4 border border-dashed border-gray-300 rounded min-h-[100px]`}}),t.ComponentRegistry.register(`text`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return n||e.className||a.className?(0,o.jsx)(`span`,{"data-obj-id":n,"data-obj-type":r,style:i,className:e.className||a.className,...a,children:e.content||e.value}):(0,o.jsx)(o.Fragment,{children:e.content||e.value})},{namespace:`ui`,label:`Text`,inputs:[{name:`content`,type:`string`,label:`Content`,required:!0}],defaultProps:{content:`Text content`}});var ye=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{process.env.NODE_ENV!==`production`&&console.warn(`[ObjectUI] The "span" component is deprecated. Please use Shadcn components instead:
|
|
5
5
|
- For badges/labels: use "badge" component
|
|
6
6
|
- For inline text emphasis: use "text" component with appropriate className
|
|
7
|
-
See documentation at https://www.objectui.org/docs/components for alternatives.`);let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(`span`,{ref:r,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s,children:B(e.body)})});t.ComponentRegistry.register(`span`,ve,{namespace:`ui`,label:`Inline Container (Deprecated)`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{className:`px-1.5 py-0.5 sm:px-2 sm:py-1`},defaultChildren:[{type:`text`,content:`Inline text`}]});var V=s.Root,ye=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(s.Item,{ref:n,className:z(`border-b`,e),...t}));ye.displayName=`AccordionItem`;var be=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(s.Header,{className:`flex`,children:(0,o.jsxs)(s.Trigger,{ref:r,className:z(`flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,o.jsx)(c.ChevronDown,{className:`h-4 w-4 shrink-0 transition-transform duration-200`})]})}));be.displayName=s.Trigger.displayName;var xe=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(s.Content,{ref:r,className:`overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,o.jsx)(`div`,{className:z(`pb-4 pt-0`,e),children:t})}));xe.displayName=s.Content.displayName;var H=(0,d.cva)(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),U=a.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,o.jsx)(r?u.Slot:`button`,{className:z(H({variant:t,size:n,className:e})),ref:a,...i}));U.displayName=`Button`;var Se=l.Root,Ce=l.Trigger,we=l.Portal,Te=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Overlay,{className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Te.displayName=l.Overlay.displayName;var Ee=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(we,{children:[(0,o.jsx)(Te,{}),(0,o.jsx)(l.Content,{ref:n,className:z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));Ee.displayName=l.Content.displayName;var De=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});De.displayName=`AlertDialogHeader`;var W=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});W.displayName=`AlertDialogFooter`;var Oe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Title,{ref:n,className:z(`text-lg font-semibold`,e),...t}));Oe.displayName=l.Title.displayName;var ke=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Description,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));ke.displayName=l.Description.displayName;var Ae=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Action,{ref:n,className:z(H(),e),...t}));Ae.displayName=l.Action.displayName;var je=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Cancel,{ref:n,className:z(H({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));je.displayName=l.Cancel.displayName;var Me=(0,d.cva)(`relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground`,{variants:{variant:{default:`bg-background text-foreground`,destructive:`border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive`}},defaultVariants:{variant:`default`}}),Ne=a.forwardRef(({className:e,variant:t,...n},r)=>(0,o.jsx)(`div`,{ref:r,role:`alert`,className:z(Me({variant:t}),e),...n}));Ne.displayName=`Alert`;var Pe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h5`,{ref:n,className:z(`mb-1 font-medium leading-none tracking-tight`,e),...t}));Pe.displayName=`AlertTitle`;var Fe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`text-sm [&_p]:leading-relaxed`,e),...t}));Fe.displayName=`AlertDescription`;var Ie=f.Root,Le=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(p.Root,{ref:n,className:z(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));Le.displayName=p.Root.displayName;var Re=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(p.Image,{ref:n,className:z(`aspect-square h-full w-full`,e),...t}));Re.displayName=p.Image.displayName;var ze=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(p.Fallback,{ref:n,className:z(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...t}));ze.displayName=p.Fallback.displayName;var Be=(0,d.cva)(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Ve({className:e,variant:t,...n}){return(0,o.jsx)(`div`,{className:z(Be({variant:t}),e),...n})}var He=a.forwardRef(({...e},t)=>(0,o.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));He.displayName=`Breadcrumb`;var Ue=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ol`,{ref:n,className:z(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5`,e),...t}));Ue.displayName=`BreadcrumbList`;var We=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,className:z(`inline-flex items-center gap-1.5`,e),...t}));We.displayName=`BreadcrumbItem`;var Ge=a.forwardRef(({asChild:e,className:t,...n},r)=>(0,o.jsx)(e?u.Slot:`a`,{ref:r,className:z(`transition-colors hover:text-foreground`,t),...n}));Ge.displayName=`BreadcrumbLink`;var Ke=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:z(`font-normal text-foreground`,e),...t}));Ke.displayName=`BreadcrumbPage`;var qe=({children:e,className:t,...n})=>(0,o.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:z(`[&>svg]:w-3.5 [&>svg]:h-3.5`,t),...n,children:e??(0,o.jsx)(c.ChevronRight,{})});qe.displayName=`BreadcrumbSeparator`;var Je=({className:e,...t})=>(0,o.jsxs)(`span`,{role:`presentation`,"aria-hidden":`true`,className:z(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,o.jsx)(c.MoreHorizontal,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`More`})]});Je.displayName=`BreadcrumbElipssis`;function Ye({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r=`label`,buttonVariant:i=`ghost`,formatters:a,components:s,...l}){let u=(0,m.getDefaultClassNames)();return(0,o.jsx)(m.DayPicker,{showOutsideDays:n,className:z(`bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:e=>e.toLocaleString(`default`,{month:`short`}),...a},classNames:{root:z(`w-fit`,u.root),months:z(`relative flex flex-col gap-4 md:flex-row`,u.months),month:z(`flex w-full flex-col gap-4`,u.month),nav:z(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,u.nav),button_previous:z(H({variant:i}),`h-(--cell-size) w-(--cell-size) select-none p-0 aria-disabled:opacity-50`,u.button_previous),button_next:z(H({variant:i}),`h-(--cell-size) w-(--cell-size) select-none p-0 aria-disabled:opacity-50`,u.button_next),month_caption:z(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,u.month_caption),dropdowns:z(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,u.dropdowns),dropdown_root:z(`has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border`,u.dropdown_root),dropdown:z(`bg-popover absolute inset-0 opacity-0`,u.dropdown),caption_label:z(`select-none font-medium`,r===`label`?`text-sm`:`[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5`,u.caption_label),weekdays:z(`flex`,u.weekdays),weekday:z(`text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal`,u.weekday),week:z(`mt-2 flex w-full`,u.week),week_number_header:z(`w-(--cell-size) select-none`,u.week_number_header),week_number:z(`text-muted-foreground select-none text-[0.8rem]`,u.week_number),day:z(`group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md`,u.day),range_start:z(`bg-accent rounded-l-md`,u.range_start),range_middle:z(`rounded-none`,u.range_middle),range_end:z(`bg-accent rounded-r-md`,u.range_end),today:z(`bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none`,u.today),outside:z(`text-muted-foreground aria-selected:text-muted-foreground`,u.outside),disabled:z(`text-muted-foreground opacity-50`,u.disabled),hidden:z(`invisible`,u.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>(0,o.jsx)(`div`,{"data-slot":`calendar`,ref:t,className:z(e),...n}),Chevron:({className:e,orientation:t,...n})=>t===`left`?(0,o.jsx)(c.ChevronLeftIcon,{className:z(`size-4`,e),...n}):t===`right`?(0,o.jsx)(c.ChevronRightIcon,{className:z(`size-4`,e),...n}):(0,o.jsx)(c.ChevronDownIcon,{className:z(`size-4`,e),...n}),DayButton:Xe,WeekNumber:({children:e,...t})=>(0,o.jsx)(`td`,{...t,children:(0,o.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...s},...l})}function Xe({className:e,day:t,modifiers:n,...r}){let i=(0,m.getDefaultClassNames)(),s=a.useRef(null);return a.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),(0,o.jsx)(U,{ref:s,variant:`ghost`,size:`icon`,"data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:z(`data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70`,i.day,e),...r})}var Ze=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));Ze.displayName=`Card`;var Qe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`flex flex-col space-y-1.5 p-6`,e),...t}));Qe.displayName=`CardHeader`;var $e=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));$e.displayName=`CardTitle`;var et=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));et.displayName=`CardDescription`;var tt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`p-6 pt-0`,e),...t}));tt.displayName=`CardContent`;var nt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`flex items-center p-6 pt-0`,e),...t}));nt.displayName=`CardFooter`;var rt=a.createContext(null);function it(){let e=a.useContext(rt);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}var at=a.forwardRef(({orientation:e=`horizontal`,opts:t,setApi:n,plugins:r,className:i,children:s,...c},l)=>{let[u,d]=(0,h.default)({...t,axis:e===`horizontal`?`x`:`y`},r),[f,p]=a.useState(!1),[m,g]=a.useState(!1),_=a.useCallback(e=>{e&&(p(e.canScrollPrev()),g(e.canScrollNext()))},[]),v=a.useCallback(()=>{d?.scrollPrev()},[d]),y=a.useCallback(()=>{d?.scrollNext()},[d]),b=a.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),v()):e.key===`ArrowRight`&&(e.preventDefault(),y())},[v,y]);return a.useEffect(()=>{!d||!n||n(d)},[d,n]),a.useEffect(()=>{if(d)return _(d),d.on(`reInit`,_),d.on(`select`,_),()=>{d?.off(`select`,_)}},[d,_]),(0,o.jsx)(rt.Provider,{value:{carouselRef:u,api:d,opts:t,orientation:e||(t?.axis===`y`?`vertical`:`horizontal`),scrollPrev:v,scrollNext:y,canScrollPrev:f,canScrollNext:m},children:(0,o.jsx)(`div`,{ref:l,onKeyDownCapture:b,className:z(`relative`,i),role:`region`,"aria-roledescription":`carousel`,...c,children:s})})});at.displayName=`Carousel`;var ot=a.forwardRef(({className:e,...t},n)=>{let{carouselRef:r,orientation:i}=it();return(0,o.jsx)(`div`,{ref:r,className:`overflow-hidden`,children:(0,o.jsx)(`div`,{ref:n,className:z(`flex`,i===`horizontal`?`-ml-4`:`-mt-4 flex-col`,e),...t})})});ot.displayName=`CarouselContent`;var st=a.forwardRef(({className:e,...t},n)=>{let{orientation:r}=it();return(0,o.jsx)(`div`,{ref:n,role:`group`,"aria-roledescription":`slide`,className:z(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`pl-4`:`pt-4`,e),...t})});st.displayName=`CarouselItem`;var ct=a.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollPrev:s,canScrollPrev:l}=it();return(0,o.jsxs)(U,{ref:i,variant:t,size:n,className:z(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-left-12 top-1/2 -translate-y-1/2`:`-top-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!l,onClick:s,...r,children:[(0,o.jsx)(c.ArrowLeft,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})});ct.displayName=`CarouselPrevious`;var lt=a.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollNext:s,canScrollNext:l}=it();return(0,o.jsxs)(U,{ref:i,variant:t,size:n,className:z(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-right-12 top-1/2 -translate-y-1/2`:`-bottom-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!l,onClick:s,...r,children:[(0,o.jsx)(c.ArrowRight,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})});lt.displayName=`CarouselNext`;var ut={light:``,dark:`.dark`},dt=a.createContext(null);function ft(){let e=a.useContext(dt);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}var pt=a.forwardRef(({id:e,className:t,children:n,config:r,...i},s)=>{let c=a.useId(),l=`chart-${e||c.replace(/:/g,``)}`;return(0,o.jsx)(dt.Provider,{value:{config:r},children:(0,o.jsxs)(`div`,{"data-chart":l,ref:s,className:z(`flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none`,t),...i,children:[(0,o.jsx)(mt,{id:l,config:r}),(0,o.jsx)(g.ResponsiveContainer,{children:n})]})})});pt.displayName=`Chart`;var mt=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme||e.color);return n.length?(0,o.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(ut).map(([t,r])=>`
|
|
7
|
+
See documentation at https://www.objectui.org/docs/components for alternatives.`);let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(`span`,{ref:r,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s,children:B(e.body)})});t.ComponentRegistry.register(`span`,ye,{namespace:`ui`,label:`Inline Container (Deprecated)`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{className:`px-1.5 py-0.5 sm:px-2 sm:py-1`},defaultChildren:[{type:`text`,content:`Inline text`}]});var be=s.Root,xe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(s.Item,{ref:n,className:z(`border-b`,e),...t}));xe.displayName=`AccordionItem`;var Se=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(s.Header,{className:`flex`,children:(0,o.jsxs)(s.Trigger,{ref:r,className:z(`flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,o.jsx)(c.ChevronDown,{className:`h-4 w-4 shrink-0 transition-transform duration-200`})]})}));Se.displayName=s.Trigger.displayName;var Ce=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(s.Content,{ref:r,className:`overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,o.jsx)(`div`,{className:z(`pb-4 pt-0`,e),children:t})}));Ce.displayName=s.Content.displayName;var we=(0,d.cva)(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),V=a.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,o.jsx)(r?u.Slot:`button`,{className:z(we({variant:t,size:n,className:e})),ref:a,...i}));V.displayName=`Button`;var H=l.Root,Te=l.Trigger,Ee=l.Portal,De=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Overlay,{className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));De.displayName=l.Overlay.displayName;var Oe=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(Ee,{children:[(0,o.jsx)(De,{}),(0,o.jsx)(l.Content,{ref:n,className:z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...t})]}));Oe.displayName=l.Content.displayName;var ke=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});ke.displayName=`AlertDialogHeader`;var Ae=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Ae.displayName=`AlertDialogFooter`;var je=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Title,{ref:n,className:z(`text-lg font-semibold`,e),...t}));je.displayName=l.Title.displayName;var Me=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Description,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));Me.displayName=l.Description.displayName;var Ne=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Action,{ref:n,className:z(we(),e),...t}));Ne.displayName=l.Action.displayName;var Pe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(l.Cancel,{ref:n,className:z(we({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));Pe.displayName=l.Cancel.displayName;var U=(0,d.cva)(`relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground`,{variants:{variant:{default:`bg-background text-foreground`,destructive:`border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive`}},defaultVariants:{variant:`default`}}),W=a.forwardRef(({className:e,variant:t,...n},r)=>(0,o.jsx)(`div`,{ref:r,role:`alert`,className:z(U({variant:t}),e),...n}));W.displayName=`Alert`;var Fe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h5`,{ref:n,className:z(`mb-1 font-medium leading-none tracking-tight`,e),...t}));Fe.displayName=`AlertTitle`;var Ie=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`text-sm [&_p]:leading-relaxed`,e),...t}));Ie.displayName=`AlertDescription`;var Le=f.Root,Re=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(p.Root,{ref:n,className:z(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));Re.displayName=p.Root.displayName;var ze=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(p.Image,{ref:n,className:z(`aspect-square h-full w-full`,e),...t}));ze.displayName=p.Image.displayName;var Be=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(p.Fallback,{ref:n,className:z(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...t}));Be.displayName=p.Fallback.displayName;var Ve=(0,d.cva)(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function He({className:e,variant:t,...n}){return(0,o.jsx)(`div`,{className:z(Ve({variant:t}),e),...n})}var Ue=a.forwardRef(({...e},t)=>(0,o.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));Ue.displayName=`Breadcrumb`;var We=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ol`,{ref:n,className:z(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5`,e),...t}));We.displayName=`BreadcrumbList`;var Ge=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,className:z(`inline-flex items-center gap-1.5`,e),...t}));Ge.displayName=`BreadcrumbItem`;var Ke=a.forwardRef(({asChild:e,className:t,...n},r)=>(0,o.jsx)(e?u.Slot:`a`,{ref:r,className:z(`transition-colors hover:text-foreground`,t),...n}));Ke.displayName=`BreadcrumbLink`;var qe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:z(`font-normal text-foreground`,e),...t}));qe.displayName=`BreadcrumbPage`;var Je=({children:e,className:t,...n})=>(0,o.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:z(`[&>svg]:w-3.5 [&>svg]:h-3.5`,t),...n,children:e??(0,o.jsx)(c.ChevronRight,{})});Je.displayName=`BreadcrumbSeparator`;var Ye=({className:e,...t})=>(0,o.jsxs)(`span`,{role:`presentation`,"aria-hidden":`true`,className:z(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,o.jsx)(c.MoreHorizontal,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`More`})]});Ye.displayName=`BreadcrumbElipssis`;function Xe({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r=`label`,buttonVariant:i=`ghost`,formatters:a,components:s,...l}){let u=(0,m.getDefaultClassNames)();return(0,o.jsx)(m.DayPicker,{showOutsideDays:n,className:z(`bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:e=>e.toLocaleString(`default`,{month:`short`}),...a},classNames:{root:z(`w-fit`,u.root),months:z(`relative flex flex-col gap-4 md:flex-row`,u.months),month:z(`flex w-full flex-col gap-4`,u.month),nav:z(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,u.nav),button_previous:z(we({variant:i}),`h-(--cell-size) w-(--cell-size) select-none p-0 aria-disabled:opacity-50`,u.button_previous),button_next:z(we({variant:i}),`h-(--cell-size) w-(--cell-size) select-none p-0 aria-disabled:opacity-50`,u.button_next),month_caption:z(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,u.month_caption),dropdowns:z(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,u.dropdowns),dropdown_root:z(`has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border`,u.dropdown_root),dropdown:z(`bg-popover absolute inset-0 opacity-0`,u.dropdown),caption_label:z(`select-none font-medium`,r===`label`?`text-sm`:`[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5`,u.caption_label),weekdays:z(`flex`,u.weekdays),weekday:z(`text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal`,u.weekday),week:z(`mt-2 flex w-full`,u.week),week_number_header:z(`w-(--cell-size) select-none`,u.week_number_header),week_number:z(`text-muted-foreground select-none text-[0.8rem]`,u.week_number),day:z(`group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md`,u.day),range_start:z(`bg-accent rounded-l-md`,u.range_start),range_middle:z(`rounded-none`,u.range_middle),range_end:z(`bg-accent rounded-r-md`,u.range_end),today:z(`bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none`,u.today),outside:z(`text-muted-foreground aria-selected:text-muted-foreground`,u.outside),disabled:z(`text-muted-foreground opacity-50`,u.disabled),hidden:z(`invisible`,u.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>(0,o.jsx)(`div`,{"data-slot":`calendar`,ref:t,className:z(e),...n}),Chevron:({className:e,orientation:t,...n})=>t===`left`?(0,o.jsx)(c.ChevronLeftIcon,{className:z(`size-4`,e),...n}):t===`right`?(0,o.jsx)(c.ChevronRightIcon,{className:z(`size-4`,e),...n}):(0,o.jsx)(c.ChevronDownIcon,{className:z(`size-4`,e),...n}),DayButton:Ze,WeekNumber:({children:e,...t})=>(0,o.jsx)(`td`,{...t,children:(0,o.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...s},...l})}function Ze({className:e,day:t,modifiers:n,...r}){let i=(0,m.getDefaultClassNames)(),s=a.useRef(null);return a.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),(0,o.jsx)(V,{ref:s,variant:`ghost`,size:`icon`,"data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:z(`data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70`,i.day,e),...r})}var Qe=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));Qe.displayName=`Card`;var $e=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`flex flex-col space-y-1.5 p-6`,e),...t}));$e.displayName=`CardHeader`;var et=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));et.displayName=`CardTitle`;var tt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));tt.displayName=`CardDescription`;var nt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`p-6 pt-0`,e),...t}));nt.displayName=`CardContent`;var rt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`flex items-center p-6 pt-0`,e),...t}));rt.displayName=`CardFooter`;var it=a.createContext(null);function at(){let e=a.useContext(it);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}var ot=a.forwardRef(({orientation:e=`horizontal`,opts:t,setApi:n,plugins:r,className:i,children:s,...c},l)=>{let[u,d]=(0,h.default)({...t,axis:e===`horizontal`?`x`:`y`},r),[f,p]=a.useState(!1),[m,g]=a.useState(!1),_=a.useCallback(e=>{e&&(p(e.canScrollPrev()),g(e.canScrollNext()))},[]),v=a.useCallback(()=>{d?.scrollPrev()},[d]),y=a.useCallback(()=>{d?.scrollNext()},[d]),b=a.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),v()):e.key===`ArrowRight`&&(e.preventDefault(),y())},[v,y]);return a.useEffect(()=>{!d||!n||n(d)},[d,n]),a.useEffect(()=>{if(d)return _(d),d.on(`reInit`,_),d.on(`select`,_),()=>{d?.off(`select`,_)}},[d,_]),(0,o.jsx)(it.Provider,{value:{carouselRef:u,api:d,opts:t,orientation:e||(t?.axis===`y`?`vertical`:`horizontal`),scrollPrev:v,scrollNext:y,canScrollPrev:f,canScrollNext:m},children:(0,o.jsx)(`div`,{ref:l,onKeyDownCapture:b,className:z(`relative`,i),role:`region`,"aria-roledescription":`carousel`,...c,children:s})})});ot.displayName=`Carousel`;var st=a.forwardRef(({className:e,...t},n)=>{let{carouselRef:r,orientation:i}=at();return(0,o.jsx)(`div`,{ref:r,className:`overflow-hidden`,children:(0,o.jsx)(`div`,{ref:n,className:z(`flex`,i===`horizontal`?`-ml-4`:`-mt-4 flex-col`,e),...t})})});st.displayName=`CarouselContent`;var ct=a.forwardRef(({className:e,...t},n)=>{let{orientation:r}=at();return(0,o.jsx)(`div`,{ref:n,role:`group`,"aria-roledescription":`slide`,className:z(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`pl-4`:`pt-4`,e),...t})});ct.displayName=`CarouselItem`;var lt=a.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollPrev:s,canScrollPrev:l}=at();return(0,o.jsxs)(V,{ref:i,variant:t,size:n,className:z(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-left-12 top-1/2 -translate-y-1/2`:`-top-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!l,onClick:s,...r,children:[(0,o.jsx)(c.ArrowLeft,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})});lt.displayName=`CarouselPrevious`;var ut=a.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollNext:s,canScrollNext:l}=at();return(0,o.jsxs)(V,{ref:i,variant:t,size:n,className:z(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-right-12 top-1/2 -translate-y-1/2`:`-bottom-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!l,onClick:s,...r,children:[(0,o.jsx)(c.ArrowRight,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})});ut.displayName=`CarouselNext`;var dt={light:``,dark:`.dark`},ft=a.createContext(null);function pt(){let e=a.useContext(ft);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}var mt=a.forwardRef(({id:e,className:t,children:n,config:r,...i},s)=>{let c=a.useId(),l=`chart-${e||c.replace(/:/g,``)}`;return(0,o.jsx)(ft.Provider,{value:{config:r},children:(0,o.jsxs)(`div`,{"data-chart":l,ref:s,className:z(`block aspect-video w-full text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none`,t),...i,children:[(0,o.jsx)(ht,{id:l,config:r}),(0,o.jsx)(g.ResponsiveContainer,{children:n})]})})});mt.displayName=`Chart`;var ht=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme||e.color);return n.length?(0,o.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(dt).map(([t,r])=>`
|
|
8
8
|
${r} [data-chart=${e}] {
|
|
9
9
|
${n.map(([e,n])=>{let r=n.theme?.[t]||n.color;return r?` --color-${e}: ${r};`:null}).join(`
|
|
10
10
|
`)}
|
|
11
11
|
}
|
|
12
12
|
`).join(`
|
|
13
|
-
`)}}):null},ht=g.Tooltip,gt=a.forwardRef(({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:s=!1,label:c,labelFormatter:l,labelClassName:u,formatter:d,color:f,nameKey:p,labelKey:m},h)=>{let{config:g}=ft(),_=a.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=yt(g,e,`${m||e?.dataKey||e?.name||`value`}`),r=!m&&typeof c==`string`?g[c]?.label||c:n?.label;return l?(0,o.jsx)(`div`,{className:z(`font-medium`,u),children:l(r,t)}):r?(0,o.jsx)(`div`,{className:z(`font-medium`,u),children:r}):null},[c,l,t,i,u,g,m]);if(!e||!t?.length)return null;let v=t.length===1&&r!==`dot`;return(0,o.jsxs)(`div`,{ref:h,className:z(`grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl`,n),children:[v?null:_,(0,o.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=yt(g,e,`${p||e.name||e.dataKey||`value`}`),i=f||e.payload.fill||e.color;return(0,o.jsx)(`div`,{className:z(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,r===`dot`&&`items-center`),children:d&&e?.value!==void 0&&e.name?d(e.value,e.name,e,t,e.payload):(0,o.jsxs)(o.Fragment,{children:[n?.icon?(0,o.jsx)(n.icon,{}):!s&&(0,o.jsx)(`div`,{className:z(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":r===`dot`,"w-1":r===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":r===`dashed`,"my-0.5":v&&r===`dashed`}),style:{"--color-bg":i,"--color-border":i}}),(0,o.jsxs)(`div`,{className:z(`flex flex-1 justify-between leading-none`,v?`items-end`:`items-center`),children:[(0,o.jsxs)(`div`,{className:`grid gap-1.5`,children:[v?_:null,(0,o.jsx)(`span`,{className:`text-muted-foreground`,children:n?.label||e.name})]}),e.value&&(0,o.jsx)(`span`,{className:`font-mono font-medium tabular-nums text-foreground`,children:e.value.toLocaleString()})]})]})},e.dataKey)})})]})});gt.displayName=`ChartTooltip`;var _t=g.Legend,vt=a.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r=`bottom`,nameKey:i},a)=>{let{config:s}=ft();return n?.length?(0,o.jsx)(`div`,{ref:a,className:z(`flex items-center justify-center gap-4`,r===`top`?`pb-3`:`pt-3`,e),children:n.filter(e=>e.type!==`none`).map(e=>{let n=yt(s,e,`${i||e.dataKey||`value`}`);return(0,o.jsxs)(`div`,{className:z(`flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground`),children:[n?.icon&&!t?(0,o.jsx)(n.icon,{}):(0,o.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),n?.label]},e.value)})}):null});vt.displayName=`ChartLegend`;function yt(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}var bt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(_.Root,{ref:n,className:z(`grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,e),...t,children:(0,o.jsx)(_.Indicator,{className:z(`grid place-content-center text-current`),children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}));bt.displayName=_.Root.displayName;var xt=v.Root,St=v.CollapsibleTrigger,Ct=v.CollapsibleContent,wt=b.Root,Tt=b.Trigger,Et=b.Portal,Dt=b.Close,Ot=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Overlay,{ref:n,className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Ot.displayName=b.Overlay.displayName;var kt=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(Et,{children:[(0,o.jsx)(Ot,{}),(0,o.jsxs)(b.Content,{ref:r,className:z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,o.jsxs)(b.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,o.jsx)(c.X,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));kt.displayName=b.Content.displayName;var At=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});At.displayName=`DialogHeader`;var jt=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});jt.displayName=`DialogFooter`;var Mt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Title,{ref:n,className:z(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Mt.displayName=b.Title.displayName;var Nt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Description,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));Nt.displayName=b.Description.displayName;var Pt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command,{ref:n,className:z(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));Pt.displayName=y.Command.displayName;var Ft=({children:e,...t})=>(0,o.jsx)(wt,{...t,children:(0,o.jsx)(kt,{className:`overflow-hidden p-0 shadow-lg`,children:(0,o.jsx)(Pt,{className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:e})})}),It=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,o.jsx)(c.Search,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,o.jsx)(y.Command.Input,{ref:n,className:z(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));It.displayName=y.Command.Input.displayName;var Lt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command.List,{ref:n,className:z(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));Lt.displayName=y.Command.List.displayName;var Rt=a.forwardRef((e,t)=>(0,o.jsx)(y.Command.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));Rt.displayName=y.Command.Empty.displayName;var zt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command.Group,{ref:n,className:z(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));zt.displayName=y.Command.Group.displayName;var Bt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command.Separator,{ref:n,className:z(`-mx-1 h-px bg-border`,e),...t}));Bt.displayName=y.Command.Separator.displayName;var Vt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command.Item,{ref:n,className:z(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...t}));Vt.displayName=y.Command.Item.displayName;var Ht=({className:e,...t})=>(0,o.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});Ht.displayName=`CommandShortcut`;var Ut=x.Root,Wt=x.Trigger,Gt=x.Group,Kt=x.Portal,qt=x.Sub,Jt=x.RadioGroup,Yt=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(x.SubTrigger,{ref:i,className:z(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(c.ChevronRight,{className:`ml-auto h-4 w-4`})]}));Yt.displayName=x.SubTrigger.displayName;var Xt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.SubContent,{ref:n,className:z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin)`,e),...t}));Xt.displayName=x.SubContent.displayName;var Zt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Portal,{children:(0,o.jsx)(x.Content,{ref:n,className:z(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin)`,e),...t})}));Zt.displayName=x.Content.displayName;var Qt=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(x.Item,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));Qt.displayName=x.Item.displayName;var $t=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(x.CheckboxItem,{ref:i,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(x.ItemIndicator,{children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}),t]}));$t.displayName=x.CheckboxItem.displayName;var en=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(x.RadioItem,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(x.ItemIndicator,{children:(0,o.jsx)(c.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));en.displayName=x.RadioItem.displayName;var tn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(x.Label,{ref:r,className:z(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));tn.displayName=x.Label.displayName;var nn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Separator,{ref:n,className:z(`-mx-1 my-1 h-px bg-border`,e),...t}));nn.displayName=x.Separator.displayName;var rn=({className:e,...t})=>(0,o.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});rn.displayName=`ContextMenuShortcut`;var an=({shouldScaleBackground:e=!0,...t})=>(0,o.jsx)(S.Drawer.Root,{shouldScaleBackground:e,...t});an.displayName=`Drawer`;var on=S.Drawer.Trigger,sn=S.Drawer.Portal,cn=S.Drawer.Close,ln=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Drawer.Overlay,{ref:n,className:z(`fixed inset-0 z-50 bg-black/80`,e),...t}));ln.displayName=S.Drawer.Overlay.displayName;var un=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(sn,{children:[(0,o.jsx)(ln,{}),(0,o.jsxs)(S.Drawer.Content,{ref:r,className:z(`fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background`,e),...n,children:[(0,o.jsx)(`div`,{className:`mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted`}),t]})]}));un.displayName=`DrawerContent`;var dn=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`grid gap-1.5 p-4 text-center sm:text-left`,e),...t});dn.displayName=`DrawerHeader`;var fn=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`mt-auto flex flex-col gap-2 p-4`,e),...t});fn.displayName=`DrawerFooter`;var pn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Drawer.Title,{ref:n,className:z(`text-lg font-semibold leading-none tracking-tight`,e),...t}));pn.displayName=S.Drawer.Title.displayName;var mn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Drawer.Description,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));mn.displayName=S.Drawer.Description.displayName;var hn=C.Root,gn=C.Trigger,_n=C.Group,vn=C.Portal,yn=C.Sub,bn=C.RadioGroup,xn=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(C.SubTrigger,{ref:i,className:z(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(c.ChevronRight,{className:`ml-auto`})]}));xn.displayName=C.SubTrigger.displayName;var Sn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.SubContent,{ref:n,className:z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...t}));Sn.displayName=C.SubContent.displayName;var Cn=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,o.jsx)(C.Portal,{children:(0,o.jsx)(C.Content,{ref:r,sideOffset:t,className:z(`z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...n})}));Cn.displayName=C.Content.displayName;var wn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(C.Item,{ref:r,className:z(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));wn.displayName=C.Item.displayName;var Tn=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(C.CheckboxItem,{ref:i,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(C.ItemIndicator,{children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}),t]}));Tn.displayName=C.CheckboxItem.displayName;var En=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(C.RadioItem,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(C.ItemIndicator,{children:(0,o.jsx)(c.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));En.displayName=C.RadioItem.displayName;var Dn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(C.Label,{ref:r,className:z(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));Dn.displayName=C.Label.displayName;var On=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.Separator,{ref:n,className:z(`-mx-1 my-1 h-px bg-muted`,e),...t}));On.displayName=C.Separator.displayName;var kn=({className:e,...t})=>(0,o.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest opacity-60`,e),...t});kn.displayName=`DropdownMenuShortcut`;var An=(0,d.cva)(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),G=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(T.Root,{ref:n,className:z(An(),e),...t}));G.displayName=T.Root.displayName;var jn=w.FormProvider,Mn=a.createContext(null),Nn=({...e})=>(0,o.jsx)(Mn.Provider,{value:{name:e.name},children:(0,o.jsx)(w.Controller,{...e})}),Pn=()=>{let e=a.useContext(Mn),t=a.useContext(Fn),{getFieldState:n,formState:r}=(0,w.useFormContext)();if(!e)throw Error(`useFormField should be used within <FormField>`);if(!t)throw Error(`useFormField should be used within <FormItem>`);let i=n(e.name,r),{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},Fn=a.createContext(null),In=a.forwardRef(({className:e,...t},n)=>{let r=a.useId();return(0,o.jsx)(Fn.Provider,{value:{id:r},children:(0,o.jsx)(`div`,{ref:n,className:z(`space-y-2`,e),...t})})});In.displayName=`FormItem`;var Ln=a.forwardRef(({className:e,...t},n)=>{let{error:r,formItemId:i}=Pn();return(0,o.jsx)(G,{ref:n,className:z(r&&`text-destructive`,e),htmlFor:i,...t})});Ln.displayName=`FormLabel`;var Rn=a.forwardRef(({...e},t)=>{let{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=Pn();return(0,o.jsx)(u.Slot,{ref:t,id:r,"aria-describedby":n?`${i} ${a}`:`${i}`,"aria-invalid":!!n,...e})});Rn.displayName=`FormControl`;var zn=a.forwardRef(({className:e,...t},n)=>{let{formDescriptionId:r}=Pn();return(0,o.jsx)(`p`,{ref:n,id:r,className:z(`text-sm text-muted-foreground`,e),...t})});zn.displayName=`FormDescription`;var Bn=a.forwardRef(({className:e,children:t,...n},r)=>{let{error:i,formMessageId:a}=Pn(),s=i?String(i?.message??``):t;return s?(0,o.jsx)(`p`,{ref:r,id:a,className:z(`text-sm font-medium text-destructive`,e),...n,children:s}):null});Bn.displayName=`FormMessage`;var Vn=E.Root,Hn=E.Trigger,Un=a.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,o.jsx)(E.Content,{ref:i,align:t,sideOffset:n,className:z(`z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-hover-card-content-transform-origin)`,e),...r}));Un.displayName=E.Content.displayName;var Wn=a.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,o.jsx)(D.OTPInput,{ref:r,containerClassName:z(`flex items-center gap-2 has-[:disabled]:opacity-50`,t),className:z(`disabled:cursor-not-allowed`,e),...n}));Wn.displayName=`InputOTP`;var Gn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`flex items-center`,e),...t}));Gn.displayName=`InputOTPGroup`;var Kn=a.forwardRef(({index:e,className:t,...n},r)=>{let{char:i,hasFakeCaret:s,isActive:c}=a.useContext(D.OTPInputContext).slots[e];return(0,o.jsxs)(`div`,{ref:r,className:z(`relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md`,c&&`z-10 ring-2 ring-ring ring-offset-background`,t),...n,children:[i,s&&(0,o.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,o.jsx)(`div`,{className:`h-4 w-px animate-caret-blink bg-foreground duration-1000`})})]})});Kn.displayName=`InputOTPSlot`;var qn=a.forwardRef(({...e},t)=>(0,o.jsx)(`div`,{ref:t,role:`separator`,...e,children:(0,o.jsx)(c.Dot,{})}));qn.displayName=`InputOTPSeparator`;var K=a.forwardRef(({className:e,type:t,...n},r)=>(0,o.jsx)(`input`,{type:t,className:z(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));K.displayName=`Input`;function Jn({...e}){return(0,o.jsx)(O.Menu,{...e})}function Yn({...e}){return(0,o.jsx)(O.Group,{...e})}function Xn({...e}){return(0,o.jsx)(O.Portal,{...e})}function Zn({...e}){return(0,o.jsx)(O.RadioGroup,{...e})}function Qn({...e}){return(0,o.jsx)(O.Sub,{"data-slot":`menubar-sub`,...e})}var $n=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(O.Root,{ref:n,className:z(`flex h-10 items-center space-x-1 rounded-md border bg-background p-1`,e),...t}));$n.displayName=O.Root.displayName;var er=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(O.Trigger,{ref:n,className:z(`flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,e),...t}));er.displayName=O.Trigger.displayName;var tr=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(O.SubTrigger,{ref:i,className:z(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(c.ChevronRight,{className:`ml-auto h-4 w-4`})]}));tr.displayName=O.SubTrigger.displayName;var nr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(O.SubContent,{ref:n,className:z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-menubar-content-transform-origin)`,e),...t}));nr.displayName=O.SubContent.displayName;var rr=a.forwardRef(({className:e,align:t=`start`,alignOffset:n=-4,sideOffset:r=8,...i},a)=>(0,o.jsx)(O.Portal,{children:(0,o.jsx)(O.Content,{ref:a,align:t,alignOffset:n,sideOffset:r,className:z(`z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-menubar-content-transform-origin)`,e),...i})}));rr.displayName=O.Content.displayName;var ir=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(O.Item,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));ir.displayName=O.Item.displayName;var ar=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(O.CheckboxItem,{ref:i,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(O.ItemIndicator,{children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}),t]}));ar.displayName=O.CheckboxItem.displayName;var or=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(O.RadioItem,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(O.ItemIndicator,{children:(0,o.jsx)(c.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));or.displayName=O.RadioItem.displayName;var sr=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(O.Label,{ref:r,className:z(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));sr.displayName=O.Label.displayName;var cr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(O.Separator,{ref:n,className:z(`-mx-1 my-1 h-px bg-muted`,e),...t}));cr.displayName=O.Separator.displayName;var lr=({className:e,...t})=>(0,o.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});lr.displayname=`MenubarShortcut`;var ur=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(k.Root,{ref:r,className:z(`relative z-10 flex max-w-max flex-1 items-center justify-center`,e),...n,children:[t,(0,o.jsx)(_r,{})]}));ur.displayName=k.Root.displayName;var dr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(k.List,{ref:n,className:z(`group flex flex-1 list-none items-center justify-center space-x-1`,e),...t}));dr.displayName=k.List.displayName;var fr=k.Item,pr=(0,d.cva)(`group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent`),mr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(k.Trigger,{ref:r,className:z(pr(),`group`,e),...n,children:[t,` `,(0,o.jsx)(c.ChevronDown,{className:`relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180`,"aria-hidden":`true`})]}));mr.displayName=k.Trigger.displayName;var hr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(k.Content,{ref:n,className:z(`left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto `,e),...t}));hr.displayName=k.Content.displayName;var gr=k.Link,_r=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{className:z(`absolute left-0 top-full flex justify-center`),children:(0,o.jsx)(k.Viewport,{className:z(`origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]`,e),ref:n,...t})}));_r.displayName=k.Viewport.displayName;var vr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(k.Indicator,{ref:n,className:z(`top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in`,e),...t,children:(0,o.jsx)(`div`,{className:`relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md`})}));vr.displayName=k.Indicator.displayName;var yr=({className:e,...t})=>(0,o.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,className:z(`mx-auto flex w-full justify-center`,e),...t});yr.displayName=`Pagination`;var br=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,className:z(`flex flex-row items-center gap-1`,e),...t}));br.displayName=`PaginationContent`;var xr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,className:z(``,e),...t}));xr.displayName=`PaginationItem`;var Sr=({className:e,isActive:t,size:n=`icon`,...r})=>(0,o.jsx)(`a`,{"aria-current":t?`page`:void 0,className:z(H({variant:t?`outline`:`ghost`,size:n}),e),...r});Sr.displayName=`PaginationLink`;var Cr=({className:e,...t})=>(0,o.jsxs)(Sr,{"aria-label":`Go to previous page`,size:`default`,className:z(`gap-1 pl-2.5`,e),...t,children:[(0,o.jsx)(c.ChevronLeft,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:`Previous`})]});Cr.displayName=`PaginationPrevious`;var wr=({className:e,...t})=>(0,o.jsxs)(Sr,{"aria-label":`Go to next page`,size:`default`,className:z(`gap-1 pr-2.5`,e),...t,children:[(0,o.jsx)(`span`,{children:`Next`}),(0,o.jsx)(c.ChevronRight,{className:`h-4 w-4`})]});wr.displayName=`PaginationNext`;var Tr=({className:e,...t})=>(0,o.jsxs)(`span`,{"aria-hidden":!0,className:z(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,o.jsx)(c.MoreHorizontal,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`More pages`})]});Tr.displayName=`PaginationEllipsis`;var Er=A.Root,Dr=A.Trigger,Or=a.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,o.jsx)(A.Portal,{children:(0,o.jsx)(A.Content,{ref:i,align:t,sideOffset:n,className:z(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)`,e),...r})}));Or.displayName=A.Content.displayName;var kr=a.forwardRef(({className:e,value:t,...n},r)=>(0,o.jsx)(ee.Root,{ref:r,className:z(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,o.jsx)(ee.Indicator,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));kr.displayName=ee.Root.displayName;var Ar=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(j.Root,{className:z(`grid gap-2`,e),...t,ref:n}));Ar.displayName=j.Root.displayName;var jr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(j.Item,{ref:n,className:z(`aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,o.jsx)(j.Indicator,{className:`flex items-center justify-center`,children:(0,o.jsx)(c.Circle,{className:`h-2.5 w-2.5 fill-current text-current`})})}));jr.displayName=j.Item.displayName;var Mr=({className:e,...t})=>(0,o.jsx)(te.Group,{className:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...t}),Nr=te.Panel,Pr=({withHandle:e,className:t,...n})=>(0,o.jsx)(te.Separator,{className:z(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90`,t),...n,children:e&&(0,o.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border`,children:(0,o.jsx)(c.GripVertical,{className:`h-2.5 w-2.5`})})}),Fr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(M.Root,{ref:r,className:z(`relative overflow-hidden`,e),...n,children:[(0,o.jsx)(M.Viewport,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,o.jsx)(Ir,{}),(0,o.jsx)(M.Corner,{})]}));Fr.displayName=M.Root.displayName;var Ir=a.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,o.jsx)(M.ScrollAreaScrollbar,{ref:r,orientation:t,className:z(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,o.jsx)(M.ScrollAreaThumb,{className:`relative flex-1 rounded-full bg-border`})}));Ir.displayName=M.ScrollAreaScrollbar.displayName;var Lr=N.Root,Rr=N.Group,q=N.Value,J=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(N.Trigger,{ref:r,className:z(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,o.jsx)(N.Icon,{asChild:!0,children:(0,o.jsx)(c.ChevronDown,{className:`h-4 w-4 opacity-50`})})]}));J.displayName=N.Trigger.displayName;var zr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(N.ScrollUpButton,{ref:n,className:z(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,o.jsx)(c.ChevronUp,{className:`h-4 w-4`})}));zr.displayName=N.ScrollUpButton.displayName;var Br=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(N.ScrollDownButton,{ref:n,className:z(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,o.jsx)(c.ChevronDown,{className:`h-4 w-4`})}));Br.displayName=N.ScrollDownButton.displayName;var Y=a.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,o.jsx)(N.Portal,{children:(0,o.jsxs)(N.Content,{ref:i,className:z(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,o.jsx)(zr,{}),(0,o.jsx)(N.Viewport,{className:z(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,o.jsx)(Br,{})]})}));Y.displayName=N.Content.displayName;var Vr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(N.Label,{ref:n,className:z(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));Vr.displayName=N.Label.displayName;var X=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(N.Item,{ref:r,className:z(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(N.ItemIndicator,{children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}),(0,o.jsx)(N.ItemText,{children:t})]}));X.displayName=N.Item.displayName;var Hr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(N.Separator,{ref:n,className:z(`-mx-1 my-1 h-px bg-muted`,e),...t}));Hr.displayName=N.Separator.displayName;var Ur=a.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,o.jsx)(ne.Root,{ref:i,decorative:n,orientation:t,className:z(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));Ur.displayName=ne.Root.displayName;var Wr=b.Root,Gr=b.Trigger,Kr=b.Close,qr=b.Portal,Jr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Overlay,{className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Jr.displayName=b.Overlay.displayName;var Yr=(0,d.cva)(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),Xr=a.forwardRef(({side:e=`right`,className:t,children:n,hideOverlay:r,...i},a)=>(0,o.jsxs)(qr,{children:[!r&&(0,o.jsx)(Jr,{}),(0,o.jsxs)(b.Content,{ref:a,className:z(Yr({side:e}),t),...i,children:[n,(0,o.jsxs)(b.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,o.jsx)(c.X,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Xr.displayName=b.Content.displayName;var Zr=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Zr.displayName=`SheetHeader`;var Qr=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Qr.displayName=`SheetFooter`;var $r=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Title,{ref:n,className:z(`text-lg font-semibold text-foreground`,e),...t}));$r.displayName=b.Title.displayName;var ei=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Description,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));ei.displayName=b.Description.displayName;var ti=768;function ni(){let[e,t]=a.useState(void 0);return a.useEffect(()=>{let e=window.matchMedia(`(max-width: ${ti-1}px)`),n=()=>{t(window.innerWidth<ti)};return e.addEventListener(`change`,n),t(window.innerWidth<ti),()=>e.removeEventListener(`change`,n)},[]),!!e}function Z({className:e,...t}){return(0,o.jsx)(`div`,{className:z(`animate-pulse rounded-md bg-muted`,e),...t})}var ri=re.Provider,ii=re.Root,ai=re.Trigger,oi=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,o.jsx)(re.Content,{ref:r,sideOffset:t,className:z(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-tooltip-content-transform-origin)`,e),...n}));oi.displayName=re.Content.displayName;var si=`sidebar_state`,ci=3600*24*7,li=`16rem`,ui=`18rem`,di=`3rem`,fi=`b`,pi=a.createContext(null);function mi(){let e=a.useContext(pi);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var hi=a.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:s,...c},l)=>{let u=ni(),[d,f]=a.useState(!1),[p,m]=a.useState(e),h=t??p,g=a.useCallback(e=>{let t=typeof e==`function`?e(h):e;n?n(t):m(t),document.cookie=`${si}=${t}; path=/; max-age=${ci}`},[n,h]),_=a.useCallback(()=>u?f(e=>!e):g(e=>!e),[u,g,f]);a.useEffect(()=>{let e=e=>{e.key===fi&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=h?`expanded`:`collapsed`,y=a.useMemo(()=>({state:v,open:h,setOpen:g,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:_}),[v,h,g,u,d,f,_]);return(0,o.jsx)(pi.Provider,{value:y,children:(0,o.jsx)(ri,{delayDuration:0,children:(0,o.jsx)(`div`,{style:{"--sidebar-width":li,"--sidebar-width-icon":di,...i},className:z(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,r),ref:l,...c,children:s})})})});hi.displayName=`SidebarProvider`;var gi=a.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},s)=>{let{isMobile:c,state:l,openMobile:u,setOpenMobile:d}=mi();return n===`none`?(0,o.jsx)(`div`,{className:z(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),ref:s,...a,children:i}):c?(0,o.jsx)(Wr,{open:u,onOpenChange:d,...a,children:(0,o.jsxs)(Xr,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":ui},side:e,children:[(0,o.jsxs)(Zr,{className:`sr-only`,children:[(0,o.jsx)($r,{children:`Sidebar`}),(0,o.jsx)(ei,{children:`Displays the mobile sidebar.`})]}),(0,o.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,o.jsxs)(`div`,{ref:s,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":l,"data-collapsible":n,"data-variant":t,"data-side":e,children:[(0,o.jsx)(`div`,{className:z(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem)]`:`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,o.jsx)(`div`,{className:z(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[state=collapsed]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem_+_2px)]`:`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,o.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:i})})]})});gi.displayName=`Sidebar`;var _i=a.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=mi();return(0,o.jsxs)(U,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:z(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,o.jsx)(c.PanelLeft,{}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});_i.displayName=`SidebarTrigger`;var vi=a.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=mi();return(0,o.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:z(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});vi.displayName=`SidebarRail`;var yi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`main`,{ref:n,className:z(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,e),...t}));yi.displayName=`SidebarInset`;var bi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(K,{ref:n,"data-sidebar":`input`,className:z(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));bi.displayName=`SidebarInput`;var xi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:z(`flex flex-col gap-2 p-2`,e),...t}));xi.displayName=`SidebarHeader`;var Si=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:z(`flex flex-col gap-2 p-2`,e),...t}));Si.displayName=`SidebarFooter`;var Ci=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(Ur,{ref:n,"data-sidebar":`separator`,className:z(`mx-2 w-auto bg-sidebar-border`,e),...t}));Ci.displayName=`SidebarSeparator`;var wi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:z(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[state=collapsed]:group-data-[collapsible=icon]:overflow-hidden`,e),...t}));wi.displayName=`SidebarContent`;var Ti=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:z(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));Ti.displayName=`SidebarGroup`;var Ei=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,o.jsx)(t?u.Slot:`div`,{ref:r,"data-sidebar":`group-label`,className:z(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:-mt-8 group-data-[state=collapsed]:group-data-[collapsible=icon]:opacity-0`,e),...n}));Ei.displayName=`SidebarGroupLabel`;var Di=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,o.jsx)(t?u.Slot:`button`,{ref:r,"data-sidebar":`group-action`,className:z(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...n}));Di.displayName=`SidebarGroupAction`;var Oi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:z(`w-full text-sm`,e),...t}));Oi.displayName=`SidebarGroupContent`;var ki=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:z(`flex w-full min-w-0 flex-col gap-1`,e),...t}));ki.displayName=`SidebarMenu`;var Ai=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:z(`group/menu-item relative`,e),...t}));Ai.displayName=`SidebarMenuItem`;var ji=(0,d.cva)(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground sidebar-menu-button-icon-mode [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm sidebar-menu-button-icon-mode-lg`}},defaultVariants:{variant:`default`,size:`default`}}),Mi=a.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...s},c)=>{let l=e?u.Slot:`button`,{isMobile:d,state:f}=mi(),p=(0,o.jsx)(l,{ref:c,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:z(ji({variant:n,size:r}),a),...s});return i?(typeof i==`string`&&(i={children:i}),(0,o.jsxs)(ii,{children:[(0,o.jsx)(ai,{asChild:!0,children:p}),(0,o.jsx)(oi,{side:`right`,align:`center`,hidden:f!==`collapsed`||d,...i})]})):p});Mi.displayName=`SidebarMenuButton`;var Ni=a.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,o.jsx)(t?u.Slot:`button`,{ref:i,"data-sidebar":`menu-action`,className:z(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));Ni.displayName=`SidebarMenuAction`;var Pi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:z(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...t}));Pi.displayName=`SidebarMenuBadge`;var Fi=a.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=a.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,o.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:z(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,o.jsx)(Z,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,o.jsx)(Z,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});Fi.displayName=`SidebarMenuSkeleton`;var Ii=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:z(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...t}));Ii.displayName=`SidebarMenuSub`;var Li=a.forwardRef(({...e},t)=>(0,o.jsx)(`li`,{ref:t,...e}));Li.displayName=`SidebarMenuSubItem`;var Ri=a.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,o.jsx)(e?u.Slot:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:z(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,r),...i}));Ri.displayName=`SidebarMenuSubButton`;var zi=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(ie.Root,{ref:n,className:z(`relative flex w-full touch-none select-none items-center`,e),...t,children:[(0,o.jsx)(ie.Track,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,o.jsx)(ie.Range,{className:`absolute h-full bg-primary`})}),(0,o.jsx)(ie.Thumb,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,"aria-label":t[`aria-label`]})]}));zi.displayName=ie.Root.displayName;var Bi=({...e})=>{let{theme:t=`system`}=(0,ae.useTheme)();return(0,o.jsx)(P.Toaster,{theme:t,className:`toaster group`,icons:{success:(0,o.jsx)(c.CircleCheck,{className:`h-4 w-4`}),info:(0,o.jsx)(c.Info,{className:`h-4 w-4`}),warning:(0,o.jsx)(c.TriangleAlert,{className:`h-4 w-4`}),error:(0,o.jsx)(c.OctagonX,{className:`h-4 w-4`}),loading:(0,o.jsx)(c.LoaderCircle,{className:`h-4 w-4 animate-spin`})},toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`}},...e})},Vi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(oe.Root,{className:z(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...t,ref:n,children:(0,o.jsx)(oe.Thumb,{className:z(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));Vi.displayName=oe.Root.displayName;var Hi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,o.jsx)(`table`,{ref:n,className:z(`w-full caption-bottom text-sm`,e),...t})}));Hi.displayName=`Table`;var Ui=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`thead`,{ref:n,className:z(`[&_tr]:border-b`,e),...t}));Ui.displayName=`TableHeader`;var Wi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tbody`,{ref:n,className:z(`[&_tr:last-child]:border-0`,e),...t}));Wi.displayName=`TableBody`;var Gi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tfoot`,{ref:n,className:z(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));Gi.displayName=`TableFooter`;var Ki=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tr`,{ref:n,className:z(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...t}));Ki.displayName=`TableRow`;var qi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`th`,{ref:n,className:z(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t}));qi.displayName=`TableHead`;var Ji=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`td`,{ref:n,className:z(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t}));Ji.displayName=`TableCell`;var Yi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`caption`,{ref:n,className:z(`mt-4 text-sm text-muted-foreground`,e),...t}));Yi.displayName=`TableCaption`;var Xi=se.Root,Zi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(se.List,{ref:n,className:z(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));Zi.displayName=se.List.displayName;var Qi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(se.Trigger,{ref:n,className:z(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,e),...t}));Qi.displayName=se.Trigger.displayName;var $i=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(se.Content,{ref:n,className:z(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));$i.displayName=se.Content.displayName;var ea=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`textarea`,{className:z(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));ea.displayName=`Textarea`;var ta=(0,d.cva)(`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-accent hover:text-accent-foreground`},size:{default:`h-10 px-3 min-w-10`,sm:`h-9 px-2.5 min-w-9`,lg:`h-11 px-5 min-w-11`}},defaultVariants:{variant:`default`,size:`default`}}),na=a.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,o.jsx)(ce.Root,{ref:i,className:z(ta({variant:t,size:n,className:e})),...r}));na.displayName=ce.Root.displayName;var ra=a.createContext({size:`default`,variant:`default`}),ia=a.forwardRef(({className:e,variant:t,size:n,children:r,...i},a)=>(0,o.jsx)(F.Root,{ref:a,className:z(`flex items-center justify-center gap-1`,e),...i,children:(0,o.jsx)(ra.Provider,{value:{variant:t,size:n},children:r})}));ia.displayName=F.Root.displayName;var aa=a.forwardRef(({className:e,children:t,variant:n,size:r,...i},s)=>{let c=a.useContext(ra);return(0,o.jsx)(F.Item,{ref:s,className:z(ta({variant:c.variant||n,size:c.size||r}),e),...i,children:t})});aa.displayName=F.Item.displayName;var oa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h1`,{ref:n,className:z(`scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl`,e),...t}));oa.displayName=`TypographyH1`;var sa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h2`,{ref:n,className:z(`scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0`,e),...t}));sa.displayName=`TypographyH2`;var ca=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h3`,{ref:n,className:z(`scroll-m-20 text-2xl font-semibold tracking-tight`,e),...t}));ca.displayName=`TypographyH3`;var la=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h4`,{ref:n,className:z(`scroll-m-20 text-xl font-semibold tracking-tight`,e),...t}));la.displayName=`TypographyH4`;var ua=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:z(`leading-7 [&:not(:first-child)]:mt-6`,e),...t}));ua.displayName=`TypographyP`;var da=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`blockquote`,{ref:n,className:z(`mt-6 border-l-2 pl-6 italic`,e),...t}));da.displayName=`TypographyBlockquote`;var fa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,className:z(`my-6 ml-6 list-disc [&>li]:mt-2`,e),...t}));fa.displayName=`TypographyList`;var pa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`code`,{ref:n,className:z(`relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold`,e),...t}));pa.displayName=`TypographyInlineCode`;var ma=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:z(`text-xl text-muted-foreground`,e),...t}));ma.displayName=`TypographyLead`;var ha=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`text-lg font-semibold`,e),...t}));ha.displayName=`TypographyLarge`;var ga=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`small`,{ref:n,className:z(`text-sm font-medium leading-none`,e),...t}));ga.displayName=`TypographySmall`;var _a=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));_a.displayName=`TypographyMuted`;var va=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(Ur,{ref:r,orientation:e.orientation,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s})});t.ComponentRegistry.register(`separator`,va,{namespace:`ui`,label:`Separator`,inputs:[{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`],defaultValue:`horizontal`,label:`Orientation`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{orientation:`horizontal`,className:`my-2 sm:my-4`}}),t.ComponentRegistry.register(`image`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(`img`,{src:e.src,alt:e.alt||``,className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`Image`,icon:`image`,category:`basic`,inputs:[{name:`src`,type:`string`,label:`Source URL`},{name:`alt`,type:`string`,label:`Alt Text`},{name:`className`,type:`string`,label:`Classes`}],defaultProps:{className:`max-w-full h-auto`}});function ya(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}var ba={Home:`House`},xa=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...l}=n,u=ya(e.name),d=ba[u]||u,f=c.icons[d];if(!f)return console.warn(`Icon "${e.name}" (lookup: "${u}"${d===u?``:` -> "${d}"`}) not found in lucide-react`),null;let p=e.size?{width:e.size,height:e.size}:void 0;return(0,o.jsx)(f,{ref:r,className:z(e.color,e.className,t),style:{...p,...s},...l,"data-obj-id":i,"data-obj-type":a})});xa.displayName=`IconRenderer`,t.ComponentRegistry.register(`icon`,xa,{namespace:`ui`,label:`Icon`,icon:`smile`,category:`basic`,inputs:[{name:`name`,type:`string`,label:`Icon Name`,defaultValue:`smile`},{name:`size`,type:`number`,label:`Size (px)`},{name:`color`,type:`string`,label:`Color Class`},{name:`className`,type:`string`,label:`CSS Class`}]}),t.ComponentRegistry.register(`html`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(`div`,{className:z(`prose prose-sm max-w-none dark:prose-invert`,t),dangerouslySetInnerHTML:{__html:e.html},...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`HTML Content`,inputs:[{name:`html`,type:`string`,label:`HTML`,description:`Raw HTML content`}]}),t.ComponentRegistry.register(`button-group`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(`div`,{className:z(`flex flex-wrap sm:inline-flex rounded-md shadow-sm`,e.className),role:`group`,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.buttons?.map((t,n)=>(0,o.jsx)(U,{variant:t.variant||e.variant,size:t.size||e.size,className:z(`rounded-none`,n===0&&`rounded-l-md`,n===(e.buttons?.length||0)-1&&`rounded-r-md`,n>0&&`-ml-px`,t.className),children:t.label},n))})},{namespace:`ui`,label:`Button Group`,inputs:[{name:`variant`,type:`enum`,enum:[`default`,`destructive`,`outline`,`secondary`,`ghost`,`link`],defaultValue:`default`,label:`Variant`},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`],defaultValue:`default`,label:`Size`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{variant:`default`,size:`default`,buttons:[{label:`Left`},{label:`Middle`},{label:`Right`}]}}),t.ComponentRegistry.register(`pagination`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,onPageChange:a,...s}=t,c=e.currentPage||e.page||1,l=e.totalPages||1,u=(e,t)=>{t.preventDefault(),e!==c&&(e<1||e>l||a&&a(e))},d=()=>l<=7?Array.from({length:l},(e,t)=>t+1):c<=3?[1,2,3,4,5,-1,l]:c>=l-2?[1,-1,l-4,l-3,l-2,l-1,l]:[1,-1,c-1,c,c+1,-1,l];return(0,o.jsx)(yr,{className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:i,children:(0,o.jsxs)(br,{children:[(0,o.jsx)(xr,{children:(0,o.jsx)(Cr,{href:`#`,onClick:e=>u(c-1,e),className:c<=1?`pointer-events-none opacity-50`:`cursor-pointer`,"aria-disabled":c<=1})}),d().map((e,t)=>(0,o.jsx)(xr,{children:e===-1?(0,o.jsx)(Tr,{}):(0,o.jsx)(Sr,{href:`#`,isActive:e===c,onClick:t=>u(e,t),className:`cursor-pointer`,children:e})},t)),(0,o.jsx)(xr,{children:(0,o.jsx)(wr,{href:`#`,onClick:e=>u(c+1,e),className:c>=l?`pointer-events-none opacity-50`:`cursor-pointer`,"aria-disabled":c>=l})})]})})},{namespace:`ui`,label:`Pagination`,inputs:[{name:`currentPage`,type:`number`,label:`Current Page`,defaultValue:1},{name:`totalPages`,type:`number`,label:`Total Pages`,defaultValue:10},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{currentPage:1,totalPages:10}}),t.ComponentRegistry.register(`navigation-menu`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(ur,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:(0,o.jsx)(dr,{children:e.items?.map((e,t)=>(0,o.jsx)(fr,{children:e.children?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(mr,{children:e.label}),(0,o.jsx)(hr,{children:(0,o.jsx)(`ul`,{className:`grid w-full gap-3 p-4 sm:w-[400px] md:w-[500px] md:grid-cols-2 lg:w-[600px]`,children:e.children.map((e,t)=>(0,o.jsx)(`li`,{children:(0,o.jsx)(gr,{asChild:!0,children:(0,o.jsxs)(`a`,{className:z(`block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground`),href:e.href,children:[(0,o.jsx)(`div`,{className:`text-sm font-medium leading-none`,children:e.label}),e.description&&(0,o.jsx)(`p`,{className:`line-clamp-2 text-sm leading-snug text-muted-foreground`,children:e.description})]})})},t))})})]}):(0,o.jsx)(gr,{href:e.href,children:e.label})},t))})})},{namespace:`ui`,label:`Navigation Menu`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{items:[{label:`Home`,href:`/`},{label:`About`,href:`/about`}]}});function Sa(e){return e.includes(`-`)?e.toLowerCase():e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1-$2`).toLowerCase()}var Ca=new Set(I.iconNames);function wa(e){return Ca.has(e)}var Ta=new Map;function Ea(e){if(!e)return c.Database;let t=Ta.get(e);if(t)return t;let n=Sa(e);if(!wa(n))return Ta.set(e,c.Database),c.Database;let r=e=>a.default.createElement(I.DynamicIcon,{name:n,fallback:c.Database,...e});return r.displayName=`LucideIcon(${e})`,Ta.set(e,r),r}var Da=({name:e,...t})=>{if(!e)return a.default.createElement(c.Database,t);let n=Sa(e);return wa(n)?a.default.createElement(I.DynamicIcon,{name:n,fallback:c.Database,...t}):a.default.createElement(c.Database,t)};function Oa(e){let t=e?.properties??{};return{...e?.props??{},...t}}function ka(e){if(!e||typeof e!=`object`)return{};let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n.startsWith(`aria-`)||n===`role`?n:`aria-${n}`]=String(r));return t}var Aa={left:`text-left`,center:`text-center`,right:`text-right`},ja={heading:`text-2xl font-semibold tracking-tight`,subheading:`text-lg font-medium text-foreground`,body:`text-sm text-foreground`,caption:`text-xs text-muted-foreground`};function Ma({schema:e}){let t=Oa(e),n=t.variant??`body`,r=t.align??`left`;return(0,o.jsx)(n===`heading`?`h2`:n===`subheading`?`h3`:`p`,{className:z(ja[n]??ja.body,Aa[r],e?.className),...ka(t.aria),children:t.content??``})}t.ComponentRegistry.register(`element:text`,Ma,{namespace:`element`,label:`Text`,category:`content`});function Na({schema:e}){return(0,o.jsx)(Ur,{className:z(`my-4`,e?.className)})}t.ComponentRegistry.register(`element:divider`,Na,{namespace:`element`,label:`Divider`,category:`content`});var Pa={cover:`object-cover`,contain:`object-contain`,fill:`object-fill`};function Fa({schema:e}){let t=Oa(e),n=t.fit??`cover`;return t.src?(0,o.jsx)(`img`,{src:t.src,alt:t.alt??``,className:z(`w-full rounded-md`,Pa[n]??Pa.cover,e?.className),style:t.height?{height:t.height}:void 0,...ka(t.aria)}):(0,o.jsx)(`div`,{className:z(`flex items-center justify-center rounded-md border border-dashed bg-muted/30 text-xs text-muted-foreground`,e?.className),style:{height:t.height??120},children:`no image source`})}t.ComponentRegistry.register(`element:image`,Fa,{namespace:`element`,label:`Image`,category:`content`});var Ia={primary:`default`,secondary:`secondary`,danger:`destructive`,ghost:`ghost`,link:`link`},La={small:`sm`,medium:`default`,large:`lg`};function Ra(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`object`){let t=e;return t.default??t.en??Object.values(t)[0]??``}return String(e)}function za({schema:e}){let t=Oa(e),n=Ia[t.variant??`primary`]??`default`,r=La[t.size??`medium`]??`default`,i=Ra(t.label),a=t.iconPosition??`left`,s=t.icon?(0,o.jsx)(Da,{name:t.icon,className:`h-4 w-4`}):null;return(0,o.jsxs)(U,{variant:n,size:r,disabled:t.disabled,className:z(e?.className),...ka(t.aria),children:[a===`left`&&s,i,a===`right`&&s]})}t.ComponentRegistry.register(`element:button`,za,{namespace:`element`,label:`Button`,category:`action`});var Ba={number:{},currency:{style:`currency`,currency:`USD`},percent:{style:`percent`,maximumFractionDigits:1}};function Va(e,t,n,r){if(e==null||Number.isNaN(e))return`—`;let i=Ba[t??`number`]??Ba.number,a=new Intl.NumberFormat(void 0,i).format(e);return`${n??``}${a}${r??``}`}function Ha({schema:e}){let t=Oa(e),n=(0,i.useAdapter)(),[r,s]=a.useState(null),[c,l]=a.useState(!0),[u,d]=a.useState(null),f=a.useMemo(()=>t.filter?JSON.stringify(t.filter):``,[t.filter]);return a.useEffect(()=>{let e=!1;if(!n||!t.object||!t.aggregate){l(!1);return}return l(!0),d(null),(async()=>{try{if(typeof n.aggregate==`function`){let r=await n.aggregate(t.object,{field:t.field,function:t.aggregate,groupBy:`_all`,filter:t.filter}),i=Array.isArray(r)?r[0]:r,a=t.aggregate===`count`?`count`:`${t.field??``}_${t.aggregate}`,o=i?.[a]??i?.[t.field??``]??i?.value??(typeof i==`number`?i:null);e||s(typeof o==`number`?o:o==null?null:Number(o))}else if(typeof n.find==`function`){let r=await n.find(t.object,t.filter?{$filter:t.filter}:void 0),i=r?.data??r?.records??(Array.isArray(r)?r:[]),a=null;if(t.aggregate===`count`)a=i.length;else if(t.field){let e=i.map(e=>Number(e?.[t.field])).filter(e=>!Number.isNaN(e));e.length&&(t.aggregate===`sum`?a=e.reduce((e,t)=>e+t,0):t.aggregate===`avg`?a=e.reduce((e,t)=>e+t,0)/e.length:t.aggregate===`min`?a=Math.min(...e):t.aggregate===`max`&&(a=Math.max(...e)))}e||s(a)}}catch(t){e||d(t?.message??`aggregate failed`)}finally{e||l(!1)}})(),()=>{e=!0}},[n,t.object,t.field,t.aggregate,f]),(0,o.jsxs)(`div`,{className:z(`flex flex-col gap-1`,e?.className),...ka(t.aria),children:[(0,o.jsx)(`div`,{className:`text-3xl font-semibold tracking-tight tabular-nums`,children:c?`…`:Va(r,t.format,t.prefix,t.suffix)}),u&&(0,o.jsx)(`div`,{className:`text-xs text-destructive`,children:u})]})}t.ComponentRegistry.register(`element:number`,Ha,{namespace:`element`,label:`Number`,category:`content`});function Ua({label:e,collapsible:t,collapsed:n,onToggle:r}){return e?(0,o.jsx)(`div`,{className:z(`col-span-full pt-4 pb-1 border-b border-border`,t&&`cursor-pointer select-none`),onClick:t?r:void 0,role:t?`button`:void 0,"aria-expanded":t?!n:void 0,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[t&&(n?(0,o.jsx)(c.ChevronRight,{className:`h-3.5 w-3.5 text-muted-foreground`}):(0,o.jsx)(c.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground`})),(0,o.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:e})]})}):null}var Wa=(0,le.createSafeTranslation)({"common.selectOption":`Select an option`},`common.selectOption`);function Ga({value:e,onChange:t,placeholder:n,className:r,label:i,...s}){let[l,u]=a.default.useState(!1),[d,f]=a.default.useState(e??``),p=e=>t&&t(e),m=()=>{f(e??``),u(!0)},h=()=>{p(d),u(!1)};return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(ea,{placeholder:n,className:z(`pr-10`,r),value:e??``,onChange:e=>p(e.target.value),...s}),(0,o.jsx)(`button`,{type:`button`,onClick:m,className:`absolute top-1.5 right-1.5 inline-flex items-center justify-center size-7 rounded-md bg-background/80 text-muted-foreground hover:text-foreground hover:bg-background border shadow-sm`,"aria-label":`Edit ${i??`text`} fullscreen`,"data-testid":`form-textarea-fullscreen-toggle`,children:(0,o.jsx)(c.Maximize2,{className:`size-3.5`})}),(0,o.jsx)(wt,{open:l,onOpenChange:u,children:(0,o.jsxs)(kt,{className:`sm:max-w-3xl h-[100dvh] sm:h-[80vh] max-h-[100dvh] sm:max-h-[80vh] flex flex-col p-0 gap-0`,"data-testid":`form-textarea-fullscreen-dialog`,children:[(0,o.jsx)(At,{className:`p-4 border-b`,children:(0,o.jsx)(Mt,{className:`text-base`,children:i??`Edit text`})}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 p-4`,children:(0,o.jsx)(ea,{autoFocus:!0,value:d,onChange:e=>f(e.target.value),placeholder:n,className:`h-full min-h-full resize-none text-base`,"data-testid":`form-textarea-fullscreen-input`})}),(0,o.jsxs)(jt,{className:`p-3 border-t flex-row justify-end gap-2`,children:[(0,o.jsxs)(U,{type:`button`,variant:`ghost`,onClick:()=>u(!1),children:[(0,o.jsx)(c.X,{className:`size-4 mr-1`}),` Cancel`]}),(0,o.jsxs)(U,{type:`button`,onClick:h,"data-testid":`form-textarea-fullscreen-save`,children:[(0,o.jsx)(c.Check,{className:`size-4 mr-1`}),` Done`]})]})]})})]})}t.ComponentRegistry.register(`form`,({schema:e,className:t,onAction:n,...r})=>{let{t:s}=Wa(),{defaultValues:l={},fields:u=[],submitLabel:d=`Submit`,cancelLabel:f=`Cancel`,showCancel:p=!1,showSubmit:m=!0,layout:h=`vertical`,columns:g=1,onSubmit:_,onChange:v,onCancel:y,resetOnSubmit:b=!1,validationMode:x=`onSubmit`,disabled:S=!1}=e,C=(0,w.useForm)({defaultValues:l,mode:x}),[T,E]=a.default.useState(!1),[D,O]=a.default.useState(null),k=a.default.useContext(i.SchemaRendererContext)?.dataSource??null;a.default.useEffect(()=>{C.reset(l)},[l]),a.default.useEffect(()=>{if(n){let e=C.watch(e=>{n({type:`form_change`,data:e,formData:e})});return()=>e.unsubscribe()}},[C,n]);let A=C.handleSubmit(async e=>{E(!0),O(null);let t=e;if(e&&(e.nativeEvent||typeof e.preventDefault==`function`||typeof e.stopPropagation==`function`||e.target||e.bubbles))t=C.getValues();else if(!t||Object.keys(t).length===0){let e=C.getValues();e&&Object.keys(e).length>0&&(t=e)}try{if(n){let e=await n({type:`form_submit`,data:t,formData:t});if(e?.error){O(e.error);return}}_&&typeof _==`function`&&await _(t),b&&C.reset()}catch(e){O(e instanceof Error?e.message:typeof e==`string`?e:`An error occurred during submission`),typeof process<`u`&&process.env.NODE_ENV===`development`&&console.error(`Form submission error:`,e)}finally{E(!1)}}),ee=()=>{C.reset(),y&&typeof y==`function`&&y(),n&&n({type:`form_cancel`,data:C.getValues()})},j=g>1?z(`grid gap-4`,g===1?``:g===2?`md:grid-cols-2`:g===3?`md:grid-cols-2 lg:grid-cols-3`:`md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`):`space-y-4`,{"data-obj-id":te,"data-obj-type":M,style:N,onSubmit:ne,onChange:re,submitLabel:ie,cancelLabel:ae,showSubmit:P,showCancel:oe,resetOnSubmit:se,defaultValues:F,inputType:ce,...I}=r;return(0,o.jsx)(jn,{...C,children:(0,o.jsxs)(`form`,{onSubmit:A,className:t,...I,"data-obj-id":te,"data-obj-type":M,style:N,children:[D&&(0,o.jsxs)(Ne,{variant:`destructive`,className:`mb-4`,children:[(0,o.jsx)(c.AlertCircle,{className:`h-4 w-4`}),(0,o.jsx)(Fe,{children:D})]}),e.children?(0,o.jsx)(`div`,{className:e.fieldContainerClass||`space-y-4`,children:B(e.children)}):(0,o.jsx)(`div`,{className:e.fieldContainerClass||j,children:u.map(t=>{let{name:n,label:r,description:i,type:a=`input`,required:c=!1,disabled:l=!1,validation:u={},condition:d,colSpan:f,hidden:p,widget:m,visibleOn:h,readonly:g,..._}=t;if(p)return null;if(d){let e=d.field,t=C.watch(e),n=t!=null;if(d.equals!==void 0&&t!==d.equals||d.notEquals!==void 0&&t===d.notEquals||d.in&&(!n||!d.in.includes(t)))return null}if(a===`section-divider`){let e=_;return(0,o.jsx)(Ua,{label:r,collapsible:e.collapsible,collapsed:e.collapsed,onToggle:e.onToggle},n)}let v={...u};c&&(v.required=typeof u.required==`string`?u.required:`${r||n} is required`);let y=t.id??n,b=m||a,x=e.fieldContainerClass||j,w=e=>{let t=Array.from(x.matchAll(/(@)?(sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl):grid-cols-(\d+)/g)).map(e=>({at:e[1]||``,bp:e[2],cols:Number(e[3])}));if(!t.length)return e===2?`col-span-2`:e===3?`col-span-3`:`col-span-4`;let n=t.find(t=>t.cols>=e)||t[t.length-1];return{"@sm:2":`@sm:col-span-2`,"@md:2":`@md:col-span-2`,"@lg:2":`@lg:col-span-2`,"@xl:2":`@xl:col-span-2`,"@2xl:2":`@2xl:col-span-2`,"@sm:3":`@sm:col-span-3`,"@md:3":`@md:col-span-3`,"@lg:3":`@lg:col-span-3`,"@xl:3":`@xl:col-span-3`,"@2xl:3":`@2xl:col-span-3`,"@4xl:3":`@4xl:col-span-3`,"@sm:4":`@sm:col-span-4`,"@md:4":`@md:col-span-4`,"@lg:4":`@lg:col-span-4`,"@xl:4":`@xl:col-span-4`,"@2xl:4":`@2xl:col-span-4`,"@4xl:4":`@4xl:col-span-4`,"sm:2":`sm:col-span-2`,"md:2":`md:col-span-2`,"lg:2":`lg:col-span-2`,"xl:2":`xl:col-span-2`,"sm:3":`sm:col-span-3`,"md:3":`md:col-span-3`,"lg:3":`lg:col-span-3`,"xl:3":`xl:col-span-3`,"sm:4":`sm:col-span-4`,"md:4":`md:col-span-4`,"lg:4":`lg:col-span-4`,"xl:4":`xl:col-span-4`}[`${n.at}${n.bp}:${e}`]||(e===2?`col-span-2`:e===3?`col-span-3`:`col-span-4`)},E=f&&f>1?f===2?w(2):f===3?w(3):f>=4?w(4):``:``;return(0,o.jsx)(Nn,{control:C.control,name:n,rules:v,render:({field:e})=>(0,o.jsxs)(In,{className:E||void 0,children:[r&&(0,o.jsxs)(Ln,{className:`text-xs sm:text-sm`,children:[r,c&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,"aria-label":`required`,children:`*`})]}),(0,o.jsx)(Rn,{children:Ka(b,{..._,field:t.field||t,...e,inputType:_.inputType,options:_.options,placeholder:_.placeholder??(b===`select`?s(`common.selectOption`):void 0),disabled:S||l||g||T,dataSource:k})}),i&&(0,o.jsx)(zn,{children:i}),(0,o.jsx)(Bn,{})]})},y)})}),e.showActions!==!1&&(0,o.jsxs)(`div`,{className:z(`flex flex-col sm:flex-row gap-2 ${h===`horizontal`?`sm:justify-end`:`sm:justify-start`} mt-6`,e.mobileStickyActions&&`sticky bottom-0 z-10 -mx-4 px-4 py-3 bg-background/95 supports-[backdrop-filter]:bg-background/80 backdrop-blur border-t md:static md:mx-0 md:px-0 md:py-0 md:bg-transparent md:border-0 md:backdrop-blur-none`),"data-testid":e.mobileStickyActions?`form-mobile-sticky-actions`:void 0,children:[p&&(0,o.jsx)(U,{type:`button`,variant:`outline`,onClick:ee,disabled:T||S,className:`w-full sm:w-auto`,children:f}),m&&(0,o.jsxs)(U,{type:`submit`,disabled:T||S,className:`w-full sm:w-auto`,children:[T&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),d]})]})]})})},{namespace:`ui`,label:`Form`,inputs:[{name:`fields`,type:`array`,label:`Fields`,description:`Array of field configurations with name, label, type, validation, etc.`},{name:`defaultValues`,type:`object`,label:`Default Values`,description:`Object with default values for form fields`},{name:`submitLabel`,type:`string`,label:`Submit Button Label`,defaultValue:`Submit`},{name:`cancelLabel`,type:`string`,label:`Cancel Button Label`,defaultValue:`Cancel`},{name:`showCancel`,type:`boolean`,label:`Show Cancel Button`,defaultValue:!1},{name:`layout`,type:`enum`,enum:[`vertical`,`horizontal`],label:`Layout`,defaultValue:`vertical`},{name:`columns`,type:`number`,label:`Number of Columns`,defaultValue:1,description:`For multi-column layouts (1-4)`},{name:`validationMode`,type:`enum`,enum:[`onSubmit`,`onBlur`,`onChange`,`onTouched`,`all`],label:`Validation Mode`,defaultValue:`onSubmit`},{name:`resetOnSubmit`,type:`boolean`,label:`Reset After Submit`,defaultValue:!1},{name:`disabled`,type:`boolean`,label:`Disabled`,defaultValue:!1},{name:`className`,type:`string`,label:`CSS Class`},{name:`fieldContainerClass`,type:`string`,label:`Field Container CSS Class`}],defaultProps:{submitLabel:`Submit`,cancelLabel:`Cancel`,showCancel:!1,layout:`vertical`,columns:1,validationMode:`onSubmit`,resetOnSubmit:!1,disabled:!1,fields:[{name:`name`,label:`Name`,type:`input`,required:!0,placeholder:`Enter your name`},{name:`email`,label:`Email`,type:`input`,inputType:`email`,required:!0,placeholder:`Enter your email`}]}});function Ka(e,n){let r=t.ComponentRegistry.get(e);if(r)return(0,o.jsx)(r,{schema:n,...n});let{inputType:i,options:a=[],placeholder:s,...c}=n;switch(e){case`input`:if(i===`file`){let{value:e,...t}=c;return(0,o.jsx)(K,{type:`file`,placeholder:s,className:`min-h-[44px] sm:min-h-0`,...t})}return(0,o.jsx)(K,{type:i||`text`,placeholder:s,className:`min-h-[44px] sm:min-h-0`,...c,value:c.value??``});case`textarea`:{let{mobile_fullscreen:e,fullscreen:t,label:n,...r}=c;return e||t?(0,o.jsx)(Ga,{placeholder:s,label:n,className:`min-h-[44px] sm:min-h-0`,...r,value:r.value??``}):(0,o.jsx)(ea,{placeholder:s,className:`min-h-[44px] sm:min-h-0`,...r,value:r.value??``})}case`checkbox`:{let{value:e,onChange:t,...n}=c;return(0,o.jsx)(bt,{checked:e,onCheckedChange:t,className:`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0`,...n})}case`switch`:{let{value:e,onChange:t,...n}=c;return(0,o.jsx)(Vi,{checked:e,onCheckedChange:t,className:`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0`,...n})}case`select`:{let{value:e,onChange:t,...n}=c;return!a||a.length===0?(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`No options available`}):(0,o.jsxs)(Lr,{value:e,onValueChange:t,...n,children:[(0,o.jsx)(J,{className:`min-h-[44px] sm:min-h-0`,children:(0,o.jsx)(q,{placeholder:s||`Select an option`})}),(0,o.jsx)(Y,{children:a.map(e=>(0,o.jsx)(X,{value:e.value,children:e.label},e.value))})]})}default:return(0,o.jsx)(K,{type:i||`text`,placeholder:s,...c})}}function qa(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}var Ja={Home:`House`},Ya=(0,a.forwardRef)(({schema:e,...t},n)=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=t,l=null;if(e.icon){let t=qa(e.icon);l=c.icons[Ja[t]||t]}let u=e.loading||t.loading,d=e.disabled||t.disabled||u;return(0,o.jsxs)(U,{ref:n,type:e.buttonType||`button`,variant:e.variant,size:e.size,className:e.className,disabled:d,...s,"data-obj-id":r,"data-obj-type":i,style:a,children:[u&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!u&&l&&e.iconPosition!==`right`&&(0,o.jsx)(l,{className:`mr-2 h-4 w-4`}),e.label||B(e.body||e.children),!u&&l&&e.iconPosition===`right`&&(0,o.jsx)(l,{className:`ml-2 h-4 w-4`})]})});Ya.displayName=`ButtonRenderer`,t.ComponentRegistry.register(`button`,Ya,{namespace:`ui`,label:`Button`,inputs:[{name:`label`,type:`string`,label:`Label`,defaultValue:`Button`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`,`link`],defaultValue:`default`},{name:`size`,type:`enum`,label:`Size`,enum:[`default`,`sm`,`lg`,`icon`],defaultValue:`default`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{label:`Button`,variant:`default`,size:`default`}}),t.ComponentRegistry.register(`label`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(G,{className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a,children:e.text||e.label||e.content})},{namespace:`ui`,label:`Label`,inputs:[{name:`text`,type:`string`,label:`Text`,required:!0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{text:`Label Text`}});var Xa=({schema:e,className:t,onChange:n,value:r,...i})=>{let a=e=>{n&&n(e.target.value)},{"data-obj-id":s,"data-obj-type":c,style:l,...u}=i;return(0,o.jsxs)(`div`,{className:z(`grid w-full items-center gap-1.5`,e.wrapperClass),"data-obj-id":s,"data-obj-type":c,style:l,children:[e.label&&(0,o.jsx)(G,{htmlFor:e.id,className:z(e.required&&`text-destructive after:content-['*'] after:ml-0.5`),children:e.label}),(0,o.jsx)(K,{type:e.inputType||`text`,id:e.id,name:e.name,placeholder:e.placeholder,className:t,required:e.required,disabled:e.disabled,readOnly:e.readOnly,value:r??e.value??``,defaultValue:r===void 0?e.defaultValue:void 0,onChange:a,min:e.min,max:e.max,step:e.step,maxLength:e.maxLength,pattern:e.pattern,...u}),e.description&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),e.error&&(0,o.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:e.error})]})};t.ComponentRegistry.register(`input`,Xa,{namespace:`ui`,label:`Input Field`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`name`,type:`string`,label:`Field Name`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`inputType`,type:`enum`,label:`Type`,enum:[`text`,`email`,`password`,`number`,`tel`,`url`,`date`,`time`,`datetime-local`],defaultValue:`text`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`description`,type:`string`,label:`Description`}],defaultProps:{inputType:`text`}}),t.ComponentRegistry.register(`email`,e=>(0,o.jsx)(Xa,{...e,schema:{...e.schema,inputType:`email`}}),{namespace:`ui`,label:`Email Input`,icon:`mail`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`name`,type:`string`,label:`Field Name`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`description`,type:`string`,label:`Description`}]}),t.ComponentRegistry.register(`password`,e=>(0,o.jsx)(Xa,{...e,schema:{...e.schema,inputType:`password`}}),{namespace:`ui`,label:`Password Input`,icon:`lock`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`name`,type:`string`,label:`Field Name`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`description`,type:`string`,label:`Description`}]}),t.ComponentRegistry.register(`textarea`,({schema:e,className:t,onChange:n,value:r,...i})=>{let a=e=>{n&&n(e.target.value)},{"data-obj-id":s,"data-obj-type":c,style:l,...u}=i;return(0,o.jsxs)(`div`,{className:z(`grid w-full gap-1.5`,e.wrapperClass),"data-obj-id":s,"data-obj-type":c,style:l,children:[e.label&&(0,o.jsx)(G,{htmlFor:e.id,className:z(e.required&&`text-destructive after:content-['*'] after:ml-0.5`),children:e.label}),(0,o.jsx)(ea,{id:e.id,name:e.name,placeholder:e.placeholder,className:t,disabled:e.disabled,readOnly:e.readOnly,required:e.required,rows:e.rows,value:r??e.value??``,defaultValue:r===void 0?e.defaultValue:void 0,onChange:a,...u})]})},{namespace:`ui`,label:`Textarea`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`rows`,type:`number`,label:`Rows`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`id`,type:`string`,label:`ID`,required:!0}],defaultProps:{label:`Textarea label`,placeholder:`Enter text here...`,rows:3,id:`textarea-field`}}),t.ComponentRegistry.register(`checkbox`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=i;return(0,o.jsxs)(`div`,{className:z(`flex items-center space-x-2`,e.wrapperClass),"data-obj-id":a,"data-obj-type":s,style:c,children:[(0,o.jsx)(bt,{id:e.id,className:t,checked:r??e.checked??!1,defaultChecked:r===void 0?e.defaultChecked:void 0,onCheckedChange:e=>{n&&n(e)},disabled:e.disabled,required:e.required,name:e.name,...l}),(0,o.jsx)(G,{htmlFor:e.id,className:z(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e.required&&`text-destructive after:content-['*'] after:ml-0.5`),children:e.label})]})},{namespace:`ui`,label:`Checkbox`,inputs:[{name:`label`,type:`string`,label:`Label`,required:!0},{name:`id`,type:`string`,label:`ID`,required:!0},{name:`checked`,type:`boolean`,label:`Checked`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`}],defaultProps:{label:`Checkbox label`,id:`checkbox-field`}}),t.ComponentRegistry.register(`switch`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsxs)(`div`,{className:`flex items-center space-x-2 ${e.wrapperClass||``}`,"data-obj-id":r,"data-obj-type":i,style:a,children:[(0,o.jsx)(Vi,{id:e.id,className:t,...s}),(0,o.jsx)(G,{htmlFor:e.id,children:e.label})]})},{namespace:`ui`,label:`Switch`,inputs:[{name:`label`,type:`string`,label:`Label`,required:!0},{name:`id`,type:`string`,label:`ID`,required:!0},{name:`checked`,type:`boolean`,label:`Checked`}],defaultProps:{label:`Switch label`,id:`switch-field`}}),t.ComponentRegistry.register(`select`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=i;return(0,o.jsxs)(`div`,{className:z(`grid w-full items-center gap-1.5`,e.wrapperClass),"data-obj-id":a,"data-obj-type":s,style:c,children:[e.label&&(0,o.jsx)(G,{className:z(e.required&&`text-destructive after:content-['*'] after:ml-0.5`),children:e.label}),(0,o.jsxs)(Lr,{defaultValue:r===void 0?e.defaultValue:void 0,value:r??e.value,onValueChange:e=>{n&&n(e)},disabled:e.disabled,required:e.required,name:e.name,...l,children:[(0,o.jsx)(J,{className:t,children:(0,o.jsx)(q,{placeholder:e.placeholder})}),(0,o.jsx)(Y,{children:e.options?.map(e=>(0,o.jsx)(X,{value:e.value,disabled:e.disabled,children:e.label},e.value))})]})]})},{namespace:`ui`,label:`Select`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`defaultValue`,type:`string`,label:`Default Value`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`options`,type:`array`,label:`Options`,description:`Array of {label, value} objects`}],defaultProps:{label:`Select an option`,placeholder:`Choose...`,options:[{label:`Option 1`,value:`option1`},{label:`Option 2`,value:`option2`},{label:`Option 3`,value:`option3`}]}}),t.ComponentRegistry.register(`radio-group`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(Ar,{defaultValue:e.defaultValue,className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a,children:e.options?.map(t=>(0,o.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,o.jsx)(jr,{value:t.value,id:`${e.id}-${t.value}`}),(0,o.jsx)(G,{htmlFor:`${e.id}-${t.value}`,children:t.label})]},t.value))})},{namespace:`ui`,label:`Radio Group`,inputs:[{name:`defaultValue`,type:`string`,label:`Default Value`},{name:`id`,type:`string`,label:`Group ID`,required:!0},{name:`options`,type:`array`,label:`Options`,description:`Array of {label, value} objects`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{id:`radio-group`,options:[{label:`Option 1`,value:`option1`},{label:`Option 2`,value:`option2`},{label:`Option 3`,value:`option3`}]}}),t.ComponentRegistry.register(`slider`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(zi,{defaultValue:Array.isArray(e.defaultValue)?e.defaultValue:e.defaultValue===void 0?void 0:[e.defaultValue],max:e.max,min:e.min,step:e.step,className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`Slider`,inputs:[{name:`defaultValue`,type:`array`,label:`Default Value`,defaultValue:[50]},{name:`max`,type:`number`,label:`Max`,defaultValue:100},{name:`min`,type:`number`,label:`Min`,defaultValue:0},{name:`step`,type:`number`,label:`Step`,defaultValue:1},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{defaultValue:[50],max:100,min:0,step:1,className:`w-full`}}),t.ComponentRegistry.register(`toggle`,({schema:e,...t})=>(0,o.jsx)(na,{variant:e.variant,size:e.size,pressed:e.pressed,"aria-label":e.ariaLabel,...t,children:e.label||B(e.children)}),{namespace:`ui`,label:`Toggle`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`pressed`,type:`boolean`,label:`Pressed`},{name:`variant`,type:`enum`,enum:[`default`,`outline`],defaultValue:`default`,label:`Variant`},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`],defaultValue:`default`,label:`Size`},{name:`ariaLabel`,type:`string`,label:`Aria Label`}],defaultProps:{label:`Toggle`,variant:`default`,size:`default`}}),t.ComponentRegistry.register(`input-otp`,({schema:e,className:t,onChange:n,value:r,...i})=>{let a=e.maxLength||6,s=Array.from({length:a});return(0,o.jsx)(Wn,{maxLength:a,className:t,value:r??e.value,onChange:e=>{n&&n(e)},...i,children:(0,o.jsx)(Gn,{children:s.map((e,t)=>(0,o.jsx)(Kn,{index:t},t))})})},{namespace:`ui`,label:`Input OTP`,inputs:[{name:`maxLength`,type:`number`,label:`Max Length`,defaultValue:6},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{maxLength:6}}),t.ComponentRegistry.register(`calendar`,({schema:e,className:t,...n})=>(0,o.jsx)(Ye,{mode:e.mode||`single`,selected:e.value||e.defaultValue,className:t,...n}),{namespace:`ui`,label:`Calendar`,inputs:[{name:`mode`,type:`enum`,enum:[`default`,`single`,`multiple`,`range`],defaultValue:`single`,label:`Mode`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{mode:`single`,className:`rounded-md border`}}),t.ComponentRegistry.register(`date-picker`,({schema:e,className:t,value:n,onChange:r,...i})=>{let a=e=>{r&&r(e)},{"data-obj-id":s,"data-obj-type":l,style:u,...d}=i;return(0,o.jsxs)(`div`,{className:`grid w-full max-w-sm items-center gap-1.5 ${e.wrapperClass||``}`,"data-obj-id":s,"data-obj-type":l,style:u,children:[e.label&&(0,o.jsx)(G,{htmlFor:e.id,children:e.label}),(0,o.jsxs)(Er,{children:[(0,o.jsx)(Dr,{asChild:!0,children:(0,o.jsxs)(U,{id:e.id,variant:`outline`,className:z(`w-full justify-start text-left font-normal`,!n&&`text-muted-foreground`,t),...d,children:[(0,o.jsx)(c.CalendarIcon,{className:`mr-2 h-4 w-4`}),n?(0,L.format)(n,e.format||`PPP`):(0,o.jsx)(`span`,{children:e.placeholder||`Pick a date`})]})}),(0,o.jsx)(Or,{className:`w-auto p-0`,children:(0,o.jsx)(Ye,{mode:`single`,selected:n,onSelect:a,autoFocus:!0})})]})]})},{namespace:`ui`,label:`Date Picker`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`format`,type:`string`,label:`Date Format`,description:`date-fns format string (e.g., "PPP", "yyyy-MM-dd")`},{name:`id`,type:`string`,label:`ID`,required:!0}],defaultProps:{label:`Date`,placeholder:`Pick a date`,format:`PPP`,id:`date-picker-field`}}),t.ComponentRegistry.register(`file-upload`,({schema:e,className:t,value:n,onChange:r,...i})=>{let[s,l]=(0,a.useState)(n||[]),[u,d]=(0,a.useState)(!1),[f,p]=(0,a.useState)(0),m=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(u){let e=setInterval(()=>{p(t=>t>=100?(clearInterval(e),d(!1),0):t+5)},50);return()=>clearInterval(e)}},[u]);let h=t=>{let n=Array.from(t.target.files||[]);if(n.length>0){d(!0),p(0);let t=e.multiple?[...s,...n]:n;setTimeout(()=>{l(t),r&&r(t)},1e3)}},g=e=>{let t=s.filter((t,n)=>n!==e);l(t),r&&r(t)},_=()=>{m.current?.click()},{"data-obj-id":v,"data-obj-type":y,style:b,...x}=i;return(0,o.jsxs)(`div`,{className:`grid w-full max-w-sm items-center gap-2 ${e.wrapperClass||``}`,"data-obj-id":v,"data-obj-type":y,style:b,children:[e.label&&(0,o.jsx)(G,{htmlFor:e.id,children:e.label}),(0,o.jsxs)(`div`,{className:z(`relative flex flex-col gap-3 group/upload`,t),children:[(0,o.jsx)(`input`,{ref:m,type:`file`,id:e.id,className:`hidden`,accept:e.accept,multiple:e.multiple,onChange:h,...x}),(0,o.jsxs)(`div`,{onClick:_,className:z(`relative overflow-hidden cursor-pointer rounded-lg border-2 border-dashed transition-all duration-300 min-h-[120px] flex flex-col items-center justify-center p-4 sm:p-6 gap-3`,u?`border-cyan-400 bg-cyan-950/30`:`border-slate-700 bg-slate-900/50 hover:bg-slate-900 hover:border-cyan-500/50 hover:shadow-[0_0_20px_-5px_rgba(6,182,212,0.3)]`),children:[(0,o.jsx)(`div`,{className:`absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-5 pointer-events-none`}),(0,o.jsx)(`div`,{className:`absolute inset-0 bg-[linear-gradient(to_right,#80808012_1px,transparent_1px),linear-gradient(to_bottom,#80808012_1px,transparent_1px)] bg-[size:14px_24px] pointer-events-none`}),(0,o.jsx)(`div`,{className:z(`relative z-10 p-3 rounded-full bg-slate-800 border border-slate-700 transition-all duration-500`,u?`scale-110 shadow-[0_0_30px_cyan] border-cyan-400 animate-bounce`:`group-hover/upload:scale-110 group-hover/upload:shadow-lg group-hover/upload:border-cyan-500`),children:u?(0,o.jsx)(c.Rocket,{className:`w-8 h-8 text-cyan-300 animate-pulse`}):(0,o.jsx)(c.Upload,{className:`w-6 h-6 text-slate-400 group-hover/upload:text-cyan-400`})}),(0,o.jsx)(`div`,{className:`relative z-10 text-center`,children:(0,o.jsx)(`p`,{className:z(`text-xs font-mono uppercase tracking-widest transition-colors`,u?`text-cyan-300`:`text-slate-500 group-hover/upload:text-cyan-200`),children:u?`INITIATING LAUNCH SEQUENCE...`:e.buttonText||`DROP PAYLOAD OR CLICK TO UPLOAD`})}),u&&(0,o.jsx)(`div`,{className:`absolute bottom-0 left-0 h-1 bg-cyan-500 shadow-[0_0_10px_cyan] transition-all duration-75 ease-out`,style:{width:`${f}%`}})]}),s.length>0&&(0,o.jsx)(`div`,{className:`flex flex-col gap-2 mt-1 perspective-1000`,children:s.map((e,t)=>(0,o.jsxs)(`div`,{className:`relative group/file overflow-hidden flex items-center justify-between p-3 border border-border bg-card/80 rounded-sm text-sm transition-all hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 animate-in slide-in-from-bottom-2 fade-in`,children:[(0,o.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 w-[2px] bg-primary/50 group-hover/file:bg-primary group-hover/file:shadow-[0_0_8px_hsl(var(--primary))]`}),(0,o.jsxs)(`div`,{className:`flex items-center gap-3 z-10`,children:[(0,o.jsx)(c.CheckCircle2,{className:`w-4 h-4 text-emerald-500 rounded-full`}),(0,o.jsx)(`span`,{className:`truncate max-w-[150px] sm:max-w-[200px] md:max-w-[300px] text-muted-foreground group-hover/file:text-foreground font-mono text-xs transition-colors`,children:e.name})]}),(0,o.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 hover:bg-destructive/10 hover:text-destructive`,onClick:()=>g(t),children:(0,o.jsx)(c.X,{className:`h-3 w-3`})}),(0,o.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-r from-transparent via-primary/5 to-transparent -translate-x-full group-hover/file:animate-[shimmer_1s_infinite] pointer-events-none`})]},t))})]})]})},{namespace:`ui`,label:`File Upload`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`buttonText`,type:`string`,label:`Button Text`},{name:`accept`,type:`string`,label:`Accepted File Types`,description:`MIME types (e.g., "image/*,application/pdf")`},{name:`multiple`,type:`boolean`,label:`Allow Multiple Files`},{name:`id`,type:`string`,label:`ID`,required:!0}],defaultProps:{label:`Upload files`,buttonText:`Choose files`,multiple:!0,id:`file-upload-field`}});var Za=(0,d.cva)(`flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none`}},defaultVariants:{orientation:`horizontal`}});function Qa({className:e,orientation:t,...n}){return(0,o.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:z(Za({orientation:t}),e),...n})}function $a({className:e,asChild:t=!1,...n}){return(0,o.jsx)(t?u.Slot:`div`,{className:z(`bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...n})}function eo({className:e,orientation:t=`vertical`,...n}){return(0,o.jsx)(Ur,{"data-slot":`button-group-separator`,orientation:t,className:z(`bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto`,e),...n})}function to({options:e,value:t,onValueChange:n,placeholder:r=`Select option...`,searchPlaceholder:i=`Search...`,emptyText:s=`No option found.`,className:l,disabled:u}){let[d,f]=a.useState(!1);return(0,o.jsxs)(Er,{open:d,onOpenChange:f,children:[(0,o.jsx)(Dr,{asChild:!0,children:(0,o.jsxs)(U,{variant:`outline`,role:`combobox`,"aria-expanded":d,className:z(`w-[200px] justify-between`,l),disabled:u,children:[t?e.find(e=>e.value===t)?.label:r,(0,o.jsx)(c.ChevronsUpDown,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,o.jsx)(Or,{className:`w-[200px] p-0`,children:(0,o.jsxs)(Pt,{children:[(0,o.jsx)(It,{placeholder:i}),(0,o.jsxs)(Lt,{children:[(0,o.jsx)(Rt,{children:s}),(0,o.jsx)(zt,{children:e.map(e=>(0,o.jsxs)(Vt,{value:e.value,onSelect:e=>{n?.(e===t?``:e),f(!1)},children:[(0,o.jsx)(c.Check,{className:z(`mr-2 h-4 w-4`,t===e.value?`opacity-100`:`opacity-0`)}),e.label]},e.value))})]})]})})]})}function no({label:e,value:t,onClick:n,children:r,className:i}){return(0,o.jsxs)(n?`button`:`div`,{className:z(`flex items-center justify-between py-1.5 min-h-[32px] w-full text-left`,n&&`cursor-pointer hover:bg-accent/50 rounded-sm -mx-1 px-1`,i),onClick:n,type:n?`button`:void 0,children:[(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0 max-w-[45%] truncate`,title:e,children:e}),r||(0,o.jsx)(`span`,{className:`text-xs text-foreground truncate ml-4 text-right max-w-[55%]`,title:t,children:t})]})}var ro=[{value:`equals`,label:`Equals`},{value:`notEquals`,label:`Does not equal`},{value:`contains`,label:`Contains`},{value:`notContains`,label:`Does not contain`},{value:`isEmpty`,label:`Is empty`},{value:`isNotEmpty`,label:`Is not empty`},{value:`greaterThan`,label:`Greater than`},{value:`lessThan`,label:`Less than`},{value:`greaterOrEqual`,label:`Greater than or equal`},{value:`lessOrEqual`,label:`Less than or equal`},{value:`before`,label:`Before`},{value:`after`,label:`After`},{value:`between`,label:`Between`},{value:`in`,label:`In`},{value:`notIn`,label:`Not in`}],io=[`equals`,`notEquals`,`contains`,`notContains`,`isEmpty`,`isNotEmpty`],ao=[`equals`,`notEquals`,`greaterThan`,`lessThan`,`greaterOrEqual`,`lessOrEqual`,`isEmpty`,`isNotEmpty`],oo=[`equals`,`notEquals`],so=[`equals`,`notEquals`,`before`,`after`,`between`,`isEmpty`,`isNotEmpty`],co=[`equals`,`notEquals`,`in`,`notIn`,`isEmpty`,`isNotEmpty`],lo=[`equals`,`notEquals`,`in`,`notIn`,`isEmpty`,`isNotEmpty`],uo=[`number`,`currency`,`percent`,`rating`],fo=[`date`,`datetime`,`time`],po=[`select`,`status`],mo=[`lookup`,`master_detail`,`user`,`owner`];function ho(e){return Array.isArray(e)?e:e!=null&&e!==``?[e]:[]}function go(e){return!!e&&typeof e==`object`&&Array.isArray(e.conditions)&&(e.logic===`and`||e.logic===`or`)}var _o={id:`root`,logic:`and`,conditions:[]};function vo({fields:e=[],value:t,onChange:n,className:r,showClearAll:i=!0}){let[s,l]=a.useState(go(t)?t:_o);a.useEffect(()=>{go(t)&&JSON.stringify(t)!==JSON.stringify(s)&&l(t)},[t]);let u=e=>{l(e),n?.(e)},d=()=>{let t={id:crypto.randomUUID(),field:e[0]?.value||``,operator:`equals`,value:``};u({...s,conditions:[...s.conditions,t]})},f=e=>{u({...s,conditions:s.conditions.filter(t=>t.id!==e)})},p=()=>{u({...s,conditions:[]})},m=(e,t)=>{u({...s,conditions:s.conditions.map(n=>n.id===e?{...n,...t}:n)})},h=()=>{u({...s,logic:s.logic===`and`?`or`:`and`})},g=t=>{let n=e.find(e=>e.value===t)?.type||`text`;return uo.includes(n)?ro.filter(e=>ao.includes(e.value)):n===`boolean`?ro.filter(e=>oo.includes(e.value)):fo.includes(n)?ro.filter(e=>so.includes(e.value)):po.includes(n)?ro.filter(e=>co.includes(e.value)):mo.includes(n)?ro.filter(e=>lo.includes(e.value)):ro.filter(e=>io.includes(e.value))},_=e=>![`isEmpty`,`isNotEmpty`].includes(e),v=t=>{let n=e.find(e=>e.value===t)?.type||`text`;return uo.includes(n)?`number`:n===`date`?`date`:n===`datetime`?`datetime-local`:n===`time`?`time`:`text`},y=t=>{let n=e.find(e=>e.value===t.field),r=[`in`,`notIn`].includes(t.operator);if(mo.includes(n?.type||``)&&!n?.options&&(n?.referenceTo||n?.type===`user`||n?.type===`owner`))return(0,o.jsx)(yo,{field:n,value:t.value,multiple:r,onChange:e=>m(t.id,{value:e})});if(n?.options&&r){let e=ho(t.value);return(0,o.jsx)(`div`,{className:`max-h-40 overflow-y-auto space-y-0.5 border rounded-md p-2`,children:n.options.map(n=>{let r=e.map(String).includes(String(n.value));return(0,o.jsxs)(`label`,{className:z(`flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer`,r?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,o.jsx)(bt,{checked:r,onCheckedChange:r=>{let i=r?[...e,n.value]:e.filter(e=>String(e)!==String(n.value));m(t.id,{value:i})}}),(0,o.jsx)(`span`,{className:`truncate`,children:n.label})]},n.value)})})}if(n?.options&&(po.includes(n.type||``)||mo.includes(n.type||``)))return(0,o.jsxs)(Lr,{value:String(t.value||``),onValueChange:e=>m(t.id,{value:e}),children:[(0,o.jsx)(J,{className:`h-9 text-sm`,children:(0,o.jsx)(q,{placeholder:`Select value`})}),(0,o.jsx)(Y,{children:n.options.map(e=>(0,o.jsx)(X,{value:e.value,children:e.label},e.value))})]});if(n?.type===`boolean`)return(0,o.jsxs)(Lr,{value:String(t.value||``),onValueChange:e=>m(t.id,{value:e===`true`}),children:[(0,o.jsx)(J,{className:`h-9 text-sm`,children:(0,o.jsx)(q,{placeholder:`Select value`})}),(0,o.jsxs)(Y,{children:[(0,o.jsx)(X,{value:`true`,children:`True`}),(0,o.jsx)(X,{value:`false`,children:`False`})]})]});let i=v(t.field),a=()=>t.value?i===`date`&&typeof t.value==`string`?t.value.split(`T`)[0]:String(t.value):``,s=e=>{let r=e;uo.includes(n?.type||``)&&e!==``?r=parseFloat(e)||0:fo.includes(n?.type||``)&&(r=e),m(t.id,{value:r})};return(0,o.jsx)(K,{type:i,className:`h-9 text-sm`,placeholder:`Value`,value:a(),onChange:e=>s(e.target.value)})};return(0,o.jsxs)(`div`,{className:z(`space-y-3`,r),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Where`}),s.conditions.length>1&&(0,o.jsx)(U,{variant:`outline`,size:`sm`,onClick:h,className:`h-7 text-xs`,children:s.logic.toUpperCase()})]}),i&&s.conditions.length>0&&(0,o.jsxs)(U,{variant:`ghost`,size:`sm`,onClick:p,className:`h-7 text-xs text-muted-foreground hover:text-destructive`,children:[(0,o.jsx)(c.Trash2,{className:`h-3 w-3 mr-1`}),`Clear all`]})]}),(0,o.jsx)(`div`,{className:`space-y-2`,children:s.conditions.map(t=>(0,o.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,o.jsxs)(`div`,{className:`flex-1 grid grid-cols-12 gap-2`,children:[(0,o.jsx)(`div`,{className:`col-span-4`,children:(0,o.jsxs)(Lr,{value:t.field,onValueChange:e=>m(t.id,{field:e}),children:[(0,o.jsx)(J,{className:`h-9 text-sm`,children:(0,o.jsx)(q,{placeholder:`Select field`})}),(0,o.jsx)(Y,{children:e.map(e=>(0,o.jsx)(X,{value:e.value,children:e.label},e.value))})]})}),(0,o.jsx)(`div`,{className:`col-span-4`,children:(0,o.jsxs)(Lr,{value:t.operator,onValueChange:e=>m(t.id,{operator:e}),children:[(0,o.jsx)(J,{className:`h-9 text-sm`,children:(0,o.jsx)(q,{placeholder:`Operator`})}),(0,o.jsx)(Y,{children:g(t.field).map(e=>(0,o.jsx)(X,{value:e.value,children:e.label},e.value))})]})}),_(t.operator)&&(0,o.jsx)(`div`,{className:`col-span-4`,children:y(t)})]}),(0,o.jsxs)(U,{variant:`ghost`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:()=>f(t.id),children:[(0,o.jsx)(c.X,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Remove condition`})]})]},t.id))}),(0,o.jsxs)(U,{variant:`outline`,size:`sm`,onClick:d,className:`h-8`,disabled:e.length===0,children:[(0,o.jsx)(c.Plus,{className:`h-3 w-3`}),`Add filter`]})]})}vo.displayName=`FilterBuilder`;function yo({field:e,value:t,multiple:n,onChange:r}){let s=a.useContext(i.SchemaRendererContext)?.dataSource??null,l=e.referenceTo||(e.type===`user`||e.type===`owner`?`users`:void 0),u=e.displayField||`name`,d=e.idField||`id`,[f,p]=a.useState(!1),[m,h]=a.useState(``),[g,_]=a.useState([]),[v,y]=a.useState(!1),[b,x]=a.useState(null),[S,C]=a.useState({}),w=a.useRef(null),T=a.useMemo(()=>n?ho(t).map(e=>String(e)):t==null||t===``?[]:[String(t)],[t,n]),E=s!=null&&typeof s.find==`function`&&!!l,D=a.useCallback(e=>{let t=e?.[d]??e?.id??e?._id,n=e?.[u]??e?.label??e?.name??String(t);return{value:t,label:String(n)}},[u,d]),O=a.useCallback(async e=>{if(E){y(!0),x(null);try{let t={$top:50};e&&e.trim()&&(t.$search=e.trim());let n=await s.find(l,t),r=(n?.data??n??[]).map(D);_(r),r.length>0&&C(e=>{let t={...e};for(let e of r)t[String(e.value)]=e.label;return t})}catch(e){x(e instanceof Error?e.message:String(e)),_([])}finally{y(!1)}}},[s,l,E,D]);a.useEffect(()=>{if(!E||T.length===0)return;let e=T.filter(e=>!(e in S));if(e.length===0)return;let t=!1;return(async()=>{try{let n=await s.find(l,{$top:e.length,$filter:{[d]:{$in:e}}}),r=n?.data??n??[];if(t)return;C(e=>{let t={...e};for(let e of r){let n=D(e);t[String(n.value)]=n.label}return t})}catch{}})(),()=>{t=!0}},[T,E,s,l,d,D,S]),a.useEffect(()=>{f&&E&&g.length===0&&O()},[f]);let k=e=>{h(e),E&&(w.current&&clearTimeout(w.current),w.current=setTimeout(()=>O(e||void 0),300))},A=e=>{if(n){let n=ho(t);r(n.map(String).includes(String(e))?n.filter(t=>String(t)!==String(e)):[...n,e])}else r(e),p(!1)};return E?(0,o.jsxs)(Er,{open:f,onOpenChange:p,children:[(0,o.jsx)(Dr,{asChild:!0,children:(0,o.jsxs)(`button`,{type:`button`,className:z(`inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm`,`hover:bg-accent hover:text-accent-foreground`,`focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1`),"data-testid":`lookup-picker-${e.value}`,children:[T.length===0?(0,o.jsxs)(`span`,{className:`text-muted-foreground truncate`,children:[`Search `,e.label,`…`]}):n?(0,o.jsx)(`span`,{className:`truncate`,children:T.length===1?S[T[0]]||T[0]:`${T.length} selected`}):(0,o.jsx)(`span`,{className:`truncate`,children:S[T[0]]||T[0]}),(0,o.jsxs)(`span`,{className:`flex items-center gap-1 shrink-0`,children:[T.length>0&&(0,o.jsx)(c.X,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`,onClick:e=>{e.stopPropagation(),r(n?[]:``)}}),(0,o.jsx)(c.ChevronDown,{className:`h-3.5 w-3.5 opacity-60`})]})]})}),(0,o.jsxs)(Or,{align:`start`,className:`w-72 p-0`,children:[(0,o.jsxs)(`div`,{className:`flex items-center border-b px-3`,children:[(0,o.jsx)(c.Search,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,o.jsx)(`input`,{autoFocus:!0,value:m,onChange:e=>k(e.target.value),placeholder:`Search ${e.label}…`,className:`flex h-9 w-full bg-transparent px-2 py-1 text-sm outline-none placeholder:text-muted-foreground`,"data-testid":`lookup-search-${e.value}`}),v&&(0,o.jsx)(c.Loader2,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`})]}),(0,o.jsxs)(`div`,{className:`max-h-64 overflow-y-auto p-1`,"data-testid":`lookup-options-${e.value}`,children:[b&&(0,o.jsx)(`div`,{className:`px-3 py-2 text-xs text-destructive`,children:b}),!b&&!v&&g.length===0&&(0,o.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:`No results`}),g.map(e=>{let t=T.includes(String(e.value));return(0,o.jsxs)(`label`,{className:z(`flex items-center gap-2 px-2 py-1.5 rounded text-sm cursor-pointer`,t?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[n?(0,o.jsx)(bt,{checked:t,onCheckedChange:()=>A(e.value)}):(0,o.jsx)(`input`,{type:`radio`,checked:t,onChange:()=>A(e.value),className:`rounded-full border-input`}),(0,o.jsx)(`span`,{className:`truncate flex-1`,children:e.label})]},String(e.value))})]})]})]}):(0,o.jsx)(K,{className:`h-9 text-sm`,placeholder:`Enter ${e.label} id`,value:T[0]??``,onChange:e=>r(e.target.value)})}function bo({fields:e=[],value:t=[],onChange:n,className:r}){let i=a.useCallback(e=>(e||[]).map((e,t)=>({id:e?.id??(typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`sort-${t}-${e?.field??``}`),field:e?.field??``,order:e?.order??e?.sortOrder??`asc`})),[]),[s,l]=a.useState(()=>i(t));a.useEffect(()=>{let e=i(t),n=e=>e.map(({id:e,...t})=>t);JSON.stringify(n(e))!==JSON.stringify(n(s))&&l(e)},[t,s,i]);let u=e=>{l(e),n?.(e)},d=()=>{let t={id:crypto.randomUUID(),field:e[0]?.value||``,order:`asc`};u([...s,t])},f=(e,t)=>{u(s.map(n=>n.id===e?{...n,...t}:n))},p=e=>{u(s.filter(t=>t.id!==e))};return(0,o.jsxs)(`div`,{className:z(`space-y-3`,r),children:[(0,o.jsx)(`div`,{className:`space-y-2`,children:s.map((t,n)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-medium w-16 text-muted-foreground`,children:n===0?`Sort by`:`Then by`}),(0,o.jsx)(`div`,{className:`flex-1`,children:(0,o.jsxs)(Lr,{value:t.field,onValueChange:e=>f(t.id,{field:e}),children:[(0,o.jsx)(J,{className:`h-9`,children:(0,o.jsx)(q,{placeholder:`Select field`})}),(0,o.jsx)(Y,{children:e.map(e=>(0,o.jsx)(X,{value:e.value,children:e.label},e.value))})]})}),(0,o.jsx)(`div`,{className:`w-28`,children:(0,o.jsxs)(Lr,{value:t.order,onValueChange:e=>f(t.id,{order:e}),children:[(0,o.jsx)(J,{className:`h-9`,children:(0,o.jsx)(q,{})}),(0,o.jsxs)(Y,{children:[(0,o.jsx)(X,{value:`asc`,children:`A -> Z`}),(0,o.jsx)(X,{value:`desc`,children:`Z -> A`})]})]})}),(0,o.jsx)(U,{variant:`ghost`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:()=>p(t.id),children:(0,o.jsx)(c.X,{className:`h-4 w-4`})})]},t.id))}),(0,o.jsxs)(U,{variant:`outline`,size:`sm`,onClick:d,className:`h-8`,disabled:e.length===0,children:[(0,o.jsx)(c.Plus,{className:`h-3 w-3 mr-2`}),`Add sort`]})]})}function xo({field:e,value:t,onChange:n,draft:r,objectDef:i}){if(e.visibleWhen&&!e.visibleWhen(r))return null;let a=e.disabled||(e.disabledWhen?e.disabledWhen(r):!1),s=t??e.defaultValue,l=null;switch(e.type){case`input`:l=(0,o.jsx)(no,{label:e.label,children:(0,o.jsx)(K,{"data-testid":`config-field-${e.key}`,className:`h-7 w-32 text-xs`,value:s??``,placeholder:e.placeholder,disabled:a,onChange:e=>n(e.target.value)})});break;case`textarea`:l=(0,o.jsx)(no,{label:e.label,className:`flex-col items-stretch gap-1`,children:(0,o.jsx)(ea,{"data-testid":`config-field-${e.key}`,className:`min-h-[60px] w-full text-xs`,value:s??``,placeholder:e.placeholder,disabled:a,rows:3,onChange:e=>n(e.target.value)})});break;case`switch`:l=(0,o.jsx)(no,{label:e.label,children:(0,o.jsx)(Vi,{"data-testid":`config-field-${e.key}`,checked:!!s,disabled:a,onCheckedChange:e=>n(e),className:`scale-75`})});break;case`checkbox`:l=(0,o.jsx)(no,{label:e.label,children:(0,o.jsx)(bt,{"data-testid":`config-field-${e.key}`,checked:!!s,disabled:a,onCheckedChange:e=>n(e)})});break;case`select`:l=(0,o.jsx)(no,{label:e.label,children:(0,o.jsxs)(Lr,{value:String(s??``),onValueChange:e=>n(e),disabled:a,children:[(0,o.jsx)(J,{"data-testid":`config-field-${e.key}`,className:`h-7 w-32 text-xs`,children:(0,o.jsx)(q,{placeholder:e.placeholder??`Select…`})}),(0,o.jsx)(Y,{children:(e.options??[]).map(e=>(0,o.jsx)(X,{value:e.value,children:e.label},e.value))})]})});break;case`slider`:l=(0,o.jsx)(no,{label:e.label,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-2 w-32`,children:[(0,o.jsx)(zi,{"data-testid":`config-field-${e.key}`,value:[Number(s??e.min??0)],min:e.min??0,max:e.max??100,step:e.step??1,disabled:a,onValueChange:e=>n(e[0]),"aria-label":e.label}),(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground w-6 text-right`,children:s??e.min??0})]})});break;case`color`:l=(0,o.jsx)(no,{label:e.label,children:(0,o.jsx)(`input`,{"data-testid":`config-field-${e.key}`,type:`color`,className:`h-7 w-10 rounded border cursor-pointer`,value:s??`#000000`,disabled:a,onChange:e=>n(e.target.value)})});break;case`icon-group`:l=(0,o.jsx)(no,{label:e.label,children:(0,o.jsx)(`div`,{className:`flex items-center gap-0.5`,"data-testid":`config-field-${e.key}`,children:(e.options??[]).map(e=>(0,o.jsx)(U,{type:`button`,size:`sm`,variant:s===e.value?`default`:`ghost`,className:z(`h-7 w-7 p-0`,s===e.value&&`ring-1 ring-primary`),disabled:a,onClick:()=>n(e.value),title:e.label,children:e.icon??(0,o.jsx)(`span`,{className:`text-[10px]`,children:e.label.charAt(0)})},e.value))})});break;case`field-picker`:l=(0,o.jsx)(no,{label:e.label,value:s??e.placeholder??`Select field…`,onClick:a?void 0:()=>{}});break;case`filter`:l=(0,o.jsxs)(`div`,{"data-testid":`config-field-${e.key}`,children:[(0,o.jsx)(no,{label:e.label}),(0,o.jsx)(vo,{fields:e.fields,value:s,onChange:n,className:`px-1 pb-2`})]});break;case`sort`:l=(0,o.jsxs)(`div`,{"data-testid":`config-field-${e.key}`,children:[(0,o.jsx)(no,{label:e.label}),(0,o.jsx)(bo,{fields:e.fields,value:s,onChange:n,className:`px-1 pb-2`})]});break;case`custom`:e.render&&(l=(0,o.jsx)(o.Fragment,{children:e.render(s,n,r)}));break;case`summary`:l=(0,o.jsx)(no,{label:e.label,onClick:e.onSummaryClick,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,o.jsx)(`span`,{className:`text-xs text-foreground truncate max-w-[120px]`,"data-testid":`config-field-${e.key}-text`,children:e.summaryText??s??``}),e.onSummaryClick&&(0,o.jsx)(c.Settings,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`,"aria-hidden":`true`,"data-testid":`config-field-${e.key}-gear`})]})});break;default:break}return l?e.helpText?(0,o.jsxs)(`div`,{children:[l,(0,o.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5 mb-1`,children:e.helpText})]}):(0,o.jsx)(o.Fragment,{children:l}):null}function So({title:e,icon:t,collapsible:n,collapsed:r,onToggle:i,testId:a,className:s}){let l=(0,o.jsxs)(`h3`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider flex items-center gap-1.5`,children:[t&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0`,"aria-hidden":`true`,children:t}),e]});return n?(0,o.jsxs)(`button`,{"data-testid":a,className:z(`flex items-center justify-between pt-4 pb-1.5 first:pt-0 w-full text-left`,s),onClick:i,type:`button`,"aria-expanded":!r,children:[l,r?(0,o.jsx)(c.ChevronRight,{className:`h-3 w-3 text-muted-foreground`}):(0,o.jsx)(c.ChevronDown,{className:`h-3 w-3 text-muted-foreground`})]}):(0,o.jsx)(`div`,{className:z(`pt-4 pb-1.5 first:pt-0`,s),"data-testid":a,children:l})}function Co({open:e,onClose:t,schema:n,draft:r,isDirty:i,onFieldChange:s,onSave:l,onDiscard:u,headerExtra:d,objectDef:f,className:p,style:m,saveLabel:h=`Save`,discardLabel:g=`Discard`,panelRef:_,role:v,ariaLabel:y,tabIndex:b,testId:x,closeTitle:S,footerTestId:C,saveTestId:w,discardTestId:T,expandedSections:E,onUndo:D,onRedo:O,canUndo:k,canRedo:A,undoLabel:ee=`Undo`,redoLabel:j=`Redo`}){let[te,M]=(0,a.useState)({});if(!e)return null;let N=(e,t)=>{M(n=>({...n,[e]:!(n[e]??t??!1)}))},ne=(e,t)=>E&&E.includes(e)?!1:te[e]??t??!1;return(0,o.jsxs)(`div`,{ref:_,"data-testid":x??`config-panel`,role:v,"aria-label":y,tabIndex:b,style:m,className:z(`absolute inset-y-0 right-0 w-full sm:w-[var(--config-panel-width,280px)] sm:relative border-l bg-background flex flex-col shrink-0 z-20`,p),children:[(0,o.jsxs)(`div`,{className:`px-4 py-3 border-b flex items-center justify-between shrink-0`,children:[(0,o.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,o.jsx)(`ol`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:n.breadcrumb.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[t>0&&(0,o.jsx)(c.ChevronRight,{className:`h-3 w-3`}),(0,o.jsx)(`li`,{className:z(t===n.breadcrumb.length-1&&`text-foreground font-medium`),children:e})]},t))})}),(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[D&&(0,o.jsx)(U,{size:`sm`,variant:`ghost`,onClick:D,disabled:!k,className:`h-7 w-7 p-0`,"data-testid":`config-panel-undo`,title:ee,children:(0,o.jsx)(c.Undo2,{className:`h-3.5 w-3.5`})}),O&&(0,o.jsx)(U,{size:`sm`,variant:`ghost`,onClick:O,disabled:!A,className:`h-7 w-7 p-0`,"data-testid":`config-panel-redo`,title:j,children:(0,o.jsx)(c.Redo2,{className:`h-3.5 w-3.5`})}),d,(0,o.jsx)(U,{size:`sm`,variant:`ghost`,onClick:t,className:`h-7 w-7 p-0`,"data-testid":`config-panel-close`,title:S,children:(0,o.jsx)(c.X,{className:`h-3.5 w-3.5`})})]})]}),(0,o.jsx)(`div`,{className:`flex-1 overflow-auto px-4 pb-4`,children:n.sections.map((e,t)=>{if(e.visibleWhen&&!e.visibleWhen(r))return null;let n=ne(e.key,e.defaultCollapsed);return(0,o.jsxs)(`div`,{"data-testid":`config-section-${e.key}`,children:[t>0&&(0,o.jsx)(Ur,{className:`my-3`}),(0,o.jsx)(So,{title:e.title,icon:e.icon,collapsible:e.collapsible,collapsed:n,onToggle:()=>N(e.key,e.defaultCollapsed),testId:`section-header-${e.key}`}),e.hint&&(0,o.jsx)(`p`,{className:`text-[10px] text-muted-foreground mb-1`,children:e.hint}),!n&&(0,o.jsxs)(`div`,{className:`space-y-1`,children:[e.fields.map(e=>(0,o.jsx)(xo,{field:e,value:r[e.key],onChange:t=>s(e.key,t),draft:r,objectDef:f},e.key)),e.subsections?.map(e=>{if(e.visibleWhen&&!e.visibleWhen(r))return null;let t=ne(e.key,e.defaultCollapsed);return(0,o.jsxs)(`div`,{"data-testid":`config-subsection-${e.key}`,className:`ml-1`,role:`group`,"aria-label":e.title,children:[(0,o.jsx)(So,{title:e.title,icon:e.icon,collapsible:e.collapsible,collapsed:t,onToggle:()=>N(e.key,e.defaultCollapsed),testId:`section-header-${e.key}`,className:`pt-2 pb-1`}),!t&&(0,o.jsx)(`div`,{className:`space-y-1`,children:e.fields.map(e=>(0,o.jsx)(xo,{field:e,value:r[e.key],onChange:t=>s(e.key,t),draft:r,objectDef:f},e.key))})]},e.key)})]})]},e.key)})}),i&&(0,o.jsxs)(`div`,{className:`px-4 py-2 border-t flex gap-2 shrink-0`,"data-testid":C??`config-panel-footer`,children:[(0,o.jsxs)(U,{size:`sm`,onClick:l,"data-testid":w??`config-panel-save`,children:[(0,o.jsx)(c.Save,{className:`h-3.5 w-3.5 mr-1`}),h]}),(0,o.jsxs)(U,{size:`sm`,variant:`ghost`,onClick:u,"data-testid":T??`config-panel-discard`,children:[(0,o.jsx)(c.RotateCcw,{className:`h-3.5 w-3.5 mr-1`}),g]})]})]})}function wo({date:e,onDateChange:t,placeholder:n=`Pick a date`,className:r,disabled:i}){return(0,o.jsxs)(Er,{children:[(0,o.jsx)(Dr,{asChild:!0,children:(0,o.jsxs)(U,{variant:`outline`,className:z(`w-[280px] justify-start text-left font-normal`,!e&&`text-muted-foreground`,r),disabled:i,children:[(0,o.jsx)(c.CalendarIcon,{className:`mr-2 h-4 w-4`}),e?(0,L.format)(e,`PPP`):(0,o.jsx)(`span`,{children:n})]})}),(0,o.jsx)(Or,{className:`w-auto p-0`,children:(0,o.jsx)(Ye,{mode:`single`,selected:e,onSelect:t,autoFocus:!0})})]})}function To(){try{let{t:e}=(0,le.useObjectTranslation)(),t=e(`detail.noValue`);return!t||t===`detail.noValue`?`No value`:t}catch{return`No value`}}function Eo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty`,className:z(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12`,e),...t})}function Do({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-header`,className:z(`flex max-w-sm flex-col items-center gap-2 text-center`,e),...t})}var Oo=(0,d.cva)(`flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6`}},defaultVariants:{variant:`default`}});function ko({className:e,variant:t=`default`,...n}){return(0,o.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:z(Oo({variant:t,className:e})),...n})}function Ao({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-title`,className:z(`text-lg font-medium tracking-tight`,e),...t})}function jo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-description`,className:z(`text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function Mo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-content`,className:z(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}function No({className:e,glyph:t=`—`,...n}){return(0,o.jsx)(`span`,{"data-slot":`empty-value`,"aria-label":To(),className:z(`select-none text-muted-foreground/50 no-underline pointer-events-none`,e),...n,children:t})}var Po=(0,d.cva)(`space-y-2`),Fo=a.forwardRef(({className:e,label:t,description:n,error:r,required:i,htmlFor:s,children:c,...l},d)=>{let f=a.useId(),p=s||f,m=`${p}-description`,h=`${p}-error`;return(0,o.jsxs)(`div`,{ref:d,className:z(Po(),e),...l,children:[t&&(0,o.jsx)(G,{htmlFor:p,className:z(r&&`text-destructive`,i&&`after:content-['*'] after:ml-0.5 after:text-destructive`),children:t}),(0,o.jsx)(u.Slot,{id:p,"aria-describedby":[n&&m,r&&h].filter(Boolean).join(` `)||void 0,"aria-invalid":!!r,children:c}),n&&!r&&(0,o.jsx)(`p`,{id:m,className:`text-[0.8rem] text-muted-foreground`,children:n}),r&&(0,o.jsx)(`p`,{id:h,className:`text-[0.8rem] font-medium text-destructive`,children:r})]})});Fo.displayName=`Field`;var Io=a.forwardRef(({className:e,startContent:t,endContent:n,children:r,...i},a)=>(0,o.jsxs)(`div`,{ref:a,className:z(`flex w-full items-center rounded-md border border-input bg-transparent ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2`,`has-[[data-invalid]]:border-destructive`,e),...i,children:[t&&(0,o.jsx)(`div`,{className:`flex items-center px-3 text-muted-foreground bg-muted/50 border-r h-full self-stretch rounded-l-md`,children:t}),(0,o.jsx)(`div`,{className:`flex-1 relative [&_input]:border-0 [&_input]:shadow-none [&_input]:focus-visible:ring-0 [&_input]:bg-transparent`,children:r}),n&&(0,o.jsx)(`div`,{className:`flex items-center px-3 text-muted-foreground bg-muted/50 border-l h-full self-stretch rounded-r-md`,children:n})]}));Io.displayName=`InputGroup`;function Lo({className:e,...t}){return(0,o.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:z(`group/item-group flex flex-col`,e),...t})}function Ro({className:e,...t}){return(0,o.jsx)(Ur,{"data-slot":`item-separator`,orientation:`horizontal`,className:z(`my-0`,e),...t})}var zo=(0,d.cva)(`group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,{variants:{variant:{default:`bg-transparent`,outline:`border-border`,muted:`bg-muted/50`},size:{default:`p-4 gap-4 `,sm:`py-3 px-4 gap-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function Bo({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,o.jsx)(r?u.Slot:`div`,{"data-slot":`item`,"data-variant":t,"data-size":n,className:z(zo({variant:t,size:n,className:e})),...i})}var Vo=(0,d.cva)(`flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5`,{variants:{variant:{default:`bg-transparent`,icon:`size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4`,image:`size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function Ho({className:e,variant:t=`default`,...n}){return(0,o.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:z(Vo({variant:t,className:e})),...n})}function Uo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-content`,className:z(`flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none`,e),...t})}function Wo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-title`,className:z(`flex w-fit items-center gap-2 text-sm leading-snug font-medium`,e),...t})}function Go({className:e,...t}){return(0,o.jsx)(`p`,{"data-slot":`item-description`,className:z(`text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function Ko({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-actions`,className:z(`flex items-center gap-2`,e),...t})}function qo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-header`,className:z(`flex basis-full items-center justify-between gap-2`,e),...t})}function Jo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-footer`,className:z(`flex basis-full items-center justify-between gap-2`,e),...t})}function Yo({className:e,...t}){return(0,o.jsx)(`kbd`,{"data-slot":`kbd`,className:z(`bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,e),...t})}function Xo({className:e,...t}){return(0,o.jsx)(`kbd`,{"data-slot":`kbd-group`,className:z(`inline-flex items-center gap-1`,e),...t})}var Zo=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(`select`,{className:z(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n,children:t}));Zo.displayName=`NativeSelect`;function Qo(e){if(e!=null)return typeof e==`number`?`${e}px`:e}function $o(e){let t=Qo(e);return t?{"--ov-w":t}:{}}var es=360,ts=.95;function ns(e){let[t,n]=a.default.useState(null),r=a.default.useRef(!1);return a.default.useEffect(()=>{if(!(!e||typeof window>`u`))try{let t=window.localStorage.getItem(`ov:${e}`);if(!t)return;let r=Number(t);Number.isFinite(r)&&r>=es&&n(r)}catch{}},[e]),{width:t,handleMouseDown:a.default.useCallback(t=>{if(!e||typeof window>`u`)return;t.preventDefault(),r.current=!0;let i=Math.floor(window.innerWidth*ts);document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let a=e=>{r.current&&n(Math.min(i,Math.max(es,window.innerWidth-e.clientX)))},o=()=>{r.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``,window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,o),n(t=>{if(t!=null)try{window.localStorage.setItem(`ov:${e}`,String(t))}catch{}return t})};window.addEventListener(`mousemove`,a),window.addEventListener(`mouseup`,o)},[e]),handleDoubleClick:a.default.useCallback(()=>{if(!(!e||typeof window>`u`)){n(null);try{window.localStorage.removeItem(`ov:${e}`)}catch{}}},[e]),enabled:!!e}}var rs=({isOpen:e,selectedRecord:t,mode:n,close:r,setIsOpen:i,width:a,view:s,title:l,description:u,className:d,children:f,renderView:p,mainContent:m,popoverTrigger:h,onExpand:g,expandLabel:_=`Open as full page`,storageKey:v})=>{if(n===`page`||n===`new_window`||n===`none`||!t)return null;let y=$o(a),b=l||`Record Detail`,x=ns(n===`drawer`?v:void 0),S=Qo(a)??`42rem`,C=x.width==null?{"--ov-w":`max(${S}, min(60vw, 880px))`}:{"--ov-w":`${x.width}px`},w=e=>p&&s?p(e,s):f(e);if(n===`drawer`)return(0,o.jsx)(Wr,{open:e,onOpenChange:i,children:(0,o.jsxs)(Xr,{side:`right`,className:z(`w-screen max-w-none sm:w-full sm:max-w-[var(--ov-w,42rem)] p-0 flex flex-col gap-0 overflow-hidden`,`[&>button:last-of-type]:hidden`,d),style:C,children:[x.enabled&&(0,o.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize drawer`,onMouseDown:x.handleMouseDown,onDoubleClick:x.handleDoubleClick,className:`hidden sm:block absolute left-0 top-0 bottom-0 z-30 w-1 cursor-col-resize bg-transparent hover:bg-primary/40 active:bg-primary/60 transition-colors`,style:{touchAction:`none`}}),(0,o.jsxs)(Zr,{className:`shrink-0 flex-row items-center justify-between gap-2 space-y-0 px-4 py-2 border-b bg-muted/30`,children:[(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)($r,{className:`truncate text-xs font-medium tracking-wide text-muted-foreground`,children:b}),u&&(0,o.jsx)(ei,{className:`truncate text-xs`,children:u})]}),(0,o.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[g&&(0,o.jsx)(`button`,{type:`button`,onClick:g,"aria-label":_,title:_,className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(c.Maximize2,{className:`h-3.5 w-3.5`})}),(0,o.jsx)(Kr,{asChild:!0,children:(0,o.jsx)(`button`,{type:`button`,"aria-label":`Close`,title:`Close`,className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(c.X,{className:`h-3.5 w-3.5`})})})]})]}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto`,children:w(t)})]})});if(n===`modal`)return(0,o.jsx)(wt,{open:e,onOpenChange:i,children:(0,o.jsxs)(kt,{className:z(`w-[calc(100vw-1rem)] max-w-none sm:max-w-[var(--ov-w,42rem)] max-h-[90vh] overflow-y-auto`,d),style:y,children:[g&&(0,o.jsx)(`button`,{type:`button`,onClick:g,"aria-label":_,title:_,className:`absolute right-12 top-4 z-10 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors`,children:(0,o.jsx)(c.Maximize2,{className:`h-4 w-4`})}),(0,o.jsxs)(At,{children:[(0,o.jsx)(Mt,{children:b}),u&&(0,o.jsx)(Nt,{children:u})]}),(0,o.jsx)(`div`,{className:`mt-4`,children:w(t)})]})});if(n===`split`){if(!e||!m)return null;let n=a&&typeof a==`number`?Math.min(70,Math.max(20,a/1200*100)):40,i=100-n;return(0,o.jsxs)(Mr,{direction:`horizontal`,className:z(`h-full`,d),children:[(0,o.jsx)(Nr,{defaultSize:i,minSize:30,children:m}),(0,o.jsx)(Pr,{withHandle:!0}),(0,o.jsx)(Nr,{defaultSize:n,minSize:20,children:(0,o.jsxs)(`div`,{className:`h-full overflow-y-auto p-4`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,o.jsx)(`h3`,{className:`text-lg font-semibold`,children:b}),(0,o.jsx)(`button`,{onClick:r,className:`rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,"aria-label":`Close panel`,children:(0,o.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,o.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,o.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),u&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:u}),w(t)]})})]})}return n===`popover`?h?(0,o.jsxs)(Er,{open:e,onOpenChange:i,children:[h&&(0,o.jsx)(Dr,{asChild:!0,children:h}),(0,o.jsx)(Or,{className:z(`w-96 max-h-[400px] overflow-y-auto p-4`,d),style:y,children:(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsx)(`h4`,{className:`text-sm font-semibold`,children:b}),u&&(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u}),w(t)]})})]}):e?(0,o.jsx)(wt,{open:e,onOpenChange:i,children:(0,o.jsxs)(kt,{className:z(`w-96 max-h-[80vh] overflow-y-auto p-4`,d),style:y,children:[(0,o.jsxs)(At,{children:[(0,o.jsx)(Mt,{className:`text-sm`,children:b}),u&&(0,o.jsx)(Nt,{className:`text-xs`,children:u})]}),(0,o.jsx)(`div`,{className:`mt-2`,children:w(t)})]})}):null:null};rs.displayName=`NavigationOverlay`;function is({className:e,...t}){return(0,o.jsx)(`div`,{role:`status`,"aria-label":`Loading`,className:z(`flex items-center justify-center`,e),...t,children:(0,o.jsx)(c.Loader2,{className:`animate-spin text-muted-foreground w-full h-full min-w-4 min-h-4`})})}var as={addGroup:`Add group field`,collapseTitle:`Collapsed by default`,removeTitle:`Remove`,ascendingTitle:`Ascending`,descendingTitle:`Descending`};function os({value:e,onChange:t,fieldOptions:n,maxLevels:r=3,className:i,labels:a}){let s={...as,...a||{}},l=e?.fields??[],u=new Set(l.map(e=>e.field)),d=e=>{t(e.length?{fields:e}:void 0)};return(0,o.jsxs)(`div`,{"data-testid":`grouping-editor`,className:z(`flex flex-col gap-1.5 w-full`,i),children:[l.map((e,t)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,o.jsx)(`select`,{"data-testid":`grouping-field-${t}`,className:`text-xs h-7 rounded-md border border-input bg-background px-2 text-foreground flex-1 min-w-0`,value:e.field,onChange:n=>{let r=[...l];r[t]={...e,field:n.target.value},d(r)},children:n.filter(t=>t.value===e.field||!u.has(t.value)).map(e=>(0,o.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,o.jsx)(`button`,{type:`button`,title:e.order===`asc`?s.ascendingTitle:s.descendingTitle,"data-testid":`grouping-order-${t}`,className:`flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background text-foreground hover:bg-muted`,onClick:()=>{let n=[...l];n[t]={...e,order:e.order===`asc`?`desc`:`asc`},d(n)},children:e.order===`asc`?(0,o.jsx)(c.ArrowUp,{className:`h-3 w-3`}):(0,o.jsx)(c.ArrowDown,{className:`h-3 w-3`})}),(0,o.jsx)(`label`,{title:s.collapseTitle,className:`flex items-center text-xs text-muted-foreground`,children:(0,o.jsx)(`input`,{type:`checkbox`,"data-testid":`grouping-collapsed-${t}`,className:`h-3 w-3`,checked:e.collapsed,onChange:n=>{let r=[...l];r[t]={...e,collapsed:n.target.checked},d(r)}})}),(0,o.jsx)(`button`,{type:`button`,title:s.removeTitle,"data-testid":`grouping-remove-${t}`,className:`flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background text-muted-foreground hover:bg-muted hover:text-destructive`,onClick:()=>{d(l.filter((e,n)=>n!==t))},children:(0,o.jsx)(c.X,{className:`h-3 w-3`})})]},t)),l.length<r&&(()=>{let e=n.filter(e=>!u.has(e.value));return e.length===0?null:(0,o.jsxs)(`button`,{type:`button`,"data-testid":`grouping-add`,className:`flex h-7 items-center gap-1 self-start rounded-md border border-dashed border-input bg-background px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:()=>{d([...l,{field:e[0].value,order:`asc`,collapsed:!1}])},children:[(0,o.jsx)(c.Plus,{className:`h-3 w-3`}),s.addGroup]})})()]})}var ss=({params:e,open:t,onSubmit:n,onCancel:r,title:i=`Action Parameters`,description:s=`Please provide the required parameters.`})=>{let[c,l]=(0,a.useState)(()=>{let t={};return e.forEach(e=>{e.defaultValue===void 0?t[e.name]=e.type===`boolean`?!1:``:t[e.name]=e.defaultValue}),t}),[u,d]=(0,a.useState)({}),f=(0,a.useCallback)((e,t)=>{l(n=>({...n,[e]:t})),d(t=>{let n={...t};return delete n[e],n})},[]),p=(0,a.useCallback)(()=>{let t={};if(e.forEach(e=>{if(e.required){let n=c[e.name];(n==null||n===``)&&(t[e.name]=`${e.label} is required`)}}),Object.keys(t).length>0){d(t);return}n(c)},[e,c,n]);return(0,o.jsx)(wt,{open:t,onOpenChange:e=>{e||r()},children:(0,o.jsxs)(kt,{className:`sm:max-w-[425px]`,children:[(0,o.jsxs)(At,{children:[(0,o.jsx)(Mt,{children:i}),(0,o.jsx)(Nt,{children:s})]}),(0,o.jsx)(`div`,{className:`space-y-4 py-4`,children:e.map(e=>{let t=c[e.name],n=u[e.name];switch(e.type){case`textarea`:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsx)(ea,{id:e.name,value:t||``,onChange:t=>f(e.name,t.target.value),placeholder:e.placeholder}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name);case`number`:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsx)(K,{id:e.name,type:`number`,value:t??``,onChange:t=>f(e.name,Number.isNaN(t.target.valueAsNumber)?``:t.target.valueAsNumber),placeholder:e.placeholder}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name);case`boolean`:return(0,o.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,o.jsx)(bt,{id:e.name,checked:!!t,onCheckedChange:t=>f(e.name,!!t)}),(0,o.jsx)(G,{htmlFor:e.name,children:e.label}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground ml-2`,children:e.helpText})]},e.name);case`select`:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsxs)(Lr,{value:t||``,onValueChange:t=>f(e.name,t),children:[(0,o.jsx)(J,{children:(0,o.jsx)(q,{placeholder:e.placeholder||`Select...`})}),(0,o.jsx)(Y,{children:e.options?.map(e=>(0,o.jsx)(X,{value:e.value,children:e.label},e.value))})]}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name);case`date`:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsx)(K,{id:e.name,type:`date`,value:t||``,onChange:t=>f(e.name,t.target.value)}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name);default:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsx)(K,{id:e.name,type:`text`,value:t||``,onChange:t=>f(e.name,t.target.value),placeholder:e.placeholder}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name)}})}),(0,o.jsxs)(jt,{children:[(0,o.jsx)(U,{variant:`outline`,onClick:r,children:`Cancel`}),(0,o.jsx)(U,{onClick:p,children:`Continue`})]})]})})};ss.displayName=`ActionParamDialog`;function cs({rows:e=5,columns:t=4,className:n,...r}){return(0,o.jsxs)(`div`,{"data-slot":`grid-skeleton`,className:z(`w-full space-y-2`,n),...r,children:[(0,o.jsx)(`div`,{className:`flex gap-4 px-4 py-2`,children:Array.from({length:t}).map((e,t)=>(0,o.jsx)(Z,{className:`h-4 flex-1 rounded`},t))}),Array.from({length:e}).map((e,n)=>(0,o.jsx)(`div`,{className:`flex gap-4 rounded-md border px-4 py-3`,children:Array.from({length:t}).map((e,t)=>(0,o.jsx)(Z,{className:z(`h-4 flex-1 rounded`,t===0&&`max-w-[40%]`)},t))},n))]})}function ls({columns:e=3,cardsPerColumn:t=3,className:n,...r}){return(0,o.jsx)(`div`,{"data-slot":`kanban-skeleton`,className:z(`flex gap-4 overflow-x-auto`,n),...r,children:Array.from({length:e}).map((e,n)=>(0,o.jsxs)(`div`,{className:`flex w-72 shrink-0 flex-col gap-3 rounded-lg border bg-muted/30 p-3`,children:[(0,o.jsx)(Z,{className:`h-5 w-24 rounded`}),Array.from({length:t}).map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-2 rounded-md border bg-background p-3`,children:[(0,o.jsx)(Z,{className:`h-4 w-3/4 rounded`}),(0,o.jsx)(Z,{className:`h-3 w-1/2 rounded`})]},t))]},n))})}function us({rows:e=4,className:t,...n}){return(0,o.jsxs)(`div`,{"data-slot":`form-skeleton`,className:z(`w-full max-w-lg space-y-6`,t),...n,children:[Array.from({length:e}).map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsx)(Z,{className:`h-4 w-28 rounded`}),(0,o.jsx)(Z,{className:`h-9 w-full rounded-md`})]},t)),(0,o.jsx)(Z,{className:`h-9 w-24 rounded-md`})]})}function ds({rows:e=5,className:t,...n}){return(0,o.jsx)(`div`,{"data-slot":`list-skeleton`,className:z(`w-full space-y-3`,t),...n,children:Array.from({length:e}).map((e,t)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border px-4 py-3`,children:[(0,o.jsx)(Z,{className:`size-8 shrink-0 rounded-full`}),(0,o.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,o.jsx)(Z,{className:`h-4 w-3/5 rounded`}),(0,o.jsx)(Z,{className:`h-3 w-2/5 rounded`})]})]},t))})}function fs({className:e,...t}){return(0,o.jsxs)(`div`,{"data-slot":`chart-skeleton`,className:z(`w-full space-y-4`,e),...t,children:[(0,o.jsx)(Z,{className:`h-5 w-40 rounded`}),(0,o.jsx)(`div`,{className:`flex h-48 items-end gap-2 rounded-md border p-4`,children:[`h-2/5`,`h-3/5`,`h-1/3`,`h-4/5`,`h-1/2`,`h-3/4`,`h-2/5`].map((e,t)=>(0,o.jsx)(Z,{className:z(`flex-1 rounded-t`,e)},t))}),(0,o.jsxs)(`div`,{className:`flex gap-4`,children:[(0,o.jsx)(Z,{className:`h-3 w-16 rounded`}),(0,o.jsx)(Z,{className:`h-3 w-16 rounded`}),(0,o.jsx)(Z,{className:`h-3 w-16 rounded`})]})]})}function ps({variant:e,...t}){switch(e){case`grid`:return(0,o.jsx)(cs,{...t});case`kanban`:return(0,o.jsx)(ls,{...t});case`form`:return(0,o.jsx)(us,{...t});case`list`:return(0,o.jsx)(ds,{...t});case`chart`:return(0,o.jsx)(fs,{...t})}}function ms({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`shimmer-skeleton`,className:z(`rounded-md bg-muted`,`motion-safe:bg-[linear-gradient(90deg,hsl(var(--muted))_0%,hsl(var(--muted-foreground)/0.12)_50%,hsl(var(--muted))_100%)]`,`motion-safe:bg-[length:200%_100%] motion-safe:animate-shimmer`,e),...t})}var hs={"zh-CN":{addToFavorites:`加入收藏`,removeFromFavorites:`从收藏移除`,copyRecordId:`复制记录 ID`,copied:`已复制`},"zh-TW":{addToFavorites:`加入收藏`,removeFromFavorites:`從收藏移除`,copyRecordId:`複製記錄 ID`,copied:`已複製`}},gs=()=>{if(typeof document<`u`){let e=document.documentElement?.lang;if(e)return e}return typeof navigator<`u`&&navigator.language?navigator.language:`en`},_s=(e,t)=>{let n=gs(),r=hs[n],i=n.split(`-`)[0],a=r||(i===`zh`?hs[`zh-CN`]:void 0);return a&&a[e]||t},vs=({title:e,icon:t,objectLabel:n,resourceId:r,showStar:i=!0,showCopyId:s=!0,isFavorite:l,onToggleFavorite:u,className:d,inlineExtras:f})=>{let[p,m]=a.default.useState(!1),[h,g]=a.default.useState(!1),_=l??p,v=a.default.useCallback(()=>{let e=!_;u&&u(e),l===void 0&&m(e)},[_,l,u]),y=a.default.useCallback(()=>{if(r)try{typeof navigator<`u`&&navigator.clipboard&&navigator.clipboard.writeText(r),g(!0),setTimeout(()=>g(!1),1500)}catch{}},[r]),b=_?_s(`removeFromFavorites`,`Remove from favourites`):_s(`addToFavorites`,`Add to favourites`),x=h?_s(`copied`,`Copied`):_s(`copyRecordId`,`Copy record ID`);return(0,o.jsx)(ri,{children:(0,o.jsx)(`div`,{className:z(`flex flex-col min-w-0`,d),children:(0,o.jsxs)(`div`,{className:`flex items-baseline gap-2 flex-wrap`,children:[t&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0 self-center`,"aria-hidden":!0,children:t}),(0,o.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold truncate`,children:e}),n&&(0,o.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground/70 shrink-0`,children:n}),s&&r&&(0,o.jsxs)(ii,{children:[(0,o.jsx)(ai,{asChild:!0,children:(0,o.jsx)(U,{variant:`ghost`,size:`icon`,className:`h-5 w-5 shrink-0 text-muted-foreground/50 hover:text-foreground`,onClick:y,"aria-label":x,children:h?(0,o.jsx)(c.Check,{className:`h-3 w-3 text-green-600`}):(0,o.jsx)(c.Copy,{className:`h-3 w-3`})})}),(0,o.jsx)(oi,{children:x})]}),i&&(0,o.jsxs)(ii,{children:[(0,o.jsx)(ai,{asChild:!0,children:(0,o.jsx)(U,{variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:v,"aria-label":b,"aria-pressed":_,children:(0,o.jsx)(c.Star,{className:z(`h-4 w-4`,_?`fill-yellow-400 text-yellow-400`:`text-muted-foreground`)})})}),(0,o.jsx)(oi,{children:b})]}),f]})})})},ys=!1;function bs(){if(ys||typeof document>`u`)return;let e=`objui-refresh-indicator-kf`;if(document.getElementById(e)){ys=!0;return}let t=document.createElement(`style`);t.id=e,t.textContent=`
|
|
13
|
+
`)}}):null},gt=g.Tooltip,_t=a.forwardRef(({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:s=!1,label:c,labelFormatter:l,labelClassName:u,formatter:d,color:f,nameKey:p,labelKey:m},h)=>{let{config:g}=pt(),_=a.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=bt(g,e,`${m||e?.dataKey||e?.name||`value`}`),r=!m&&typeof c==`string`?g[c]?.label||c:n?.label;return l?(0,o.jsx)(`div`,{className:z(`font-medium`,u),children:l(r,t)}):r?(0,o.jsx)(`div`,{className:z(`font-medium`,u),children:r}):null},[c,l,t,i,u,g,m]);if(!e||!t?.length)return null;let v=t.length===1&&r!==`dot`;return(0,o.jsxs)(`div`,{ref:h,className:z(`grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl`,n),children:[v?null:_,(0,o.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=bt(g,e,`${p||e.name||e.dataKey||`value`}`),i=f||e.payload.fill||e.color;return(0,o.jsx)(`div`,{className:z(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,r===`dot`&&`items-center`),children:d&&e?.value!==void 0&&e.name?d(e.value,e.name,e,t,e.payload):(0,o.jsxs)(o.Fragment,{children:[n?.icon?(0,o.jsx)(n.icon,{}):!s&&(0,o.jsx)(`div`,{className:z(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":r===`dot`,"w-1":r===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":r===`dashed`,"my-0.5":v&&r===`dashed`}),style:{"--color-bg":i,"--color-border":i}}),(0,o.jsxs)(`div`,{className:z(`flex flex-1 justify-between leading-none`,v?`items-end`:`items-center`),children:[(0,o.jsxs)(`div`,{className:`grid gap-1.5`,children:[v?_:null,(0,o.jsx)(`span`,{className:`text-muted-foreground`,children:n?.label||e.name})]}),e.value&&(0,o.jsx)(`span`,{className:`font-mono font-medium tabular-nums text-foreground`,children:e.value.toLocaleString()})]})]})},e.dataKey)})})]})});_t.displayName=`ChartTooltip`;var vt=g.Legend,yt=a.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r=`bottom`,nameKey:i},a)=>{let{config:s}=pt();return n?.length?(0,o.jsx)(`div`,{ref:a,className:z(`flex items-center justify-center gap-4`,r===`top`?`pb-3`:`pt-3`,e),children:n.filter(e=>e.type!==`none`).map(e=>{let n=bt(s,e,`${i||e.dataKey||`value`}`);return(0,o.jsxs)(`div`,{className:z(`flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground`),children:[n?.icon&&!t?(0,o.jsx)(n.icon,{}):(0,o.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),n?.label]},e.value)})}):null});yt.displayName=`ChartLegend`;function bt(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}var xt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(_.Root,{ref:n,className:z(`grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,e),...t,children:(0,o.jsx)(_.Indicator,{className:z(`grid place-content-center text-current`),children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}));xt.displayName=_.Root.displayName;var St=v.Root,Ct=v.CollapsibleTrigger,wt=v.CollapsibleContent,Tt=b.Root,Et=b.Trigger,Dt=b.Portal,Ot=b.Close,kt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Overlay,{ref:n,className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));kt.displayName=b.Overlay.displayName;var At=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(Dt,{children:[(0,o.jsx)(kt,{}),(0,o.jsxs)(b.Content,{ref:r,className:z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,o.jsxs)(b.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,o.jsx)(c.X,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));At.displayName=b.Content.displayName;var jt=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});jt.displayName=`DialogHeader`;var Mt=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Mt.displayName=`DialogFooter`;var Nt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Title,{ref:n,className:z(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Nt.displayName=b.Title.displayName;var Pt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Description,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));Pt.displayName=b.Description.displayName;var Ft=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command,{ref:n,className:z(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));Ft.displayName=y.Command.displayName;var It=({children:e,contentProps:t,title:n=`Command Palette`,description:r,...i})=>{let{className:a,...s}=t??{};return(0,o.jsx)(Tt,{...i,children:(0,o.jsxs)(At,{className:z(`overflow-hidden p-0 shadow-lg`,a),...s,children:[(0,o.jsx)(Nt,{className:`sr-only`,children:n}),r?(0,o.jsx)(Pt,{className:`sr-only`,children:r}):null,(0,o.jsx)(Ft,{className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:e})]})})},Lt=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,o.jsx)(c.Search,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,o.jsx)(y.Command.Input,{ref:n,className:z(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));Lt.displayName=y.Command.Input.displayName;var Rt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command.List,{ref:n,className:z(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));Rt.displayName=y.Command.List.displayName;var zt=a.forwardRef((e,t)=>(0,o.jsx)(y.Command.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));zt.displayName=y.Command.Empty.displayName;var Bt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command.Group,{ref:n,className:z(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));Bt.displayName=y.Command.Group.displayName;var Vt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command.Separator,{ref:n,className:z(`-mx-1 h-px bg-border`,e),...t}));Vt.displayName=y.Command.Separator.displayName;var Ht=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(y.Command.Item,{ref:n,className:z(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...t}));Ht.displayName=y.Command.Item.displayName;var Ut=({className:e,...t})=>(0,o.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});Ut.displayName=`CommandShortcut`;var Wt=x.Root,Gt=x.Trigger,Kt=x.Group,qt=x.Portal,Jt=x.Sub,Yt=x.RadioGroup,Xt=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(x.SubTrigger,{ref:i,className:z(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(c.ChevronRight,{className:`ml-auto h-4 w-4`})]}));Xt.displayName=x.SubTrigger.displayName;var Zt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.SubContent,{ref:n,className:z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin)`,e),...t}));Zt.displayName=x.SubContent.displayName;var Qt=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Portal,{children:(0,o.jsx)(x.Content,{ref:n,className:z(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin)`,e),...t})}));Qt.displayName=x.Content.displayName;var $t=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(x.Item,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));$t.displayName=x.Item.displayName;var en=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(x.CheckboxItem,{ref:i,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(x.ItemIndicator,{children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}),t]}));en.displayName=x.CheckboxItem.displayName;var tn=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(x.RadioItem,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(x.ItemIndicator,{children:(0,o.jsx)(c.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));tn.displayName=x.RadioItem.displayName;var nn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(x.Label,{ref:r,className:z(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));nn.displayName=x.Label.displayName;var rn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(x.Separator,{ref:n,className:z(`-mx-1 my-1 h-px bg-border`,e),...t}));rn.displayName=x.Separator.displayName;var an=({className:e,...t})=>(0,o.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});an.displayName=`ContextMenuShortcut`;var on=({shouldScaleBackground:e=!0,...t})=>(0,o.jsx)(S.Drawer.Root,{shouldScaleBackground:e,...t});on.displayName=`Drawer`;var sn=S.Drawer.Trigger,cn=S.Drawer.Portal,ln=S.Drawer.Close,un=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Drawer.Overlay,{ref:n,className:z(`fixed inset-0 z-50 bg-black/80`,e),...t}));un.displayName=S.Drawer.Overlay.displayName;var dn=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(cn,{children:[(0,o.jsx)(un,{}),(0,o.jsxs)(S.Drawer.Content,{ref:r,className:z(`fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background`,e),...n,children:[(0,o.jsx)(`div`,{className:`mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted`}),t]})]}));dn.displayName=`DrawerContent`;var fn=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`grid gap-1.5 p-4 text-center sm:text-left`,e),...t});fn.displayName=`DrawerHeader`;var pn=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`mt-auto flex flex-col gap-2 p-4`,e),...t});pn.displayName=`DrawerFooter`;var mn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Drawer.Title,{ref:n,className:z(`text-lg font-semibold leading-none tracking-tight`,e),...t}));mn.displayName=S.Drawer.Title.displayName;var hn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(S.Drawer.Description,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));hn.displayName=S.Drawer.Description.displayName;var gn=C.Root,_n=C.Trigger,vn=C.Group,yn=C.Portal,bn=C.Sub,xn=C.RadioGroup,Sn=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(C.SubTrigger,{ref:i,className:z(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(c.ChevronRight,{className:`ml-auto`})]}));Sn.displayName=C.SubTrigger.displayName;var Cn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.SubContent,{ref:n,className:z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...t}));Cn.displayName=C.SubContent.displayName;var wn=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,o.jsx)(C.Portal,{children:(0,o.jsx)(C.Content,{ref:r,sideOffset:t,className:z(`z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...n})}));wn.displayName=C.Content.displayName;var Tn=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(C.Item,{ref:r,className:z(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));Tn.displayName=C.Item.displayName;var En=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(C.CheckboxItem,{ref:i,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(C.ItemIndicator,{children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}),t]}));En.displayName=C.CheckboxItem.displayName;var Dn=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(C.RadioItem,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(C.ItemIndicator,{children:(0,o.jsx)(c.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));Dn.displayName=C.RadioItem.displayName;var On=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(C.Label,{ref:r,className:z(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));On.displayName=C.Label.displayName;var kn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(C.Separator,{ref:n,className:z(`-mx-1 my-1 h-px bg-muted`,e),...t}));kn.displayName=C.Separator.displayName;var An=({className:e,...t})=>(0,o.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest opacity-60`,e),...t});An.displayName=`DropdownMenuShortcut`;var jn=(0,d.cva)(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),G=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(T.Root,{ref:n,className:z(jn(),e),...t}));G.displayName=T.Root.displayName;var Mn=w.FormProvider,Nn=a.createContext(null),Pn=({...e})=>(0,o.jsx)(Nn.Provider,{value:{name:e.name},children:(0,o.jsx)(w.Controller,{...e})}),Fn=()=>{let e=a.useContext(Nn),t=a.useContext(In),{getFieldState:n,formState:r}=(0,w.useFormContext)();if(!e)throw Error(`useFormField should be used within <FormField>`);if(!t)throw Error(`useFormField should be used within <FormItem>`);let i=n(e.name,r),{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},In=a.createContext(null),Ln=a.forwardRef(({className:e,...t},n)=>{let r=a.useId();return(0,o.jsx)(In.Provider,{value:{id:r},children:(0,o.jsx)(`div`,{ref:n,className:z(`space-y-2`,e),...t})})});Ln.displayName=`FormItem`;var Rn=a.forwardRef(({className:e,...t},n)=>{let{error:r,formItemId:i}=Fn();return(0,o.jsx)(G,{ref:n,className:z(r&&`text-destructive`,e),htmlFor:i,...t})});Rn.displayName=`FormLabel`;var zn=a.forwardRef(({...e},t)=>{let{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=Fn();return(0,o.jsx)(u.Slot,{ref:t,id:r,"aria-describedby":n?`${i} ${a}`:`${i}`,"aria-invalid":!!n,...e})});zn.displayName=`FormControl`;var Bn=a.forwardRef(({className:e,...t},n)=>{let{formDescriptionId:r}=Fn();return(0,o.jsx)(`p`,{ref:n,id:r,className:z(`text-sm text-muted-foreground`,e),...t})});Bn.displayName=`FormDescription`;var Vn=a.forwardRef(({className:e,children:t,...n},r)=>{let{error:i,formMessageId:a}=Fn(),s=i?String(i?.message??``):t;return s?(0,o.jsx)(`p`,{ref:r,id:a,className:z(`text-sm font-medium text-destructive`,e),...n,children:s}):null});Vn.displayName=`FormMessage`;var Hn=E.Root,Un=E.Trigger,Wn=a.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,o.jsx)(E.Content,{ref:i,align:t,sideOffset:n,className:z(`z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-hover-card-content-transform-origin)`,e),...r}));Wn.displayName=E.Content.displayName;var Gn=a.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,o.jsx)(D.OTPInput,{ref:r,containerClassName:z(`flex items-center gap-2 has-[:disabled]:opacity-50`,t),className:z(`disabled:cursor-not-allowed`,e),...n}));Gn.displayName=`InputOTP`;var Kn=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`flex items-center`,e),...t}));Kn.displayName=`InputOTPGroup`;var qn=a.forwardRef(({index:e,className:t,...n},r)=>{let{char:i,hasFakeCaret:s,isActive:c}=a.useContext(D.OTPInputContext).slots[e];return(0,o.jsxs)(`div`,{ref:r,className:z(`relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md`,c&&`z-10 ring-2 ring-ring ring-offset-background`,t),...n,children:[i,s&&(0,o.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,o.jsx)(`div`,{className:`h-4 w-px animate-caret-blink bg-foreground duration-1000`})})]})});qn.displayName=`InputOTPSlot`;var Jn=a.forwardRef(({...e},t)=>(0,o.jsx)(`div`,{ref:t,role:`separator`,...e,children:(0,o.jsx)(c.Dot,{})}));Jn.displayName=`InputOTPSeparator`;var K=a.forwardRef(({className:e,type:t,...n},r)=>(0,o.jsx)(`input`,{type:t,className:z(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));K.displayName=`Input`;function Yn({...e}){return(0,o.jsx)(O.Menu,{...e})}function Xn({...e}){return(0,o.jsx)(O.Group,{...e})}function Zn({...e}){return(0,o.jsx)(O.Portal,{...e})}function Qn({...e}){return(0,o.jsx)(O.RadioGroup,{...e})}function $n({...e}){return(0,o.jsx)(O.Sub,{"data-slot":`menubar-sub`,...e})}var er=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(O.Root,{ref:n,className:z(`flex h-10 items-center space-x-1 rounded-md border bg-background p-1`,e),...t}));er.displayName=O.Root.displayName;var tr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(O.Trigger,{ref:n,className:z(`flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,e),...t}));tr.displayName=O.Trigger.displayName;var nr=a.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,o.jsxs)(O.SubTrigger,{ref:i,className:z(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,o.jsx)(c.ChevronRight,{className:`ml-auto h-4 w-4`})]}));nr.displayName=O.SubTrigger.displayName;var rr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(O.SubContent,{ref:n,className:z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-menubar-content-transform-origin)`,e),...t}));rr.displayName=O.SubContent.displayName;var ir=a.forwardRef(({className:e,align:t=`start`,alignOffset:n=-4,sideOffset:r=8,...i},a)=>(0,o.jsx)(O.Portal,{children:(0,o.jsx)(O.Content,{ref:a,align:t,alignOffset:n,sideOffset:r,className:z(`z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-menubar-content-transform-origin)`,e),...i})}));ir.displayName=O.Content.displayName;var ar=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(O.Item,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));ar.displayName=O.Item.displayName;var or=a.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,o.jsxs)(O.CheckboxItem,{ref:i,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(O.ItemIndicator,{children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}),t]}));or.displayName=O.CheckboxItem.displayName;var sr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(O.RadioItem,{ref:r,className:z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(O.ItemIndicator,{children:(0,o.jsx)(c.Circle,{className:`h-2 w-2 fill-current`})})}),t]}));sr.displayName=O.RadioItem.displayName;var cr=a.forwardRef(({className:e,inset:t,...n},r)=>(0,o.jsx)(O.Label,{ref:r,className:z(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));cr.displayName=O.Label.displayName;var lr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(O.Separator,{ref:n,className:z(`-mx-1 my-1 h-px bg-muted`,e),...t}));lr.displayName=O.Separator.displayName;var ur=({className:e,...t})=>(0,o.jsx)(`span`,{className:z(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});ur.displayname=`MenubarShortcut`;var dr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(k.Root,{ref:r,className:z(`relative z-10 flex max-w-max flex-1 items-center justify-center`,e),...n,children:[t,(0,o.jsx)(vr,{})]}));dr.displayName=k.Root.displayName;var fr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(k.List,{ref:n,className:z(`group flex flex-1 list-none items-center justify-center space-x-1`,e),...t}));fr.displayName=k.List.displayName;var pr=k.Item,mr=(0,d.cva)(`group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent`),hr=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(k.Trigger,{ref:r,className:z(mr(),`group`,e),...n,children:[t,` `,(0,o.jsx)(c.ChevronDown,{className:`relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180`,"aria-hidden":`true`})]}));hr.displayName=k.Trigger.displayName;var gr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(k.Content,{ref:n,className:z(`left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto `,e),...t}));gr.displayName=k.Content.displayName;var _r=k.Link,vr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{className:z(`absolute left-0 top-full flex justify-center`),children:(0,o.jsx)(k.Viewport,{className:z(`origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]`,e),ref:n,...t})}));vr.displayName=k.Viewport.displayName;var yr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(k.Indicator,{ref:n,className:z(`top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in`,e),...t,children:(0,o.jsx)(`div`,{className:`relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md`})}));yr.displayName=k.Indicator.displayName;var br=({className:e,...t})=>(0,o.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,className:z(`mx-auto flex w-full justify-center`,e),...t});br.displayName=`Pagination`;var xr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,className:z(`flex flex-row items-center gap-1`,e),...t}));xr.displayName=`PaginationContent`;var Sr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,className:z(``,e),...t}));Sr.displayName=`PaginationItem`;var Cr=({className:e,isActive:t,size:n=`icon`,...r})=>(0,o.jsx)(`a`,{"aria-current":t?`page`:void 0,className:z(we({variant:t?`outline`:`ghost`,size:n}),e),...r});Cr.displayName=`PaginationLink`;var wr=({className:e,...t})=>(0,o.jsxs)(Cr,{"aria-label":`Go to previous page`,size:`default`,className:z(`gap-1 pl-2.5`,e),...t,children:[(0,o.jsx)(c.ChevronLeft,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:`Previous`})]});wr.displayName=`PaginationPrevious`;var Tr=({className:e,...t})=>(0,o.jsxs)(Cr,{"aria-label":`Go to next page`,size:`default`,className:z(`gap-1 pr-2.5`,e),...t,children:[(0,o.jsx)(`span`,{children:`Next`}),(0,o.jsx)(c.ChevronRight,{className:`h-4 w-4`})]});Tr.displayName=`PaginationNext`;var Er=({className:e,...t})=>(0,o.jsxs)(`span`,{"aria-hidden":!0,className:z(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,o.jsx)(c.MoreHorizontal,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`More pages`})]});Er.displayName=`PaginationEllipsis`;var Dr=A.Root,Or=A.Trigger,kr=a.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,o.jsx)(A.Portal,{children:(0,o.jsx)(A.Content,{ref:i,align:t,sideOffset:n,className:z(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)`,e),...r})}));kr.displayName=A.Content.displayName;var Ar=a.forwardRef(({className:e,value:t,...n},r)=>(0,o.jsx)(j.Root,{ref:r,className:z(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,o.jsx)(j.Indicator,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));Ar.displayName=j.Root.displayName;var jr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ee.Root,{className:z(`grid gap-2`,e),...t,ref:n}));jr.displayName=ee.Root.displayName;var Mr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(ee.Item,{ref:n,className:z(`aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,o.jsx)(ee.Indicator,{className:`flex items-center justify-center`,children:(0,o.jsx)(c.Circle,{className:`h-2.5 w-2.5 fill-current text-current`})})}));Mr.displayName=ee.Item.displayName;var Nr=({className:e,...t})=>(0,o.jsx)(te.Group,{className:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...t}),Pr=te.Panel,Fr=({withHandle:e,className:t,...n})=>(0,o.jsx)(te.Separator,{className:z(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90`,t),...n,children:e&&(0,o.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border`,children:(0,o.jsx)(c.GripVertical,{className:`h-2.5 w-2.5`})})}),Ir=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(M.Root,{ref:r,className:z(`relative overflow-hidden`,e),...n,children:[(0,o.jsx)(M.Viewport,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,o.jsx)(Lr,{}),(0,o.jsx)(M.Corner,{})]}));Ir.displayName=M.Root.displayName;var Lr=a.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,o.jsx)(M.ScrollAreaScrollbar,{ref:r,orientation:t,className:z(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,o.jsx)(M.ScrollAreaThumb,{className:`relative flex-1 rounded-full bg-border`})}));Lr.displayName=M.ScrollAreaScrollbar.displayName;var Rr=N.Root,zr=N.Group,Br=N.Value,q=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(N.Trigger,{ref:r,className:z(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,o.jsx)(N.Icon,{asChild:!0,children:(0,o.jsx)(c.ChevronDown,{className:`h-4 w-4 opacity-50`})})]}));q.displayName=N.Trigger.displayName;var Vr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(N.ScrollUpButton,{ref:n,className:z(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,o.jsx)(c.ChevronUp,{className:`h-4 w-4`})}));Vr.displayName=N.ScrollUpButton.displayName;var Hr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(N.ScrollDownButton,{ref:n,className:z(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,o.jsx)(c.ChevronDown,{className:`h-4 w-4`})}));Hr.displayName=N.ScrollDownButton.displayName;var J=a.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,o.jsx)(N.Portal,{children:(0,o.jsxs)(N.Content,{ref:i,className:z(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,o.jsx)(Vr,{}),(0,o.jsx)(N.Viewport,{className:z(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,o.jsx)(Hr,{})]})}));J.displayName=N.Content.displayName;var Ur=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(N.Label,{ref:n,className:z(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));Ur.displayName=N.Label.displayName;var Y=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(N.Item,{ref:r,className:z(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,o.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,o.jsx)(N.ItemIndicator,{children:(0,o.jsx)(c.Check,{className:`h-4 w-4`})})}),(0,o.jsx)(N.ItemText,{children:t})]}));Y.displayName=N.Item.displayName;var Wr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(N.Separator,{ref:n,className:z(`-mx-1 my-1 h-px bg-muted`,e),...t}));Wr.displayName=N.Separator.displayName;var Gr=a.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,o.jsx)(ne.Root,{ref:i,decorative:n,orientation:t,className:z(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));Gr.displayName=ne.Root.displayName;var Kr=b.Root,qr=b.Trigger,Jr=b.Close,Yr=b.Portal,Xr=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Overlay,{className:z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Xr.displayName=b.Overlay.displayName;var Zr=(0,d.cva)(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),Qr=a.forwardRef(({side:e=`right`,className:t,children:n,hideOverlay:r,...i},a)=>(0,o.jsxs)(Yr,{children:[!r&&(0,o.jsx)(Xr,{}),(0,o.jsxs)(b.Content,{ref:a,className:z(Zr({side:e}),t),...i,children:[n,(0,o.jsxs)(b.Close,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,o.jsx)(c.X,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Qr.displayName=b.Content.displayName;var $r=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});$r.displayName=`SheetHeader`;var ei=({className:e,...t})=>(0,o.jsx)(`div`,{className:z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});ei.displayName=`SheetFooter`;var ti=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Title,{ref:n,className:z(`text-lg font-semibold text-foreground`,e),...t}));ti.displayName=b.Title.displayName;var ni=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(b.Description,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));ni.displayName=b.Description.displayName;var ri=768;function ii(){let[e,t]=a.useState(void 0);return a.useEffect(()=>{let e=window.matchMedia(`(max-width: ${ri-1}px)`),n=()=>{t(window.innerWidth<ri)};return e.addEventListener(`change`,n),t(window.innerWidth<ri),()=>e.removeEventListener(`change`,n)},[]),!!e}function X({className:e,...t}){return(0,o.jsx)(`div`,{className:z(`animate-pulse rounded-md bg-muted`,e),...t})}var ai=re.Provider,oi=re.Root,si=re.Trigger,ci=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,o.jsx)(re.Content,{ref:r,sideOffset:t,className:z(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-tooltip-content-transform-origin)`,e),...n}));ci.displayName=re.Content.displayName;var li=`sidebar_state`,ui=3600*24*7,di=`16rem`,fi=`18rem`,pi=`3rem`,mi=`b`,hi=a.createContext(null);function gi(){let e=a.useContext(hi);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var _i=a.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:s,...c},l)=>{let u=ii(),[d,f]=a.useState(!1),[p,m]=a.useState(e),h=t??p,g=a.useCallback(e=>{let t=typeof e==`function`?e(h):e;n?n(t):m(t),document.cookie=`${li}=${t}; path=/; max-age=${ui}`},[n,h]),_=a.useCallback(()=>u?f(e=>!e):g(e=>!e),[u,g,f]);a.useEffect(()=>{let e=e=>{e.key===mi&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=h?`expanded`:`collapsed`,y=a.useMemo(()=>({state:v,open:h,setOpen:g,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:_}),[v,h,g,u,d,f,_]);return(0,o.jsx)(hi.Provider,{value:y,children:(0,o.jsx)(ai,{delayDuration:0,children:(0,o.jsx)(`div`,{style:{"--sidebar-width":di,"--sidebar-width-icon":pi,...i},className:z(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,r),ref:l,...c,children:s})})})});_i.displayName=`SidebarProvider`;var vi=a.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},s)=>{let{isMobile:c,state:l,openMobile:u,setOpenMobile:d}=gi();return n===`none`?(0,o.jsx)(`div`,{className:z(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),ref:s,...a,children:i}):c?(0,o.jsx)(Kr,{open:u,onOpenChange:d,...a,children:(0,o.jsxs)(Qr,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden data-[state=open]:duration-300 data-[state=open]:ease-out`,style:{"--sidebar-width":fi},side:e,children:[(0,o.jsxs)($r,{className:`sr-only`,children:[(0,o.jsx)(ti,{children:`Sidebar`}),(0,o.jsx)(ni,{children:`Displays the mobile sidebar.`})]}),(0,o.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,o.jsxs)(`div`,{ref:s,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":l,"data-collapsible":n,"data-variant":t,"data-side":e,children:[(0,o.jsx)(`div`,{className:z(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem)]`:`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,o.jsx)(`div`,{className:z(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[state=collapsed]:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem_+_2px)]`:`group-data-[state=collapsed]:group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,o.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:i})})]})});vi.displayName=`Sidebar`;var yi=a.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=gi();return(0,o.jsxs)(V,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:z(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,o.jsx)(c.PanelLeft,{}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});yi.displayName=`SidebarTrigger`;var bi=a.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=gi();return(0,o.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:z(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});bi.displayName=`SidebarRail`;var xi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`main`,{ref:n,className:z(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,e),...t}));xi.displayName=`SidebarInset`;var Si=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(K,{ref:n,"data-sidebar":`input`,className:z(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));Si.displayName=`SidebarInput`;var Ci=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:z(`flex flex-col gap-2 p-2`,e),...t}));Ci.displayName=`SidebarHeader`;var wi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:z(`flex flex-col gap-2 p-2`,e),...t}));wi.displayName=`SidebarFooter`;var Ti=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(Gr,{ref:n,"data-sidebar":`separator`,className:z(`mx-2 w-auto bg-sidebar-border`,e),...t}));Ti.displayName=`SidebarSeparator`;var Ei=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:z(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[state=collapsed]:group-data-[collapsible=icon]:overflow-hidden`,e),...t}));Ei.displayName=`SidebarContent`;var Di=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:z(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));Di.displayName=`SidebarGroup`;var Oi=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,o.jsx)(t?u.Slot:`div`,{ref:r,"data-sidebar":`group-label`,className:z(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:-mt-8 group-data-[state=collapsed]:group-data-[collapsible=icon]:opacity-0`,e),...n}));Oi.displayName=`SidebarGroupLabel`;var ki=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,o.jsx)(t?u.Slot:`button`,{ref:r,"data-sidebar":`group-action`,className:z(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...n}));ki.displayName=`SidebarGroupAction`;var Ai=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:z(`w-full text-sm`,e),...t}));Ai.displayName=`SidebarGroupContent`;var ji=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:z(`flex w-full min-w-0 flex-col gap-1`,e),...t}));ji.displayName=`SidebarMenu`;var Mi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:z(`group/menu-item relative`,e),...t}));Mi.displayName=`SidebarMenuItem`;var Ni=(0,d.cva)(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding,color,background-color] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground sidebar-menu-button-icon-mode [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm sidebar-menu-button-icon-mode-lg`}},defaultVariants:{variant:`default`,size:`default`}}),Pi=a.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...s},c)=>{let l=e?u.Slot:`button`,{isMobile:d,state:f}=gi(),p=(0,o.jsx)(l,{ref:c,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:z(Ni({variant:n,size:r}),a),...s});return i?(typeof i==`string`&&(i={children:i}),(0,o.jsxs)(oi,{children:[(0,o.jsx)(si,{asChild:!0,children:p}),(0,o.jsx)(ci,{side:`right`,align:`center`,hidden:f!==`collapsed`||d,...i})]})):p});Pi.displayName=`SidebarMenuButton`;var Fi=a.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,o.jsx)(t?u.Slot:`button`,{ref:i,"data-sidebar":`menu-action`,className:z(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));Fi.displayName=`SidebarMenuAction`;var Ii=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:z(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...t}));Ii.displayName=`SidebarMenuBadge`;var Li=a.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=a.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,o.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:z(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,o.jsx)(X,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,o.jsx)(X,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});Li.displayName=`SidebarMenuSkeleton`;var Ri=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:z(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,e),...t}));Ri.displayName=`SidebarMenuSub`;var zi=a.forwardRef(({...e},t)=>(0,o.jsx)(`li`,{ref:t,...e}));zi.displayName=`SidebarMenuSubItem`;var Bi=a.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,o.jsx)(e?u.Slot:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:z(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[state=collapsed]:group-data-[collapsible=icon]:hidden`,r),...i}));Bi.displayName=`SidebarMenuSubButton`;var Vi=a.forwardRef(({className:e,...t},n)=>(0,o.jsxs)(ie.Root,{ref:n,className:z(`relative flex w-full touch-none select-none items-center`,e),...t,children:[(0,o.jsx)(ie.Track,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,o.jsx)(ie.Range,{className:`absolute h-full bg-primary`})}),(0,o.jsx)(ie.Thumb,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,"aria-label":t[`aria-label`]})]}));Vi.displayName=ie.Root.displayName;var Hi=({...e})=>{let{theme:t=`system`}=(0,ae.useTheme)();return(0,o.jsx)(P.Toaster,{theme:t,className:`toaster group`,icons:{success:(0,o.jsx)(c.CircleCheck,{className:`h-4 w-4`}),info:(0,o.jsx)(c.Info,{className:`h-4 w-4`}),warning:(0,o.jsx)(c.TriangleAlert,{className:`h-4 w-4`}),error:(0,o.jsx)(c.OctagonX,{className:`h-4 w-4`}),loading:(0,o.jsx)(c.LoaderCircle,{className:`h-4 w-4 animate-spin`})},toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`}},...e})},Ui=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(oe.Root,{className:z(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...t,ref:n,children:(0,o.jsx)(oe.Thumb,{className:z(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));Ui.displayName=oe.Root.displayName;var Wi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,o.jsx)(`table`,{ref:n,className:z(`w-full caption-bottom text-sm`,e),...t})}));Wi.displayName=`Table`;var Gi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`thead`,{ref:n,className:z(`[&_tr]:border-b`,e),...t}));Gi.displayName=`TableHeader`;var Ki=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tbody`,{ref:n,className:z(`[&_tr:last-child]:border-0`,e),...t}));Ki.displayName=`TableBody`;var qi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tfoot`,{ref:n,className:z(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));qi.displayName=`TableFooter`;var Ji=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`tr`,{ref:n,className:z(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...t}));Ji.displayName=`TableRow`;var Yi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`th`,{ref:n,className:z(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t}));Yi.displayName=`TableHead`;var Xi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`td`,{ref:n,className:z(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t}));Xi.displayName=`TableCell`;var Zi=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`caption`,{ref:n,className:z(`mt-4 text-sm text-muted-foreground`,e),...t}));Zi.displayName=`TableCaption`;var Qi=se.Root,$i=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(se.List,{ref:n,className:z(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));$i.displayName=se.List.displayName;var ea=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(se.Trigger,{ref:n,className:z(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,e),...t}));ea.displayName=se.Trigger.displayName;var ta=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(se.Content,{ref:n,className:z(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));ta.displayName=se.Content.displayName;var na=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`textarea`,{className:z(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));na.displayName=`Textarea`;var ra=(0,d.cva)(`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-accent hover:text-accent-foreground`},size:{default:`h-10 px-3 min-w-10`,sm:`h-9 px-2.5 min-w-9`,lg:`h-11 px-5 min-w-11`}},defaultVariants:{variant:`default`,size:`default`}}),ia=a.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,o.jsx)(le.Root,{ref:i,className:z(ra({variant:t,size:n,className:e})),...r}));ia.displayName=le.Root.displayName;var aa=a.createContext({size:`default`,variant:`default`}),oa=a.forwardRef(({className:e,variant:t,size:n,children:r,...i},a)=>(0,o.jsx)(ce.Root,{ref:a,className:z(`flex items-center justify-center gap-1`,e),...i,children:(0,o.jsx)(aa.Provider,{value:{variant:t,size:n},children:r})}));oa.displayName=ce.Root.displayName;var sa=a.forwardRef(({className:e,children:t,variant:n,size:r,...i},s)=>{let c=a.useContext(aa);return(0,o.jsx)(ce.Item,{ref:s,className:z(ra({variant:c.variant||n,size:c.size||r}),e),...i,children:t})});sa.displayName=ce.Item.displayName;var ca=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h1`,{ref:n,className:z(`scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl`,e),...t}));ca.displayName=`TypographyH1`;var la=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h2`,{ref:n,className:z(`scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0`,e),...t}));la.displayName=`TypographyH2`;var ua=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h3`,{ref:n,className:z(`scroll-m-20 text-2xl font-semibold tracking-tight`,e),...t}));ua.displayName=`TypographyH3`;var da=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`h4`,{ref:n,className:z(`scroll-m-20 text-xl font-semibold tracking-tight`,e),...t}));da.displayName=`TypographyH4`;var fa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:z(`leading-7 [&:not(:first-child)]:mt-6`,e),...t}));fa.displayName=`TypographyP`;var pa=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`blockquote`,{ref:n,className:z(`mt-6 border-l-2 pl-6 italic`,e),...t}));pa.displayName=`TypographyBlockquote`;var ma=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`ul`,{ref:n,className:z(`my-6 ml-6 list-disc [&>li]:mt-2`,e),...t}));ma.displayName=`TypographyList`;var ha=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`code`,{ref:n,className:z(`relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold`,e),...t}));ha.displayName=`TypographyInlineCode`;var ga=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:z(`text-xl text-muted-foreground`,e),...t}));ga.displayName=`TypographyLead`;var _a=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,className:z(`text-lg font-semibold`,e),...t}));_a.displayName=`TypographyLarge`;var va=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`small`,{ref:n,className:z(`text-sm font-medium leading-none`,e),...t}));va.displayName=`TypographySmall`;var ya=a.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`p`,{ref:n,className:z(`text-sm text-muted-foreground`,e),...t}));ya.displayName=`TypographyMuted`;var ba=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n;return(0,o.jsx)(Gr,{ref:r,orientation:e.orientation,className:t,...c,"data-obj-id":i,"data-obj-type":a,style:s})});t.ComponentRegistry.register(`separator`,ba,{namespace:`ui`,label:`Separator`,inputs:[{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`],defaultValue:`horizontal`,label:`Orientation`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{orientation:`horizontal`,className:`my-2 sm:my-4`}}),t.ComponentRegistry.register(`image`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(`img`,{src:e.src,alt:e.alt||``,className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`Image`,icon:`image`,category:`basic`,inputs:[{name:`src`,type:`string`,label:`Source URL`},{name:`alt`,type:`string`,label:`Alt Text`},{name:`className`,type:`string`,label:`Classes`}],defaultProps:{className:`max-w-full h-auto`}});function xa(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}var Sa={Home:`House`},Ca=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...l}=n,u=xa(e.name),d=Sa[u]||u,f=c.icons[d];if(!f)return console.warn(`Icon "${e.name}" (lookup: "${u}"${d===u?``:` -> "${d}"`}) not found in lucide-react`),null;let p=e.size?{width:e.size,height:e.size}:void 0;return(0,o.jsx)(f,{ref:r,className:z(e.color,e.className,t),style:{...p,...s},...l,"data-obj-id":i,"data-obj-type":a})});Ca.displayName=`IconRenderer`,t.ComponentRegistry.register(`icon`,Ca,{namespace:`ui`,label:`Icon`,icon:`smile`,category:`basic`,inputs:[{name:`name`,type:`string`,label:`Icon Name`,defaultValue:`smile`},{name:`size`,type:`number`,label:`Size (px)`},{name:`color`,type:`string`,label:`Color Class`},{name:`className`,type:`string`,label:`CSS Class`}]}),t.ComponentRegistry.register(`html`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(`div`,{className:z(`prose prose-sm max-w-none dark:prose-invert`,t),dangerouslySetInnerHTML:{__html:e.html},...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`HTML Content`,inputs:[{name:`html`,type:`string`,label:`HTML`,description:`Raw HTML content`}]}),t.ComponentRegistry.register(`button-group`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(`div`,{className:z(`flex flex-wrap sm:inline-flex rounded-md shadow-sm`,e.className),role:`group`,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.buttons?.map((t,n)=>(0,o.jsx)(V,{variant:t.variant||e.variant,size:t.size||e.size,className:z(`rounded-none`,n===0&&`rounded-l-md`,n===(e.buttons?.length||0)-1&&`rounded-r-md`,n>0&&`-ml-px`,t.className),children:t.label},n))})},{namespace:`ui`,label:`Button Group`,inputs:[{name:`variant`,type:`enum`,enum:[`default`,`destructive`,`outline`,`secondary`,`ghost`,`link`],defaultValue:`default`,label:`Variant`},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`,`icon`],defaultValue:`default`,label:`Size`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{variant:`default`,size:`default`,buttons:[{label:`Left`},{label:`Middle`},{label:`Right`}]}}),t.ComponentRegistry.register(`pagination`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,onPageChange:a,...s}=t,c=e.currentPage||e.page||1,l=e.totalPages||1,u=(e,t)=>{t.preventDefault(),e!==c&&(e<1||e>l||a&&a(e))},d=()=>l<=7?Array.from({length:l},(e,t)=>t+1):c<=3?[1,2,3,4,5,-1,l]:c>=l-2?[1,-1,l-4,l-3,l-2,l-1,l]:[1,-1,c-1,c,c+1,-1,l];return(0,o.jsx)(br,{className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:i,children:(0,o.jsxs)(xr,{children:[(0,o.jsx)(Sr,{children:(0,o.jsx)(wr,{href:`#`,onClick:e=>u(c-1,e),className:c<=1?`pointer-events-none opacity-50`:`cursor-pointer`,"aria-disabled":c<=1})}),d().map((e,t)=>(0,o.jsx)(Sr,{children:e===-1?(0,o.jsx)(Er,{}):(0,o.jsx)(Cr,{href:`#`,isActive:e===c,onClick:t=>u(e,t),className:`cursor-pointer`,children:e})},t)),(0,o.jsx)(Sr,{children:(0,o.jsx)(Tr,{href:`#`,onClick:e=>u(c+1,e),className:c>=l?`pointer-events-none opacity-50`:`cursor-pointer`,"aria-disabled":c>=l})})]})})},{namespace:`ui`,label:`Pagination`,inputs:[{name:`currentPage`,type:`number`,label:`Current Page`,defaultValue:1},{name:`totalPages`,type:`number`,label:`Total Pages`,defaultValue:10},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{currentPage:1,totalPages:10}}),t.ComponentRegistry.register(`navigation-menu`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(dr,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:(0,o.jsx)(fr,{children:e.items?.map((e,t)=>(0,o.jsx)(pr,{children:e.children?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(hr,{children:e.label}),(0,o.jsx)(gr,{children:(0,o.jsx)(`ul`,{className:`grid w-full gap-3 p-4 sm:w-[400px] md:w-[500px] md:grid-cols-2 lg:w-[600px]`,children:e.children.map((e,t)=>(0,o.jsx)(`li`,{children:(0,o.jsx)(_r,{asChild:!0,children:(0,o.jsxs)(`a`,{className:z(`block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground`),href:e.href,children:[(0,o.jsx)(`div`,{className:`text-sm font-medium leading-none`,children:e.label}),e.description&&(0,o.jsx)(`p`,{className:`line-clamp-2 text-sm leading-snug text-muted-foreground`,children:e.description})]})})},t))})})]}):(0,o.jsx)(_r,{href:e.href,children:e.label})},t))})})},{namespace:`ui`,label:`Navigation Menu`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{items:[{label:`Home`,href:`/`},{label:`About`,href:`/about`}]}});function wa(e){return e.includes(`-`)?e.toLowerCase():e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1-$2`).toLowerCase()}var Ta=new Set(ue.iconNames);function Ea(e){return Ta.has(e)}var Da=new Map;function Oa(e){if(!e)return c.Database;let t=Da.get(e);if(t)return t;let n=wa(e);if(!Ea(n))return Da.set(e,c.Database),c.Database;let r=e=>a.default.createElement(ue.DynamicIcon,{name:n,fallback:c.Database,...e});return r.displayName=`LucideIcon(${e})`,Da.set(e,r),r}var ka=({name:e,...t})=>{if(!e)return a.default.createElement(c.Database,t);let n=wa(e);return Ea(n)?a.default.createElement(ue.DynamicIcon,{name:n,fallback:c.Database,...t}):a.default.createElement(c.Database,t)};function Aa(e){let t=e?.properties??{};return{...e?.props??{},...t}}function ja(e){if(!e||typeof e!=`object`)return{};let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n.startsWith(`aria-`)||n===`role`?n:`aria-${n}`]=String(r));return t}var Ma={left:`text-left`,center:`text-center`,right:`text-right`},Na={heading:`text-2xl font-semibold tracking-tight`,subheading:`text-lg font-medium text-foreground`,body:`text-sm text-foreground`,caption:`text-xs text-muted-foreground`};function Pa({schema:e}){let t=Aa(e),{language:n}=(0,F.useObjectTranslation)(),r=t.variant??`body`,i=t.align??`left`;return(0,o.jsx)(r===`heading`?`h2`:r===`subheading`?`h3`:`p`,{className:z(Na[r]??Na.body,Ma[i],e?.className),...ja(t.aria),children:(0,F.pickLocalized)(t.content,n)})}t.ComponentRegistry.register(`element:text`,Pa,{namespace:`element`,label:`Text`,category:`content`});function Fa({schema:e}){return(0,o.jsx)(Gr,{className:z(`my-4`,e?.className)})}t.ComponentRegistry.register(`element:divider`,Fa,{namespace:`element`,label:`Divider`,category:`content`});var Ia={cover:`object-cover`,contain:`object-contain`,fill:`object-fill`};function La({schema:e}){let t=Aa(e),n=t.fit??`cover`;return t.src?(0,o.jsx)(`img`,{src:t.src,alt:t.alt??``,className:z(`w-full rounded-md`,Ia[n]??Ia.cover,e?.className),style:t.height?{height:t.height}:void 0,...ja(t.aria)}):(0,o.jsx)(`div`,{className:z(`flex items-center justify-center rounded-md border border-dashed bg-muted/30 text-xs text-muted-foreground`,e?.className),style:{height:t.height??120},children:`no image source`})}t.ComponentRegistry.register(`element:image`,La,{namespace:`element`,label:`Image`,category:`content`});var Ra={primary:`default`,secondary:`secondary`,danger:`destructive`,ghost:`ghost`,link:`link`},za={small:`sm`,medium:`default`,large:`lg`};function Ba({schema:e}){let t=Aa(e),n=Ra[t.variant??`primary`]??`default`,r=za[t.size??`medium`]??`default`,{language:s}=(0,F.useObjectTranslation)(),c=(0,F.pickLocalized)(t.label,s),l=t.iconPosition??`left`,u=t.icon?(0,o.jsx)(ka,{name:t.icon,className:`h-4 w-4`}):null,{execute:d}=(0,i.useAction)(),[f,p]=a.useState(!1),m=t.action,h=a.useCallback(async()=>{if(!(!m||f)){p(!0);try{let e=Array.isArray(m.params)?{actionParams:m.params}:{params:m.params};await d({type:m.actionType||m.type,name:m.name,label:m.label,description:m.description,target:m.target,endpoint:m.endpoint,method:m.method,navigate:m.navigate,to:m.to,opensInNewTab:m.opensInNewTab,confirmText:m.confirmText,successMessage:m.successMessage,errorMessage:m.errorMessage,refreshAfter:m.refreshAfter,...e})}finally{p(!1)}}},[m,d,f]);return(0,o.jsxs)(V,{type:`button`,variant:n,size:r,disabled:t.disabled||f,className:z(e?.className),onClick:m?h:void 0,...ja(t.aria),children:[l===`left`&&u,c,l===`right`&&u]})}t.ComponentRegistry.register(`element:button`,Ba,{namespace:`element`,label:`Button`,category:`action`});var Va={number:{},currency:{style:`currency`,currency:`USD`},percent:{style:`percent`,maximumFractionDigits:1}};function Ha(e,t,n,r,i,a){if(e==null||Number.isNaN(e))return`—`;let o=Va[t??`number`]??Va.number;t===`currency`&&(o={...Va.currency,currency:i||`USD`});let s=new Intl.NumberFormat(a,o).format(e);return`${n??``}${s}${r??``}`}function Ua({schema:e}){let t=Aa(e),n=(0,i.useAdapter)(),{currency:r,locale:s}=(0,F.useLocalization)(),[c,l]=a.useState(null),[u,d]=a.useState(!0),[f,p]=a.useState(null),m=a.useMemo(()=>t.filter?JSON.stringify(t.filter):``,[t.filter]);return a.useEffect(()=>{let e=!1;if(!n||!t.object||!t.aggregate){d(!1);return}return d(!0),p(null),(async()=>{try{if(typeof n.aggregate==`function`){let r=await n.aggregate(t.object,{field:t.field,function:t.aggregate,groupBy:`_all`,filter:t.filter}),i=Array.isArray(r)?r[0]:r,a=t.aggregate===`count`?`count`:`${t.field??``}_${t.aggregate}`,o=i?.[a]??i?.[t.field??``]??i?.value??(typeof i==`number`?i:null);e||l(typeof o==`number`?o:o==null?null:Number(o))}else if(typeof n.find==`function`){let r=await n.find(t.object,t.filter?{$filter:t.filter}:void 0),i=r?.data??r?.records??(Array.isArray(r)?r:[]),a=null;if(t.aggregate===`count`)a=i.length;else if(t.field){let e=i.map(e=>Number(e?.[t.field])).filter(e=>!Number.isNaN(e));e.length&&(t.aggregate===`sum`?a=e.reduce((e,t)=>e+t,0):t.aggregate===`avg`?a=e.reduce((e,t)=>e+t,0)/e.length:t.aggregate===`min`?a=Math.min(...e):t.aggregate===`max`&&(a=Math.max(...e)))}e||l(a)}}catch(t){e||p(t?.message??`aggregate failed`)}finally{e||d(!1)}})(),()=>{e=!0}},[n,t.object,t.field,t.aggregate,m]),(0,o.jsxs)(`div`,{className:z(`flex flex-col gap-1`,e?.className),...ja(t.aria),children:[(0,o.jsx)(`div`,{className:`text-3xl font-semibold tracking-tight tabular-nums`,children:u?`…`:Ha(c,t.format,t.prefix,t.suffix,r,s)}),f&&(0,o.jsx)(`div`,{className:`text-xs text-destructive`,children:f})]})}t.ComponentRegistry.register(`element:number`,Ua,{namespace:`element`,label:`Number`,category:`content`});function Wa(e){let t=e?.properties??{};return{...e?.props??{},...t}}function Ga(e,t){if(!e||!t)return;let n=e.fields;if(n)return Array.isArray(n)?n.find(e=>e?.name===t):n[t]}function Ka({hint:e,icon:t,title:n,subtitle:r,children:i}){return(0,o.jsxs)(`div`,{className:`rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-2.5 border-b bg-muted/40 px-3.5 py-2.5`,children:[(0,o.jsx)(t,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-semibold leading-tight`,children:n}),(0,o.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-muted-foreground`,children:e})]}),r&&(0,o.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:r})]})]}),(0,o.jsx)(`div`,{className:`p-3.5`,children:i})]})}function Z({tone:e=`muted`,children:t}){return(0,o.jsxs)(`div`,{className:z(`flex items-center gap-2 rounded-md border border-dashed px-3 py-2.5 text-xs`,e===`warn`?`border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-300`:`bg-muted/30 text-muted-foreground`),children:[e===`warn`&&(0,o.jsx)(c.AlertTriangle,{className:`h-3.5 w-3.5 shrink-0`}),t]})}function qa({object:e,name:t}){let{item:n,loading:r,error:s}=(0,i.useMetadataItem)(`object`,e??null),l=a.useMemo(()=>{let e=n?.validations??n?.validationRules??[];if(Array.isArray(e))return e.find(e=>e?.type===`state_machine`&&(!t||e?.name===t))},[n,t]);if(!e)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Missing `,(0,o.jsx)(`code`,{className:`font-mono`,children:`object`}),` for the state machine.`]});if(r)return(0,o.jsxs)(Z,{children:[`Loading `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`…`]});if(s)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Failed to load object `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`: `,s.message]});if(!n)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Object `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),` not found.`]});if(!l)return(0,o.jsxs)(Z,{tone:`warn`,children:[`No state machine`,t?` named “${t}”`:``,` on `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`.`]});let u=l.transitions&&typeof l.transitions==`object`&&!Array.isArray(l.transitions)?l.transitions:{},d=Ga(n,l.field),f=Array.isArray(d?.options)?d.options:[],p=new Map(f.map(e=>[e.value,e])),m=e=>p.get(e)?.label??e,h=e=>p.get(e)?.color,g=f.find(e=>e.default)?.value,_=new Set;g&&_.add(g);for(let e of f)_.add(e.value);for(let[e,t]of Object.entries(u)){_.add(e);for(let e of t)_.add(e)}let v=[..._],y=({value:e})=>(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-background px-2 py-0.5 text-xs font-medium`,children:[(0,o.jsx)(`span`,{className:`h-2 w-2 rounded-full`,style:{backgroundColor:h(e)??`var(--muted-foreground)`}}),m(e)]});return(0,o.jsx)(Ka,{hint:`state machine`,icon:c.Workflow,title:l.label??l.name??`State machine`,subtitle:(0,o.jsxs)(o.Fragment,{children:[`Lifecycle of `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),l.field?(0,o.jsxs)(o.Fragment,{children:[` · field `,(0,o.jsx)(`code`,{className:`font-mono`,children:l.field})]}):null]}),children:(0,o.jsx)(`ol`,{className:`space-y-1.5`,children:v.map(e=>{let t=u[e]??[],n=e===g,r=t.length===0;return(0,o.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 rounded-md border bg-muted/20 px-2.5 py-2`,children:[(0,o.jsx)(y,{value:e}),n&&(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-emerald-100 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-400`,children:[(0,o.jsx)(c.CircleDot,{className:`h-3 w-3`}),` initial`]}),r?(0,o.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,o.jsx)(c.Flag,{className:`h-3 w-3`}),` final`]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.ArrowRight,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,o.jsx)(`span`,{className:`flex flex-wrap gap-1.5`,children:t.map(e=>(0,o.jsx)(y,{value:e},e))})]})]},e)})})})}var Ja=new Set([`script`,`http_request`,`connector_action`,`assignment`,`get_record`,`create_record`,`update_record`,`delete_record`,`boundary_event`]);function Ya({name:e,detail:t}){let{item:n,loading:r,error:a}=(0,i.useMetadataItem)(`flow`,e??null);if(!e)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Missing `,(0,o.jsx)(`code`,{className:`font-mono`,children:`name`}),` for the flow.`]});if(r)return(0,o.jsxs)(Z,{children:[`Loading flow `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`…`]});if(a)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Failed to load flow `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`: `,a.message]});if(!n)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Flow `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),` not found.`]});let s=Array.isArray(n.nodes)?n.nodes:[],l=(t??`business`)===`business`,u=l?s.filter(e=>!Ja.has(e?.type)):s,d=s.length-u.length;return(0,o.jsxs)(Ka,{hint:`flow`,icon:c.GitBranch,title:n.label??n.name??e,subtitle:n.description??(0,o.jsxs)(o.Fragment,{children:[`Process with `,s.length,` step`,s.length===1?``:`s`]}),children:[u.length===0?(0,o.jsx)(Z,{children:`No steps to show.`}):(0,o.jsx)(`ol`,{className:`space-y-1.5`,children:u.map((e,t)=>(0,o.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-md border bg-muted/20 px-2.5 py-2`,children:[(0,o.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[11px] font-semibold text-primary`,children:t+1}),(0,o.jsx)(`span`,{className:`text-sm`,children:e?.label??e?.id??`(step)`}),e?.type&&(0,o.jsx)(`span`,{className:`ml-auto rounded border bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:e.type})]},e?.id??t))}),l&&d>0&&(0,o.jsxs)(`div`,{className:`mt-2 text-[11px] text-muted-foreground`,children:[d,` technical step`,d===1?``:`s`,` hidden · set `,(0,o.jsx)(`code`,{className:`font-mono`,children:`detail: technical`}),` to show all`]})]})}var Xa=[{key:`allowCreate`,label:`C`},{key:`allowRead`,label:`R`},{key:`allowEdit`,label:`U`},{key:`allowDelete`,label:`D`}];function Za({name:e}){let{item:t,loading:n,error:r}=(0,i.useMetadataItem)(`permission`,e??null);if(!e)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Missing `,(0,o.jsx)(`code`,{className:`font-mono`,children:`name`}),` for the permission set.`]});if(n)return(0,o.jsxs)(Z,{children:[`Loading permission set `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`…`]});if(r)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Failed to load permission `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),`: `,r.message]});if(!t)return(0,o.jsxs)(Z,{tone:`warn`,children:[`Permission set `,(0,o.jsx)(`code`,{className:`font-mono`,children:e}),` not found.`]});let a=t.objects&&typeof t.objects==`object`?t.objects:{},s=Object.entries(a);return(0,o.jsx)(Ka,{hint:`permission`,icon:c.ShieldCheck,title:t.label??t.name??e,subtitle:(0,o.jsxs)(o.Fragment,{children:[`Object access · `,s.length,` object`,s.length===1?``:`s`,t.isProfile?` · profile`:``]}),children:s.length===0?(0,o.jsx)(Z,{children:`No object permissions declared.`}):(0,o.jsxs)(`table`,{className:`w-full border-separate border-spacing-0 text-xs`,children:[(0,o.jsx)(`thead`,{children:(0,o.jsxs)(`tr`,{className:`text-muted-foreground`,children:[(0,o.jsx)(`th`,{className:`border-b px-2 py-1.5 text-left font-medium`,children:`Object`}),Xa.map(e=>(0,o.jsx)(`th`,{className:`border-b px-2 py-1.5 text-center font-mono font-medium`,title:e.key,children:e.label},e.key))]})}),(0,o.jsx)(`tbody`,{children:s.map(([e,t])=>(0,o.jsxs)(`tr`,{children:[(0,o.jsx)(`td`,{className:`border-b px-2 py-1.5 font-mono`,children:e}),Xa.map(e=>(0,o.jsx)(`td`,{className:`border-b px-2 py-1.5 text-center`,children:t?.[e.key]?(0,o.jsx)(c.Check,{className:`mx-auto h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400`}):(0,o.jsx)(c.Minus,{className:`mx-auto h-3.5 w-3.5 text-muted-foreground/40`})},e.key))]},e))})]})})}function Qa({schema:e}){let t=Wa(e);switch(t.type){case`state_machine`:return(0,o.jsx)(qa,{...t});case`flow`:return(0,o.jsx)(Ya,{...t});case`permission`:return(0,o.jsx)(Za,{...t});default:return(0,o.jsxs)(Z,{tone:`warn`,children:[`Unknown metadata view type`,t.type?` “${t.type}”`:``,`. Expected`,` `,(0,o.jsx)(`code`,{className:`font-mono`,children:`state_machine`}),`, `,(0,o.jsx)(`code`,{className:`font-mono`,children:`flow`}),`, or`,` `,(0,o.jsx)(`code`,{className:`font-mono`,children:`permission`}),`.`]})}}t.ComponentRegistry.register(`element:metadata_viewer`,Qa,{namespace:`element`,label:`Metadata Viewer`,category:`content`});function $a(e){let t=e?.properties??{};return{...e?.props??{},...t}}function eo(e){return e==null||e===``?`—`:typeof e==`object`?JSON.stringify(e):String(e)}function to({schema:e}){let t=$a(e),n=Array.isArray(t.items)?t.items:[],r=t.columns===2?`sm:grid-cols-2`:`grid-cols-1`;return n.length===0?(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No details`}):(0,o.jsx)(`dl`,{className:z(`grid gap-x-6 gap-y-3`,r,e?.className,t.className),"data-testid":`definition-list`,children:n.map((e,n)=>(0,o.jsxs)(`div`,{className:z(t.inline?`flex items-baseline justify-between gap-3`:`flex flex-col gap-0.5`),children:[(0,o.jsx)(`dt`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:e.term}),(0,o.jsx)(`dd`,{className:`text-sm text-foreground`,children:eo(e.description)})]},n))})}t.ComponentRegistry.register(`element:definition-list`,to,{namespace:`element`,label:`Definition List`,category:`content`});function no({schema:e}){let t=$a(e),n=(0,i.useAdapter)(),[r,s]=a.useState([]),[c,l]=a.useState(!0),[u,d]=a.useState(null),f=a.useMemo(()=>t.filter?JSON.stringify(t.filter):``,[t.filter]),p=a.useMemo(()=>(t.fields??[]).map(e=>typeof e==`string`?{field:e}:e),[t.fields]);return a.useEffect(()=>{let e=!1;if(!n||!t.object||typeof n.find!=`function`){l(!1);return}return l(!0),d(null),(async()=>{try{let r={};t.filter&&(r.$filter=t.filter),t.sort&&(r.$orderby=t.sort),t.limit&&(r.$top=t.limit);let i=await n.find(t.object,r),a=i?.data??i?.records??(Array.isArray(i)?i:[]);e||s(a)}catch(t){e||d(t?.message??`Failed to load`)}finally{e||l(!1)}})(),()=>{e=!0}},[n,t.object,f,t.limit]),c?(0,o.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`Loading…`}):u?(0,o.jsx)(`p`,{className:`py-2 text-sm text-destructive`,children:u}):r.length===0?(0,o.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:t.emptyText??`No records`}):(0,o.jsx)(`ul`,{className:z(t.divided!==!1&&`divide-y divide-border`,e?.className,t.className),"data-testid":`repeater`,children:r.map((e,n)=>(0,o.jsxs)(`li`,{className:`flex items-baseline gap-3 py-2`,children:[t.titleField&&(0,o.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:eo(e[t.titleField])}),p.map(t=>(0,o.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:eo(e[t.field])},t.field))]},e?.id??n))})}t.ComponentRegistry.register(`element:repeater`,no,{namespace:`element`,label:`Repeater`,category:`content`});function ro({label:e,collapsible:t,collapsed:n,onToggle:r}){return e?(0,o.jsx)(`div`,{className:z(`col-span-full pt-4 pb-1 border-b border-border`,t&&`cursor-pointer select-none`),onClick:t?r:void 0,role:t?`button`:void 0,"aria-expanded":t?!n:void 0,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[t&&(n?(0,o.jsx)(c.ChevronRight,{className:`h-3.5 w-3.5 text-muted-foreground`}):(0,o.jsx)(c.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground`})),(0,o.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:e})]})}):null}var io=(0,F.createSafeTranslation)({"common.selectOption":`Select an option`},`common.selectOption`),ao=new Set([`input`,`textarea`,`checkbox`,`switch`,`select`]),oo=new Set([`lookup`,`master_detail`,`tree`]);function so(e){let{dataSource:t,inputType:n,options:r,field:i,schema:a,showActions:o,fieldContainerClass:s,mobileStickyActions:c,mobile_fullscreen:l,fullscreen:u,dependentValues:d,...f}=e;return f}function co(e){return e.startsWith(`field:`)?e.slice(6):e}function lo(e,t){let{dataSource:n,inputType:r,showActions:i,fieldContainerClass:a,mobileStickyActions:o,mobile_fullscreen:s,fullscreen:c,dependentValues:l,schema:u,...d}=t,f=co(e);return{...d,...oo.has(f)?{dataSource:n,dependentValues:l}:{}}}function uo({value:e,onChange:t,placeholder:n,className:r,label:i,...s}){let[l,u]=a.default.useState(!1),[d,f]=a.default.useState(e??``),p=e=>t&&t(e),m=()=>{f(e??``),u(!0)},h=()=>{p(d),u(!1)};return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(na,{placeholder:n,className:z(`pr-10`,r),value:e??``,onChange:e=>p(e.target.value),...s}),(0,o.jsx)(`button`,{type:`button`,onClick:m,className:`absolute top-1.5 right-1.5 inline-flex items-center justify-center size-7 rounded-md bg-background/80 text-muted-foreground hover:text-foreground hover:bg-background border shadow-sm`,"aria-label":`Edit ${i??`text`} fullscreen`,"data-testid":`form-textarea-fullscreen-toggle`,children:(0,o.jsx)(c.Maximize2,{className:`size-3.5`})}),(0,o.jsx)(Tt,{open:l,onOpenChange:u,children:(0,o.jsxs)(At,{className:`sm:max-w-3xl h-[100dvh] sm:h-[80vh] max-h-[100dvh] sm:max-h-[80vh] flex flex-col p-0 gap-0`,"data-testid":`form-textarea-fullscreen-dialog`,children:[(0,o.jsxs)(jt,{className:`p-4 border-b`,children:[(0,o.jsx)(Nt,{className:`text-base`,children:i??`Edit text`}),(0,o.jsx)(Pt,{className:`sr-only`,children:`Edit the full text value, then save or cancel your changes.`})]}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 p-4`,children:(0,o.jsx)(na,{autoFocus:!0,value:d,onChange:e=>f(e.target.value),placeholder:n,className:`h-full min-h-full resize-none text-base`,"data-testid":`form-textarea-fullscreen-input`})}),(0,o.jsxs)(Mt,{className:`p-3 border-t flex-row justify-end gap-2`,children:[(0,o.jsxs)(V,{type:`button`,variant:`ghost`,onClick:()=>u(!1),children:[(0,o.jsx)(c.X,{className:`size-4 mr-1`}),` Cancel`]}),(0,o.jsxs)(V,{type:`button`,onClick:h,"data-testid":`form-textarea-fullscreen-save`,children:[(0,o.jsx)(c.Check,{className:`size-4 mr-1`}),` Done`]})]})]})})]})}t.ComponentRegistry.register(`form`,({schema:e,className:n,onAction:r,...s})=>{let{t:l}=io(),{defaultValues:u={},fields:d=[],submitLabel:f=`Submit`,cancelLabel:p=`Cancel`,showCancel:m=!1,showSubmit:h=!0,layout:g=`vertical`,columns:_=1,onSubmit:v,onChange:y,onCancel:b,resetOnSubmit:x=!1,validationMode:S=`onSubmit`,disabled:C=!1}=e,T=(0,w.useForm)({defaultValues:u,mode:S}),[E,D]=a.default.useState(!1),[O,k]=a.default.useState(null),A=T.watch(),j=a.default.useMemo(()=>{let e={};for(let t of d)t?.name&&(e[t.name]=null);for(let t of Object.keys(A))A[t]!==void 0&&(e[t]=A[t]);return e},[d,JSON.stringify(A)]);a.default.useEffect(()=>{let e=T.formState.errors;if(!(!e||Object.keys(e).length===0))for(let n of d){let r=n?.name;if(!r||!e[r])continue;let i=(0,t.resolveFieldRuleState)({visibleWhen:n.visibleWhen,readonlyWhen:n.readonlyWhen,requiredWhen:n.requiredWhen,conditionalRequired:n.conditionalRequired},j,{required:!!n.required,readonly:n.readonly===!0}),a=e[r]?.type;(!i.visible||!i.required&&a===`required`)&&T.clearErrors(r)}},[j]);let ee=a.default.useContext(i.SchemaRendererContext)?.dataSource??null,te=a.default.useRef(void 0);a.default.useEffect(()=>{let e;try{e=JSON.stringify(u??{})}catch{e=String(Date.now())}te.current!==e&&(te.current=e,T.reset(u))},[u]),a.default.useEffect(()=>{if(r){let e=T.watch(e=>{r({type:`form_change`,data:e,formData:e})});return()=>e.unsubscribe()}},[T,r]);let M=T.handleSubmit(async e=>{D(!0),k(null);let t=e;if(e&&(e.nativeEvent||typeof e.preventDefault==`function`||typeof e.stopPropagation==`function`||e.target||e.bubbles))t=T.getValues();else if(!t||Object.keys(t).length===0){let e=T.getValues();e&&Object.keys(e).length>0&&(t=e)}try{if(r){let e=await r({type:`form_submit`,data:t,formData:t});if(e?.error){k(e.error);return}}v&&typeof v==`function`&&await v(t),x&&T.reset()}catch(e){k(e instanceof Error?e.message:typeof e==`string`?e:`An error occurred during submission`),typeof process<`u`&&process.env.NODE_ENV===`development`&&console.error(`Form submission error:`,e)}finally{D(!1)}}),N=()=>{T.reset(),b&&typeof b==`function`&&b(),r&&r({type:`form_cancel`,data:T.getValues()})},ne=_>1?z(`grid gap-4`,_===1?``:_===2?`md:grid-cols-2`:_===3?`md:grid-cols-2 lg:grid-cols-3`:`md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`):`space-y-4`,{"data-obj-id":re,"data-obj-type":ie,style:ae,onSubmit:P,onChange:oe,submitLabel:se,cancelLabel:ce,showSubmit:le,showCancel:F,resetOnSubmit:ue,defaultValues:de,inputType:fe,dataSource:pe,showActions:me,fieldContainerClass:I,mobileStickyActions:he,...L}=s;return(0,o.jsx)(Mn,{...T,children:(0,o.jsxs)(`form`,{onSubmit:M,className:n,...L,"data-obj-id":re,"data-obj-type":ie,style:ae,children:[O&&(0,o.jsxs)(W,{variant:`destructive`,className:`mb-4`,children:[(0,o.jsx)(c.AlertCircle,{className:`h-4 w-4`}),(0,o.jsx)(Ie,{children:O})]}),e.children?(0,o.jsx)(`div`,{className:e.fieldContainerClass||`space-y-4`,children:B(e.children)}):(0,o.jsx)(`div`,{className:e.fieldContainerClass||ne,children:d.map(n=>{let{name:r,label:i,description:a,type:s=`input`,required:c=!1,disabled:u=!1,validation:d={},condition:f,colSpan:p,hidden:m,widget:h,visibleOn:g,readonly:_,visibleWhen:v,readonlyWhen:y,requiredWhen:b,conditionalRequired:x,...S}=n;if(m)return null;if(f){let e=f.field,t=T.watch(e),n=t!=null;if(f.equals!==void 0&&t!==f.equals||f.notEquals!==void 0&&t===f.notEquals||f.in&&(!n||!f.in.includes(t)))return null}let w=(0,t.resolveFieldRuleState)({visibleWhen:v,readonlyWhen:y,requiredWhen:b,conditionalRequired:x},j,{required:c,readonly:_===!0});if(!w.visible)return null;let D=w.required,O=w.readonly;if(s===`section-divider`){let e=S;return(0,o.jsx)(ro,{label:i,collapsible:e.collapsible,collapsed:e.collapsed,onToggle:e.onToggle},r)}let k={...d};D&&(k.required=typeof d.required==`string`?d.required:`${i||r} is required`);let A=n.id??r,te=h||s,M=e.fieldContainerClass||ne,N=e=>{let t=Array.from(M.matchAll(/(@)?(sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl):grid-cols-(\d+)/g)).map(e=>({at:e[1]||``,bp:e[2],cols:Number(e[3])}));if(!t.length)return e===2?`col-span-2`:e===3?`col-span-3`:`col-span-4`;let n=t.find(t=>t.cols>=e)||t[t.length-1];return{"@sm:2":`@sm:col-span-2`,"@md:2":`@md:col-span-2`,"@lg:2":`@lg:col-span-2`,"@xl:2":`@xl:col-span-2`,"@2xl:2":`@2xl:col-span-2`,"@sm:3":`@sm:col-span-3`,"@md:3":`@md:col-span-3`,"@lg:3":`@lg:col-span-3`,"@xl:3":`@xl:col-span-3`,"@2xl:3":`@2xl:col-span-3`,"@4xl:3":`@4xl:col-span-3`,"@sm:4":`@sm:col-span-4`,"@md:4":`@md:col-span-4`,"@lg:4":`@lg:col-span-4`,"@xl:4":`@xl:col-span-4`,"@2xl:4":`@2xl:col-span-4`,"@4xl:4":`@4xl:col-span-4`,"sm:2":`sm:col-span-2`,"md:2":`md:col-span-2`,"lg:2":`lg:col-span-2`,"xl:2":`xl:col-span-2`,"sm:3":`sm:col-span-3`,"md:3":`md:col-span-3`,"lg:3":`lg:col-span-3`,"xl:3":`xl:col-span-3`,"sm:4":`sm:col-span-4`,"md:4":`md:col-span-4`,"lg:4":`lg:col-span-4`,"xl:4":`xl:col-span-4`}[`${n.at}${n.bp}:${e}`]||(e===2?`col-span-2`:e===3?`col-span-3`:`col-span-4`)},re=p&&p>1?p===2?N(2):p===3?N(3):p>=4?N(4):``:``,ie=`field:${e.objectName?`${e.objectName}.`:``}${r}`;return(0,o.jsx)(Pn,{control:T.control,name:r,rules:k,render:({field:e})=>(0,o.jsxs)(Ln,{className:re||void 0,"data-testid":ie,"data-field":r,children:[i&&(0,o.jsxs)(Rn,{className:`text-xs sm:text-sm`,children:[i,D&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,"aria-label":`required`,children:`*`})]}),(0,o.jsx)(zn,{children:fo(te,{...S,field:n.field||n,...e,inputType:S.inputType,options:S.options,placeholder:S.placeholder??(te===`select`?l(`common.selectOption`):void 0),disabled:C||u||O||E,dataSource:ee})}),a&&(0,o.jsx)(Bn,{children:a}),(0,o.jsx)(Vn,{})]})},A)})}),e.showActions!==!1&&(0,o.jsxs)(`div`,{className:z(`flex flex-col sm:flex-row gap-2 ${g===`horizontal`?`sm:justify-end`:`sm:justify-start`} mt-6`,e.mobileStickyActions&&`sticky bottom-0 z-10 -mx-4 px-4 py-3 bg-background/95 supports-[backdrop-filter]:bg-background/80 backdrop-blur border-t md:static md:mx-0 md:px-0 md:py-0 md:bg-transparent md:border-0 md:backdrop-blur-none`),"data-testid":e.mobileStickyActions?`form-mobile-sticky-actions`:void 0,children:[m&&(0,o.jsx)(V,{type:`button`,variant:`outline`,onClick:N,disabled:E||C,className:`w-full sm:w-auto`,children:p}),h&&(0,o.jsxs)(V,{type:`submit`,disabled:E||C,className:`w-full sm:w-auto`,children:[E&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),f]})]})]})})},{namespace:`ui`,label:`Form`,inputs:[{name:`fields`,type:`array`,label:`Fields`,description:`Array of field configurations with name, label, type, validation, etc.`},{name:`defaultValues`,type:`object`,label:`Default Values`,description:`Object with default values for form fields`},{name:`submitLabel`,type:`string`,label:`Submit Button Label`,defaultValue:`Submit`},{name:`cancelLabel`,type:`string`,label:`Cancel Button Label`,defaultValue:`Cancel`},{name:`showCancel`,type:`boolean`,label:`Show Cancel Button`,defaultValue:!1},{name:`layout`,type:`enum`,enum:[`vertical`,`horizontal`],label:`Layout`,defaultValue:`vertical`},{name:`columns`,type:`number`,label:`Number of Columns`,defaultValue:1,description:`For multi-column layouts (1-4)`},{name:`validationMode`,type:`enum`,enum:[`onSubmit`,`onBlur`,`onChange`,`onTouched`,`all`],label:`Validation Mode`,defaultValue:`onSubmit`},{name:`resetOnSubmit`,type:`boolean`,label:`Reset After Submit`,defaultValue:!1},{name:`disabled`,type:`boolean`,label:`Disabled`,defaultValue:!1},{name:`className`,type:`string`,label:`CSS Class`},{name:`fieldContainerClass`,type:`string`,label:`Field Container CSS Class`}],defaultProps:{submitLabel:`Submit`,cancelLabel:`Cancel`,showCancel:!1,layout:`vertical`,columns:1,validationMode:`onSubmit`,resetOnSubmit:!1,disabled:!1,fields:[{name:`name`,label:`Name`,type:`input`,required:!0,placeholder:`Enter your name`},{name:`email`,label:`Email`,type:`input`,inputType:`email`,required:!0,placeholder:`Enter your email`}]}});function fo(e,n){let r=ao.has(e)?void 0:!e.includes(`:`)&&t.ComponentRegistry.get(`field:${e}`)||t.ComponentRegistry.get(e);if(r){let t=lo(e,n);return(0,o.jsx)(r,{schema:n.field||n.schema||n,...t})}let{inputType:i,options:a=[],placeholder:s,...c}=n,l=so(c);switch(e){case`input`:if(i===`file`){let{value:e,...t}=l;return(0,o.jsx)(K,{type:`file`,placeholder:s,className:`min-h-[44px] sm:min-h-0`,...t})}return(0,o.jsx)(K,{type:i||`text`,placeholder:s,className:`min-h-[44px] sm:min-h-0`,...l,value:l.value??``});case`textarea`:{let{mobile_fullscreen:e,fullscreen:t,label:n}=c,{label:r,...i}=so(c);return e||t?(0,o.jsx)(uo,{placeholder:s,label:n,className:`min-h-[44px] sm:min-h-0`,...i,value:i.value??``}):(0,o.jsx)(na,{placeholder:s,className:`min-h-[44px] sm:min-h-0`,...i,value:i.value??``})}case`checkbox`:{let{value:e,onChange:t,...n}=l;return(0,o.jsx)(xt,{checked:e,onCheckedChange:t,className:`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0`,...n})}case`switch`:{let{value:e,onChange:t,...n}=l;return(0,o.jsx)(Ui,{checked:e,onCheckedChange:t,className:`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0`,...n})}case`select`:{let{value:e,onChange:t,...n}=l;return!a||a.length===0?(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`No options available`}):(0,o.jsxs)(Rr,{value:e,onValueChange:t,...n,children:[(0,o.jsx)(q,{className:`min-h-[44px] sm:min-h-0`,children:(0,o.jsx)(Br,{placeholder:s||`Select an option`})}),(0,o.jsx)(J,{children:a.map(e=>(0,o.jsx)(Y,{value:e.value,children:e.label},e.value))})]})}default:return(0,o.jsx)(K,{type:i||`text`,placeholder:s,...l})}}function po(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}var mo={Home:`House`},ho=(0,a.forwardRef)(({schema:e,...t},n)=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=t,l=null;if(e.icon){let t=po(e.icon);l=c.icons[mo[t]||t]}let u=e.loading||t.loading,d=e.disabled||t.disabled||u;return(0,o.jsxs)(V,{ref:n,type:e.buttonType||`button`,variant:e.variant,size:e.size,className:e.className,disabled:d,...s,"data-obj-id":r,"data-obj-type":i,style:a,children:[u&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!u&&l&&e.iconPosition!==`right`&&(0,o.jsx)(l,{className:`mr-2 h-4 w-4`}),e.label||B(e.body||e.children),!u&&l&&e.iconPosition===`right`&&(0,o.jsx)(l,{className:`ml-2 h-4 w-4`})]})});ho.displayName=`ButtonRenderer`,t.ComponentRegistry.register(`button`,ho,{namespace:`ui`,label:`Button`,inputs:[{name:`label`,type:`string`,label:`Label`,defaultValue:`Button`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`,`link`],defaultValue:`default`},{name:`size`,type:`enum`,label:`Size`,enum:[`default`,`sm`,`lg`,`icon`],defaultValue:`default`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{label:`Button`,variant:`default`,size:`default`}}),t.ComponentRegistry.register(`label`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(G,{className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a,children:e.text||e.label||e.content})},{namespace:`ui`,label:`Label`,inputs:[{name:`text`,type:`string`,label:`Text`,required:!0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{text:`Label Text`}});var go=({schema:e,className:t,onChange:n,value:r,...i})=>{let a=e=>{n&&n(e.target.value)},{"data-obj-id":s,"data-obj-type":c,style:l,...u}=i;return(0,o.jsxs)(`div`,{className:z(`grid w-full items-center gap-1.5`,e.wrapperClass),"data-obj-id":s,"data-obj-type":c,style:l,children:[e.label&&(0,o.jsx)(G,{htmlFor:e.id,className:z(e.required&&`text-destructive after:content-['*'] after:ml-0.5`),children:e.label}),(0,o.jsx)(K,{type:e.inputType||`text`,id:e.id,name:e.name,placeholder:e.placeholder,className:t,required:e.required,disabled:e.disabled,readOnly:e.readOnly,value:r??e.value??``,defaultValue:r===void 0?e.defaultValue:void 0,onChange:a,min:e.min,max:e.max,step:e.step,maxLength:e.maxLength,pattern:e.pattern,...u}),e.description&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),e.error&&(0,o.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:e.error})]})};t.ComponentRegistry.register(`input`,go,{namespace:`ui`,label:`Input Field`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`name`,type:`string`,label:`Field Name`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`inputType`,type:`enum`,label:`Type`,enum:[`text`,`email`,`password`,`number`,`tel`,`url`,`date`,`time`,`datetime-local`],defaultValue:`text`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`description`,type:`string`,label:`Description`}],defaultProps:{inputType:`text`}}),t.ComponentRegistry.register(`email`,e=>(0,o.jsx)(go,{...e,schema:{...e.schema,inputType:`email`}}),{namespace:`ui`,label:`Email Input`,icon:`mail`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`name`,type:`string`,label:`Field Name`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`description`,type:`string`,label:`Description`}]}),t.ComponentRegistry.register(`password`,e=>(0,o.jsx)(go,{...e,schema:{...e.schema,inputType:`password`}}),{namespace:`ui`,label:`Password Input`,icon:`lock`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`name`,type:`string`,label:`Field Name`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`description`,type:`string`,label:`Description`}]}),t.ComponentRegistry.register(`textarea`,({schema:e,className:t,onChange:n,value:r,...i})=>{let a=e=>{n&&n(e.target.value)},{"data-obj-id":s,"data-obj-type":c,style:l,...u}=i;return(0,o.jsxs)(`div`,{className:z(`grid w-full gap-1.5`,e.wrapperClass),"data-obj-id":s,"data-obj-type":c,style:l,children:[e.label&&(0,o.jsx)(G,{htmlFor:e.id,className:z(e.required&&`text-destructive after:content-['*'] after:ml-0.5`),children:e.label}),(0,o.jsx)(na,{id:e.id,name:e.name,placeholder:e.placeholder,className:t,disabled:e.disabled,readOnly:e.readOnly,required:e.required,rows:e.rows,value:r??e.value??``,defaultValue:r===void 0?e.defaultValue:void 0,onChange:a,...u})]})},{namespace:`ui`,label:`Textarea`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`rows`,type:`number`,label:`Rows`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`id`,type:`string`,label:`ID`,required:!0}],defaultProps:{label:`Textarea label`,placeholder:`Enter text here...`,rows:3,id:`textarea-field`}}),t.ComponentRegistry.register(`checkbox`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=i;return(0,o.jsxs)(`div`,{className:z(`flex items-center space-x-2`,e.wrapperClass),"data-obj-id":a,"data-obj-type":s,style:c,children:[(0,o.jsx)(xt,{id:e.id,className:t,checked:r??e.checked??!1,defaultChecked:r===void 0?e.defaultChecked:void 0,onCheckedChange:e=>{n&&n(e)},disabled:e.disabled,required:e.required,name:e.name,...l}),(0,o.jsx)(G,{htmlFor:e.id,className:z(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e.required&&`text-destructive after:content-['*'] after:ml-0.5`),children:e.label})]})},{namespace:`ui`,label:`Checkbox`,inputs:[{name:`label`,type:`string`,label:`Label`,required:!0},{name:`id`,type:`string`,label:`ID`,required:!0},{name:`checked`,type:`boolean`,label:`Checked`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`}],defaultProps:{label:`Checkbox label`,id:`checkbox-field`}}),t.ComponentRegistry.register(`switch`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsxs)(`div`,{className:`flex items-center space-x-2 ${e.wrapperClass||``}`,"data-obj-id":r,"data-obj-type":i,style:a,children:[(0,o.jsx)(Ui,{id:e.id,className:t,...s}),(0,o.jsx)(G,{htmlFor:e.id,children:e.label})]})},{namespace:`ui`,label:`Switch`,inputs:[{name:`label`,type:`string`,label:`Label`,required:!0},{name:`id`,type:`string`,label:`ID`,required:!0},{name:`checked`,type:`boolean`,label:`Checked`}],defaultProps:{label:`Switch label`,id:`switch-field`}}),t.ComponentRegistry.register(`select`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=i;return(0,o.jsxs)(`div`,{className:z(`grid w-full items-center gap-1.5`,e.wrapperClass),"data-obj-id":a,"data-obj-type":s,style:c,children:[e.label&&(0,o.jsx)(G,{className:z(e.required&&`text-destructive after:content-['*'] after:ml-0.5`),children:e.label}),(0,o.jsxs)(Rr,{defaultValue:r===void 0?e.defaultValue:void 0,value:r??e.value,onValueChange:e=>{n&&n(e)},disabled:e.disabled,required:e.required,name:e.name,...l,children:[(0,o.jsx)(q,{className:t,children:(0,o.jsx)(Br,{placeholder:e.placeholder})}),(0,o.jsx)(J,{children:e.options?.map(e=>(0,o.jsx)(Y,{value:e.value,disabled:e.disabled,children:e.label},e.value))})]})]})},{namespace:`ui`,label:`Select`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`defaultValue`,type:`string`,label:`Default Value`},{name:`required`,type:`boolean`,label:`Required`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`options`,type:`array`,label:`Options`,description:`Array of {label, value} objects`}],defaultProps:{label:`Select an option`,placeholder:`Choose...`,options:[{label:`Option 1`,value:`option1`},{label:`Option 2`,value:`option2`},{label:`Option 3`,value:`option3`}]}}),t.ComponentRegistry.register(`radio-group`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(jr,{defaultValue:e.defaultValue,className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a,children:e.options?.map(t=>(0,o.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,o.jsx)(Mr,{value:t.value,id:`${e.id}-${t.value}`}),(0,o.jsx)(G,{htmlFor:`${e.id}-${t.value}`,children:t.label})]},t.value))})},{namespace:`ui`,label:`Radio Group`,inputs:[{name:`defaultValue`,type:`string`,label:`Default Value`},{name:`id`,type:`string`,label:`Group ID`,required:!0},{name:`options`,type:`array`,label:`Options`,description:`Array of {label, value} objects`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{id:`radio-group`,options:[{label:`Option 1`,value:`option1`},{label:`Option 2`,value:`option2`},{label:`Option 3`,value:`option3`}]}}),t.ComponentRegistry.register(`slider`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n;return(0,o.jsx)(Vi,{defaultValue:Array.isArray(e.defaultValue)?e.defaultValue:e.defaultValue===void 0?void 0:[e.defaultValue],max:e.max,min:e.min,step:e.step,className:t,...s,"data-obj-id":r,"data-obj-type":i,style:a})},{namespace:`ui`,label:`Slider`,inputs:[{name:`defaultValue`,type:`array`,label:`Default Value`,defaultValue:[50]},{name:`max`,type:`number`,label:`Max`,defaultValue:100},{name:`min`,type:`number`,label:`Min`,defaultValue:0},{name:`step`,type:`number`,label:`Step`,defaultValue:1},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{defaultValue:[50],max:100,min:0,step:1,className:`w-full`}}),t.ComponentRegistry.register(`toggle`,({schema:e,...t})=>(0,o.jsx)(ia,{variant:e.variant,size:e.size,pressed:e.pressed,"aria-label":e.ariaLabel,...t,children:e.label||B(e.children)}),{namespace:`ui`,label:`Toggle`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`pressed`,type:`boolean`,label:`Pressed`},{name:`variant`,type:`enum`,enum:[`default`,`outline`],defaultValue:`default`,label:`Variant`},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`],defaultValue:`default`,label:`Size`},{name:`ariaLabel`,type:`string`,label:`Aria Label`}],defaultProps:{label:`Toggle`,variant:`default`,size:`default`}}),t.ComponentRegistry.register(`input-otp`,({schema:e,className:t,onChange:n,value:r,...i})=>{let a=e.maxLength||6,s=Array.from({length:a});return(0,o.jsx)(Gn,{maxLength:a,className:t,value:r??e.value,onChange:e=>{n&&n(e)},...i,children:(0,o.jsx)(Kn,{children:s.map((e,t)=>(0,o.jsx)(qn,{index:t},t))})})},{namespace:`ui`,label:`Input OTP`,inputs:[{name:`maxLength`,type:`number`,label:`Max Length`,defaultValue:6},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{maxLength:6}}),t.ComponentRegistry.register(`calendar`,({schema:e,className:t,...n})=>(0,o.jsx)(Xe,{mode:e.mode||`single`,selected:e.value||e.defaultValue,className:t,...n}),{namespace:`ui`,label:`Calendar`,inputs:[{name:`mode`,type:`enum`,enum:[`default`,`single`,`multiple`,`range`],defaultValue:`single`,label:`Mode`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{mode:`single`,className:`rounded-md border`}}),t.ComponentRegistry.register(`date-picker`,({schema:e,className:t,value:n,onChange:r,...i})=>{let a=e=>{r&&r(e)},{"data-obj-id":s,"data-obj-type":l,style:u,...d}=i;return(0,o.jsxs)(`div`,{className:`grid w-full max-w-sm items-center gap-1.5 ${e.wrapperClass||``}`,"data-obj-id":s,"data-obj-type":l,style:u,children:[e.label&&(0,o.jsx)(G,{htmlFor:e.id,children:e.label}),(0,o.jsxs)(Dr,{children:[(0,o.jsx)(Or,{asChild:!0,children:(0,o.jsxs)(V,{id:e.id,variant:`outline`,className:z(`w-full justify-start text-left font-normal`,!n&&`text-muted-foreground`,t),...d,children:[(0,o.jsx)(c.CalendarIcon,{className:`mr-2 h-4 w-4`}),n?(0,de.format)(n,e.format||`PPP`):(0,o.jsx)(`span`,{children:e.placeholder||`Pick a date`})]})}),(0,o.jsx)(kr,{className:`w-auto p-0`,children:(0,o.jsx)(Xe,{mode:`single`,selected:n,onSelect:a,autoFocus:!0})})]})]})},{namespace:`ui`,label:`Date Picker`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`format`,type:`string`,label:`Date Format`,description:`date-fns format string (e.g., "PPP", "yyyy-MM-dd")`},{name:`id`,type:`string`,label:`ID`,required:!0}],defaultProps:{label:`Date`,placeholder:`Pick a date`,format:`PPP`,id:`date-picker-field`}}),t.ComponentRegistry.register(`file-upload`,({schema:e,className:t,value:n,onChange:r,...i})=>{let[s,l]=(0,a.useState)(n||[]),[u,d]=(0,a.useState)(!1),[f,p]=(0,a.useState)(0),m=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(u){let e=setInterval(()=>{p(t=>t>=100?(clearInterval(e),d(!1),0):t+5)},50);return()=>clearInterval(e)}},[u]);let h=t=>{let n=Array.from(t.target.files||[]);if(n.length>0){d(!0),p(0);let t=e.multiple?[...s,...n]:n;setTimeout(()=>{l(t),r&&r(t)},1e3)}},g=e=>{let t=s.filter((t,n)=>n!==e);l(t),r&&r(t)},_=()=>{m.current?.click()},{"data-obj-id":v,"data-obj-type":y,style:b,...x}=i;return(0,o.jsxs)(`div`,{className:`grid w-full max-w-sm items-center gap-2 ${e.wrapperClass||``}`,"data-obj-id":v,"data-obj-type":y,style:b,children:[e.label&&(0,o.jsx)(G,{htmlFor:e.id,children:e.label}),(0,o.jsxs)(`div`,{className:z(`relative flex flex-col gap-3 group/upload`,t),children:[(0,o.jsx)(`input`,{ref:m,type:`file`,id:e.id,className:`hidden`,accept:e.accept,multiple:e.multiple,onChange:h,...x}),(0,o.jsxs)(`div`,{onClick:_,className:z(`relative overflow-hidden cursor-pointer rounded-lg border-2 border-dashed transition-all duration-300 min-h-[120px] flex flex-col items-center justify-center p-4 sm:p-6 gap-3`,u?`border-cyan-400 bg-cyan-950/30`:`border-slate-700 bg-slate-900/50 hover:bg-slate-900 hover:border-cyan-500/50 hover:shadow-[0_0_20px_-5px_rgba(6,182,212,0.3)]`),children:[(0,o.jsx)(`div`,{className:`absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-5 pointer-events-none`}),(0,o.jsx)(`div`,{className:`absolute inset-0 bg-[linear-gradient(to_right,#80808012_1px,transparent_1px),linear-gradient(to_bottom,#80808012_1px,transparent_1px)] bg-[size:14px_24px] pointer-events-none`}),(0,o.jsx)(`div`,{className:z(`relative z-10 p-3 rounded-full bg-slate-800 border border-slate-700 transition-all duration-500`,u?`scale-110 shadow-[0_0_30px_cyan] border-cyan-400 animate-bounce`:`group-hover/upload:scale-110 group-hover/upload:shadow-lg group-hover/upload:border-cyan-500`),children:u?(0,o.jsx)(c.Rocket,{className:`w-8 h-8 text-cyan-300 animate-pulse`}):(0,o.jsx)(c.Upload,{className:`w-6 h-6 text-slate-400 group-hover/upload:text-cyan-400`})}),(0,o.jsx)(`div`,{className:`relative z-10 text-center`,children:(0,o.jsx)(`p`,{className:z(`text-xs font-mono uppercase tracking-widest transition-colors`,u?`text-cyan-300`:`text-slate-500 group-hover/upload:text-cyan-200`),children:u?`INITIATING LAUNCH SEQUENCE...`:e.buttonText||`DROP PAYLOAD OR CLICK TO UPLOAD`})}),u&&(0,o.jsx)(`div`,{className:`absolute bottom-0 left-0 h-1 bg-cyan-500 shadow-[0_0_10px_cyan] transition-all duration-75 ease-out`,style:{width:`${f}%`}})]}),s.length>0&&(0,o.jsx)(`div`,{className:`flex flex-col gap-2 mt-1 perspective-1000`,children:s.map((e,t)=>(0,o.jsxs)(`div`,{className:`relative group/file overflow-hidden flex items-center justify-between p-3 border border-border bg-card/80 rounded-sm text-sm transition-all hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 animate-in slide-in-from-bottom-2 fade-in`,children:[(0,o.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 w-[2px] bg-primary/50 group-hover/file:bg-primary group-hover/file:shadow-[0_0_8px_hsl(var(--primary))]`}),(0,o.jsxs)(`div`,{className:`flex items-center gap-3 z-10`,children:[(0,o.jsx)(c.CheckCircle2,{className:`w-4 h-4 text-emerald-500 rounded-full`}),(0,o.jsx)(`span`,{className:`truncate max-w-[150px] sm:max-w-[200px] md:max-w-[300px] text-muted-foreground group-hover/file:text-foreground font-mono text-xs transition-colors`,children:e.name})]}),(0,o.jsx)(V,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 hover:bg-destructive/10 hover:text-destructive`,onClick:()=>g(t),children:(0,o.jsx)(c.X,{className:`h-3 w-3`})}),(0,o.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-r from-transparent via-primary/5 to-transparent -translate-x-full group-hover/file:animate-[shimmer_1s_infinite] pointer-events-none`})]},t))})]})]})},{namespace:`ui`,label:`File Upload`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`buttonText`,type:`string`,label:`Button Text`},{name:`accept`,type:`string`,label:`Accepted File Types`,description:`MIME types (e.g., "image/*,application/pdf")`},{name:`multiple`,type:`boolean`,label:`Allow Multiple Files`},{name:`id`,type:`string`,label:`ID`,required:!0}],defaultProps:{label:`Upload files`,buttonText:`Choose files`,multiple:!0,id:`file-upload-field`}});var _o=(0,d.cva)(`flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none`}},defaultVariants:{orientation:`horizontal`}});function vo({className:e,orientation:t,...n}){return(0,o.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":t,className:z(_o({orientation:t}),e),...n})}function yo({className:e,asChild:t=!1,...n}){return(0,o.jsx)(t?u.Slot:`div`,{className:z(`bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...n})}function bo({className:e,orientation:t=`vertical`,...n}){return(0,o.jsx)(Gr,{"data-slot":`button-group-separator`,orientation:t,className:z(`bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto`,e),...n})}function xo({options:e,value:t,onValueChange:n,placeholder:r=`Select option...`,searchPlaceholder:i=`Search...`,emptyText:s=`No option found.`,className:l,disabled:u}){let[d,f]=a.useState(!1);return(0,o.jsxs)(Dr,{open:d,onOpenChange:f,children:[(0,o.jsx)(Or,{asChild:!0,children:(0,o.jsxs)(V,{variant:`outline`,role:`combobox`,"aria-expanded":d,className:z(`w-[200px] justify-between`,l),disabled:u,children:[t?e.find(e=>e.value===t)?.label:r,(0,o.jsx)(c.ChevronsUpDown,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,o.jsx)(kr,{className:`w-[200px] p-0`,children:(0,o.jsxs)(Ft,{children:[(0,o.jsx)(Lt,{placeholder:i}),(0,o.jsxs)(Rt,{children:[(0,o.jsx)(zt,{children:s}),(0,o.jsx)(Bt,{children:e.map(e=>(0,o.jsxs)(Ht,{value:e.value,onSelect:e=>{n?.(e===t?``:e),f(!1)},children:[(0,o.jsx)(c.Check,{className:z(`mr-2 h-4 w-4`,t===e.value?`opacity-100`:`opacity-0`)}),e.label]},e.value))})]})]})})]})}function So({label:e,value:t,onClick:n,children:r,className:i}){return(0,o.jsxs)(n?`button`:`div`,{className:z(`flex items-center justify-between py-1.5 min-h-[32px] w-full text-left`,n&&`cursor-pointer hover:bg-accent/50 rounded-sm -mx-1 px-1`,i),onClick:n,type:n?`button`:void 0,children:[(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0 max-w-[45%] truncate`,title:e,children:e}),r||(0,o.jsx)(`span`,{className:`text-xs text-foreground truncate ml-4 text-right max-w-[55%]`,title:t,children:t})]})}var Co=[{value:`equals`,label:`Equals`},{value:`notEquals`,label:`Does not equal`},{value:`contains`,label:`Contains`},{value:`notContains`,label:`Does not contain`},{value:`isEmpty`,label:`Is empty`},{value:`isNotEmpty`,label:`Is not empty`},{value:`greaterThan`,label:`Greater than`},{value:`lessThan`,label:`Less than`},{value:`greaterOrEqual`,label:`Greater than or equal`},{value:`lessOrEqual`,label:`Less than or equal`},{value:`before`,label:`Before`},{value:`after`,label:`After`},{value:`between`,label:`Between`},{value:`in`,label:`In`},{value:`notIn`,label:`Not in`}],wo=(0,F.createSafeTranslation)({"filterBuilder.where":`Where`,"filterBuilder.and":`AND`,"filterBuilder.or":`OR`,"filterBuilder.clearAll":`Clear all`,"filterBuilder.selectField":`Select field`,"filterBuilder.operator":`Operator`,"filterBuilder.selectValue":`Select value`,"filterBuilder.value":`Value`,"filterBuilder.addFilter":`Add filter`,"filterBuilder.removeCondition":`Remove condition`,"filterBuilder.trueLabel":`True`,"filterBuilder.falseLabel":`False`,"filterBuilder.noResults":`No results`,"filterBuilder.searchField":`Search {{label}}…`,"filterBuilder.enterId":`Enter {{label}} id`,"filterBuilder.operators.equals":`Equals`,"filterBuilder.operators.notEquals":`Does not equal`,"filterBuilder.operators.contains":`Contains`,"filterBuilder.operators.notContains":`Does not contain`,"filterBuilder.operators.isEmpty":`Is empty`,"filterBuilder.operators.isNotEmpty":`Is not empty`,"filterBuilder.operators.greaterThan":`Greater than`,"filterBuilder.operators.lessThan":`Less than`,"filterBuilder.operators.greaterOrEqual":`Greater than or equal`,"filterBuilder.operators.lessOrEqual":`Less than or equal`,"filterBuilder.operators.before":`Before`,"filterBuilder.operators.after":`After`,"filterBuilder.operators.between":`Between`,"filterBuilder.operators.in":`In`,"filterBuilder.operators.notIn":`Not in`},`filterBuilder.where`),To=[`equals`,`notEquals`,`contains`,`notContains`,`isEmpty`,`isNotEmpty`],Eo=[`equals`,`notEquals`,`greaterThan`,`lessThan`,`greaterOrEqual`,`lessOrEqual`,`isEmpty`,`isNotEmpty`],Do=[`equals`,`notEquals`],Oo=[`equals`,`notEquals`,`before`,`after`,`between`,`isEmpty`,`isNotEmpty`],ko=[`equals`,`notEquals`,`in`,`notIn`,`isEmpty`,`isNotEmpty`],Ao=[`equals`,`notEquals`,`in`,`notIn`,`isEmpty`,`isNotEmpty`],jo=[`number`,`currency`,`percent`,`rating`],Mo=[`date`,`datetime`,`time`],No=[`select`,`status`],Po=[`lookup`,`master_detail`,`user`,`owner`];function Fo(e){return Array.isArray(e)?e:e!=null&&e!==``?[e]:[]}function Io(e){return!!e&&typeof e==`object`&&Array.isArray(e.conditions)&&(e.logic===`and`||e.logic===`or`)}var Lo={id:`root`,logic:`and`,conditions:[]};function Ro({fields:e=[],value:t,onChange:n,className:r,showClearAll:i=!0}){let{t:s}=wo(),[l,u]=a.useState(Io(t)?t:Lo);a.useEffect(()=>{Io(t)&&JSON.stringify(t)!==JSON.stringify(l)&&u(t)},[t]);let d=e=>{u(e),n?.(e)},f=()=>{let t={id:crypto.randomUUID(),field:e[0]?.value||``,operator:`equals`,value:``};d({...l,conditions:[...l.conditions,t]})},p=e=>{d({...l,conditions:l.conditions.filter(t=>t.id!==e)})},m=()=>{d({...l,conditions:[]})},h=(e,t)=>{d({...l,conditions:l.conditions.map(n=>n.id===e?{...n,...t}:n)})},g=()=>{d({...l,logic:l.logic===`and`?`or`:`and`})},_=t=>{let n=e.find(e=>e.value===t)?.type||`text`;return jo.includes(n)?Co.filter(e=>Eo.includes(e.value)):n===`boolean`?Co.filter(e=>Do.includes(e.value)):Mo.includes(n)?Co.filter(e=>Oo.includes(e.value)):No.includes(n)?Co.filter(e=>ko.includes(e.value)):Po.includes(n)?Co.filter(e=>Ao.includes(e.value)):Co.filter(e=>To.includes(e.value))},v=e=>![`isEmpty`,`isNotEmpty`].includes(e),y=t=>{let n=e.find(e=>e.value===t)?.type||`text`;return jo.includes(n)?`number`:n===`date`?`date`:n===`datetime`?`datetime-local`:n===`time`?`time`:`text`},b=t=>{let n=e.find(e=>e.value===t.field),r=[`in`,`notIn`].includes(t.operator);if(Po.includes(n?.type||``)&&!n?.options&&(n?.referenceTo||n?.type===`user`||n?.type===`owner`))return(0,o.jsx)(zo,{field:n,value:t.value,multiple:r,onChange:e=>h(t.id,{value:e})});if(n?.options&&r){let e=Fo(t.value);return(0,o.jsx)(`div`,{className:`max-h-40 overflow-y-auto space-y-0.5 border rounded-md p-2`,children:n.options.map(n=>{let r=e.map(String).includes(String(n.value));return(0,o.jsxs)(`label`,{className:z(`flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer`,r?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,o.jsx)(xt,{checked:r,onCheckedChange:r=>{let i=r?[...e,n.value]:e.filter(e=>String(e)!==String(n.value));h(t.id,{value:i})}}),(0,o.jsx)(`span`,{className:`truncate`,children:n.label})]},n.value)})})}if(n?.options&&(No.includes(n.type||``)||Po.includes(n.type||``)))return(0,o.jsxs)(Rr,{value:String(t.value||``),onValueChange:e=>h(t.id,{value:e}),children:[(0,o.jsx)(q,{className:`h-9 text-sm`,children:(0,o.jsx)(Br,{placeholder:s(`filterBuilder.selectValue`)})}),(0,o.jsx)(J,{children:n.options.map(e=>(0,o.jsx)(Y,{value:e.value,children:e.label},e.value))})]});if(n?.type===`boolean`)return(0,o.jsxs)(Rr,{value:String(t.value||``),onValueChange:e=>h(t.id,{value:e===`true`}),children:[(0,o.jsx)(q,{className:`h-9 text-sm`,children:(0,o.jsx)(Br,{placeholder:s(`filterBuilder.selectValue`)})}),(0,o.jsxs)(J,{children:[(0,o.jsx)(Y,{value:`true`,children:s(`filterBuilder.trueLabel`)}),(0,o.jsx)(Y,{value:`false`,children:s(`filterBuilder.falseLabel`)})]})]});let i=y(t.field),a=()=>t.value?i===`date`&&typeof t.value==`string`?t.value.split(`T`)[0]:String(t.value):``,c=e=>{let r=e;jo.includes(n?.type||``)&&e!==``?r=parseFloat(e)||0:Mo.includes(n?.type||``)&&(r=e),h(t.id,{value:r})};return(0,o.jsx)(K,{type:i,className:`h-9 text-sm`,placeholder:s(`filterBuilder.value`),value:a(),onChange:e=>c(e.target.value)})};return(0,o.jsxs)(`div`,{className:z(`space-y-3`,r),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:s(`filterBuilder.where`)}),l.conditions.length>1&&(0,o.jsx)(V,{variant:`outline`,size:`sm`,onClick:g,className:`h-7 text-xs`,children:l.logic===`or`?s(`filterBuilder.or`):s(`filterBuilder.and`)})]}),i&&l.conditions.length>0&&(0,o.jsxs)(V,{variant:`ghost`,size:`sm`,onClick:m,className:`h-7 text-xs text-muted-foreground hover:text-destructive`,children:[(0,o.jsx)(c.Trash2,{className:`h-3 w-3 mr-1`}),s(`filterBuilder.clearAll`)]})]}),(0,o.jsx)(`div`,{className:`space-y-2`,children:l.conditions.map(t=>(0,o.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,o.jsxs)(`div`,{className:`flex-1 grid grid-cols-12 gap-2`,children:[(0,o.jsx)(`div`,{className:`col-span-4`,children:(0,o.jsxs)(Rr,{value:t.field,onValueChange:e=>h(t.id,{field:e}),children:[(0,o.jsx)(q,{className:`h-9 text-sm`,children:(0,o.jsx)(Br,{placeholder:s(`filterBuilder.selectField`)})}),(0,o.jsx)(J,{children:e.map(e=>(0,o.jsx)(Y,{value:e.value,children:e.label},e.value))})]})}),(0,o.jsx)(`div`,{className:`col-span-4`,children:(0,o.jsxs)(Rr,{value:t.operator,onValueChange:e=>h(t.id,{operator:e}),children:[(0,o.jsx)(q,{className:`h-9 text-sm`,children:(0,o.jsx)(Br,{placeholder:s(`filterBuilder.operator`)})}),(0,o.jsx)(J,{children:_(t.field).map(e=>(0,o.jsx)(Y,{value:e.value,children:s(`filterBuilder.operators.${e.value}`)},e.value))})]})}),v(t.operator)&&(0,o.jsx)(`div`,{className:`col-span-4`,children:b(t)})]}),(0,o.jsxs)(V,{variant:`ghost`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:()=>p(t.id),children:[(0,o.jsx)(c.X,{className:`h-4 w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:s(`filterBuilder.removeCondition`)})]})]},t.id))}),(0,o.jsxs)(V,{variant:`outline`,size:`sm`,onClick:f,className:`h-8`,disabled:e.length===0,children:[(0,o.jsx)(c.Plus,{className:`h-3 w-3`}),s(`filterBuilder.addFilter`)]})]})}Ro.displayName=`FilterBuilder`;function zo({field:e,value:t,multiple:n,onChange:r}){let{t:s}=wo(),l=a.useContext(i.SchemaRendererContext)?.dataSource??null,u=e.referenceTo||(e.type===`user`||e.type===`owner`?`users`:void 0),d=e.displayField||`name`,f=e.idField||`id`,[p,m]=a.useState(!1),[h,g]=a.useState(``),[_,v]=a.useState([]),[y,b]=a.useState(!1),[x,S]=a.useState(null),[C,w]=a.useState({}),T=a.useRef(null),E=a.useMemo(()=>n?Fo(t).map(e=>String(e)):t==null||t===``?[]:[String(t)],[t,n]),D=l!=null&&typeof l.find==`function`&&!!u,O=a.useCallback(e=>{let t=e?.[f]??e?.id??e?._id,n=e?.[d]??e?.label??e?.name??String(t);return{value:t,label:String(n)}},[d,f]),k=a.useCallback(async e=>{if(D){b(!0),S(null);try{let t={$top:50};e&&e.trim()&&(t.$search=e.trim());let n=await l.find(u,t),r=(n?.data??n??[]).map(O);v(r),r.length>0&&w(e=>{let t={...e};for(let e of r)t[String(e.value)]=e.label;return t})}catch(e){S(e instanceof Error?e.message:String(e)),v([])}finally{b(!1)}}},[l,u,D,O]);a.useEffect(()=>{if(!D||E.length===0)return;let e=E.filter(e=>!(e in C));if(e.length===0)return;let t=!1;return(async()=>{try{let n=await l.find(u,{$top:e.length,$filter:{[f]:{$in:e}}}),r=n?.data??n??[];if(t)return;w(e=>{let t={...e};for(let e of r){let n=O(e);t[String(n.value)]=n.label}return t})}catch{}})(),()=>{t=!0}},[E,D,l,u,f,O,C]),a.useEffect(()=>{p&&D&&_.length===0&&k()},[p]);let A=e=>{g(e),D&&(T.current&&clearTimeout(T.current),T.current=setTimeout(()=>k(e||void 0),300))},j=e=>{if(n){let n=Fo(t);r(n.map(String).includes(String(e))?n.filter(t=>String(t)!==String(e)):[...n,e])}else r(e),m(!1)};return D?(0,o.jsxs)(Dr,{open:p,onOpenChange:m,children:[(0,o.jsx)(Or,{asChild:!0,children:(0,o.jsxs)(`button`,{type:`button`,className:z(`inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm`,`hover:bg-accent hover:text-accent-foreground`,`focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1`),"data-testid":`lookup-picker-${e.value}`,children:[E.length===0?(0,o.jsx)(`span`,{className:`text-muted-foreground truncate`,children:s(`filterBuilder.searchField`,{label:e.label})}):n?(0,o.jsx)(`span`,{className:`truncate`,children:E.length===1?C[E[0]]||E[0]:`${E.length} selected`}):(0,o.jsx)(`span`,{className:`truncate`,children:C[E[0]]||E[0]}),(0,o.jsxs)(`span`,{className:`flex items-center gap-1 shrink-0`,children:[E.length>0&&(0,o.jsx)(c.X,{className:`h-3.5 w-3.5 opacity-60 hover:opacity-100`,onClick:e=>{e.stopPropagation(),r(n?[]:``)}}),(0,o.jsx)(c.ChevronDown,{className:`h-3.5 w-3.5 opacity-60`})]})]})}),(0,o.jsxs)(kr,{align:`start`,className:`w-72 p-0`,children:[(0,o.jsxs)(`div`,{className:`flex items-center border-b px-3`,children:[(0,o.jsx)(c.Search,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,o.jsx)(`input`,{autoFocus:!0,value:h,onChange:e=>A(e.target.value),placeholder:s(`filterBuilder.searchField`,{label:e.label}),className:`flex h-9 w-full bg-transparent px-2 py-1 text-sm outline-none placeholder:text-muted-foreground`,"data-testid":`lookup-search-${e.value}`}),y&&(0,o.jsx)(c.Loader2,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`})]}),(0,o.jsxs)(`div`,{className:`max-h-64 overflow-y-auto p-1`,"data-testid":`lookup-options-${e.value}`,children:[x&&(0,o.jsx)(`div`,{className:`px-3 py-2 text-xs text-destructive`,children:x}),!x&&!y&&_.length===0&&(0,o.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:s(`filterBuilder.noResults`)}),_.map(e=>{let t=E.includes(String(e.value));return(0,o.jsxs)(`label`,{className:z(`flex items-center gap-2 px-2 py-1.5 rounded text-sm cursor-pointer`,t?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[n?(0,o.jsx)(xt,{checked:t,onCheckedChange:()=>j(e.value)}):(0,o.jsx)(`input`,{type:`radio`,checked:t,onChange:()=>j(e.value),className:`rounded-full border-input`}),(0,o.jsx)(`span`,{className:`truncate flex-1`,children:e.label})]},String(e.value))})]})]})]}):(0,o.jsx)(K,{className:`h-9 text-sm`,placeholder:s(`filterBuilder.enterId`,{label:e.label}),value:E[0]??``,onChange:e=>r(e.target.value)})}var Bo=(0,F.createSafeTranslation)({"sortBuilder.sortBy":`Sort by`,"sortBuilder.thenBy":`Then by`,"sortBuilder.selectField":`Select field`,"sortBuilder.ascending":`A → Z`,"sortBuilder.descending":`Z → A`,"sortBuilder.addSort":`Add sort`,"sortBuilder.removeSort":`Remove sort`},`sortBuilder.sortBy`);function Vo({fields:e=[],value:t=[],onChange:n,className:r}){let{t:i}=Bo(),s=a.useCallback(e=>(e||[]).map((e,t)=>({id:e?.id??(typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`sort-${t}-${e?.field??``}`),field:e?.field??``,order:e?.order??e?.sortOrder??`asc`})),[]),[l,u]=a.useState(()=>s(t));a.useEffect(()=>{let e=s(t),n=e=>e.map(({id:e,...t})=>t);JSON.stringify(n(e))!==JSON.stringify(n(l))&&u(e)},[t,l,s]);let d=e=>{u(e),n?.(e)},f=()=>{let t={id:crypto.randomUUID(),field:e[0]?.value||``,order:`asc`};d([...l,t])},p=(e,t)=>{d(l.map(n=>n.id===e?{...n,...t}:n))},m=e=>{d(l.filter(t=>t.id!==e))};return(0,o.jsxs)(`div`,{className:z(`space-y-3`,r),children:[(0,o.jsx)(`div`,{className:`space-y-2`,children:l.map((t,n)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-medium w-16 text-muted-foreground`,children:i(n===0?`sortBuilder.sortBy`:`sortBuilder.thenBy`)}),(0,o.jsx)(`div`,{className:`flex-1`,children:(0,o.jsxs)(Rr,{value:t.field,onValueChange:e=>p(t.id,{field:e}),children:[(0,o.jsx)(q,{className:`h-9`,children:(0,o.jsx)(Br,{placeholder:i(`sortBuilder.selectField`)})}),(0,o.jsx)(J,{children:e.map(e=>(0,o.jsx)(Y,{value:e.value,children:e.label},e.value))})]})}),(0,o.jsx)(`div`,{className:`w-28`,children:(0,o.jsxs)(Rr,{value:t.order,onValueChange:e=>p(t.id,{order:e}),children:[(0,o.jsx)(q,{className:`h-9`,children:(0,o.jsx)(Br,{})}),(0,o.jsxs)(J,{children:[(0,o.jsx)(Y,{value:`asc`,children:i(`sortBuilder.ascending`)}),(0,o.jsx)(Y,{value:`desc`,children:i(`sortBuilder.descending`)})]})]})}),(0,o.jsx)(V,{variant:`ghost`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:()=>m(t.id),children:(0,o.jsx)(c.X,{className:`h-4 w-4`})})]},t.id))}),(0,o.jsxs)(V,{variant:`outline`,size:`sm`,onClick:f,className:`h-8`,disabled:e.length===0,children:[(0,o.jsx)(c.Plus,{className:`h-3 w-3 mr-2`}),i(`sortBuilder.addSort`)]})]})}function Ho({field:e,value:t,onChange:n,draft:r,objectDef:i}){if(e.visibleWhen&&!e.visibleWhen(r))return null;let a=e.disabled||(e.disabledWhen?e.disabledWhen(r):!1),s=t??e.defaultValue,l=null;switch(e.type){case`input`:l=(0,o.jsx)(So,{label:e.label,children:(0,o.jsx)(K,{"data-testid":`config-field-${e.key}`,className:`h-7 w-32 text-xs`,value:s??``,placeholder:e.placeholder,disabled:a,onChange:e=>n(e.target.value)})});break;case`textarea`:l=(0,o.jsx)(So,{label:e.label,className:`flex-col items-stretch gap-1`,children:(0,o.jsx)(na,{"data-testid":`config-field-${e.key}`,className:`min-h-[60px] w-full text-xs`,value:s??``,placeholder:e.placeholder,disabled:a,rows:3,onChange:e=>n(e.target.value)})});break;case`switch`:l=(0,o.jsx)(So,{label:e.label,children:(0,o.jsx)(Ui,{"data-testid":`config-field-${e.key}`,checked:!!s,disabled:a,onCheckedChange:e=>n(e),className:`scale-75`})});break;case`checkbox`:l=(0,o.jsx)(So,{label:e.label,children:(0,o.jsx)(xt,{"data-testid":`config-field-${e.key}`,checked:!!s,disabled:a,onCheckedChange:e=>n(e)})});break;case`select`:l=(0,o.jsx)(So,{label:e.label,children:(0,o.jsxs)(Rr,{value:String(s??``),onValueChange:e=>n(e),disabled:a,children:[(0,o.jsx)(q,{"data-testid":`config-field-${e.key}`,className:`h-7 w-32 text-xs`,children:(0,o.jsx)(Br,{placeholder:e.placeholder??`Select…`})}),(0,o.jsx)(J,{children:(e.options??[]).map(e=>(0,o.jsx)(Y,{value:e.value,children:e.label},e.value))})]})});break;case`slider`:l=(0,o.jsx)(So,{label:e.label,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-2 w-32`,children:[(0,o.jsx)(Vi,{"data-testid":`config-field-${e.key}`,value:[Number(s??e.min??0)],min:e.min??0,max:e.max??100,step:e.step??1,disabled:a,onValueChange:e=>n(e[0]),"aria-label":e.label}),(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground w-6 text-right`,children:s??e.min??0})]})});break;case`color`:l=(0,o.jsx)(So,{label:e.label,children:(0,o.jsx)(`input`,{"data-testid":`config-field-${e.key}`,type:`color`,className:`h-7 w-10 rounded border cursor-pointer`,value:s??`#000000`,disabled:a,onChange:e=>n(e.target.value)})});break;case`icon-group`:l=(0,o.jsx)(So,{label:e.label,children:(0,o.jsx)(`div`,{className:`flex items-center gap-0.5`,"data-testid":`config-field-${e.key}`,children:(e.options??[]).map(e=>(0,o.jsx)(V,{type:`button`,size:`sm`,variant:s===e.value?`default`:`ghost`,className:z(`h-7 w-7 p-0`,s===e.value&&`ring-1 ring-primary`),disabled:a,onClick:()=>n(e.value),title:e.label,children:e.icon??(0,o.jsx)(`span`,{className:`text-[10px]`,children:e.label.charAt(0)})},e.value))})});break;case`field-picker`:l=(0,o.jsx)(So,{label:e.label,value:s??e.placeholder??`Select field…`,onClick:a?void 0:()=>{}});break;case`filter`:l=(0,o.jsxs)(`div`,{"data-testid":`config-field-${e.key}`,children:[(0,o.jsx)(So,{label:e.label}),(0,o.jsx)(Ro,{fields:e.fields,value:s,onChange:n,className:`px-1 pb-2`})]});break;case`sort`:l=(0,o.jsxs)(`div`,{"data-testid":`config-field-${e.key}`,children:[(0,o.jsx)(So,{label:e.label}),(0,o.jsx)(Vo,{fields:e.fields,value:s,onChange:n,className:`px-1 pb-2`})]});break;case`custom`:e.render&&(l=(0,o.jsx)(o.Fragment,{children:e.render(s,n,r)}));break;case`summary`:l=(0,o.jsx)(So,{label:e.label,onClick:e.onSummaryClick,children:(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,o.jsx)(`span`,{className:`text-xs text-foreground truncate max-w-[120px]`,"data-testid":`config-field-${e.key}-text`,children:e.summaryText??s??``}),e.onSummaryClick&&(0,o.jsx)(c.Settings,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`,"aria-hidden":`true`,"data-testid":`config-field-${e.key}-gear`})]})});break;default:break}return l?e.helpText?(0,o.jsxs)(`div`,{children:[l,(0,o.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5 mb-1`,children:e.helpText})]}):(0,o.jsx)(o.Fragment,{children:l}):null}function Uo({title:e,icon:t,collapsible:n,collapsed:r,onToggle:i,testId:a,className:s}){let l=(0,o.jsxs)(`h3`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider flex items-center gap-1.5`,children:[t&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0`,"aria-hidden":`true`,children:t}),e]});return n?(0,o.jsxs)(`button`,{"data-testid":a,className:z(`flex items-center justify-between pt-4 pb-1.5 first:pt-0 w-full text-left`,s),onClick:i,type:`button`,"aria-expanded":!r,children:[l,r?(0,o.jsx)(c.ChevronRight,{className:`h-3 w-3 text-muted-foreground`}):(0,o.jsx)(c.ChevronDown,{className:`h-3 w-3 text-muted-foreground`})]}):(0,o.jsx)(`div`,{className:z(`pt-4 pb-1.5 first:pt-0`,s),"data-testid":a,children:l})}function Wo({open:e,onClose:t,schema:n,draft:r,isDirty:i,onFieldChange:s,onSave:l,onDiscard:u,headerExtra:d,objectDef:f,className:p,style:m,saveLabel:h=`Save`,discardLabel:g=`Discard`,panelRef:_,role:v,ariaLabel:y,tabIndex:b,testId:x,closeTitle:S,footerTestId:C,saveTestId:w,discardTestId:T,expandedSections:E,onUndo:D,onRedo:O,canUndo:k,canRedo:A,undoLabel:j=`Undo`,redoLabel:ee=`Redo`}){let[te,M]=(0,a.useState)({});if(!e)return null;let N=(e,t)=>{M(n=>({...n,[e]:!(n[e]??t??!1)}))},ne=(e,t)=>E&&E.includes(e)?!1:te[e]??t??!1;return(0,o.jsxs)(`div`,{ref:_,"data-testid":x??`config-panel`,role:v,"aria-label":y,tabIndex:b,style:m,className:z(`absolute inset-y-0 right-0 w-full sm:w-[var(--config-panel-width,280px)] sm:relative border-l bg-background flex flex-col shrink-0 z-20`,p),children:[(0,o.jsxs)(`div`,{className:`px-4 py-3 border-b flex items-center justify-between shrink-0`,children:[(0,o.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,o.jsx)(`ol`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:n.breadcrumb.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[t>0&&(0,o.jsx)(c.ChevronRight,{className:`h-3 w-3`}),(0,o.jsx)(`li`,{className:z(t===n.breadcrumb.length-1&&`text-foreground font-medium`),children:e})]},t))})}),(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[D&&(0,o.jsx)(V,{size:`sm`,variant:`ghost`,onClick:D,disabled:!k,className:`h-7 w-7 p-0`,"data-testid":`config-panel-undo`,title:j,children:(0,o.jsx)(c.Undo2,{className:`h-3.5 w-3.5`})}),O&&(0,o.jsx)(V,{size:`sm`,variant:`ghost`,onClick:O,disabled:!A,className:`h-7 w-7 p-0`,"data-testid":`config-panel-redo`,title:ee,children:(0,o.jsx)(c.Redo2,{className:`h-3.5 w-3.5`})}),d,(0,o.jsx)(V,{size:`sm`,variant:`ghost`,onClick:t,className:`h-7 w-7 p-0`,"data-testid":`config-panel-close`,title:S,children:(0,o.jsx)(c.X,{className:`h-3.5 w-3.5`})})]})]}),(0,o.jsx)(`div`,{className:`flex-1 overflow-auto px-4 pb-4`,children:n.sections.map((e,t)=>{if(e.visibleWhen&&!e.visibleWhen(r))return null;let n=ne(e.key,e.defaultCollapsed);return(0,o.jsxs)(`div`,{"data-testid":`config-section-${e.key}`,children:[t>0&&(0,o.jsx)(Gr,{className:`my-3`}),(0,o.jsx)(Uo,{title:e.title,icon:e.icon,collapsible:e.collapsible,collapsed:n,onToggle:()=>N(e.key,e.defaultCollapsed),testId:`section-header-${e.key}`}),e.hint&&(0,o.jsx)(`p`,{className:`text-[10px] text-muted-foreground mb-1`,children:e.hint}),!n&&(0,o.jsxs)(`div`,{className:`space-y-1`,children:[e.fields.map(e=>(0,o.jsx)(Ho,{field:e,value:r[e.key],onChange:t=>s(e.key,t),draft:r,objectDef:f},e.key)),e.subsections?.map(e=>{if(e.visibleWhen&&!e.visibleWhen(r))return null;let t=ne(e.key,e.defaultCollapsed);return(0,o.jsxs)(`div`,{"data-testid":`config-subsection-${e.key}`,className:`ml-1`,role:`group`,"aria-label":e.title,children:[(0,o.jsx)(Uo,{title:e.title,icon:e.icon,collapsible:e.collapsible,collapsed:t,onToggle:()=>N(e.key,e.defaultCollapsed),testId:`section-header-${e.key}`,className:`pt-2 pb-1`}),!t&&(0,o.jsx)(`div`,{className:`space-y-1`,children:e.fields.map(e=>(0,o.jsx)(Ho,{field:e,value:r[e.key],onChange:t=>s(e.key,t),draft:r,objectDef:f},e.key))})]},e.key)})]})]},e.key)})}),i&&(0,o.jsxs)(`div`,{className:`px-4 py-2 border-t flex gap-2 shrink-0`,"data-testid":C??`config-panel-footer`,children:[(0,o.jsxs)(V,{size:`sm`,onClick:l,"data-testid":w??`config-panel-save`,children:[(0,o.jsx)(c.Save,{className:`h-3.5 w-3.5 mr-1`}),h]}),(0,o.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:u,"data-testid":T??`config-panel-discard`,children:[(0,o.jsx)(c.RotateCcw,{className:`h-3.5 w-3.5 mr-1`}),g]})]})]})}function Go({date:e,onDateChange:t,placeholder:n=`Pick a date`,className:r,disabled:i}){return(0,o.jsxs)(Dr,{children:[(0,o.jsx)(Or,{asChild:!0,children:(0,o.jsxs)(V,{variant:`outline`,className:z(`w-[280px] justify-start text-left font-normal`,!e&&`text-muted-foreground`,r),disabled:i,children:[(0,o.jsx)(c.CalendarIcon,{className:`mr-2 h-4 w-4`}),e?(0,de.format)(e,`PPP`):(0,o.jsx)(`span`,{children:n})]})}),(0,o.jsx)(kr,{className:`w-auto p-0`,children:(0,o.jsx)(Xe,{mode:`single`,selected:e,onSelect:t,autoFocus:!0})})]})}function Ko(){try{let{t:e}=(0,F.useObjectTranslation)(),t=e(`detail.noValue`);return!t||t===`detail.noValue`?`No value`:t}catch{return`No value`}}function qo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty`,className:z(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12`,e),...t})}function Jo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-header`,className:z(`flex max-w-sm flex-col items-center gap-2 text-center`,e),...t})}var Yo=(0,d.cva)(`flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6`}},defaultVariants:{variant:`default`}});function Xo({className:e,variant:t=`default`,...n}){return(0,o.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:z(Yo({variant:t,className:e})),...n})}function Zo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-title`,className:z(`text-lg font-medium tracking-tight`,e),...t})}function Qo({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-description`,className:z(`text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function $o({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`empty-content`,className:z(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}function es({className:e,glyph:t=`—`,...n}){return(0,o.jsx)(`span`,{"data-slot":`empty-value`,"aria-label":Ko(),className:z(`select-none text-muted-foreground/50 no-underline pointer-events-none`,e),...n,children:t})}var ts=(0,d.cva)(`space-y-2`),ns=a.forwardRef(({className:e,label:t,description:n,error:r,required:i,htmlFor:s,children:c,...l},d)=>{let f=a.useId(),p=s||f,m=`${p}-description`,h=`${p}-error`;return(0,o.jsxs)(`div`,{ref:d,className:z(ts(),e),...l,children:[t&&(0,o.jsx)(G,{htmlFor:p,className:z(r&&`text-destructive`,i&&`after:content-['*'] after:ml-0.5 after:text-destructive`),children:t}),(0,o.jsx)(u.Slot,{id:p,"aria-describedby":[n&&m,r&&h].filter(Boolean).join(` `)||void 0,"aria-invalid":!!r,children:c}),n&&!r&&(0,o.jsx)(`p`,{id:m,className:`text-[0.8rem] text-muted-foreground`,children:n}),r&&(0,o.jsx)(`p`,{id:h,className:`text-[0.8rem] font-medium text-destructive`,children:r})]})});ns.displayName=`Field`;var rs=a.forwardRef(({className:e,startContent:t,endContent:n,children:r,...i},a)=>(0,o.jsxs)(`div`,{ref:a,className:z(`flex w-full items-center rounded-md border border-input bg-transparent ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2`,`has-[[data-invalid]]:border-destructive`,e),...i,children:[t&&(0,o.jsx)(`div`,{className:`flex items-center px-3 text-muted-foreground bg-muted/50 border-r h-full self-stretch rounded-l-md`,children:t}),(0,o.jsx)(`div`,{className:`flex-1 relative [&_input]:border-0 [&_input]:shadow-none [&_input]:focus-visible:ring-0 [&_input]:bg-transparent`,children:r}),n&&(0,o.jsx)(`div`,{className:`flex items-center px-3 text-muted-foreground bg-muted/50 border-l h-full self-stretch rounded-r-md`,children:n})]}));rs.displayName=`InputGroup`;function is({className:e,...t}){return(0,o.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:z(`group/item-group flex flex-col`,e),...t})}function as({className:e,...t}){return(0,o.jsx)(Gr,{"data-slot":`item-separator`,orientation:`horizontal`,className:z(`my-0`,e),...t})}var os=(0,d.cva)(`group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,{variants:{variant:{default:`bg-transparent`,outline:`border-border`,muted:`bg-muted/50`},size:{default:`p-4 gap-4 `,sm:`py-3 px-4 gap-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function ss({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,o.jsx)(r?u.Slot:`div`,{"data-slot":`item`,"data-variant":t,"data-size":n,className:z(os({variant:t,size:n,className:e})),...i})}var cs=(0,d.cva)(`flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5`,{variants:{variant:{default:`bg-transparent`,icon:`size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4`,image:`size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function ls({className:e,variant:t=`default`,...n}){return(0,o.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:z(cs({variant:t,className:e})),...n})}function us({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-content`,className:z(`flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none`,e),...t})}function ds({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-title`,className:z(`flex w-fit items-center gap-2 text-sm leading-snug font-medium`,e),...t})}function fs({className:e,...t}){return(0,o.jsx)(`p`,{"data-slot":`item-description`,className:z(`text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function ps({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-actions`,className:z(`flex items-center gap-2`,e),...t})}function ms({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-header`,className:z(`flex basis-full items-center justify-between gap-2`,e),...t})}function hs({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`item-footer`,className:z(`flex basis-full items-center justify-between gap-2`,e),...t})}function gs({className:e,...t}){return(0,o.jsx)(`kbd`,{"data-slot":`kbd`,className:z(`bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,e),...t})}function _s({className:e,...t}){return(0,o.jsx)(`kbd`,{"data-slot":`kbd-group`,className:z(`inline-flex items-center gap-1`,e),...t})}var vs=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsx)(`select`,{className:z(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n,children:t}));vs.displayName=`NativeSelect`;function ys(e){if(e!=null)return typeof e==`number`?`${e}px`:e}function bs(e){let t=ys(e);return t?{"--ov-w":t}:{}}var xs=360,Ss=.95;function Cs(e){let[t,n]=a.default.useState(null),r=a.default.useRef(!1);return a.default.useEffect(()=>{if(!(!e||typeof window>`u`))try{let t=window.localStorage.getItem(`ov:${e}`);if(!t)return;let r=Number(t);Number.isFinite(r)&&r>=xs&&n(r)}catch{}},[e]),{width:t,handleMouseDown:a.default.useCallback(t=>{if(!e||typeof window>`u`)return;t.preventDefault(),r.current=!0;let i=Math.floor(window.innerWidth*Ss);document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let a=e=>{r.current&&n(Math.min(i,Math.max(xs,window.innerWidth-e.clientX)))},o=()=>{r.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``,window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,o),n(t=>{if(t!=null)try{window.localStorage.setItem(`ov:${e}`,String(t))}catch{}return t})};window.addEventListener(`mousemove`,a),window.addEventListener(`mouseup`,o)},[e]),handleDoubleClick:a.default.useCallback(()=>{if(!(!e||typeof window>`u`)){n(null);try{window.localStorage.removeItem(`ov:${e}`)}catch{}}},[e]),enabled:!!e}}var ws=({isOpen:e,selectedRecord:t,mode:n,close:r,setIsOpen:i,width:a,view:s,title:l,description:u,className:d,children:f,renderView:p,mainContent:m,popoverTrigger:h,onExpand:g,expandLabel:_=`Open as full page`,storageKey:v})=>{let y=bs(a),b=l||`Record Detail`,x=Cs(n===`drawer`?v:void 0);if(n===`page`||n===`new_window`||n===`none`||!t)return null;let S=ys(a)??`42rem`,C=x.width==null?{"--ov-w":`max(${S}, min(60vw, 880px))`}:{"--ov-w":`${x.width}px`},w=e=>p&&s?p(e,s):f(e);if(n===`drawer`)return(0,o.jsx)(Kr,{open:e,onOpenChange:i,children:(0,o.jsxs)(Qr,{side:`right`,className:z(`w-screen max-w-none sm:w-full sm:max-w-[var(--ov-w,42rem)] p-0 flex flex-col gap-0 overflow-hidden`,`[&>button:last-of-type]:hidden`,d),style:C,children:[x.enabled&&(0,o.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize drawer`,onMouseDown:x.handleMouseDown,onDoubleClick:x.handleDoubleClick,className:`hidden sm:block absolute left-0 top-0 bottom-0 z-30 w-1 cursor-col-resize touch-none bg-transparent hover:bg-primary/40 active:bg-primary/60 transition-colors`}),(0,o.jsxs)($r,{className:`shrink-0 flex-row items-center justify-between gap-2 space-y-0 px-4 py-2 border-b bg-muted/30`,children:[(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(ti,{className:`truncate text-xs font-medium tracking-wide text-muted-foreground`,children:b}),u?(0,o.jsx)(ni,{className:`truncate text-xs`,children:u}):(0,o.jsxs)(ni,{className:`sr-only`,children:[`Record detail overlay for `,b,`.`]})]}),(0,o.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[g&&(0,o.jsx)(`button`,{type:`button`,onClick:g,"aria-label":_,title:_,className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(c.Maximize2,{className:`h-3.5 w-3.5`})}),(0,o.jsx)(Jr,{asChild:!0,children:(0,o.jsx)(`button`,{type:`button`,"aria-label":`Close`,title:`Close`,className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(c.X,{className:`h-3.5 w-3.5`})})})]})]}),(0,o.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto`,children:w(t)})]})});if(n===`modal`)return(0,o.jsx)(Tt,{open:e,onOpenChange:i,children:(0,o.jsxs)(At,{className:z(`w-[calc(100vw-1rem)] max-w-none sm:max-w-[var(--ov-w,42rem)] max-h-[90vh] overflow-y-auto`,d),style:y,children:[g&&(0,o.jsx)(`button`,{type:`button`,onClick:g,"aria-label":_,title:_,className:`absolute right-12 top-4 z-10 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors`,children:(0,o.jsx)(c.Maximize2,{className:`h-4 w-4`})}),(0,o.jsxs)(jt,{children:[(0,o.jsx)(Nt,{children:b}),u?(0,o.jsx)(Pt,{children:u}):(0,o.jsxs)(Pt,{className:`sr-only`,children:[`Record detail overlay for `,b,`.`]})]}),(0,o.jsx)(`div`,{className:`mt-4`,children:w(t)})]})});if(n===`split`){if(!e||!m)return null;let n=a&&typeof a==`number`?Math.min(70,Math.max(20,a/1200*100)):40,i=100-n;return(0,o.jsxs)(Nr,{direction:`horizontal`,className:z(`h-full`,d),children:[(0,o.jsx)(Pr,{defaultSize:i,minSize:30,children:m}),(0,o.jsx)(Fr,{withHandle:!0}),(0,o.jsx)(Pr,{defaultSize:n,minSize:20,children:(0,o.jsxs)(`div`,{className:`h-full overflow-y-auto p-4`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,o.jsx)(`h3`,{className:`text-lg font-semibold`,children:b}),(0,o.jsx)(`button`,{onClick:r,className:`rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,"aria-label":`Close panel`,children:(0,o.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,o.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,o.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),u&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:u}),w(t)]})})]})}return n===`popover`?h?(0,o.jsxs)(Dr,{open:e,onOpenChange:i,children:[h&&(0,o.jsx)(Or,{asChild:!0,children:h}),(0,o.jsx)(kr,{className:z(`w-96 max-h-[400px] overflow-y-auto p-4`,d),style:y,children:(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsx)(`h4`,{className:`text-sm font-semibold`,children:b}),u&&(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u}),w(t)]})})]}):e?(0,o.jsx)(Tt,{open:e,onOpenChange:i,children:(0,o.jsxs)(At,{className:z(`w-96 max-h-[80vh] overflow-y-auto p-4`,d),style:y,children:[(0,o.jsxs)(jt,{children:[(0,o.jsx)(Nt,{className:`text-sm`,children:b}),u?(0,o.jsx)(Pt,{className:`text-xs`,children:u}):(0,o.jsxs)(Pt,{className:`sr-only`,children:[`Record detail overlay for `,b,`.`]})]}),(0,o.jsx)(`div`,{className:`mt-2`,children:w(t)})]})}):null:null};ws.displayName=`NavigationOverlay`;function Ts({className:e,...t}){return(0,o.jsx)(`div`,{role:`status`,"aria-label":`Loading`,className:z(`flex items-center justify-center`,e),...t,children:(0,o.jsx)(c.Loader2,{className:`animate-spin text-muted-foreground w-full h-full min-w-4 min-h-4`})})}var Es={addGroup:`Add group field`,collapseTitle:`Collapsed by default`,removeTitle:`Remove`,ascendingTitle:`Ascending`,descendingTitle:`Descending`};function Ds({value:e,onChange:t,fieldOptions:n,maxLevels:r=3,className:i,labels:a}){let s={...Es,...a||{}},l=e?.fields??[],u=new Set(l.map(e=>e.field)),d=e=>{t(e.length?{fields:e}:void 0)};return(0,o.jsxs)(`div`,{"data-testid":`grouping-editor`,className:z(`flex flex-col gap-1.5 w-full`,i),children:[l.map((e,t)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,o.jsx)(`select`,{"data-testid":`grouping-field-${t}`,className:`text-xs h-7 rounded-md border border-input bg-background px-2 text-foreground flex-1 min-w-0`,value:e.field,onChange:n=>{let r=[...l];r[t]={...e,field:n.target.value},d(r)},children:n.filter(t=>t.value===e.field||!u.has(t.value)).map(e=>(0,o.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,o.jsx)(`button`,{type:`button`,title:e.order===`asc`?s.ascendingTitle:s.descendingTitle,"data-testid":`grouping-order-${t}`,className:`flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background text-foreground hover:bg-muted`,onClick:()=>{let n=[...l];n[t]={...e,order:e.order===`asc`?`desc`:`asc`},d(n)},children:e.order===`asc`?(0,o.jsx)(c.ArrowUp,{className:`h-3 w-3`}):(0,o.jsx)(c.ArrowDown,{className:`h-3 w-3`})}),(0,o.jsx)(`label`,{title:s.collapseTitle,className:`flex items-center text-xs text-muted-foreground`,children:(0,o.jsx)(`input`,{type:`checkbox`,"data-testid":`grouping-collapsed-${t}`,className:`h-3 w-3`,checked:e.collapsed,onChange:n=>{let r=[...l];r[t]={...e,collapsed:n.target.checked},d(r)}})}),(0,o.jsx)(`button`,{type:`button`,title:s.removeTitle,"data-testid":`grouping-remove-${t}`,className:`flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background text-muted-foreground hover:bg-muted hover:text-destructive`,onClick:()=>{d(l.filter((e,n)=>n!==t))},children:(0,o.jsx)(c.X,{className:`h-3 w-3`})})]},t)),l.length<r&&(()=>{let e=n.filter(e=>!u.has(e.value));return e.length===0?null:(0,o.jsxs)(`button`,{type:`button`,"data-testid":`grouping-add`,className:`flex h-7 items-center gap-1 self-start rounded-md border border-dashed border-input bg-background px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:()=>{d([...l,{field:e[0].value,order:`asc`,collapsed:!1}])},children:[(0,o.jsx)(c.Plus,{className:`h-3 w-3`}),s.addGroup]})})()]})}var Os=({params:e,open:t,onSubmit:n,onCancel:r,title:i=`Action Parameters`,description:s=`Please provide the required parameters.`})=>{let[c,l]=(0,a.useState)(()=>{let t={};return e.forEach(e=>{e.defaultValue===void 0?t[e.name]=e.type===`boolean`?!1:``:t[e.name]=e.defaultValue}),t}),[u,d]=(0,a.useState)({}),f=(0,a.useCallback)((e,t)=>{l(n=>({...n,[e]:t})),d(t=>{let n={...t};return delete n[e],n})},[]),p=(0,a.useCallback)(()=>{let t={};if(e.forEach(e=>{if(e.required){let n=c[e.name];(n==null||n===``)&&(t[e.name]=`${e.label} is required`)}}),Object.keys(t).length>0){d(t);return}n(c)},[e,c,n]);return(0,o.jsx)(Tt,{open:t,onOpenChange:e=>{e||r()},children:(0,o.jsxs)(At,{className:`sm:max-w-[425px]`,children:[(0,o.jsxs)(jt,{children:[(0,o.jsx)(Nt,{children:i}),(0,o.jsx)(Pt,{children:s})]}),(0,o.jsx)(`div`,{className:`space-y-4 py-4`,children:e.map(e=>{let t=c[e.name],n=u[e.name];switch(e.type){case`textarea`:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsx)(na,{id:e.name,value:t||``,onChange:t=>f(e.name,t.target.value),placeholder:e.placeholder}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name);case`number`:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsx)(K,{id:e.name,type:`number`,value:t??``,onChange:t=>f(e.name,Number.isNaN(t.target.valueAsNumber)?``:t.target.valueAsNumber),placeholder:e.placeholder}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name);case`boolean`:return(0,o.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,o.jsx)(xt,{id:e.name,checked:!!t,onCheckedChange:t=>f(e.name,!!t)}),(0,o.jsx)(G,{htmlFor:e.name,children:e.label}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground ml-2`,children:e.helpText})]},e.name);case`select`:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsxs)(Rr,{value:t||``,onValueChange:t=>f(e.name,t),children:[(0,o.jsx)(q,{children:(0,o.jsx)(Br,{placeholder:e.placeholder||`Select...`})}),(0,o.jsx)(J,{children:e.options?.map(e=>(0,o.jsx)(Y,{value:e.value,children:e.label},e.value))})]}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name);case`date`:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsx)(K,{id:e.name,type:`date`,value:t||``,onChange:t=>f(e.name,t.target.value)}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name);default:return(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsxs)(G,{htmlFor:e.name,children:[e.label,e.required&&(0,o.jsx)(`span`,{className:`text-destructive ml-1`,children:`*`})]}),(0,o.jsx)(K,{id:e.name,type:`text`,value:t||``,onChange:t=>f(e.name,t.target.value),placeholder:e.placeholder}),e.helpText&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.helpText}),n&&(0,o.jsx)(`p`,{className:`text-sm text-destructive`,children:n})]},e.name)}})}),(0,o.jsxs)(Mt,{children:[(0,o.jsx)(V,{variant:`outline`,onClick:r,children:`Cancel`}),(0,o.jsx)(V,{onClick:p,children:`Continue`})]})]})})};Os.displayName=`ActionParamDialog`;function ks({rows:e=5,columns:t=4,className:n,...r}){return(0,o.jsxs)(`div`,{"data-slot":`grid-skeleton`,className:z(`w-full space-y-2`,n),...r,children:[(0,o.jsx)(`div`,{className:`flex gap-4 px-4 py-2`,children:Array.from({length:t}).map((e,t)=>(0,o.jsx)(X,{className:`h-4 flex-1 rounded`},t))}),Array.from({length:e}).map((e,n)=>(0,o.jsx)(`div`,{className:`flex gap-4 rounded-md border px-4 py-3`,children:Array.from({length:t}).map((e,t)=>(0,o.jsx)(X,{className:z(`h-4 flex-1 rounded`,t===0&&`max-w-[40%]`)},t))},n))]})}function As({columns:e=3,cardsPerColumn:t=3,className:n,...r}){return(0,o.jsx)(`div`,{"data-slot":`kanban-skeleton`,className:z(`flex gap-4 overflow-x-auto`,n),...r,children:Array.from({length:e}).map((e,n)=>(0,o.jsxs)(`div`,{className:`flex w-72 shrink-0 flex-col gap-3 rounded-lg border bg-muted/30 p-3`,children:[(0,o.jsx)(X,{className:`h-5 w-24 rounded`}),Array.from({length:t}).map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-2 rounded-md border bg-background p-3`,children:[(0,o.jsx)(X,{className:`h-4 w-3/4 rounded`}),(0,o.jsx)(X,{className:`h-3 w-1/2 rounded`})]},t))]},n))})}function js({rows:e=4,className:t,...n}){return(0,o.jsxs)(`div`,{"data-slot":`form-skeleton`,className:z(`w-full max-w-lg space-y-6`,t),...n,children:[Array.from({length:e}).map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-2`,children:[(0,o.jsx)(X,{className:`h-4 w-28 rounded`}),(0,o.jsx)(X,{className:`h-9 w-full rounded-md`})]},t)),(0,o.jsx)(X,{className:`h-9 w-24 rounded-md`})]})}function Ms({rows:e=5,className:t,...n}){return(0,o.jsx)(`div`,{"data-slot":`list-skeleton`,className:z(`w-full space-y-3`,t),...n,children:Array.from({length:e}).map((e,t)=>(0,o.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border px-4 py-3`,children:[(0,o.jsx)(X,{className:`size-8 shrink-0 rounded-full`}),(0,o.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,o.jsx)(X,{className:`h-4 w-3/5 rounded`}),(0,o.jsx)(X,{className:`h-3 w-2/5 rounded`})]})]},t))})}function Ns({className:e,...t}){return(0,o.jsxs)(`div`,{"data-slot":`chart-skeleton`,className:z(`w-full space-y-4`,e),...t,children:[(0,o.jsx)(X,{className:`h-5 w-40 rounded`}),(0,o.jsx)(`div`,{className:`flex h-48 items-end gap-2 rounded-md border p-4`,children:[`h-2/5`,`h-3/5`,`h-1/3`,`h-4/5`,`h-1/2`,`h-3/4`,`h-2/5`].map((e,t)=>(0,o.jsx)(X,{className:z(`flex-1 rounded-t`,e)},t))}),(0,o.jsxs)(`div`,{className:`flex gap-4`,children:[(0,o.jsx)(X,{className:`h-3 w-16 rounded`}),(0,o.jsx)(X,{className:`h-3 w-16 rounded`}),(0,o.jsx)(X,{className:`h-3 w-16 rounded`})]})]})}function Ps({variant:e,...t}){switch(e){case`grid`:return(0,o.jsx)(ks,{...t});case`kanban`:return(0,o.jsx)(As,{...t});case`form`:return(0,o.jsx)(js,{...t});case`list`:return(0,o.jsx)(Ms,{...t});case`chart`:return(0,o.jsx)(Ns,{...t})}}function Fs({className:e,...t}){return(0,o.jsx)(`div`,{"data-slot":`shimmer-skeleton`,className:z(`rounded-md bg-muted`,`motion-safe:bg-[linear-gradient(90deg,hsl(var(--muted))_0%,hsl(var(--muted-foreground)/0.12)_50%,hsl(var(--muted))_100%)]`,`motion-safe:bg-[length:200%_100%] motion-safe:animate-shimmer`,e),...t})}var Is={"zh-CN":{addToFavorites:`加入收藏`,removeFromFavorites:`从收藏移除`,copyRecordId:`复制记录 ID`,copied:`已复制`},"zh-TW":{addToFavorites:`加入收藏`,removeFromFavorites:`從收藏移除`,copyRecordId:`複製記錄 ID`,copied:`已複製`}},Ls=()=>{if(typeof document<`u`){let e=document.documentElement?.lang;if(e)return e}return typeof navigator<`u`&&navigator.language?navigator.language:`en`},Rs=(e,t)=>{let n=Ls(),r=Is[n],i=n.split(`-`)[0],a=r||(i===`zh`?Is[`zh-CN`]:void 0);return a&&a[e]||t},zs=({title:e,icon:t,objectLabel:n,resourceId:r,showStar:i=!0,showCopyId:s=!0,isFavorite:l,onToggleFavorite:u,className:d,inlineExtras:f})=>{let[p,m]=a.default.useState(!1),[h,g]=a.default.useState(!1),_=l??p,v=a.default.useCallback(()=>{let e=!_;u&&u(e),l===void 0&&m(e)},[_,l,u]),y=a.default.useCallback(()=>{if(r)try{typeof navigator<`u`&&navigator.clipboard&&navigator.clipboard.writeText(r),g(!0),setTimeout(()=>g(!1),1500)}catch{}},[r]),b=_?Rs(`removeFromFavorites`,`Remove from favourites`):Rs(`addToFavorites`,`Add to favourites`),x=h?Rs(`copied`,`Copied`):Rs(`copyRecordId`,`Copy record ID`);return(0,o.jsx)(ai,{children:(0,o.jsx)(`div`,{className:z(`flex flex-col min-w-0`,d),children:(0,o.jsxs)(`div`,{className:`flex items-baseline gap-2 flex-wrap`,children:[t&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0 self-center`,"aria-hidden":!0,children:t}),(0,o.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold truncate`,children:e}),n&&(0,o.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground/70 shrink-0`,children:n}),s&&r&&(0,o.jsxs)(oi,{children:[(0,o.jsx)(si,{asChild:!0,children:(0,o.jsx)(V,{variant:`ghost`,size:`icon`,className:`h-5 w-5 shrink-0 text-muted-foreground/50 hover:text-foreground`,onClick:y,"aria-label":x,children:h?(0,o.jsx)(c.Check,{className:`h-3 w-3 text-green-600`}):(0,o.jsx)(c.Copy,{className:`h-3 w-3`})})}),(0,o.jsx)(ci,{children:x})]}),i&&(0,o.jsxs)(oi,{children:[(0,o.jsx)(si,{asChild:!0,children:(0,o.jsx)(V,{variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:v,"aria-label":b,"aria-pressed":_,children:(0,o.jsx)(c.Star,{className:z(`h-4 w-4`,_?`fill-yellow-400 text-yellow-400`:`text-muted-foreground`)})})}),(0,o.jsx)(ci,{children:b})]}),f]})})})},Bs=!1;function Vs(){if(Bs||typeof document>`u`)return;let e=`objui-refresh-indicator-kf`;if(document.getElementById(e)){Bs=!0;return}let t=document.createElement(`style`);t.id=e,t.textContent=`
|
|
14
14
|
@keyframes objui-refresh-bar {
|
|
15
15
|
0% { transform: translateX(-100%); }
|
|
16
16
|
100% { transform: translateX(400%); }
|
|
17
17
|
}
|
|
18
|
-
`,document.head.appendChild(t),ys=!0}var xs=({active:e,ariaLabel:t=`Refreshing`,className:n,...r})=>(a.useEffect(()=>{e&&bs()},[e]),e?(0,o.jsx)(`div`,{className:z(`pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden`,n),role:`progressbar`,"aria-busy":`true`,"aria-label":t,"data-testid":`refresh-indicator`,...r,children:(0,o.jsx)(`div`,{className:`h-full w-1/4 rounded-full bg-primary/70`,style:{animation:`objui-refresh-bar 1.1s ease-in-out infinite`}})}):null);xs.displayName=`RefreshIndicator`;function Ss({className:e,message:t=`Loading…`,...n}){return(0,o.jsxs)(`div`,{role:`status`,"aria-label":t,"data-slot":`data-loading-state`,className:z(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...n,children:[(0,o.jsx)(c.Loader2,{className:`size-6 animate-spin text-muted-foreground`}),t&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]})}function Cs({className:e,icon:t,illustration:n,showIcon:r=!0,iconWrapperClassName:i,title:a=`No data`,description:s,action:l,children:u,...d}){let f=r&&(t!=null||!n);return(0,o.jsxs)(`div`,{"data-slot":`data-empty-state`,className:z(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...d,children:[n&&(0,o.jsx)(`div`,{"data-slot":`data-empty-state-illustration`,className:`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-300 [&_svg]:max-h-40 [&_svg]:w-auto`,"aria-hidden":!0,children:n}),f&&(0,o.jsx)(`div`,{"data-slot":`data-empty-state-icon`,className:z(i??`flex size-10 items-center justify-center rounded-lg bg-muted`),children:t??(0,o.jsx)(c.InboxIcon,{className:`size-5 text-muted-foreground`})}),a&&(0,o.jsx)(`h3`,{className:`text-sm font-medium`,children:a}),s&&(0,o.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:s}),l,u]})}function ws({className:e,title:t=`Something went wrong`,message:n,onRetry:r,retryLabel:i=`Retry`,children:a,...s}){return(0,o.jsxs)(`div`,{role:`alert`,"data-slot":`data-error-state`,className:z(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...s,children:[(0,o.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-lg bg-destructive/10`,children:(0,o.jsx)(c.AlertCircle,{className:`size-5 text-destructive`})}),t&&(0,o.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),n&&(0,o.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:n}),r&&(0,o.jsx)(U,{variant:`outline`,size:`sm`,onClick:r,children:i}),a]})}var Ts=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(Et,{children:[(0,o.jsx)(Ot,{}),(0,o.jsxs)(b.Content,{ref:r,className:z(`fixed inset-0 z-50 w-full bg-background p-4 shadow-lg duration-200`,`h-[100dvh]`,`sm:inset-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%]`,`sm:max-w-lg sm:h-auto sm:max-h-[90vh] sm:rounded-lg sm:border sm:p-6`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]`,`data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...n,children:[t,(0,o.jsxs)(b.Close,{className:z(`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity`,`hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,`disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 flex items-center justify-center`),children:[(0,o.jsx)(c.X,{className:`h-5 w-5 sm:h-4 sm:w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Ts.displayName=`MobileDialogContent`;function Es(e){return!e&&e!==0?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function Ds({open:e,onOpenChange:t,job:n,title:r,description:i,filename:s,allowCloseWhileRunning:l=!0,className:u,onAfterDownload:d,closeAfterDownloadMs:f}){let{progress:p,error:m,isRunning:h,cancel:g,download:_,reset:v}=n,y=p?.status,b=typeof p?.percentComplete==`number`?Math.max(0,Math.min(100,p.percentComplete)):void 0,x=y===`completed`,S=y===`failed`||y===`expired`,C=y===`cancelled`,w=a.useCallback(async()=>{await _(s)&&(d?.(),f&&f>0&&setTimeout(()=>t(!1),f))},[_,s,d,f,t]),T=a.useCallback(e=>{!e&&h&&!l||(t(e),!e&&!h&&setTimeout(v,0))},[h,l,t,v]),E=r??(x?`Export ready`:S?`Export failed`:C?`Export cancelled`:`Exporting…`),D=i??(x?`Your export is ready to download.`:S?`The export job did not complete.`:C?`The export was cancelled.`:`Your export is being prepared on the server. You can close this window — the job will continue in the background.`);return(0,o.jsx)(wt,{open:e,onOpenChange:T,children:(0,o.jsxs)(kt,{"data-testid":`export-progress-dialog`,className:z(`sm:max-w-md`,u),children:[(0,o.jsxs)(At,{children:[(0,o.jsxs)(Mt,{className:`flex items-center gap-2`,children:[x?(0,o.jsx)(c.CheckCircle2,{className:`h-5 w-5 text-green-600`,"aria-hidden":`true`}):S?(0,o.jsx)(c.AlertCircle,{className:`h-5 w-5 text-destructive`,"aria-hidden":`true`}):(0,o.jsx)(c.Loader2,{className:z(`h-5 w-5 text-muted-foreground`,h&&`animate-spin`),"aria-hidden":`true`}),E]}),(0,o.jsx)(Nt,{children:D})]}),(0,o.jsxs)(`div`,{className:`py-2 space-y-3`,children:[(h||x)&&(0,o.jsx)(`div`,{"data-testid":`export-progress-bar`,children:b===void 0?(0,o.jsx)(kr,{value:void 0,"aria-label":`Export progress (indeterminate)`}):(0,o.jsx)(kr,{value:b,"aria-label":`Export progress`})}),(0,o.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,o.jsx)(`span`,{"data-testid":`export-progress-counts`,children:p?.processedRecords==null?h?`Starting…`:``:`${p.processedRecords.toLocaleString()}${p.totalRecords==null?``:` / ${p.totalRecords.toLocaleString()}`} records`}),(0,o.jsx)(`span`,{"data-testid":`export-progress-percent`,children:b===void 0?``:`${b.toFixed(0)}%`})]}),p?.fileSize?(0,o.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:Es(p.fileSize)}):null,(m||p?.error)&&(0,o.jsx)(`div`,{"data-testid":`export-progress-error`,className:`text-xs text-destructive bg-destructive/10 border border-destructive/30 rounded-md px-2 py-1`,children:m?.message||p?.error?.message})]}),(0,o.jsxs)(jt,{className:`gap-2 sm:gap-2`,children:[h&&(0,o.jsxs)(U,{type:`button`,variant:`ghost`,onClick:()=>g(),"data-testid":`export-progress-cancel`,children:[(0,o.jsx)(c.X,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,o.jsx)(`span`,{className:`ml-1`,children:`Cancel`})]}),x&&(0,o.jsxs)(U,{type:`button`,variant:`default`,onClick:w,"data-testid":`export-progress-download`,children:[(0,o.jsx)(c.Download,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,o.jsx)(`span`,{className:`ml-1`,children:`Download`})]}),!h&&(0,o.jsx)(U,{type:`button`,variant:`outline`,onClick:()=>T(!1),"data-testid":`export-progress-close`,children:`Close`})]})]})})}t.ComponentRegistry.register(`combobox`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(to,{options:e.options||[],placeholder:e.placeholder,value:e.value,disabled:e.disabled,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i})},{namespace:`ui`,label:`Combobox`,inputs:[{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`value`,type:`string`,label:`Value`},{name:`disabled`,type:`boolean`,label:`Disabled`,defaultValue:!1},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{placeholder:`Select option...`,options:[]}}),t.ComponentRegistry.register(`command`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsxs)(Pt,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:[(0,o.jsx)(It,{placeholder:e.placeholder||`Type a command or search...`}),(0,o.jsxs)(Lt,{children:[(0,o.jsx)(Rt,{children:e.emptyText||`No results found.`}),e.groups?.map((e,t)=>(0,o.jsx)(zt,{heading:e.heading,children:e.items?.map((e,t)=>(0,o.jsx)(Vt,{value:e.value,children:e.label},t))},t))]})]})},{namespace:`ui`,label:`Command`,inputs:[{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`emptyText`,type:`string`,label:`Empty Text`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{placeholder:`Type a command or search...`,emptyText:`No results found.`,groups:[]}});var Os=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n,l=e.clickable||!!n.onClick;return(0,o.jsxs)(Ze,{ref:r,className:z(t,(e.hoverable||l)&&`transition-colors hover:bg-muted/50`,l&&`cursor-pointer active:bg-muted`),...c,"data-obj-id":i,"data-obj-type":a,style:s,children:[(e.title||e.description||e.header)&&(0,o.jsxs)(Qe,{children:[e.title&&(0,o.jsx)($e,{children:e.title}),e.description&&(0,o.jsx)(et,{children:e.description}),e.header&&B(e.header)]}),(e.children||e.body)&&(0,o.jsx)(tt,{children:B(e.children||e.body)}),e.footer&&(0,o.jsx)(nt,{className:`flex justify-between`,children:B(e.footer)})]})});t.ComponentRegistry.register(`card`,Os,{namespace:`ui`,label:`Card`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`Card Title`,description:`Card description goes here`,className:`w-full`},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}}),t.ComponentRegistry.register(`tabs`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=i,u=e=>{n&&n(e)},d=e.orientation===`vertical`;return(0,o.jsxs)(Xi,{defaultValue:r===void 0?e.defaultValue:void 0,value:r??e.value,onValueChange:u,orientation:e.orientation||`horizontal`,className:z(t,d&&`flex gap-2`),...l,"data-obj-id":a,"data-obj-type":s,style:c,children:[(0,o.jsx)(Zi,{className:z(d&&`flex-col h-auto items-stretch bg-muted/50 p-1`),children:e.items?.map(e=>(0,o.jsx)(Qi,{value:e.value,disabled:e.disabled,className:z(d&&`justify-start`),children:e.label},e.value))}),e.items?.map(e=>(0,o.jsx)($i,{value:e.value,className:z(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,d&&`mt-0 flex-1`),children:B(e.content||e.body)},e.value))]})},{namespace:`ui`,label:`Tabs`,inputs:[{name:`defaultValue`,type:`string`,label:`Default Value`,required:!0},{name:`className`,type:`string`,label:`CSS Class`},{name:`items`,type:`array`,label:`Items`}],defaultProps:{defaultValue:`tab1`,items:[{label:`Tab 1`,value:`tab1`,body:[{type:`text`,content:`Content for Tab 1`}]},{label:`Tab 2`,value:`tab2`,body:[{type:`text`,content:`Content for Tab 2`}]},{label:`Tab 3`,value:`tab3`,body:[{type:`text`,content:`Content for Tab 3`}]}],className:`w-full`}});var ks={1:`grid-cols-1`,2:`grid-cols-2`,3:`grid-cols-3`,4:`grid-cols-4`,5:`grid-cols-5`,6:`grid-cols-6`,7:`grid-cols-7`,8:`grid-cols-8`,9:`grid-cols-9`,10:`grid-cols-10`,11:`grid-cols-11`,12:`grid-cols-12`},As={1:`sm:grid-cols-1`,2:`sm:grid-cols-2`,3:`sm:grid-cols-3`,4:`sm:grid-cols-4`,5:`sm:grid-cols-5`,6:`sm:grid-cols-6`,7:`sm:grid-cols-7`,8:`sm:grid-cols-8`,9:`sm:grid-cols-9`,10:`sm:grid-cols-10`,11:`sm:grid-cols-11`,12:`sm:grid-cols-12`},js={1:`md:grid-cols-1`,2:`md:grid-cols-2`,3:`md:grid-cols-3`,4:`md:grid-cols-4`,5:`md:grid-cols-5`,6:`md:grid-cols-6`,7:`md:grid-cols-7`,8:`md:grid-cols-8`,9:`md:grid-cols-9`,10:`md:grid-cols-10`,11:`md:grid-cols-11`,12:`md:grid-cols-12`},Ms={1:`lg:grid-cols-1`,2:`lg:grid-cols-2`,3:`lg:grid-cols-3`,4:`lg:grid-cols-4`,5:`lg:grid-cols-5`,6:`lg:grid-cols-6`,7:`lg:grid-cols-7`,8:`lg:grid-cols-8`,9:`lg:grid-cols-9`,10:`lg:grid-cols-10`,11:`lg:grid-cols-11`,12:`lg:grid-cols-12`},Ns={1:`xl:grid-cols-1`,2:`xl:grid-cols-2`,3:`xl:grid-cols-3`,4:`xl:grid-cols-4`,5:`xl:grid-cols-5`,6:`xl:grid-cols-6`,7:`xl:grid-cols-7`,8:`xl:grid-cols-8`,9:`xl:grid-cols-9`,10:`xl:grid-cols-10`,11:`xl:grid-cols-11`,12:`xl:grid-cols-12`},Ps={0:`gap-0`,1:`gap-1`,2:`gap-2`,3:`gap-3`,4:`gap-4`,5:`gap-5`,6:`gap-6`,8:`gap-8`,10:`gap-10`,12:`gap-12`};t.ComponentRegistry.register(`grid`,({schema:e,className:t,...n})=>{let r=2,i,a,s,c;typeof e.columns==`number`?r=e.columns:typeof e.columns==`object`&&e.columns!==null&&(r=e.columns.xs??1,i=e.columns.sm,a=e.columns.md,s=e.columns.lg,c=e.columns.xl),e.smColumns&&(i=e.smColumns),e.mdColumns&&(a=e.mdColumns),e.lgColumns&&(s=e.lgColumns),e.xlColumns&&(c=e.xlColumns);let l=e.gap??4,u=z(`grid`,ks[r]||`grid-cols-2`,i&&As[i],a&&js[a],s&&Ms[s],c&&Ns[c],Ps[l]||`gap-[${l*.25}rem]`,t),{"data-obj-id":d,"data-obj-type":f,style:p,...m}=n;return(0,o.jsx)(`div`,{className:u,...m,"data-obj-id":d,"data-obj-type":f,style:p,children:e.children&&B(e.children)})},{namespace:`ui`,label:`Grid Layout`,inputs:[{name:`columns`,type:`number`,label:`Base Columns (Mobile)`,defaultValue:2,description:`Number of columns on mobile devices`},{name:`smColumns`,type:`number`,label:`SM Columns (Tablet)`,description:`Columns at sm breakpoint (>640px)`},{name:`mdColumns`,type:`number`,label:`MD Columns (Laptop)`,description:`Columns at md breakpoint (>768px)`},{name:`lgColumns`,type:`number`,label:`LG Columns (Desktop)`,description:`Columns at lg breakpoint (>1024px)`},{name:`xlColumns`,type:`number`,label:`XL Columns (Wide)`,description:`Columns at xl breakpoint (>1280px)`},{name:`gap`,type:`number`,label:`Gap`,defaultValue:4,description:`Gap between items (0-12)`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{columns:1,mdColumns:2,lgColumns:4,gap:4,children:[{type:`card`,title:`Card 1`,description:`First card`},{type:`card`,title:`Card 2`,description:`Second card`},{type:`card`,title:`Card 3`,description:`Third card`},{type:`card`,title:`Card 4`,description:`Fourth card`}]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}}),t.ComponentRegistry.register(`flex`,({schema:e,className:t,...n})=>{let r=e.direction||`row`,i=e.justify||`start`,a=e.align||`start`,s=e.gap||2,c=e.wrap||!1,l=z(`flex`,r===`row`&&`flex-row`,r===`col`&&`flex-col`,r===`row-reverse`&&`flex-row-reverse`,r===`col-reverse`&&`flex-col-reverse`,i===`start`&&`justify-start`,i===`end`&&`justify-end`,i===`center`&&`justify-center`,i===`between`&&`justify-between`,i===`around`&&`justify-around`,i===`evenly`&&`justify-evenly`,a===`start`&&`items-start`,a===`end`&&`items-end`,a===`center`&&`items-center`,a===`baseline`&&`items-baseline`,a===`stretch`&&`items-stretch`,s===0&&`gap-0`,s===1&&`gap-1`,s===2&&`gap-1.5 sm:gap-2`,s===3&&`gap-2 sm:gap-3`,s===4&&`gap-2 sm:gap-3 md:gap-4`,s===5&&`gap-3 sm:gap-4 md:gap-5`,s===6&&`gap-3 sm:gap-4 md:gap-6`,s===7&&`gap-4 sm:gap-5 md:gap-7`,s===8&&`gap-4 sm:gap-6 md:gap-8`,c&&`flex-wrap`,t),{"data-obj-id":u,"data-obj-type":d,style:f,...p}=n;return(0,o.jsx)(`div`,{className:l,...p,"data-obj-id":u,"data-obj-type":d,style:f,children:e.children&&B(e.children)})},{namespace:`ui`,label:`Flex Layout`,inputs:[{name:`direction`,type:`enum`,enum:[`row`,`col`,`row-reverse`,`col-reverse`],label:`Direction`,defaultValue:`row`},{name:`justify`,type:`enum`,enum:[`start`,`end`,`center`,`between`,`around`,`evenly`],label:`Justify Content`,defaultValue:`start`},{name:`align`,type:`enum`,enum:[`start`,`end`,`center`,`baseline`,`stretch`],label:`Align Items`,defaultValue:`start`},{name:`gap`,type:`number`,label:`Gap`,defaultValue:2,description:`Gap between items (0-8)`},{name:`wrap`,type:`boolean`,label:`Wrap`,defaultValue:!1,description:`Allow flex items to wrap`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{direction:`row`,justify:`start`,align:`center`,gap:2,wrap:!1,children:[{type:`button`,label:`Button 1`},{type:`button`,label:`Button 2`},{type:`button`,label:`Button 3`}]}});var Fs=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let i=e.direction||`col`,a=e.justify||`start`,s=e.align||`stretch`,c=e.gap??e.spacing??2,l=e.wrap||!1,u=z(`flex`,i===`row`&&`flex-row`,i===`col`&&`flex-col`,i===`row-reverse`&&`flex-row-reverse`,i===`col-reverse`&&`flex-col-reverse`,a===`start`&&`justify-start`,a===`end`&&`justify-end`,a===`center`&&`justify-center`,a===`between`&&`justify-between`,a===`around`&&`justify-around`,a===`evenly`&&`justify-evenly`,s===`start`&&`items-start`,s===`end`&&`items-end`,s===`center`&&`items-center`,s===`baseline`&&`items-baseline`,s===`stretch`&&`items-stretch`,c===0&&`gap-0`,c===1&&`gap-1`,c===2&&`gap-1.5 sm:gap-2`,c===3&&`gap-2 sm:gap-3`,c===4&&`gap-2 sm:gap-3 md:gap-4`,c===5&&`gap-3 sm:gap-4 md:gap-5`,c===6&&`gap-3 sm:gap-4 md:gap-6`,c===8&&`gap-4 sm:gap-6 md:gap-8`,c===10&&`gap-5 sm:gap-7 md:gap-10`,l&&`flex-wrap`,t),{"data-obj-id":d,"data-obj-type":f,style:p,...m}=n;return(0,o.jsx)(`div`,{ref:r,className:u,...m,"data-obj-id":d,"data-obj-type":f,style:p,children:e.children&&B(e.children)})});t.ComponentRegistry.register(`stack`,Fs,{namespace:`ui`,label:`Stack`,inputs:[{name:`direction`,type:`enum`,label:`Direction`,enum:[`col`,`row`,`col-reverse`,`row-reverse`],defaultValue:`col`},{name:`gap`,type:`number`,label:`Gap`,defaultValue:2},{name:`align`,type:`enum`,label:`Align Items`,enum:[`start`,`end`,`center`,`stretch`,`baseline`],defaultValue:`stretch`},{name:`justify`,type:`enum`,label:`Justify Content`,enum:[`start`,`end`,`center`,`between`,`around`,`evenly`],defaultValue:`start`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{direction:`col`,gap:2,align:`stretch`,children:[]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:100,minHeight:50}});var Is=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let i=e.maxWidth||`xl`,a=e.padding||4,s=e.centered!==!1,c=z(`w-full`,i===`sm`&&`max-w-sm`,i===`md`&&`max-w-md`,i===`lg`&&`max-w-lg`,i===`xl`&&`max-w-xl`,i===`2xl`&&`max-w-2xl`,i===`3xl`&&`max-w-3xl`,i===`4xl`&&`max-w-4xl`,i===`5xl`&&`max-w-5xl`,i===`6xl`&&`max-w-6xl`,i===`7xl`&&`max-w-7xl`,i===`full`&&`max-w-full`,i===`screen`&&`max-w-screen-2xl`,s&&`mx-auto`,a===0&&`p-0`,a===1&&`p-0.5 sm:p-1`,a===2&&`p-1 sm:p-2`,a===3&&`p-2 sm:p-3`,a===4&&`p-2 sm:p-3 md:p-4`,a===5&&`p-3 sm:p-4 md:p-5`,a===6&&`p-3 sm:p-4 md:p-6`,a===7&&`p-4 sm:p-5 md:p-7`,a===8&&`p-4 sm:p-6 md:p-8`,a===10&&`p-5 sm:p-7 md:p-10`,a===12&&`p-6 sm:p-8 md:p-12`,a===16&&`p-8 sm:p-10 md:p-16`,t),{"data-obj-id":l,"data-obj-type":u,style:d,...f}=n;return(0,o.jsx)(`div`,{ref:r,className:c,...f,"data-obj-id":l,"data-obj-type":u,style:d,children:e.children&&B(e.children)})});t.ComponentRegistry.register(`container`,Is,{namespace:`ui`,label:`Container`,inputs:[{name:`maxWidth`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`,`full`,`screen`],label:`Max Width`,defaultValue:`xl`},{name:`padding`,type:`number`,label:`Padding`,defaultValue:4,description:`Padding value (0, 1-8, 10, 12, 16)`},{name:`centered`,type:`boolean`,label:`Center Horizontally`,defaultValue:!0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{maxWidth:`xl`,padding:4,centered:!0,children:[{type:`text`,content:`Container content goes here`}]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}});function Ls(e){switch(e){case`small`:return`w-64`;case`medium`:return`w-80`;case`large`:return`w-96`;case`full`:return`w-full`;default:return e||`w-full`}}function Rs(e){switch(e){case`utility`:return`max-w-4xl`;case`home`:return`max-w-screen-2xl`;case`app`:return`max-w-screen-xl`;default:return`max-w-7xl`}}function Q(e,t){return e?.find(e=>e.name?.toLowerCase()===t.toLowerCase())}function zs(e,t){if(!e)return[];let n=new Set(t.map(e=>e.toLowerCase()));return e.filter(e=>!n.has(e.name?.toLowerCase()??``))}var $=({region:e,className:t})=>{let n=e.components||[];return n.length===0?null:(0,o.jsx)(`div`,{className:z(`space-y-4`,e.className,t),"data-region":e.name,children:n.map((t,n)=>(0,o.jsx)(i.SchemaRenderer,{schema:t},t?.id||`${e.name}-${n}`))})},Bs=({regions:e,pageType:t,className:n})=>{let r=Q(e,`header`),i=Q(e,`sidebar`),a=Q(e,`main`),s=Q(e,`aside`),c=Q(e,`footer`),l=zs(e,[`header`,`sidebar`,`main`,`aside`,`footer`]);return r||i||a||s||c?(0,o.jsxs)(`div`,{className:z(`flex flex-col gap-6`,n),"data-page-layout":t,children:[r&&(0,o.jsx)($,{region:r,className:z(Ls(r.width))}),(0,o.jsxs)(`div`,{className:`flex flex-1 gap-6`,children:[i&&(0,o.jsx)(`aside`,{className:z(`shrink-0`,Ls(i.width||`small`)),children:(0,o.jsx)($,{region:i})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[a&&(0,o.jsx)($,{region:a}),l.map((e,t)=>(0,o.jsx)($,{region:e},e.name||`extra-${t}`))]}),s&&(0,o.jsx)(`aside`,{className:z(`shrink-0`,Ls(s.width||`small`),s.className),children:(0,o.jsx)($,{region:s})})]}),c&&(0,o.jsx)($,{region:c,className:z(Ls(c.width))})]}):(0,o.jsx)(`div`,{className:z(`space-y-6`,n),"data-page-layout":t,children:e.map((e,t)=>(0,o.jsx)($,{region:e},e.name||t))})},Vs=({schema:e})=>{let t=e.body||e.children,n=Array.isArray(t)?t:t?[t]:[];return n.length===0?null:(0,o.jsx)(`div`,{className:`space-y-6`,children:n.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},e?.id||t))})},Hs=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Bs,{regions:e.regions,pageType:e.pageType}):(0,o.jsx)(Vs,{schema:e}),Us={default:Hs,"full-width":Hs,"header-sidebar-main":({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(Vs,{schema:e});let n=Q(t,`header`),r=Q(t,`sidebar`),i=Q(t,`main`),a=zs(t,[`header`,`sidebar`,`main`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`header-sidebar-main`,children:[n&&(0,o.jsx)($,{region:n}),(0,o.jsxs)(`div`,{className:`flex flex-1 gap-6`,children:[r&&(0,o.jsx)(`aside`,{className:z(`shrink-0`,Ls(r.width||`medium`)),children:(0,o.jsx)($,{region:r})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[i&&(0,o.jsx)($,{region:i}),a.map((e,t)=>(0,o.jsx)($,{region:e},e.name||`extra-${t}`))]})]})]})},"three-column":({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(Vs,{schema:e});let n=Q(t,`header`),r=Q(t,`sidebar`),i=Q(t,`main`),a=Q(t,`aside`),s=Q(t,`footer`),c=zs(t,[`header`,`sidebar`,`main`,`aside`,`footer`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`three-column`,children:[n&&(0,o.jsx)($,{region:n}),(0,o.jsxs)(`div`,{className:`flex flex-1 gap-6`,children:[r&&(0,o.jsx)(`aside`,{className:z(`shrink-0`,Ls(r.width||`small`)),children:(0,o.jsx)($,{region:r})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[i&&(0,o.jsx)($,{region:i}),c.map((e,t)=>(0,o.jsx)($,{region:e},e.name||`extra-${t}`))]}),a&&(0,o.jsx)(`aside`,{className:z(`shrink-0`,Ls(a.width||`small`),a.className),children:(0,o.jsx)($,{region:a})})]}),s&&(0,o.jsx)($,{region:s})]})},dashboard:({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(Vs,{schema:e});let n=Q(t,`header`),r=Q(t,`footer`),i=zs(t,[`header`,`footer`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`dashboard`,children:[n&&(0,o.jsx)($,{region:n}),(0,o.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:i.map((e,t)=>(0,o.jsx)($,{region:e},e.name||`region-${t}`))}),r&&(0,o.jsx)($,{region:r})]})}};function Ws(e){return e.template&&Us[e.template]||null}var Gs=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Bs,{regions:e.regions,pageType:`record`}):(0,o.jsx)(Vs,{schema:e}),Ks=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Bs,{regions:e.regions,pageType:`home`}):(0,o.jsx)(Vs,{schema:e}),qs=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Bs,{regions:e.regions,pageType:`app`}):(0,o.jsx)(Vs,{schema:e}),Js=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(Bs,{regions:e.regions,pageType:`utility`}):(0,o.jsx)(Vs,{schema:e}),Ys=({schema:e,className:t,...n})=>{let r=e.pageType||`record`,{"data-obj-id":s,"data-obj-type":c,style:l,pageType:u,schema:d,regions:f,template:p,title:m,icon:h,description:g,object:_,variables:v,blankLayout:y,body:b,isDefault:x,assignedProfiles:S,aria:C,recordOverride:w,permissions:T,requiredPermissions:E,enforceFieldSecurity:D,redactFields:O,children:k,...A}=n,ee=Object.fromEntries(Object.entries(A).filter(([e])=>!e.startsWith(`_`))),j=(0,a.useMemo)(()=>{let t=Ws(e);if(t)return(0,o.jsx)(t,{schema:e});switch(r){case`home`:return(0,o.jsx)(Ks,{schema:e});case`app`:return(0,o.jsx)(qs,{schema:e});case`utility`:return(0,o.jsx)(Js,{schema:e});default:return(0,o.jsx)(Gs,{schema:e})}},[e,r]),te=(0,o.jsx)(`div`,{className:z(`min-h-full w-full bg-background p-3 md:p-4 lg:p-6`,t),"data-page-type":r,"data-obj-id":s,"data-obj-type":c,style:l,...ee,children:(0,o.jsxs)(`div`,{className:z(`mx-auto space-y-6`,Rs(r)),children:[r!==`record`&&(e.title||e.description)&&(0,o.jsxs)(`div`,{className:`space-y-2`,children:[e.title&&(0,o.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground`,children:e.title}),e.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground`,children:e.description})]}),j]})});return e.variables&&e.variables.length>0?(0,o.jsx)(i.PageVariablesProvider,{definitions:e.variables,children:te}):te},Xs={namespace:`ui`,label:`Page`,icon:`Layout`,category:`layout`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`pageType`,type:`string`,label:`Page Type`},{name:`object`,type:`string`,label:`Object Name`},{name:`template`,type:`string`,label:`Template`},{name:`regions`,type:`array`,label:`Regions`,itemType:`object`},{name:`variables`,type:`array`,label:`Variables`,itemType:`object`},{name:`body`,type:`array`,label:`Content (Legacy)`,itemType:`component`}]};t.ComponentRegistry.register(`page`,Ys,Xs),t.ComponentRegistry.register(`app`,Ys,{...Xs,label:`App Page`}),t.ComponentRegistry.register(`utility`,Ys,{...Xs,label:`Utility Page`}),t.ComponentRegistry.register(`home`,Ys,{...Xs,label:`Home Page`}),t.ComponentRegistry.register(`record`,Ys,{...Xs,label:`Record Page`});var Zs=new Map,Qs=new Map,$s=new Set;function ec(e,t,n){return`${e}::${t??``}::${n??``}`}function tc(){for(let e of $s)e()}function nc(e,t,n){return Zs.get(ec(e,t,n))}function rc(e,t,n,r){let i=ec(e,t,n);Zs.get(i)!==r&&(Zs.set(i,r),tc())}async function ic(e,t,n,r){let i=ec(t,n,r),a=Zs.get(i);if(a!==void 0)return a;let o=Qs.get(i);if(o)return o;let s=(async()=>{let a={};if(n){if(!r)return 0;a[n]=r}try{let i=await e(t,{$filter:a,$top:1}),o=typeof i?.total==`number`?i.total:Array.isArray(i?.data)?i.data.length:Array.isArray(i)?i.length:0,s=typeof o==`number`?o:0;return rc(t,n,r,s),s}catch{return 0}finally{Qs.delete(i)}})();return Qs.set(i,s),s}function ac(e,t){let n=!1,r=`${e}::`;for(let e of Zs.keys())e.startsWith(r)&&(t!==void 0&&!e.endsWith(`::${t}`)||(Zs.delete(e),n=!0));n&&tc()}function oc(){Zs.size!==0&&(Zs.clear(),tc())}function sc(e){return $s.add(e),()=>{$s.delete(e)}}function cc(){return Zs}function lc(e,t,n){if((0,a.useSyncExternalStore)(sc,cc,cc),e)return nc(e,t,n)}var uc={get:nc,set:rc,fetch:ic,invalidate:ac,invalidateAll:oc,_reset:()=>{Zs.clear(),Qs.clear(),tc()}},dc=e=>{let{"data-obj-id":t,"data-obj-type":n,style:r,...i}=e||{};return{designer:{"data-obj-id":t,"data-obj-type":n,style:r},rest:i}},fc=e=>e==null?``:typeof e==`string`?e:typeof e==`object`?e.default||e.value||``:String(e),pc={"zh-CN":{Details:`详情`,Related:`相关`,Activity:`活动`,History:`历史`,Notes:`备注`,Files:`文件`,Tasks:`任务`,"Open Tasks":`待办任务`,"Closed Tasks":`已完成任务`,Events:`日程`,Attachments:`附件`,Chatter:`讨论`,Discussion:`讨论`,Comments:`评论`,Overview:`概览`,Summary:`摘要`,Quotes:`报价单`,Products:`产品`,Contacts:`联系人`,Accounts:`客户`,Leads:`线索`,Opportunities:`商机`,Cases:`服务案例`,Campaigns:`营销活动`,Approvals:`审批`,Documents:`文档`,Emails:`邮件`,Calls:`通话`,Meetings:`会议`},"zh-TW":{Details:`詳情`,Related:`相關`,Activity:`活動`,History:`歷史`,Notes:`備註`,Files:`檔案`,Tasks:`任務`,"Open Tasks":`待辦任務`,"Closed Tasks":`已完成任務`,Events:`行程`,Attachments:`附件`,Chatter:`討論`,Discussion:`討論`,Comments:`評論`,Overview:`概覽`,Summary:`摘要`,Quotes:`報價單`,Products:`產品`,Contacts:`聯絡人`,Accounts:`客戶`,Leads:`線索`,Opportunities:`商機`,Cases:`服務案例`,Campaigns:`行銷活動`,Approvals:`審批`,Documents:`文件`,Emails:`郵件`,Calls:`通話`,Meetings:`會議`}},mc=()=>{if(typeof document<`u`){let e=document.documentElement?.lang;if(e)return e}return typeof navigator<`u`&&navigator.language?navigator.language:`en`},hc=e=>{if(!e)return e;let t=mc(),n=pc[t],r=t.split(`-`)[0]===`zh`?pc[`zh-CN`]:void 0,i=n||r;if(!i)return e;if(i[e]!==void 0)return i[e];let a=/\s*(?:&|and|和)\s*/i;if(a.test(e)){let n=e.split(a);if(n.every(e=>i[e.trim()]!==void 0)){let e=t.startsWith(`zh`)?`与`:` & `;return n.map(e=>i[e.trim()]).join(e)}}return e},gc=(e,t,n,r,i)=>!e||typeof e!=`string`?e||``:e.includes(`{`)?e.replace(/\{([a-zA-Z0-9_.]+)\}/g,(e,a)=>{let o=a.split(`.`).reduce((e,t)=>e==null?e:e[t],t);if(o==null||typeof o==`object`)return``;let s=String(o);if(n?.fields&&r&&i&&!a.includes(`.`)){let e=(Array.isArray(n.fields)?n.fields.find(e=>e?.name===a):n.fields[a])?.options;if(Array.isArray(e)){let t=e.find(e=>String(e?.value??e)===s);return r(i,a,s,t?.label?String(t.label):s)}}return s}).replace(/\s+/g,` `).trim():e,_c=e=>{let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,``)}k`:String(t):String(e)},vc=(e,t=[])=>{if(!e)return t;let n=Array.isArray(e)?e:[e];for(let e of n){if(!e||typeof e!=`object`)continue;if(e.type===`record:related_list`||e.type===`record_related_list`){t.push(e);continue}let n=[e.children,e.properties?.children,e.properties?.items,e.body,e.items];for(let e of n)e&&vc(e,t)}return t};t.ComponentRegistry.register(`page:tabs`,({schema:e,className:t,...n})=>{let{designer:r}=dc(n),s=e?.items||[],c=e?.properties?.type||e?.tabStyle||`line`,l=(e?.position||`top`)===`left`,u=(0,i.useRecordContext)(),d=u?.data?.id,f=u?.dataSource;lc(void 0,void 0,d);let p=a.default.useMemo(()=>{let e=new Map;return s.forEach((t,n)=>{if(t.count!==void 0&&t.count!==null&&t.count!==``)return;let r=vc(t.children),i=[];for(let e of r){let t=e?.properties?.objectName||e?.objectName;if(!t)continue;let n=e?.properties?.relationshipField||e?.relationshipField;i.push({objectName:t,relationshipField:n})}i.length>0&&e.set(n,i)}),e},[s]);a.default.useEffect(()=>{if(!f||typeof f.find!=`function`||p.size===0)return;let e=!1;for(let t of p.values())for(let n of t)if(uc.fetch((e,t)=>f.find(e,t),n.objectName,n.relationshipField,d).catch(()=>0),e)return;return()=>{e=!0}},[f,p,d]);let m=e=>{let t=p.get(e);if(!t||t.length===0)return;let n=0,r=!1;for(let e of t){let t=uc.get(e.objectName,e.relationshipField,d);t!==void 0&&(n+=t,r=!0)}return r?n:void 0},h=s.map((e,t)=>({...e,value:`tab-${t}`,labelStr:hc(fc(e.label)),count:e.count!==void 0&&e.count!==null&&e.count!==``?e.count:m(t)})),g=h[0]?.value,_=z(l&&`flex-col h-auto items-stretch p-1`,c===`card`&&`bg-transparent gap-1`,c===`pill`&&`bg-muted rounded-full p-1 gap-1`,c===`line`&&!l&&`h-auto rounded-none bg-transparent p-0 gap-4 border-b border-border w-full justify-start`,!l&&`sticky top-0 z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60`),v=()=>z(l&&`justify-start`,c===`card`&&`data-[state=active]:bg-background data-[state=active]:border data-[state=active]:shadow-sm rounded-md`,c===`pill`&&`rounded-full data-[state=active]:bg-background`,c===`line`&&!l&&`rounded-none border-b-2 border-transparent bg-transparent px-1 pb-2.5 -mb-px shadow-none data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=active]:text-foreground`);return(0,o.jsxs)(Xi,{defaultValue:g,orientation:l?`vertical`:`horizontal`,className:z(t,l&&`flex gap-4 w-full`),...r,children:[(h.length>1||e?.properties?.alwaysShowStrip===!0)&&(0,o.jsx)(Zi,{className:_,children:h.map(e=>(0,o.jsxs)(Qi,{value:e.value,className:v(),children:[e.icon&&(0,o.jsx)(Da,{name:e.icon,className:`mr-1.5 h-3.5 w-3.5 shrink-0 opacity-70`,"aria-hidden":!0}),(0,o.jsx)(`span`,{children:e.labelStr}),e.count!==void 0&&e.count!==null&&e.count!==``&&Number(e.count)>0&&(0,o.jsx)(`span`,{className:`ml-1.5 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-muted px-1 text-[10px] font-medium leading-none text-muted-foreground`,"aria-label":`${_c(e.count)} items`,children:_c(e.count)})]},e.value))}),h.map(e=>(0,o.jsx)($i,{value:e.value,className:z(h.length>1?`mt-3`:`mt-0`,l&&`mt-0 flex-1`),children:B(e.children)},e.value))]})},{namespace:`page`,label:`Page Tabs`,category:`layout`,isContainer:!0}),t.ComponentRegistry.register(`page:card`,({schema:e,className:t,...n})=>{let{designer:r}=dc(n),i=fc(e?.title),a=e?.bordered!==!1,s=e?.body,c=e?.footer;return(0,o.jsxs)(Ze,{className:z(t,!a&&`border-0 shadow-none bg-transparent`),...r,children:[i&&(0,o.jsx)(Qe,{children:(0,o.jsx)($e,{children:i})}),s&&(0,o.jsx)(tt,{children:B(s)}),c&&(0,o.jsx)(nt,{className:`flex justify-between`,children:B(c)})]})},{namespace:`page`,label:`Page Card`,category:`layout`,isContainer:!0}),t.ComponentRegistry.register(`page:accordion`,({schema:e,className:t,...n})=>{let{designer:r}=dc(n),i=e?.items||[],a=!!e?.allowMultiple,s=(e?.variant??e?.properties?.variant??`flush`)===`flush`?`border-b last:border-b-0`:void 0,c=i.map((e,t)=>({...e,value:`panel-${t}`,labelStr:hc(fc(e.label))})),l=c.filter(e=>e.collapsed===!1).map(e=>e.value),u=c.map(e=>(0,o.jsxs)(ye,{value:e.value,className:s,children:[(0,o.jsx)(be,{className:`text-sm font-semibold tracking-tight hover:no-underline`,children:e.labelStr}),(0,o.jsx)(xe,{children:B(e.children)})]},e.value));return a?(0,o.jsx)(V,{type:`multiple`,defaultValue:l,className:t,...r,children:u}):(0,o.jsx)(V,{type:`single`,collapsible:!0,defaultValue:l[0],className:t,...r,children:u})},{namespace:`page`,label:`Page Accordion`,category:`layout`,isContainer:!0}),t.ComponentRegistry.register(`page:section`,({schema:e,className:t,...n})=>{let{designer:r}=dc(n);return(0,o.jsx)(`section`,{className:z(`space-y-4`,t),...r,children:B(e?.children||e?.body)})},{namespace:`page`,label:`Page Section`,category:`layout`,isContainer:!0});function yc(e){if(!e)return e;let t=e;for(let e=0;e<4;e+=1){let e=t.replace(/[\s\u00A0]*[-·:|/–—][\s\u00A0]*$/u,``).trimEnd();if(e===t)break;t=e}for(let e=0;e<4;e+=1){let e=t.replace(/^[\s\u00A0]*[-·:|/–—][\s\u00A0]*/u,``).trimStart();if(e===t)break;t=e}return t=t.replace(/([-·:|/–—])[\s\u00A0]*\1/gu,`$1`),t=t.replace(/[\s\u00A0]+/g,` `).trim(),t}t.ComponentRegistry.register(`page:header`,({schema:e,className:n,...r})=>{let{designer:s}=dc(r),l=(0,i.useRecordContext)(),{execute:u}=(0,i.useAction)(),{objectLabel:d,actionLabel:f}=(0,le.useObjectLabel)(),{fieldOptionLabel:p}=(0,le.useSafeFieldLabel)(),m=e?.title??e?.properties?.title,h=e?.subtitle??e?.properties?.subtitle,g=l?.objectSchema,_=l?.objectName||g?.name,v=gc(fc(m),l?.data,g,p,_),y=gc(fc(h),l?.data,g,p,_),b=(e?.breadcrumb??e?.properties?.breadcrumb)!==!1,x=e?.recordChrome===!1||e?.properties?.recordChrome===!1,S=e?.showStar!==!1&&e?.properties?.showStar!==!1,C=e?.showCopyId!==!1&&e?.properties?.showCopyId!==!1,w=e?.actions??e?.properties?.actions,T=l?.headerSystemActions,E=a.default.useMemo(()=>{let e=l?.data,n=new t.ExpressionEvaluator({...e&&typeof e==`object`?e:{},record:e,data:e}),r=e=>{try{return n.evaluateExpression(e)}catch{return}},i=e=>{if(Array.isArray(e?.locations)&&e.locations.length>0&&!e.locations.includes(`record_header`))return!1;let t=e?.visible;if(t!=null)if(typeof t==`boolean`){if(!t)return!1}else{let e=typeof t==`string`?t:t&&typeof t==`object`&&typeof t.source==`string`?t.source:null;if(e&&!r(e))return!1}let n=e?.hidden;if(n!=null)if(typeof n==`boolean`){if(n)return!1}else{let e=typeof n==`string`?n:n&&typeof n==`object`&&typeof n.source==`string`?n.source:null;if(e&&r(e))return!1}return!0},a=Array.isArray(w)?w.filter(i):[],o=Array.isArray(T)?T.filter(i):[],s=new Set,c=[];for(let e of[...a,...o]){let t=e?.name||e?.id||``;t&&s.has(t)||(t&&s.add(t),c.push(e))}return c},[w,T,l?.data]),D=()=>{if(E.length===0)return null;let e=(e,t)=>{let n=e?.name||e?.id,r=e?.label||n||`Action ${t+1}`;return n?f(l?.objectName,n,r):r},t=E.length>2,n=t?E.slice(0,1):E,r=t?E.slice(1):[];return(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 shrink-0`,role:`toolbar`,"aria-label":`Page header actions`,children:[n.map((t,n)=>{let r=e(t,n),i=t.variant||`default`,a=t.size||`sm`,s=typeof t.disabled==`boolean`?t.disabled:void 0,c=typeof t.icon==`string`?t.icon:null;return(0,o.jsxs)(U,{variant:i,size:a,disabled:s,className:`gap-2`,onClick:()=>{if(typeof t.onClick==`function`){t.onClick();return}u(t)},children:[c&&(0,o.jsx)(Da,{name:c,className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:r})]},t.name||t.id||`header-action-${n}`)}),t&&(0,o.jsxs)(hn,{children:[(0,o.jsx)(gn,{asChild:!0,children:(0,o.jsx)(U,{variant:`outline`,size:`sm`,className:`gap-1 px-2`,"aria-label":`More actions`,children:(0,o.jsx)(c.MoreHorizontal,{className:`h-4 w-4`})})}),(0,o.jsx)(Cn,{align:`end`,className:`w-44`,children:r.map((t,n)=>{let r=e(t,n+1),i=typeof t.disabled==`boolean`?t.disabled:void 0,a=typeof t.icon==`string`?t.icon:null;return(0,o.jsxs)(wn,{disabled:i,onSelect:e=>{if(e.preventDefault(),typeof t.onClick==`function`){t.onClick();return}u(t)},className:z(`gap-2`,(t.variant===`destructive`||t.name===`sys_delete`)&&`text-destructive focus:text-destructive focus:bg-destructive/10`),children:[a&&(0,o.jsx)(Da,{name:a,className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:r})]},t.name||t.id||`overflow-action-${n}`)})})]})]})};if(l?.data&&l?.objectSchema&&!x){let e=l.data,t=l.objectSchema,r=l.objectName||t?.name,i=fc(t?.label)||t?.name||l.objectName||``,a=r?d({name:r,label:i}):i||void 0,c=t?.primaryField,u=t?.titleFormat,f=typeof u==`string`?u:u&&typeof u==`object`&&typeof u.source==`string`?u.source:void 0,m=f?yc(gc(f,e,t,p,r).trim()):``,h=v||c&&e?.[c]||(m&&!m.includes(`{`)?m:``)||e?.name||e?.full_name||e?.title||e?.subject||e?.display_name||e?.label||(a&&e?.id?`${a} ${String(e.id).slice(0,8)}`:``)||a||``;return(0,o.jsxs)(`header`,{className:z(`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-4 pb-4 border-b`,n),...s,children:[(0,o.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[b&&(0,o.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,"data-page-breadcrumb-slot":!0}),(0,o.jsx)(vs,{title:h,objectLabel:a,resourceId:e?.id?String(e.id):void 0,showStar:S,showCopyId:C,isFavorite:l?.isFavorite,onToggleFavorite:l?.onToggleFavorite?()=>l.onToggleFavorite():void 0}),y&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:y})]}),D()??(0,o.jsx)(`div`,{"data-page-actions-slot":!0,className:`shrink-0`})]})}return(0,o.jsxs)(`header`,{className:z(`flex flex-col gap-2 pb-4 border-b`,n),...s,children:[b&&(0,o.jsx)(`div`,{className:`text-xs text-muted-foreground`,"data-page-breadcrumb-slot":!0}),(0,o.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[v&&(0,o.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:v}),y&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y})]}),D()??(0,o.jsx)(`div`,{"data-page-actions-slot":!0})]})]})},{namespace:`page`,label:`Page Header`,category:`layout`}),t.ComponentRegistry.register(`page:footer`,({schema:e,className:t,...n})=>{let{designer:r}=dc(n);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Ur,{className:`my-4`}),(0,o.jsx)(`footer`,{className:z(`flex items-center justify-between text-sm text-muted-foreground`,t),...r,children:B(e?.children||e?.body)})]})},{namespace:`page`,label:`Page Footer`,category:`layout`,isContainer:!0}),t.ComponentRegistry.register(`page:sidebar`,({schema:e,className:t,...n})=>{let{designer:r}=dc(n);return(0,o.jsx)(`aside`,{className:z(`flex flex-col gap-4 w-full md:w-80 shrink-0`,t),...r,children:B(e?.children||e?.body)})},{namespace:`page`,label:`Page Sidebar`,category:`layout`,isContainer:!0}),[`aside`,`main`,`header`,`nav`,`footer`,`section`,`article`].forEach(e=>{let n=(0,a.forwardRef)(({schema:t,className:n,...r},i)=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=r;return(0,o.jsx)(e,{ref:i,className:n,...l,"data-obj-id":a,"data-obj-type":s,style:c,children:B(t.children||t.body)})});n.displayName=`Semantic${e.charAt(0).toUpperCase()+e.slice(1)}`,t.ComponentRegistry.register(e,n,{namespace:`ui`,label:e.charAt(0).toUpperCase()+e.slice(1),category:`layout`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}]})}),t.ComponentRegistry.register(`aspect-ratio`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(Ie,{ratio:e.ratio||16/9,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.image?(0,o.jsx)(`img`,{src:e.image,alt:e.alt||``,loading:`lazy`,className:`rounded-md object-cover w-full h-full`}):B(e.children||e.body)})},{namespace:`ui`,label:`Aspect Ratio`,inputs:[{name:`ratio`,type:`number`,label:`Ratio`,defaultValue:16/9},{name:`image`,type:`string`,label:`Image URL`},{name:`alt`,type:`string`,label:`Alt Text`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{ratio:16/9}}),t.ComponentRegistry.register(`sidebar-provider`,({schema:e,...t})=>(0,o.jsx)(hi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Provider`,inputs:[{name:`defaultOpen`,type:`boolean`,label:`Default Open`,defaultValue:!0}],defaultProps:{defaultOpen:!0},defaultChildren:[{type:`sidebar`},{type:`sidebar-inset`}]}),t.ComponentRegistry.register(`sidebar`,({schema:e,...t})=>(0,o.jsx)(gi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar`,inputs:[{name:`collapsible`,type:`enum`,enum:[`offcanvas`,`icon`,`none`],defaultValue:`icon`,label:`Collapsible`},{name:`side`,type:`enum`,enum:[`left`,`right`],defaultValue:`left`,label:`Side`},{name:`variant`,type:`enum`,enum:[`sidebar`,`floating`,`inset`],defaultValue:`sidebar`,label:`Variant`}],defaultProps:{collapsible:`icon`,side:`left`,variant:`sidebar`},defaultChildren:[{type:`sidebar-header`},{type:`sidebar-content`},{type:`sidebar-footer`}]}),t.ComponentRegistry.register(`sidebar-header`,({schema:e,...t})=>(0,o.jsx)(xi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Header`,defaultChildren:[{type:`text`,content:`Sidebar Header`}]}),t.ComponentRegistry.register(`sidebar-content`,({schema:e,...t})=>(0,o.jsx)(wi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Content`,defaultChildren:[{type:`sidebar-group`}]}),t.ComponentRegistry.register(`sidebar-group`,({schema:e,...t})=>(0,o.jsxs)(Ti,{...t,children:[e.label&&(0,o.jsx)(Ei,{children:e.label}),(0,o.jsx)(Oi,{children:B(e.body)})]}),{namespace:`ui`,label:`Sidebar Group`,inputs:[{name:`label`,type:`string`,label:`Label`}],defaultProps:{label:`Menu`},defaultChildren:[{type:`sidebar-menu`}]}),t.ComponentRegistry.register(`sidebar-menu`,({schema:e,...t})=>(0,o.jsx)(ki,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Menu`,defaultChildren:[{type:`sidebar-menu-item`},{type:`sidebar-menu-item`}]}),t.ComponentRegistry.register(`sidebar-menu-item`,({schema:e,...t})=>(0,o.jsx)(Ai,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Menu Item`,defaultChildren:[{type:`sidebar-menu-button`}]}),t.ComponentRegistry.register(`sidebar-menu-button`,({schema:e,...t})=>(0,o.jsx)(Mi,{isActive:e.active,...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Menu Button`,inputs:[{name:`active`,type:`boolean`,label:`Active`,defaultValue:!1},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`],defaultValue:`default`,label:`Size`},{name:`tooltip`,type:`string`,label:`Tooltip`}],defaultProps:{size:`default`},defaultChildren:[{type:`text`,content:`Menu Item`}]}),t.ComponentRegistry.register(`sidebar-footer`,({schema:e,...t})=>(0,o.jsx)(Si,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Footer`,defaultChildren:[{type:`text`,content:`Footer`}]}),t.ComponentRegistry.register(`sidebar-inset`,({schema:e,...t})=>(0,o.jsx)(yi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Inset`,defaultChildren:[{type:`div`,className:`p-4`,body:[{type:`text`,content:`Main content area`}]}]}),t.ComponentRegistry.register(`sidebar-trigger`,({className:e,...t})=>(0,o.jsx)(_i,{className:e,...t}),{namespace:`ui`,label:`Sidebar Trigger`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}]});function bc({crumb:e,isLast:t}){let n=(0,i.resolveI18nLabel)(e.label)??``;return e.siblings&&e.siblings.length>0?(0,o.jsxs)(hn,{children:[(0,o.jsxs)(gn,{className:`flex items-center gap-1`,children:[t?(0,o.jsx)(`span`,{className:`font-semibold`,children:n}):(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(c.ChevronDown,{className:`h-3 w-3`})]}),(0,o.jsx)(Cn,{align:`start`,children:e.siblings.map((e,t)=>(0,o.jsx)(wn,{asChild:!0,children:(0,o.jsx)(`a`,{href:e.href,children:e.label})},t))})]}):t?(0,o.jsx)(Ke,{children:n}):(0,o.jsx)(Ge,{href:e.href||`#`,children:n})}t.ComponentRegistry.register(`header-bar`,({schema:e})=>(0,o.jsxs)(`header`,{className:`flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b px-3 sm:px-4`,children:[(0,o.jsx)(_i,{}),(0,o.jsx)(Ur,{orientation:`vertical`,className:`mr-2 h-4`}),(0,o.jsx)(He,{children:(0,o.jsx)(Ue,{children:e.crumbs?.map((t,n)=>(0,o.jsxs)(a.default.Fragment,{children:[(0,o.jsx)(We,{children:(0,o.jsx)(bc,{crumb:t,isLast:n===e.crumbs.length-1})}),n<e.crumbs.length-1&&(0,o.jsx)(qe,{})]},n))})}),(0,o.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[e.search?.enabled&&(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(c.Search,{className:`absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground`}),(0,o.jsx)(K,{type:`search`,placeholder:e.search.placeholder,className:`pl-8 w-[200px] lg:w-[300px]`}),e.search.shortcut&&(0,o.jsx)(`kbd`,{className:`pointer-events-none absolute right-2 top-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex`,children:e.search.shortcut})]}),e.actions?.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},t)),e.rightContent&&(0,o.jsx)(i.SchemaRenderer,{schema:e.rightContent})]})]}),{namespace:`ui`,label:`Header Bar`,inputs:[{name:`crumbs`,type:`array`,label:`Breadcrumbs`},{name:`search`,type:`object`,label:`Search Configuration`},{name:`actions`,type:`array`,label:`Action Slots`},{name:`rightContent`,type:`object`,label:`Right Content`}],defaultProps:{crumbs:[{label:`Home`,href:`#`},{label:`Current Page`}]}}),t.ComponentRegistry.register(`badge`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(Ve,{variant:e.variant,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.label||B(e.body)})},{namespace:`ui`,label:`Badge`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`],defaultValue:`default`,label:`Variant`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{label:`Badge`,variant:`default`}}),t.ComponentRegistry.register(`avatar`,({schema:e,className:t,...n})=>(0,o.jsxs)(Le,{className:t,...n,children:[(0,o.jsx)(Re,{src:e.src,alt:e.alt}),(0,o.jsx)(ze,{children:e.fallback})]}),{namespace:`ui`,label:`Avatar`,inputs:[{name:`src`,type:`string`,label:`Image URL`},{name:`alt`,type:`string`,label:`Alt Text`},{name:`fallback`,type:`string`,label:`Fallback Initials`,defaultValue:`CN`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{fallback:`CN`,alt:`Avatar`}}),t.ComponentRegistry.register(`alert`,({schema:e,className:t,...n})=>(0,o.jsxs)(Ne,{variant:e.variant,className:t,...n,children:[(0,o.jsx)(Pe,{children:e.title}),(0,o.jsx)(Fe,{children:e.description||B(e.body)})]}),{namespace:`ui`,label:`Alert`,inputs:[{name:`title`,type:`string`,label:`Title`,required:!0},{name:`description`,type:`string`,label:`Description`},{name:`variant`,type:`enum`,enum:[`default`,`destructive`],defaultValue:`default`,label:`Variant`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`Alert Title`,description:`This is an alert message.`,variant:`default`}}),t.ComponentRegistry.register(`list`,({schema:e,className:t,...n})=>{let r=(0,i.useDataScope)(e.bind),a=Array.isArray(r)?r:Array.isArray(e.items)?e.items:[],s=e.ordered?`ol`:`ul`,c=e.ordered?`list-decimal`:`list-disc`;return(0,o.jsxs)(`div`,{className:z(`space-y-2`,e.wrapperClass),children:[e.title&&(0,o.jsx)(`h3`,{className:`text-lg font-semibold tracking-tight`,children:e.title}),(0,o.jsx)(s,{className:z(`ml-6 [&>li]:mt-2`,c,t),...n,children:a.map((e,t)=>(0,o.jsx)(`li`,{className:z(typeof e==`object`&&e.className),children:typeof e==`string`?e:e.content||B(e.body)},t))})]})},{namespace:`ui`,label:`List`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`ordered`,type:`boolean`,label:`Ordered List (numbered)`,defaultValue:!1},{name:`items`,type:`array`,label:`List Items`,description:`Array of strings or objects with content/body`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{ordered:!1,items:[`First item`,`Second item`,`Third item`],className:`text-sm`}});var xc=({node:e,onNodeClick:t})=>{let[n,r]=(0,a.useState)(!1),i=e.children&&e.children.length>0;return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsxs)(`div`,{className:z(`group flex items-center py-1.5 px-2 rounded-sm cursor-pointer transition-colors`,`hover:bg-accent hover:text-accent-foreground`,n&&i&&`bg-accent/50`),onClick:()=>{t&&t(e)},children:[i?(0,o.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r(!n)},className:`mr-2 p-0.5 h-5 w-5 flex items-center justify-center rounded-sm hover:bg-muted text-muted-foreground transition-colors`,children:n?(0,o.jsx)(c.ChevronDown,{className:`h-4 w-4`}):(0,o.jsx)(c.ChevronRight,{className:`h-4 w-4`})}):(0,o.jsx)(`span`,{className:`mr-2 w-5 flex justify-center`,children:(0,o.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-muted-foreground/50`})}),e.icon===`folder`||i?n?(0,o.jsx)(c.FolderOpen,{className:`h-4 w-4 mr-2 text-primary`}):(0,o.jsx)(c.Folder,{className:`h-4 w-4 mr-2 text-muted-foreground group-hover:text-primary transition-colors`}):(0,o.jsx)(c.File,{className:`h-4 w-4 mr-2 text-muted-foreground group-hover:text-primary transition-colors`}),(0,o.jsx)(`span`,{className:z(`text-sm transition-colors`,n?`font-medium text-foreground`:`text-muted-foreground group-hover:text-foreground`),children:e.label})]}),i&&n&&(0,o.jsx)(`div`,{className:`relative ml-[11px] pl-3 border-l border-border animate-in slide-in-from-left-2 fade-in duration-200`,children:e.children.map(e=>(0,o.jsx)(xc,{node:e,onNodeClick:t},e.id))})]})};t.ComponentRegistry.register(`tree-view`,({schema:e,className:t,...n})=>{let r=t=>{e.onNodeClick&&e.onNodeClick(t)},a=(0,i.useDataScope)(e.bind)||e.nodes||e.data||[],s=Array.isArray(a)?a:[];return(0,o.jsxs)(`div`,{className:z(`relative border rounded-lg p-3 bg-card text-card-foreground`,t),...n,children:[e.title&&(0,o.jsx)(`div`,{className:`flex items-center gap-2 mb-3 pb-2 border-b`,children:(0,o.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.title})}),(0,o.jsx)(`div`,{className:`space-y-1`,children:s.map(e=>(0,o.jsx)(xc,{node:e,onNodeClick:r},e.id))})]})},{namespace:`ui`,label:`Tree View`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`nodes`,type:`array`,label:`Tree Nodes`,description:`Array of { id, label, icon, children, data }`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`File Explorer`,nodes:[{id:`1`,label:`Documents`,icon:`folder`,children:[{id:`1-1`,label:`Resume.pdf`,icon:`file`},{id:`1-2`,label:`Cover Letter.docx`,icon:`file`}]},{id:`2`,label:`Photos`,icon:`folder`,children:[{id:`2-1`,label:`Vacation`,icon:`folder`,children:[{id:`2-1-1`,label:`Beach.jpg`,icon:`file`}]},{id:`2-2`,label:`Family.jpg`,icon:`file`}]},{id:`3`,label:`README.md`,icon:`file`}]}});var Sc=e=>e?Ea(e):null;t.ComponentRegistry.register(`statistic`,({schema:e})=>{let t=e.icon?Sc(e.icon):null;return(0,o.jsxs)(`div`,{className:z(`group relative flex flex-col p-4 sm:p-5 md:p-6 rounded-xl border bg-card text-card-foreground shadow-sm`,e.className),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[e.label&&(0,o.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),t&&(0,o.jsx)(t,{className:`h-4 w-4 text-muted-foreground`})]}),(0,o.jsx)(`div`,{className:`flex items-baseline gap-2`,children:(0,o.jsx)(`h3`,{className:`text-2xl font-bold tracking-tight`,children:e.value})}),(e.trend||e.description)&&(0,o.jsxs)(`div`,{className:`mt-1 flex items-center text-xs text-muted-foreground`,children:[e.trend===`up`&&(0,o.jsx)(c.TrendingUp,{className:`mr-1 h-3 w-3 text-emerald-500`}),e.trend===`down`&&(0,o.jsx)(c.TrendingDown,{className:`mr-1 h-3 w-3 text-rose-500`}),e.trend===`neutral`&&(0,o.jsx)(c.Minus,{className:`mr-1 h-3 w-3`}),(0,o.jsx)(`span`,{className:z(e.trend===`up`&&`text-emerald-500 font-medium`,e.trend===`down`&&`text-rose-500 font-medium`),children:e.description})]})]})},{namespace:`ui`,label:`Statistic`,category:`data-display`,icon:`Activity`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`value`,type:`string`,label:`Value`},{name:`description`,type:`string`,label:`Description`},{name:`trend`,type:`enum`,enum:[{label:`Up`,value:`up`},{label:`Down`,value:`down`},{label:`Neutral`,value:`neutral`}],label:`Trend`}],defaultProps:{label:`Total Revenue`,value:`$45,231.89`,trend:`up`,description:`+20.1% from last month`}}),t.ComponentRegistry.register(`breadcrumb`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:a,...s}=t;return(0,o.jsx)(He,{className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:a,children:(0,o.jsx)(Ue,{children:e.items?.map((t,n)=>(0,o.jsxs)(`div`,{className:`flex items-center`,children:[(0,o.jsx)(We,{children:n===(e.items?.length||0)-1?(0,o.jsx)(Ke,{children:(0,i.resolveI18nLabel)(t.label)??``}):(0,o.jsx)(Ge,{href:t.href,children:(0,i.resolveI18nLabel)(t.label)??``})}),n<(e.items?.length||0)-1&&(0,o.jsx)(qe,{})]},n))})})},{namespace:`ui`,label:`Breadcrumb`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{items:[{label:`Home`,href:`/`},{label:`Products`,href:`/products`},{label:`Product`}]}}),t.ComponentRegistry.register(`kbd`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t,s=Array.isArray(e.keys)?e.keys:[e.keys||e.label||`K`];return(0,o.jsx)(`div`,{className:z(`inline-flex flex-wrap gap-1`,e.className),children:s.map((e,t)=>(0,o.jsx)(`kbd`,{className:`pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100`,...a,...t===0?{"data-obj-id":n,"data-obj-type":r,style:i}:{},children:e},t))})},{namespace:`ui`,label:`Keyboard Key`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{label:`K`}}),t.ComponentRegistry.register(`table`,({schema:e,className:t})=>{let n=(0,i.useDataScope)(e.bind)||e.data||e.props?.data||[],r=Array.isArray(e.columns)?e.columns:Array.isArray(e.props?.columns)?e.props.columns:[];if(n&&!Array.isArray(n))return(0,o.jsx)(`div`,{className:`text-red-500 p-2 border border-red-200 bg-red-50 rounded text-sm`,children:`Table data must be an array`});let a=Array.isArray(n)?n:[];return(0,o.jsx)(`div`,{className:z(`rounded-md border`,t),children:(0,o.jsxs)(Hi,{children:[(0,o.jsx)(Ui,{children:(0,o.jsx)(Ki,{children:r.map((e,t)=>(0,o.jsx)(qi,{children:e.label||e.header},e.key||e.accessorKey||t))})}),(0,o.jsx)(Wi,{children:a.length===0?(0,o.jsx)(Ki,{children:(0,o.jsx)(Ji,{colSpan:r.length,className:`h-24 text-center`,children:`No results.`})}):a.map((e,t)=>(0,o.jsx)(Ki,{children:r.map((t,n)=>{let r=t.key||t.accessorKey||``,i=r?e[r]:``;return(0,o.jsx)(Ji,{children:typeof i==`object`&&i?String(i):i},t.key||t.accessorKey||n)})},e.id||t))})]})})},{namespace:`ui`}),t.ComponentRegistry.register(`progress`,({schema:e,className:t,...n})=>(0,o.jsx)(kr,{value:e.value,className:t,...n}),{namespace:`ui`,label:`Progress`,inputs:[{name:`value`,type:`number`,label:`Value`,defaultValue:0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{value:50,className:`w-full`}}),t.ComponentRegistry.register(`skeleton`,({schema:e,className:t,...n})=>(0,o.jsx)(Z,{className:t,...n,style:{width:e.width,height:e.height}}),{namespace:`ui`,label:`Skeleton`,inputs:[{name:`width`,type:`string`,label:`Width`},{name:`height`,type:`string`,label:`Height`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{width:`100%`,height:`20px`,className:`rounded-md`}}),t.ComponentRegistry.register(`toaster`,()=>(0,o.jsx)(Bi,{}),{namespace:`ui`,label:`Toaster`,inputs:[],defaultProps:{}}),t.ComponentRegistry.register(`loading`,({schema:e,className:t,...n})=>{let r=e.size||`md`,i=e.fullscreen||!1,a=(0,o.jsxs)(`div`,{className:z(`flex flex-col items-center justify-center gap-2`,t),children:[(0,o.jsx)(is,{className:z(r===`sm`&&`h-4 w-4`,r===`md`&&`h-8 w-8`,r===`lg`&&`h-12 w-12`,r===`xl`&&`h-16 w-16`)}),e.text&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.text})]});return i?(0,o.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,...n,children:a}):(0,o.jsx)(`div`,{className:`flex items-center justify-center p-8`,...n,children:a})},{namespace:`ui`,label:`Loading`,inputs:[{name:`text`,type:`string`,label:`Loading Text`},{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`],label:`Size`,defaultValue:`md`},{name:`fullscreen`,type:`boolean`,label:`Fullscreen Overlay`,defaultValue:!1},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{text:`Loading...`,size:`md`,fullscreen:!1}}),t.ComponentRegistry.register(`toast`,({schema:e})=>(0,o.jsx)(U,{onClick:()=>{(e.variant===`success`?P.toast.success:e.variant===`error`?P.toast.error:e.variant===`warning`?P.toast.warning:e.variant===`info`?P.toast.info:P.toast)(e.title||`Notification`,{description:e.description,duration:e.duration})},variant:e.buttonVariant,className:e.className,children:e.buttonLabel||`Show Toast`}),{namespace:`ui`,label:`Toast`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`variant`,type:`enum`,enum:[`default`,`success`,`warning`,`error`,`info`],defaultValue:`default`,label:`Variant`},{name:`duration`,type:`number`,label:`Duration (ms)`},{name:`buttonLabel`,type:`string`,label:`Button Label`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`Notification`,buttonLabel:`Show Toast`,variant:`default`,duration:5e3}}),t.ComponentRegistry.register(`spinner`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(c.Loader2,{className:z(`animate-spin`,{sm:`h-4 w-4`,md:`h-6 w-6`,lg:`h-8 w-8`,xl:`h-12 w-12`}[e.size||`md`],e.className),...a,"data-obj-id":n,"data-obj-type":r,style:i})},{namespace:`ui`,label:`Spinner`,inputs:[{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`],defaultValue:`md`,label:`Size`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{size:`md`}}),t.ComponentRegistry.register(`empty`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:a,action:s,icon:c,...l}=t,u=e.action,d=u&&typeof u==`object`?(0,o.jsx)(i.SchemaRenderer,{schema:u}):void 0;return(0,o.jsx)(Cs,{title:e.title||`No data`,description:e.description,className:e.className,action:d,...l,"data-obj-id":n,"data-obj-type":r,style:a})},{namespace:`ui`,label:`Empty`,inputs:[{name:`title`,type:`string`,label:`Title`,defaultValue:`No data`},{name:`description`,type:`string`,label:`Description`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`No data`}}),t.ComponentRegistry.register(`sonner`,({schema:e,...t})=>(0,o.jsx)(U,{onClick:()=>{(e.variant===`success`?P.toast.success:e.variant===`error`?P.toast.error:e.variant===`warning`?P.toast.warning:e.variant===`info`?P.toast.info:P.toast)(e.message||e.title||`Notification`,{description:e.description})},variant:e.buttonVariant,className:e.className,...t,children:e.buttonLabel||`Show Toast`}),{namespace:`ui`,label:`Sonner Toast`,inputs:[{name:`message`,type:`string`,label:`Message`},{name:`description`,type:`string`,label:`Description`},{name:`variant`,type:`enum`,enum:[`default`,`success`,`error`,`warning`,`info`],defaultValue:`default`,label:`Variant`},{name:`buttonLabel`,type:`string`,label:`Button Label`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{message:`Notification`,buttonLabel:`Show Toast`,variant:`default`}}),t.ComponentRegistry.register(`dialog`,({schema:e,className:t,...n})=>(0,o.jsxs)(wt,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(Tt,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(kt,{className:t,children:[(0,o.jsxs)(At,{children:[e.title&&(0,o.jsx)(Mt,{children:e.title}),e.description&&(0,o.jsx)(Nt,{children:e.description})]}),B(e.content),e.footer&&(0,o.jsx)(jt,{children:B(e.footer)})]})]}),{namespace:`ui`,label:`Dialog`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`modal`,type:`boolean`,label:`Modal`,defaultValue:!0},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`trigger`,type:`slot`,label:`Trigger`,description:`Element that opens the dialog`},{name:`content`,type:`slot`,label:`Content`,description:`Main content of the dialog`},{name:`footer`,type:`slot`,label:`Footer`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{title:`Dialog Title`,description:`Dialog description goes here`,modal:!0,trigger:[{type:`button`,label:`Open Dialog`}],content:[{type:`text`,content:`Dialog content goes here`}]}}),t.ComponentRegistry.register(`sheet`,({schema:e,className:t,...n})=>(0,o.jsxs)(Wr,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(Gr,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(Xr,{side:e.side||`right`,className:t,children:[(0,o.jsxs)(Zr,{children:[e.title&&(0,o.jsx)($r,{children:e.title}),e.description&&(0,o.jsx)(ei,{children:e.description})]}),B(e.content),e.footer&&(0,o.jsx)(Qr,{children:B(e.footer)})]})]}),{namespace:`ui`,label:`Sheet`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],defaultValue:`right`,label:`Side`},{name:`modal`,type:`boolean`,label:`Modal`,defaultValue:!0},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`footer`,type:`slot`,label:`Footer`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{title:`Sheet Title`,description:`Sheet description`,side:`right`,modal:!0,trigger:[{type:`button`,label:`Open Sheet`}],content:[{type:`text`,content:`Sheet content goes here`}]}}),t.ComponentRegistry.register(`popover`,({schema:e,className:t,...n})=>(0,o.jsxs)(Er,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(Dr,{asChild:!0,children:B(e.trigger)}),(0,o.jsx)(Or,{align:e.align,side:e.side,className:t,children:B(e.content)})]}),{namespace:`ui`,label:`Popover`,inputs:[{name:`modal`,type:`boolean`,label:`Modal`},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`],label:`Align`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],label:`Side`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Open Popover`,variant:`outline`}],content:[{type:`text`,content:`Popover content goes here`}],align:`center`,side:`bottom`}}),t.ComponentRegistry.register(`tooltip`,({schema:e,className:t,...n})=>(0,o.jsx)(ri,{delayDuration:e.delayDuration,children:(0,o.jsxs)(ii,{...n,children:[(0,o.jsx)(ai,{asChild:!0,children:B(e.trigger)}),(0,o.jsx)(oi,{side:e.side,align:e.align,className:t,children:e.content||B(e.body)})]})}),{namespace:`ui`,label:`Tooltip`,inputs:[{name:`delayDuration`,type:`number`,label:`Delay Duration`,defaultValue:700},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],label:`Side`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`],label:`Align`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`string`,label:`Content Text`},{name:`body`,type:`slot`,label:`Rich Content`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Hover me`,variant:`outline`}],content:`Tooltip content`,delayDuration:700,side:`top`}}),t.ComponentRegistry.register(`alert-dialog`,({schema:e,className:t,...n})=>(0,o.jsxs)(Se,{defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(Ce,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(Ee,{className:t,children:[(0,o.jsxs)(De,{children:[e.title&&(0,o.jsx)(Oe,{children:e.title}),e.description&&(0,o.jsx)(ke,{children:e.description})]}),B(e.content),(0,o.jsxs)(W,{children:[e.cancelText&&(0,o.jsx)(je,{children:e.cancelText}),e.actionText&&(0,o.jsx)(Ae,{onClick:e.onAction,children:e.actionText})]})]})]}),{namespace:`ui`,label:`Alert Dialog`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`cancelText`,type:`string`,label:`Cancel Text`,defaultValue:`Cancel`},{name:`actionText`,type:`string`,label:`Action Text`,defaultValue:`Continue`},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content/Body`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{title:`Are you sure?`,description:`This action cannot be undone.`,cancelText:`Cancel`,actionText:`Continue`,trigger:[{type:`button`,label:`Open Alert`,variant:`destructive`}]}}),t.ComponentRegistry.register(`drawer`,({schema:e,className:t,...n})=>(0,o.jsxs)(an,{shouldScaleBackground:e.shouldScaleBackground,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(on,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(un,{className:t,children:[(0,o.jsxs)(dn,{children:[e.title&&(0,o.jsx)(pn,{children:e.title}),e.description&&(0,o.jsx)(mn,{children:e.description})]}),B(e.content),e.footer&&(0,o.jsxs)(fn,{children:[B(e.footer),e.showClose&&(0,o.jsx)(cn,{asChild:!0,children:(0,o.jsx)(`button`,{children:`Close`})})]})]})]}),{namespace:`ui`,label:`Drawer`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`shouldScaleBackground`,type:`boolean`,label:`Scale Background`},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`showClose`,type:`boolean`,label:`Show Close Button in Footer`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`footer`,type:`slot`,label:`Footer`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{title:`Drawer Title`,description:`Drawer description`,trigger:[{type:`button`,label:`Open Drawer`}],content:[{type:`text`,content:`Drawer content goes here`}]}}),t.ComponentRegistry.register(`hover-card`,({schema:e,className:t,...n})=>(0,o.jsxs)(Vn,{openDelay:e.openDelay,closeDelay:e.closeDelay,...n,children:[(0,o.jsx)(Hn,{asChild:!0,children:B(e.trigger)}),(0,o.jsx)(Un,{align:e.align,side:e.side,className:t,children:B(e.content)})]}),{namespace:`ui`,label:`Hover Card`,inputs:[{name:`openDelay`,type:`number`,label:`Open Delay`},{name:`closeDelay`,type:`number`,label:`Close Delay`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],label:`Side`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`],label:`Align`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Hover me`,variant:`link`}],content:[{type:`text`,content:`Hover card content appears on hover`}],side:`top`}});var Cc=e=>e?e.map((e,t)=>e.type===`separator`?(0,o.jsx)(On,{},t):e.type===`label`?(0,o.jsx)(Dn,{children:e.label},t):e.children?(0,o.jsxs)(yn,{children:[(0,o.jsxs)(xn,{inset:e.inset,children:[e.icon&&(0,o.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}),(0,o.jsx)(Sn,{children:Cc(e.children)})]},t):(0,o.jsxs)(wn,{disabled:e.disabled,inset:e.inset,onSelect:e.onSelect,children:[e.icon&&(0,o.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label,e.shortcut&&(0,o.jsx)(`span`,{className:`ml-auto text-xs tracking-widest opacity-60`,children:e.shortcut})]},t)):null;t.ComponentRegistry.register(`dropdown-menu`,({schema:e,className:t,...n})=>(0,o.jsxs)(hn,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(gn,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(Cn,{align:e.align,side:e.side,className:t,children:[e.label&&(0,o.jsx)(Dn,{children:e.label}),e.label&&(0,o.jsx)(On,{}),Cc(e.items)]})]}),{namespace:`ui`,label:`Dropdown Menu`,inputs:[{name:`label`,type:`string`,label:`Menu Label`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],label:`Side`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`],label:`Align`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`items`,type:`array`,label:`Items`,description:`Recursive structure: { type?: "separator"|"label", label, icon, shortcut, disabled, children: [] }`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Menu`,variant:`outline`}],items:[{label:`Item 1`},{label:`Item 2`},{type:`separator`},{label:`Item 3`}],align:`start`,side:`bottom`}});var wc=e=>e?e.map((e,t)=>e.type===`separator`?(0,o.jsx)(nn,{},t):e.type===`label`?(0,o.jsx)(tn,{children:e.label},t):e.children?(0,o.jsxs)(qt,{children:[(0,o.jsx)(Yt,{inset:e.inset,children:e.label}),(0,o.jsx)(Xt,{children:wc(e.children)})]},t):(0,o.jsxs)(Qt,{disabled:e.disabled,inset:e.inset,onSelect:e.onSelect,children:[e.label,e.shortcut&&(0,o.jsx)(rn,{children:e.shortcut})]},t)):null;t.ComponentRegistry.register(`context-menu`,({schema:e,className:t,...n})=>{let r=e.triggerClassName||t||e.className||`h-[120px] w-full sm:h-[150px] sm:w-[300px] border border-dashed text-sm flex items-center justify-center`,i=e.contentClassName;return(0,o.jsxs)(Ut,{modal:e.modal,...n,children:[(0,o.jsx)(Wt,{asChild:!0,children:(0,o.jsx)(`div`,{className:r,children:B(e.trigger||{type:`text`,value:`Right click here`})})}),(0,o.jsx)(Zt,{className:i,children:wc(e.items)})]})},{namespace:`ui`,label:`Context Menu`,inputs:[{name:`trigger`,type:`slot`,label:`Trigger Area`},{name:`triggerClassName`,type:`string`,label:`Trigger Area Class`},{name:`items`,type:`array`,label:`Items`,description:`Recursive structure: { type?: "separator"|"label", label, shortcut, children }`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{items:[{label:`Action 1`},{label:`Action 2`},{type:`separator`},{label:`Action 3`}],trigger:[{type:`text`,content:`Right click here`}]}}),t.ComponentRegistry.register(`menubar`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)($n,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.menus?.map((e,t)=>(0,o.jsxs)(Jn,{children:[(0,o.jsx)(er,{children:e.label}),(0,o.jsx)(rr,{children:e.items?.map((e,t)=>e.separator?(0,o.jsx)(cr,{},t):e.children?(0,o.jsxs)(Qn,{children:[(0,o.jsx)(tr,{children:e.label}),(0,o.jsx)(nr,{children:e.children.map((e,t)=>(0,o.jsx)(ir,{children:e.label},t))})]},t):(0,o.jsx)(ir,{disabled:e.disabled,children:e.label},t))})]},t))})},{namespace:`ui`,label:`Menubar`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{menus:[{label:`File`,items:[{label:`New`},{label:`Open`},{separator:!0},{label:`Exit`}]}]}}),t.ComponentRegistry.register(`accordion`,({schema:e,className:t,...n})=>(0,o.jsx)(V,{type:e.accordionType||`single`,collapsible:e.collapsible,className:t,...n,children:e.items?.map((e,t)=>(0,o.jsxs)(ye,{value:e.value||`item-${t}`,children:[(0,o.jsx)(be,{children:e.title}),(0,o.jsx)(xe,{children:B(e.content)})]},e.value||t))}),{namespace:`ui`,label:`Accordion`,inputs:[{name:`accordionType`,type:`enum`,enum:[`single`,`multiple`],defaultValue:`single`,label:`Type`},{name:`collapsible`,type:`boolean`,label:`Collapsible (for single type)`},{name:`items`,type:`array`,label:`Items`,description:`Array of { trigger, content, value }`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{accordionType:`single`,collapsible:!0,items:[{label:`Item 1`,value:`item-1`,content:[{type:`text`,content:`Content for item 1`}]},{label:`Item 2`,value:`item-2`,content:[{type:`text`,content:`Content for item 2`}]},{label:`Item 3`,value:`item-3`,content:[{type:`text`,content:`Content for item 3`}]}],className:`w-full`}}),t.ComponentRegistry.register(`collapsible`,({schema:e,className:t,...n})=>(0,o.jsxs)(xt,{defaultOpen:e.defaultOpen,disabled:e.disabled,className:t,...n,children:[(0,o.jsx)(St,{asChild:!0,children:B(e.trigger)}),(0,o.jsx)(Ct,{children:B(e.content)})]}),{namespace:`ui`,label:`Collapsible`,inputs:[{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Toggle`,variant:`outline`}],content:[{type:`text`,content:`Collapsible content goes here`}],className:`w-full`}}),t.ComponentRegistry.register(`toggle-group`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,type:a,...s}=t;return(0,o.jsx)(ia,{type:e.selectionType||`single`,variant:e.variant,size:e.size,value:e.value,className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:i,children:e.items?.map((e,t)=>(0,o.jsx)(aa,{value:e.value,"aria-label":e.label,children:e.label},t))})},{namespace:`ui`,label:`Toggle Group`,inputs:[{name:`selectionType`,type:`enum`,enum:[`single`,`multiple`],defaultValue:`single`,label:`Selection Type`},{name:`variant`,type:`enum`,enum:[`default`,`outline`],defaultValue:`default`,label:`Variant`},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`],defaultValue:`default`,label:`Size`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{selectionType:`single`,variant:`default`,size:`default`,items:[{value:`bold`,label:`Bold`},{value:`italic`,label:`Italic`},{value:`underline`,label:`Underline`}]}}),t.ComponentRegistry.register(`carousel`,({schema:e,className:t,...n})=>(0,o.jsxs)(at,{opts:e.opts,orientation:e.orientation||`horizontal`,className:t,...n,children:[(0,o.jsx)(ot,{children:e.items?.map((t,n)=>(0,o.jsx)(st,{className:e.itemClassName,children:B(t)},n))}),e.showArrows&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ct,{}),(0,o.jsx)(lt,{})]})]}),{namespace:`ui`,label:`Carousel`,inputs:[{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`],defaultValue:`horizontal`,label:`Orientation`},{name:`showArrows`,type:`boolean`,label:`Show Arrows`,defaultValue:!0},{name:`items`,type:`array`,label:`Items`,description:`Array of content schemas`},{name:`itemClassName`,type:`string`,label:`Item CSS Class`},{name:`className`,type:`string`,label:`Container CSS Class`}],defaultProps:{orientation:`horizontal`,showArrows:!0,items:[[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,body:[{type:`text`,content:`Slide 1`}]}],[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,body:[{type:`text`,content:`Slide 2`}]}],[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,body:[{type:`text`,content:`Slide 3`}]}]],className:`w-full max-w-xs`}}),t.ComponentRegistry.register(`filter-builder`,({schema:e,className:t,onChange:n,...r})=>(0,o.jsxs)(`div`,{className:e.wrapperClass||``,children:[e.label&&(0,o.jsx)(`label`,{className:`text-sm font-medium mb-2 block`,children:e.label}),(0,o.jsx)(vo,{fields:e.fields||[],value:e.value||r.value,onChange:t=>{n&&n({target:{name:e.name,value:t}})},className:t,...r})]}),{namespace:`ui`,label:`Filter Builder`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`name`,type:`string`,label:`Name`,required:!0},{name:`fields`,type:`array`,label:`Fields`,description:`Array of { value: string, label: string, type?: string } objects`,required:!0},{name:`value`,type:`object`,label:`Initial Value`,description:`FilterGroup object with conditions`}],defaultProps:{label:`Filters`,name:`filters`,fields:[{value:`name`,label:`Name`,type:`text`},{value:`email`,label:`Email`,type:`text`},{value:`age`,label:`Age`,type:`number`},{value:`status`,label:`Status`,type:`text`}],value:{id:`root`,logic:`and`,conditions:[]}}}),t.ComponentRegistry.register(`scroll-area`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n,c=e.orientation||`vertical`;return(0,o.jsxs)(Fr,{className:t,style:{height:e.height,width:e.width,...a},...s,"data-obj-id":r,"data-obj-type":i,children:[B(e.children),(c===`horizontal`||c===`both`)&&(0,o.jsx)(Ir,{orientation:`horizontal`}),(c===`vertical`||c===`both`)&&(0,o.jsx)(Ir,{orientation:`vertical`})]})},{namespace:`ui`,label:`Scroll Area`,inputs:[{name:`height`,type:`string`,label:`Height (e.g. 200px)`},{name:`width`,type:`string`,label:`Width`},{name:`orientation`,type:`enum`,enum:[`vertical`,`horizontal`,`both`],defaultValue:`vertical`,label:`Orientation`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{height:`200px`,width:`100%`,orientation:`vertical`,children:[{type:`div`,className:`p-4`,body:[{type:`text`,content:`Scrollable content goes here. Add more content to see scrolling behavior.`}]}],className:`rounded-md border`}}),t.ComponentRegistry.register(`resizable`,({schema:e,className:t,...n})=>{let r=Array.isArray(e.panels)?e.panels:[];return(0,o.jsx)(Mr,{orientation:e.direction||`horizontal`,className:t,...n,style:{minHeight:e.minHeight||`200px`},children:r.map((t,n)=>(0,o.jsxs)(a.default.Fragment,{children:[(0,o.jsx)(Nr,{defaultSize:t.defaultSize,minSize:t.minSize,maxSize:t.maxSize,children:B(t.content)}),n<r.length-1&&(0,o.jsx)(Pr,{withHandle:e.withHandle})]},n))})},{namespace:`ui`,label:`Resizable Panel Group`,inputs:[{name:`direction`,type:`enum`,enum:[`horizontal`,`vertical`],defaultValue:`horizontal`,label:`Direction`},{name:`minHeight`,type:`string`,label:`Min Height`},{name:`withHandle`,type:`boolean`,label:`Show Handle Icon`,defaultValue:!0},{name:`panels`,type:`array`,label:`Panels`,description:`Array of { defaultSize, minSize, maxSize, content }`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{direction:`horizontal`,minHeight:`200px`,withHandle:!0,panels:[{defaultSize:50,content:[{type:`div`,className:`p-4`,body:[{type:`text`,content:`Panel 1`}]}]},{defaultSize:50,content:[{type:`div`,className:`p-4`,body:[{type:`text`,content:`Panel 2`}]}]}],className:`rounded-lg border`}}),t.ComponentRegistry.register(`table`,({schema:e,className:t,...n})=>(0,o.jsxs)(Hi,{className:t,...n,children:[e.caption&&(0,o.jsx)(Yi,{children:e.caption}),(0,o.jsx)(Ui,{children:(0,o.jsx)(Ki,{children:e.columns?.map((e,t)=>(0,o.jsx)(qi,{className:e.className,style:{width:e.width},children:e.header||e.label},t))})}),(0,o.jsx)(Wi,{children:e.data?.map((t,n)=>(0,o.jsx)(Ki,{children:e.columns?.map((e,n)=>(0,o.jsx)(Ji,{className:e.cellClassName,children:t[e.accessorKey||e.name]},n))},n))}),e.footer&&(0,o.jsx)(Gi,{children:(0,o.jsx)(Ki,{children:(0,o.jsx)(Ji,{colSpan:e.columns?.length,children:typeof e.footer==`string`?e.footer:B(e.footer)})})})]}),{namespace:`ui`,label:`Table`,inputs:[{name:`caption`,type:`string`,label:`Caption`},{name:`footer`,type:`string`,label:`Footer Content`},{name:`columns`,type:`array`,label:`Columns`,description:`Array of { header, accessorKey, className, width }`},{name:`data`,type:`array`,label:`Data`,description:`Array of objects`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{caption:`Table Caption`,columns:[{header:`Column 1`,accessorKey:`col1`},{header:`Column 2`,accessorKey:`col2`},{header:`Column 3`,accessorKey:`col3`}],data:[{col1:`Row 1, Col 1`,col2:`Row 1, Col 2`,col3:`Row 1, Col 3`},{col1:`Row 2, Col 1`,col2:`Row 2, Col 2`,col3:`Row 2, Col 3`},{col1:`Row 3, Col 1`,col2:`Row 3, Col 2`,col3:`Row 3, Col 3`}]}});var Tc={"table.rowsPerPage":`Rows per page`,"table.pageInfo":`Page {{current}} of {{total}}`,"table.totalRecords":`{{count}} total`,"table.noResults":`No results found`,"table.noResultsHint":`Try adjusting your filters or search query.`,"table.sortAsc":`Sort ascending`,"table.sortDesc":`Sort descending`,"table.hideColumn":`Hide column`,"table.cancelAll":`Cancel All`,"table.saveAll":`Save All ({{count}})`,"table.exportCSV":`Export CSV`,"table.addRecord":`Add record`,"table.open":`Open`,"table.search":`Search...`,"table.modified":`{{count}} row modified`,"table.selected":`{{count}} selected`,"table.edit":`Edit`,"table.delete":`Delete`,"common.actions":`Actions`};function Ec(){try{let e=(0,i.useObjectTranslation)();return e.t(`table.rowsPerPage`)===`table.rowsPerPage`?{t:(e,t)=>{let n=Tc[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n},language:e.language||`en`}:{t:e.t,language:e.language||`en`}}catch{return{t:(e,t)=>{let n=Tc[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n},language:`en`}}}t.ComponentRegistry.register(`data-table`,({schema:e})=>{let{caption:n,columns:r=[],data:i=[],pagination:s=!0,pageSize:l=10,searchable:u=!0,selectable:d=!1,sortable:f=!0,exportable:p=!1,rowActions:m=!1,resizableColumns:h=!0,reorderableColumns:g=!0,editable:_=!1,singleClickEdit:v=!1,selectionStyle:y=`always`,rowClassName:b,rowStyle:x,className:S,cellClassName:C,frozenColumns:w=0,showRowNumbers:T=!1,showAddRow:E=!1,borderless:D=!1}=e,{t:O,language:k}=Ec(),A=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,ee=a.default.useCallback(e=>{if(typeof e!=`string`||e.length<8||!A.test(e))return e;let t=Date.parse(e);if(Number.isNaN(t))return e;let n=e.includes(`T`);try{return new Intl.DateTimeFormat(k,n?{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}:{year:`numeric`,month:`short`,day:`numeric`}).format(new Date(t))}catch{return e}},[k]),j=Array.isArray(i)?i:[],te=(0,a.useMemo)(()=>r.map(e=>({...e,header:e.header||e.label,accessorKey:e.accessorKey||e.name})),[r]),M=(0,a.useMemo)(()=>{let e={},t=r.map(e=>({header:e.header||e.label,accessorKey:e.accessorKey||e.name,width:e.width}));for(let n of t){if(n.width)continue;let t=(n.header||``).length,r=j.slice(0,50);for(let e of r){let r=e[n.accessorKey],i=r==null?0:String(r).length;i>t&&(t=i)}e[n.accessorKey]=Math.min(400,Math.max(80,t*8+48))}return e},[r,j]),[N,ne]=(0,a.useState)(``),[re,ie]=(0,a.useState)(null),[ae,P]=(0,a.useState)(null),[oe,se]=(0,a.useState)(new Set),[F,ce]=(0,a.useState)(1),[I,le]=(0,a.useState)(l),[L,ue]=(0,a.useState)(te),[de,fe]=(0,a.useState)({}),[pe,me]=(0,a.useState)(null),[he,ge]=(0,a.useState)(null),[R,B]=(0,a.useState)(null),[_e,ve]=(0,a.useState)(``),[V,ye]=(0,a.useState)(new Map),[be,xe]=(0,a.useState)(!1),[H,Se]=(0,a.useState)(null),Ce=(0,a.useRef)(null),we=(0,a.useRef)(0),Te=(0,a.useRef)(0),Ee=(0,a.useRef)(null);(0,a.useEffect)(()=>{ue(te)},[te]);let De=(0,a.useMemo)(()=>N?j.filter(e=>L.some(t=>e[t.accessorKey]?.toString().toLowerCase().includes(N.toLowerCase()))):j,[j,N,L]),W=(0,a.useMemo)(()=>!re||!ae?De:[...De].sort((e,t)=>{let n=e[re],r=t[re];if(n===r)return 0;let i=n<r?-1:1;return ae===`asc`?i:-i}),[De,re,ae]),Oe=Math.ceil(W.length/I),ke=s?W.slice((F-1)*I,F*I):W,Ae=(e,t)=>e.id===void 0?`row-${t}`:e.id,je=e=>{f&&(re===e?ae===`asc`?P(`desc`):ae===`desc`&&(P(null),ie(null)):(ie(e),P(`asc`)))},Me=(e,t)=>{e.preventDefault(),Se({x:e.clientX,y:e.clientY,columnKey:t})},Ne=e=>{ue(t=>t.filter(t=>t.accessorKey!==e)),Se(null)};(0,a.useEffect)(()=>{if(!H)return;let e=()=>Se(null);return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[H]);let Pe=t=>{let n=new Set;if(t&&ke.forEach((e,t)=>{let r=Ae(e,(F-1)*I+t);n.add(r)}),se(n),e.onSelectionChange){let t=W.filter((e,t)=>{let r=Ae(e,t);return n.has(r)});e.onSelectionChange(t)}},Fe=(t,n)=>{let r=new Set(oe);if(n?r.add(t):r.delete(t),se(r),e.onSelectionChange){let t=W.filter((e,t)=>{let n=Ae(e,t);return r.has(n)});e.onSelectionChange(t)}},Ie=()=>{let e=[L.map(e=>e.header).join(`,`),...W.map(e=>L.map(t=>JSON.stringify(e[t.accessorKey]||``)).join(`,`))].join(`
|
|
19
|
-
`),t=new Blob([e],{type:`text/csv`}),n=window.URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`table-export.csv`,r.click(),window.URL.revokeObjectURL(n)},Le=e=>re===e?ae===`asc`?(0,o.jsx)(c.ChevronUp,{className:`h-3 w-3 ml-0.5 text-primary`}):(0,o.jsx)(c.ChevronDown,{className:`h-3 w-3 ml-0.5 text-primary`}):(0,o.jsx)(c.ChevronsUpDown,{className:`h-3 w-3 ml-0.5 opacity-0 group-hover:opacity-50 transition-opacity`}),Re=(e,t)=>{if(!h)return;e.preventDefault(),e.stopPropagation(),Ce.current=t,we.current=e.clientX;let n=e.target.closest(`th`);n&&(Te.current=n.offsetWidth),document.addEventListener(`mousemove`,ze),document.addEventListener(`mouseup`,Be)},ze=e=>{if(!Ce.current)return;let t=e.clientX-we.current,n=Math.max(50,Te.current+t);fe(e=>({...e,[Ce.current]:n}))},Be=()=>{Ce.current=null,document.removeEventListener(`mousemove`,ze),document.removeEventListener(`mouseup`,Be)},Ve=(e,t)=>{g&&(me(t),e.dataTransfer.effectAllowed=`move`)},He=(e,t)=>{g&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,ge(t))},Ue=(t,n)=>{if(!g||pe===null)return;if(t.preventDefault(),pe===n){me(null),ge(null);return}let r=[...L],[i]=r.splice(pe,1);r.splice(n,0,i),ue(r),me(null),ge(null),e.onColumnsReorder&&e.onColumnsReorder(r)},We=()=>{me(null),ge(null)},Ge=(e,t)=>{if(!_||L.find(e=>e.accessorKey===t)?.editable===!1)return;B({rowIndex:e,columnKey:t});let n=V.get(e),r=ke[e][t];ve(n?.[t]??r??``)},Ke=(t=!1)=>{if(!R||!t&&R===null)return;let{rowIndex:n,columnKey:r}=R,i=(F-1)*I+n,a=W[i],o=new Map(V),s=o.get(n)||{};s[r]=_e,o.set(n,s),ye(o),e.onCellChange&&e.onCellChange(i,r,_e,a),B(null),ve(``)},qe=()=>{B(null),ve(``)},Je=async t=>{let n=(F-1)*I+t,r=W[n],i=V.get(t);if(!(!i||Object.keys(i).length===0)){xe(!0);try{e.onRowSave&&await e.onRowSave(n,i,r);let a=new Map(V);a.delete(t),ye(a)}catch(e){console.error(`Failed to save row:`,e)}finally{xe(!1)}}},Ye=e=>{let t=new Map(V);t.delete(e),ye(t)},Xe=async()=>{if(V.size!==0){xe(!0);try{let t=Array.from(V.entries()).map(([e,t])=>{let n=(F-1)*I+e;return{rowIndex:n,changes:t,row:W[n]}});e.onBatchSave&&await e.onBatchSave(t),ye(new Map)}catch(e){console.error(`Failed to save batch:`,e)}finally{xe(!1)}}},Ze=()=>{ye(new Map)},Qe=(e,t,n)=>{if((e.ctrlKey||e.metaKey)&&e.key===`c`&&!R){e.preventDefault();let r=W[(F-1)*I+t];if(r){let e=r[n],t=e==null?``:String(e);navigator.clipboard.writeText(t).catch(()=>{})}return}_&&L.find(e=>e.accessorKey===n)?.editable!==!1&&e.key===`Enter`&&!R&&(e.preventDefault(),Ge(t,n))},$e=e=>{e.key===`Enter`?(e.preventDefault(),Ke(!0)):e.key===`Escape`&&(e.preventDefault(),qe())};(0,a.useEffect)(()=>{R&&Ee.current&&(Ee.current.focus(),Ee.current.select())},[R]),(0,a.useEffect)(()=>()=>{document.removeEventListener(`mousemove`,ze),document.removeEventListener(`mouseup`,Be)},[]);let et=ke.length>0&&ke.every((e,t)=>{let n=Ae(e,(F-1)*I+t);return oe.has(n)}),tt=ke.some((e,t)=>{let n=Ae(e,(F-1)*I+t);return oe.has(n)})&&!et,nt=V.size>0,rt=u||p||d&&oe.size>0||nt;return(0,o.jsxs)(`div`,{className:`flex flex-col h-full gap-2 sm:gap-4 ${S||``}`,children:[rt&&(0,o.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-4 flex-none`,children:[(0,o.jsx)(`div`,{className:`flex items-center gap-2 flex-1`,children:u&&(0,o.jsxs)(`div`,{className:`relative w-full sm:max-w-sm flex-1`,children:[(0,o.jsx)(c.Search,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,o.jsx)(K,{placeholder:O(`table.search`),value:N,onChange:e=>{ne(e.target.value),ce(1)},className:`pl-8`})]})}),(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[nt&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:O(`table.modified`,{count:V.size})}),(0,o.jsxs)(U,{variant:`outline`,size:`sm`,onClick:Ze,disabled:be,children:[(0,o.jsx)(c.X,{className:`h-4 w-4 mr-2`}),O(`table.cancelAll`)]}),(0,o.jsxs)(U,{variant:`default`,size:`sm`,onClick:Xe,disabled:be,children:[(0,o.jsx)(c.Save,{className:`h-4 w-4 mr-2`}),O(`table.saveAll`,{count:V.size})]})]}),p&&(0,o.jsxs)(U,{variant:`outline`,size:`sm`,onClick:Ie,disabled:W.length===0,children:[(0,o.jsx)(c.Download,{className:`h-4 w-4 mr-2`}),O(`table.exportCSV`)]}),d&&oe.size>0&&(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:O(`table.selected`,{count:oe.size})})]})]}),(0,o.jsx)(`div`,{className:z(`flex-1 min-h-0 overflow-auto relative bg-background [-webkit-overflow-scrolling:touch]`,!D&&`rounded-md border shadow-[inset_-8px_0_8px_-8px_rgba(0,0,0,0.08)]`),children:(0,o.jsxs)(Hi,{children:[n&&(0,o.jsx)(Yi,{children:n}),(0,o.jsx)(Ui,{className:`sticky top-0 bg-muted/30 z-10`,children:(0,o.jsxs)(Ki,{children:[d&&(0,o.jsx)(qi,{className:z(`w-10 bg-muted/30`,w>0&&`sticky left-0 z-20`),children:(0,o.jsx)(bt,{checked:et?!0:tt?`indeterminate`:!1,onCheckedChange:Pe})}),T&&(0,o.jsx)(qi,{className:z(`w-10 bg-muted/30 text-center`,w>0&&`sticky z-20`),style:w>0?{left:d?40:0}:void 0,children:(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`#`})}),L.map((e,t)=>{let n=de[e.accessorKey]||e.width||M[e.accessorKey],r=pe===t,i=he===t,a=w>0&&t<w,s=a?L.slice(0,t).reduce((e,t,n)=>{if(n<w){let n=de[t.accessorKey]||t.width||M[t.accessorKey];return e+(typeof n==`number`?n:n&&parseInt(String(n),10)||150)}return e},(d?40:0)+(T?40:0)):void 0;return(0,o.jsx)(qi,{className:z(e.className,f&&e.sortable!==!1&&`cursor-pointer select-none`,r&&`opacity-50`,i&&`border-l-2 border-primary`,e.align===`right`&&`text-right`,e.align===`center`&&`text-center`,`relative group bg-muted/30`,a&&`sticky z-20`,a&&t===w-1&&`border-r-2 border-border shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]`),style:{width:n,minWidth:n,...a&&{left:s}},draggable:g,onDragStart:e=>Ve(e,t),onDragOver:e=>He(e,t),onDrop:e=>Ue(e,t),onDragEnd:We,onClick:()=>f&&e.sortable!==!1&&je(e.accessorKey),onContextMenu:t=>Me(t,e.accessorKey),children:(0,o.jsxs)(`div`,{className:z(`flex items-center`,e.align===`right`?`justify-end`:`justify-between`),children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[g&&(0,o.jsx)(c.GripVertical,{className:`h-4 w-4 opacity-0 group-hover:opacity-50 cursor-grab active:cursor-grabbing shrink-0`}),e.headerIcon&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e.headerIcon}),(0,o.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground whitespace-nowrap truncate`,children:e.header}),f&&e.sortable!==!1&&Le(e.accessorKey)]}),h&&e.resizable!==!1&&(0,o.jsx)(`div`,{className:`absolute right-0 top-0 h-full w-1 cursor-col-resize hover:bg-primary opacity-0 hover:opacity-100 transition-opacity`,onMouseDown:t=>Re(t,e.accessorKey),onClick:e=>e.stopPropagation()})]})},e.accessorKey)}),m&&(0,o.jsx)(qi,{className:`w-24 text-right bg-muted/30`,children:O(`common.actions`)})]})}),(0,o.jsx)(Wi,{children:ke.length===0?(0,o.jsx)(Ki,{className:`hover:bg-transparent`,children:(0,o.jsx)(Ji,{colSpan:L.length+ +!!d+ +!!T+ +!!m,className:`h-48 text-center text-muted-foreground border-0`,children:(0,o.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3`,children:[(0,o.jsx)(c.Search,{className:`h-8 w-8 text-muted-foreground/50`}),(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(`p`,{children:O(`table.noResults`)}),(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground/50`,children:O(`table.noResultsHint`)})]}),e.emptyAction&&(()=>{let n=e.emptyAction,r=n?.type?t.ComponentRegistry.get(n.type):null;return r?(0,o.jsx)(r,{schema:n}):null})()]})})}):(0,o.jsxs)(o.Fragment,{children:[ke.map((t,n)=>{let r=(F-1)*I+n,i=Ae(t,r),a=oe.has(i),s=V.has(n),l=V.get(n)||{};return(0,o.jsxs)(Ki,{"data-state":a?`selected`:void 0,className:z(`bg-background border-b border-border group/row transition-colors`,`hover:bg-muted/40`,`data-[state=selected]:bg-primary/5 data-[state=selected]:hover:bg-primary/10`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset`,e.onRowClick&&`cursor-pointer`,s&&`bg-amber-50 dark:bg-amber-950/20`,b&&b(t,n)),style:x?x(t,n):void 0,onClick:n=>{if(e.onRowClick&&!n.defaultPrevented){let r=n.target;if(r.closest(`button`)||r.closest(`a`)||r.closest(`input, select, textarea, label`)||r.closest(`[role="checkbox"]`)||r.closest(`[role="menu"]`)||r.closest(`[role="menuitem"]`)||r.closest(`[role="menuitemcheckbox"]`)||r.closest(`[role="menuitemradio"]`)||r.closest(`[role="dialog"]`)||r.closest(`[role="alertdialog"]`)||r.closest(`[role="listbox"]`)||r.closest(`[role="option"]`)||r.closest(`[role="tab"]`)||r.closest(`[data-radix-popper-content-wrapper]`))return;e.onRowClick(t)}},children:[d&&(0,o.jsx)(Ji,{className:z(C,w>0&&`sticky left-0 z-10 bg-background`,y===`hover`&&`relative`),children:y===`hover`?(0,o.jsx)(`div`,{className:z(`transition-opacity`,a?`opacity-100`:`opacity-0 group-hover/row:opacity-100`),children:(0,o.jsx)(bt,{checked:a,onCheckedChange:e=>Fe(i,e)})}):(0,o.jsx)(bt,{checked:a,onCheckedChange:e=>Fe(i,e)})}),T&&(0,o.jsxs)(Ji,{className:z(`text-center w-10 relative`,C,w>0&&`sticky z-10 bg-background`),style:w>0?{left:d?40:0}:void 0,children:[(0,o.jsx)(`span`,{className:z(`text-xs text-muted-foreground tabular-nums select-none`,!d&&e.onRowClick&&`group-hover/row:invisible`),children:r+1}),!d&&e.onRowClick&&(0,o.jsxs)(`button`,{type:`button`,className:`absolute inset-0 hidden group-hover/row:flex items-center justify-center gap-0.5 text-xs font-medium text-primary hover:text-primary/80`,"data-testid":`row-expand-button`,onClick:n=>{n.stopPropagation(),e.onRowClick?.(t)},title:`Open record`,children:[(0,o.jsx)(`span`,{children:O(`table.open`)}),(0,o.jsx)(c.ChevronRight,{className:`h-3 w-3`})]})]}),L.map((e,r)=>{let i=de[e.accessorKey]||e.width||M[e.accessorKey],a=t[e.accessorKey],s=l[e.accessorKey]!==void 0,c=s?l[e.accessorKey]:a,u=R?.rowIndex===n&&R?.columnKey===e.accessorKey,f=_&&e.editable!==!1,p=w>0&&r<w,m=p?L.slice(0,r).reduce((e,t,n)=>{if(n<w){let n=de[t.accessorKey]||t.width||M[t.accessorKey];return e+(typeof n==`number`?n:n&&parseInt(String(n),10)||150)}return e},(d?40:0)+(T?40:0)):void 0;return(0,o.jsx)(Ji,{className:z(e.cellClassName,e.align===`right`&&`text-right`,e.align===`center`&&`text-center`,f&&!u&&`cursor-text hover:bg-muted/50`,s&&`font-semibold text-amber-700 dark:text-amber-400`,p&&`sticky z-10 bg-background`,p&&r===w-1&&`border-r-2 border-border shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]`),style:{width:i,minWidth:i,maxWidth:i,...p&&{left:m}},onDoubleClick:()=>f&&!v&&Ge(n,e.accessorKey),onClick:()=>f&&v&&Ge(n,e.accessorKey),onKeyDown:t=>Qe(t,n,e.accessorKey),tabIndex:0,children:u?(0,o.jsx)(K,{ref:Ee,value:_e,onChange:e=>ve(e.target.value),onKeyDown:$e,className:`h-8 px-2 py-1`}):typeof e.cell==`function`?e.cell(c,t):typeof c==`object`&&c?String(c):ee(c)},r)}),m&&(0,o.jsx)(Ji,{className:z(`text-right`,C),children:(0,o.jsx)(`div`,{className:`flex items-center justify-end gap-1`,children:s&&(e.onRowSave||e.onBatchSave)?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(U,{variant:`ghost`,size:`icon`,onClick:()=>Ye(n),disabled:be,title:`Cancel changes`,children:(0,o.jsx)(c.X,{className:`h-4 w-4`})}),(0,o.jsx)(U,{variant:`ghost`,size:`icon`,onClick:()=>Je(n),disabled:be,title:`Save row`,children:(0,o.jsx)(c.Save,{className:`h-4 w-4 text-green-600`})})]}):(e.onRowEdit||e.onRowDelete)&&(0,o.jsxs)(hn,{children:[(0,o.jsx)(gn,{asChild:!0,children:(0,o.jsx)(U,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:e=>e.stopPropagation(),"aria-label":`Row actions`,children:(0,o.jsx)(c.MoreHorizontal,{className:`h-4 w-4`})})}),(0,o.jsxs)(Cn,{align:`end`,onClick:e=>e.stopPropagation(),children:[e.onRowEdit&&(0,o.jsxs)(wn,{onClick:()=>e.onRowEdit?.(t),children:[(0,o.jsx)(c.Edit,{className:`mr-2 h-4 w-4`}),O(`table.edit`)]}),e.onRowEdit&&e.onRowDelete&&(0,o.jsx)(On,{}),e.onRowDelete&&(0,o.jsxs)(wn,{onClick:()=>e.onRowDelete?.(t),className:`text-destructive focus:text-destructive`,children:[(0,o.jsx)(c.Trash2,{className:`mr-2 h-4 w-4`}),O(`table.delete`)]})]})]})})})]},i)}),E&&(0,o.jsx)(Ki,{className:`hover:bg-muted/30 cursor-pointer border-b border-border`,"data-testid":`add-record-row`,onClick:()=>e.onAddRecord?.(),children:(0,o.jsx)(Ji,{colSpan:L.length+ +!!d+ +!!T+ +!!m,className:`h-9 px-3 py-1.5`,children:(0,o.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground text-sm hover:text-foreground transition-colors`,children:[(0,o.jsx)(c.Plus,{className:`h-3.5 w-3.5`}),O(`table.addRecord`)]})})})]})})]})}),s&&W.length>0&&Oe>1&&(0,o.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center justify-between gap-2`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsxs)(`span`,{className:`text-xs sm:text-sm text-muted-foreground`,children:[O(`table.rowsPerPage`),`:`]}),(0,o.jsxs)(Lr,{value:I.toString(),onValueChange:e=>{le(Number(e)),ce(1)},children:[(0,o.jsx)(J,{className:`w-20`,children:(0,o.jsx)(q,{})}),(0,o.jsxs)(Y,{children:[(0,o.jsx)(X,{value:`5`,children:`5`}),(0,o.jsx)(X,{value:`10`,children:`10`}),(0,o.jsx)(X,{value:`20`,children:`20`}),(0,o.jsx)(X,{value:`50`,children:`50`}),(0,o.jsx)(X,{value:`100`,children:`100`})]})]})]}),(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-xs sm:text-sm text-muted-foreground`,children:O(`table.pageInfo`,{current:F,total:Oe})}),(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(U,{variant:`outline`,size:`icon`,onClick:()=>ce(1),disabled:F===1,children:(0,o.jsx)(c.ChevronsLeft,{className:`h-4 w-4`})}),(0,o.jsx)(U,{variant:`outline`,size:`icon`,onClick:()=>ce(Math.max(1,F-1)),disabled:F===1,children:(0,o.jsx)(c.ChevronLeft,{className:`h-4 w-4`})}),(0,o.jsx)(U,{variant:`outline`,size:`icon`,onClick:()=>ce(Math.min(Oe,F+1)),disabled:F===Oe,children:(0,o.jsx)(c.ChevronRight,{className:`h-4 w-4`})}),(0,o.jsx)(U,{variant:`outline`,size:`icon`,onClick:()=>ce(Oe),disabled:F===Oe,children:(0,o.jsx)(c.ChevronsRight,{className:`h-4 w-4`})})]})]})]}),H&&(0,o.jsxs)(`div`,{className:`fixed z-50 min-w-[160px] rounded-md border bg-popover p-1 shadow-md`,style:{left:H.x,top:H.y},"data-testid":`column-context-menu`,onClick:e=>e.stopPropagation(),children:[f&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>{ie(H.columnKey),P(`asc`),Se(null)},children:[(0,o.jsx)(c.ChevronUp,{className:`h-3.5 w-3.5`}),O(`table.sortAsc`)]}),(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>{ie(H.columnKey),P(`desc`),Se(null)},children:[(0,o.jsx)(c.ChevronDown,{className:`h-3.5 w-3.5`}),O(`table.sortDesc`)]}),(0,o.jsx)(`div`,{className:`my-1 h-px bg-border`})]}),(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>Ne(H.columnKey),children:[(0,o.jsx)(c.X,{className:`h-3.5 w-3.5`}),O(`table.hideColumn`)]})]})]})},{namespace:`ui`,label:`Data Table`,icon:`table`,inputs:[{name:`caption`,type:`string`,label:`Caption`},{name:`columns`,type:`array`,label:`Columns`,description:`Array of { header, accessorKey, className, width, sortable, filterable, resizable }`,required:!0},{name:`data`,type:`array`,label:`Data`,description:`Array of data objects`,required:!0},{name:`pagination`,type:`boolean`,label:`Enable Pagination`,defaultValue:!0},{name:`pageSize`,type:`number`,label:`Page Size`,defaultValue:10},{name:`searchable`,type:`boolean`,label:`Enable Search`,defaultValue:!0},{name:`selectable`,type:`boolean`,label:`Enable Row Selection`,defaultValue:!1},{name:`sortable`,type:`boolean`,label:`Enable Sorting`,defaultValue:!0},{name:`exportable`,type:`boolean`,label:`Enable Export`,defaultValue:!1},{name:`rowActions`,type:`boolean`,label:`Show Row Actions`,defaultValue:!1},{name:`resizableColumns`,type:`boolean`,label:`Enable Column Resizing`,defaultValue:!0},{name:`reorderableColumns`,type:`boolean`,label:`Enable Column Reordering`,defaultValue:!0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{caption:`Enterprise Data Table`,pagination:!0,pageSize:10,searchable:!0,selectable:!0,sortable:!0,exportable:!0,rowActions:!0,resizableColumns:!0,reorderableColumns:!0,columns:[{header:`ID`,accessorKey:`id`,width:`80px`},{header:`Name`,accessorKey:`name`},{header:`Email`,accessorKey:`email`},{header:`Status`,accessorKey:`status`},{header:`Role`,accessorKey:`role`}],data:[{id:1,name:`John Doe`,email:`john@example.com`,status:`Active`,role:`Admin`},{id:2,name:`Jane Smith`,email:`jane@example.com`,status:`Active`,role:`User`},{id:3,name:`Bob Johnson`,email:`bob@example.com`,status:`Inactive`,role:`User`},{id:4,name:`Alice Williams`,email:`alice@example.com`,status:`Active`,role:`Manager`},{id:5,name:`Charlie Brown`,email:`charlie@example.com`,status:`Active`,role:`User`},{id:6,name:`Diana Prince`,email:`diana@example.com`,status:`Active`,role:`Admin`},{id:7,name:`Ethan Hunt`,email:`ethan@example.com`,status:`Inactive`,role:`User`},{id:8,name:`Fiona Gallagher`,email:`fiona@example.com`,status:`Active`,role:`User`},{id:9,name:`George Wilson`,email:`george@example.com`,status:`Active`,role:`Manager`},{id:10,name:`Hannah Montana`,email:`hannah@example.com`,status:`Active`,role:`User`},{id:11,name:`Ivan Drago`,email:`ivan@example.com`,status:`Inactive`,role:`User`},{id:12,name:`Julia Roberts`,email:`julia@example.com`,status:`Active`,role:`Admin`}]}});function Dc(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}var Oc={Home:`House`};function kc(e){if(!e)return null;let t=Dc(e);return c.icons[Oc[t]||t]??null}var Ac=(0,a.forwardRef)(({schema:e,className:t,context:n,...r},s)=>{let{"data-obj-id":l,"data-obj-type":u,style:d,data:f,...p}=r,{execute:m}=(0,i.useAction)(),[h,g]=(0,a.useState)(!1),_=typeof f==`object`&&f?f:{},v=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),_),y=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),_),b=kc(e.icon),x=e.variant===`primary`?`default`:e.variant||`default`,S=e.size===`md`?`default`:e.size||`default`,C=(0,a.useCallback)(async()=>{if(!h){g(!0);try{let t=Array.isArray(e.params)?{actionParams:e.params}:{params:e.params};await m({type:e.actionType||e.type,name:e.name,target:e.target,execute:e.execute,endpoint:e.endpoint,method:e.method,...t,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,toast:e.toast,...n})}finally{g(!1)}}},[e,m,h,n]);return e.visible&&!v?null:(0,o.jsxs)(U,{ref:s,type:`button`,variant:x,size:S,className:z(e.className,t),disabled:(e.enabled?!y:!1)||h,onClick:C,...p,"data-obj-id":l,"data-obj-type":u,style:d,children:[h&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!h&&b&&(0,o.jsx)(b,{className:z(`h-4 w-4`,e.label&&`mr-2`)}),e.label]})});Ac.displayName=`ActionButtonRenderer`,t.ComponentRegistry.register(`action:button`,Ac,{namespace:`action`,label:`Action Button`,inputs:[{name:`name`,type:`string`,label:`Action Name`},{name:`label`,type:`string`,label:`Label`,defaultValue:`Action`},{name:`icon`,type:`string`,label:`Icon`},{name:`type`,type:`enum`,label:`Action Type`,enum:[`script`,`url`,`modal`,`flow`,`api`],defaultValue:`script`},{name:`target`,type:`string`,label:`Target`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`default`,`primary`,`secondary`,`destructive`,`outline`,`ghost`],defaultValue:`default`},{name:`size`,type:`enum`,label:`Size`,enum:[`sm`,`md`,`lg`],defaultValue:`md`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{label:`Action`,type:`script`,variant:`default`,size:`md`}});var jc=(0,a.forwardRef)(({schema:e,className:t,context:n,...r},s)=>{let{"data-obj-id":l,"data-obj-type":u,style:d,...f}=r,{execute:p}=(0,i.useAction)(),[m,h]=(0,a.useState)(!1),g=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),_=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled)),v=kc(e.icon),y=e.variant===`primary`?`default`:e.variant||`ghost`,b=(0,a.useCallback)(async()=>{if(!m){h(!0);try{await p({type:e.type,name:e.name,target:e.target,execute:e.execute,endpoint:e.endpoint,method:e.method,params:e.params,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,toast:e.toast,...n})}finally{h(!1)}}},[e,p,m,n]);if(e.visible&&!g)return null;let x=(0,o.jsx)(U,{ref:s,type:`button`,variant:y,size:`icon`,className:z(`h-8 w-8`,e.className,t),disabled:(e.enabled?!_:!1)||m,onClick:b,"aria-label":e.label||e.name,...f,"data-obj-id":l,"data-obj-type":u,style:d,children:m?(0,o.jsx)(c.Loader2,{className:`h-4 w-4 animate-spin`}):v?(0,o.jsx)(v,{className:`h-4 w-4`}):(0,o.jsx)(`span`,{className:`text-xs`,children:e.label?.charAt(0)||`?`})});return e.label||e.description?(0,o.jsx)(ri,{delayDuration:300,children:(0,o.jsxs)(ii,{children:[(0,o.jsx)(ai,{asChild:!0,children:x}),(0,o.jsx)(oi,{children:(0,o.jsx)(`p`,{children:e.label||e.description})})]})}):x});jc.displayName=`ActionIconRenderer`,t.ComponentRegistry.register(`action:icon`,jc,{namespace:`action`,label:`Action Icon`,inputs:[{name:`name`,type:`string`,label:`Action Name`},{name:`label`,type:`string`,label:`Tooltip Label`},{name:`icon`,type:`string`,label:`Icon`},{name:`type`,type:`enum`,label:`Action Type`,enum:[`script`,`url`,`modal`,`flow`,`api`],defaultValue:`script`},{name:`target`,type:`string`,label:`Target`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`],defaultValue:`ghost`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{icon:`play`,type:`script`,variant:`ghost`}});function Mc(){try{let{t:e}=(0,le.useObjectTranslation)(),t=e(`detail.moreActions`);return!t||t===`detail.moreActions`?`More actions`:t}catch{return`More actions`}}var Nc=({action:e,onExecute:t})=>{let n=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),r=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled)),s=(0,a.useMemo)(()=>{let t=kc(e.icon);return t?(0,o.jsx)(t,{className:`mr-2 h-4 w-4`}):null},[e.icon]);return e.visible&&!n?null:(0,o.jsxs)(wn,{disabled:e.enabled?!r:!1,onSelect:n=>{n.preventDefault(),t(e)},className:z(e.variant===`destructive`&&`text-destructive focus:text-destructive`,e.className),children:[s,(0,o.jsx)(`span`,{children:e.label||e.name})]})};Nc.displayName=`ActionMenuItem`;var Pc=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":s,"data-obj-type":l,style:u,...d}=n,{execute:f}=(0,i.useAction)(),[p,m]=(0,a.useState)(!1),h=Mc(),g=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),_=kc(e.icon)||c.MoreHorizontal,v=e.variant||`ghost`,y=e.size||`icon`,b=(0,a.useCallback)(async e=>{m(!0);try{if(typeof e.onClick==`function`){await e.onClick();return}await f({type:e.type,name:e.name,target:e.target,execute:e.execute,endpoint:e.endpoint,method:e.method,params:e.params,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,toast:e.toast})}finally{m(!1)}},[f]);if(e.visible&&!g)return null;let x=e.actions||[];return x.length===0?null:(0,o.jsxs)(hn,{children:[(0,o.jsx)(gn,{asChild:!0,children:(0,o.jsx)(U,{ref:r,type:`button`,variant:v,size:y,className:z(y===`icon`&&`h-8 w-8`,e.className,t),disabled:p,"aria-label":e.label||h,...d,"data-obj-id":s,"data-obj-type":l,style:u,children:p?(0,o.jsx)(c.Loader2,{className:`h-4 w-4 animate-spin`}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(_,{className:z(`h-4 w-4`,e.label&&`mr-2`)}),e.label&&(0,o.jsx)(`span`,{children:e.label})]})})}),(0,o.jsx)(Cn,{align:`end`,children:x.map((e,t)=>{let n=e.tags?.includes(`separator-before`)&&t>0;return(0,o.jsxs)(a.default.Fragment,{children:[n&&(0,o.jsx)(On,{}),(0,o.jsx)(Nc,{action:e,onExecute:b})]},e.name||t)})})]})});Pc.displayName=`ActionMenuRenderer`,t.ComponentRegistry.register(`action:menu`,Pc,{namespace:`action`,label:`Action Menu`,inputs:[{name:`label`,type:`string`,label:`Trigger Label`},{name:`icon`,type:`string`,label:`Trigger Icon`},{name:`actions`,type:`object`,label:`Actions`},{name:`variant`,type:`enum`,label:`Trigger Variant`,enum:[`default`,`secondary`,`outline`,`ghost`],defaultValue:`ghost`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{variant:`ghost`,actions:[]}});var Fc=({action:e,variant:t,size:n,onExecute:r})=>{let[s,l]=(0,a.useState)(!1),u=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),d=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled)),f=kc(e.icon),p=e.variant===`primary`?`default`:e.variant||t||`outline`,m=e.size===`md`?`default`:e.size||n||`sm`,h=(0,a.useCallback)(async()=>{if(!s){l(!0);try{await r(e)}finally{l(!1)}}},[e,r,s]);return e.visible&&!u?null:(0,o.jsxs)(U,{type:`button`,variant:p,size:m,className:e.className,disabled:(e.enabled?!d:!1)||s,onClick:h,children:[s&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!s&&f&&(0,o.jsx)(f,{className:z(`h-4 w-4`,e.label&&`mr-2`)}),e.label]})};Fc.displayName=`InlineActionButton`;var Ic=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":s,"data-obj-type":l,style:u,...d}=n,{execute:f}=(0,i.useAction)(),[p,m]=(0,a.useState)(!1),h=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),g=e.actions||[];e.location&&(g=g.filter(t=>!t.locations||t.locations.includes(e.location)));let _=(0,a.useCallback)(async e=>{await f({type:e.type,name:e.name,target:e.target,execute:e.execute,endpoint:e.endpoint,method:e.method,params:e.params,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,toast:e.toast})},[f]);if(e.visible&&!h||g.length===0)return null;if((e.display||`inline`)===`dropdown`){let n=kc(e.icon);return(0,o.jsxs)(hn,{children:[(0,o.jsx)(gn,{asChild:!0,children:(0,o.jsxs)(U,{type:`button`,variant:e.variant||`outline`,size:e.size===`md`?`default`:e.size||`default`,className:z(e.className,t),disabled:p,"data-obj-id":s,"data-obj-type":l,style:u,children:[p&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!p&&n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label||`Actions`,(0,o.jsx)(c.ChevronDown,{className:`ml-2 h-3 w-3 opacity-50`})]})}),(0,o.jsx)(Cn,{align:`end`,children:g.map((e,t)=>{let n=kc(e.icon),r=e.tags?.includes(`separator-before`)&&t>0;return(0,o.jsxs)(a.default.Fragment,{children:[r&&(0,o.jsx)(On,{}),(0,o.jsxs)(wn,{onSelect:async t=>{t.preventDefault(),m(!0);try{await _(e)}finally{m(!1)}},className:z(e.variant===`destructive`&&`text-destructive focus:text-destructive`,e.className),children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),(0,o.jsx)(`span`,{children:e.label||e.name})]})]},e.name||t)})})]})}return(0,o.jsx)(`div`,{ref:r,className:z(`flex items-center gap-2`,e.className,t),...d,"data-obj-id":s,"data-obj-type":l,style:u,children:g.map(t=>(0,o.jsx)(Fc,{action:t,variant:e.variant,size:e.size,onExecute:_},t.name))})});Ic.displayName=`ActionGroupRenderer`,t.ComponentRegistry.register(`action:group`,Ic,{namespace:`action`,label:`Action Group`,inputs:[{name:`name`,type:`string`,label:`Group Name`},{name:`label`,type:`string`,label:`Label`},{name:`icon`,type:`string`,label:`Icon`},{name:`actions`,type:`object`,label:`Actions`},{name:`display`,type:`enum`,label:`Display Mode`,enum:[`inline`,`dropdown`],defaultValue:`inline`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`default`,`secondary`,`outline`,`ghost`],defaultValue:`outline`},{name:`size`,type:`enum`,label:`Size`,enum:[`sm`,`md`,`lg`],defaultValue:`sm`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{display:`inline`,variant:`outline`,size:`sm`,actions:[]}});function Lc(){try{let{t:e}=(0,le.useObjectTranslation)(),t=e(`common.actions`);return!t||t===`common.actions`?`Actions`:t}catch{return`Actions`}}var Rc=(0,a.forwardRef)(({schema:e,className:n,...r},s)=>{let c=Lc(),{"data-obj-id":l,"data-obj-type":u,style:d,data:f,actions:p,systemActions:m,location:h,maxVisible:g,mobileMaxVisible:_,direction:v,gap:y,variant:b,size:x,visible:S,...C}=r,w=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),T=ni(),E=(0,a.useMemo)(()=>{let t=e.actions||[],n=e.location?t.filter(t=>!t.locations||t.locations.length===0||t.locations.includes(e.location)):t,r=new Set;return n.filter(e=>e.name?r.has(e.name)?!1:(r.add(e.name),!0):!0)},[e.actions,e.location]),D=(0,a.useMemo)(()=>{let t=e.systemActions||[],n=new Set;return t.filter(e=>e.name?n.has(e.name)?!1:(n.add(e.name),!0):!0)},[e.systemActions]),O=T?e.mobileMaxVisible??1:e.maxVisible??3,{inlineActions:k,overflowActions:A}=(0,a.useMemo)(()=>E.length<=O?{inlineActions:E,overflowActions:[]}:{inlineActions:E.slice(0,O),overflowActions:E.slice(O)},[E,O]),ee=(0,a.useMemo)(()=>{if(D.length===0)return A;if(A.length===0)return D;let[e,...t]=D,n={...e,tags:[...e.tags||[],`separator-before`]};return[...A,n,...t]},[A,D]);if(e.visible&&!w||E.length===0&&D.length===0)return null;let j=e.direction||`horizontal`,te=e.gap||`gap-2`,M=ee.length>0?t.ComponentRegistry.get(`action:menu`):null,N=M?(0,o.jsx)(M,{schema:{type:`action:menu`,actions:ee,variant:e.variant||`ghost`,size:e.size||`sm`}}):null;return(0,o.jsxs)(`div`,{ref:s,className:z(`flex items-center`,j===`vertical`?`flex-col items-stretch`:`flex-row flex-wrap`,te,e.className,n),role:`toolbar`,"aria-label":c,...C,"data-obj-id":l,"data-obj-type":u,style:d,children:[k.map(n=>{let r=n.component||`action:button`,i=t.ComponentRegistry.get(r);return i?(0,o.jsx)(i,{schema:{...n,type:r,actionType:n.type,variant:n.variant||e.variant,size:n.size||e.size},data:f},n.name):null}),ee.length>0&&N]})});Rc.displayName=`ActionBarRenderer`,t.ComponentRegistry.register(`action:bar`,Rc,{namespace:`action`,label:`Action Bar`,inputs:[{name:`actions`,type:`object`,label:`Actions`},{name:`systemActions`,type:`object`,label:`System Actions (always in overflow)`},{name:`location`,type:`enum`,label:`Location`,enum:[`list_toolbar`,`list_item`,`record_header`,`record_more`,`record_related`,`global_nav`]},{name:`maxVisible`,type:`number`,label:`Max Visible Actions`,defaultValue:3},{name:`direction`,type:`enum`,label:`Direction`,enum:[`horizontal`,`vertical`],defaultValue:`horizontal`},{name:`variant`,type:`enum`,label:`Default Variant`,enum:[`default`,`secondary`,`outline`,`ghost`],defaultValue:`outline`},{name:`size`,type:`enum`,label:`Default Size`,enum:[`sm`,`md`,`lg`],defaultValue:`sm`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{maxVisible:3,direction:`horizontal`,variant:`outline`,size:`sm`,actions:[]}});var zc=({schema:e,className:t})=>{let n=e.type,r=n.startsWith(`view:`),i=n.startsWith(`widget:`),a=n.startsWith(`field:`);return(0,o.jsxs)(`div`,{className:z(`flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg bg-muted/30 transition-colors hover:bg-muted/50`,r&&`border-blue-300 bg-blue-50/50 min-h-[200px]`,i&&`border-purple-300 bg-purple-50/50 min-h-[150px]`,a&&`border-yellow-300 bg-yellow-50/50 p-2 min-h-[40px] flex-row gap-2 justify-start`,t),children:[(0,o.jsxs)(`div`,{className:z(`flex items-center gap-2 text-muted-foreground`,a&&`text-sm`),children:[a?(0,o.jsx)(c.Box,{className:`h-4 w-4`}):(0,o.jsx)(c.FileQuestion,{className:`h-8 w-8 mb-2 opacity-50`}),(0,o.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,o.jsx)(`span`,{className:`font-mono font-medium text-foreground`,children:n}),!a&&(0,o.jsx)(`span`,{className:`text-xs`,children:`Component Placeholder`})]})]}),e.props&&!a&&(0,o.jsxs)(`div`,{className:`mt-4 w-full text-xs text-muted-foreground bg-background/50 p-2 rounded overflow-hidden`,children:[(0,o.jsx)(`div`,{className:`opacity-70`,children:`Properties:`}),(0,o.jsx)(`pre`,{className:`mt-1 truncate`,children:JSON.stringify(e.props,null,0)})]})]})},Bc=`view:grid.view:kanban.view:map.view:calendar.view:gantt.view:timeline.view:gallery.view:simple.view:wizard.view:tabbed.view:drawer.view:modal.view:split.field:text.field:textarea.field:password.field:email.field:url.field:phone.field:markdown.field:html.field:code.field:number.field:currency.field:percent.field:slider.field:boolean.field:checkboxes.field:select.field:multiselect.field:radio.field:date.field:datetime.field:time.field:duration.field:lookup.field:master_detail.field:tree.field:image.field:file.field:video.field:audio.field:avatar.field:color.field:rating.field:signature.field:qrcode.field:progress.field:json.field:address.field:location.page:header.page-header.page:footer.page:tabs.page:accordion.page:card.page:sidebar.record:details.record:highlights.record:related_list.record:activity.record:chatter.record:path.app:launcher.nav:menu.nav:breadcrumb.global:search.global:notifications.user:profile.widget:metric.widget:bar.widget:line.widget:pie.widget:funnel.widget:radar.widget:scatter.widget:heatmap.widget:pivot.widget:table.widget:text.widget:image.ai:input.ai:suggestion.ai:feedback`.split(`.`);function Vc(){Bc.forEach(e=>{t.ComponentRegistry.get(e)||t.ComponentRegistry.register(e,zc)})}function Hc(e,t){let n=t?.maxHistory??50,[r,i]=(0,a.useState)({...e}),[o,s]=(0,a.useState)(t?.mode===`create`),c=(0,a.useRef)([]),l=(0,a.useRef)([]),[,u]=(0,a.useState)(0);(0,a.useEffect)(()=>{i({...e}),s(t?.mode===`create`),c.current=[],l.current=[]},[e]);let d=(0,a.useCallback)((e,r)=>{i(t=>(c.current=[...c.current.slice(-(n-1)),t],l.current=[],{...t,[e]:r})),s(!0),u(e=>e+1),t?.onUpdate?.(e,r)},[t?.onUpdate,n]),f=(0,a.useCallback)(()=>{c.current.length!==0&&(i(e=>{let t=[...c.current],n=t.pop();return c.current=t,l.current=[e,...l.current],n}),u(e=>e+1))},[]),p=(0,a.useCallback)(()=>{l.current.length!==0&&(i(e=>{let t=[...l.current],n=t.shift();return l.current=t,c.current=[...c.current,e],n}),u(e=>e+1))},[]);return{draft:r,isDirty:o,updateField:d,discard:(0,a.useCallback)(()=>{i({...e}),s(!1),c.current=[],l.current=[],u(e=>e+1)},[e]),setDraft:i,undo:f,redo:p,canUndo:c.current.length>0,canRedo:l.current.length>0}}function Uc(e){let[t,n]=a.useState({width:0,height:0});return a.useEffect(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=t.getBoundingClientRect();n(e=>e.width===r.width&&e.height===r.height?e:{width:r.width,height:r.height});let i=new ResizeObserver(e=>{let t=e[0];if(!t)return;let r,i=t.borderBoxSize?.[0];r=i?{width:i.inlineSize,height:i.blockSize}:{width:t.contentRect.width,height:t.contentRect.height},n(e=>e.width===r.width&&e.height===r.height?e:r)});return i.observe(t),()=>i.disconnect()},[e]),t}var Wc=[`completed`,`failed`,`cancelled`,`expired`];function Gc(e){return!!e&&Wc.includes(e)}function Kc(e={}){let{dataSource:t,pollIntervalMs:n=1500,maxAttempts:r=600,onComplete:i,onError:o}=e,[s,c]=(0,a.useState)(null),[l,u]=(0,a.useState)(null),[d,f]=(0,a.useState)(!1),p=(0,a.useRef)(null),m=(0,a.useRef)(null),h=(0,a.useRef)(0),g=(0,a.useRef)(!1),_=(0,a.useRef)({onComplete:i,onError:o});_.current={onComplete:i,onError:o};let v=!!t?.createExportJob&&!!t?.getExportJobProgress,y=(0,a.useCallback)(()=>{m.current&&=(clearTimeout(m.current),null)},[]),b=(0,a.useCallback)(()=>{y(),p.current=null,g.current=!1,h.current=0,c(null),u(null),f(!1)},[y]);(0,a.useEffect)(()=>()=>y(),[y]);let x=(0,a.useCallback)(async()=>{if(t?.getExportJobProgress&&!(!p.current||g.current)){if(h.current+=1,h.current>r){let e=Error(`Export job timed out (max attempts exceeded)`);u(e),f(!1),_.current.onError?.(e,s??void 0);return}try{let e=await t.getExportJobProgress(p.current);if(g.current)return;if(c(e),Gc(e.status)){if(f(!1),e.status===`completed`)_.current.onComplete?.(e);else{let t=e.error?.message??`Export ${e.status}`,n=Error(t);u(n),_.current.onError?.(n,e)}return}m.current=setTimeout(x,n)}catch(e){if(g.current)return;let t=e instanceof Error?e:Error(String(e));u(t),f(!1),_.current.onError?.(t,s??void 0)}}},[t,r,n,s]),S=(0,a.useCallback)(async(e,r)=>{if(!t?.createExportJob){let e=Error(`DataSource does not implement createExportJob — cannot start async export.`);return u(e),_.current.onError?.(e),null}y(),g.current=!1,h.current=0,u(null),c(null),f(!0);try{let i=await t.createExportJob(e,r);if(p.current=i.jobId,c({jobId:i.jobId,status:i.status,processedRecords:0,totalRecords:i.estimatedRecords,percentComplete:0}),Gc(i.status)){if(f(!1),i.status===`completed`&&t.getExportJobProgress)try{let e=await t.getExportJobProgress(i.jobId);c(e),_.current.onComplete?.(e)}catch{}return i.jobId}return m.current=setTimeout(x,n),i.jobId}catch(e){let t=e instanceof Error?e:Error(String(e));return u(t),f(!1),_.current.onError?.(t),null}},[t,y,x,n]),C=(0,a.useCallback)(async()=>{if(p.current){if(g.current=!0,y(),f(!1),t?.cancelExportJob)try{await t.cancelExportJob(p.current)}catch{}c(e=>e&&{...e,status:`cancelled`})}},[t,y]),w=(0,a.useCallback)(async()=>{if(!p.current)return null;if(t?.getExportJobDownloadUrl)try{return await t.getExportJobDownloadUrl(p.current)}catch{}return s?.downloadUrl??null},[t,s]);return{isRunning:d,progress:s,error:l,isSupported:v,start:S,cancel:C,getDownloadUrl:w,download:(0,a.useCallback)(async e=>{let t=await w();if(!t)return!1;let n=document.createElement(`a`);return n.href=t,e&&(n.download=e),n.rel=`noopener`,document.body.appendChild(n),n.click(),n.remove(),!0},[w]),reset:b}}function qc({schema:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No schema available`})}function Jc({dataContext:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No data context available`})}function Yc(){let e=(0,a.useMemo)(()=>{try{return t.ComponentRegistry.getAllTypes()}catch{return[]}},[]);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No registered components`}):(0,o.jsxs)(`div`,{className:`space-y-1 max-h-[60vh] overflow-auto`,children:[e.map(e=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 rounded text-xs font-mono bg-muted/30`,children:[(0,o.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-green-500 shrink-0`}),e]},e)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` component`,e.length===1?``:`s`,` registered`]})]})}function Xc({flags:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No debug flags`})}function Zc(e){let n=t.DebugCollector.getInstance(),[r,i]=(0,a.useState)(()=>n.getEntries(e));return a.default.useEffect(()=>(i(n.getEntries(e)),n.subscribe(()=>{i(n.getEntries(e))})),[n,e]),r}function Qc(){let e=Zc(`perf`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No performance data collected yet`}):(0,o.jsxs)(`div`,{className:`space-y-1 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:z(`flex items-center justify-between px-2 py-1 rounded text-xs font-mono`,e.durationMs>16?`bg-red-50 text-red-700`:`bg-muted/30`),children:[(0,o.jsxs)(`span`,{className:`truncate mr-2`,children:[e.type,e.id?`:${e.id}`:``]}),(0,o.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[e.durationMs.toFixed(2),`ms`]})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` render`,e.length===1?``:`s`,` tracked`]})]})}function $c(){let e=Zc(`expr`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No expression evaluations tracked yet`}):(0,o.jsxs)(`div`,{className:`space-y-1.5 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:`px-2 py-1.5 rounded bg-muted/30 text-xs font-mono`,children:[(0,o.jsx)(`div`,{className:`text-muted-foreground truncate`,children:e.expression}),(0,o.jsxs)(`div`,{className:`mt-0.5`,children:[`→ `,JSON.stringify(e.result)]})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` evaluation`,e.length===1?``:`s`,` tracked`]})]})}function el(){let e=Zc(`event`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No events captured yet`}):(0,o.jsxs)(`div`,{className:`space-y-1.5 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:`px-2 py-1.5 rounded bg-muted/30 text-xs font-mono`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsx)(`span`,{className:`font-semibold`,children:e.action}),(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString()})]}),e.payload!==void 0&&(0,o.jsx)(`pre`,{className:`mt-0.5 text-[10px] text-muted-foreground truncate`,children:JSON.stringify(e.payload)})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` event`,e.length===1?``:`s`,` captured`]})]})}function tl({open:e,onClose:t,flags:n,schema:r,dataContext:i,extraTabs:s=[],className:c}){let l=(0,a.useMemo)(()=>[{id:`schema`,label:`Schema`,render:()=>(0,o.jsx)(qc,{schema:r})},{id:`data`,label:`Data`,render:()=>(0,o.jsx)(Jc,{dataContext:i})},{id:`perf`,label:`Perf`,render:()=>(0,o.jsx)(Qc,{})},{id:`expr`,label:`Expr`,render:()=>(0,o.jsx)($c,{})},{id:`events`,label:`Events`,render:()=>(0,o.jsx)(el,{})},{id:`registry`,label:`Registry`,render:()=>(0,o.jsx)(Yc,{})},{id:`flags`,label:`Flags`,render:()=>(0,o.jsx)(Xc,{flags:n})}],[r,i,n]),u=(0,a.useMemo)(()=>[...l,...s],[l,s]),[d,f]=(0,a.useState)(u[0]?.id??`schema`),p=u.find(e=>e.id===d)??u[0],m=(0,a.useCallback)(e=>{f(e)},[]);return e?(0,o.jsxs)(`div`,{className:z(`fixed bottom-4 right-4 z-[9999] w-[420px] max-w-[95vw] rounded-lg border bg-background shadow-2xl`,`flex flex-col overflow-hidden`,c),"data-testid":`debug-panel`,role:`dialog`,"aria-label":`Developer Debug Panel`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b bg-muted/30`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`🛠 Debug Panel`}),(0,o.jsx)(`button`,{onClick:t,className:`text-muted-foreground hover:text-foreground text-sm leading-none px-1`,"aria-label":`Close debug panel`,"data-testid":`debug-panel-close`,children:`✕`})]}),(0,o.jsx)(`div`,{className:`flex border-b overflow-x-auto`,role:`tablist`,children:u.map(e=>(0,o.jsxs)(`button`,{role:`tab`,"aria-selected":e.id===p?.id,onClick:()=>m(e.id),className:z(`px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors`,e.id===p?.id?`border-b-2 border-primary text-foreground`:`text-muted-foreground hover:text-foreground`),"data-testid":`debug-tab-${e.id}`,children:[e.icon&&(0,o.jsx)(`span`,{className:`mr-1`,children:e.icon}),e.label]},e.id))}),(0,o.jsx)(`div`,{className:`p-3 overflow-auto max-h-[50vh]`,"data-testid":`debug-panel-content`,children:p?.render()})]}):null}var nl={permission:`view`,audience:`link_only`,expiresInDays:7,password:``,label:``},rl=[{label:`1 day`,value:1},{label:`7 days`,value:7},{label:`30 days`,value:30},{label:`90 days`,value:90},{label:`Never`,value:null}],il=[{value:`link_only`,label:`Anyone with the link`,help:`No sign-in required`},{value:`signed_in`,label:`Signed-in users`,help:`Must be logged in to view`},{value:`workspace`,label:`Workspace members`,help:`Same tenant only`},{value:`email_allowlist`,label:`Specific emails`,help:`Restricted to listed addresses`}];function al(e,t){return`${(e??(typeof window<`u`?`${window.location.origin}/s`:`/s`)).replace(/\/+$/,``)}/${t}`}async function ol(e){try{if(typeof navigator<`u`&&navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document<`u`){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();try{return document.execCommand(`copy`),document.body.removeChild(t),!0}catch{document.body.removeChild(t)}}return!1}function sl({open:e,onOpenChange:t,objectName:n,recordId:r,recordLabel:i,apiBase:s,publicBaseUrl:l,fetchHeaders:u}){let[d,f]=(0,a.useState)([]),[p,m]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),[_,v]=(0,a.useState)(null),[y,b]=(0,a.useState)(nl),[x,S]=(0,a.useState)(null),C=(0,a.useCallback)(async()=>{let e={"Content-Type":`application/json`};if(!u)return e;let t=await u();return{...e,...t}},[u]),w=(0,a.useMemo)(()=>`${s.replace(/\/+$/,``)}/v1/share-links?object=${encodeURIComponent(n)}&recordId=${encodeURIComponent(r)}`,[s,n,r]),T=(0,a.useCallback)(async()=>{m(!0),v(null);try{let e=await C(),t=await fetch(w,{headers:e,credentials:`include`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();f(n.links??n.data??[])}catch(e){v(e?.message??`Failed to load share links`)}finally{m(!1)}},[w,C]);(0,a.useEffect)(()=>{e&&(T(),b(nl))},[e,T]);let E=(0,a.useCallback)(async()=>{g(!0),v(null);try{let e=y.expiresInDays==null?void 0:new Date(Date.now()+y.expiresInDays*24*60*60*1e3).toISOString(),t=await C(),i=await fetch(`${s.replace(/\/+$/,``)}/v1/share-links`,{method:`POST`,headers:t,credentials:`include`,body:JSON.stringify({object:n,recordId:r,permission:y.permission,audience:y.audience,expiresAt:e,password:y.password.trim()||void 0,label:y.label.trim()||void 0})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.error?.message||`HTTP ${i.status}`)}let a=await i.json(),o=a.link??a.data;if(!o)throw Error(`Share link create response missing link payload`);f(e=>[o,...e]),await ol(al(l,o.token))&&(S(o.id),setTimeout(()=>S(null),1500)),b(nl)}catch(e){v(e?.message??`Failed to create share link`)}finally{g(!1)}},[s,C,n,r,y,l]),D=(0,a.useCallback)(async e=>{try{let t=await C(),n=await fetch(`${s.replace(/\/+$/,``)}/v1/share-links/${encodeURIComponent(e.id)}`,{method:`DELETE`,headers:t,credentials:`include`});if(!n.ok&&n.status!==204)throw Error(`HTTP ${n.status}`);f(t=>t.map(t=>t.id===e.id?{...t,revoked_at:new Date().toISOString()}:t))}catch(e){v(e?.message??`Failed to revoke link`)}},[s,C]),O=(0,a.useCallback)(async e=>{await ol(al(l,e.token))&&(S(e.id),setTimeout(()=>S(null),1500))},[l]),k=d.filter(e=>!e.revoked_at),A=d.filter(e=>e.revoked_at);return(0,o.jsx)(wt,{open:e,onOpenChange:t,children:(0,o.jsxs)(kt,{className:`max-w-xl`,"data-testid":`share-dialog`,children:[(0,o.jsxs)(At,{children:[(0,o.jsxs)(Mt,{className:`flex items-center gap-2`,children:[(0,o.jsx)(c.Link2,{className:`h-4 w-4`}),`Share `,i??`this record`]}),(0,o.jsx)(Nt,{children:`Generate a link anyone (or selected people) can use to open this record. Links can be revoked at any time.`})]}),_&&(0,o.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,"data-testid":`share-dialog-error`,children:_}),(0,o.jsxs)(`section`,{className:`space-y-3 rounded-lg border bg-muted/30 p-3`,children:[(0,o.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(G,{className:`text-xs`,children:`Who can access`}),(0,o.jsxs)(Lr,{value:y.audience,onValueChange:e=>b(t=>({...t,audience:e})),children:[(0,o.jsx)(J,{className:`h-8 text-xs`,"data-testid":`share-audience`,children:(0,o.jsx)(q,{})}),(0,o.jsx)(Y,{children:il.map(e=>(0,o.jsx)(X,{value:e.value,className:`text-xs`,children:(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[(0,o.jsx)(`span`,{children:e.label}),(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.help})]})},e.value))})]})]}),(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(G,{className:`text-xs`,children:`Expires in`}),(0,o.jsxs)(Lr,{value:y.expiresInDays==null?`never`:String(y.expiresInDays),onValueChange:e=>b(t=>({...t,expiresInDays:e===`never`?null:Number(e)})),children:[(0,o.jsx)(J,{className:`h-8 text-xs`,"data-testid":`share-expiry`,children:(0,o.jsx)(q,{})}),(0,o.jsx)(Y,{children:rl.map(e=>(0,o.jsx)(X,{value:e.value==null?`never`:String(e.value),className:`text-xs`,children:e.label},String(e.value)))})]})]}),(0,o.jsxs)(`div`,{className:`space-y-1 sm:col-span-2`,children:[(0,o.jsx)(G,{className:`text-xs`,children:`Password (optional)`}),(0,o.jsx)(K,{type:`password`,value:y.password,onChange:e=>b(t=>({...t,password:e.target.value})),placeholder:`Require a password to open`,className:`h-8 text-xs`,"data-testid":`share-password`})]}),(0,o.jsxs)(`div`,{className:`space-y-1 sm:col-span-2`,children:[(0,o.jsx)(G,{className:`text-xs`,children:`Label (only you see this)`}),(0,o.jsx)(K,{value:y.label,onChange:e=>b(t=>({...t,label:e.target.value})),placeholder:`e.g. Sent to design review`,className:`h-8 text-xs`,"data-testid":`share-label`})]})]}),(0,o.jsx)(`div`,{className:`flex justify-end`,children:(0,o.jsxs)(U,{size:`sm`,onClick:E,disabled:h,"data-testid":`share-create`,children:[h?(0,o.jsx)(c.Loader2,{className:`mr-1 h-3 w-3 animate-spin`}):(0,o.jsx)(c.Link2,{className:`mr-1 h-3 w-3`}),`Create link`]})})]}),(0,o.jsxs)(`section`,{className:`space-y-2`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsxs)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:[`Existing links`,k.length?` (${k.length})`:``]}),p&&(0,o.jsx)(c.Loader2,{className:`h-3 w-3 animate-spin text-muted-foreground`})]}),!p&&k.length===0&&A.length===0&&(0,o.jsx)(`p`,{className:`rounded-md border border-dashed px-3 py-4 text-center text-xs text-muted-foreground`,children:`No share links yet. Create one above.`}),(0,o.jsxs)(`ul`,{className:`space-y-2`,children:[k.map(e=>(0,o.jsx)(cl,{link:e,copied:x===e.id,onCopy:()=>O(e),onRevoke:()=>D(e),publicBaseUrl:l},e.id)),A.length>0&&(0,o.jsx)(`li`,{className:`pt-2 text-[10px] uppercase tracking-wide text-muted-foreground`,children:`Revoked`}),A.map(e=>(0,o.jsx)(cl,{link:e,copied:!1,onCopy:()=>O(e),onRevoke:()=>D(e),publicBaseUrl:l,disabled:!0},e.id))]})]}),(0,o.jsx)(jt,{children:(0,o.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>t(!1),children:`Done`})})]})})}function cl({link:e,copied:t,onCopy:n,onRevoke:r,publicBaseUrl:i,disabled:a}){let s=al(i,e.token);return(0,o.jsxs)(`li`,{className:z(`flex items-center gap-2 rounded-md border bg-card px-2 py-2 text-xs`,a&&`opacity-60`),"data-testid":`share-link-row`,children:[(0,o.jsx)(Ve,{variant:`secondary`,className:`text-[10px] capitalize`,children:e.audience.replace(`_`,` `)}),(0,o.jsx)(Ve,{variant:`outline`,className:`text-[10px] capitalize`,children:e.permission}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`truncate font-mono text-[11px]`,title:s,children:s}),e.label&&(0,o.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.label})]}),!a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(U,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:n,"data-testid":`share-link-copy`,children:[(0,o.jsx)(c.Copy,{className:`mr-1 h-3 w-3`}),t?`Copied!`:`Copy`]}),(0,o.jsx)(U,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive`,onClick:r,"data-testid":`share-link-revoke`,title:`Revoke`,children:(0,o.jsx)(c.Trash2,{className:`h-3 w-3`})})]}),a&&(0,o.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,o.jsx)(c.ShieldOff,{className:`h-3 w-3`}),`revoked`]})]})}function ll(){return!0}e.Accordion=V,e.AccordionContent=xe,e.AccordionItem=ye,e.AccordionTrigger=be,e.ActionParamDialog=ss,e.Alert=Ne,e.AlertDescription=Fe,e.AlertDialog=Se,e.AlertDialogAction=Ae,e.AlertDialogCancel=je,e.AlertDialogContent=Ee,e.AlertDialogDescription=ke,e.AlertDialogFooter=W,e.AlertDialogHeader=De,e.AlertDialogOverlay=Te,e.AlertDialogPortal=we,e.AlertDialogTitle=Oe,e.AlertDialogTrigger=Ce,e.AlertTitle=Pe,e.AspectRatio=Ie,e.Avatar=Le,e.AvatarFallback=ze,e.AvatarImage=Re,e.Badge=Ve,e.Breadcrumb=He,e.BreadcrumbEllipsis=Je,e.BreadcrumbItem=We,e.BreadcrumbLink=Ge,e.BreadcrumbList=Ue,e.BreadcrumbPage=Ke,e.BreadcrumbSeparator=qe,e.Button=U,e.ButtonGroup=Qa,e.ButtonGroupSeparator=eo,e.ButtonGroupText=$a,e.Calendar=Ye,e.CalendarDayButton=Xe,e.Card=Ze,e.CardContent=tt,e.CardDescription=et,e.CardFooter=nt,e.CardHeader=Qe,e.CardTitle=$e,e.Carousel=at,e.CarouselContent=ot,e.CarouselItem=st,e.CarouselNext=lt,e.CarouselPrevious=ct,e.ChartContainer=pt,e.ChartLegend=_t,e.ChartLegendContent=vt,e.ChartSkeleton=fs,e.ChartStyle=mt,e.ChartTooltip=ht,e.ChartTooltipContent=gt,e.Checkbox=bt,e.Collapsible=xt,e.CollapsibleContent=Ct,e.CollapsibleTrigger=St,e.Combobox=to,e.Command=Pt,e.CommandDialog=Ft,e.CommandEmpty=Rt,e.CommandGroup=zt,e.CommandInput=It,e.CommandItem=Vt,e.CommandList=Lt,e.CommandSeparator=Bt,e.CommandShortcut=Ht,e.ConfigFieldRenderer=xo,e.ConfigPanelRenderer=Co,e.ConfigRow=no,e.ContextMenu=Ut,e.ContextMenuCheckboxItem=$t,e.ContextMenuContent=Zt,e.ContextMenuGroup=Gt,e.ContextMenuItem=Qt,e.ContextMenuLabel=tn,e.ContextMenuPortal=Kt,e.ContextMenuRadioGroup=Jt,e.ContextMenuRadioItem=en,e.ContextMenuSeparator=nn,e.ContextMenuShortcut=rn,e.ContextMenuSub=qt,e.ContextMenuSubContent=Xt,e.ContextMenuSubTrigger=Yt,e.ContextMenuTrigger=Wt,e.DataEmptyState=Cs,e.EmptyState=Cs,e.DataErrorState=ws,e.DataLoadingState=Ss,e.DatePicker=wo,e.DebugPanel=tl,e.Dialog=wt,e.DialogClose=Dt,e.DialogContent=kt,e.DialogDescription=Nt,e.DialogFooter=jt,e.DialogHeader=At,e.DialogOverlay=Ot,e.DialogPortal=Et,e.DialogTitle=Mt,e.DialogTrigger=Tt,e.Drawer=an,e.DrawerClose=cn,e.DrawerContent=un,e.DrawerDescription=mn,e.DrawerFooter=fn,e.DrawerHeader=dn,e.DrawerOverlay=ln,e.DrawerPortal=sn,e.DrawerTitle=pn,e.DrawerTrigger=on,e.DropdownMenu=hn,e.DropdownMenuCheckboxItem=Tn,e.DropdownMenuContent=Cn,e.DropdownMenuGroup=_n,e.DropdownMenuItem=wn,e.DropdownMenuLabel=Dn,e.DropdownMenuPortal=vn,e.DropdownMenuRadioGroup=bn,e.DropdownMenuRadioItem=En,e.DropdownMenuSeparator=On,e.DropdownMenuShortcut=kn,e.DropdownMenuSub=yn,e.DropdownMenuSubContent=Sn,e.DropdownMenuSubTrigger=xn,e.DropdownMenuTrigger=gn,e.Empty=Eo,e.EmptyContent=Mo,e.EmptyDescription=jo,e.EmptyHeader=Do,e.EmptyMedia=ko,e.EmptyTitle=Ao,e.EmptyValue=No,e.ExportProgressDialog=Ds,e.Field=Fo,e.FilterBuilder=vo,e.Form=jn,e.FormControl=Rn,e.FormDescription=zn,e.FormField=Nn,e.FormItem=In,e.FormLabel=Ln,e.FormMessage=Bn,e.FormSkeleton=us,e.GridSkeleton=cs,e.GroupingEditor=os,e.HoverCard=Vn,e.HoverCardContent=Un,e.HoverCardTrigger=Hn,e.Input=K,e.InputGroup=Io,e.InputOTP=Wn,e.InputOTPGroup=Gn,e.InputOTPSeparator=qn,e.InputOTPSlot=Kn,e.Item=Bo,e.ItemActions=Ko,e.ItemContent=Uo,e.ItemDescription=Go,e.ItemFooter=Jo,e.ItemGroup=Lo,e.ItemHeader=qo,e.ItemMedia=Ho,e.ItemSeparator=Ro,e.ItemTitle=Wo,e.KanbanSkeleton=ls,e.Kbd=Yo,e.KbdGroup=Xo,e.Label=G,e.LazyIcon=Da,e.ListSkeleton=ds,e.LookupValuePicker=yo,e.Menubar=$n,e.MenubarCheckboxItem=ar,e.MenubarContent=rr,e.MenubarGroup=Yn,e.MenubarItem=ir,e.MenubarLabel=sr,e.MenubarMenu=Jn,e.MenubarPortal=Xn,e.MenubarRadioGroup=Zn,e.MenubarRadioItem=or,e.MenubarSeparator=cr,e.MenubarShortcut=lr,e.MenubarSub=Qn,e.MenubarSubContent=nr,e.MenubarSubTrigger=tr,e.MenubarTrigger=er,e.MobileDialogContent=Ts,e.NativeSelect=Zo,e.NavigationMenu=ur,e.NavigationMenuContent=hr,e.NavigationMenuIndicator=vr,e.NavigationMenuItem=fr,e.NavigationMenuLink=gr,e.NavigationMenuList=dr,e.NavigationMenuTrigger=mr,e.NavigationMenuViewport=_r,e.NavigationOverlay=rs,e.Pagination=yr,e.PaginationContent=br,e.PaginationEllipsis=Tr,e.PaginationItem=xr,e.PaginationLink=Sr,e.PaginationNext=wr,e.PaginationPrevious=Cr,e.Popover=Er,e.PopoverContent=Or,e.PopoverTrigger=Dr,e.Progress=kr,e.RadioGroup=Ar,e.RadioGroupItem=jr,e.RecordTitleChip=vs,e.RefreshIndicator=xs,e.RelatedCountStore=uc,e.ResizableHandle=Pr,e.ResizablePanel=Nr,e.ResizablePanelGroup=Mr,e.ScrollArea=Fr,e.ScrollBar=Ir,e.SectionHeader=So,e.Select=Lr,e.SelectContent=Y,e.SelectGroup=Rr,e.SelectItem=X,e.SelectLabel=Vr,e.SelectScrollDownButton=Br,e.SelectScrollUpButton=zr,e.SelectSeparator=Hr,e.SelectTrigger=J,e.SelectValue=q,e.Separator=Ur,e.ShareDialog=sl,e.Sheet=Wr,e.SheetClose=Kr,e.SheetContent=Xr,e.SheetDescription=ei,e.SheetFooter=Qr,e.SheetHeader=Zr,e.SheetOverlay=Jr,e.SheetPortal=qr,e.SheetTitle=$r,e.SheetTrigger=Gr,e.ShimmerSkeleton=ms,e.Sidebar=gi,e.SidebarContent=wi,e.SidebarFooter=Si,e.SidebarGroup=Ti,e.SidebarGroupAction=Di,e.SidebarGroupContent=Oi,e.SidebarGroupLabel=Ei,e.SidebarHeader=xi,e.SidebarInput=bi,e.SidebarInset=yi,e.SidebarMenu=ki,e.SidebarMenuAction=Ni,e.SidebarMenuBadge=Pi,e.SidebarMenuButton=Mi,e.SidebarMenuItem=Ai,e.SidebarMenuSkeleton=Fi,e.SidebarMenuSub=Ii,e.SidebarMenuSubButton=Ri,e.SidebarMenuSubItem=Li,e.SidebarProvider=hi,e.SidebarRail=vi,e.SidebarSeparator=Ci,e.SidebarTrigger=_i,e.Skeleton=Z,e.Slider=zi,e.SortBuilder=bo,e.Spinner=is,e.Switch=Vi,e.Table=Hi,e.TableBody=Wi,e.TableCaption=Yi,e.TableCell=Ji,e.TableFooter=Gi,e.TableHead=qi,e.TableHeader=Ui,e.TableRow=Ki,e.Tabs=Xi,e.TabsContent=$i,e.TabsList=Zi,e.TabsTrigger=Qi,e.Textarea=ea,e.Toaster=Bi,e.Toggle=na,e.ToggleGroup=ia,e.ToggleGroupItem=aa,e.Tooltip=ii,e.TooltipContent=oi,e.TooltipProvider=ri,e.TooltipTrigger=ai,e.TypographyBlockquote=da,e.TypographyH1=oa,e.TypographyH2=sa,e.TypographyH3=ca,e.TypographyH4=la,e.TypographyInlineCode=pa,e.TypographyLarge=ha,e.TypographyLead=ma,e.TypographyList=fa,e.TypographyMuted=_a,e.TypographyP=ua,e.TypographySmall=ga,e.ViewSkeleton=ps,e.badgeVariants=Be,e.buttonGroupVariants=Za,e.buttonVariants=H,e.cn=z,Object.defineProperty(e,"cva",{enumerable:!0,get:function(){return d.cva}}),e.getLazyIcon=Ea,e.initializeComponents=ll,e.navigationMenuTriggerStyle=pr,e.registerPlaceholders=Vc,e.renderChildren=B,e.toKebabIconName=Sa,e.toggleVariants=ta,e.useConfigDraft=Hc,e.useExportJob=Kc,e.useFormField=Pn,e.useIsMobile=ni,e.useRelatedCount=lc,e.useResizeObserver=Uc,e.useSidebar=mi});
|
|
18
|
+
`,document.head.appendChild(t),Bs=!0}var Hs=({active:e,ariaLabel:t=`Refreshing`,className:n,...r})=>(a.useEffect(()=>{e&&Vs()},[e]),e?(0,o.jsx)(`div`,{className:z(`pointer-events-none absolute inset-x-0 top-0 z-20 h-0.5 overflow-hidden`,n),role:`progressbar`,"aria-busy":`true`,"aria-label":t,"data-testid":`refresh-indicator`,...r,children:(0,o.jsx)(`div`,{className:`h-full w-1/4 rounded-full bg-primary/70`,style:{animation:`objui-refresh-bar 1.1s ease-in-out infinite`}})}):null);Hs.displayName=`RefreshIndicator`;function Us({className:e,message:t=`Loading…`,...n}){return(0,o.jsxs)(`div`,{role:`status`,"aria-label":t,"data-slot":`data-loading-state`,className:z(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...n,children:[(0,o.jsx)(c.Loader2,{className:`size-6 animate-spin text-muted-foreground`}),t&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]})}function Ws({className:e,icon:t,illustration:n,showIcon:r=!0,iconWrapperClassName:i,title:a=`No data`,description:s,action:l,children:u,...d}){let f=r&&(t!=null||!n);return(0,o.jsxs)(`div`,{"data-slot":`data-empty-state`,className:z(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...d,children:[n&&(0,o.jsx)(`div`,{"data-slot":`data-empty-state-illustration`,className:`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:duration-300 [&_svg]:max-h-40 [&_svg]:w-auto`,"aria-hidden":!0,children:n}),f&&(0,o.jsx)(`div`,{"data-slot":`data-empty-state-icon`,className:z(i??`flex size-10 items-center justify-center rounded-lg bg-muted`),children:t??(0,o.jsx)(c.InboxIcon,{className:`size-5 text-muted-foreground`})}),a&&(0,o.jsx)(`h3`,{className:`text-sm font-medium`,children:a}),s&&(0,o.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:s}),l,u]})}function Gs({className:e,title:t=`Something went wrong`,message:n,onRetry:r,retryLabel:i=`Retry`,children:a,...s}){return(0,o.jsxs)(`div`,{role:`alert`,"data-slot":`data-error-state`,className:z(`flex flex-col items-center justify-center gap-3 p-6 text-center`,e),...s,children:[(0,o.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-lg bg-destructive/10`,children:(0,o.jsx)(c.AlertCircle,{className:`size-5 text-destructive`})}),t&&(0,o.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),n&&(0,o.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:n}),r&&(0,o.jsx)(V,{variant:`outline`,size:`sm`,onClick:r,children:i}),a]})}var Ks=a.forwardRef(({className:e,children:t,...n},r)=>(0,o.jsxs)(Dt,{children:[(0,o.jsx)(kt,{}),(0,o.jsxs)(b.Content,{ref:r,className:z(`fixed inset-0 z-50 w-full bg-background p-4 shadow-lg duration-200`,`h-[100dvh]`,`sm:inset-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%]`,`sm:max-w-lg sm:h-auto sm:max-h-[90vh] sm:rounded-lg sm:border sm:p-6`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]`,`data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...n,children:[t,(0,o.jsxs)(b.Close,{className:z(`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity`,`hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,`disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,`min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 flex items-center justify-center`),children:[(0,o.jsx)(c.X,{className:`h-5 w-5 sm:h-4 sm:w-4`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Ks.displayName=`MobileDialogContent`;function qs(e){return!e&&e!==0?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function Js({open:e,onOpenChange:t,job:n,title:r,description:i,filename:s,allowCloseWhileRunning:l=!0,className:u,onAfterDownload:d,closeAfterDownloadMs:f}){let{progress:p,error:m,isRunning:h,cancel:g,download:_,reset:v}=n,y=p?.status,b=typeof p?.percentComplete==`number`?Math.max(0,Math.min(100,p.percentComplete)):void 0,x=y===`completed`,S=y===`failed`||y===`expired`,C=y===`cancelled`,w=a.useCallback(async()=>{await _(s)&&(d?.(),f&&f>0&&setTimeout(()=>t(!1),f))},[_,s,d,f,t]),T=a.useCallback(e=>{!e&&h&&!l||(t(e),!e&&!h&&setTimeout(v,0))},[h,l,t,v]),E=r??(x?`Export ready`:S?`Export failed`:C?`Export cancelled`:`Exporting…`),D=i??(x?`Your export is ready to download.`:S?`The export job did not complete.`:C?`The export was cancelled.`:`Your export is being prepared on the server. You can close this window — the job will continue in the background.`);return(0,o.jsx)(Tt,{open:e,onOpenChange:T,children:(0,o.jsxs)(At,{"data-testid":`export-progress-dialog`,className:z(`sm:max-w-md`,u),children:[(0,o.jsxs)(jt,{children:[(0,o.jsxs)(Nt,{className:`flex items-center gap-2`,children:[x?(0,o.jsx)(c.CheckCircle2,{className:`h-5 w-5 text-green-600`,"aria-hidden":`true`}):S?(0,o.jsx)(c.AlertCircle,{className:`h-5 w-5 text-destructive`,"aria-hidden":`true`}):(0,o.jsx)(c.Loader2,{className:z(`h-5 w-5 text-muted-foreground`,h&&`animate-spin`),"aria-hidden":`true`}),E]}),(0,o.jsx)(Pt,{children:D})]}),(0,o.jsxs)(`div`,{className:`py-2 space-y-3`,children:[(h||x)&&(0,o.jsx)(`div`,{"data-testid":`export-progress-bar`,children:b===void 0?(0,o.jsx)(Ar,{value:void 0,"aria-label":`Export progress (indeterminate)`}):(0,o.jsx)(Ar,{value:b,"aria-label":`Export progress`})}),(0,o.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,o.jsx)(`span`,{"data-testid":`export-progress-counts`,children:p?.processedRecords==null?h?`Starting…`:``:`${p.processedRecords.toLocaleString()}${p.totalRecords==null?``:` / ${p.totalRecords.toLocaleString()}`} records`}),(0,o.jsx)(`span`,{"data-testid":`export-progress-percent`,children:b===void 0?``:`${b.toFixed(0)}%`})]}),p?.fileSize?(0,o.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:qs(p.fileSize)}):null,(m||p?.error)&&(0,o.jsx)(`div`,{"data-testid":`export-progress-error`,className:`text-xs text-destructive bg-destructive/10 border border-destructive/30 rounded-md px-2 py-1`,children:m?.message||p?.error?.message})]}),(0,o.jsxs)(Mt,{className:`gap-2 sm:gap-2`,children:[h&&(0,o.jsxs)(V,{type:`button`,variant:`ghost`,onClick:()=>g(),"data-testid":`export-progress-cancel`,children:[(0,o.jsx)(c.X,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,o.jsx)(`span`,{className:`ml-1`,children:`Cancel`})]}),x&&(0,o.jsxs)(V,{type:`button`,variant:`default`,onClick:w,"data-testid":`export-progress-download`,children:[(0,o.jsx)(c.Download,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,o.jsx)(`span`,{className:`ml-1`,children:`Download`})]}),!h&&(0,o.jsx)(V,{type:`button`,variant:`outline`,onClick:()=>T(!1),"data-testid":`export-progress-close`,children:`Close`})]})]})})}t.ComponentRegistry.register(`combobox`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(xo,{options:e.options||[],placeholder:e.placeholder,value:e.value,disabled:e.disabled,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i})},{namespace:`ui`,label:`Combobox`,inputs:[{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`value`,type:`string`,label:`Value`},{name:`disabled`,type:`boolean`,label:`Disabled`,defaultValue:!1},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{placeholder:`Select option...`,options:[]}}),t.ComponentRegistry.register(`command`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsxs)(Ft,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:[(0,o.jsx)(Lt,{placeholder:e.placeholder||`Type a command or search...`}),(0,o.jsxs)(Rt,{children:[(0,o.jsx)(zt,{children:e.emptyText||`No results found.`}),e.groups?.map((e,t)=>(0,o.jsx)(Bt,{heading:e.heading,children:e.items?.map((e,t)=>(0,o.jsx)(Ht,{value:e.value,children:e.label},t))},t))]})]})},{namespace:`ui`,label:`Command`,inputs:[{name:`placeholder`,type:`string`,label:`Placeholder`},{name:`emptyText`,type:`string`,label:`Empty Text`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{placeholder:`Type a command or search...`,emptyText:`No results found.`,groups:[]}});var Ys=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":i,"data-obj-type":a,style:s,...c}=n,l=e.clickable||!!n.onClick;return(0,o.jsxs)(Qe,{ref:r,className:z(t,(e.hoverable||l)&&`transition-colors hover:bg-muted/50`,l&&`cursor-pointer active:bg-muted`),...c,"data-obj-id":i,"data-obj-type":a,style:s,children:[(e.title||e.description||e.header)&&(0,o.jsxs)($e,{children:[e.title&&(0,o.jsx)(et,{children:e.title}),e.description&&(0,o.jsx)(tt,{children:e.description}),e.header&&B(e.header)]}),(e.children||e.body)&&(0,o.jsx)(nt,{children:B(e.children||e.body)}),e.footer&&(0,o.jsx)(rt,{className:`flex justify-between`,children:B(e.footer)})]})});t.ComponentRegistry.register(`card`,Ys,{namespace:`ui`,label:`Card`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`Card Title`,description:`Card description goes here`,className:`w-full`},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}}),t.ComponentRegistry.register(`tabs`,({schema:e,className:t,onChange:n,value:r,...i})=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=i,u=e=>{n&&n(e)},d=e.orientation===`vertical`;return(0,o.jsxs)(Qi,{defaultValue:r===void 0?e.defaultValue:void 0,value:r??e.value,onValueChange:u,orientation:e.orientation||`horizontal`,className:z(t,d&&`flex gap-2`),...l,"data-obj-id":a,"data-obj-type":s,style:c,children:[(0,o.jsx)($i,{className:z(d&&`flex-col h-auto items-stretch bg-muted/50 p-1`),children:e.items?.map(e=>(0,o.jsx)(ea,{value:e.value,disabled:e.disabled,className:z(d&&`justify-start`),children:e.label},e.value))}),e.items?.map(e=>(0,o.jsx)(ta,{value:e.value,className:z(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,d&&`mt-0 flex-1`),children:B(e.content||e.body)},e.value))]})},{namespace:`ui`,label:`Tabs`,inputs:[{name:`defaultValue`,type:`string`,label:`Default Value`,required:!0},{name:`className`,type:`string`,label:`CSS Class`},{name:`items`,type:`array`,label:`Items`}],defaultProps:{defaultValue:`tab1`,items:[{label:`Tab 1`,value:`tab1`,body:[{type:`text`,content:`Content for Tab 1`}]},{label:`Tab 2`,value:`tab2`,body:[{type:`text`,content:`Content for Tab 2`}]},{label:`Tab 3`,value:`tab3`,body:[{type:`text`,content:`Content for Tab 3`}]}],className:`w-full`}});var Xs={1:`grid-cols-1`,2:`grid-cols-2`,3:`grid-cols-3`,4:`grid-cols-4`,5:`grid-cols-5`,6:`grid-cols-6`,7:`grid-cols-7`,8:`grid-cols-8`,9:`grid-cols-9`,10:`grid-cols-10`,11:`grid-cols-11`,12:`grid-cols-12`},Zs={1:`sm:grid-cols-1`,2:`sm:grid-cols-2`,3:`sm:grid-cols-3`,4:`sm:grid-cols-4`,5:`sm:grid-cols-5`,6:`sm:grid-cols-6`,7:`sm:grid-cols-7`,8:`sm:grid-cols-8`,9:`sm:grid-cols-9`,10:`sm:grid-cols-10`,11:`sm:grid-cols-11`,12:`sm:grid-cols-12`},Qs={1:`md:grid-cols-1`,2:`md:grid-cols-2`,3:`md:grid-cols-3`,4:`md:grid-cols-4`,5:`md:grid-cols-5`,6:`md:grid-cols-6`,7:`md:grid-cols-7`,8:`md:grid-cols-8`,9:`md:grid-cols-9`,10:`md:grid-cols-10`,11:`md:grid-cols-11`,12:`md:grid-cols-12`},$s={1:`lg:grid-cols-1`,2:`lg:grid-cols-2`,3:`lg:grid-cols-3`,4:`lg:grid-cols-4`,5:`lg:grid-cols-5`,6:`lg:grid-cols-6`,7:`lg:grid-cols-7`,8:`lg:grid-cols-8`,9:`lg:grid-cols-9`,10:`lg:grid-cols-10`,11:`lg:grid-cols-11`,12:`lg:grid-cols-12`},ec={1:`xl:grid-cols-1`,2:`xl:grid-cols-2`,3:`xl:grid-cols-3`,4:`xl:grid-cols-4`,5:`xl:grid-cols-5`,6:`xl:grid-cols-6`,7:`xl:grid-cols-7`,8:`xl:grid-cols-8`,9:`xl:grid-cols-9`,10:`xl:grid-cols-10`,11:`xl:grid-cols-11`,12:`xl:grid-cols-12`},tc={0:`gap-0`,1:`gap-1`,2:`gap-2`,3:`gap-3`,4:`gap-4`,5:`gap-5`,6:`gap-6`,8:`gap-8`,10:`gap-10`,12:`gap-12`};t.ComponentRegistry.register(`grid`,({schema:e,className:t,...n})=>{let r=2,i,a,s,c;typeof e.columns==`number`?r=e.columns:typeof e.columns==`object`&&e.columns!==null&&(r=e.columns.xs??1,i=e.columns.sm,a=e.columns.md,s=e.columns.lg,c=e.columns.xl),e.smColumns&&(i=e.smColumns),e.mdColumns&&(a=e.mdColumns),e.lgColumns&&(s=e.lgColumns),e.xlColumns&&(c=e.xlColumns),typeof e.columns==`number`&&r>1&&i===void 0&&a===void 0&&s===void 0&&c===void 0&&(a=r,i=Math.min(2,r),r=1);let l=e.gap??4,u=z(`grid`,Xs[r]||`grid-cols-2`,i&&Zs[i],a&&Qs[a],s&&$s[s],c&&ec[c],tc[l]||`gap-[${l*.25}rem]`,t),{"data-obj-id":d,"data-obj-type":f,style:p,...m}=n;return(0,o.jsx)(`div`,{className:u,...m,"data-obj-id":d,"data-obj-type":f,style:p,children:e.children&&B(e.children)})},{namespace:`ui`,label:`Grid Layout`,inputs:[{name:`columns`,type:`number`,label:`Base Columns (Mobile)`,defaultValue:2,description:`Number of columns on mobile devices`},{name:`smColumns`,type:`number`,label:`SM Columns (Tablet)`,description:`Columns at sm breakpoint (>640px)`},{name:`mdColumns`,type:`number`,label:`MD Columns (Laptop)`,description:`Columns at md breakpoint (>768px)`},{name:`lgColumns`,type:`number`,label:`LG Columns (Desktop)`,description:`Columns at lg breakpoint (>1024px)`},{name:`xlColumns`,type:`number`,label:`XL Columns (Wide)`,description:`Columns at xl breakpoint (>1280px)`},{name:`gap`,type:`number`,label:`Gap`,defaultValue:4,description:`Gap between items (0-12)`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{columns:1,mdColumns:2,lgColumns:4,gap:4,children:[{type:`card`,title:`Card 1`,description:`First card`},{type:`card`,title:`Card 2`,description:`Second card`},{type:`card`,title:`Card 3`,description:`Third card`},{type:`card`,title:`Card 4`,description:`Fourth card`}]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}}),t.ComponentRegistry.register(`flex`,({schema:e,className:t,...n})=>{let r=e.direction||`row`,i=e.justify||`start`,a=e.align||`start`,s=e.gap||2,c=e.wrap||!1,l=z(`flex`,r===`row`&&`flex-row`,r===`col`&&`flex-col`,r===`row-reverse`&&`flex-row-reverse`,r===`col-reverse`&&`flex-col-reverse`,i===`start`&&`justify-start`,i===`end`&&`justify-end`,i===`center`&&`justify-center`,i===`between`&&`justify-between`,i===`around`&&`justify-around`,i===`evenly`&&`justify-evenly`,a===`start`&&`items-start`,a===`end`&&`items-end`,a===`center`&&`items-center`,a===`baseline`&&`items-baseline`,a===`stretch`&&`items-stretch`,s===0&&`gap-0`,s===1&&`gap-1`,s===2&&`gap-1.5 sm:gap-2`,s===3&&`gap-2 sm:gap-3`,s===4&&`gap-2 sm:gap-3 md:gap-4`,s===5&&`gap-3 sm:gap-4 md:gap-5`,s===6&&`gap-3 sm:gap-4 md:gap-6`,s===7&&`gap-4 sm:gap-5 md:gap-7`,s===8&&`gap-4 sm:gap-6 md:gap-8`,c&&`flex-wrap`,t),{"data-obj-id":u,"data-obj-type":d,style:f,...p}=n;return(0,o.jsx)(`div`,{className:l,...p,"data-obj-id":u,"data-obj-type":d,style:f,children:e.children&&B(e.children)})},{namespace:`ui`,label:`Flex Layout`,inputs:[{name:`direction`,type:`enum`,enum:[`row`,`col`,`row-reverse`,`col-reverse`],label:`Direction`,defaultValue:`row`},{name:`justify`,type:`enum`,enum:[`start`,`end`,`center`,`between`,`around`,`evenly`],label:`Justify Content`,defaultValue:`start`},{name:`align`,type:`enum`,enum:[`start`,`end`,`center`,`baseline`,`stretch`],label:`Align Items`,defaultValue:`start`},{name:`gap`,type:`number`,label:`Gap`,defaultValue:2,description:`Gap between items (0-8)`},{name:`wrap`,type:`boolean`,label:`Wrap`,defaultValue:!1,description:`Allow flex items to wrap`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{direction:`row`,justify:`start`,align:`center`,gap:2,wrap:!1,children:[{type:`button`,label:`Button 1`},{type:`button`,label:`Button 2`},{type:`button`,label:`Button 3`}]}});var nc=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let i=e.direction||`col`,a=e.justify||`start`,s=e.align||`stretch`,c=e.gap??e.spacing??2,l=e.wrap||!1,u=z(`flex`,i===`row`&&`flex-row`,i===`col`&&`flex-col`,i===`row-reverse`&&`flex-row-reverse`,i===`col-reverse`&&`flex-col-reverse`,a===`start`&&`justify-start`,a===`end`&&`justify-end`,a===`center`&&`justify-center`,a===`between`&&`justify-between`,a===`around`&&`justify-around`,a===`evenly`&&`justify-evenly`,s===`start`&&`items-start`,s===`end`&&`items-end`,s===`center`&&`items-center`,s===`baseline`&&`items-baseline`,s===`stretch`&&`items-stretch`,c===0&&`gap-0`,c===1&&`gap-1`,c===2&&`gap-1.5 sm:gap-2`,c===3&&`gap-2 sm:gap-3`,c===4&&`gap-2 sm:gap-3 md:gap-4`,c===5&&`gap-3 sm:gap-4 md:gap-5`,c===6&&`gap-3 sm:gap-4 md:gap-6`,c===8&&`gap-4 sm:gap-6 md:gap-8`,c===10&&`gap-5 sm:gap-7 md:gap-10`,l&&`flex-wrap`,t),{"data-obj-id":d,"data-obj-type":f,style:p,...m}=n;return(0,o.jsx)(`div`,{ref:r,className:u,...m,"data-obj-id":d,"data-obj-type":f,style:p,children:e.children&&B(e.children)})});t.ComponentRegistry.register(`stack`,nc,{namespace:`ui`,label:`Stack`,inputs:[{name:`direction`,type:`enum`,label:`Direction`,enum:[`col`,`row`,`col-reverse`,`row-reverse`],defaultValue:`col`},{name:`gap`,type:`number`,label:`Gap`,defaultValue:2},{name:`align`,type:`enum`,label:`Align Items`,enum:[`start`,`end`,`center`,`stretch`,`baseline`],defaultValue:`stretch`},{name:`justify`,type:`enum`,label:`Justify Content`,enum:[`start`,`end`,`center`,`between`,`around`,`evenly`],defaultValue:`start`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{direction:`col`,gap:2,align:`stretch`,children:[]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:100,minHeight:50}});var rc=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let i=e.maxWidth||`xl`,a=e.padding||4,s=e.centered!==!1,c=z(`w-full`,i===`sm`&&`max-w-sm`,i===`md`&&`max-w-md`,i===`lg`&&`max-w-lg`,i===`xl`&&`max-w-xl`,i===`2xl`&&`max-w-2xl`,i===`3xl`&&`max-w-3xl`,i===`4xl`&&`max-w-4xl`,i===`5xl`&&`max-w-5xl`,i===`6xl`&&`max-w-6xl`,i===`7xl`&&`max-w-7xl`,i===`full`&&`max-w-full`,i===`screen`&&`max-w-screen-2xl`,s&&`mx-auto`,a===0&&`p-0`,a===1&&`p-0.5 sm:p-1`,a===2&&`p-1 sm:p-2`,a===3&&`p-2 sm:p-3`,a===4&&`p-2 sm:p-3 md:p-4`,a===5&&`p-3 sm:p-4 md:p-5`,a===6&&`p-3 sm:p-4 md:p-6`,a===7&&`p-4 sm:p-5 md:p-7`,a===8&&`p-4 sm:p-6 md:p-8`,a===10&&`p-5 sm:p-7 md:p-10`,a===12&&`p-6 sm:p-8 md:p-12`,a===16&&`p-8 sm:p-10 md:p-16`,t),{"data-obj-id":l,"data-obj-type":u,style:d,...f}=n;return(0,o.jsx)(`div`,{ref:r,className:c,...f,"data-obj-id":l,"data-obj-type":u,style:d,children:e.children&&B(e.children)})});t.ComponentRegistry.register(`container`,rc,{namespace:`ui`,label:`Container`,inputs:[{name:`maxWidth`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`,`full`,`screen`],label:`Max Width`,defaultValue:`xl`},{name:`padding`,type:`number`,label:`Padding`,defaultValue:4,description:`Padding value (0, 1-8, 10, 12, 16)`},{name:`centered`,type:`boolean`,label:`Center Horizontally`,defaultValue:!0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{maxWidth:`xl`,padding:4,centered:!0,children:[{type:`text`,content:`Container content goes here`}]},isContainer:!0,resizable:!0,resizeConstraints:{width:!0,height:!0,minWidth:200,minHeight:100}});function ic(e){switch(e){case`small`:return`w-64`;case`medium`:return`w-80`;case`large`:return`w-96`;case`full`:return`w-full`;default:return e||`w-full`}}function ac(e){switch(e){case`small`:return`w-full md:w-64`;case`medium`:return`w-full md:w-80`;case`large`:return`w-full md:w-96`;default:return`w-full`}}function oc(e){switch(e){case`utility`:return`max-w-4xl`;case`home`:return`max-w-screen-2xl`;case`app`:return`max-w-screen-xl`;default:return`max-w-7xl`}}function Q(e,t){return e?.find(e=>e.name?.toLowerCase()===t.toLowerCase())}function sc(e,t){if(!e)return[];let n=new Set(t.map(e=>e.toLowerCase()));return e.filter(e=>!n.has(e.name?.toLowerCase()??``))}var $=({region:e,className:t})=>{let n=e.components||[];return n.length===0?null:(0,o.jsx)(`div`,{className:z(`space-y-4`,e.className,t),"data-region":e.name,children:n.map((t,n)=>(0,o.jsx)(i.SchemaRenderer,{schema:t},t?.id||`${e.name}-${n}`))})},cc=({regions:e,pageType:t,className:n})=>{let r=Q(e,`header`),i=Q(e,`sidebar`),a=Q(e,`main`),s=Q(e,`aside`),c=Q(e,`footer`),l=sc(e,[`header`,`sidebar`,`main`,`aside`,`footer`]);return r||i||a||s||c?(0,o.jsxs)(`div`,{className:z(`flex flex-col gap-6`,n),"data-page-layout":t,children:[r&&(0,o.jsx)($,{region:r,className:z(ic(r.width))}),(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[i&&(0,o.jsx)(`aside`,{className:z(`md:shrink-0`,ac(i.width||`small`)),children:(0,o.jsx)($,{region:i})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[a&&(0,o.jsx)($,{region:a}),l.map((e,t)=>(0,o.jsx)($,{region:e},e.name||`extra-${t}`))]}),s&&(0,o.jsx)(`aside`,{className:z(`md:shrink-0`,ac(s.width||`small`),s.className),children:(0,o.jsx)($,{region:s})})]}),c&&(0,o.jsx)($,{region:c,className:z(ic(c.width))})]}):(0,o.jsx)(`div`,{className:z(`space-y-6`,n),"data-page-layout":t,children:e.map((e,t)=>(0,o.jsx)($,{region:e},e.name||t))})},lc=({schema:e})=>{let t=e.body||e.children,n=Array.isArray(t)?t:t?[t]:[];return n.length===0?null:(0,o.jsx)(`div`,{className:`space-y-6`,children:n.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},e?.id||t))})},uc=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(cc,{regions:e.regions,pageType:e.pageType}):(0,o.jsx)(lc,{schema:e}),dc={default:uc,"full-width":uc,"header-sidebar-main":({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(lc,{schema:e});let n=Q(t,`header`),r=Q(t,`sidebar`),i=Q(t,`main`),a=sc(t,[`header`,`sidebar`,`main`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`header-sidebar-main`,children:[n&&(0,o.jsx)($,{region:n}),(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[r&&(0,o.jsx)(`aside`,{className:z(`md:shrink-0`,ac(r.width||`medium`)),children:(0,o.jsx)($,{region:r})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[i&&(0,o.jsx)($,{region:i}),a.map((e,t)=>(0,o.jsx)($,{region:e},e.name||`extra-${t}`))]})]})]})},"three-column":({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(lc,{schema:e});let n=Q(t,`header`),r=Q(t,`sidebar`),i=Q(t,`main`),a=Q(t,`aside`),s=Q(t,`footer`),c=sc(t,[`header`,`sidebar`,`main`,`aside`,`footer`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`three-column`,children:[n&&(0,o.jsx)($,{region:n}),(0,o.jsxs)(`div`,{className:`flex flex-col md:flex-row flex-1 gap-6`,children:[r&&(0,o.jsx)(`aside`,{className:z(`md:shrink-0`,ac(r.width||`small`)),children:(0,o.jsx)($,{region:r})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-6`,children:[i&&(0,o.jsx)($,{region:i}),c.map((e,t)=>(0,o.jsx)($,{region:e},e.name||`extra-${t}`))]}),a&&(0,o.jsx)(`aside`,{className:z(`md:shrink-0`,ac(a.width||`small`),a.className),children:(0,o.jsx)($,{region:a})})]}),s&&(0,o.jsx)($,{region:s})]})},dashboard:({schema:e})=>{let t=e.regions||[];if(t.length===0)return(0,o.jsx)(lc,{schema:e});let n=Q(t,`header`),r=Q(t,`footer`),i=sc(t,[`header`,`footer`]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-template":`dashboard`,children:[n&&(0,o.jsx)($,{region:n}),(0,o.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:i.map((e,t)=>(0,o.jsx)($,{region:e},e.name||`region-${t}`))}),r&&(0,o.jsx)($,{region:r})]})}};function fc(e){return e.template&&dc[e.template]||null}var pc=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(cc,{regions:e.regions,pageType:`record`}):(0,o.jsx)(lc,{schema:e}),mc=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(cc,{regions:e.regions,pageType:`home`}):(0,o.jsx)(lc,{schema:e}),hc=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(cc,{regions:e.regions,pageType:`app`}):(0,o.jsx)(lc,{schema:e}),gc=({schema:e})=>e.regions&&e.regions.length>0?(0,o.jsx)(cc,{regions:e.regions,pageType:`utility`}):(0,o.jsx)(lc,{schema:e}),_c=({schema:e,className:t,...n})=>{let r=e.pageType||`record`,{"data-obj-id":s,"data-obj-type":c,style:l,pageType:u,schema:d,regions:f,template:p,title:m,icon:h,description:g,object:_,variables:v,blankLayout:y,body:b,isDefault:x,assignedProfiles:S,aria:C,recordOverride:w,permissions:T,requiredPermissions:E,enforceFieldSecurity:D,redactFields:O,children:k,...A}=n,j=Object.fromEntries(Object.entries(A).filter(([e])=>!e.startsWith(`_`))),ee=(0,a.useMemo)(()=>{let t=fc(e);if(t)return(0,o.jsx)(t,{schema:e});switch(r){case`home`:return(0,o.jsx)(mc,{schema:e});case`app`:return(0,o.jsx)(hc,{schema:e});case`utility`:return(0,o.jsx)(gc,{schema:e});default:return(0,o.jsx)(pc,{schema:e})}},[e,r]),te=(0,o.jsx)(`div`,{className:z(`min-h-full w-full bg-background p-3 md:p-4 lg:p-6`,t),"data-page-type":r,"data-obj-id":s,"data-obj-type":c,style:l,...j,children:(0,o.jsxs)(`div`,{className:z(`mx-auto space-y-6`,oc(r)),children:[r!==`record`&&(e.title||e.description)&&(0,o.jsxs)(`div`,{className:`space-y-2`,children:[e.title&&(0,o.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground`,children:e.title}),e.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground`,children:e.description})]}),ee]})});return e.variables&&e.variables.length>0?(0,o.jsx)(i.PageVariablesProvider,{definitions:e.variables,children:te}):te},vc={namespace:`ui`,label:`Page`,icon:`Layout`,category:`layout`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`pageType`,type:`string`,label:`Page Type`},{name:`object`,type:`string`,label:`Object Name`},{name:`template`,type:`string`,label:`Template`},{name:`regions`,type:`array`,label:`Regions`,itemType:`object`},{name:`variables`,type:`array`,label:`Variables`,itemType:`object`},{name:`body`,type:`array`,label:`Content (Legacy)`,itemType:`component`}]};t.ComponentRegistry.register(`page`,_c,vc),t.ComponentRegistry.register(`app`,_c,{...vc,label:`App Page`}),t.ComponentRegistry.register(`utility`,_c,{...vc,label:`Utility Page`}),t.ComponentRegistry.register(`home`,_c,{...vc,label:`Home Page`}),t.ComponentRegistry.register(`record`,_c,{...vc,label:`Record Page`});var yc=new Map,bc=new Map,xc=new Set;function Sc(e,t,n){return`${e}::${t??``}::${n??``}`}function Cc(){for(let e of xc)e()}function wc(e,t,n){return yc.get(Sc(e,t,n))}function Tc(e,t,n,r){let i=Sc(e,t,n);yc.get(i)!==r&&(yc.set(i,r),Cc())}async function Ec(e,t,n,r){let i=Sc(t,n,r),a=yc.get(i);if(a!==void 0)return a;let o=bc.get(i);if(o)return o;let s=(async()=>{let a={};if(n){if(!r)return 0;a[n]=r}try{let i=await e(t,{$filter:a,$top:1,$count:!0}),o=typeof i?.total==`number`?i.total:typeof i?.count==`number`?i.count:Array.isArray(i?.records)?i.records.length:Array.isArray(i?.data)?i.data.length:Array.isArray(i)?i.length:0,s=typeof o==`number`?o:0;return Tc(t,n,r,s),s}catch{return 0}finally{bc.delete(i)}})();return bc.set(i,s),s}function Dc(e,t){let n=!1,r=`${e}::`;for(let e of yc.keys())e.startsWith(r)&&(t!==void 0&&!e.endsWith(`::${t}`)||(yc.delete(e),n=!0));n&&Cc()}function Oc(){yc.size!==0&&(yc.clear(),Cc())}function kc(e){return xc.add(e),()=>{xc.delete(e)}}function Ac(){return yc}function jc(e,t,n){if((0,a.useSyncExternalStore)(kc,Ac,Ac),e)return wc(e,t,n)}var Mc={get:wc,set:Tc,fetch:Ec,invalidate:Dc,invalidateAll:Oc,_reset:()=>{yc.clear(),bc.clear(),Cc()}},Nc=e=>{let{"data-obj-id":t,"data-obj-type":n,style:r,...i}=e||{};return{designer:{"data-obj-id":t,"data-obj-type":n,style:r},rest:i}},Pc=e=>e==null?``:typeof e==`string`?e:typeof e==`object`?e.default||e.value||``:String(e),Fc={"zh-CN":{Details:`详情`,Related:`相关`,Activity:`活动`,History:`历史`,Notes:`备注`,Files:`文件`,Tasks:`任务`,"Open Tasks":`待办任务`,"Closed Tasks":`已完成任务`,Events:`日程`,Attachments:`附件`,Chatter:`讨论`,Discussion:`讨论`,Comments:`评论`,Overview:`概览`,Summary:`摘要`,Quotes:`报价单`,Products:`产品`,Contacts:`联系人`,Accounts:`客户`,Leads:`线索`,Opportunities:`商机`,Cases:`服务案例`,Campaigns:`营销活动`,Approvals:`审批`,Documents:`文档`,Emails:`邮件`,Calls:`通话`,Meetings:`会议`},"zh-TW":{Details:`詳情`,Related:`相關`,Activity:`活動`,History:`歷史`,Notes:`備註`,Files:`檔案`,Tasks:`任務`,"Open Tasks":`待辦任務`,"Closed Tasks":`已完成任務`,Events:`行程`,Attachments:`附件`,Chatter:`討論`,Discussion:`討論`,Comments:`評論`,Overview:`概覽`,Summary:`摘要`,Quotes:`報價單`,Products:`產品`,Contacts:`聯絡人`,Accounts:`客戶`,Leads:`線索`,Opportunities:`商機`,Cases:`服務案例`,Campaigns:`行銷活動`,Approvals:`審批`,Documents:`文件`,Emails:`郵件`,Calls:`通話`,Meetings:`會議`}},Ic=()=>{if(typeof document<`u`){let e=document.documentElement?.lang;if(e)return e}return typeof navigator<`u`&&navigator.language?navigator.language:`en`},Lc=e=>{if(!e)return e;let t=Ic(),n=Fc[t],r=t.split(`-`)[0]===`zh`?Fc[`zh-CN`]:void 0,i=n||r;if(!i)return e;if(i[e]!==void 0)return i[e];let a=/\s*(?:&|and|和)\s*/i;if(a.test(e)){let n=e.split(a);if(n.every(e=>i[e.trim()]!==void 0)){let e=t.startsWith(`zh`)?`与`:` & `;return n.map(e=>i[e.trim()]).join(e)}}return e},Rc=(e,t,n,r,i)=>!e||typeof e!=`string`?e||``:e.includes(`{`)?e.replace(/\{([a-zA-Z0-9_.]+)\}/g,(e,a)=>{let o=a.split(`.`).reduce((e,t)=>e==null?e:e[t],t);if(o==null||typeof o==`object`)return``;let s=String(o);if(n?.fields&&r&&i&&!a.includes(`.`)){let e=(Array.isArray(n.fields)?n.fields.find(e=>e?.name===a):n.fields[a])?.options;if(Array.isArray(e)){let t=e.find(e=>String(e?.value??e)===s);return r(i,a,s,t?.label?String(t.label):s)}}return s}).replace(/\s+/g,` `).trim():e,zc=e=>{let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,``)}k`:String(t):String(e)},Bc=(e,t=[])=>{if(!e)return t;let n=Array.isArray(e)?e:[e];for(let e of n){if(!e||typeof e!=`object`)continue;if(e.type===`record:related_list`||e.type===`record_related_list`){t.push(e);continue}let n=[e.children,e.properties?.children,e.properties?.items,e.body,e.items];for(let e of n)e&&Bc(e,t)}return t};t.ComponentRegistry.register(`page:tabs`,({schema:e,className:t,...n})=>{let{designer:r}=Nc(n),{language:s}=(0,F.useObjectTranslation)(),c=e?.items||[],l=e?.properties?.type||e?.tabStyle||`line`,u=(e?.position||`top`)===`left`,d=(0,i.useRecordContext)(),f=d?.data?.id,p=d?.dataSource;jc(void 0,void 0,f);let m=a.default.useMemo(()=>{let e=new Map;return c.forEach((t,n)=>{if(t.count!==void 0&&t.count!==null&&t.count!==``)return;let r=Bc(t.children),i=[];for(let e of r){let t=e?.properties?.objectName||e?.objectName;if(!t)continue;let n=e?.properties?.relationshipField||e?.relationshipField;i.push({objectName:t,relationshipField:n})}i.length>0&&e.set(n,i)}),e},[c]);a.default.useEffect(()=>{if(!p||typeof p.find!=`function`||m.size===0)return;let e=!1;for(let t of m.values())for(let n of t)if(Mc.fetch((e,t)=>p.find(e,t),n.objectName,n.relationshipField,f).catch(()=>0),e)return;return()=>{e=!0}},[p,m,f]);let h=e=>{let t=m.get(e);if(!t||t.length===0)return;let n=0,r=!1;for(let e of t){let t=Mc.get(e.objectName,e.relationshipField,f);t!==void 0&&(n+=t,r=!0)}return r?n:void 0},g=c.map((e,t)=>({...e,value:`tab-${t}`,labelStr:Lc((0,F.pickLocalized)(e.label,s)),count:e.count!==void 0&&e.count!==null&&e.count!==``?e.count:h(t)})),_=g[0]?.value,v=z(u&&`flex-col h-auto items-stretch p-1`,l===`card`&&`bg-transparent gap-1`,l===`pill`&&`bg-muted rounded-full p-1 gap-1`,l===`line`&&!u&&`h-auto rounded-none bg-transparent p-0 gap-4 border-b border-border w-full justify-start`,!u&&`sticky top-0 z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60`),y=()=>z(u&&`justify-start`,l===`card`&&`data-[state=active]:bg-background data-[state=active]:border data-[state=active]:shadow-sm rounded-md`,l===`pill`&&`rounded-full data-[state=active]:bg-background`,l===`line`&&!u&&`rounded-none border-b-2 border-transparent bg-transparent px-1 pb-2.5 -mb-px shadow-none data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=active]:text-foreground`);return(0,o.jsxs)(Qi,{defaultValue:_,orientation:u?`vertical`:`horizontal`,className:z(t,u&&`flex gap-4 w-full`),...r,children:[(g.length>1||e?.properties?.alwaysShowStrip===!0)&&(0,o.jsx)($i,{className:v,children:g.map(e=>(0,o.jsxs)(ea,{value:e.value,className:y(),children:[e.icon&&(0,o.jsx)(ka,{name:e.icon,className:`mr-1.5 h-3.5 w-3.5 shrink-0 opacity-70`,"aria-hidden":!0}),(0,o.jsx)(`span`,{children:e.labelStr}),e.count!==void 0&&e.count!==null&&e.count!==``&&Number(e.count)>0&&(0,o.jsx)(`span`,{className:`ml-1.5 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-muted px-1 text-[10px] font-medium leading-none text-muted-foreground`,"aria-label":`${zc(e.count)} items`,children:zc(e.count)})]},e.value))}),g.map(e=>(0,o.jsx)(ta,{value:e.value,className:z(g.length>1?`mt-3`:`mt-0`,u&&`mt-0 flex-1`),children:B(e.children)},e.value))]})},{namespace:`page`,label:`Page Tabs`,category:`layout`,isContainer:!0}),t.ComponentRegistry.register(`page:card`,({schema:e,className:t,...n})=>{let{designer:r}=Nc(n),{language:i}=(0,F.useObjectTranslation)(),a=(0,F.pickLocalized)(e?.title,i),s=e?.bordered!==!1,c=e?.body??e?.children,l=e?.footer;return(0,o.jsxs)(Qe,{className:z(t,!s&&`border-0 shadow-none bg-transparent`),...r,children:[a&&(0,o.jsx)($e,{children:(0,o.jsx)(et,{children:a})}),c&&(0,o.jsx)(nt,{children:B(c)}),l&&(0,o.jsx)(rt,{className:`flex justify-between`,children:B(l)})]})},{namespace:`page`,label:`Page Card`,category:`layout`,isContainer:!0}),t.ComponentRegistry.register(`page:accordion`,({schema:e,className:t,...n})=>{let{designer:r}=Nc(n),{language:i}=(0,F.useObjectTranslation)(),a=e?.items||[],s=!!e?.allowMultiple,c=(e?.variant??e?.properties?.variant??`flush`)===`flush`?`border-b last:border-b-0`:void 0,l=a.map((e,t)=>({...e,value:`panel-${t}`,labelStr:Lc((0,F.pickLocalized)(e.label,i))})),u=l.filter(e=>e.collapsed===!1).map(e=>e.value),d=l.map(e=>(0,o.jsxs)(xe,{value:e.value,className:c,children:[(0,o.jsx)(Se,{className:`text-sm font-semibold tracking-tight hover:no-underline`,children:e.labelStr}),(0,o.jsx)(Ce,{children:B(e.children)})]},e.value));return s?(0,o.jsx)(be,{type:`multiple`,defaultValue:u,className:t,...r,children:d}):(0,o.jsx)(be,{type:`single`,collapsible:!0,defaultValue:u[0],className:t,...r,children:d})},{namespace:`page`,label:`Page Accordion`,category:`layout`,isContainer:!0}),t.ComponentRegistry.register(`page:section`,({schema:e,className:t,...n})=>{let{designer:r}=Nc(n);return(0,o.jsx)(`section`,{className:z(`space-y-4`,t),...r,children:B(e?.children||e?.body)})},{namespace:`page`,label:`Page Section`,category:`layout`,isContainer:!0});function Vc(e){if(!e)return e;let t=e;for(let e=0;e<4;e+=1){let e=t.replace(/[\s\u00A0]*[-·:|/–—][\s\u00A0]*$/u,``).trimEnd();if(e===t)break;t=e}for(let e=0;e<4;e+=1){let e=t.replace(/^[\s\u00A0]*[-·:|/–—][\s\u00A0]*/u,``).trimStart();if(e===t)break;t=e}return t=t.replace(/([-·:|/–—])[\s\u00A0]*\1/gu,`$1`),t=t.replace(/[\s\u00A0]+/g,` `).trim(),t}t.ComponentRegistry.register(`page:header`,({schema:e,className:n,...r})=>{let{designer:s}=Nc(r),l=(0,i.useRecordContext)(),{execute:u}=(0,i.useAction)(),{objectLabel:d,actionLabel:f}=(0,F.useObjectLabel)(),{fieldOptionLabel:p}=(0,F.useSafeFieldLabel)(),{language:m}=(0,F.useObjectTranslation)(),h=e?.title??e?.properties?.title,g=e?.subtitle??e?.properties?.subtitle,_=l?.objectSchema,v=l?.objectName||_?.name,y=Rc((0,F.pickLocalized)(h,m),l?.data,_,p,v),b=Rc((0,F.pickLocalized)(g,m),l?.data,_,p,v),x=(e?.breadcrumb??e?.properties?.breadcrumb)!==!1,S=e?.recordChrome===!1||e?.properties?.recordChrome===!1,C=e?.showStar!==!1&&e?.properties?.showStar!==!1,w=e?.showCopyId!==!1&&e?.properties?.showCopyId!==!1,T=e?.actions??e?.properties?.actions,E=l?.headerSystemActions,D=a.default.useMemo(()=>{let e=l?.data,n=new t.ExpressionEvaluator({...e&&typeof e==`object`?e:{},record:e,data:e}),r=e=>{try{return n.evaluateExpression(e)}catch{return}},i=e=>{if(Array.isArray(e?.locations)&&e.locations.length>0&&!e.locations.includes(`record_header`))return!1;let t=e?.visible;if(t!=null)if(typeof t==`boolean`){if(!t)return!1}else{let e=typeof t==`string`?t:t&&typeof t==`object`&&typeof t.source==`string`?t.source:null;if(e&&!r(e))return!1}let n=e?.hidden;if(n!=null)if(typeof n==`boolean`){if(n)return!1}else{let e=typeof n==`string`?n:n&&typeof n==`object`&&typeof n.source==`string`?n.source:null;if(e&&r(e))return!1}return!0},a=Array.isArray(T)?T.filter(i):[],o=Array.isArray(E)?E.filter(i):[],s=new Set,c=[];for(let e of[...a,...o]){let t=e?.name||e?.id||``;t&&s.has(t)||(t&&s.add(t),c.push(e))}return c},[T,E,l?.data]),O=()=>{if(D.length===0)return null;let e=(e,t)=>{let n=e?.name||e?.id,r=e?.label||n||`Action ${t+1}`;return n?f(l?.objectName,n,r):r},n=D.length>2,r=n?D.slice(0,1):D,i=n?D.slice(1):[],a=l?.data,s=new t.ExpressionEvaluator({...a&&typeof a==`object`?a:{},record:a,data:a}),d=e=>{if(e==null)return!1;if(typeof e==`boolean`)return e;let t=typeof e==`string`?e:e&&typeof e==`object`&&typeof e.source==`string`?e.source:void 0;if(!t)return!1;try{return!!s.evaluateExpression(t)}catch{return!1}};return(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 shrink-0`,role:`toolbar`,"aria-label":`Page header actions`,children:[r.map((t,n)=>{let r=e(t,n),i=t.variant||`default`,a=t.size||`sm`,s=d(t.disabled),c=typeof t.icon==`string`?t.icon:null;return(0,o.jsxs)(V,{variant:i,size:a,disabled:s,className:`gap-2`,onClick:()=>{if(typeof t.onClick==`function`){t.onClick();return}u(t)},children:[c&&(0,o.jsx)(ka,{name:c,className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:r})]},t.name||t.id||`header-action-${n}`)}),n&&(0,o.jsxs)(gn,{children:[(0,o.jsx)(_n,{asChild:!0,children:(0,o.jsx)(V,{variant:`outline`,size:`sm`,className:`gap-1 px-2`,"aria-label":`More actions`,children:(0,o.jsx)(c.MoreHorizontal,{className:`h-4 w-4`})})}),(0,o.jsx)(wn,{align:`end`,className:`w-44`,children:i.map((t,n)=>{let r=e(t,n+1),i=d(t.disabled),a=typeof t.icon==`string`?t.icon:null;return(0,o.jsxs)(Tn,{disabled:i,onSelect:e=>{if(e.preventDefault(),typeof t.onClick==`function`){t.onClick();return}u(t)},className:z(`gap-2`,(t.variant===`destructive`||t.name===`sys_delete`)&&`text-destructive focus:text-destructive focus:bg-destructive/10`),children:[a&&(0,o.jsx)(ka,{name:a,className:`h-4 w-4`}),(0,o.jsx)(`span`,{children:r})]},t.name||t.id||`overflow-action-${n}`)})})]})]})};if(l?.data&&l?.objectSchema&&!S){let e=l.data,t=l.objectSchema,r=l.objectName||t?.name,i=Pc(t?.label)||t?.name||l.objectName||``,a=r?d({name:r,label:i}):i||void 0,c=t?.primaryField,u=t?.titleFormat,f=typeof u==`string`?u:u&&typeof u==`object`&&typeof u.source==`string`?u.source:void 0,m=f?Vc(Rc(f,e,t,p,r).trim()):``,h=y||c&&e?.[c]||(m&&!m.includes(`{`)?m:``)||e?.name||e?.full_name||e?.title||e?.subject||e?.display_name||e?.label||(a&&e?.id?`${a} ${String(e.id).slice(0,8)}`:``)||a||``;return(0,o.jsxs)(`header`,{className:z(`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-4 pb-4 border-b`,n),...s,children:[(0,o.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[x&&(0,o.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,"data-page-breadcrumb-slot":!0}),(0,o.jsx)(zs,{title:h,objectLabel:a,resourceId:e?.id?String(e.id):void 0,showStar:C,showCopyId:w,isFavorite:l?.isFavorite,onToggleFavorite:l?.onToggleFavorite?()=>l.onToggleFavorite():void 0}),b&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:b})]}),O()??(0,o.jsx)(`div`,{"data-page-actions-slot":!0,className:`shrink-0`})]})}return(0,o.jsxs)(`header`,{className:z(`flex flex-col gap-2 pb-4 border-b`,n),...s,children:[x&&(0,o.jsx)(`div`,{className:`text-xs text-muted-foreground`,"data-page-breadcrumb-slot":!0}),(0,o.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[y&&(0,o.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:y}),b&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:b})]}),O()??(0,o.jsx)(`div`,{"data-page-actions-slot":!0})]})]})},{namespace:`page`,label:`Page Header`,category:`layout`}),t.ComponentRegistry.register(`page:footer`,({schema:e,className:t,...n})=>{let{designer:r}=Nc(n);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Gr,{className:`my-4`}),(0,o.jsx)(`footer`,{className:z(`flex items-center justify-between text-sm text-muted-foreground`,t),...r,children:B(e?.children||e?.body)})]})},{namespace:`page`,label:`Page Footer`,category:`layout`,isContainer:!0}),t.ComponentRegistry.register(`page:sidebar`,({schema:e,className:t,...n})=>{let{designer:r}=Nc(n);return(0,o.jsx)(`aside`,{className:z(`flex flex-col gap-4 w-full md:w-80 shrink-0`,t),...r,children:B(e?.children||e?.body)})},{namespace:`page`,label:`Page Sidebar`,category:`layout`,isContainer:!0}),[`aside`,`main`,`header`,`nav`,`footer`,`section`,`article`].forEach(e=>{let n=(0,a.forwardRef)(({schema:t,className:n,...r},i)=>{let{"data-obj-id":a,"data-obj-type":s,style:c,...l}=r;return(0,o.jsx)(e,{ref:i,className:n,...l,"data-obj-id":a,"data-obj-type":s,style:c,children:B(t.children||t.body)})});n.displayName=`Semantic${e.charAt(0).toUpperCase()+e.slice(1)}`,t.ComponentRegistry.register(e,n,{namespace:`ui`,label:e.charAt(0).toUpperCase()+e.slice(1),category:`layout`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}]})}),t.ComponentRegistry.register(`aspect-ratio`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(Le,{ratio:e.ratio||16/9,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.image?(0,o.jsx)(`img`,{src:e.image,alt:e.alt||``,loading:`lazy`,className:`rounded-md object-cover w-full h-full`}):B(e.children||e.body)})},{namespace:`ui`,label:`Aspect Ratio`,inputs:[{name:`ratio`,type:`number`,label:`Ratio`,defaultValue:16/9},{name:`image`,type:`string`,label:`Image URL`},{name:`alt`,type:`string`,label:`Alt Text`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{ratio:16/9}}),t.ComponentRegistry.register(`sidebar-provider`,({schema:e,...t})=>(0,o.jsx)(_i,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Provider`,inputs:[{name:`defaultOpen`,type:`boolean`,label:`Default Open`,defaultValue:!0}],defaultProps:{defaultOpen:!0},defaultChildren:[{type:`sidebar`},{type:`sidebar-inset`}]}),t.ComponentRegistry.register(`sidebar`,({schema:e,...t})=>(0,o.jsx)(vi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar`,inputs:[{name:`collapsible`,type:`enum`,enum:[`offcanvas`,`icon`,`none`],defaultValue:`icon`,label:`Collapsible`},{name:`side`,type:`enum`,enum:[`left`,`right`],defaultValue:`left`,label:`Side`},{name:`variant`,type:`enum`,enum:[`sidebar`,`floating`,`inset`],defaultValue:`sidebar`,label:`Variant`}],defaultProps:{collapsible:`icon`,side:`left`,variant:`sidebar`},defaultChildren:[{type:`sidebar-header`},{type:`sidebar-content`},{type:`sidebar-footer`}]}),t.ComponentRegistry.register(`sidebar-header`,({schema:e,...t})=>(0,o.jsx)(Ci,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Header`,defaultChildren:[{type:`text`,content:`Sidebar Header`}]}),t.ComponentRegistry.register(`sidebar-content`,({schema:e,...t})=>(0,o.jsx)(Ei,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Content`,defaultChildren:[{type:`sidebar-group`}]}),t.ComponentRegistry.register(`sidebar-group`,({schema:e,...t})=>(0,o.jsxs)(Di,{...t,children:[e.label&&(0,o.jsx)(Oi,{children:e.label}),(0,o.jsx)(Ai,{children:B(e.body)})]}),{namespace:`ui`,label:`Sidebar Group`,inputs:[{name:`label`,type:`string`,label:`Label`}],defaultProps:{label:`Menu`},defaultChildren:[{type:`sidebar-menu`}]}),t.ComponentRegistry.register(`sidebar-menu`,({schema:e,...t})=>(0,o.jsx)(ji,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Menu`,defaultChildren:[{type:`sidebar-menu-item`},{type:`sidebar-menu-item`}]}),t.ComponentRegistry.register(`sidebar-menu-item`,({schema:e,...t})=>(0,o.jsx)(Mi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Menu Item`,defaultChildren:[{type:`sidebar-menu-button`}]}),t.ComponentRegistry.register(`sidebar-menu-button`,({schema:e,...t})=>(0,o.jsx)(Pi,{isActive:e.active,...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Menu Button`,inputs:[{name:`active`,type:`boolean`,label:`Active`,defaultValue:!1},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`],defaultValue:`default`,label:`Size`},{name:`tooltip`,type:`string`,label:`Tooltip`}],defaultProps:{size:`default`},defaultChildren:[{type:`text`,content:`Menu Item`}]}),t.ComponentRegistry.register(`sidebar-footer`,({schema:e,...t})=>(0,o.jsx)(wi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Footer`,defaultChildren:[{type:`text`,content:`Footer`}]}),t.ComponentRegistry.register(`sidebar-inset`,({schema:e,...t})=>(0,o.jsx)(xi,{...t,children:B(e.body)}),{namespace:`ui`,label:`Sidebar Inset`,defaultChildren:[{type:`div`,className:`p-4`,body:[{type:`text`,content:`Main content area`}]}]}),t.ComponentRegistry.register(`sidebar-trigger`,({className:e,...t})=>(0,o.jsx)(yi,{className:e,...t}),{namespace:`ui`,label:`Sidebar Trigger`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}]});function Hc({crumb:e,isLast:t}){let n=(0,i.resolveI18nLabel)(e.label)??``;return e.siblings&&e.siblings.length>0?(0,o.jsxs)(gn,{children:[(0,o.jsxs)(_n,{className:`flex items-center gap-1`,children:[t?(0,o.jsx)(`span`,{className:`font-semibold`,children:n}):(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(c.ChevronDown,{className:`h-3 w-3`})]}),(0,o.jsx)(wn,{align:`start`,children:e.siblings.map((e,t)=>(0,o.jsx)(Tn,{asChild:!0,children:(0,o.jsx)(`a`,{href:e.href,children:e.label})},t))})]}):t?(0,o.jsx)(qe,{children:n}):(0,o.jsx)(Ke,{href:e.href||`#`,children:n})}t.ComponentRegistry.register(`header-bar`,({schema:e})=>(0,o.jsxs)(`header`,{className:`flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b px-3 sm:px-4`,children:[(0,o.jsx)(yi,{}),(0,o.jsx)(Gr,{orientation:`vertical`,className:`mr-2 h-4`}),(0,o.jsx)(Ue,{children:(0,o.jsx)(We,{children:e.crumbs?.map((t,n)=>(0,o.jsxs)(a.default.Fragment,{children:[(0,o.jsx)(Ge,{children:(0,o.jsx)(Hc,{crumb:t,isLast:n===e.crumbs.length-1})}),n<e.crumbs.length-1&&(0,o.jsx)(Je,{})]},n))})}),(0,o.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[e.search?.enabled&&(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(c.Search,{className:`absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground`}),(0,o.jsx)(K,{type:`search`,placeholder:e.search.placeholder,className:`pl-8 w-[200px] lg:w-[300px]`}),e.search.shortcut&&(0,o.jsx)(`kbd`,{className:`pointer-events-none absolute right-2 top-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex`,children:e.search.shortcut})]}),e.actions?.map((e,t)=>(0,o.jsx)(i.SchemaRenderer,{schema:e},t)),e.rightContent&&(0,o.jsx)(i.SchemaRenderer,{schema:e.rightContent})]})]}),{namespace:`ui`,label:`Header Bar`,inputs:[{name:`crumbs`,type:`array`,label:`Breadcrumbs`},{name:`search`,type:`object`,label:`Search Configuration`},{name:`actions`,type:`array`,label:`Action Slots`},{name:`rightContent`,type:`object`,label:`Right Content`}],defaultProps:{crumbs:[{label:`Home`,href:`#`},{label:`Current Page`}]}}),t.ComponentRegistry.register(`badge`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(He,{variant:e.variant,className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.label||B(e.body)})},{namespace:`ui`,label:`Badge`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`variant`,type:`enum`,enum:[`default`,`secondary`,`destructive`,`outline`],defaultValue:`default`,label:`Variant`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{label:`Badge`,variant:`default`}}),t.ComponentRegistry.register(`avatar`,({schema:e,className:t,...n})=>(0,o.jsxs)(Re,{className:t,...n,children:[(0,o.jsx)(ze,{src:e.src,alt:e.alt}),(0,o.jsx)(Be,{children:e.fallback})]}),{namespace:`ui`,label:`Avatar`,inputs:[{name:`src`,type:`string`,label:`Image URL`},{name:`alt`,type:`string`,label:`Alt Text`},{name:`fallback`,type:`string`,label:`Fallback Initials`,defaultValue:`CN`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{fallback:`CN`,alt:`Avatar`}}),t.ComponentRegistry.register(`alert`,({schema:e,className:t,...n})=>(0,o.jsxs)(W,{variant:e.variant,className:t,...n,children:[(0,o.jsx)(Fe,{children:e.title}),(0,o.jsx)(Ie,{children:e.description||B(e.body)})]}),{namespace:`ui`,label:`Alert`,inputs:[{name:`title`,type:`string`,label:`Title`,required:!0},{name:`description`,type:`string`,label:`Description`},{name:`variant`,type:`enum`,enum:[`default`,`destructive`],defaultValue:`default`,label:`Variant`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`Alert Title`,description:`This is an alert message.`,variant:`default`}}),t.ComponentRegistry.register(`list`,({schema:e,className:t,...n})=>{let r=(0,i.useDataScope)(e.bind),a=Array.isArray(r)?r:Array.isArray(e.items)?e.items:[],s=e.ordered?`ol`:`ul`,c=e.ordered?`list-decimal`:`list-disc`;return(0,o.jsxs)(`div`,{className:z(`space-y-2`,e.wrapperClass),children:[e.title&&(0,o.jsx)(`h3`,{className:`text-lg font-semibold tracking-tight`,children:e.title}),(0,o.jsx)(s,{className:z(`ml-6 [&>li]:mt-2`,c,t),...n,children:a.map((e,t)=>(0,o.jsx)(`li`,{className:z(typeof e==`object`&&e.className),children:typeof e==`string`?e:e.content||B(e.body)},t))})]})},{namespace:`ui`,label:`List`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`ordered`,type:`boolean`,label:`Ordered List (numbered)`,defaultValue:!1},{name:`items`,type:`array`,label:`List Items`,description:`Array of strings or objects with content/body`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{ordered:!1,items:[`First item`,`Second item`,`Third item`],className:`text-sm`}});var Uc=({node:e,onNodeClick:t})=>{let[n,r]=(0,a.useState)(!1),i=e.children&&e.children.length>0;return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsxs)(`div`,{className:z(`group flex items-center py-1.5 px-2 rounded-sm cursor-pointer transition-colors`,`hover:bg-accent hover:text-accent-foreground`,n&&i&&`bg-accent/50`),onClick:()=>{t&&t(e)},children:[i?(0,o.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r(!n)},className:`mr-2 p-0.5 h-5 w-5 flex items-center justify-center rounded-sm hover:bg-muted text-muted-foreground transition-colors`,children:n?(0,o.jsx)(c.ChevronDown,{className:`h-4 w-4`}):(0,o.jsx)(c.ChevronRight,{className:`h-4 w-4`})}):(0,o.jsx)(`span`,{className:`mr-2 w-5 flex justify-center`,children:(0,o.jsx)(`div`,{className:`w-1 h-1 rounded-full bg-muted-foreground/50`})}),e.icon===`folder`||i?n?(0,o.jsx)(c.FolderOpen,{className:`h-4 w-4 mr-2 text-primary`}):(0,o.jsx)(c.Folder,{className:`h-4 w-4 mr-2 text-muted-foreground group-hover:text-primary transition-colors`}):(0,o.jsx)(c.File,{className:`h-4 w-4 mr-2 text-muted-foreground group-hover:text-primary transition-colors`}),(0,o.jsx)(`span`,{className:z(`text-sm transition-colors`,n?`font-medium text-foreground`:`text-muted-foreground group-hover:text-foreground`),children:e.label})]}),i&&n&&(0,o.jsx)(`div`,{className:`relative ml-[11px] pl-3 border-l border-border animate-in slide-in-from-left-2 fade-in duration-200`,children:e.children.map(e=>(0,o.jsx)(Uc,{node:e,onNodeClick:t},e.id))})]})};t.ComponentRegistry.register(`tree-view`,({schema:e,className:t,...n})=>{let r=t=>{e.onNodeClick&&e.onNodeClick(t)},a=(0,i.useDataScope)(e.bind)||e.nodes||e.data||[],s=Array.isArray(a)?a:[];return(0,o.jsxs)(`div`,{className:z(`relative border rounded-lg p-3 bg-card text-card-foreground`,t),...n,children:[e.title&&(0,o.jsx)(`div`,{className:`flex items-center gap-2 mb-3 pb-2 border-b`,children:(0,o.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.title})}),(0,o.jsx)(`div`,{className:`space-y-1`,children:s.map(e=>(0,o.jsx)(Uc,{node:e,onNodeClick:r},e.id))})]})},{namespace:`ui`,label:`Tree View`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`nodes`,type:`array`,label:`Tree Nodes`,description:`Array of { id, label, icon, children, data }`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`File Explorer`,nodes:[{id:`1`,label:`Documents`,icon:`folder`,children:[{id:`1-1`,label:`Resume.pdf`,icon:`file`},{id:`1-2`,label:`Cover Letter.docx`,icon:`file`}]},{id:`2`,label:`Photos`,icon:`folder`,children:[{id:`2-1`,label:`Vacation`,icon:`folder`,children:[{id:`2-1-1`,label:`Beach.jpg`,icon:`file`}]},{id:`2-2`,label:`Family.jpg`,icon:`file`}]},{id:`3`,label:`README.md`,icon:`file`}]}});var Wc=e=>e?Oa(e):null;t.ComponentRegistry.register(`statistic`,({schema:e})=>{let t=e.icon?Wc(e.icon):null;return(0,o.jsxs)(`div`,{className:z(`group relative flex flex-col p-4 sm:p-5 md:p-6 rounded-xl border bg-card text-card-foreground shadow-sm`,e.className),children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[e.label&&(0,o.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),t&&(0,o.jsx)(t,{className:`h-4 w-4 text-muted-foreground`})]}),(0,o.jsx)(`div`,{className:`flex items-baseline gap-2`,children:(0,o.jsx)(`h3`,{className:`text-2xl font-bold tracking-tight`,children:e.value})}),(e.trend||e.description)&&(0,o.jsxs)(`div`,{className:`mt-1 flex items-center text-xs text-muted-foreground`,children:[e.trend===`up`&&(0,o.jsx)(c.TrendingUp,{className:`mr-1 h-3 w-3 text-emerald-500`}),e.trend===`down`&&(0,o.jsx)(c.TrendingDown,{className:`mr-1 h-3 w-3 text-rose-500`}),e.trend===`neutral`&&(0,o.jsx)(c.Minus,{className:`mr-1 h-3 w-3`}),(0,o.jsx)(`span`,{className:z(e.trend===`up`&&`text-emerald-500 font-medium`,e.trend===`down`&&`text-rose-500 font-medium`),children:e.description})]})]})},{namespace:`ui`,label:`Statistic`,category:`data-display`,icon:`Activity`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`value`,type:`string`,label:`Value`},{name:`description`,type:`string`,label:`Description`},{name:`trend`,type:`enum`,enum:[{label:`Up`,value:`up`},{label:`Down`,value:`down`},{label:`Neutral`,value:`neutral`}],label:`Trend`}],defaultProps:{label:`Total Revenue`,value:`$45,231.89`,trend:`up`,description:`+20.1% from last month`}}),t.ComponentRegistry.register(`breadcrumb`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:a,...s}=t;return(0,o.jsx)(Ue,{className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:a,children:(0,o.jsx)(We,{children:e.items?.map((t,n)=>(0,o.jsxs)(`div`,{className:`flex items-center`,children:[(0,o.jsx)(Ge,{children:n===(e.items?.length||0)-1?(0,o.jsx)(qe,{children:(0,i.resolveI18nLabel)(t.label)??``}):(0,o.jsx)(Ke,{href:t.href,children:(0,i.resolveI18nLabel)(t.label)??``})}),n<(e.items?.length||0)-1&&(0,o.jsx)(Je,{})]},n))})})},{namespace:`ui`,label:`Breadcrumb`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{items:[{label:`Home`,href:`/`},{label:`Products`,href:`/products`},{label:`Product`}]}}),t.ComponentRegistry.register(`kbd`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t,s=Array.isArray(e.keys)?e.keys:[e.keys||e.label||`K`];return(0,o.jsx)(`div`,{className:z(`inline-flex flex-wrap gap-1`,e.className),children:s.map((e,t)=>(0,o.jsx)(`kbd`,{className:`pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100`,...a,...t===0?{"data-obj-id":n,"data-obj-type":r,style:i}:{},children:e},t))})},{namespace:`ui`,label:`Keyboard Key`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{label:`K`}}),t.ComponentRegistry.register(`table`,({schema:e,className:t})=>{let n=(0,i.useDataScope)(e.bind)||e.data||e.props?.data||[],r=Array.isArray(e.columns)?e.columns:Array.isArray(e.props?.columns)?e.props.columns:[];if(n&&!Array.isArray(n))return(0,o.jsx)(`div`,{className:`text-red-500 p-2 border border-red-200 bg-red-50 rounded text-sm`,children:`Table data must be an array`});let a=Array.isArray(n)?n:[];return(0,o.jsx)(`div`,{className:z(`rounded-md border`,t),children:(0,o.jsxs)(Wi,{children:[(0,o.jsx)(Gi,{children:(0,o.jsx)(Ji,{children:r.map((e,t)=>(0,o.jsx)(Yi,{children:e.label||e.header},e.key||e.accessorKey||t))})}),(0,o.jsx)(Ki,{children:a.length===0?(0,o.jsx)(Ji,{children:(0,o.jsx)(Xi,{colSpan:r.length,className:`h-24 text-center`,children:`No results.`})}):a.map((e,t)=>(0,o.jsx)(Ji,{children:r.map((t,n)=>{let r=t.key||t.accessorKey||``,i=r?e[r]:``;return(0,o.jsx)(Xi,{children:typeof i==`object`&&i?String(i):i},t.key||t.accessorKey||n)})},e.id||t))})]})})},{namespace:`ui`}),t.ComponentRegistry.register(`progress`,({schema:e,className:t,...n})=>(0,o.jsx)(Ar,{value:e.value,className:t,...n}),{namespace:`ui`,label:`Progress`,inputs:[{name:`value`,type:`number`,label:`Value`,defaultValue:0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{value:50,className:`w-full`}}),t.ComponentRegistry.register(`skeleton`,({schema:e,className:t,...n})=>(0,o.jsx)(X,{className:t,...n,style:{width:e.width,height:e.height}}),{namespace:`ui`,label:`Skeleton`,inputs:[{name:`width`,type:`string`,label:`Width`},{name:`height`,type:`string`,label:`Height`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{width:`100%`,height:`20px`,className:`rounded-md`}}),t.ComponentRegistry.register(`toaster`,()=>(0,o.jsx)(Hi,{}),{namespace:`ui`,label:`Toaster`,inputs:[],defaultProps:{}}),t.ComponentRegistry.register(`loading`,({schema:e,className:t,...n})=>{let r=e.size||`md`,i=e.fullscreen||!1,a=(0,o.jsxs)(`div`,{className:z(`flex flex-col items-center justify-center gap-2`,t),children:[(0,o.jsx)(Ts,{className:z(r===`sm`&&`h-4 w-4`,r===`md`&&`h-8 w-8`,r===`lg`&&`h-12 w-12`,r===`xl`&&`h-16 w-16`)}),e.text&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.text})]});return i?(0,o.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,...n,children:a}):(0,o.jsx)(`div`,{className:`flex items-center justify-center p-8`,...n,children:a})},{namespace:`ui`,label:`Loading`,inputs:[{name:`text`,type:`string`,label:`Loading Text`},{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`],label:`Size`,defaultValue:`md`},{name:`fullscreen`,type:`boolean`,label:`Fullscreen Overlay`,defaultValue:!1},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{text:`Loading...`,size:`md`,fullscreen:!1}}),t.ComponentRegistry.register(`toast`,({schema:e})=>(0,o.jsx)(V,{onClick:()=>{(e.variant===`success`?P.toast.success:e.variant===`error`?P.toast.error:e.variant===`warning`?P.toast.warning:e.variant===`info`?P.toast.info:P.toast)(e.title||`Notification`,{description:e.description,duration:e.duration})},variant:e.buttonVariant,className:e.className,children:e.buttonLabel||`Show Toast`}),{namespace:`ui`,label:`Toast`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`variant`,type:`enum`,enum:[`default`,`success`,`warning`,`error`,`info`],defaultValue:`default`,label:`Variant`},{name:`duration`,type:`number`,label:`Duration (ms)`},{name:`buttonLabel`,type:`string`,label:`Button Label`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`Notification`,buttonLabel:`Show Toast`,variant:`default`,duration:5e3}}),t.ComponentRegistry.register(`spinner`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(c.Loader2,{className:z(`animate-spin`,{sm:`h-4 w-4`,md:`h-6 w-6`,lg:`h-8 w-8`,xl:`h-12 w-12`}[e.size||`md`],e.className),...a,"data-obj-id":n,"data-obj-type":r,style:i})},{namespace:`ui`,label:`Spinner`,inputs:[{name:`size`,type:`enum`,enum:[`sm`,`md`,`lg`,`xl`],defaultValue:`md`,label:`Size`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{size:`md`}}),t.ComponentRegistry.register(`empty`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:a,action:s,icon:c,...l}=t,u=e.action,d=u&&typeof u==`object`?(0,o.jsx)(i.SchemaRenderer,{schema:u}):void 0;return(0,o.jsx)(Ws,{title:e.title||`No data`,description:e.description,className:e.className,action:d,...l,"data-obj-id":n,"data-obj-type":r,style:a})},{namespace:`ui`,label:`Empty`,inputs:[{name:`title`,type:`string`,label:`Title`,defaultValue:`No data`},{name:`description`,type:`string`,label:`Description`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{title:`No data`}}),t.ComponentRegistry.register(`sonner`,({schema:e,...t})=>(0,o.jsx)(V,{onClick:()=>{(e.variant===`success`?P.toast.success:e.variant===`error`?P.toast.error:e.variant===`warning`?P.toast.warning:e.variant===`info`?P.toast.info:P.toast)(e.message||e.title||`Notification`,{description:e.description})},variant:e.buttonVariant,className:e.className,...t,children:e.buttonLabel||`Show Toast`}),{namespace:`ui`,label:`Sonner Toast`,inputs:[{name:`message`,type:`string`,label:`Message`},{name:`description`,type:`string`,label:`Description`},{name:`variant`,type:`enum`,enum:[`default`,`success`,`error`,`warning`,`info`],defaultValue:`default`,label:`Variant`},{name:`buttonLabel`,type:`string`,label:`Button Label`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{message:`Notification`,buttonLabel:`Show Toast`,variant:`default`}}),t.ComponentRegistry.register(`dialog`,({schema:e,className:t,...n})=>(0,o.jsxs)(Tt,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(Et,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(At,{className:t,children:[(0,o.jsxs)(jt,{children:[e.title&&(0,o.jsx)(Nt,{children:e.title}),e.description&&(0,o.jsx)(Pt,{children:e.description})]}),B(e.content),e.footer&&(0,o.jsx)(Mt,{children:B(e.footer)})]})]}),{namespace:`ui`,label:`Dialog`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`modal`,type:`boolean`,label:`Modal`,defaultValue:!0},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`trigger`,type:`slot`,label:`Trigger`,description:`Element that opens the dialog`},{name:`content`,type:`slot`,label:`Content`,description:`Main content of the dialog`},{name:`footer`,type:`slot`,label:`Footer`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{title:`Dialog Title`,description:`Dialog description goes here`,modal:!0,trigger:[{type:`button`,label:`Open Dialog`}],content:[{type:`text`,content:`Dialog content goes here`}]}}),t.ComponentRegistry.register(`sheet`,({schema:e,className:t,...n})=>(0,o.jsxs)(Kr,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(qr,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(Qr,{side:e.side||`right`,className:t,children:[(0,o.jsxs)($r,{children:[e.title&&(0,o.jsx)(ti,{children:e.title}),e.description&&(0,o.jsx)(ni,{children:e.description})]}),B(e.content),e.footer&&(0,o.jsx)(ei,{children:B(e.footer)})]})]}),{namespace:`ui`,label:`Sheet`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],defaultValue:`right`,label:`Side`},{name:`modal`,type:`boolean`,label:`Modal`,defaultValue:!0},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`footer`,type:`slot`,label:`Footer`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{title:`Sheet Title`,description:`Sheet description`,side:`right`,modal:!0,trigger:[{type:`button`,label:`Open Sheet`}],content:[{type:`text`,content:`Sheet content goes here`}]}}),t.ComponentRegistry.register(`popover`,({schema:e,className:t,...n})=>(0,o.jsxs)(Dr,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(Or,{asChild:!0,children:B(e.trigger)}),(0,o.jsx)(kr,{align:e.align,side:e.side,className:t,children:B(e.content)})]}),{namespace:`ui`,label:`Popover`,inputs:[{name:`modal`,type:`boolean`,label:`Modal`},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`],label:`Align`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],label:`Side`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Open Popover`,variant:`outline`}],content:[{type:`text`,content:`Popover content goes here`}],align:`center`,side:`bottom`}}),t.ComponentRegistry.register(`tooltip`,({schema:e,className:t,...n})=>(0,o.jsx)(ai,{delayDuration:e.delayDuration,children:(0,o.jsxs)(oi,{...n,children:[(0,o.jsx)(si,{asChild:!0,children:B(e.trigger)}),(0,o.jsx)(ci,{side:e.side,align:e.align,className:t,children:e.content||B(e.body)})]})}),{namespace:`ui`,label:`Tooltip`,inputs:[{name:`delayDuration`,type:`number`,label:`Delay Duration`,defaultValue:700},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],label:`Side`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`],label:`Align`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`string`,label:`Content Text`},{name:`body`,type:`slot`,label:`Rich Content`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Hover me`,variant:`outline`}],content:`Tooltip content`,delayDuration:700,side:`top`}}),t.ComponentRegistry.register(`alert-dialog`,({schema:e,className:t,...n})=>(0,o.jsxs)(H,{defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(Te,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(Oe,{className:t,children:[(0,o.jsxs)(ke,{children:[e.title&&(0,o.jsx)(je,{children:e.title}),e.description&&(0,o.jsx)(Me,{children:e.description})]}),B(e.content),(0,o.jsxs)(Ae,{children:[e.cancelText&&(0,o.jsx)(Pe,{children:e.cancelText}),e.actionText&&(0,o.jsx)(Ne,{onClick:e.onAction,children:e.actionText})]})]})]}),{namespace:`ui`,label:`Alert Dialog`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`cancelText`,type:`string`,label:`Cancel Text`,defaultValue:`Cancel`},{name:`actionText`,type:`string`,label:`Action Text`,defaultValue:`Continue`},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content/Body`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{title:`Are you sure?`,description:`This action cannot be undone.`,cancelText:`Cancel`,actionText:`Continue`,trigger:[{type:`button`,label:`Open Alert`,variant:`destructive`}]}}),t.ComponentRegistry.register(`drawer`,({schema:e,className:t,...n})=>(0,o.jsxs)(on,{shouldScaleBackground:e.shouldScaleBackground,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(sn,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(dn,{className:t,children:[(0,o.jsxs)(fn,{children:[e.title&&(0,o.jsx)(mn,{children:e.title}),e.description&&(0,o.jsx)(hn,{children:e.description})]}),B(e.content),e.footer&&(0,o.jsxs)(pn,{children:[B(e.footer),e.showClose&&(0,o.jsx)(ln,{asChild:!0,children:(0,o.jsx)(`button`,{children:`Close`})})]})]})]}),{namespace:`ui`,label:`Drawer`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`shouldScaleBackground`,type:`boolean`,label:`Scale Background`},{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`showClose`,type:`boolean`,label:`Show Close Button in Footer`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`footer`,type:`slot`,label:`Footer`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{title:`Drawer Title`,description:`Drawer description`,trigger:[{type:`button`,label:`Open Drawer`}],content:[{type:`text`,content:`Drawer content goes here`}]}}),t.ComponentRegistry.register(`hover-card`,({schema:e,className:t,...n})=>(0,o.jsxs)(Hn,{openDelay:e.openDelay,closeDelay:e.closeDelay,...n,children:[(0,o.jsx)(Un,{asChild:!0,children:B(e.trigger)}),(0,o.jsx)(Wn,{align:e.align,side:e.side,className:t,children:B(e.content)})]}),{namespace:`ui`,label:`Hover Card`,inputs:[{name:`openDelay`,type:`number`,label:`Open Delay`},{name:`closeDelay`,type:`number`,label:`Close Delay`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],label:`Side`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`],label:`Align`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Hover me`,variant:`link`}],content:[{type:`text`,content:`Hover card content appears on hover`}],side:`top`}});var Gc=e=>e?e.map((e,t)=>e.type===`separator`?(0,o.jsx)(kn,{},t):e.type===`label`?(0,o.jsx)(On,{children:e.label},t):e.children?(0,o.jsxs)(bn,{children:[(0,o.jsxs)(Sn,{inset:e.inset,children:[e.icon&&(0,o.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}),(0,o.jsx)(Cn,{children:Gc(e.children)})]},t):(0,o.jsxs)(Tn,{disabled:e.disabled,inset:e.inset,onSelect:e.onSelect,children:[e.icon&&(0,o.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label,e.shortcut&&(0,o.jsx)(`span`,{className:`ml-auto text-xs tracking-widest opacity-60`,children:e.shortcut})]},t)):null;t.ComponentRegistry.register(`dropdown-menu`,({schema:e,className:t,...n})=>(0,o.jsxs)(gn,{modal:e.modal,defaultOpen:e.defaultOpen,...n,children:[(0,o.jsx)(_n,{asChild:!0,children:B(e.trigger)}),(0,o.jsxs)(wn,{align:e.align,side:e.side,className:t,children:[e.label&&(0,o.jsx)(On,{children:e.label}),e.label&&(0,o.jsx)(kn,{}),Gc(e.items)]})]}),{namespace:`ui`,label:`Dropdown Menu`,inputs:[{name:`label`,type:`string`,label:`Menu Label`},{name:`side`,type:`enum`,enum:[`top`,`right`,`bottom`,`left`],label:`Side`},{name:`align`,type:`enum`,enum:[`start`,`center`,`end`],label:`Align`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`items`,type:`array`,label:`Items`,description:`Recursive structure: { type?: "separator"|"label", label, icon, shortcut, disabled, children: [] }`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Menu`,variant:`outline`}],items:[{label:`Item 1`},{label:`Item 2`},{type:`separator`},{label:`Item 3`}],align:`start`,side:`bottom`}});var Kc=e=>e?e.map((e,t)=>e.type===`separator`?(0,o.jsx)(rn,{},t):e.type===`label`?(0,o.jsx)(nn,{children:e.label},t):e.children?(0,o.jsxs)(Jt,{children:[(0,o.jsx)(Xt,{inset:e.inset,children:e.label}),(0,o.jsx)(Zt,{children:Kc(e.children)})]},t):(0,o.jsxs)($t,{disabled:e.disabled,inset:e.inset,onSelect:e.onSelect,children:[e.label,e.shortcut&&(0,o.jsx)(an,{children:e.shortcut})]},t)):null;t.ComponentRegistry.register(`context-menu`,({schema:e,className:t,...n})=>{let r=e.triggerClassName||t||e.className||`h-[120px] w-full sm:h-[150px] sm:w-[300px] border border-dashed text-sm flex items-center justify-center`,i=e.contentClassName;return(0,o.jsxs)(Wt,{modal:e.modal,...n,children:[(0,o.jsx)(Gt,{asChild:!0,children:(0,o.jsx)(`div`,{className:r,children:B(e.trigger||{type:`text`,value:`Right click here`})})}),(0,o.jsx)(Qt,{className:i,children:Kc(e.items)})]})},{namespace:`ui`,label:`Context Menu`,inputs:[{name:`trigger`,type:`slot`,label:`Trigger Area`},{name:`triggerClassName`,type:`string`,label:`Trigger Area Class`},{name:`items`,type:`array`,label:`Items`,description:`Recursive structure: { type?: "separator"|"label", label, shortcut, children }`},{name:`className`,type:`string`,label:`Content CSS Class`}],defaultProps:{items:[{label:`Action 1`},{label:`Action 2`},{type:`separator`},{label:`Action 3`}],trigger:[{type:`text`,content:`Right click here`}]}}),t.ComponentRegistry.register(`menubar`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,...a}=t;return(0,o.jsx)(er,{className:e.className,...a,"data-obj-id":n,"data-obj-type":r,style:i,children:e.menus?.map((e,t)=>(0,o.jsxs)(Yn,{children:[(0,o.jsx)(tr,{children:e.label}),(0,o.jsx)(ir,{children:e.items?.map((e,t)=>e.separator?(0,o.jsx)(lr,{},t):e.children?(0,o.jsxs)($n,{children:[(0,o.jsx)(nr,{children:e.label}),(0,o.jsx)(rr,{children:e.children.map((e,t)=>(0,o.jsx)(ar,{children:e.label},t))})]},t):(0,o.jsx)(ar,{disabled:e.disabled,children:e.label},t))})]},t))})},{namespace:`ui`,label:`Menubar`,inputs:[{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{menus:[{label:`File`,items:[{label:`New`},{label:`Open`},{separator:!0},{label:`Exit`}]}]}}),t.ComponentRegistry.register(`accordion`,({schema:e,className:t,...n})=>(0,o.jsx)(be,{type:e.accordionType||`single`,collapsible:e.collapsible,className:t,...n,children:e.items?.map((e,t)=>(0,o.jsxs)(xe,{value:e.value||`item-${t}`,children:[(0,o.jsx)(Se,{children:e.title}),(0,o.jsx)(Ce,{children:B(e.content)})]},e.value||t))}),{namespace:`ui`,label:`Accordion`,inputs:[{name:`accordionType`,type:`enum`,enum:[`single`,`multiple`],defaultValue:`single`,label:`Type`},{name:`collapsible`,type:`boolean`,label:`Collapsible (for single type)`},{name:`items`,type:`array`,label:`Items`,description:`Array of { trigger, content, value }`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{accordionType:`single`,collapsible:!0,items:[{label:`Item 1`,value:`item-1`,content:[{type:`text`,content:`Content for item 1`}]},{label:`Item 2`,value:`item-2`,content:[{type:`text`,content:`Content for item 2`}]},{label:`Item 3`,value:`item-3`,content:[{type:`text`,content:`Content for item 3`}]}],className:`w-full`}}),t.ComponentRegistry.register(`collapsible`,({schema:e,className:t,...n})=>(0,o.jsxs)(St,{defaultOpen:e.defaultOpen,disabled:e.disabled,className:t,...n,children:[(0,o.jsx)(Ct,{asChild:!0,children:B(e.trigger)}),(0,o.jsx)(wt,{children:B(e.content)})]}),{namespace:`ui`,label:`Collapsible`,inputs:[{name:`defaultOpen`,type:`boolean`,label:`Default Open`},{name:`disabled`,type:`boolean`,label:`Disabled`},{name:`trigger`,type:`slot`,label:`Trigger`},{name:`content`,type:`slot`,label:`Content`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{trigger:[{type:`button`,label:`Toggle`,variant:`outline`}],content:[{type:`text`,content:`Collapsible content goes here`}],className:`w-full`}}),t.ComponentRegistry.register(`toggle-group`,({schema:e,...t})=>{let{"data-obj-id":n,"data-obj-type":r,style:i,type:a,...s}=t;return(0,o.jsx)(oa,{type:e.selectionType||`single`,variant:e.variant,size:e.size,value:e.value,className:e.className,...s,"data-obj-id":n,"data-obj-type":r,style:i,children:e.items?.map((e,t)=>(0,o.jsx)(sa,{value:e.value,"aria-label":e.label,children:e.label},t))})},{namespace:`ui`,label:`Toggle Group`,inputs:[{name:`selectionType`,type:`enum`,enum:[`single`,`multiple`],defaultValue:`single`,label:`Selection Type`},{name:`variant`,type:`enum`,enum:[`default`,`outline`],defaultValue:`default`,label:`Variant`},{name:`size`,type:`enum`,enum:[`default`,`sm`,`lg`],defaultValue:`default`,label:`Size`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{selectionType:`single`,variant:`default`,size:`default`,items:[{value:`bold`,label:`Bold`},{value:`italic`,label:`Italic`},{value:`underline`,label:`Underline`}]}}),t.ComponentRegistry.register(`carousel`,({schema:e,className:t,...n})=>(0,o.jsxs)(ot,{opts:e.opts,orientation:e.orientation||`horizontal`,className:t,...n,children:[(0,o.jsx)(st,{children:e.items?.map((t,n)=>(0,o.jsx)(ct,{className:e.itemClassName,children:B(t)},n))}),e.showArrows&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(lt,{}),(0,o.jsx)(ut,{})]})]}),{namespace:`ui`,label:`Carousel`,inputs:[{name:`orientation`,type:`enum`,enum:[`horizontal`,`vertical`],defaultValue:`horizontal`,label:`Orientation`},{name:`showArrows`,type:`boolean`,label:`Show Arrows`,defaultValue:!0},{name:`items`,type:`array`,label:`Items`,description:`Array of content schemas`},{name:`itemClassName`,type:`string`,label:`Item CSS Class`},{name:`className`,type:`string`,label:`Container CSS Class`}],defaultProps:{orientation:`horizontal`,showArrows:!0,items:[[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,body:[{type:`text`,content:`Slide 1`}]}],[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,body:[{type:`text`,content:`Slide 2`}]}],[{type:`div`,className:`p-4 sm:p-6 md:p-8 border rounded bg-slate-50`,body:[{type:`text`,content:`Slide 3`}]}]],className:`w-full max-w-xs`}}),t.ComponentRegistry.register(`filter-builder`,({schema:e,className:t,onChange:n,...r})=>(0,o.jsxs)(`div`,{className:e.wrapperClass||``,children:[e.label&&(0,o.jsx)(`label`,{className:`text-sm font-medium mb-2 block`,children:e.label}),(0,o.jsx)(Ro,{fields:e.fields||[],value:e.value||r.value,onChange:t=>{n&&n({target:{name:e.name,value:t}})},className:t,...r})]}),{namespace:`ui`,label:`Filter Builder`,inputs:[{name:`label`,type:`string`,label:`Label`},{name:`name`,type:`string`,label:`Name`,required:!0},{name:`fields`,type:`array`,label:`Fields`,description:`Array of { value: string, label: string, type?: string } objects`,required:!0},{name:`value`,type:`object`,label:`Initial Value`,description:`FilterGroup object with conditions`}],defaultProps:{label:`Filters`,name:`filters`,fields:[{value:`name`,label:`Name`,type:`text`},{value:`email`,label:`Email`,type:`text`},{value:`age`,label:`Age`,type:`number`},{value:`status`,label:`Status`,type:`text`}],value:{id:`root`,logic:`and`,conditions:[]}}}),t.ComponentRegistry.register(`scroll-area`,({schema:e,className:t,...n})=>{let{"data-obj-id":r,"data-obj-type":i,style:a,...s}=n,c=e.orientation||`vertical`;return(0,o.jsxs)(Ir,{className:t,style:{height:e.height,width:e.width,...a},...s,"data-obj-id":r,"data-obj-type":i,children:[B(e.children),(c===`horizontal`||c===`both`)&&(0,o.jsx)(Lr,{orientation:`horizontal`}),(c===`vertical`||c===`both`)&&(0,o.jsx)(Lr,{orientation:`vertical`})]})},{namespace:`ui`,label:`Scroll Area`,inputs:[{name:`height`,type:`string`,label:`Height (e.g. 200px)`},{name:`width`,type:`string`,label:`Width`},{name:`orientation`,type:`enum`,enum:[`vertical`,`horizontal`,`both`],defaultValue:`vertical`,label:`Orientation`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{height:`200px`,width:`100%`,orientation:`vertical`,children:[{type:`div`,className:`p-4`,body:[{type:`text`,content:`Scrollable content goes here. Add more content to see scrolling behavior.`}]}],className:`rounded-md border`}}),t.ComponentRegistry.register(`resizable`,({schema:e,className:t,...n})=>{let r=Array.isArray(e.panels)?e.panels:[];return(0,o.jsx)(Nr,{orientation:e.direction||`horizontal`,className:t,...n,style:{minHeight:e.minHeight||`200px`},children:r.map((t,n)=>(0,o.jsxs)(a.default.Fragment,{children:[(0,o.jsx)(Pr,{defaultSize:t.defaultSize,minSize:t.minSize,maxSize:t.maxSize,children:B(t.content)}),n<r.length-1&&(0,o.jsx)(Fr,{withHandle:e.withHandle})]},n))})},{namespace:`ui`,label:`Resizable Panel Group`,inputs:[{name:`direction`,type:`enum`,enum:[`horizontal`,`vertical`],defaultValue:`horizontal`,label:`Direction`},{name:`minHeight`,type:`string`,label:`Min Height`},{name:`withHandle`,type:`boolean`,label:`Show Handle Icon`,defaultValue:!0},{name:`panels`,type:`array`,label:`Panels`,description:`Array of { defaultSize, minSize, maxSize, content }`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{direction:`horizontal`,minHeight:`200px`,withHandle:!0,panels:[{defaultSize:50,content:[{type:`div`,className:`p-4`,body:[{type:`text`,content:`Panel 1`}]}]},{defaultSize:50,content:[{type:`div`,className:`p-4`,body:[{type:`text`,content:`Panel 2`}]}]}],className:`rounded-lg border`}}),t.ComponentRegistry.register(`table`,({schema:e,className:t,...n})=>(0,o.jsxs)(Wi,{className:t,...n,children:[e.caption&&(0,o.jsx)(Zi,{children:e.caption}),(0,o.jsx)(Gi,{children:(0,o.jsx)(Ji,{children:e.columns?.map((e,t)=>(0,o.jsx)(Yi,{className:e.className,style:{width:e.width},children:e.header||e.label},t))})}),(0,o.jsx)(Ki,{children:e.data?.map((t,n)=>(0,o.jsx)(Ji,{children:e.columns?.map((e,n)=>(0,o.jsx)(Xi,{className:e.cellClassName,children:t[e.accessorKey||e.name]},n))},n))}),e.footer&&(0,o.jsx)(qi,{children:(0,o.jsx)(Ji,{children:(0,o.jsx)(Xi,{colSpan:e.columns?.length,children:typeof e.footer==`string`?e.footer:B(e.footer)})})})]}),{namespace:`ui`,label:`Table`,inputs:[{name:`caption`,type:`string`,label:`Caption`},{name:`footer`,type:`string`,label:`Footer Content`},{name:`columns`,type:`array`,label:`Columns`,description:`Array of { header, accessorKey, className, width }`},{name:`data`,type:`array`,label:`Data`,description:`Array of objects`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{caption:`Table Caption`,columns:[{header:`Column 1`,accessorKey:`col1`},{header:`Column 2`,accessorKey:`col2`},{header:`Column 3`,accessorKey:`col3`}],data:[{col1:`Row 1, Col 1`,col2:`Row 1, Col 2`,col3:`Row 1, Col 3`},{col1:`Row 2, Col 1`,col2:`Row 2, Col 2`,col3:`Row 2, Col 3`},{col1:`Row 3, Col 1`,col2:`Row 3, Col 2`,col3:`Row 3, Col 3`}]}});var qc={"table.rowsPerPage":`Rows per page`,"table.pageInfo":`Page {{current}} of {{total}}`,"table.totalRecords":`{{count}} total`,"table.noResults":`No results found`,"table.noResultsHint":`Try adjusting your filters or search query.`,"table.sortAsc":`Sort ascending`,"table.sortDesc":`Sort descending`,"table.hideColumn":`Hide column`,"table.cancelAll":`Cancel All`,"table.saveAll":`Save All ({{count}})`,"table.exportCSV":`Export CSV`,"table.addRecord":`Add record`,"table.open":`Open`,"table.search":`Search...`,"table.modified":`{{count}} row modified`,"table.selected":`{{count}} selected`,"table.edit":`Edit`,"table.delete":`Delete`,"common.actions":`Actions`};function Jc(){try{let e=(0,i.useObjectTranslation)();return e.t(`table.rowsPerPage`)===`table.rowsPerPage`?{t:(e,t)=>{let n=qc[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n},language:e.language||`en`}:{t:e.t,language:e.language||`en`}}catch{return{t:(e,t)=>{let n=qc[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n},language:`en`}}}t.ComponentRegistry.register(`data-table`,({schema:e})=>{let{caption:n,columns:r=[],data:i=[],pagination:s=!0,pageSize:l=10,manualPagination:u=!1,rowCount:d,page:f,onPageChange:p,onPageSizeChange:m,searchable:h=!0,selectable:g=!1,sortable:_=!0,exportable:v=!1,rowActions:y=!1,resizableColumns:b=!0,reorderableColumns:x=!0,editable:S=!1,singleClickEdit:C=!1,selectionStyle:w=`always`,rowClassName:T,rowStyle:E,className:D,cellClassName:O,frozenColumns:k=0,showRowNumbers:A=!1,showAddRow:j=!1,borderless:ee=!1,disableInnerScroll:te=!1}=e,{t:M,language:N}=Jc(),ne=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,re=a.default.useCallback(e=>{if(typeof e!=`string`||e.length<8||!ne.test(e))return e;let t=Date.parse(e);if(Number.isNaN(t))return e;let n=e.includes(`T`);try{return new Intl.DateTimeFormat(N,n?{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}:{year:`numeric`,month:`short`,day:`numeric`}).format(new Date(t))}catch{return e}},[N]),ie=Array.isArray(i)?i:[],ae=(0,a.useMemo)(()=>r.map(e=>({...e,header:e.header||e.label,accessorKey:e.accessorKey||e.name})),[r]),P=(0,a.useMemo)(()=>{let e={},t=r.map(e=>({header:e.header||e.label,accessorKey:e.accessorKey||e.name,width:e.width}));for(let n of t){if(n.width)continue;let t=(n.header||``).length,r=ie.slice(0,50);for(let e of r){let r=e[n.accessorKey],i=r==null?0:String(r).length;i>t&&(t=i)}e[n.accessorKey]=Math.min(400,Math.max(80,t*8+48))}return e},[r,ie]),[oe,se]=(0,a.useState)(``),[ce,le]=(0,a.useState)(null),[F,ue]=(0,a.useState)(null),[de,fe]=(0,a.useState)(new Set),[pe,me]=(0,a.useState)(1),[I,he]=(0,a.useState)(l),[L,ge]=(0,a.useState)(ae),[_e,R]=(0,a.useState)({}),[B,ve]=(0,a.useState)(null),[ye,be]=(0,a.useState)(null),[xe,Se]=(0,a.useState)(null),[Ce,we]=(0,a.useState)(``),[H,Te]=(0,a.useState)(new Map),[Ee,De]=(0,a.useState)(!1),[Oe,ke]=(0,a.useState)(null),Ae=(0,a.useRef)(null),je=(0,a.useRef)(0),Me=(0,a.useRef)(0),Ne=(0,a.useRef)(null);(0,a.useEffect)(()=>{ge(ae)},[ae]);let Pe=(0,a.useMemo)(()=>oe?ie.filter(e=>L.some(t=>e[t.accessorKey]?.toString().toLowerCase().includes(oe.toLowerCase()))):ie,[ie,oe,L]),U=(0,a.useMemo)(()=>!ce||!F?Pe:[...Pe].sort((e,t)=>{let n=e[ce],r=t[ce];if(n===r)return 0;let i=n<r?-1:1;return F===`asc`?i:-i}),[Pe,ce,F]),W=u?Math.max(1,f??1):pe,Fe=u?Math.max(1,Math.ceil((d??U.length)/I)):Math.ceil(U.length/I),Ie=s&&!u?U.slice((pe-1)*I,pe*I):U,Le=e=>{let t=Math.min(Fe,Math.max(1,e));u?p?.(t):me(t)},Re=e=>{he(e),u?(m?.(e),p?.(1)):me(1)},ze=(e,t)=>e.id===void 0?`row-${t}`:e.id,Be=e=>{_&&(ce===e?F===`asc`?ue(`desc`):F===`desc`&&(ue(null),le(null)):(le(e),ue(`asc`)))},Ve=(e,t)=>{e.preventDefault(),ke({x:e.clientX,y:e.clientY,columnKey:t})},He=e=>{ge(t=>t.filter(t=>t.accessorKey!==e)),ke(null)};(0,a.useEffect)(()=>{if(!Oe)return;let e=()=>ke(null);return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[Oe]);let Ue=t=>{let n=new Set;if(t&&Ie.forEach((e,t)=>{let r=ze(e,(W-1)*I+t);n.add(r)}),fe(n),e.onSelectionChange){let t=U.filter((e,t)=>{let r=ze(e,t);return n.has(r)});e.onSelectionChange(t)}},We=(t,n)=>{let r=new Set(de);if(n?r.add(t):r.delete(t),fe(r),e.onSelectionChange){let t=U.filter((e,t)=>{let n=ze(e,t);return r.has(n)});e.onSelectionChange(t)}},Ge=()=>{let e=[L.map(e=>e.header).join(`,`),...U.map(e=>L.map(t=>JSON.stringify(e[t.accessorKey]||``)).join(`,`))].join(`
|
|
19
|
+
`),t=new Blob([e],{type:`text/csv`}),n=window.URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`table-export.csv`,r.click(),window.URL.revokeObjectURL(n)},Ke=e=>ce===e?F===`asc`?(0,o.jsx)(c.ChevronUp,{className:`h-3 w-3 ml-0.5 text-primary`}):(0,o.jsx)(c.ChevronDown,{className:`h-3 w-3 ml-0.5 text-primary`}):(0,o.jsx)(c.ChevronsUpDown,{className:`h-3 w-3 ml-0.5 opacity-0 group-hover:opacity-50 transition-opacity`}),qe=(e,t)=>{if(!b)return;e.preventDefault(),e.stopPropagation(),Ae.current=t,je.current=e.clientX;let n=e.target.closest(`th`);n&&(Me.current=n.offsetWidth),document.addEventListener(`mousemove`,Je),document.addEventListener(`mouseup`,Ye)},Je=e=>{if(!Ae.current)return;let t=e.clientX-je.current,n=Math.max(50,Me.current+t);R(e=>({...e,[Ae.current]:n}))},Ye=()=>{Ae.current=null,document.removeEventListener(`mousemove`,Je),document.removeEventListener(`mouseup`,Ye)},Xe=(e,t)=>{x&&(ve(t),e.dataTransfer.effectAllowed=`move`)},Ze=(e,t)=>{x&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,be(t))},Qe=(t,n)=>{if(!x||B===null)return;if(t.preventDefault(),B===n){ve(null),be(null);return}let r=[...L],[i]=r.splice(B,1);r.splice(n,0,i),ge(r),ve(null),be(null),e.onColumnsReorder&&e.onColumnsReorder(r)},$e=()=>{ve(null),be(null)},et=(e,t)=>{if(!S||L.find(e=>e.accessorKey===t)?.editable===!1)return;Se({rowIndex:e,columnKey:t});let n=H.get(e),r=Ie[e][t];we(n?.[t]??r??``)},tt=(t=!1)=>{if(!xe||!t&&xe===null)return;let{rowIndex:n,columnKey:r}=xe,i=(W-1)*I+n,a=U[u?n:i],o=new Map(H),s=o.get(n)||{};s[r]=Ce,o.set(n,s),Te(o),e.onCellChange&&e.onCellChange(i,r,Ce,a),Se(null),we(``)},nt=()=>{Se(null),we(``)},rt=async t=>{let n=(W-1)*I+t,r=U[u?t:n],i=H.get(t);if(!(!i||Object.keys(i).length===0)){De(!0);try{e.onRowSave&&await e.onRowSave(n,i,r);let a=new Map(H);a.delete(t),Te(a)}catch(e){console.error(`Failed to save row:`,e)}finally{De(!1)}}},it=e=>{let t=new Map(H);t.delete(e),Te(t)},at=async()=>{if(H.size!==0){De(!0);try{let t=Array.from(H.entries()).map(([e,t])=>{let n=(W-1)*I+e;return{rowIndex:n,changes:t,row:U[u?e:n]}});e.onBatchSave&&await e.onBatchSave(t),Te(new Map)}catch(e){console.error(`Failed to save batch:`,e)}finally{De(!1)}}},ot=()=>{Te(new Map)},st=(e,t,n)=>{if((e.ctrlKey||e.metaKey)&&e.key===`c`&&!xe){e.preventDefault();let r=(W-1)*I+t,i=U[u?t:r];if(i){let e=i[n],t=e==null?``:String(e);navigator.clipboard.writeText(t).catch(()=>{})}return}S&&L.find(e=>e.accessorKey===n)?.editable!==!1&&e.key===`Enter`&&!xe&&(e.preventDefault(),et(t,n))},ct=e=>{e.key===`Enter`?(e.preventDefault(),tt(!0)):e.key===`Escape`&&(e.preventDefault(),nt())};(0,a.useEffect)(()=>{xe&&Ne.current&&(Ne.current.focus(),Ne.current.select())},[xe]),(0,a.useEffect)(()=>()=>{document.removeEventListener(`mousemove`,Je),document.removeEventListener(`mouseup`,Ye)},[]);let lt=Ie.length>0&&Ie.every((e,t)=>{let n=ze(e,(W-1)*I+t);return de.has(n)}),ut=Ie.some((e,t)=>{let n=ze(e,(W-1)*I+t);return de.has(n)})&&!lt,dt=H.size>0,ft=h||v||g&&de.size>0||dt;return(0,o.jsxs)(`div`,{className:`flex flex-col h-full gap-2 sm:gap-4 ${D||``}`,children:[ft&&(0,o.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-4 flex-none`,children:[(0,o.jsx)(`div`,{className:`flex items-center gap-2 flex-1`,children:h&&(0,o.jsxs)(`div`,{className:`relative w-full sm:max-w-sm flex-1`,children:[(0,o.jsx)(c.Search,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,o.jsx)(K,{placeholder:M(`table.search`),value:oe,onChange:e=>{se(e.target.value),me(1)},className:`pl-8`})]})}),(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[dt&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:M(`table.modified`,{count:H.size})}),(0,o.jsxs)(V,{variant:`outline`,size:`sm`,onClick:ot,disabled:Ee,children:[(0,o.jsx)(c.X,{className:`h-4 w-4 mr-2`}),M(`table.cancelAll`)]}),(0,o.jsxs)(V,{variant:`default`,size:`sm`,onClick:at,disabled:Ee,children:[(0,o.jsx)(c.Save,{className:`h-4 w-4 mr-2`}),M(`table.saveAll`,{count:H.size})]})]}),v&&(0,o.jsxs)(V,{variant:`outline`,size:`sm`,onClick:Ge,disabled:U.length===0,children:[(0,o.jsx)(c.Download,{className:`h-4 w-4 mr-2`}),M(`table.exportCSV`)]}),g&&de.size>0&&(0,o.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:M(`table.selected`,{count:de.size})})]})]}),(0,o.jsx)(`div`,{className:z(`relative bg-background`,te?`overflow-visible`:`flex-1 min-h-0 overflow-auto [-webkit-overflow-scrolling:touch]`,!ee&&`rounded-md border shadow-[inset_-8px_0_8px_-8px_rgba(0,0,0,0.08)]`),children:(0,o.jsxs)(Wi,{children:[n&&(0,o.jsx)(Zi,{children:n}),(0,o.jsx)(Gi,{className:`sticky top-0 bg-background z-10`,children:(0,o.jsxs)(Ji,{children:[g&&(0,o.jsx)(Yi,{className:z(`w-10 bg-background`,k>0&&`sticky left-0 z-20`),children:(0,o.jsx)(xt,{checked:lt?!0:ut?`indeterminate`:!1,onCheckedChange:Ue})}),A&&(0,o.jsx)(Yi,{className:z(`w-10 bg-background text-center`,k>0&&`sticky z-20`),style:k>0?{left:g?40:0}:void 0,children:(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`#`})}),L.map((e,t)=>{let n=_e[e.accessorKey]||e.width||P[e.accessorKey],r=B===t,i=ye===t,a=k>0&&t<k,s=a?L.slice(0,t).reduce((e,t,n)=>{if(n<k){let n=_e[t.accessorKey]||t.width||P[t.accessorKey];return e+(typeof n==`number`?n:n&&parseInt(String(n),10)||150)}return e},(g?40:0)+(A?40:0)):void 0;return(0,o.jsx)(Yi,{className:z(e.className,_&&e.sortable!==!1&&`cursor-pointer select-none`,r&&`opacity-50`,i&&`border-l-2 border-primary`,e.align===`right`&&`text-right`,e.align===`center`&&`text-center`,`relative group bg-background`,a&&`sticky z-20`,a&&t===k-1&&`border-r-2 border-border shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]`),style:{width:n,minWidth:n,...a&&{left:s}},draggable:x,onDragStart:e=>Xe(e,t),onDragOver:e=>Ze(e,t),onDrop:e=>Qe(e,t),onDragEnd:$e,onClick:()=>_&&e.sortable!==!1&&Be(e.accessorKey),onContextMenu:t=>Ve(t,e.accessorKey),children:(0,o.jsxs)(`div`,{className:z(`flex items-center`,e.align===`right`?`justify-end`:`justify-between`),children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[x&&(0,o.jsx)(c.GripVertical,{className:`h-4 w-4 opacity-0 group-hover:opacity-50 cursor-grab active:cursor-grabbing shrink-0`}),e.headerIcon&&(0,o.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e.headerIcon}),(0,o.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground whitespace-nowrap truncate`,children:e.header}),_&&e.sortable!==!1&&Ke(e.accessorKey)]}),b&&e.resizable!==!1&&(0,o.jsx)(`div`,{className:`absolute right-0 top-0 h-full w-1 cursor-col-resize hover:bg-primary opacity-0 hover:opacity-100 transition-opacity`,onMouseDown:t=>qe(t,e.accessorKey),onClick:e=>e.stopPropagation()})]})},e.accessorKey)}),y&&(0,o.jsx)(Yi,{className:`w-24 text-right bg-background`,children:M(`common.actions`)})]})}),(0,o.jsx)(Ki,{children:Ie.length===0?(0,o.jsx)(Ji,{className:`hover:bg-transparent`,children:(0,o.jsx)(Xi,{colSpan:L.length+ +!!g+ +!!A+ +!!y,className:`h-48 text-center text-muted-foreground border-0`,children:(0,o.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3`,children:[(0,o.jsx)(c.Search,{className:`h-8 w-8 text-muted-foreground/50`}),(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(`p`,{children:M(`table.noResults`)}),(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground/50`,children:M(`table.noResultsHint`)})]}),e.emptyAction&&(()=>{let n=e.emptyAction,r=n?.type?t.ComponentRegistry.get(n.type):null;return r?(0,o.jsx)(r,{schema:n}):null})()]})})}):(0,o.jsxs)(o.Fragment,{children:[Ie.map((t,n)=>{let r=(W-1)*I+n,i=ze(t,r),a=de.has(i),s=H.has(n),l=H.get(n)||{};return(0,o.jsxs)(Ji,{"data-state":a?`selected`:void 0,className:z(`bg-background border-b border-border/60 group/row transition-colors`,`hover:bg-muted/40`,`data-[state=selected]:bg-primary/5 data-[state=selected]:hover:bg-primary/10`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset`,e.onRowClick&&`cursor-pointer`,s&&`bg-amber-50 dark:bg-amber-950/20`,T&&T(t,n)),style:E?E(t,n):void 0,onClick:n=>{if(e.onRowClick&&!n.defaultPrevented){let r=n.target;if(r.closest(`button`)||r.closest(`a`)||r.closest(`input, select, textarea, label`)||r.closest(`[role="checkbox"]`)||r.closest(`[role="menu"]`)||r.closest(`[role="menuitem"]`)||r.closest(`[role="menuitemcheckbox"]`)||r.closest(`[role="menuitemradio"]`)||r.closest(`[role="dialog"]`)||r.closest(`[role="alertdialog"]`)||r.closest(`[role="listbox"]`)||r.closest(`[role="option"]`)||r.closest(`[role="tab"]`)||r.closest(`[data-radix-popper-content-wrapper]`))return;e.onRowClick(t)}},children:[g&&(0,o.jsx)(Xi,{className:z(O,k>0&&`sticky left-0 z-10 bg-background`,w===`hover`&&`relative`),children:w===`hover`?(0,o.jsx)(`div`,{className:z(`transition-opacity`,a?`opacity-100`:`opacity-0 group-hover/row:opacity-100`),children:(0,o.jsx)(xt,{checked:a,onCheckedChange:e=>We(i,e)})}):(0,o.jsx)(xt,{checked:a,onCheckedChange:e=>We(i,e)})}),A&&(0,o.jsxs)(Xi,{className:z(`text-center w-10 relative`,O,k>0&&`sticky z-10 bg-background`),style:k>0?{left:g?40:0}:void 0,children:[(0,o.jsx)(`span`,{className:z(`text-xs text-muted-foreground tabular-nums select-none`,!g&&e.onRowClick&&`group-hover/row:invisible`),children:r+1}),!g&&e.onRowClick&&(0,o.jsxs)(`button`,{type:`button`,className:`absolute inset-0 hidden group-hover/row:flex items-center justify-center gap-0.5 text-xs font-medium text-primary hover:text-primary/80`,"data-testid":`row-expand-button`,onClick:n=>{n.stopPropagation(),e.onRowClick?.(t)},title:`Open record`,children:[(0,o.jsx)(`span`,{children:M(`table.open`)}),(0,o.jsx)(c.ChevronRight,{className:`h-3 w-3`})]})]}),L.map((e,r)=>{let i=_e[e.accessorKey]||e.width||P[e.accessorKey],a=t[e.accessorKey],s=l[e.accessorKey]!==void 0,c=s?l[e.accessorKey]:a,u=xe?.rowIndex===n&&xe?.columnKey===e.accessorKey,d=S&&e.editable!==!1,f=k>0&&r<k,p=f?L.slice(0,r).reduce((e,t,n)=>{if(n<k){let n=_e[t.accessorKey]||t.width||P[t.accessorKey];return e+(typeof n==`number`?n:n&&parseInt(String(n),10)||150)}return e},(g?40:0)+(A?40:0)):void 0;return(0,o.jsx)(Xi,{className:z(e.cellClassName,e.align===`right`&&`text-right`,e.align===`center`&&`text-center`,`overflow-hidden`,d&&!u&&`cursor-text hover:bg-muted/50`,s&&`font-semibold text-amber-700 dark:text-amber-400`,f&&`sticky z-10 bg-background`,f&&r===k-1&&`border-r-2 border-border shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]`),style:{width:i,minWidth:i,maxWidth:i,...f&&{left:p}},onDoubleClick:()=>d&&!C&&et(n,e.accessorKey),onClick:()=>d&&C&&et(n,e.accessorKey),onKeyDown:t=>st(t,n,e.accessorKey),tabIndex:0,children:u?(0,o.jsx)(K,{ref:Ne,value:Ce,onChange:e=>we(e.target.value),onKeyDown:ct,className:`h-8 px-2 py-1`}):(0,o.jsx)(`div`,{className:`truncate w-full`,title:c!=null&&typeof c!=`object`?String(c):void 0,children:typeof e.cell==`function`?e.cell(c,t):typeof c==`object`&&c?String(c):re(c)})},r)}),y&&(0,o.jsx)(Xi,{className:z(`text-right`,O),children:(0,o.jsx)(`div`,{className:`flex items-center justify-end gap-1`,children:s&&(e.onRowSave||e.onBatchSave)?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(V,{variant:`ghost`,size:`icon`,onClick:()=>it(n),disabled:Ee,title:`Cancel changes`,children:(0,o.jsx)(c.X,{className:`h-4 w-4`})}),(0,o.jsx)(V,{variant:`ghost`,size:`icon`,onClick:()=>rt(n),disabled:Ee,title:`Save row`,children:(0,o.jsx)(c.Save,{className:`h-4 w-4 text-green-600`})})]}):(e.onRowEdit||e.onRowDelete)&&(0,o.jsxs)(gn,{children:[(0,o.jsx)(_n,{asChild:!0,children:(0,o.jsx)(V,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:e=>e.stopPropagation(),"aria-label":`Row actions`,children:(0,o.jsx)(c.MoreHorizontal,{className:`h-4 w-4`})})}),(0,o.jsxs)(wn,{align:`end`,onClick:e=>e.stopPropagation(),children:[e.onRowEdit&&(0,o.jsxs)(Tn,{onClick:()=>e.onRowEdit?.(t),children:[(0,o.jsx)(c.Edit,{className:`mr-2 h-4 w-4`}),M(`table.edit`)]}),e.onRowEdit&&e.onRowDelete&&(0,o.jsx)(kn,{}),e.onRowDelete&&(0,o.jsxs)(Tn,{onClick:()=>e.onRowDelete?.(t),className:`text-destructive focus:text-destructive`,children:[(0,o.jsx)(c.Trash2,{className:`mr-2 h-4 w-4`}),M(`table.delete`)]})]})]})})})]},i)}),j&&(0,o.jsx)(Ji,{className:`hover:bg-muted/30 cursor-pointer border-b border-border`,"data-testid":`add-record-row`,onClick:()=>e.onAddRecord?.(),children:(0,o.jsx)(Xi,{colSpan:L.length+ +!!g+ +!!A+ +!!y,className:`h-9 px-3 py-1.5`,children:(0,o.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground text-sm hover:text-foreground transition-colors`,children:[(0,o.jsx)(c.Plus,{className:`h-3.5 w-3.5`}),M(`table.addRecord`)]})})})]})})]})}),s&&U.length>0&&Fe>1&&(0,o.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center justify-between gap-2`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsxs)(`span`,{className:`text-xs sm:text-sm text-muted-foreground`,children:[M(`table.rowsPerPage`),`:`]}),(0,o.jsxs)(Rr,{value:I.toString(),onValueChange:e=>Re(Number(e)),children:[(0,o.jsx)(q,{className:`w-20`,children:(0,o.jsx)(Br,{})}),(0,o.jsxs)(J,{children:[(0,o.jsx)(Y,{value:`5`,children:`5`}),(0,o.jsx)(Y,{value:`10`,children:`10`}),(0,o.jsx)(Y,{value:`20`,children:`20`}),(0,o.jsx)(Y,{value:`50`,children:`50`}),(0,o.jsx)(Y,{value:`100`,children:`100`})]})]})]}),(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-xs sm:text-sm text-muted-foreground`,children:M(`table.pageInfo`,{current:W,total:Fe})}),(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(V,{variant:`outline`,size:`icon`,onClick:()=>Le(1),disabled:W===1,children:(0,o.jsx)(c.ChevronsLeft,{className:`h-4 w-4`})}),(0,o.jsx)(V,{variant:`outline`,size:`icon`,onClick:()=>Le(W-1),disabled:W===1,children:(0,o.jsx)(c.ChevronLeft,{className:`h-4 w-4`})}),(0,o.jsx)(V,{variant:`outline`,size:`icon`,onClick:()=>Le(W+1),disabled:W===Fe,children:(0,o.jsx)(c.ChevronRight,{className:`h-4 w-4`})}),(0,o.jsx)(V,{variant:`outline`,size:`icon`,onClick:()=>Le(Fe),disabled:W===Fe,children:(0,o.jsx)(c.ChevronsRight,{className:`h-4 w-4`})})]})]})]}),Oe&&(0,o.jsxs)(`div`,{className:`fixed z-50 min-w-[160px] rounded-md border bg-popover p-1 shadow-md`,style:{left:Oe.x,top:Oe.y},"data-testid":`column-context-menu`,onClick:e=>e.stopPropagation(),children:[_&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>{le(Oe.columnKey),ue(`asc`),ke(null)},children:[(0,o.jsx)(c.ChevronUp,{className:`h-3.5 w-3.5`}),M(`table.sortAsc`)]}),(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>{le(Oe.columnKey),ue(`desc`),ke(null)},children:[(0,o.jsx)(c.ChevronDown,{className:`h-3.5 w-3.5`}),M(`table.sortDesc`)]}),(0,o.jsx)(`div`,{className:`my-1 h-px bg-border`})]}),(0,o.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground cursor-pointer`,onClick:()=>He(Oe.columnKey),children:[(0,o.jsx)(c.X,{className:`h-3.5 w-3.5`}),M(`table.hideColumn`)]})]})]})},{namespace:`ui`,label:`Data Table`,icon:`table`,inputs:[{name:`caption`,type:`string`,label:`Caption`},{name:`columns`,type:`array`,label:`Columns`,description:`Array of { header, accessorKey, className, width, sortable, filterable, resizable }`,required:!0},{name:`data`,type:`array`,label:`Data`,description:`Array of data objects`,required:!0},{name:`pagination`,type:`boolean`,label:`Enable Pagination`,defaultValue:!0},{name:`pageSize`,type:`number`,label:`Page Size`,defaultValue:10},{name:`searchable`,type:`boolean`,label:`Enable Search`,defaultValue:!0},{name:`selectable`,type:`boolean`,label:`Enable Row Selection`,defaultValue:!1},{name:`sortable`,type:`boolean`,label:`Enable Sorting`,defaultValue:!0},{name:`exportable`,type:`boolean`,label:`Enable Export`,defaultValue:!1},{name:`rowActions`,type:`boolean`,label:`Show Row Actions`,defaultValue:!1},{name:`resizableColumns`,type:`boolean`,label:`Enable Column Resizing`,defaultValue:!0},{name:`reorderableColumns`,type:`boolean`,label:`Enable Column Reordering`,defaultValue:!0},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{caption:`Enterprise Data Table`,pagination:!0,pageSize:10,searchable:!0,selectable:!0,sortable:!0,exportable:!0,rowActions:!0,resizableColumns:!0,reorderableColumns:!0,columns:[{header:`ID`,accessorKey:`id`,width:`80px`},{header:`Name`,accessorKey:`name`},{header:`Email`,accessorKey:`email`},{header:`Status`,accessorKey:`status`},{header:`Role`,accessorKey:`role`}],data:[{id:1,name:`John Doe`,email:`john@example.com`,status:`Active`,role:`Admin`},{id:2,name:`Jane Smith`,email:`jane@example.com`,status:`Active`,role:`User`},{id:3,name:`Bob Johnson`,email:`bob@example.com`,status:`Inactive`,role:`User`},{id:4,name:`Alice Williams`,email:`alice@example.com`,status:`Active`,role:`Manager`},{id:5,name:`Charlie Brown`,email:`charlie@example.com`,status:`Active`,role:`User`},{id:6,name:`Diana Prince`,email:`diana@example.com`,status:`Active`,role:`Admin`},{id:7,name:`Ethan Hunt`,email:`ethan@example.com`,status:`Inactive`,role:`User`},{id:8,name:`Fiona Gallagher`,email:`fiona@example.com`,status:`Active`,role:`User`},{id:9,name:`George Wilson`,email:`george@example.com`,status:`Active`,role:`Manager`},{id:10,name:`Hannah Montana`,email:`hannah@example.com`,status:`Active`,role:`User`},{id:11,name:`Ivan Drago`,email:`ivan@example.com`,status:`Inactive`,role:`User`},{id:12,name:`Julia Roberts`,email:`julia@example.com`,status:`Active`,role:`Admin`}]}});function Yc(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}var Xc={Home:`House`};function Zc(e){if(!e)return null;let t=Yc(e);return c.icons[Xc[t]||t]??null}var Qc=(0,a.forwardRef)(({schema:e,className:t,context:n,...r},s)=>{let{"data-obj-id":l,"data-obj-type":u,style:d,data:f,...p}=r,{execute:m}=(0,i.useAction)(),[h,g]=(0,a.useState)(!1),_=typeof f==`object`&&f?f:{},v=(0,i.useCondition)((0,i.toPredicateInput)(e.visible),_),y=(0,i.useCondition)((0,i.toPredicateInput)(e.disabled),_),b=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled),_),x=Zc(e.icon),S=e.variant===`primary`?`default`:e.variant||`default`,C=e.size===`md`?`default`:e.size||`default`,w=(0,a.useCallback)(async()=>{if(!h){g(!0);try{let t=Array.isArray(e.params)?{actionParams:e.params}:{params:e.params};await m({type:e.actionType||e.type,name:e.name,label:e.label,description:e.description,target:e.target,execute:e.execute,endpoint:e.endpoint,method:e.method,...t,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,undoable:e.undoable,recordIdField:e.recordIdField,toast:e.toast,resultDialog:e.resultDialog,...n})}finally{g(!1)}}},[e,m,h,n]);return e.visible&&!v?null:(0,o.jsxs)(V,{ref:s,type:`button`,variant:S,size:C,className:z(e.className,t),disabled:(e.disabled==null?e.enabled==null?!1:!b:y)||h,onClick:w,...p,"data-obj-id":l,"data-obj-type":u,style:d,children:[h&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!h&&x&&(0,o.jsx)(x,{className:z(`h-4 w-4`,e.label&&`mr-2`)}),e.label]})});Qc.displayName=`ActionButtonRenderer`,t.ComponentRegistry.register(`action:button`,Qc,{namespace:`action`,label:`Action Button`,inputs:[{name:`name`,type:`string`,label:`Action Name`},{name:`label`,type:`string`,label:`Label`,defaultValue:`Action`},{name:`icon`,type:`string`,label:`Icon`},{name:`type`,type:`enum`,label:`Action Type`,enum:[`script`,`url`,`modal`,`flow`,`api`],defaultValue:`script`},{name:`target`,type:`string`,label:`Target`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`default`,`primary`,`secondary`,`destructive`,`outline`,`ghost`],defaultValue:`default`},{name:`size`,type:`enum`,label:`Size`,enum:[`sm`,`md`,`lg`],defaultValue:`md`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{label:`Action`,type:`script`,variant:`default`,size:`md`}});var $c=(0,a.forwardRef)(({schema:e,className:t,context:n,...r},s)=>{let{"data-obj-id":l,"data-obj-type":u,style:d,...f}=r,{execute:p}=(0,i.useAction)(),[m,h]=(0,a.useState)(!1),g=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),_=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled)),v=Zc(e.icon),y=e.variant===`primary`?`default`:e.variant||`ghost`,b=(0,a.useCallback)(async()=>{if(!m){h(!0);try{await p({type:e.type,name:e.name,target:e.target,execute:e.execute,endpoint:e.endpoint,method:e.method,params:e.params,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,toast:e.toast,...n})}finally{h(!1)}}},[e,p,m,n]);if(e.visible&&!g)return null;let x=(0,o.jsx)(V,{ref:s,type:`button`,variant:y,size:`icon`,className:z(`h-8 w-8`,e.className,t),disabled:(e.enabled?!_:!1)||m,onClick:b,"aria-label":e.label||e.name,...f,"data-obj-id":l,"data-obj-type":u,style:d,children:m?(0,o.jsx)(c.Loader2,{className:`h-4 w-4 animate-spin`}):v?(0,o.jsx)(v,{className:`h-4 w-4`}):(0,o.jsx)(`span`,{className:`text-xs`,children:e.label?.charAt(0)||`?`})});return e.label||e.description?(0,o.jsx)(ai,{delayDuration:300,children:(0,o.jsxs)(oi,{children:[(0,o.jsx)(si,{asChild:!0,children:x}),(0,o.jsx)(ci,{children:(0,o.jsx)(`p`,{children:e.label||e.description})})]})}):x});$c.displayName=`ActionIconRenderer`,t.ComponentRegistry.register(`action:icon`,$c,{namespace:`action`,label:`Action Icon`,inputs:[{name:`name`,type:`string`,label:`Action Name`},{name:`label`,type:`string`,label:`Tooltip Label`},{name:`icon`,type:`string`,label:`Icon`},{name:`type`,type:`enum`,label:`Action Type`,enum:[`script`,`url`,`modal`,`flow`,`api`],defaultValue:`script`},{name:`target`,type:`string`,label:`Target`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`default`,`secondary`,`destructive`,`outline`,`ghost`],defaultValue:`ghost`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{icon:`play`,type:`script`,variant:`ghost`}});function el(){try{let{t:e}=(0,F.useObjectTranslation)(),t=e(`detail.moreActions`);return!t||t===`detail.moreActions`?`More actions`:t}catch{return`More actions`}}var tl=({action:e,onExecute:t})=>{let n=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),r=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled)),s=(0,a.useMemo)(()=>{let t=Zc(e.icon);return t?(0,o.jsx)(t,{className:`mr-2 h-4 w-4`}):null},[e.icon]);return e.visible&&!n?null:(0,o.jsxs)(Tn,{disabled:e.enabled?!r:!1,onSelect:n=>{n.preventDefault(),t(e)},className:z(e.variant===`destructive`&&`text-destructive focus:text-destructive`,e.className),children:[s,(0,o.jsx)(`span`,{children:e.label||e.name})]})};tl.displayName=`ActionMenuItem`;var nl=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":s,"data-obj-type":l,style:u,...d}=n,{execute:f}=(0,i.useAction)(),[p,m]=(0,a.useState)(!1),h=el(),g=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),_=Zc(e.icon)||c.MoreHorizontal,v=e.variant||`ghost`,y=e.size||`icon`,b=(0,a.useCallback)(async e=>{m(!0);try{if(typeof e.onClick==`function`){await e.onClick();return}await f({type:e.type,name:e.name,target:e.target,execute:e.execute,endpoint:e.endpoint,method:e.method,params:e.params,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,toast:e.toast,resultDialog:e.resultDialog})}finally{m(!1)}},[f]);if(e.visible&&!g)return null;let x=e.actions||[];return x.length===0?null:(0,o.jsxs)(gn,{children:[(0,o.jsx)(_n,{asChild:!0,children:(0,o.jsx)(V,{ref:r,type:`button`,variant:v,size:y,className:z(y===`icon`&&`h-8 w-8`,e.className,t),disabled:p,"aria-label":e.label||h,...d,"data-obj-id":s,"data-obj-type":l,style:u,children:p?(0,o.jsx)(c.Loader2,{className:`h-4 w-4 animate-spin`}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(_,{className:z(`h-4 w-4`,e.label&&`mr-2`)}),e.label&&(0,o.jsx)(`span`,{children:e.label})]})})}),(0,o.jsx)(wn,{align:`end`,children:x.map((e,t)=>{let n=e.tags?.includes(`separator-before`)&&t>0;return(0,o.jsxs)(a.default.Fragment,{children:[n&&(0,o.jsx)(kn,{}),(0,o.jsx)(tl,{action:e,onExecute:b})]},e.name||t)})})]})});nl.displayName=`ActionMenuRenderer`,t.ComponentRegistry.register(`action:menu`,nl,{namespace:`action`,label:`Action Menu`,inputs:[{name:`label`,type:`string`,label:`Trigger Label`},{name:`icon`,type:`string`,label:`Trigger Icon`},{name:`actions`,type:`object`,label:`Actions`},{name:`variant`,type:`enum`,label:`Trigger Variant`,enum:[`default`,`secondary`,`outline`,`ghost`],defaultValue:`ghost`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{variant:`ghost`,actions:[]}});var rl=({action:e,variant:t,size:n,onExecute:r})=>{let[s,l]=(0,a.useState)(!1),u=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),d=(0,i.useCondition)((0,i.toPredicateInput)(e.enabled)),f=Zc(e.icon),p=e.variant===`primary`?`default`:e.variant||t||`outline`,m=e.size===`md`?`default`:e.size||n||`sm`,h=(0,a.useCallback)(async()=>{if(!s){l(!0);try{await r(e)}finally{l(!1)}}},[e,r,s]);return e.visible&&!u?null:(0,o.jsxs)(V,{type:`button`,variant:p,size:m,className:e.className,disabled:(e.enabled?!d:!1)||s,onClick:h,children:[s&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!s&&f&&(0,o.jsx)(f,{className:z(`h-4 w-4`,e.label&&`mr-2`)}),e.label]})};rl.displayName=`InlineActionButton`;var il=(0,a.forwardRef)(({schema:e,className:t,...n},r)=>{let{"data-obj-id":s,"data-obj-type":l,style:u,...d}=n,{execute:f}=(0,i.useAction)(),[p,m]=(0,a.useState)(!1),h=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),g=e.actions||[];e.location&&(g=g.filter(t=>!t.locations||t.locations.includes(e.location)));let _=(0,a.useCallback)(async e=>{await f({type:e.type,name:e.name,target:e.target,execute:e.execute,endpoint:e.endpoint,method:e.method,params:e.params,confirmText:e.confirmText,successMessage:e.successMessage,errorMessage:e.errorMessage,refreshAfter:e.refreshAfter,toast:e.toast})},[f]);if(e.visible&&!h||g.length===0)return null;if((e.display||`inline`)===`dropdown`){let n=Zc(e.icon);return(0,o.jsxs)(gn,{children:[(0,o.jsx)(_n,{asChild:!0,children:(0,o.jsxs)(V,{type:`button`,variant:e.variant||`outline`,size:e.size===`md`?`default`:e.size||`default`,className:z(e.className,t),disabled:p,"data-obj-id":s,"data-obj-type":l,style:u,children:[p&&(0,o.jsx)(c.Loader2,{className:`mr-2 h-4 w-4 animate-spin`}),!p&&n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),e.label||`Actions`,(0,o.jsx)(c.ChevronDown,{className:`ml-2 h-3 w-3 opacity-50`})]})}),(0,o.jsx)(wn,{align:`end`,children:g.map((e,t)=>{let n=Zc(e.icon),r=e.tags?.includes(`separator-before`)&&t>0;return(0,o.jsxs)(a.default.Fragment,{children:[r&&(0,o.jsx)(kn,{}),(0,o.jsxs)(Tn,{onSelect:async t=>{t.preventDefault(),m(!0);try{await _(e)}finally{m(!1)}},className:z(e.variant===`destructive`&&`text-destructive focus:text-destructive`,e.className),children:[n&&(0,o.jsx)(n,{className:`mr-2 h-4 w-4`}),(0,o.jsx)(`span`,{children:e.label||e.name})]})]},e.name||t)})})]})}return(0,o.jsx)(`div`,{ref:r,className:z(`flex items-center gap-2`,e.className,t),...d,"data-obj-id":s,"data-obj-type":l,style:u,children:g.map(t=>(0,o.jsx)(rl,{action:t,variant:e.variant,size:e.size,onExecute:_},t.name))})});il.displayName=`ActionGroupRenderer`,t.ComponentRegistry.register(`action:group`,il,{namespace:`action`,label:`Action Group`,inputs:[{name:`name`,type:`string`,label:`Group Name`},{name:`label`,type:`string`,label:`Label`},{name:`icon`,type:`string`,label:`Icon`},{name:`actions`,type:`object`,label:`Actions`},{name:`display`,type:`enum`,label:`Display Mode`,enum:[`inline`,`dropdown`],defaultValue:`inline`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`default`,`secondary`,`outline`,`ghost`],defaultValue:`outline`},{name:`size`,type:`enum`,label:`Size`,enum:[`sm`,`md`,`lg`],defaultValue:`sm`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{display:`inline`,variant:`outline`,size:`sm`,actions:[]}});function al(){try{let{t:e}=(0,F.useObjectTranslation)(),t=e(`common.actions`);return!t||t===`common.actions`?`Actions`:t}catch{return`Actions`}}var ol=(0,a.forwardRef)(({schema:e,className:n,...r},s)=>{let c=al(),{"data-obj-id":l,"data-obj-type":u,style:d,data:f,actions:p,systemActions:m,location:h,maxVisible:g,mobileMaxVisible:_,direction:v,gap:y,variant:b,size:x,visible:S,...C}=r,w=(0,i.useCondition)((0,i.toPredicateInput)(e.visible)),T=ii(),E=(0,a.useMemo)(()=>{let t=e.actions||[],n=e.location?t.filter(t=>!t.locations||t.locations.length===0||t.locations.includes(e.location)):t,r=new Set;return n.filter(e=>e.name?r.has(e.name)?!1:(r.add(e.name),!0):!0)},[e.actions,e.location]),D=(0,a.useMemo)(()=>{let t=e.systemActions||[],n=new Set;return t.filter(e=>e.name?n.has(e.name)?!1:(n.add(e.name),!0):!0)},[e.systemActions]),O=T?e.mobileMaxVisible??1:e.maxVisible??3,{inlineActions:k,overflowActions:A}=(0,a.useMemo)(()=>E.length<=O?{inlineActions:E,overflowActions:[]}:{inlineActions:E.slice(0,O),overflowActions:E.slice(O)},[E,O]),j=(0,a.useMemo)(()=>{if(D.length===0)return A;if(A.length===0)return D;let[e,...t]=D,n={...e,tags:[...e.tags||[],`separator-before`]};return[...A,n,...t]},[A,D]);if(e.visible&&!w||E.length===0&&D.length===0)return null;let ee=e.direction||`horizontal`,te=e.gap||`gap-2`,M=j.length>0?t.ComponentRegistry.get(`action:menu`):null,N=M?(0,o.jsx)(M,{schema:{type:`action:menu`,actions:j,variant:e.variant||`ghost`,size:e.size||`sm`}}):null;return(0,o.jsxs)(`div`,{ref:s,className:z(`flex items-center`,ee===`vertical`?`flex-col items-stretch`:`flex-row flex-wrap`,te,e.className,n),role:`toolbar`,"aria-label":c,...C,"data-obj-id":l,"data-obj-type":u,style:d,children:[k.map(n=>{let r=n.component||`action:button`,i=t.ComponentRegistry.get(r);return i?(0,o.jsx)(i,{schema:{...n,type:r,actionType:n.type,variant:n.variant||e.variant,size:n.size||e.size},data:f},n.name):null}),j.length>0&&N]})});ol.displayName=`ActionBarRenderer`,t.ComponentRegistry.register(`action:bar`,ol,{namespace:`action`,label:`Action Bar`,inputs:[{name:`actions`,type:`object`,label:`Actions`},{name:`systemActions`,type:`object`,label:`System Actions (always in overflow)`},{name:`location`,type:`enum`,label:`Location`,enum:[...fe.ACTION_LOCATIONS]},{name:`maxVisible`,type:`number`,label:`Max Visible Actions`,defaultValue:3},{name:`direction`,type:`enum`,label:`Direction`,enum:[`horizontal`,`vertical`],defaultValue:`horizontal`},{name:`variant`,type:`enum`,label:`Default Variant`,enum:[`default`,`secondary`,`outline`,`ghost`],defaultValue:`outline`},{name:`size`,type:`enum`,label:`Default Size`,enum:[`sm`,`md`,`lg`],defaultValue:`sm`},{name:`className`,type:`string`,label:`CSS Class`,advanced:!0}],defaultProps:{maxVisible:3,direction:`horizontal`,variant:`outline`,size:`sm`,actions:[]}});var sl=({schema:e,className:t})=>{let n=e.type,r=n.startsWith(`view:`),i=n.startsWith(`widget:`),a=n.startsWith(`field:`);return(0,o.jsxs)(`div`,{className:z(`flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg bg-muted/30 transition-colors hover:bg-muted/50`,r&&`border-blue-300 bg-blue-50/50 min-h-[200px]`,i&&`border-purple-300 bg-purple-50/50 min-h-[150px]`,a&&`border-yellow-300 bg-yellow-50/50 p-2 min-h-[40px] flex-row gap-2 justify-start`,t),children:[(0,o.jsxs)(`div`,{className:z(`flex items-center gap-2 text-muted-foreground`,a&&`text-sm`),children:[a?(0,o.jsx)(c.Box,{className:`h-4 w-4`}):(0,o.jsx)(c.FileQuestion,{className:`h-8 w-8 mb-2 opacity-50`}),(0,o.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,o.jsx)(`span`,{className:`font-mono font-medium text-foreground`,children:n}),!a&&(0,o.jsx)(`span`,{className:`text-xs`,children:`Component Placeholder`})]})]}),e.props&&!a&&(0,o.jsxs)(`div`,{className:`mt-4 w-full text-xs text-muted-foreground bg-background/50 p-2 rounded overflow-hidden`,children:[(0,o.jsx)(`div`,{className:`opacity-70`,children:`Properties:`}),(0,o.jsx)(`pre`,{className:`mt-1 truncate`,children:JSON.stringify(e.props,null,0)})]})]})},cl=`view:grid.view:kanban.view:map.view:calendar.view:gantt.view:timeline.view:gallery.view:simple.view:wizard.view:tabbed.view:drawer.view:modal.view:split.field:text.field:textarea.field:password.field:email.field:url.field:phone.field:markdown.field:html.field:code.field:number.field:currency.field:percent.field:slider.field:boolean.field:checkboxes.field:select.field:multiselect.field:radio.field:date.field:datetime.field:time.field:duration.field:lookup.field:master_detail.field:tree.field:image.field:file.field:video.field:audio.field:avatar.field:color.field:rating.field:signature.field:qrcode.field:progress.field:json.field:address.field:location.page:header.page-header.page:footer.page:tabs.page:accordion.page:card.page:sidebar.record:details.record:highlights.record:related_list.record:activity.record:chatter.record:path.app:launcher.nav:menu.nav:breadcrumb.global:search.global:notifications.user:profile.widget:metric.widget:bar.widget:line.widget:pie.widget:funnel.widget:radar.widget:scatter.widget:heatmap.widget:pivot.widget:table.widget:text.widget:image.ai:input.ai:suggestion.ai:feedback`.split(`.`);function ll(){cl.forEach(e=>{t.ComponentRegistry.get(e)||t.ComponentRegistry.register(e,sl,{namespace:`protocol-placeholder`})})}function ul(e,t){let n=t?.maxHistory??50,[r,i]=(0,a.useState)({...e}),[o,s]=(0,a.useState)(t?.mode===`create`),c=(0,a.useRef)([]),l=(0,a.useRef)([]),[,u]=(0,a.useState)(0);(0,a.useEffect)(()=>{i({...e}),s(t?.mode===`create`),c.current=[],l.current=[]},[e]);let d=(0,a.useCallback)((e,r)=>{i(t=>(c.current=[...c.current.slice(-(n-1)),t],l.current=[],{...t,[e]:r})),s(!0),u(e=>e+1),t?.onUpdate?.(e,r)},[t?.onUpdate,n]),f=(0,a.useCallback)(()=>{c.current.length!==0&&(i(e=>{let t=[...c.current],n=t.pop();return c.current=t,l.current=[e,...l.current],n}),u(e=>e+1))},[]),p=(0,a.useCallback)(()=>{l.current.length!==0&&(i(e=>{let t=[...l.current],n=t.shift();return l.current=t,c.current=[...c.current,e],n}),u(e=>e+1))},[]);return{draft:r,isDirty:o,updateField:d,discard:(0,a.useCallback)(()=>{i({...e}),s(!1),c.current=[],l.current=[],u(e=>e+1)},[e]),setDraft:i,undo:f,redo:p,canUndo:c.current.length>0,canRedo:l.current.length>0}}function dl(e){let[t,n]=a.useState({width:0,height:0});return a.useEffect(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=t.getBoundingClientRect();n(e=>e.width===r.width&&e.height===r.height?e:{width:r.width,height:r.height});let i=new ResizeObserver(e=>{let t=e[0];if(!t)return;let r,i=t.borderBoxSize?.[0];r=i?{width:i.inlineSize,height:i.blockSize}:{width:t.contentRect.width,height:t.contentRect.height},n(e=>e.width===r.width&&e.height===r.height?e:r)});return i.observe(t),()=>i.disconnect()},[e]),t}var fl=[`completed`,`failed`,`cancelled`,`expired`];function pl(e){return!!e&&fl.includes(e)}function ml(e={}){let{dataSource:t,pollIntervalMs:n=1500,maxAttempts:r=600,onComplete:i,onError:o}=e,[s,c]=(0,a.useState)(null),[l,u]=(0,a.useState)(null),[d,f]=(0,a.useState)(!1),p=(0,a.useRef)(null),m=(0,a.useRef)(null),h=(0,a.useRef)(0),g=(0,a.useRef)(!1),_=(0,a.useRef)({onComplete:i,onError:o});_.current={onComplete:i,onError:o};let v=!!t?.createExportJob&&!!t?.getExportJobProgress,y=(0,a.useCallback)(()=>{m.current&&=(clearTimeout(m.current),null)},[]),b=(0,a.useCallback)(()=>{y(),p.current=null,g.current=!1,h.current=0,c(null),u(null),f(!1)},[y]);(0,a.useEffect)(()=>()=>y(),[y]);let x=(0,a.useCallback)(async()=>{if(t?.getExportJobProgress&&!(!p.current||g.current)){if(h.current+=1,h.current>r){let e=Error(`Export job timed out (max attempts exceeded)`);u(e),f(!1),_.current.onError?.(e,s??void 0);return}try{let e=await t.getExportJobProgress(p.current);if(g.current)return;if(c(e),pl(e.status)){if(f(!1),e.status===`completed`)_.current.onComplete?.(e);else{let t=e.error?.message??`Export ${e.status}`,n=Error(t);u(n),_.current.onError?.(n,e)}return}m.current=setTimeout(x,n)}catch(e){if(g.current)return;let t=e instanceof Error?e:Error(String(e));u(t),f(!1),_.current.onError?.(t,s??void 0)}}},[t,r,n,s]),S=(0,a.useCallback)(async(e,r)=>{if(!t?.createExportJob){let e=Error(`DataSource does not implement createExportJob — cannot start async export.`);return u(e),_.current.onError?.(e),null}y(),g.current=!1,h.current=0,u(null),c(null),f(!0);try{let i=await t.createExportJob(e,r);if(p.current=i.jobId,c({jobId:i.jobId,status:i.status,processedRecords:0,totalRecords:i.estimatedRecords,percentComplete:0}),pl(i.status)){if(f(!1),i.status===`completed`&&t.getExportJobProgress)try{let e=await t.getExportJobProgress(i.jobId);c(e),_.current.onComplete?.(e)}catch{}return i.jobId}return m.current=setTimeout(x,n),i.jobId}catch(e){let t=e instanceof Error?e:Error(String(e));return u(t),f(!1),_.current.onError?.(t),null}},[t,y,x,n]),C=(0,a.useCallback)(async()=>{if(p.current){if(g.current=!0,y(),f(!1),t?.cancelExportJob)try{await t.cancelExportJob(p.current)}catch{}c(e=>e&&{...e,status:`cancelled`})}},[t,y]),w=(0,a.useCallback)(async()=>{if(!p.current)return null;if(t?.getExportJobDownloadUrl)try{return await t.getExportJobDownloadUrl(p.current)}catch{}return s?.downloadUrl??null},[t,s]);return{isRunning:d,progress:s,error:l,isSupported:v,start:S,cancel:C,getDownloadUrl:w,download:(0,a.useCallback)(async e=>{let t=await w();if(!t)return!1;let n=document.createElement(`a`);return n.href=t,e&&(n.download=e),n.rel=`noopener`,document.body.appendChild(n),n.click(),n.remove(),!0},[w]),reset:b}}function hl({schema:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No schema available`})}function gl({dataContext:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No data context available`})}function _l(){let e=(0,a.useMemo)(()=>{try{return t.ComponentRegistry.getAllTypes()}catch{return[]}},[]);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No registered components`}):(0,o.jsxs)(`div`,{className:`space-y-1 max-h-[60vh] overflow-auto`,children:[e.map(e=>(0,o.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 rounded text-xs font-mono bg-muted/30`,children:[(0,o.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-green-500 shrink-0`}),e]},e)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` component`,e.length===1?``:`s`,` registered`]})]})}function vl({flags:e}){return e?(0,o.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap break-all`,children:JSON.stringify(e,null,2)}):(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No debug flags`})}function yl(e){let n=t.DebugCollector.getInstance(),[r,i]=(0,a.useState)(()=>n.getEntries(e));return a.default.useEffect(()=>(i(n.getEntries(e)),n.subscribe(()=>{i(n.getEntries(e))})),[n,e]),r}function bl(){let e=yl(`perf`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No performance data collected yet`}):(0,o.jsxs)(`div`,{className:`space-y-1 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:z(`flex items-center justify-between px-2 py-1 rounded text-xs font-mono`,e.durationMs>16?`bg-red-50 text-red-700`:`bg-muted/30`),children:[(0,o.jsxs)(`span`,{className:`truncate mr-2`,children:[e.type,e.id?`:${e.id}`:``]}),(0,o.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[e.durationMs.toFixed(2),`ms`]})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` render`,e.length===1?``:`s`,` tracked`]})]})}function xl(){let e=yl(`expr`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No expression evaluations tracked yet`}):(0,o.jsxs)(`div`,{className:`space-y-1.5 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:`px-2 py-1.5 rounded bg-muted/30 text-xs font-mono`,children:[(0,o.jsx)(`div`,{className:`text-muted-foreground truncate`,children:e.expression}),(0,o.jsxs)(`div`,{className:`mt-0.5`,children:[`→ `,JSON.stringify(e.result)]})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` evaluation`,e.length===1?``:`s`,` tracked`]})]})}function Sl(){let e=yl(`event`).map(e=>e.data);return e.length===0?(0,o.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No events captured yet`}):(0,o.jsxs)(`div`,{className:`space-y-1.5 max-h-[60vh] overflow-auto`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:`px-2 py-1.5 rounded bg-muted/30 text-xs font-mono`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsx)(`span`,{className:`font-semibold`,children:e.action}),(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString()})]}),e.payload!==void 0&&(0,o.jsx)(`pre`,{className:`mt-0.5 text-[10px] text-muted-foreground truncate`,children:JSON.stringify(e.payload)})]},t)),(0,o.jsxs)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:[e.length,` event`,e.length===1?``:`s`,` captured`]})]})}function Cl({open:e,onClose:t,flags:n,schema:r,dataContext:i,extraTabs:s=[],className:c}){let l=(0,a.useMemo)(()=>[{id:`schema`,label:`Schema`,render:()=>(0,o.jsx)(hl,{schema:r})},{id:`data`,label:`Data`,render:()=>(0,o.jsx)(gl,{dataContext:i})},{id:`perf`,label:`Perf`,render:()=>(0,o.jsx)(bl,{})},{id:`expr`,label:`Expr`,render:()=>(0,o.jsx)(xl,{})},{id:`events`,label:`Events`,render:()=>(0,o.jsx)(Sl,{})},{id:`registry`,label:`Registry`,render:()=>(0,o.jsx)(_l,{})},{id:`flags`,label:`Flags`,render:()=>(0,o.jsx)(vl,{flags:n})}],[r,i,n]),u=(0,a.useMemo)(()=>[...l,...s],[l,s]),[d,f]=(0,a.useState)(u[0]?.id??`schema`),p=u.find(e=>e.id===d)??u[0],m=(0,a.useCallback)(e=>{f(e)},[]);return e?(0,o.jsxs)(`div`,{className:z(`fixed bottom-4 right-4 z-[9999] w-[420px] max-w-[95vw] rounded-lg border bg-background shadow-2xl`,`flex flex-col overflow-hidden`,c),"data-testid":`debug-panel`,role:`dialog`,"aria-label":`Developer Debug Panel`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b bg-muted/30`,children:[(0,o.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`🛠 Debug Panel`}),(0,o.jsx)(`button`,{onClick:t,className:`text-muted-foreground hover:text-foreground text-sm leading-none px-1`,"aria-label":`Close debug panel`,"data-testid":`debug-panel-close`,children:`✕`})]}),(0,o.jsx)(`div`,{className:`flex border-b overflow-x-auto`,role:`tablist`,children:u.map(e=>(0,o.jsxs)(`button`,{role:`tab`,"aria-selected":e.id===p?.id,onClick:()=>m(e.id),className:z(`px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors`,e.id===p?.id?`border-b-2 border-primary text-foreground`:`text-muted-foreground hover:text-foreground`),"data-testid":`debug-tab-${e.id}`,children:[e.icon&&(0,o.jsx)(`span`,{className:`mr-1`,children:e.icon}),e.label]},e.id))}),(0,o.jsx)(`div`,{className:`p-3 overflow-auto max-h-[50vh]`,"data-testid":`debug-panel-content`,children:p?.render()})]}):null}var wl={permission:`view`,audience:`link_only`,expiresInDays:7,password:``,label:``},Tl=[{label:`1 day`,value:1},{label:`7 days`,value:7},{label:`30 days`,value:30},{label:`90 days`,value:90},{label:`Never`,value:null}],El=[{value:`link_only`,label:`Anyone with the link`,help:`No sign-in required`},{value:`signed_in`,label:`Signed-in users`,help:`Must be logged in to view`}];function Dl(e,t){return`${(e??(typeof window<`u`?`${window.location.origin}/s`:`/s`)).replace(/\/+$/,``)}/${t}`}async function Ol(e){try{if(typeof navigator<`u`&&navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document<`u`){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();try{return document.execCommand(`copy`),document.body.removeChild(t),!0}catch{document.body.removeChild(t)}}return!1}function kl({open:e,onOpenChange:t,objectName:n,recordId:r,recordLabel:i,apiBase:s,publicBaseUrl:l,fetchHeaders:u}){let[d,f]=(0,a.useState)([]),[p,m]=(0,a.useState)(!1),[h,g]=(0,a.useState)(!1),[_,v]=(0,a.useState)(null),[y,b]=(0,a.useState)(wl),[x,S]=(0,a.useState)(null),C=(0,a.useCallback)(async()=>{let e={"Content-Type":`application/json`};if(!u)return e;let t=await u();return{...e,...t}},[u]),w=(0,a.useMemo)(()=>`${s.replace(/\/+$/,``)}/v1/share-links?object=${encodeURIComponent(n)}&recordId=${encodeURIComponent(r)}`,[s,n,r]),T=(0,a.useCallback)(async()=>{m(!0),v(null);try{let e=await C(),t=await fetch(w,{headers:e,credentials:`include`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();f(n.links??n.data??[])}catch(e){v(e?.message??`Failed to load share links`)}finally{m(!1)}},[w,C]);(0,a.useEffect)(()=>{e&&(T(),b(wl))},[e,T]);let E=(0,a.useCallback)(async()=>{g(!0),v(null);try{let e=y.expiresInDays==null?void 0:new Date(Date.now()+y.expiresInDays*24*60*60*1e3).toISOString(),t=await C(),i=await fetch(`${s.replace(/\/+$/,``)}/v1/share-links`,{method:`POST`,headers:t,credentials:`include`,body:JSON.stringify({object:n,recordId:r,permission:y.permission,audience:y.audience,expiresAt:e,password:y.password.trim()||void 0,label:y.label.trim()||void 0})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.error?.message||`HTTP ${i.status}`)}let a=await i.json(),o=a.link??a.data;if(!o)throw Error(`Share link create response missing link payload`);f(e=>[o,...e]),await Ol(Dl(l,o.token))&&(S(o.id),setTimeout(()=>S(null),1500)),b(wl)}catch(e){v(e?.message??`Failed to create share link`)}finally{g(!1)}},[s,C,n,r,y,l]),D=(0,a.useCallback)(async e=>{try{let t=await C(),n=await fetch(`${s.replace(/\/+$/,``)}/v1/share-links/${encodeURIComponent(e.id)}`,{method:`DELETE`,headers:t,credentials:`include`});if(!n.ok&&n.status!==204)throw Error(`HTTP ${n.status}`);f(t=>t.map(t=>t.id===e.id?{...t,revoked_at:new Date().toISOString()}:t))}catch(e){v(e?.message??`Failed to revoke link`)}},[s,C]),O=(0,a.useCallback)(async e=>{await Ol(Dl(l,e.token))&&(S(e.id),setTimeout(()=>S(null),1500))},[l]),k=d.filter(e=>!e.revoked_at),A=d.filter(e=>e.revoked_at);return(0,o.jsx)(Tt,{open:e,onOpenChange:t,children:(0,o.jsxs)(At,{className:`max-w-xl`,"data-testid":`share-dialog`,children:[(0,o.jsxs)(jt,{children:[(0,o.jsxs)(Nt,{className:`flex items-center gap-2`,children:[(0,o.jsx)(c.Link2,{className:`h-4 w-4`}),`Share `,i??`this record`]}),(0,o.jsx)(Pt,{children:`Generate a link anyone (or selected people) can use to open this record. Links can be revoked at any time.`})]}),_&&(0,o.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,"data-testid":`share-dialog-error`,children:_}),(0,o.jsxs)(`section`,{className:`space-y-3 rounded-lg border bg-muted/30 p-3`,children:[(0,o.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(G,{className:`text-xs`,children:`Who can access`}),(0,o.jsxs)(Rr,{value:y.audience,onValueChange:e=>b(t=>({...t,audience:e})),children:[(0,o.jsx)(q,{className:`h-8 text-xs`,"data-testid":`share-audience`,children:(0,o.jsx)(Br,{})}),(0,o.jsx)(J,{children:El.map(e=>(0,o.jsx)(Y,{value:e.value,className:`text-xs`,children:(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[(0,o.jsx)(`span`,{children:e.label}),(0,o.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.help})]})},e.value))})]})]}),(0,o.jsxs)(`div`,{className:`space-y-1`,children:[(0,o.jsx)(G,{className:`text-xs`,children:`Expires in`}),(0,o.jsxs)(Rr,{value:y.expiresInDays==null?`never`:String(y.expiresInDays),onValueChange:e=>b(t=>({...t,expiresInDays:e===`never`?null:Number(e)})),children:[(0,o.jsx)(q,{className:`h-8 text-xs`,"data-testid":`share-expiry`,children:(0,o.jsx)(Br,{})}),(0,o.jsx)(J,{children:Tl.map(e=>(0,o.jsx)(Y,{value:e.value==null?`never`:String(e.value),className:`text-xs`,children:e.label},String(e.value)))})]})]}),(0,o.jsxs)(`div`,{className:`space-y-1 sm:col-span-2`,children:[(0,o.jsx)(G,{className:`text-xs`,children:`Password (optional)`}),(0,o.jsx)(K,{type:`password`,value:y.password,onChange:e=>b(t=>({...t,password:e.target.value})),placeholder:`Require a password to open`,className:`h-8 text-xs`,"data-testid":`share-password`})]}),(0,o.jsxs)(`div`,{className:`space-y-1 sm:col-span-2`,children:[(0,o.jsx)(G,{className:`text-xs`,children:`Label (only you see this)`}),(0,o.jsx)(K,{value:y.label,onChange:e=>b(t=>({...t,label:e.target.value})),placeholder:`e.g. Sent to design review`,className:`h-8 text-xs`,"data-testid":`share-label`})]})]}),(0,o.jsx)(`div`,{className:`flex justify-end`,children:(0,o.jsxs)(V,{size:`sm`,onClick:E,disabled:h,"data-testid":`share-create`,children:[h?(0,o.jsx)(c.Loader2,{className:`mr-1 h-3 w-3 animate-spin`}):(0,o.jsx)(c.Link2,{className:`mr-1 h-3 w-3`}),`Create link`]})})]}),(0,o.jsxs)(`section`,{className:`space-y-2`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,o.jsxs)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:[`Existing links`,k.length?` (${k.length})`:``]}),p&&(0,o.jsx)(c.Loader2,{className:`h-3 w-3 animate-spin text-muted-foreground`})]}),!p&&k.length===0&&A.length===0&&(0,o.jsx)(`p`,{className:`rounded-md border border-dashed px-3 py-4 text-center text-xs text-muted-foreground`,children:`No share links yet. Create one above.`}),(0,o.jsxs)(`ul`,{className:`space-y-2`,children:[k.map(e=>(0,o.jsx)(Al,{link:e,copied:x===e.id,onCopy:()=>O(e),onRevoke:()=>D(e),publicBaseUrl:l},e.id)),A.length>0&&(0,o.jsx)(`li`,{className:`pt-2 text-[10px] uppercase tracking-wide text-muted-foreground`,children:`Revoked`}),A.map(e=>(0,o.jsx)(Al,{link:e,copied:!1,onCopy:()=>O(e),onRevoke:()=>D(e),publicBaseUrl:l,disabled:!0},e.id))]})]}),(0,o.jsx)(Mt,{children:(0,o.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>t(!1),children:`Done`})})]})})}function Al({link:e,copied:t,onCopy:n,onRevoke:r,publicBaseUrl:i,disabled:a}){let s=Dl(i,e.token);return(0,o.jsxs)(`li`,{className:z(`flex items-center gap-2 rounded-md border bg-card px-2 py-2 text-xs`,a&&`opacity-60`),"data-testid":`share-link-row`,children:[(0,o.jsx)(He,{variant:`secondary`,className:`text-[10px] capitalize`,children:e.audience.replace(`_`,` `)}),(0,o.jsx)(He,{variant:`outline`,className:`text-[10px] capitalize`,children:e.permission}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`div`,{className:`truncate font-mono text-[11px]`,title:s,children:s}),e.label&&(0,o.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.label})]}),!a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(V,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:n,"data-testid":`share-link-copy`,children:[(0,o.jsx)(c.Copy,{className:`mr-1 h-3 w-3`}),t?`Copied!`:`Copy`]}),(0,o.jsx)(V,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive`,onClick:r,"data-testid":`share-link-revoke`,title:`Revoke`,children:(0,o.jsx)(c.Trash2,{className:`h-3 w-3`})})]}),a&&(0,o.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,o.jsx)(c.ShieldOff,{className:`h-3 w-3`}),`revoked`]})]})}function jl(){return!0}e.Accordion=be,e.AccordionContent=Ce,e.AccordionItem=xe,e.AccordionTrigger=Se,e.ActionParamDialog=Os,e.Alert=W,e.AlertDescription=Ie,e.AlertDialog=H,e.AlertDialogAction=Ne,e.AlertDialogCancel=Pe,e.AlertDialogContent=Oe,e.AlertDialogDescription=Me,e.AlertDialogFooter=Ae,e.AlertDialogHeader=ke,e.AlertDialogOverlay=De,e.AlertDialogPortal=Ee,e.AlertDialogTitle=je,e.AlertDialogTrigger=Te,e.AlertTitle=Fe,e.AspectRatio=Le,e.Avatar=Re,e.AvatarFallback=Be,e.AvatarImage=ze,e.Badge=He,e.Breadcrumb=Ue,e.BreadcrumbEllipsis=Ye,e.BreadcrumbItem=Ge,e.BreadcrumbLink=Ke,e.BreadcrumbList=We,e.BreadcrumbPage=qe,e.BreadcrumbSeparator=Je,e.Button=V,e.ButtonGroup=vo,e.ButtonGroupSeparator=bo,e.ButtonGroupText=yo,e.Calendar=Xe,e.CalendarDayButton=Ze,e.Card=Qe,e.CardContent=nt,e.CardDescription=tt,e.CardFooter=rt,e.CardHeader=$e,e.CardTitle=et,e.Carousel=ot,e.CarouselContent=st,e.CarouselItem=ct,e.CarouselNext=ut,e.CarouselPrevious=lt,e.ChartContainer=mt,e.ChartLegend=vt,e.ChartLegendContent=yt,e.ChartSkeleton=Ns,e.ChartStyle=ht,e.ChartTooltip=gt,e.ChartTooltipContent=_t,e.Checkbox=xt,e.Collapsible=St,e.CollapsibleContent=wt,e.CollapsibleTrigger=Ct,e.Combobox=xo,e.Command=Ft,e.CommandDialog=It,e.CommandEmpty=zt,e.CommandGroup=Bt,e.CommandInput=Lt,e.CommandItem=Ht,e.CommandList=Rt,e.CommandSeparator=Vt,e.CommandShortcut=Ut,e.ConfigFieldRenderer=Ho,e.ConfigPanelRenderer=Wo,e.ConfigRow=So,e.ContextMenu=Wt,e.ContextMenuCheckboxItem=en,e.ContextMenuContent=Qt,e.ContextMenuGroup=Kt,e.ContextMenuItem=$t,e.ContextMenuLabel=nn,e.ContextMenuPortal=qt,e.ContextMenuRadioGroup=Yt,e.ContextMenuRadioItem=tn,e.ContextMenuSeparator=rn,e.ContextMenuShortcut=an,e.ContextMenuSub=Jt,e.ContextMenuSubContent=Zt,e.ContextMenuSubTrigger=Xt,e.ContextMenuTrigger=Gt,e.DataEmptyState=Ws,e.EmptyState=Ws,e.DataErrorState=Gs,e.DataLoadingState=Us,e.DatePicker=Go,e.DebugPanel=Cl,e.Dialog=Tt,e.DialogClose=Ot,e.DialogContent=At,e.DialogDescription=Pt,e.DialogFooter=Mt,e.DialogHeader=jt,e.DialogOverlay=kt,e.DialogPortal=Dt,e.DialogTitle=Nt,e.DialogTrigger=Et,e.Drawer=on,e.DrawerClose=ln,e.DrawerContent=dn,e.DrawerDescription=hn,e.DrawerFooter=pn,e.DrawerHeader=fn,e.DrawerOverlay=un,e.DrawerPortal=cn,e.DrawerTitle=mn,e.DrawerTrigger=sn,e.DropdownMenu=gn,e.DropdownMenuCheckboxItem=En,e.DropdownMenuContent=wn,e.DropdownMenuGroup=vn,e.DropdownMenuItem=Tn,e.DropdownMenuLabel=On,e.DropdownMenuPortal=yn,e.DropdownMenuRadioGroup=xn,e.DropdownMenuRadioItem=Dn,e.DropdownMenuSeparator=kn,e.DropdownMenuShortcut=An,e.DropdownMenuSub=bn,e.DropdownMenuSubContent=Cn,e.DropdownMenuSubTrigger=Sn,e.DropdownMenuTrigger=_n,e.Empty=qo,e.EmptyContent=$o,e.EmptyDescription=Qo,e.EmptyHeader=Jo,e.EmptyMedia=Xo,e.EmptyTitle=Zo,e.EmptyValue=es,e.ExportProgressDialog=Js,e.Field=ns,e.FilterBuilder=Ro,e.Form=Mn,e.FormControl=zn,e.FormDescription=Bn,e.FormField=Pn,e.FormItem=Ln,e.FormLabel=Rn,e.FormMessage=Vn,e.FormSkeleton=js,e.GridSkeleton=ks,e.GroupingEditor=Ds,e.HoverCard=Hn,e.HoverCardContent=Wn,e.HoverCardTrigger=Un,e.Input=K,e.InputGroup=rs,e.InputOTP=Gn,e.InputOTPGroup=Kn,e.InputOTPSeparator=Jn,e.InputOTPSlot=qn,e.Item=ss,e.ItemActions=ps,e.ItemContent=us,e.ItemDescription=fs,e.ItemFooter=hs,e.ItemGroup=is,e.ItemHeader=ms,e.ItemMedia=ls,e.ItemSeparator=as,e.ItemTitle=ds,e.KanbanSkeleton=As,e.Kbd=gs,e.KbdGroup=_s,e.Label=G,e.LazyIcon=ka,e.ListSkeleton=Ms,e.LookupValuePicker=zo,e.Menubar=er,e.MenubarCheckboxItem=or,e.MenubarContent=ir,e.MenubarGroup=Xn,e.MenubarItem=ar,e.MenubarLabel=cr,e.MenubarMenu=Yn,e.MenubarPortal=Zn,e.MenubarRadioGroup=Qn,e.MenubarRadioItem=sr,e.MenubarSeparator=lr,e.MenubarShortcut=ur,e.MenubarSub=$n,e.MenubarSubContent=rr,e.MenubarSubTrigger=nr,e.MenubarTrigger=tr,e.MobileDialogContent=Ks,e.NativeSelect=vs,e.NavigationMenu=dr,e.NavigationMenuContent=gr,e.NavigationMenuIndicator=yr,e.NavigationMenuItem=pr,e.NavigationMenuLink=_r,e.NavigationMenuList=fr,e.NavigationMenuTrigger=hr,e.NavigationMenuViewport=vr,e.NavigationOverlay=ws,e.Pagination=br,e.PaginationContent=xr,e.PaginationEllipsis=Er,e.PaginationItem=Sr,e.PaginationLink=Cr,e.PaginationNext=Tr,e.PaginationPrevious=wr,e.Popover=Dr,e.PopoverContent=kr,e.PopoverTrigger=Or,e.Progress=Ar,e.RadioGroup=jr,e.RadioGroupItem=Mr,e.RecordTitleChip=zs,e.RefreshIndicator=Hs,e.RelatedCountStore=Mc,e.ResizableHandle=Fr,e.ResizablePanel=Pr,e.ResizablePanelGroup=Nr,e.ScrollArea=Ir,e.ScrollBar=Lr,e.SectionHeader=Uo,e.Select=Rr,e.SelectContent=J,e.SelectGroup=zr,e.SelectItem=Y,e.SelectLabel=Ur,e.SelectScrollDownButton=Hr,e.SelectScrollUpButton=Vr,e.SelectSeparator=Wr,e.SelectTrigger=q,e.SelectValue=Br,e.Separator=Gr,e.ShareDialog=kl,e.Sheet=Kr,e.SheetClose=Jr,e.SheetContent=Qr,e.SheetDescription=ni,e.SheetFooter=ei,e.SheetHeader=$r,e.SheetOverlay=Xr,e.SheetPortal=Yr,e.SheetTitle=ti,e.SheetTrigger=qr,e.ShimmerSkeleton=Fs,e.Sidebar=vi,e.SidebarContent=Ei,e.SidebarFooter=wi,e.SidebarGroup=Di,e.SidebarGroupAction=ki,e.SidebarGroupContent=Ai,e.SidebarGroupLabel=Oi,e.SidebarHeader=Ci,e.SidebarInput=Si,e.SidebarInset=xi,e.SidebarMenu=ji,e.SidebarMenuAction=Fi,e.SidebarMenuBadge=Ii,e.SidebarMenuButton=Pi,e.SidebarMenuItem=Mi,e.SidebarMenuSkeleton=Li,e.SidebarMenuSub=Ri,e.SidebarMenuSubButton=Bi,e.SidebarMenuSubItem=zi,e.SidebarProvider=_i,e.SidebarRail=bi,e.SidebarSeparator=Ti,e.SidebarTrigger=yi,e.Skeleton=X,e.Slider=Vi,e.SortBuilder=Vo,e.Spinner=Ts,e.Switch=Ui,e.Table=Wi,e.TableBody=Ki,e.TableCaption=Zi,e.TableCell=Xi,e.TableFooter=qi,e.TableHead=Yi,e.TableHeader=Gi,e.TableRow=Ji,e.Tabs=Qi,e.TabsContent=ta,e.TabsList=$i,e.TabsTrigger=ea,e.Textarea=na,e.Toaster=Hi,e.Toggle=ia,e.ToggleGroup=oa,e.ToggleGroupItem=sa,e.Tooltip=oi,e.TooltipContent=ci,e.TooltipProvider=ai,e.TooltipTrigger=si,e.TypographyBlockquote=pa,e.TypographyH1=ca,e.TypographyH2=la,e.TypographyH3=ua,e.TypographyH4=da,e.TypographyInlineCode=ha,e.TypographyLarge=_a,e.TypographyLead=ga,e.TypographyList=ma,e.TypographyMuted=ya,e.TypographyP=fa,e.TypographySmall=va,e.ViewSkeleton=Ps,e.badgeVariants=Ve,e.buttonGroupVariants=_o,e.buttonVariants=we,e.cn=z,Object.defineProperty(e,"cva",{enumerable:!0,get:function(){return d.cva}}),e.getLazyIcon=Oa,e.initializeComponents=jl,e.navigationMenuTriggerStyle=mr,e.registerPlaceholders=ll,e.renderChildren=B,e.toKebabIconName=wa,e.toast=P.toast,e.toggleVariants=ra,e.useConfigDraft=ul,e.useExportJob=ml,e.useFormField=Fn,e.useIsMobile=ii,e.useRelatedCount=jc,e.useResizeObserver=dl,e.useSidebar=gi});
|