@vertesia/ui 1.5.0 → 1.5.1
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/lib/core/components/SelectList.d.ts.map +1 -1
- package/lib/core/components/SelectList.js +3 -3
- package/lib/core/components/SelectList.js.map +1 -1
- package/lib/core/components/SidePanel.d.ts.map +1 -1
- package/lib/core/components/SidePanel.js +2 -1
- package/lib/core/components/SidePanel.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.js +51 -17
- package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +5 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +9 -2
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentPlans.d.ts +1 -1
- package/lib/features/agent/chat/hooks/useAgentPlans.d.ts.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentPlans.js +5 -5
- package/lib/features/agent/chat/hooks/useAgentPlans.js.map +1 -1
- package/lib/features/magic-pdf/GroundedExtractionView.js +3 -3
- package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.d.ts +2 -2
- package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.js +9 -7
- package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.js +7 -3
- package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
- package/lib/features/oauth/useMcpConnections.d.ts +4 -2
- package/lib/features/oauth/useMcpConnections.d.ts.map +1 -1
- package/lib/features/oauth/useMcpConnections.js +15 -9
- package/lib/features/oauth/useMcpConnections.js.map +1 -1
- package/lib/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -1
- package/lib/features/store/objects/selection/ObjectsActionContext.js +2 -0
- package/lib/features/store/objects/selection/ObjectsActionContext.js.map +1 -1
- package/lib/features/store/objects/selection/SelectionActions.d.ts +4 -2
- package/lib/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
- package/lib/features/store/objects/selection/SelectionActions.js +6 -3
- package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/features/store/objects/selection/actions/RunIntakeAction.d.ts +8 -0
- package/lib/features/store/objects/selection/actions/RunIntakeAction.d.ts.map +1 -0
- package/lib/features/store/objects/selection/actions/RunIntakeAction.js +65 -0
- package/lib/features/store/objects/selection/actions/RunIntakeAction.js.map +1 -0
- package/lib/features/store/objects/selection/actions/index.d.ts +1 -0
- package/lib/features/store/objects/selection/actions/index.d.ts.map +1 -1
- package/lib/features/store/objects/selection/actions/index.js +1 -0
- package/lib/features/store/objects/selection/actions/index.js.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.js +11 -3
- package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.js +14 -14
- package/lib/features/store/types/IntakePolicyEditor.js.map +1 -1
- package/lib/features/store/types/TypeRegistry.d.ts +275 -150
- package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
- package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +275 -150
- package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
- package/lib/i18n/locales/ar.json +28 -7
- package/lib/i18n/locales/de.json +24 -7
- package/lib/i18n/locales/en.json +24 -7
- package/lib/i18n/locales/es.json +24 -7
- package/lib/i18n/locales/fr.json +25 -7
- package/lib/i18n/locales/it.json +24 -7
- package/lib/i18n/locales/ja.json +24 -7
- package/lib/i18n/locales/ko.json +24 -7
- package/lib/i18n/locales/pt.json +24 -7
- package/lib/i18n/locales/ru.json +26 -7
- package/lib/i18n/locales/tr.json +24 -7
- package/lib/i18n/locales/zh-TW.json +24 -7
- package/lib/i18n/locales/zh.json +24 -7
- package/lib/shell/apps/AppInstallationProvider.d.ts +4 -4
- package/lib/shell/login/SignInIcons.d.ts.map +1 -1
- package/lib/shell/login/SignInIcons.js +2 -1
- package/lib/shell/login/SignInIcons.js.map +1 -1
- package/lib/shell/login/SignInPasswordStep.d.ts +9 -0
- package/lib/shell/login/SignInPasswordStep.d.ts.map +1 -0
- package/lib/shell/login/SignInPasswordStep.js +58 -0
- package/lib/shell/login/SignInPasswordStep.js.map +1 -0
- package/lib/shell/login/SignInPrimitives.d.ts +13 -0
- package/lib/shell/login/SignInPrimitives.d.ts.map +1 -1
- package/lib/shell/login/SignInPrimitives.js +11 -1
- package/lib/shell/login/SignInPrimitives.js.map +1 -1
- package/lib/shell/login/SignInProvidersStep.d.ts +3 -1
- package/lib/shell/login/SignInProvidersStep.d.ts.map +1 -1
- package/lib/shell/login/SignInProvidersStep.js +4 -2
- package/lib/shell/login/SignInProvidersStep.js.map +1 -1
- package/lib/shell/login/SignInReturningStep.d.ts +3 -1
- package/lib/shell/login/SignInReturningStep.d.ts.map +1 -1
- package/lib/shell/login/SignInReturningStep.js +18 -8
- package/lib/shell/login/SignInReturningStep.js.map +1 -1
- package/lib/shell/login/SignInTenantStep.d.ts +3 -1
- package/lib/shell/login/SignInTenantStep.d.ts.map +1 -1
- package/lib/shell/login/SignInTenantStep.js +2 -2
- package/lib/shell/login/SignInTenantStep.js.map +1 -1
- package/lib/shell/login/SignInWithProviderButton.d.ts +5 -3
- package/lib/shell/login/SignInWithProviderButton.d.ts.map +1 -1
- package/lib/shell/login/SignInWithProviderButton.js +8 -7
- package/lib/shell/login/SignInWithProviderButton.js.map +1 -1
- package/lib/shell/login/SigninScreen.d.ts.map +1 -1
- package/lib/shell/login/SigninScreen.js +13 -4
- package/lib/shell/login/SigninScreen.js.map +1 -1
- package/lib/shell/login/signInUtils.d.ts +20 -4
- package/lib/shell/login/signInUtils.d.ts.map +1 -1
- package/lib/shell/login/signInUtils.js +47 -1
- package/lib/shell/login/signInUtils.js.map +1 -1
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +14 -14
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.BoNE1APG.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.BoNE1APG.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.BoPtiSPb.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.BoPtiSPb.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.C4BBW5v5.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.C4BBW5v5.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.C81wuNkY.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.C81wuNkY.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.C9GipKIH.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.C9GipKIH.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.CWsoS0W9.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.CWsoS0W9.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.Cr9NtzZB.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.Cr9NtzZB.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.DEpkHOD5.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.DEpkHOD5.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.DPXaRKFO.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.DPXaRKFO.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.D_QNm1Xg.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.D_QNm1Xg.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.F26Cc0f7.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.F26Cc0f7.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.YkXIESV_.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.YkXIESV_.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.js +3 -3
- package/lib/vertesia-ui-i18n.js.map +1 -1
- package/lib/vertesia-ui-shell.js +15 -9
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/widgets/xml-viewer/hooks/useCollapsible.d.ts +1 -1
- package/package.json +7 -7
- package/src/core/components/SelectList.tsx +5 -2
- package/src/core/components/SidePanel.tsx +65 -60
- package/src/features/agent/chat/ModernAgentConversation.test.tsx +150 -1
- package/src/features/agent/chat/ModernAgentConversation.tsx +59 -21
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +17 -1
- package/src/features/agent/chat/hooks/useAgentPlans.test.ts +52 -0
- package/src/features/agent/chat/hooks/useAgentPlans.ts +5 -5
- package/src/features/magic-pdf/GroundedExtractionView.tsx +3 -3
- package/src/features/oauth/McpConnectionsButton.test.tsx +56 -0
- package/src/features/oauth/McpConnectionsButton.tsx +9 -6
- package/src/features/oauth/McpConnectionsDialog.tsx +14 -5
- package/src/features/oauth/useMcpConnections.test.ts +10 -0
- package/src/features/oauth/useMcpConnections.ts +18 -10
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +2 -0
- package/src/features/store/objects/selection/SelectionActions.tsx +13 -6
- package/src/features/store/objects/selection/actions/RunIntakeAction.tsx +69 -0
- package/src/features/store/objects/selection/actions/index.ts +1 -0
- package/src/features/store/types/ContentObjectTypesTable.tsx +20 -3
- package/src/features/store/types/IntakePolicyEditor.tsx +33 -28
- package/src/i18n/locales/ar.json +28 -7
- package/src/i18n/locales/de.json +24 -7
- package/src/i18n/locales/en.json +24 -7
- package/src/i18n/locales/es.json +24 -7
- package/src/i18n/locales/fr.json +25 -7
- package/src/i18n/locales/it.json +24 -7
- package/src/i18n/locales/ja.json +24 -7
- package/src/i18n/locales/ko.json +24 -7
- package/src/i18n/locales/pt.json +24 -7
- package/src/i18n/locales/ru.json +26 -7
- package/src/i18n/locales/tr.json +24 -7
- package/src/i18n/locales/zh-TW.json +24 -7
- package/src/i18n/locales/zh.json +24 -7
- package/src/shell/login/SignInIcons.tsx +2 -1
- package/src/shell/login/SignInPasswordRequired.test.tsx +82 -0
- package/src/shell/login/SignInPasswordStep.test.tsx +71 -0
- package/src/shell/login/SignInPasswordStep.tsx +103 -0
- package/src/shell/login/SignInPrimitives.tsx +53 -1
- package/src/shell/login/SignInProvidersStep.tsx +8 -4
- package/src/shell/login/SignInReturningStep.tsx +20 -8
- package/src/shell/login/SignInTenantStep.tsx +6 -2
- package/src/shell/login/SignInWithProviderButton.tsx +11 -7
- package/src/shell/login/SigninScreen.tsx +32 -3
- package/src/shell/login/signInPassword.test.ts +133 -0
- package/src/shell/login/signInUtils.ts +60 -7
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.d.ts +0 -7
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.d.ts.map +0 -1
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js +0 -51
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js.map +0 -1
- package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.DN79y06J.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.DN79y06J.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js.map +0 -1
- package/src/features/store/objects/selection/actions/StartWorkflowButton.tsx +0 -104
package/lib/vertesia-ui-core.js
CHANGED
|
@@ -281,7 +281,7 @@ let n=p(({className:n,...r},i)=>f(je,{ref:i,iconNode:t,className:Ce(`lucide-${we
|
|
|
281
281
|
|
|
282
282
|
`,DT=({filterValues:r,setFilterValues:i,isRange:a=!1})=>{let[o,s]=w(!1),[c,l]=w([null,null]),{t:u}=k(),d=r[0]?Q(r[0]).toDate():void 0,f=a?[c[0]||(r[0]?Q(r[0]).toDate():null),c[1]||(r[1]?Q(r[1]).toDate():null)]:[null,null];_(()=>{a&&l([r[0]?Q(r[0]).toDate():null,r[1]?Q(r[1]).toDate():null])},[r,a]);let p=()=>a?f[0]&&f[1]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`-`}),t(`span`,{className:`font-medium`,children:Q(f[1]).format(`MMMM DD, YYYY`)})]}):f[0]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`- Select end`})]}):t(`span`,{className:`text-muted`,children:u(`filter.selectRange`)}):d?Q(d).format(`MMMM DD, YYYY`):`Pick a date`,m=e=>{if(a)Array.isArray(e)&&(l([e[0],e[1]]),e[0]&&e[1]?i([Q(e[0]).format(`YYYY-MM-DD`),Q(e[1]).format(`YYYY-MM-DD`)]):e[0]&&i([Q(e[0]).format(`YYYY-MM-DD`)]));else if(e){let t=Array.isArray(e)?e[0]:e;t&&(i([Q(t).format(`YYYY-MM-DD`)]),s(!1))}};return n(yT,{_open:o,onOpenChange:s,children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center min-h-[20px]`,children:p()})}),t(CT,{className:`w-auto p-0`,align:`start`,side:`bottom`,alignOffset:-4,sideOffset:6,children:t(`div`,{className:`p-2`,children:a?n(e,{children:[n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:f,onChange:m,selectRange:!0,returnValue:`range`,maxDate:(()=>{let e=new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(f[0]){let e=f[0].getTime();if(f[1]){let n=f[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}})]}),f[0]&&f[1]&&t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(U,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{let e=new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(d&&t===d.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})})]})};function OT({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=w(i||n),[s,c]=w(!1);return _(()=>{if(!r){o(i||n);return}(async()=>{c(!0);try{let e=r(n);if(e instanceof Promise){let t=await e;o(t)}else o(e)}catch(e){console.error(`Error rendering label:`,e),o(i||n)}finally{c(!1)}})()},[n,r,i]),s?t(`span`,{className:`text-muted`,children:`Loading...`}):t(e,{children:a})}const kT=({filterType:r,filterValues:i,setFilterValues:a,options:o,labelRenderer:s,multiple:c=!0})=>{let[l,u]=w(!1),[d,f]=w(``),p=C(null),{t:m}=k(),h=o?.filter(e=>!i.some(t=>t.value===e.value));return n(yT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-info shrink-0`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:i?.length===1?(()=>{let e=i[0];return t(OT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(CT,{className:`w-[300px] p-0`,children:t(Wx,{children:n(dv,{children:[t(pv,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(mv,{children:[t(hv,{children:m(`filter.noResultsFound`)}),t(gv,{children:i.map(e=>n(vv,{className:`group flex gap-2 items-center`,onSelect:()=>{a(i.filter(t=>t.value!==e.value)),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(`input`,{type:`checkbox`,checked:!0,onChange:()=>{}}),t(OT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(_v,{}),t(gv,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(vv,{className:`group flex gap-2 items-center`,value:String(e.label||e.value),onSelect:()=>{let t={value:e.value,label:e.label};a(c?[...i,t]:[t]),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(rg,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(OT,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},AT=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(yT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r.length>0?r.length===1?r[0]:`${r.length} tags`:`Add tags...`})}),t(CT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-3`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(Ki,{value:s,onChange:c,placeholder:`Add ${e.toLowerCase()}...`}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},jT=A(``,{variants:{size:{xs:`rounded py-1 text-xs rounded-xs`,sm:`rounded text-xs rounded-sm`,md:`rounded-md py-2 text-sm`,lg:`rounded-md text-base`,xl:`rounded-md py-2.5 text-lg`},variant:{default:`flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,unstyled:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,noPadding:`block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`,legacy:`py-1.5 block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`}},defaultVariants:{size:`md`,variant:`default`}}),MT=a.forwardRef(({className:e,type:r,size:i=`md`,variant:a=`default`,clearable:o=!0,onChange:s,value:c,invalid:l,...u},d)=>{let f=()=>{s?.(``)},p=e=>{s?.(e.target.value)},m=u[`aria-invalid`]??(l?!0:void 0);return n(`div`,{className:`w-full relative inline-block [&:hover_.clear-button]:opacity-100`,children:[t(`input`,{type:r,className:z(jT({size:i,variant:a}),e,o&&c?`pe-8`:``),ref:d,value:c??``,onChange:p,...u,"aria-invalid":m}),o&&c&&!u.readOnly&&!u.disabled&&t(U,{variant:`link`,size:`icon`,type:`button`,onClick:f,className:`clear-button opacity-0 transition-opacity duration-200
|
|
283
283
|
absolute top-1/2 -translate-y-1/2 text-muted !hover:text-destructive cursor-pointer
|
|
284
|
-
flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(Ze,{size:16})})]})});MT.displayName=`Input`;const NT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(yT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r||`Enter text...`})}),t(CT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:s,onChange:c,onKeyDown:e=>{e.key===`Enter`&&(i(s),o(!1))},placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function PT({selectedView:r,selectedDate:i,setSelectedDate:a,setFilters:o,filters:s,handleClose:c,filterGroups:l}){let{t:u}=k(),[d,f]=w([null,null]),[p,m]=w([null,null]),h=l.find(e=>e.name===r),g=h?.multiple,_=new Date;_.setHours(23,59,59,999);let v=[p[0]||d[0],p[1]||d[1]],y=e=>{if(g)Array.isArray(e)?(m([e[0],e[1]]),f([e[0],e[1]])):(m([e,null]),f([e,null]));else{let t=Array.isArray(e)?e[0]:e;if(a(t||void 0),t){let e=new Date(t);e.setHours(0,0,0,0),o([...s,{name:r||``,placeholder:h?.placeholder,value:[{value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}],type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}}};return t(`div`,{className:`p-2`,children:g?n(e,{children:[t(`div`,{children:g?v[0]&&v[1]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:u(`filter.to`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[1]).format(`MMMM DD, YYYY`)})]}):v[0]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`→ Select end date`})]}):t(`span`,{className:`text-muted text-xs`,children:h?.placeholder||h?.name||r||`Select date range`}):i?Q(i).format(`MMMM DD, YYYY`):`Pick a date`}),n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:v,onChange:y,selectRange:!0,returnValue:`range`,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(v[0]){let e=v[0].getTime();if(v[1]){let n=v[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{if(d[0]){let e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);let n=[];n.push({value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:Q(t).format(`LLL dd, y`)}),o([...s,{name:r||``,placeholder:h?.placeholder,value:n,type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}},disabled:!v[0],children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:i,onChange:y,selectRange:!1,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(i&&t===i.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})}function FT({selectedView:e,commandInput:r,setFilters:i,handleClose:a,filterGroups:o}){let[s,c]=w([]),l=e=>{let t=o.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){let e=r.toLowerCase();return n.filter(n=>n.value!==void 0&&t.filterBy?.(n.value,e))}let i=r.toLowerCase();return n.filter(e=>String(e.value||``).toLowerCase().includes(i))};if(!e)return null;let u=l(e),d=o.find(t=>t.name===e),f=d?.placeholder||d?.name,p=()=>{s.length>0&&i(t=>[...t.filter(t=>t.name!==e),{name:e||``,placeholder:d?.placeholder||``,value:s,type:d?.type||`select`,multiple:d?.multiple||!1}]),a()},m=t=>{let n={value:t.value,label:t.label};d?.multiple?s.some(e=>e.value===t.value)?c(e=>e.filter(e=>e.value!==t.value)):c(e=>[...e,n]):(i(t=>{let r=t.findIndex(t=>t.name===e);if(r>=0){let e=[...t];return e[r]={...e[r],value:[n]},e}return[...t,{name:e||``,placeholder:d?.placeholder||``,value:[n],type:d?.type||`select`,multiple:d?.multiple||!1}]}),a())};return n(`div`,{className:`flex flex-col h-full`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted shrink-0`,children:t(`span`,{children:f})}),t(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:t(`div`,{className:`max-h-[200px] overflow-y-auto`,children:u.length>0&&u.map(e=>{let r=s.some(t=>t.value===e.value);return n(vv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(OT,{value:e.value||``,labelRenderer:e.labelRenderer||d?.labelRenderer,fallbackLabel:e.label}),d?.multiple&&r&&t(`span`,{className:`ms-auto text-xs text-success`,children:`✓`})]},e.value||`option-${Math.random()}`)})})}),d?.multiple&&t(`div`,{className:`p-2 border-t shrink-0`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(U,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function IT({selectedView:e,setFilters:r,handleClose:i,filterGroups:a}){let[o,s]=w([]),c=a.find(t=>t.name===e);return n(`div`,{className:`p-2 space-y-3`,children:[t(`div`,{className:`space-y-2`,children:t(Ki,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{o.length>0&&r(t=>[...t.filter(t=>t.name!==e),{name:e,placeholder:c?.placeholder,value:o,type:`stringList`}]),i()},disabled:o.length===0,children:`Apply`})]})]})}function LT({selectedView:e,textValue:r,setTextValue:i,setFilters:a,handleClose:o,filterGroups:s}){let c=()=>{a(t=>[...t,{name:e||``,placeholder:s.find(t=>t.name===e)?.placeholder,value:[{value:r,label:r}],type:`text`}]),o()};return n(`div`,{className:`p-2 flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:s.find(t=>t.name===e)?.placeholder})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:r,onChange:i,onKeyDown:e=>e.key===`Enter`&&c(),placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(U,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function RT(e,n,r){switch(e.type){case`date`:return t(DT,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Q(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(NT,{filterType:e.placeholder||e.name,filterValue:Array.isArray(e.value)&&e.value[0]&&typeof e.value[0]==`object`&&e.value[0].value||``,setFilterValue:t=>{n(n=>n.map(n=>n===e?{...n,value:[{value:t,label:t}]}:n))}});case`stringList`:return t(AT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`string`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))}});default:{let i=r.find(t=>t.name===e.name);return t(kT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))},options:i?.options||[],labelRenderer:i?.labelRenderer,multiple:e.multiple??i?.multiple})}}}function zT({filters:e,setFilters:r,filterGroups:i}){return t(`div`,{className:`flex gap-2 flex-wrap justify-start`,children:e.filter(e=>e.value?.length>0).map(e=>n(`div`,{className:`flex gap-[1px] items-center text-sm`,children:[t(`div`,{className:`flex gap-1.5 shrink-0 rounded-s bg-muted p-1.5 h-8 items-center`,children:e.placeholder||e.name}),RT(e,r,i),t(U,{variant:`ghost`,size:`icon`,onClick:()=>{r(t=>t.filter(t=>t!==e))},className:`bg-muted rounded-s-none rounded-e-sm size-8 hover:text-info hover:bg-muted/50 transition shrink-0`,children:t(Ze,{className:`size-6`})})]},`${e.name}-${e.type===`date`?`date`:e.type===`stringList`&&typeof e.value[0]==`string`?e.value.join(`,`):Array.isArray(e.value)?e.value.map(e=>e.value).join(`,`):``}`))})}const BT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),VT=({filters:e,setFilters:n,filterGroups:r,children:i,inModal:a})=>{let s=new URL(window.location.href).searchParams.toString(),[c]=o.useState(()=>new URLSearchParams(window.location.search).get(`filters`)),l=o.useRef(new Set),u=o.useRef(a||!c);return _(()=>{if(!a&&u.current)try{let t=new URLSearchParams(s);if(e.length>0){let n=e.map(e=>{let t;if(e.type===`stringList`&&Array.isArray(e.value)&&typeof e.value[0]==`string`)t=`[${e.value.map(e=>encodeURIComponent(e)).join(`,`)}]`;else if(Array.isArray(e.value)){if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else{let n=e.value[0];t=typeof n==`string`?encodeURIComponent(n):typeof n==`object`&&n?.value!==void 0?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||``))}}else t=encodeURIComponent(e.value||``);return`${encodeURIComponent(e.name)}:${t}`}).join(`;`);t.set(`filters`,n)}else t.delete(`filters`);let n=`${window.location.pathname}?${t.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},``,n)}catch(e){console.error(`Failed to update URL with filters:`,e)}},[e,a,s]),_(()=>{if(!(a||!c||r.length===0))try{let e=c.split(`;`),t=[];for(let n of e){let e=n.indexOf(`:`);if(e===-1)continue;let i=n.slice(0,e),a=n.slice(e+1),o=decodeURIComponent(i);if(l.current.has(o))continue;let s=r.find(e=>e.name===o);if(!s)continue;l.current.add(o);let c;if(a.startsWith(`[`)&&a.endsWith(`]`)){let e=a.slice(1,-1);c=e?e.split(`,`).map(e=>decodeURIComponent(e)):[]}else c=[decodeURIComponent(a)];let u;u=s.type===`stringList`?c:s.type===`text`?c.length===1?[{value:c[0],label:c[0]}]:c.map(e=>({value:e,label:e})):c.map(e=>{let t=s.options?.find(t=>t.value===e),n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}}),s.multiple&&!a.startsWith(`[`)&&!a.endsWith(`]`)&&(s.type===`stringList`?u=c:Array.isArray(u)||(u=[u])),t.push({name:o,type:s.type,placeholder:s.placeholder,value:u,multiple:s.multiple})}t.length>0&&n(e=>{let n=new Set(t.map(e=>e.name));return[...e.filter(e=>!n.has(e.name)),...t]}),u.current=!0}catch{}},[r,a,c,n]),t(BT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},HT=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(BT),{t:s}=k(),[c,l]=o.useState(!1),[u,d]=o.useState(null),[f,p]=o.useState(``),m=o.useRef(null),[h,g]=o.useState(),[_,v]=o.useState(``),y=e=>{d(e),p(``),m.current?.focus()},b=()=>{let e=a.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>n.type===`date`?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&typeof n.value[0]==`string`?n.value.some(e=>e===t.value):n.value.some(e=>GT(e)===t.value))))})).filter(e=>(e.options??[]).length>0||e.type===`date`&&!r.some(t=>t.name===e.name)||e.type===`text`&&!r.some(t=>t.name===e.name)||e.type===`stringList`&&!r.some(t=>t.name===e.name));return e.length===0?t(hv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(vv,{onSelect:()=>y(e.name),className:`group flex gap-2 items-center hover:bg-muted`,children:t(`span`,{children:e.placeholder??e.name})},e.name))},x=()=>{l(!1),setTimeout(()=>{d(null),p(``),g(void 0)},200)};return n(yT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(xT,{asChild:!0,children:n(U,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:z(`transition group flex gap-1.5`,e),children:[t(He,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(CT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(dv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(pv,{placeholder:u?s(`filter.filterBy`,{view:u}):s(`filter.filterPlaceholder`),className:`h-9 ring-0`,value:f,onValueChange:e=>{p(e)},ref:m,autoFocus:!0}),t(mv,{children:t(gv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(PT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(LT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(IT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(FT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},UT=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(BT);return t(`div`,{className:z(e),children:t(zT,{filters:n,setFilters:r,filterGroups:i})})},WT=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(BT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(U,{variant:`outline`,size:`md`,className:z(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function GT(e){return typeof e==`string`?e:e.value||``}var KT;(function(e){e.IS=`is`,e.IS_NOT=`is_not`,e.CONTAINS=`contains`,e.BEFORE=`before`,e.AFTER=`after`,e.IS_ANY_OF=`is_any_of`})(KT||={});const qT=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:z({h1:`text-2xl font-medium tracking-tight`,h2:`text-xl font-medium tracking-tight`,h3:`text-lg font-medium`,h4:`text-base font-medium`,h5:`text-sm font-medium`,h6:`text-xs font-medium`}[`h${n}`],`mb-2`,e),...r})});qT.displayName=`Heading`;function JT({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":ee,"aria-invalid":te}){let F=C(null),[ne,re]=w(!1),[ie,ae]=w(0),[oe,se]=w(``),ce=v(),le=v(),ue=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?YT(e,T)===YT(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ae(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let de=e=>{if(x){let t=Array.isArray(s)?s:[];fe(e,t)?c(t.filter(t=>!pe(t,e))):c([...t,e])}else c(e)},fe=(e,t)=>!t||t.length===0?!1:t.some(t=>pe(t,e)),pe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?YT(e,T)===YT(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(YT(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let _e=oe.toLowerCase(),ve=he(f);me=me.filter(e=>ve(e).includes(_e));let ye=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},be=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},xe=(e,r)=>{let i=x?fe(e,Array.isArray(s)?s:[]):s!=null&&pe(s,e);return t(vv,{onSelect:()=>de(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]}):n(wT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=new Map;for(let n of me){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Ce=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1`,children:[t(`div`,{className:`mx-2`,children:t(qe,{className:`size-4`})}),t(MT,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(dv,{className:`overflow-hidden`,children:n(mv,{className:E?`max-h-full overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(hv,{children:`No result found.`}),Se?Se.map(e=>t(gv,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>xe(t,`${e.key}-${n}`))},e.key)):t(gv,{children:me?.map((e,t)=>xe(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-muted bg-transparent border-0`),children:[t(Je,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(h,b&&`border border-border rounded-md`,`bg-popover p-1`,g),children:D?t(`div`,{className:`flex justify-center items-center p-2 text-muted text-sm`,children:t(Ue,{className:`size-4 animate-spin`})}):Ce()});let we=!!p,Te=M??(we?void 0:typeof m==`string`?m:void 0),Ee=N??(we?le:void 0),De=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Oe=te===!0||te===`true`||ue?!0:te===!1||te===`false`?!1:void 0;return n(yT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(xT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":ne,"aria-controls":ce,"aria-label":Te,"aria-labelledby":Ee,"aria-describedby":ee,"aria-invalid":Oe,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(ue||Oe?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,De&&`pe-10`)),children:D?t(Ue,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:le,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,ue&&`text-destructive`),children:[ue&&t(bi,{description:k,placement:`top`,asChild:!0,children:t(Xe,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Ie,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!D&&t(U,{variant:`link`,size:`icon`,disabled:d,title:j||`Clear selection`,onClick:e=>{e.stopPropagation(),c(x?[]:void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`absolute end-2 top-1/2 -translate-y-1/2 hover:bg-muted/20 rounded p-1`,children:A||t(Ze,{className:`size-4`})})]}),t(CT,{id:ce,style:{width:`${ie}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Ce()})]})}function YT(e,t){return typeof e==`object`&&e?e[t]:void 0}const XT={ar:`العربية`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,it:`Italiano`,ja:`日本語`,ko:`한국어`,pt:`Português`,ru:`Русский`,tr:`Türkçe`,zh:`中文`,"zh-TW":`繁體中文`};function ZT({label:e,className:r}={}){let{language:i,setLanguage:a}=O(),{t:o}=k(),s=e===!1?!1:e??o(`language.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center gap-3`:`flex items-center`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),t(JT,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>XT[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var QT=Object.defineProperty,$T=a.forwardRef(((e,t)=>QT(e,`name`,{value:t,configurable:!0}))(function(e,n){return t(H.label,{...e,ref:n,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));const eE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),tE=a.forwardRef(({className:e,required:r,...i},a)=>n($T,{ref:a,className:z(eE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive-foreground ms-1`,children:`*`})]}));tE.displayName=$T.displayName;function nE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Re,{className:`size-5 text-destructive`,"aria-hidden":`true`}),c=`text-destructive`,l=`text-foreground`,u=`bg-destructive border border-destructive`;break;case`warning`:s=t(Xe,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Le,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(Ve,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(Ve,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(Ve,{className:`size-5 text-done`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-done border border-done`}return t(`div`,{className:`rounded-md p-4 ${u} ${o}`,children:n(`div`,{className:`flex`,children:[t(`div`,{className:`shrink-0`,children:e??s}),n(`div`,{className:`w-full ms-2 px-1`,children:[i&&t(`h3`,{className:`text-base font-medium mb-2 ${c}`,children:i}),t(`div`,{className:`text-sm ${l} break-words`,children:a})]})]})})}function rE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(nE,{status:`error`,title:e,className:`${r} flex flex-col items-center justify-center text-center`,children:[t(`pre`,{className:`whitespace-pre-wrap break-words`,children:i}),a&&o&&t(U,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function iE({title:e,className:n,children:r}){return t(nE,{status:`info`,title:e,className:n,children:r})}function aE({title:e,className:n,children:r}){return t(nE,{status:`warning`,title:e,className:n,children:r})}function oE({title:e,className:n,children:r}){return t(nE,{status:`success`,title:e,className:n,children:r})}function sE({title:e,className:n,children:r}){return t(nE,{status:`default`,title:e,className:n,children:r})}function cE({title:e,content:r,onConfirm:i,onCancel:a,isOpen:o,isLoading:s,confirmationValue:c,confirmationLabel:l,confirmationPlaceholder:u}){let{t:d}=k(),f=C(null),[p,m]=w(``);_(()=>{o||m(``)},[o]);let h=!!c,g=!c||p.trim()===c.trim(),v=()=>{!g||s||i()};return n($_,{isOpen:o,onClose:a,description:`Confirm Modal`,children:[n(`div`,{className:`sm:flex sm:items-start p-2`,children:[t(`div`,{className:`mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-destructive sm:mx-0 sm:h-10 sm:w-10`,children:t(Xe,{className:`size-6 text-destructive`,"aria-hidden":`true`})}),n(`div`,{className:`mt-3 text-center sm:ms-4 sm:mt-0 sm:text-start`,children:[t(ev,{className:`leading-6`,show:!0,children:e}),t(`div`,{className:`mt-2`,children:t(`div`,{className:`prose text-sm text-muted`,children:r})})]})]}),h&&t(`div`,{className:`px-2 pb-2 text-start`,children:t(zi,{label:l??u,children:t(MT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(nv,{align:`right`,children:[t(U,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(U,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function lE(){return g(uE)}const uE=d(()=>{}),dE={success:Le,error:Re,warning:Xe,info:Ve},fE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function pE({data:e,onClose:r}){let[i,a]=w(!0),o=C(null),s=h(()=>{o.current&&=(globalThis.clearTimeout(o.current),null)},[]),c=h(()=>{s(),e.duration&&(o.current=setTimeout(()=>a(!1),e.duration))},[s,e.duration]);_(()=>(c(),s),[s,c]);let l=dE[e.status]||Ve,u=fE[e.status]||`text-info`;return t(`div`,{"aria-live":`assertive`,className:`pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100`,children:t(`div`,{className:`flex w-full flex-col items-center space-y-4 sm:items-end`,children:t(Tp,{onExitComplete:r,children:i&&t(vh.div,{className:`pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border`,initial:{opacity:0,x:8},animate:{opacity:1,x:0,transition:{ease:`easeOut`,duration:.7}},exit:{opacity:0,transition:{ease:`easeIn`,duration:.3}},onMouseEnter:s,onMouseLeave:c,children:t(`div`,{className:`p-5`,children:n(`div`,{className:`flex items-start`,children:[t(`div`,{className:`shrink-0`,children:t(l,{className:`size-6 ${u}`,"aria-hidden":`true`})}),n(`div`,{className:`ms-3 flex-1 pt-0.5 min-w-0`,children:[t(`p`,{className:`text-sm font-semibold text-foreground break-words`,children:e.title}),e.description&&t(`p`,{className:`mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed`,children:e.description})]}),t(`div`,{className:`ms-4 flex shrink-0`,children:n(`button`,{type:`button`,className:`inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background`,onClick:()=>a(!1),children:[t(`span`,{className:`sr-only`,children:`Close`}),t(Ze,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function mE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(uE.Provider,{value:o,children:r}),i&&t(Ch,{children:t(pE,{data:i,onClose:()=>o(null)})})]})}function hE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=lE();return t(cE,{title:n,content:r,isOpen:!!e,onConfirm:async()=>{if(e)return a(e).then(()=>{s({title:o(`modal.delete.succeeded`),status:`success`})}).catch(e=>{s({title:o(`modal.delete.failed`),description:e instanceof Error?e.message:o(`modal.delete.error`),status:`error`})}).finally(()=>{i(void 0)})},onCancel:()=>{i(void 0)}})}const gE=4,_E={tabs:{base:`flex items-center border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`border-transparent text-muted hover:border-border hover:text-foreground`,active:`border-primary text-info`,icon:`ms-1 size-4`},pills:{base:`flex items-center rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`text-muted hover:bg-muted/60`,active:`bg-muted text-foreground`,icon:`ms-0.5 size-3.5`}};function vE(e,t,n=4){let r=C(null),i=C([]),a=C(null),[o,s]=w({count:e.length,promote:!1}),c=()=>{let o=r.current;if(!o)return;let c=o.clientWidth,l=e.map((e,t)=>i.current[t]?.offsetWidth??0),u=l.reduce((e,t)=>e+t,0)+n*Math.max(0,e.length-1),d=(t,r)=>{let i=0,a=0;for(let o=0;o<e.length;o++){if(o===r)continue;let e=i+(a>0?n:0)+l[o];if(e>t)break;i=e,a+=1}return a},f;if(u<=c)f={count:e.length,promote:!1};else{let r=a.current?.offsetWidth??0,i=Math.max(1,d(c-r-n,-1)),o=e.findIndex(t);f=o<0||o<i?{count:i,promote:!1}:{count:d(c-r-l[o]-n*2,o),promote:!0}}s(e=>e.count===f.count&&e.promote===f.promote?e:f)},l=C(c);l.current=c,x(()=>{l.current()}),_(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>l.current());return t.observe(e),()=>t.disconnect()},[]);let u=e.findIndex(t),d,f;if(o.promote&&u>=0){let t=e.filter((e,t)=>t!==u);d=[...t.slice(0,o.count),e[u]],f=t.slice(o.count)}else d=e.slice(0,o.count),f=e.slice(o.count);return{containerRef:r,setItemRef:e=>t=>{i.current[e]=t},setMoreRef:e=>{a.current=e},visible:d,overflow:f,activeInOverflow:f.some(t)}}function yE({label:e,triggerClassName:r,icon:i,children:a}){let[o,s]=w(!1),c=C(null),l=C(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)},d=()=>{u(),l.current=!0,s(!0)},f=()=>{u(),c.current=setTimeout(()=>s(!1),150)};return _(()=>()=>clearTimeout(c.current??void 0),[]),n(Tx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Dx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Ne,{className:`ms-1 size-4`})]})}),t(Ox,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function bE({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=_E[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=vE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:z(`relative`,o),children:[n(`div`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute start-0 top-0 flex w-max gap-1`,children:[e.map((e,n)=>t(`button`,{type:`button`,tabIndex:-1,ref:u(n),className:z(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:z(c.base,c.inactive),children:[h,t(Ne,{className:c.icon})]})]}),n(`div`,{className:z(`flex gap-1 overflow-hidden`,a===`tabs`&&`-mb-px border-b`),children:[f.map(e=>{let n=e.name===r;return t(`button`,{type:`button`,"aria-current":n?`page`:void 0,disabled:e.disabled,onClick:()=>i(e.name),className:z(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(yE,{label:h,triggerClassName:z(c.base,m?c.active:c.inactive),icon:t(Ne,{className:c.icon}),children:p.map(e=>t(Ax,{disabled:e.disabled,onClick:()=>i(e.name),className:z(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function xE({children:r,action:i,title:a,description:o,footer:s,className:c,collapsible:l,defaultCollapsed:u=!1,size:d=`md`,clickableHeader:f=!1}){let[p,m]=w(u),h=l&&f,g=d===`sm`,_=g||h,v=t(p?Ne:Fe,{className:`size-4 text-muted`}),y=n(e,{children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`div`,{className:`font-semibold ${g?`text-sm`:`text-lg`}`,children:a}),t(Ii,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(U,{variant:`ghost`,size:`icon`,onClick:()=>m(!p),children:v}))]})]}),b=g?`px-4 py-2`:`px-4 py-3`,x=g?`px-4 pt-3 pb-3`:`p-4`,S=g?`px-4 pb-3`:`px-4 pb-4`;return n(`div`,{className:`flex flex-col ${_?``:`p-4 gap-2`} rounded-sm border bg-card ${h?`overflow-hidden`:``} ${c??``}`,children:[h?t(`button`,{type:`button`,className:`w-full flex items-center justify-between ${b} hover:bg-muted/50 transition-colors`,onClick:()=>m(!p),children:y}):t(`div`,{className:`flex items-center justify-between ${_?b:``}`,children:y}),!p&&(_?t(`div`,{className:x,children:r}):r),s&&t(`div`,{className:`border-t border-muted flex flex-col-2 text-sm pt-4 ${_?S:``}`,children:s})]})}var SE=Object.defineProperty,CE=(e,t)=>SE(e,`name`,{value:t,configurable:!0}),wE=`Radio`,[TE,EE]=an(wE),[DE,OE]=TE(wE);function kE(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),_=a.useRef(!1),[v,y]=a.useReducer(e=>e+1,0),b={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:CE(()=>l?.(),`onCheck`)};return t(DE,{scope:n,...b,children:IE(f)?f(b):i})}CE(kE,`RadioProvider`);var AE=`RadioTrigger`,jE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,hasConsumerStoppedPropagationRef:u,onUserInteraction:d,isFormControl:f,bubbleInput:p}=OE(AE,e),m=R(i,c);return t(H.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":LE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:B(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),ME=`RadioIndicator`,NE=a.forwardRef(CE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=OE(ME,r);return t(or,{present:i||o.checked,children:t(H.span,{"data-state":LE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),PE=`RadioBubbleInput`,FE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=OE(PE,e),_=R(i,m),v=Pn(o),y=a.useRef(!1),b=a.useRef(s),x=a.useRef(g);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==s;b.current=s;let a=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[p,s,h,g]);let S=a.useRef(s);return t(H.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:_,onClick:B(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function IE(e){return typeof e==`function`}CE(IE,`isFunction`);function LE(e){return e?`checked`:`unchecked`}CE(LE,`getState`);var RE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],zE=`RadioGroup`,[BE,VE]=an(zE,[Xv,EE]),HE=Xv(),UE=EE(),[WE,GE]=BE(zE),KE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,name:i,form:o,defaultValue:s,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:p=!0,onValueChange:m,...h}=e,g=HE(r),_=fe(f),[v,y]=br({prop:c,defaultProp:s??null,onChange:m,caller:zE}),[b,x]=a.useState(null),S=R(n,x),C=a.useRef(v);return a.useEffect(()=>{let e=o?b?.ownerDocument.getElementById(o):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=CE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),t(WE,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:t(cy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:t(H.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),qE=`RadioGroupItemProvider`,JE=`RadioGroupItemTrigger`;function YE(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=GE(qE,n),c=UE(n),l=s.disabled||i;return t(kE,{...c,checked:s.value===r,disabled:l,required:s.required,name:s.name,form:s.form,value:r,onCheck:()=>s.onValueChange(r),internal_do_not_use_render:o,children:a})}CE(YE,`RadioGroupItemProvider`);var XE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=HE(r),s=UE(r),{checked:c,disabled:l}=OE(JE,s.__scopeRadio),u=a.useRef(null),d=R(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=CE(e=>{RE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=CE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),t(ly,{asChild:!0,...o,focusable:!l,active:c,children:t(jE,{...s,...i,ref:d,onKeyDown:B(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:B(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),ZE=a.forwardRef(CE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return t(YE,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(XE,{...c,ref:i,__scopeRadioGroup:a}),r&&t(QE,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),QE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(FE,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),$E=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(NE,{...a,...i,ref:n})},`RadioGroupIndicator`));function eD({className:e,...n}){return t(ZE,{"data-slot":`radio-group-item`,className:z(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t($E,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:t(`span`,{className:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})})})}var tD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function nD({onSelect:e,selected:r,options:i,adapter:a}){let o=e=>a?a.idOf(e):e.id,s=e=>a?a.labelOf(e):e.label,c=e=>a?a.descriptionOf(e):e.description,l=e=>a?a.selectedClassName(e):`border-primary`;return t(KE,{"data-slot":`radio-group`,value:r?o(r):void 0,onValueChange:t=>{let n=i.find(e=>o(e)===t);n&&e(n)},className:`space-y-4`,children:i.map(e=>{let i=r?o(r)===o(e):!1;return t(ZE,{value:o(e),className:z(`relative block w-full cursor-pointer rounded-lg border border-border bg-muted px-6 py-4 shadow-2xs text-start`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`sm:flex sm:justify-between`,i&&l(e)),children:t(`span`,{className:`flex items-center`,children:n(`span`,{className:`flex flex-col text-sm`,children:[t(`span`,{className:`font-medium text-foreground`,children:s(e)}),c(e)&&t(`span`,{className:`text-muted`,children:c(e)})]})})},o(e))})})}function rD({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(_e.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function iD(e){return typeof e==`number`?`${e}%`:e}function aD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:iD(e),minSize:iD(n),maxSize:iD(r),collapsedSize:iD(i),...a})}function oD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:z(`bg-muted focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),...r,children:e&&t(`div`,{className:`z-10 flex size-4 items-center justify-center rounded-xs font-semibold`,children:t(We,{className:`size-4 rotate-90`})})})}var sD=Object.defineProperty,cD=(e,t)=>sD(e,`name`,{value:t,configurable:!0}),lD=`horizontal`,uD=[`horizontal`,`vertical`],dD=a.forwardRef(cD(function(e,n){let{decorative:r,orientation:i=lD,...a}=e,o=fD(i)?i:lD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return t(H.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function fD(e){return uD.includes(e)}cD(fD,`isValidOrientation`);var pD=dD;const mD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(pD,{ref:a,decorative:r,orientation:n,className:z(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));mD.displayName=pD.displayName;var hD=Object.defineProperty,gD=(e,t)=>hD(e,`name`,{value:t,configurable:!0});function _D(e,[t,n]){return Math.min(n,Math.max(t,e))}gD(_D,`clamp`);var vD=Object.defineProperty,yD=(e,t)=>vD(e,`name`,{value:t,configurable:!0});function bD(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}yD(bD,`usePrevious`);var xD=Object.defineProperty,$=(e,t)=>xD(e,`name`,{value:t,configurable:!0}),SD=[`PageUp`,`PageDown`],CD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],wD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},TD=`Slider`,[ED,DD,OD]=Sv(TD),[kD,AD]=an(TD,[OD]),[jD,MD]=kD(TD),ND=a.forwardRef($(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[i],value:f,onValueChange:p=$(()=>{},`onValueChange`),onValueCommit:m=$(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?ID:LD,[S,C]=a.useState(null),w=R(n,C),[T=[],E]=br({prop:f,defaultProp:d,onChange:$(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),D=a.useRef(T),O=a.useRef(T);a.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=$(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,tO(T,e))}$(k,`handleSlideStart`);function A(e){M(e,y.current)}$(A,`handleSlideMove`);function j(){String(T)!==String(D.current)&&m(T)}$(j,`handleSlideEnd`);function M(e,t,{commit:n}={commit:!1}){let r=oO(s),a=_D(sO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=QD(e,a,t);if(iO(r,u*s)){y.current=r.indexOf(a);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return $(M,`updateValues`),t(jD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:t(ED.Provider,{scope:e.__scopeSlider,children:t(ED.Slot,{scope:e.__scopeSlider,children:t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:B(_.onPointerDown,()=>{l||(D.current=T,b.current=!1)}),min:i,max:o,inverted:h,onSlideStart:l?void 0:k,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:j,onHomeKeyDown:()=>{l||(b.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,M(o,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){b.current=!0;let n=SD.includes(e.key)||e.shiftKey&&CD.includes(e.key)?10:1,r=y.current,a=T[r];M(cO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[PD,FD]=kD(TD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ID=a.forwardRef($(function(e,n){let{min:r,max:i,dir:o,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=a.useState(null),h=R(n,m),g=a.useRef(void 0),_=fe(o),v=_===`ltr`,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=aO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:t(RD,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);c?.(t)},onSlideMove:e=>{let t=b(e.clientX);l?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=wD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),LD=a.forwardRef($(function(e,n){let{min:r,max:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,f=a.useRef(null),p=R(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=aO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:t(RD,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);s?.(t)},onSlideMove:e=>{let t=g(e.clientY);c?.(t)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:e=>{let t=wD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),RD=a.forwardRef($(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=MD(TD,r);return t(H.span,{...u,ref:n,onKeyDown:B(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):SD.concat(CD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:B(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):i(e)}),onPointerMove:B(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:B(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),zD=`SliderTrack`,BD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(zD,r);return t(H.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),VD=`SliderRange`,HD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,o=MD(VD,r),s=FD(VD,r),c=R(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>$D(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return t(H.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[UD,WD]=kD(`SliderThumb`),GD=`SliderThumbProvider`;function KD(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=MD(GD,n),c=DD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=Pn(l),p=!l||!!s.form||!!l.closest(`form`),m=s.values[d],h=r??(s.name?s.name+(s.values.length>1?`[]`:``):void 0),g=m===void 0?0:$D(m,s.min,s.max);a.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let _={value:m,name:h,form:s.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:g,size:f};return t(UD,{scope:n,..._,children:lO(o)?o(_):i})}$(KD,`SliderThumbProvider`);var qD=`SliderThumbTrigger`,JD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(qD,r),o=FD(qD,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=WD(qD,r),f=R(n,d),p=eO(s,a.values.length),m=u?.[o.size],h=m?nO(m,l,o.direction):0;return t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:t(ED.ItemSlot,{scope:r,children:t(H.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:c===void 0?{display:`none`}:e.style,onFocus:B(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),YD=a.forwardRef($(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return t(KD,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>n(e,{children:[t(JD,{...s,ref:i,__scopeSlider:a}),o?t(ZD,{__scopeSlider:a},r):null]})})},`SliderThumb`)),XD=`SliderBubbleInput`,ZD=a.forwardRef($(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=WD(XD,e),c=a.useRef(null),l=R(c,r),u=bD(i);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[u,i]),t(H.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function QD(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(QD,`getNextSortedValues`);function $D(e,t,n){return _D(100/(n-t)*(e-t),[0,100])}$($D,`convertValueToPercentage`);function eO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(eO,`getLabel`);function tO(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}$(tO,`getClosestValueIndex`);function nO(e,t,n){let r=e/2;return(r-aO([0,50],[0,r])(t)*n)*n}$(nO,`getThumbInBoundsOffset`);function rO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(rO,`getStepsBetweenValues`);function iO(e,t){if(t>0){let n=rO(e);return Math.min(...n)>=t}return!0}$(iO,`hasMinStepsBetweenValues`);function aO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}$(aO,`linearScale`);function oO(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}$(oO,`getDecimalCount`);function sO(e,t){let n=10**t;return Math.round(e*n)/n}$(sO,`roundValue`);function cO(e,{min:t,step:n,direction:r,multiplier:i}){let a=oO(n),o=(e-t)/n,s=Math.round(o),c=sO(s*n+t,a)===sO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),sO(l*n+t,a)}$(cO,`getNextStepValue`);function lO(e){return typeof e==`function`}$(lO,`isFunction`);const uO=a.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:o,value:s,defaultValue:c,min:l=0,max:u=100,"aria-label":d,...f},p)=>{let m=a.useId(),h=Array.isArray(s)?s.length:Array.isArray(c)?c.length:1,g=a.useMemo(()=>Array.from({length:Math.max(1,h)},(e,t)=>`${m}-thumb-${t}`),[m,h]);return n(ND,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:z(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(BD,{"data-slot":`slider-track`,className:z(`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,r),children:t(HD,{"data-slot":`slider-range`,className:z(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(YD,{"data-slot":`slider-thumb`,"aria-label":d,className:z(`block size-3.5 rounded-full border border-primary bg-background shadow-sm 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`,o)},e))]})});uO.displayName=ND.displayName;var dO=Object.defineProperty,fO=(e,t)=>dO(e,`name`,{value:t,configurable:!0}),pO=`Switch`,[mO,hO]=an(pO),[gO,_O]=mO(pO);function vO(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=br({prop:r,defaultProp:o??!1,onChange:u,caller:pO}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return t(gO,{scope:n,...C,children:EO(p)?p(C):i})}fO(vO,`SwitchProvider`);var yO=`SwitchTrigger`,bO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=_O(yO,e),v=R(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=fO(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),t(H.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":DO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:B(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),xO=a.forwardRef(fO(function(r,i){let{__scopeSwitch:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return t(vO,{__scopeSwitch:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(bO,{...m,ref:i,__scopeSwitch:a}),r&&t(TO,{__scopeSwitch:a})]})})},`Switch`)),SO=`SwitchThumb`,CO=a.forwardRef(fO(function(e,n){let{__scopeSwitch:r,...i}=e,a=_O(SO,r);return t(H.span,{"data-state":DO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),wO=`SwitchBubbleInput`,TO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=_O(wO,e),v=R(i,_),y=Pn(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(l);return t(H.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:B(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function EO(e){return typeof e==`function`}fO(EO,`isFunction`);function DO(e){return e?`checked`:`unchecked`}fO(DO,`getState`);const OO={sm:[`h-5 w-8`,`size-3`,`translate-x-4 rtl:-translate-x-4`],md:[`h-6 w-11`,`size-4`,`translate-x-6 rtl:-translate-x-6`],lg:[`h-8 w-16`,`size-6`,`translate-x-9 rtl:-translate-x-9`]};function kO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=OO[r],f=t(xO,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:z(`data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full border focus-visible:ring-3 aria-invalid:ring-3 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,l,!o&&e),children:t(CO,{"data-slot":`switch-thumb`,className:z(`bg-white rounded-full pointer-events-none block ring-0 transition-transform`,u,i?d:`translate-x-1 rtl:-translate-x-1`)})});return o?n(`div`,{className:z(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var AO=Object.defineProperty,jO=(e,t)=>AO(e,`name`,{value:t,configurable:!0}),MO=`Tabs`,[NO,PO]=an(MO,[Xv]),FO=Xv(),[IO,LO]=NO(MO),RO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=fe(c),[f,p]=br({prop:i,onChange:a,defaultProp:o??``,caller:MO});return t(IO,{scope:r,baseId:V(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:t(H.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),zO=`TabsList`,BO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=LO(zO,r),s=FO(r);return t(cy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:t(H.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),VO=`TabsTrigger`,HO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=LO(VO,r),c=FO(r),l=GO(s.baseId,i),u=KO(s.baseId,i),d=i===s.value;return t(ly,{asChild:!0,...c,focusable:!a,active:d,children:t(H.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:n,onMouseDown:B(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:B(e.onFocus,()=>{let e=s.activationMode!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),UO=`TabsContent`,WO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=LO(UO,r),u=GO(l.baseId,i),d=KO(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),t(or,{present:o||f,children:({present:r})=>t(H.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:r&&s})})},`TabsContent`));function GO(e,t){return`${e}-trigger-${t}`}jO(GO,`makeTriggerId`);function KO(e,t){return`${e}-content-${t}`}jO(KO,`makeContentId`);var qO=RO,JO=BO,YO=HO,XO=WO;const ZO=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),QO=({tabs:e,defaultValue:n,current:r,className:i,fullWidth:o,fullHeight:s,children:c,onTabChange:l,responsive:u=!1,variant:d=`tabs`,updateHash:f=!0,canChangeTab:p})=>{let m=a.useMemo(()=>e.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[e]),[h,g]=a.useState(()=>{let e=typeof r==`function`?r():r;if(e)return e;let t=window.location.hash,i=t?t.substring(1):void 0;return i&&m.some(e=>e.name===i)?i:n||m[0]?.name});a.useEffect(()=>{let e=typeof r==`function`?r():r;e&&e!==h&&g(e)},[r,h]),a.useEffect(()=>{if(r)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&m.some(e=>e.name===t)?g(t):!e&&n&&g(n)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[r,m,n]);let _=a.useCallback(e=>{if(!(e!==h&&p&&!p(e,h))){if(g(e),f&&!r){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}l&&l(e)}},[r,l,f,p,h]),v=a.useCallback(e=>{_(e)},[_]);return t(ZO.Provider,{value:{tabs:m,size:o?m.length:0,current:h,setTab:v,responsive:u,variant:d,updateHash:f,canChangeTab:p},children:t(qO,{defaultValue:h||m[0]?.name,value:h,onValueChange:_,className:z(`flex-1 flex flex-col min-h-0 px-2`,s&&`h-full`,i),children:c})})},$O=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m}=a.useContext(ZO),h=c!==0,g=a.useCallback(e=>{if(!s||!u||e!==l&&m&&!m(e,l))return;let t=s.find(t=>t.name===e);if(t?.href&&p){let e=window.history.state;window.history.pushState(e,``,t.href)}u(e)},[s,u,p,m,l]);return!s||!u?(console.warn(`TabsBar: No tabs provided or setTab not available`),null):n(e,{children:[d&&t(`div`,{className:`px-2 block lg:hidden`,children:t(JT,{label:`Tab`,className:z(i&&`sticky top-0 bg-background z-10`,r),options:s,optionLabel:e=>typeof e.label==`string`?e.label:String(e.label),value:s.find(e=>e.name===l),onChange:e=>{g(e.name)}})}),t(tk,{size:c,variant:f,className:z(h?`w-full`:``,i&&`sticky top-0 bg-background z-10`,o===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(nk,{className:z(o===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>g(e.name),children:e.label},e.name))})]})},ek=({className:n})=>{let{tabs:r}=a.useContext(ZO);return r?t(e,{children:r.map(e=>t(rk,{value:e.name,className:n,children:e.content},e.name))}):null},tk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(ZO.Provider,{value:{size:n,variant:r},children:t(JO,{ref:a,className:z(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));tk.displayName=JO.displayName;const nk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(ZO),c=a.useCallback(e=>{if(n){e.preventDefault();let t=window.history.state;window.history.pushState(t,``,n)}i.onClick&&i.onClick(e)},[n,i.onClick]);return t(YO,{ref:o,className:z(r===`tabs`?z(`border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer`,`border-transparent text-muted hover:border-border hover:text-foreground`,`data-[state=active]:border-primary data-[state=active]:text-info`,`disabled:pointer-events-none disabled:opacity-50`):z(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});nk.displayName=YO.displayName;const rk=a.forwardRef(({className:e,...n},r)=>t(XO,{ref:r,className:z(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));rk.displayName=XO.displayName;const ik=A(`text-foreground`,{variants:{size:{xl:`text-base md:text-lg leading-relaxed`,lg:`text-base leading-relaxed`,default:`text-sm leading-normal`,sm:`text-sm leading-normal`,xs:`text-xs leading-normal`},weight:{normal:`font-normal`,medium:`font-medium`,semibold:`font-semibold`}},defaultVariants:{size:`default`,weight:`normal`}}),ak=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:z(ik({size:n,weight:r,className:e})),...i}));ak.displayName=`Text`;function ok({className:e,minLines:n,maxLines:r,value:i,...a}){let o=C(null),s=n!==void 0||r!==void 0,c=h(()=>{let e=o.current;if(!e)return;let t=getComputedStyle(e),i=parseFloat(t.lineHeight)||parseFloat(t.fontSize)*1.5,a=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),s=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),c=n??1,l=r??1/0,u=c*i+a+s,d=l===1/0?1/0:l*i+a+s;e.style.height=`auto`;let f=Math.min(Math.max(e.scrollHeight,u),d);e.style.height=`${f}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?`auto`:`hidden`},[n,r]);return x(()=>{s&&c()}),t(`textarea`,{ref:o,"data-slot":`textarea`,value:i,className:z(`py-2 text-sm`,`flex w-full rounded-md border border-input bg-background ring-offset-background`,`placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,s&&`resize-none`,e),...a})}const sk=d({theme:`system`,setTheme:()=>null});function ck({children:e,defaultTheme:n=`system`,storageKey:r=`vite-ui-theme`,...i}){let[a,o]=w(()=>localStorage.getItem(r)||n);_(()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),a===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(a)},[a]);let s=h((e,t)=>{t?.persist!==!1&&localStorage.setItem(r,e),o(e)},[r]),c=S(()=>({theme:a,setTheme:s}),[s,a]);return t(sk.Provider,{...i,value:c,children:e})}const lk=()=>{let e=g(sk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function uk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(U,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function dk({label:e,className:r}={}){let{setTheme:i,theme:a}=lk(),{t:o}=k(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(uk,{current:a,option:`system`,setTheme:i,icon:t(L,{}),alt:o(`theme.system`)}),t(uk,{current:a,option:`light`,setTheme:i,icon:t(Ye,{}),alt:o(`theme.light`)}),t(uk,{current:a,option:`dark`,setTheme:i,icon:t(Ge,{}),alt:o(`theme.dark`)})]})]})}function fk(e,n){return{label:String(e),check:t(n?Me:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function pk({value:e,options:i,onChange:a,className:o,optionLayout:s,by:c,noCheck:l,filterBy:u}){let{t:d}=k(),[f,p]=w(e),[m,h]=w(``),g=e=>{p(e),a(e)},_=S(()=>typeof c==`string`?(e,t)=>e[c]===t[c]:c||((e,t)=>e===t),[c]);return n(`div`,{className:r(``,o),children:[u&&t(MT,{type:`text`,placeholder:d(`form.filter`),value:m,onChange:e=>h(e)}),i.map((e,n)=>{if(u&&!u(m)(e))return null;let r=f?_(f,e):!1,i;return s?(i=s(e,r),i=Object.assign(fk(e,r),i)):i=fk(e,r),t(mk,{option:e,onSelect:g,layout:i,noCheck:l},`option-${n}`)})]})}function mk({option:e,onSelect:i,layout:a,noCheck:o}){return n(U,{variant:`unstyled`,size:`none`,className:r(`group !flex w-full items-center cursor-pointer gap-x-2 hover:bg-muted`,a.reverse&&`flex-row-reverse`,a.className),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function hk({isOpen:e,title:r,onClose:i,children:a,panelWidth:o=768,backdrop:s=!1,side:c=`right`,resizable:l=!0,className:u,contentClassName:d}){let[f,p]=w(o),m=e=>{e.preventDefault();let t=!0,n=e.pageX,r=f,i=e=>{if(t){let t=n-e.pageX,i=Math.max(r+t,480);p(i)}},a=()=>{t=!1,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},h=c===`left`,g=h?`left-0`:`right-0`,_=h?`pr-10 sm:pr-16`:`pl-10 sm:pl-16`,v=h?`border-r`:`border-l`,y=h?`-right-1`:`-left-1`,b=h?`-100%`:`100%`;return t(Tp,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(vh.div,{className:`fixed inset-0 bg-black/70`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i}),t(`div`,{className:`fixed inset-y-0 ${g} overflow-hidden`,children:t(`div`,{className:`absolute inset-0 overflow-hidden`,children:t(`div`,{className:`pointer-events-none fixed inset-y-0 ${g} flex max-w-full ${_}`,children:t(vh.div,{className:`pointer-events-auto ${v}`,style:{width:`${f}px`},initial:{x:b},animate:{x:0},exit:{x:b},transition:{type:`spring`,stiffness:300,damping:30},children:n(`div`,{className:`relative flex h-full`,children:[l&&t(`div`,{"aria-label":`Resize panel`,className:`absolute ${y} top-0 bottom-0 w-3 z-25 cursor-ew-resize hover:bg-primary transition-colors flex items-center justify-center`,onMouseDown:m,children:t(We,{className:`rotate-90 font-semibold`,strokeWidth:4})}),n(`div`,{className:`flex-1 min-w-0 flex flex-col bg-background shadow-xl ${u}`,children:[r&&t(`div`,{className:`sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b`,children:n(`div`,{className:`flex items-start justify-between`,children:[t(`h2`,{className:`w-full text-base font-semibold leading-6`,children:t(`div`,{className:`text-2xl`,children:r??``})}),t(`div`,{className:`ms-3 flex h-7 items-center`,children:t(gk,{onClose:i})})]})}),t(`div`,{className:d??`flex-1 overflow-auto px-2 sm:px-4 py-4`,children:t(`div`,{className:`w-full h-full flex-1 flex flex-col`,children:a})})]})]})})})})})]})})}function gk({onClose:e}){return t(U,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(Ze,{className:`size-6`,"aria-hidden":`true`})})}function _k(e){switch(e){case`xs`:return`size-2`;case`sm`:return`size-3`;case`md`:return`size-4`;case`lg`:return`size-5`;case`xl`:return`size-7`;case`2xl`:return`size-10`;default:throw Error(`Unexpected size: ${e}`)}}function vk({size:e,className:i}){let a=_k(e||`md`);return n(`svg`,{className:r(`animate-[spin_0.8s_linear_infinite] text-info`,a,i),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),t(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function yk({options:i,value:a,onChange:o,onOptionsChange:s,placeholder:c,className:l,disabled:u,layout:d=`horizontal`,creatable:f=!1,createText:p=`Create "%value%"`,maxDropdownHeight:m=200}){let h=g(vT),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),ee=f&&v&&!a.includes(v)&&!i.includes(v),te=P.length+ +!!ee;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let F=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},ne=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},re=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(xT,{asChild:!0,children:n(`div`,{ref:k,className:r(`min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2`,`flex items-center gap-1`,d===`horizontal`?`flex-wrap`:`flex-col items-stretch`,`cursor-text`,`ring-offset-background`,u&&`opacity-50 cursor-not-allowed`,M?`ring-1 ring-inset ring-ring`:``),onClick:()=>{u||O.current?.focus()},children:[d===`vertical`&&a.length>0&&t(`div`,{className:`flex flex-col gap-1 w-full`,children:a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-info text-foreground ring-1 ring-primary/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(Ze,{className:`h-3 w-3`})})]},e))}),d===`horizontal`&&a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center gap-1 px-2 py-1 text-sm bg-info text-foreground ring-1 ring-primary/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[e,t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(Ze,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&te>0){e.preventDefault(),e.stopPropagation(),b===P.length&&ee?ne(v):b<P.length&&F(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<te-1?e+1:e):N(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(!1);return}if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t);return}!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(CT,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>F(e),onKeyDown:Bi(()=>F(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-info text-foreground`:`hover:bg-muted/50`),children:e},e))}),ee&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(U,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>ne(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-info`,b===P.length?`bg-info`:`hover:bg-muted/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function bk(e){return t(yT,{click:!0,children:t(yk,{...e})})}function xk({className:e,children:n,...i}){return t(`table`,{className:r(`
|
|
284
|
+
flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(Ze,{size:16})})]})});MT.displayName=`Input`;const NT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(yT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r||`Enter text...`})}),t(CT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:s,onChange:c,onKeyDown:e=>{e.key===`Enter`&&(i(s),o(!1))},placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function PT({selectedView:r,selectedDate:i,setSelectedDate:a,setFilters:o,filters:s,handleClose:c,filterGroups:l}){let{t:u}=k(),[d,f]=w([null,null]),[p,m]=w([null,null]),h=l.find(e=>e.name===r),g=h?.multiple,_=new Date;_.setHours(23,59,59,999);let v=[p[0]||d[0],p[1]||d[1]],y=e=>{if(g)Array.isArray(e)?(m([e[0],e[1]]),f([e[0],e[1]])):(m([e,null]),f([e,null]));else{let t=Array.isArray(e)?e[0]:e;if(a(t||void 0),t){let e=new Date(t);e.setHours(0,0,0,0),o([...s,{name:r||``,placeholder:h?.placeholder,value:[{value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}],type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}}};return t(`div`,{className:`p-2`,children:g?n(e,{children:[t(`div`,{children:g?v[0]&&v[1]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:u(`filter.to`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[1]).format(`MMMM DD, YYYY`)})]}):v[0]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`→ Select end date`})]}):t(`span`,{className:`text-muted text-xs`,children:h?.placeholder||h?.name||r||`Select date range`}):i?Q(i).format(`MMMM DD, YYYY`):`Pick a date`}),n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:v,onChange:y,selectRange:!0,returnValue:`range`,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(v[0]){let e=v[0].getTime();if(v[1]){let n=v[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{if(d[0]){let e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);let n=[];n.push({value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:Q(t).format(`LLL dd, y`)}),o([...s,{name:r||``,placeholder:h?.placeholder,value:n,type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}},disabled:!v[0],children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:i,onChange:y,selectRange:!1,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(i&&t===i.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})}function FT({selectedView:e,commandInput:r,setFilters:i,handleClose:a,filterGroups:o}){let[s,c]=w([]),l=e=>{let t=o.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){let e=r.toLowerCase();return n.filter(n=>n.value!==void 0&&t.filterBy?.(n.value,e))}let i=r.toLowerCase();return n.filter(e=>String(e.value||``).toLowerCase().includes(i))};if(!e)return null;let u=l(e),d=o.find(t=>t.name===e),f=d?.placeholder||d?.name,p=()=>{s.length>0&&i(t=>[...t.filter(t=>t.name!==e),{name:e||``,placeholder:d?.placeholder||``,value:s,type:d?.type||`select`,multiple:d?.multiple||!1}]),a()},m=t=>{let n={value:t.value,label:t.label};d?.multiple?s.some(e=>e.value===t.value)?c(e=>e.filter(e=>e.value!==t.value)):c(e=>[...e,n]):(i(t=>{let r=t.findIndex(t=>t.name===e);if(r>=0){let e=[...t];return e[r]={...e[r],value:[n]},e}return[...t,{name:e||``,placeholder:d?.placeholder||``,value:[n],type:d?.type||`select`,multiple:d?.multiple||!1}]}),a())};return n(`div`,{className:`flex flex-col h-full`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted shrink-0`,children:t(`span`,{children:f})}),t(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:t(`div`,{className:`max-h-[200px] overflow-y-auto`,children:u.length>0&&u.map(e=>{let r=s.some(t=>t.value===e.value);return n(vv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(OT,{value:e.value||``,labelRenderer:e.labelRenderer||d?.labelRenderer,fallbackLabel:e.label}),d?.multiple&&r&&t(`span`,{className:`ms-auto text-xs text-success`,children:`✓`})]},e.value||`option-${Math.random()}`)})})}),d?.multiple&&t(`div`,{className:`p-2 border-t shrink-0`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(U,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function IT({selectedView:e,setFilters:r,handleClose:i,filterGroups:a}){let[o,s]=w([]),c=a.find(t=>t.name===e);return n(`div`,{className:`p-2 space-y-3`,children:[t(`div`,{className:`space-y-2`,children:t(Ki,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{o.length>0&&r(t=>[...t.filter(t=>t.name!==e),{name:e,placeholder:c?.placeholder,value:o,type:`stringList`}]),i()},disabled:o.length===0,children:`Apply`})]})]})}function LT({selectedView:e,textValue:r,setTextValue:i,setFilters:a,handleClose:o,filterGroups:s}){let c=()=>{a(t=>[...t,{name:e||``,placeholder:s.find(t=>t.name===e)?.placeholder,value:[{value:r,label:r}],type:`text`}]),o()};return n(`div`,{className:`p-2 flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:s.find(t=>t.name===e)?.placeholder})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:r,onChange:i,onKeyDown:e=>e.key===`Enter`&&c(),placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(U,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function RT(e,n,r){switch(e.type){case`date`:return t(DT,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Q(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(NT,{filterType:e.placeholder||e.name,filterValue:Array.isArray(e.value)&&e.value[0]&&typeof e.value[0]==`object`&&e.value[0].value||``,setFilterValue:t=>{n(n=>n.map(n=>n===e?{...n,value:[{value:t,label:t}]}:n))}});case`stringList`:return t(AT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`string`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))}});default:{let i=r.find(t=>t.name===e.name);return t(kT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))},options:i?.options||[],labelRenderer:i?.labelRenderer,multiple:e.multiple??i?.multiple})}}}function zT({filters:e,setFilters:r,filterGroups:i}){return t(`div`,{className:`flex gap-2 flex-wrap justify-start`,children:e.filter(e=>e.value?.length>0).map(e=>n(`div`,{className:`flex gap-[1px] items-center text-sm`,children:[t(`div`,{className:`flex gap-1.5 shrink-0 rounded-s bg-muted p-1.5 h-8 items-center`,children:e.placeholder||e.name}),RT(e,r,i),t(U,{variant:`ghost`,size:`icon`,onClick:()=>{r(t=>t.filter(t=>t!==e))},className:`bg-muted rounded-s-none rounded-e-sm size-8 hover:text-info hover:bg-muted/50 transition shrink-0`,children:t(Ze,{className:`size-6`})})]},`${e.name}-${e.type===`date`?`date`:e.type===`stringList`&&typeof e.value[0]==`string`?e.value.join(`,`):Array.isArray(e.value)?e.value.map(e=>e.value).join(`,`):``}`))})}const BT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),VT=({filters:e,setFilters:n,filterGroups:r,children:i,inModal:a})=>{let s=new URL(window.location.href).searchParams.toString(),[c]=o.useState(()=>new URLSearchParams(window.location.search).get(`filters`)),l=o.useRef(new Set),u=o.useRef(a||!c);return _(()=>{if(!a&&u.current)try{let t=new URLSearchParams(s);if(e.length>0){let n=e.map(e=>{let t;if(e.type===`stringList`&&Array.isArray(e.value)&&typeof e.value[0]==`string`)t=`[${e.value.map(e=>encodeURIComponent(e)).join(`,`)}]`;else if(Array.isArray(e.value)){if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else{let n=e.value[0];t=typeof n==`string`?encodeURIComponent(n):typeof n==`object`&&n?.value!==void 0?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||``))}}else t=encodeURIComponent(e.value||``);return`${encodeURIComponent(e.name)}:${t}`}).join(`;`);t.set(`filters`,n)}else t.delete(`filters`);let n=`${window.location.pathname}?${t.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},``,n)}catch(e){console.error(`Failed to update URL with filters:`,e)}},[e,a,s]),_(()=>{if(!(a||!c||r.length===0))try{let e=c.split(`;`),t=[];for(let n of e){let e=n.indexOf(`:`);if(e===-1)continue;let i=n.slice(0,e),a=n.slice(e+1),o=decodeURIComponent(i);if(l.current.has(o))continue;let s=r.find(e=>e.name===o);if(!s)continue;l.current.add(o);let c;if(a.startsWith(`[`)&&a.endsWith(`]`)){let e=a.slice(1,-1);c=e?e.split(`,`).map(e=>decodeURIComponent(e)):[]}else c=[decodeURIComponent(a)];let u;u=s.type===`stringList`?c:s.type===`text`?c.length===1?[{value:c[0],label:c[0]}]:c.map(e=>({value:e,label:e})):c.map(e=>{let t=s.options?.find(t=>t.value===e),n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}}),s.multiple&&!a.startsWith(`[`)&&!a.endsWith(`]`)&&(s.type===`stringList`?u=c:Array.isArray(u)||(u=[u])),t.push({name:o,type:s.type,placeholder:s.placeholder,value:u,multiple:s.multiple})}t.length>0&&n(e=>{let n=new Set(t.map(e=>e.name));return[...e.filter(e=>!n.has(e.name)),...t]}),u.current=!0}catch{}},[r,a,c,n]),t(BT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},HT=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(BT),{t:s}=k(),[c,l]=o.useState(!1),[u,d]=o.useState(null),[f,p]=o.useState(``),m=o.useRef(null),[h,g]=o.useState(),[_,v]=o.useState(``),y=e=>{d(e),p(``),m.current?.focus()},b=()=>{let e=a.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>n.type===`date`?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&typeof n.value[0]==`string`?n.value.some(e=>e===t.value):n.value.some(e=>GT(e)===t.value))))})).filter(e=>(e.options??[]).length>0||e.type===`date`&&!r.some(t=>t.name===e.name)||e.type===`text`&&!r.some(t=>t.name===e.name)||e.type===`stringList`&&!r.some(t=>t.name===e.name));return e.length===0?t(hv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(vv,{onSelect:()=>y(e.name),className:`group flex gap-2 items-center hover:bg-muted`,children:t(`span`,{children:e.placeholder??e.name})},e.name))},x=()=>{l(!1),setTimeout(()=>{d(null),p(``),g(void 0)},200)};return n(yT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(xT,{asChild:!0,children:n(U,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:z(`transition group flex gap-1.5`,e),children:[t(He,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(CT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(dv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(pv,{placeholder:u?s(`filter.filterBy`,{view:u}):s(`filter.filterPlaceholder`),className:`h-9 ring-0`,value:f,onValueChange:e=>{p(e)},ref:m,autoFocus:!0}),t(mv,{children:t(gv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(PT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(LT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(IT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(FT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},UT=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(BT);return t(`div`,{className:z(e),children:t(zT,{filters:n,setFilters:r,filterGroups:i})})},WT=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(BT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(U,{variant:`outline`,size:`md`,className:z(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function GT(e){return typeof e==`string`?e:e.value||``}var KT;(function(e){e.IS=`is`,e.IS_NOT=`is_not`,e.CONTAINS=`contains`,e.BEFORE=`before`,e.AFTER=`after`,e.IS_ANY_OF=`is_any_of`})(KT||={});const qT=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:z({h1:`text-2xl font-medium tracking-tight`,h2:`text-xl font-medium tracking-tight`,h3:`text-lg font-medium`,h4:`text-base font-medium`,h5:`text-sm font-medium`,h6:`text-xs font-medium`}[`h${n}`],`mb-2`,e),...r})});qT.displayName=`Heading`;function JT({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":ee,"aria-invalid":te}){let F=C(null),[ne,re]=w(!1),[ie,ae]=w(0),[oe,se]=w(``),ce=v(),le=v(),ue=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?YT(e,T)===YT(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ae(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let de=e=>{if(x){let t=Array.isArray(s)?s:[];fe(e,t)?c(t.filter(t=>!pe(t,e))):c([...t,e])}else c(e)},fe=(e,t)=>!t||t.length===0?!1:t.some(t=>pe(t,e)),pe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?YT(e,T)===YT(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(YT(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let _e=oe.toLowerCase(),ve=he(f);me=me.filter(e=>ve(e).includes(_e));let ye=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},be=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},xe=(e,r)=>{let i=x?fe(e,Array.isArray(s)?s:[]):s!=null&&pe(s,e);return t(vv,{onSelect:()=>de(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]}):n(wT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=new Map;for(let n of me){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Ce=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1`,children:[t(`div`,{className:`mx-2`,children:t(qe,{className:`size-4`})}),t(MT,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(dv,{className:`overflow-hidden`,children:n(mv,{className:E?`max-h-full overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(hv,{children:`No result found.`}),Se?Se.map(e=>t(gv,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>xe(t,`${e.key}-${n}`))},e.key)):t(gv,{children:me?.map((e,t)=>xe(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-muted bg-transparent border-0`),children:[t(Je,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(h,b&&`border border-border rounded-md`,`bg-popover p-1`,g),children:D?t(`div`,{className:`flex justify-center items-center p-2 text-muted text-sm`,children:t(Ue,{className:`size-4 animate-spin`})}):Ce()});let we=!!p,Te=M??(we?void 0:typeof m==`string`?m:void 0),Ee=N??(we?le:void 0),De=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Oe=te===!0||te===`true`||ue?!0:te===!1||te===`false`?!1:void 0;return n(yT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(xT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":ne,"aria-controls":ce,"aria-label":Te,"aria-labelledby":Ee,"aria-describedby":ee,"aria-invalid":Oe,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(ue||Oe?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,De&&`pe-10`)),children:D?t(Ue,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:le,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,ue&&`text-destructive`),children:[ue&&t(bi,{description:k,placement:`top`,asChild:!0,children:t(Xe,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Ie,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!D&&t(U,{variant:`link`,size:`icon`,disabled:d,title:j||`Clear selection`,onClick:e=>{e.stopPropagation(),c(x?[]:void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`absolute end-2 top-1/2 -translate-y-1/2 hover:bg-muted/20 rounded p-1`,children:A||t(Ze,{className:`size-4`})})]}),t(CT,{id:ce,style:{width:`${ie}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Ce()})]})}function YT(e,t){return typeof e==`object`&&e?e[t]:void 0}const XT={ar:`العربية`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,it:`Italiano`,ja:`日本語`,ko:`한국어`,pt:`Português`,ru:`Русский`,tr:`Türkçe`,zh:`中文`,"zh-TW":`繁體中文`};function ZT({label:e,className:r}={}){let{language:i,setLanguage:a}=O(),{t:o}=k(),s=e===!1?!1:e??o(`language.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center gap-3`:`flex items-center`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),t(JT,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>XT[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var QT=Object.defineProperty,$T=a.forwardRef(((e,t)=>QT(e,`name`,{value:t,configurable:!0}))(function(e,n){return t(H.label,{...e,ref:n,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));const eE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),tE=a.forwardRef(({className:e,required:r,...i},a)=>n($T,{ref:a,className:z(eE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive-foreground ms-1`,children:`*`})]}));tE.displayName=$T.displayName;function nE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Re,{className:`size-5 text-destructive`,"aria-hidden":`true`}),c=`text-destructive`,l=`text-foreground`,u=`bg-destructive border border-destructive`;break;case`warning`:s=t(Xe,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Le,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(Ve,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(Ve,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(Ve,{className:`size-5 text-done`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-done border border-done`}return t(`div`,{className:`rounded-md p-4 ${u} ${o}`,children:n(`div`,{className:`flex`,children:[t(`div`,{className:`shrink-0`,children:e??s}),n(`div`,{className:`w-full ms-2 px-1`,children:[i&&t(`h3`,{className:`text-base font-medium mb-2 ${c}`,children:i}),t(`div`,{className:`text-sm ${l} break-words`,children:a})]})]})})}function rE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(nE,{status:`error`,title:e,className:`${r} flex flex-col items-center justify-center text-center`,children:[t(`pre`,{className:`whitespace-pre-wrap break-words`,children:i}),a&&o&&t(U,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function iE({title:e,className:n,children:r}){return t(nE,{status:`info`,title:e,className:n,children:r})}function aE({title:e,className:n,children:r}){return t(nE,{status:`warning`,title:e,className:n,children:r})}function oE({title:e,className:n,children:r}){return t(nE,{status:`success`,title:e,className:n,children:r})}function sE({title:e,className:n,children:r}){return t(nE,{status:`default`,title:e,className:n,children:r})}function cE({title:e,content:r,onConfirm:i,onCancel:a,isOpen:o,isLoading:s,confirmationValue:c,confirmationLabel:l,confirmationPlaceholder:u}){let{t:d}=k(),f=C(null),[p,m]=w(``);_(()=>{o||m(``)},[o]);let h=!!c,g=!c||p.trim()===c.trim(),v=()=>{!g||s||i()};return n($_,{isOpen:o,onClose:a,description:`Confirm Modal`,children:[n(`div`,{className:`sm:flex sm:items-start p-2`,children:[t(`div`,{className:`mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-destructive sm:mx-0 sm:h-10 sm:w-10`,children:t(Xe,{className:`size-6 text-destructive`,"aria-hidden":`true`})}),n(`div`,{className:`mt-3 text-center sm:ms-4 sm:mt-0 sm:text-start`,children:[t(ev,{className:`leading-6`,show:!0,children:e}),t(`div`,{className:`mt-2`,children:t(`div`,{className:`prose text-sm text-muted`,children:r})})]})]}),h&&t(`div`,{className:`px-2 pb-2 text-start`,children:t(zi,{label:l??u,children:t(MT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(nv,{align:`right`,children:[t(U,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(U,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function lE(){return g(uE)}const uE=d(()=>{}),dE={success:Le,error:Re,warning:Xe,info:Ve},fE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function pE({data:e,onClose:r}){let[i,a]=w(!0),o=C(null),s=h(()=>{o.current&&=(globalThis.clearTimeout(o.current),null)},[]),c=h(()=>{s(),e.duration&&(o.current=setTimeout(()=>a(!1),e.duration))},[s,e.duration]);_(()=>(c(),s),[s,c]);let l=dE[e.status]||Ve,u=fE[e.status]||`text-info`;return t(`div`,{"aria-live":`assertive`,className:`pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100`,children:t(`div`,{className:`flex w-full flex-col items-center space-y-4 sm:items-end`,children:t(Tp,{onExitComplete:r,children:i&&t(vh.div,{className:`pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border`,initial:{opacity:0,x:8},animate:{opacity:1,x:0,transition:{ease:`easeOut`,duration:.7}},exit:{opacity:0,transition:{ease:`easeIn`,duration:.3}},onMouseEnter:s,onMouseLeave:c,children:t(`div`,{className:`p-5`,children:n(`div`,{className:`flex items-start`,children:[t(`div`,{className:`shrink-0`,children:t(l,{className:`size-6 ${u}`,"aria-hidden":`true`})}),n(`div`,{className:`ms-3 flex-1 pt-0.5 min-w-0`,children:[t(`p`,{className:`text-sm font-semibold text-foreground break-words`,children:e.title}),e.description&&t(`p`,{className:`mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed`,children:e.description})]}),t(`div`,{className:`ms-4 flex shrink-0`,children:n(`button`,{type:`button`,className:`inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background`,onClick:()=>a(!1),children:[t(`span`,{className:`sr-only`,children:`Close`}),t(Ze,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function mE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(uE.Provider,{value:o,children:r}),i&&t(Ch,{children:t(pE,{data:i,onClose:()=>o(null)})})]})}function hE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=lE();return t(cE,{title:n,content:r,isOpen:!!e,onConfirm:async()=>{if(e)return a(e).then(()=>{s({title:o(`modal.delete.succeeded`),status:`success`})}).catch(e=>{s({title:o(`modal.delete.failed`),description:e instanceof Error?e.message:o(`modal.delete.error`),status:`error`})}).finally(()=>{i(void 0)})},onCancel:()=>{i(void 0)}})}const gE=4,_E={tabs:{base:`flex items-center border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`border-transparent text-muted hover:border-border hover:text-foreground`,active:`border-primary text-info`,icon:`ms-1 size-4`},pills:{base:`flex items-center rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`text-muted hover:bg-muted/60`,active:`bg-muted text-foreground`,icon:`ms-0.5 size-3.5`}};function vE(e,t,n=4){let r=C(null),i=C([]),a=C(null),[o,s]=w({count:e.length,promote:!1}),c=()=>{let o=r.current;if(!o)return;let c=o.clientWidth,l=e.map((e,t)=>i.current[t]?.offsetWidth??0),u=l.reduce((e,t)=>e+t,0)+n*Math.max(0,e.length-1),d=(t,r)=>{let i=0,a=0;for(let o=0;o<e.length;o++){if(o===r)continue;let e=i+(a>0?n:0)+l[o];if(e>t)break;i=e,a+=1}return a},f;if(u<=c)f={count:e.length,promote:!1};else{let r=a.current?.offsetWidth??0,i=Math.max(1,d(c-r-n,-1)),o=e.findIndex(t);f=o<0||o<i?{count:i,promote:!1}:{count:d(c-r-l[o]-n*2,o),promote:!0}}s(e=>e.count===f.count&&e.promote===f.promote?e:f)},l=C(c);l.current=c,x(()=>{l.current()}),_(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>l.current());return t.observe(e),()=>t.disconnect()},[]);let u=e.findIndex(t),d,f;if(o.promote&&u>=0){let t=e.filter((e,t)=>t!==u);d=[...t.slice(0,o.count),e[u]],f=t.slice(o.count)}else d=e.slice(0,o.count),f=e.slice(o.count);return{containerRef:r,setItemRef:e=>t=>{i.current[e]=t},setMoreRef:e=>{a.current=e},visible:d,overflow:f,activeInOverflow:f.some(t)}}function yE({label:e,triggerClassName:r,icon:i,children:a}){let[o,s]=w(!1),c=C(null),l=C(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)},d=()=>{u(),l.current=!0,s(!0)},f=()=>{u(),c.current=setTimeout(()=>s(!1),150)};return _(()=>()=>clearTimeout(c.current??void 0),[]),n(Tx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Dx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Ne,{className:`ms-1 size-4`})]})}),t(Ox,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function bE({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=_E[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=vE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:z(`relative`,o),children:[n(`div`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute start-0 top-0 flex w-max gap-1`,children:[e.map((e,n)=>t(`button`,{type:`button`,tabIndex:-1,ref:u(n),className:z(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:z(c.base,c.inactive),children:[h,t(Ne,{className:c.icon})]})]}),n(`div`,{className:z(`flex gap-1 overflow-hidden`,a===`tabs`&&`-mb-px border-b`),children:[f.map(e=>{let n=e.name===r;return t(`button`,{type:`button`,"aria-current":n?`page`:void 0,disabled:e.disabled,onClick:()=>i(e.name),className:z(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(yE,{label:h,triggerClassName:z(c.base,m?c.active:c.inactive),icon:t(Ne,{className:c.icon}),children:p.map(e=>t(Ax,{disabled:e.disabled,onClick:()=>i(e.name),className:z(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function xE({children:r,action:i,title:a,description:o,footer:s,className:c,collapsible:l,defaultCollapsed:u=!1,size:d=`md`,clickableHeader:f=!1}){let[p,m]=w(u),h=l&&f,g=d===`sm`,_=g||h,v=t(p?Ne:Fe,{className:`size-4 text-muted`}),y=n(e,{children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`div`,{className:`font-semibold ${g?`text-sm`:`text-lg`}`,children:a}),t(Ii,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(U,{variant:`ghost`,size:`icon`,onClick:()=>m(!p),children:v}))]})]}),b=g?`px-4 py-2`:`px-4 py-3`,x=g?`px-4 pt-3 pb-3`:`p-4`,S=g?`px-4 pb-3`:`px-4 pb-4`;return n(`div`,{className:`flex flex-col ${_?``:`p-4 gap-2`} rounded-sm border bg-card ${h?`overflow-hidden`:``} ${c??``}`,children:[h?t(`button`,{type:`button`,className:`w-full flex items-center justify-between ${b} hover:bg-muted/50 transition-colors`,onClick:()=>m(!p),children:y}):t(`div`,{className:`flex items-center justify-between ${_?b:``}`,children:y}),!p&&(_?t(`div`,{className:x,children:r}):r),s&&t(`div`,{className:`border-t border-muted flex flex-col-2 text-sm pt-4 ${_?S:``}`,children:s})]})}var SE=Object.defineProperty,CE=(e,t)=>SE(e,`name`,{value:t,configurable:!0}),wE=`Radio`,[TE,EE]=an(wE),[DE,OE]=TE(wE);function kE(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),_=a.useRef(!1),[v,y]=a.useReducer(e=>e+1,0),b={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:CE(()=>l?.(),`onCheck`)};return t(DE,{scope:n,...b,children:IE(f)?f(b):i})}CE(kE,`RadioProvider`);var AE=`RadioTrigger`,jE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,hasConsumerStoppedPropagationRef:u,onUserInteraction:d,isFormControl:f,bubbleInput:p}=OE(AE,e),m=R(i,c);return t(H.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":LE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:B(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),ME=`RadioIndicator`,NE=a.forwardRef(CE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=OE(ME,r);return t(or,{present:i||o.checked,children:t(H.span,{"data-state":LE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),PE=`RadioBubbleInput`,FE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=OE(PE,e),_=R(i,m),v=Pn(o),y=a.useRef(!1),b=a.useRef(s),x=a.useRef(g);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==s;b.current=s;let a=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[p,s,h,g]);let S=a.useRef(s);return t(H.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:_,onClick:B(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function IE(e){return typeof e==`function`}CE(IE,`isFunction`);function LE(e){return e?`checked`:`unchecked`}CE(LE,`getState`);var RE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],zE=`RadioGroup`,[BE,VE]=an(zE,[Xv,EE]),HE=Xv(),UE=EE(),[WE,GE]=BE(zE),KE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,name:i,form:o,defaultValue:s,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:p=!0,onValueChange:m,...h}=e,g=HE(r),_=fe(f),[v,y]=br({prop:c,defaultProp:s??null,onChange:m,caller:zE}),[b,x]=a.useState(null),S=R(n,x),C=a.useRef(v);return a.useEffect(()=>{let e=o?b?.ownerDocument.getElementById(o):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=CE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),t(WE,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:t(cy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:t(H.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),qE=`RadioGroupItemProvider`,JE=`RadioGroupItemTrigger`;function YE(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=GE(qE,n),c=UE(n),l=s.disabled||i;return t(kE,{...c,checked:s.value===r,disabled:l,required:s.required,name:s.name,form:s.form,value:r,onCheck:()=>s.onValueChange(r),internal_do_not_use_render:o,children:a})}CE(YE,`RadioGroupItemProvider`);var XE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=HE(r),s=UE(r),{checked:c,disabled:l}=OE(JE,s.__scopeRadio),u=a.useRef(null),d=R(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=CE(e=>{RE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=CE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),t(ly,{asChild:!0,...o,focusable:!l,active:c,children:t(jE,{...s,...i,ref:d,onKeyDown:B(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:B(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),ZE=a.forwardRef(CE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return t(YE,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(XE,{...c,ref:i,__scopeRadioGroup:a}),r&&t(QE,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),QE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(FE,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),$E=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(NE,{...a,...i,ref:n})},`RadioGroupIndicator`));function eD({className:e,...n}){return t(ZE,{"data-slot":`radio-group-item`,className:z(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t($E,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:t(`span`,{className:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})})})}var tD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function nD({onSelect:e,selected:r,options:i,adapter:a}){let o=e=>a?a.idOf(e):e.id,s=e=>a?a.labelOf(e):e.label,c=e=>a?a.descriptionOf(e):e.description,l=e=>a?a.selectedClassName(e):`border-primary`;return t(KE,{"data-slot":`radio-group`,value:r?o(r):void 0,onValueChange:t=>{let n=i.find(e=>o(e)===t);n&&e(n)},className:`space-y-4`,children:i.map(e=>{let i=r?o(r)===o(e):!1;return t(ZE,{value:o(e),className:z(`relative block w-full cursor-pointer rounded-lg border border-border bg-muted px-6 py-4 shadow-2xs text-start`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`sm:flex sm:justify-between`,i&&l(e)),children:t(`span`,{className:`flex items-center`,children:n(`span`,{className:`flex flex-col text-sm`,children:[t(`span`,{className:`font-medium text-foreground`,children:s(e)}),c(e)&&t(`span`,{className:`text-muted`,children:c(e)})]})})},o(e))})})}function rD({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(_e.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function iD(e){return typeof e==`number`?`${e}%`:e}function aD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:iD(e),minSize:iD(n),maxSize:iD(r),collapsedSize:iD(i),...a})}function oD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:z(`bg-muted focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),...r,children:e&&t(`div`,{className:`z-10 flex size-4 items-center justify-center rounded-xs font-semibold`,children:t(We,{className:`size-4 rotate-90`})})})}var sD=Object.defineProperty,cD=(e,t)=>sD(e,`name`,{value:t,configurable:!0}),lD=`horizontal`,uD=[`horizontal`,`vertical`],dD=a.forwardRef(cD(function(e,n){let{decorative:r,orientation:i=lD,...a}=e,o=fD(i)?i:lD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return t(H.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function fD(e){return uD.includes(e)}cD(fD,`isValidOrientation`);var pD=dD;const mD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(pD,{ref:a,decorative:r,orientation:n,className:z(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));mD.displayName=pD.displayName;var hD=Object.defineProperty,gD=(e,t)=>hD(e,`name`,{value:t,configurable:!0});function _D(e,[t,n]){return Math.min(n,Math.max(t,e))}gD(_D,`clamp`);var vD=Object.defineProperty,yD=(e,t)=>vD(e,`name`,{value:t,configurable:!0});function bD(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}yD(bD,`usePrevious`);var xD=Object.defineProperty,$=(e,t)=>xD(e,`name`,{value:t,configurable:!0}),SD=[`PageUp`,`PageDown`],CD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],wD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},TD=`Slider`,[ED,DD,OD]=Sv(TD),[kD,AD]=an(TD,[OD]),[jD,MD]=kD(TD),ND=a.forwardRef($(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[i],value:f,onValueChange:p=$(()=>{},`onValueChange`),onValueCommit:m=$(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?ID:LD,[S,C]=a.useState(null),w=R(n,C),[T=[],E]=br({prop:f,defaultProp:d,onChange:$(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),D=a.useRef(T),O=a.useRef(T);a.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=$(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,tO(T,e))}$(k,`handleSlideStart`);function A(e){M(e,y.current)}$(A,`handleSlideMove`);function j(){String(T)!==String(D.current)&&m(T)}$(j,`handleSlideEnd`);function M(e,t,{commit:n}={commit:!1}){let r=oO(s),a=_D(sO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=QD(e,a,t);if(iO(r,u*s)){y.current=r.indexOf(a);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return $(M,`updateValues`),t(jD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:t(ED.Provider,{scope:e.__scopeSlider,children:t(ED.Slot,{scope:e.__scopeSlider,children:t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:B(_.onPointerDown,()=>{l||(D.current=T,b.current=!1)}),min:i,max:o,inverted:h,onSlideStart:l?void 0:k,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:j,onHomeKeyDown:()=>{l||(b.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,M(o,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){b.current=!0;let n=SD.includes(e.key)||e.shiftKey&&CD.includes(e.key)?10:1,r=y.current,a=T[r];M(cO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[PD,FD]=kD(TD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ID=a.forwardRef($(function(e,n){let{min:r,max:i,dir:o,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=a.useState(null),h=R(n,m),g=a.useRef(void 0),_=fe(o),v=_===`ltr`,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=aO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:t(RD,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);c?.(t)},onSlideMove:e=>{let t=b(e.clientX);l?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=wD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),LD=a.forwardRef($(function(e,n){let{min:r,max:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,f=a.useRef(null),p=R(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=aO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:t(RD,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);s?.(t)},onSlideMove:e=>{let t=g(e.clientY);c?.(t)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:e=>{let t=wD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),RD=a.forwardRef($(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=MD(TD,r);return t(H.span,{...u,ref:n,onKeyDown:B(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):SD.concat(CD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:B(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):i(e)}),onPointerMove:B(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:B(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),zD=`SliderTrack`,BD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(zD,r);return t(H.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),VD=`SliderRange`,HD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,o=MD(VD,r),s=FD(VD,r),c=R(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>$D(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return t(H.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[UD,WD]=kD(`SliderThumb`),GD=`SliderThumbProvider`;function KD(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=MD(GD,n),c=DD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=Pn(l),p=!l||!!s.form||!!l.closest(`form`),m=s.values[d],h=r??(s.name?s.name+(s.values.length>1?`[]`:``):void 0),g=m===void 0?0:$D(m,s.min,s.max);a.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let _={value:m,name:h,form:s.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:g,size:f};return t(UD,{scope:n,..._,children:lO(o)?o(_):i})}$(KD,`SliderThumbProvider`);var qD=`SliderThumbTrigger`,JD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(qD,r),o=FD(qD,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=WD(qD,r),f=R(n,d),p=eO(s,a.values.length),m=u?.[o.size],h=m?nO(m,l,o.direction):0;return t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:t(ED.ItemSlot,{scope:r,children:t(H.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:c===void 0?{display:`none`}:e.style,onFocus:B(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),YD=a.forwardRef($(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return t(KD,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>n(e,{children:[t(JD,{...s,ref:i,__scopeSlider:a}),o?t(ZD,{__scopeSlider:a},r):null]})})},`SliderThumb`)),XD=`SliderBubbleInput`,ZD=a.forwardRef($(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=WD(XD,e),c=a.useRef(null),l=R(c,r),u=bD(i);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[u,i]),t(H.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function QD(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(QD,`getNextSortedValues`);function $D(e,t,n){return _D(100/(n-t)*(e-t),[0,100])}$($D,`convertValueToPercentage`);function eO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(eO,`getLabel`);function tO(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}$(tO,`getClosestValueIndex`);function nO(e,t,n){let r=e/2;return(r-aO([0,50],[0,r])(t)*n)*n}$(nO,`getThumbInBoundsOffset`);function rO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(rO,`getStepsBetweenValues`);function iO(e,t){if(t>0){let n=rO(e);return Math.min(...n)>=t}return!0}$(iO,`hasMinStepsBetweenValues`);function aO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}$(aO,`linearScale`);function oO(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}$(oO,`getDecimalCount`);function sO(e,t){let n=10**t;return Math.round(e*n)/n}$(sO,`roundValue`);function cO(e,{min:t,step:n,direction:r,multiplier:i}){let a=oO(n),o=(e-t)/n,s=Math.round(o),c=sO(s*n+t,a)===sO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),sO(l*n+t,a)}$(cO,`getNextStepValue`);function lO(e){return typeof e==`function`}$(lO,`isFunction`);const uO=a.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:o,value:s,defaultValue:c,min:l=0,max:u=100,"aria-label":d,...f},p)=>{let m=a.useId(),h=Array.isArray(s)?s.length:Array.isArray(c)?c.length:1,g=a.useMemo(()=>Array.from({length:Math.max(1,h)},(e,t)=>`${m}-thumb-${t}`),[m,h]);return n(ND,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:z(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(BD,{"data-slot":`slider-track`,className:z(`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,r),children:t(HD,{"data-slot":`slider-range`,className:z(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(YD,{"data-slot":`slider-thumb`,"aria-label":d,className:z(`block size-3.5 rounded-full border border-primary bg-background shadow-sm 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`,o)},e))]})});uO.displayName=ND.displayName;var dO=Object.defineProperty,fO=(e,t)=>dO(e,`name`,{value:t,configurable:!0}),pO=`Switch`,[mO,hO]=an(pO),[gO,_O]=mO(pO);function vO(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=br({prop:r,defaultProp:o??!1,onChange:u,caller:pO}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return t(gO,{scope:n,...C,children:EO(p)?p(C):i})}fO(vO,`SwitchProvider`);var yO=`SwitchTrigger`,bO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=_O(yO,e),v=R(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=fO(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),t(H.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":DO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:B(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),xO=a.forwardRef(fO(function(r,i){let{__scopeSwitch:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return t(vO,{__scopeSwitch:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(bO,{...m,ref:i,__scopeSwitch:a}),r&&t(TO,{__scopeSwitch:a})]})})},`Switch`)),SO=`SwitchThumb`,CO=a.forwardRef(fO(function(e,n){let{__scopeSwitch:r,...i}=e,a=_O(SO,r);return t(H.span,{"data-state":DO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),wO=`SwitchBubbleInput`,TO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=_O(wO,e),v=R(i,_),y=Pn(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(l);return t(H.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:B(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function EO(e){return typeof e==`function`}fO(EO,`isFunction`);function DO(e){return e?`checked`:`unchecked`}fO(DO,`getState`);const OO={sm:[`h-5 w-8`,`size-3`,`translate-x-4 rtl:-translate-x-4`],md:[`h-6 w-11`,`size-4`,`translate-x-6 rtl:-translate-x-6`],lg:[`h-8 w-16`,`size-6`,`translate-x-9 rtl:-translate-x-9`]};function kO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=OO[r],f=t(xO,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:z(`data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full border focus-visible:ring-3 aria-invalid:ring-3 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,l,!o&&e),children:t(CO,{"data-slot":`switch-thumb`,className:z(`bg-white rounded-full pointer-events-none block ring-0 transition-transform`,u,i?d:`translate-x-1 rtl:-translate-x-1`)})});return o?n(`div`,{className:z(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var AO=Object.defineProperty,jO=(e,t)=>AO(e,`name`,{value:t,configurable:!0}),MO=`Tabs`,[NO,PO]=an(MO,[Xv]),FO=Xv(),[IO,LO]=NO(MO),RO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=fe(c),[f,p]=br({prop:i,onChange:a,defaultProp:o??``,caller:MO});return t(IO,{scope:r,baseId:V(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:t(H.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),zO=`TabsList`,BO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=LO(zO,r),s=FO(r);return t(cy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:t(H.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),VO=`TabsTrigger`,HO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=LO(VO,r),c=FO(r),l=GO(s.baseId,i),u=KO(s.baseId,i),d=i===s.value;return t(ly,{asChild:!0,...c,focusable:!a,active:d,children:t(H.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:n,onMouseDown:B(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:B(e.onFocus,()=>{let e=s.activationMode!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),UO=`TabsContent`,WO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=LO(UO,r),u=GO(l.baseId,i),d=KO(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),t(or,{present:o||f,children:({present:r})=>t(H.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:r&&s})})},`TabsContent`));function GO(e,t){return`${e}-trigger-${t}`}jO(GO,`makeTriggerId`);function KO(e,t){return`${e}-content-${t}`}jO(KO,`makeContentId`);var qO=RO,JO=BO,YO=HO,XO=WO;const ZO=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),QO=({tabs:e,defaultValue:n,current:r,className:i,fullWidth:o,fullHeight:s,children:c,onTabChange:l,responsive:u=!1,variant:d=`tabs`,updateHash:f=!0,canChangeTab:p})=>{let m=a.useMemo(()=>e.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[e]),[h,g]=a.useState(()=>{let e=typeof r==`function`?r():r;if(e)return e;let t=window.location.hash,i=t?t.substring(1):void 0;return i&&m.some(e=>e.name===i)?i:n||m[0]?.name});a.useEffect(()=>{let e=typeof r==`function`?r():r;e&&e!==h&&g(e)},[r,h]),a.useEffect(()=>{if(r)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&m.some(e=>e.name===t)?g(t):!e&&n&&g(n)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[r,m,n]);let _=a.useCallback(e=>{if(!(e!==h&&p&&!p(e,h))){if(g(e),f&&!r){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}l&&l(e)}},[r,l,f,p,h]),v=a.useCallback(e=>{_(e)},[_]);return t(ZO.Provider,{value:{tabs:m,size:o?m.length:0,current:h,setTab:v,responsive:u,variant:d,updateHash:f,canChangeTab:p},children:t(qO,{defaultValue:h||m[0]?.name,value:h,onValueChange:_,className:z(`flex-1 flex flex-col min-h-0 px-2`,s&&`h-full`,i),children:c})})},$O=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m}=a.useContext(ZO),h=c!==0,g=a.useCallback(e=>{if(!s||!u||e!==l&&m&&!m(e,l))return;let t=s.find(t=>t.name===e);if(t?.href&&p){let e=window.history.state;window.history.pushState(e,``,t.href)}u(e)},[s,u,p,m,l]);return!s||!u?(console.warn(`TabsBar: No tabs provided or setTab not available`),null):n(e,{children:[d&&t(`div`,{className:`px-2 block lg:hidden`,children:t(JT,{label:`Tab`,className:z(i&&`sticky top-0 bg-background z-10`,r),options:s,optionLabel:e=>typeof e.label==`string`?e.label:String(e.label),value:s.find(e=>e.name===l),onChange:e=>{g(e.name)}})}),t(tk,{size:c,variant:f,className:z(h?`w-full`:``,i&&`sticky top-0 bg-background z-10`,o===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(nk,{className:z(o===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>g(e.name),children:e.label},e.name))})]})},ek=({className:n})=>{let{tabs:r}=a.useContext(ZO);return r?t(e,{children:r.map(e=>t(rk,{value:e.name,className:n,children:e.content},e.name))}):null},tk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(ZO.Provider,{value:{size:n,variant:r},children:t(JO,{ref:a,className:z(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));tk.displayName=JO.displayName;const nk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(ZO),c=a.useCallback(e=>{if(n){e.preventDefault();let t=window.history.state;window.history.pushState(t,``,n)}i.onClick&&i.onClick(e)},[n,i.onClick]);return t(YO,{ref:o,className:z(r===`tabs`?z(`border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer`,`border-transparent text-muted hover:border-border hover:text-foreground`,`data-[state=active]:border-primary data-[state=active]:text-info`,`disabled:pointer-events-none disabled:opacity-50`):z(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});nk.displayName=YO.displayName;const rk=a.forwardRef(({className:e,...n},r)=>t(XO,{ref:r,className:z(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));rk.displayName=XO.displayName;const ik=A(`text-foreground`,{variants:{size:{xl:`text-base md:text-lg leading-relaxed`,lg:`text-base leading-relaxed`,default:`text-sm leading-normal`,sm:`text-sm leading-normal`,xs:`text-xs leading-normal`},weight:{normal:`font-normal`,medium:`font-medium`,semibold:`font-semibold`}},defaultVariants:{size:`default`,weight:`normal`}}),ak=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:z(ik({size:n,weight:r,className:e})),...i}));ak.displayName=`Text`;function ok({className:e,minLines:n,maxLines:r,value:i,...a}){let o=C(null),s=n!==void 0||r!==void 0,c=h(()=>{let e=o.current;if(!e)return;let t=getComputedStyle(e),i=parseFloat(t.lineHeight)||parseFloat(t.fontSize)*1.5,a=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),s=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),c=n??1,l=r??1/0,u=c*i+a+s,d=l===1/0?1/0:l*i+a+s;e.style.height=`auto`;let f=Math.min(Math.max(e.scrollHeight,u),d);e.style.height=`${f}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?`auto`:`hidden`},[n,r]);return x(()=>{s&&c()}),t(`textarea`,{ref:o,"data-slot":`textarea`,value:i,className:z(`py-2 text-sm`,`flex w-full rounded-md border border-input bg-background ring-offset-background`,`placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,s&&`resize-none`,e),...a})}const sk=d({theme:`system`,setTheme:()=>null});function ck({children:e,defaultTheme:n=`system`,storageKey:r=`vite-ui-theme`,...i}){let[a,o]=w(()=>localStorage.getItem(r)||n);_(()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),a===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(a)},[a]);let s=h((e,t)=>{t?.persist!==!1&&localStorage.setItem(r,e),o(e)},[r]),c=S(()=>({theme:a,setTheme:s}),[s,a]);return t(sk.Provider,{...i,value:c,children:e})}const lk=()=>{let e=g(sk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function uk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(U,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function dk({label:e,className:r}={}){let{setTheme:i,theme:a}=lk(),{t:o}=k(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(uk,{current:a,option:`system`,setTheme:i,icon:t(L,{}),alt:o(`theme.system`)}),t(uk,{current:a,option:`light`,setTheme:i,icon:t(Ye,{}),alt:o(`theme.light`)}),t(uk,{current:a,option:`dark`,setTheme:i,icon:t(Ge,{}),alt:o(`theme.dark`)})]})]})}function fk(e,n){return{label:String(e),check:t(n?Me:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function pk({value:e,options:i,onChange:a,className:o,optionLayout:s,by:c,noCheck:l,filterBy:u}){let{t:d}=k(),[f,p]=w(e),[m,h]=w(``),g=e=>{p(e),a(e)},_=S(()=>typeof c==`string`?(e,t)=>e[c]===t[c]:c||((e,t)=>e===t),[c]);return n(`div`,{className:r(``,o),children:[u&&t(MT,{type:`text`,placeholder:d(`form.filter`),value:m,onChange:e=>h(e)}),i.map((e,n)=>{if(u&&!u(m)(e))return null;let r=f?_(f,e):!1,i;return s?(i=s(e,r),i=Object.assign(fk(e,r),i)):i=fk(e,r),t(mk,{option:e,onSelect:g,layout:i,noCheck:l,isSelected:r},`option-${n}`)})]})}function mk({option:e,onSelect:i,layout:a,noCheck:o,isSelected:s}){return n(U,{variant:`unstyled`,size:`none`,className:r(`group flex! w-full items-center cursor-pointer gap-x-2 hover:bg-muted`,a.reverse&&`flex-row-reverse`,a.className,s&&`bg-muted`),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function hk({isOpen:e,title:r,onClose:i,children:a,panelWidth:o=768,backdrop:s=!1,side:c=`right`,resizable:l=!0,className:u,contentClassName:d}){let[f,p]=w(o),m=e=>{e.preventDefault();let t=!0,n=e.pageX,r=f,i=e=>{if(t){let t=n-e.pageX,i=Math.max(r+t,480);p(i)}},a=()=>{t=!1,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},h=c===`left`,g=h?`left-0`:`right-0`,_=h?`pr-10 sm:pr-16`:`pl-10 sm:pl-16`,v=h?`border-r`:`border-l`,y=h?`-right-1`:`-left-1`,b=h?`-100%`:`100%`;return t(Ch,{children:t(Tp,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(vh.div,{className:`fixed inset-0 bg-black/70`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i}),t(`div`,{className:`fixed inset-y-0 ${g} overflow-hidden`,children:t(`div`,{className:`absolute inset-0 overflow-hidden`,children:t(`div`,{className:`pointer-events-none fixed inset-y-0 ${g} flex max-w-full ${_}`,children:t(vh.div,{className:`pointer-events-auto ${v}`,style:{width:`${f}px`},initial:{x:b},animate:{x:0},exit:{x:b},transition:{type:`spring`,stiffness:300,damping:30},children:n(`div`,{className:`relative flex h-full`,children:[l&&t(`div`,{"aria-label":`Resize panel`,className:`absolute ${y} top-0 bottom-0 w-3 z-25 cursor-ew-resize hover:bg-primary transition-colors flex items-center justify-center`,onMouseDown:m,children:t(We,{className:`rotate-90 font-semibold`,strokeWidth:4})}),n(`div`,{className:`flex-1 min-w-0 flex flex-col bg-background shadow-xl ${u}`,children:[r&&t(`div`,{className:`sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b`,children:n(`div`,{className:`flex items-start justify-between`,children:[t(`h2`,{className:`w-full text-base font-semibold leading-6`,children:t(`div`,{className:`text-2xl`,children:r??``})}),t(`div`,{className:`ms-3 flex h-7 items-center`,children:t(gk,{onClose:i})})]})}),t(`div`,{className:d??`flex-1 overflow-auto px-2 sm:px-4 py-4`,children:t(`div`,{className:`w-full h-full flex-1 flex flex-col`,children:a})})]})]})})})})})]})})})}function gk({onClose:e}){return t(U,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(Ze,{className:`size-6`,"aria-hidden":`true`})})}function _k(e){switch(e){case`xs`:return`size-2`;case`sm`:return`size-3`;case`md`:return`size-4`;case`lg`:return`size-5`;case`xl`:return`size-7`;case`2xl`:return`size-10`;default:throw Error(`Unexpected size: ${e}`)}}function vk({size:e,className:i}){let a=_k(e||`md`);return n(`svg`,{className:r(`animate-[spin_0.8s_linear_infinite] text-info`,a,i),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),t(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function yk({options:i,value:a,onChange:o,onOptionsChange:s,placeholder:c,className:l,disabled:u,layout:d=`horizontal`,creatable:f=!1,createText:p=`Create "%value%"`,maxDropdownHeight:m=200}){let h=g(vT),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),ee=f&&v&&!a.includes(v)&&!i.includes(v),te=P.length+ +!!ee;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let F=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},ne=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},re=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(xT,{asChild:!0,children:n(`div`,{ref:k,className:r(`min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2`,`flex items-center gap-1`,d===`horizontal`?`flex-wrap`:`flex-col items-stretch`,`cursor-text`,`ring-offset-background`,u&&`opacity-50 cursor-not-allowed`,M?`ring-1 ring-inset ring-ring`:``),onClick:()=>{u||O.current?.focus()},children:[d===`vertical`&&a.length>0&&t(`div`,{className:`flex flex-col gap-1 w-full`,children:a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-info text-foreground ring-1 ring-primary/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(Ze,{className:`h-3 w-3`})})]},e))}),d===`horizontal`&&a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center gap-1 px-2 py-1 text-sm bg-info text-foreground ring-1 ring-primary/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[e,t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(Ze,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&te>0){e.preventDefault(),e.stopPropagation(),b===P.length&&ee?ne(v):b<P.length&&F(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<te-1?e+1:e):N(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(!1);return}if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t);return}!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(CT,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>F(e),onKeyDown:Bi(()=>F(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-info text-foreground`:`hover:bg-muted/50`),children:e},e))}),ee&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(U,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>ne(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-info`,b===P.length?`bg-info`:`hover:bg-muted/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function bk(e){return t(yT,{click:!0,children:t(yk,{...e})})}function xk({className:e,children:n,...i}){return t(`table`,{className:r(`
|
|
285
285
|
divide-y divide-border
|
|
286
286
|
[&>tbody]:divide-y [&>tbody]:divide-border
|
|
287
287
|
[&_th]:text-start [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted
|