@vertesia/ui 1.6.0-dev.20261019.172735Z → 1.6.0-dev.20261022.120426Z
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/shadcn/selectBox.js +1 -1
- package/lib/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/vertesia-ui-boot.js.map +1 -1
- package/lib/vertesia-ui-core.js +43 -43
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-env.js.map +1 -1
- package/lib/vertesia-ui-features.js +204 -204
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.js +1 -1
- package/lib/vertesia-ui-i18n.js.map +1 -1
- package/lib/vertesia-ui-layout.js +1 -1
- package/lib/vertesia-ui-layout.js.map +1 -1
- package/lib/vertesia-ui-rich-text.js +12 -12
- package/lib/vertesia-ui-rich-text.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +5 -5
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +14 -14
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/lib/widgets/markdown/MermaidDiagram.d.ts.map +1 -1
- package/lib/widgets/markdown/MermaidDiagram.js +5 -2
- package/lib/widgets/markdown/MermaidDiagram.js.map +1 -1
- package/package.json +25 -20
- package/src/core/components/shadcn/selectBox.tsx +1 -1
- package/src/widgets/markdown/MermaidDiagram.tsx +5 -2
package/lib/vertesia-ui-core.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import r,{clsx as i}from"clsx";import*as a from"react";import o,{Children as s,Component as c,Fragment as l,cloneElement as u,createContext as d,createElement as f,forwardRef as p,isValidElement as m,useCallback as h,useContext as g,useEffect as _,useId as v,useImperativeHandle as y,useInsertionEffect as b,useLayoutEffect as x,useMemo as S,useRef as C,useState as w}from"react";import*as T from"react-dom";import{createPortal as E}from"react-dom";import{SUPPORTED_LANGUAGES as D,useLanguage as O,useUITranslation as k}from"@vertesia/ui/i18n";import{cva as A}from"class-variance-authority";import{twMerge as j}from"tailwind-merge";import{DismissableLayer as M,useDismissableLayerSurface as N}from"@radix-ui/react-dismissable-layer";import{FocusScope as P,FocusScopeBranchProvider as F,useFocusScopeBranch as
|
|
1
|
+
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import r,{clsx as i}from"clsx";import*as a from"react";import o,{Children as s,Component as c,Fragment as l,cloneElement as u,createContext as d,createElement as f,forwardRef as p,isValidElement as m,useCallback as h,useContext as g,useEffect as _,useId as v,useImperativeHandle as y,useInsertionEffect as b,useLayoutEffect as x,useMemo as S,useRef as C,useState as w}from"react";import*as T from"react-dom";import{createPortal as E}from"react-dom";import{SUPPORTED_LANGUAGES as D,useLanguage as O,useUITranslation as k}from"@vertesia/ui/i18n";import{cva as A}from"class-variance-authority";import{twMerge as j}from"tailwind-merge";import{DismissableLayer as M,useDismissableLayerSurface as N}from"@radix-ui/react-dismissable-layer";import{FocusScope as P,FocusScopeBranchProvider as F,useFocusScopeBranch as ee,useFocusScopeBranchRegistry as I}from"@radix-ui/react-focus-scope";import{arrow as te,autoUpdate as ne,computePosition as re,flip as ie,hide as ae,limitShift as oe,offset as se,shift as ce,size as le}from"@floating-ui/dom";import{Env as ue}from"@vertesia/ui/env";import{useFocusGuards as de}from"@radix-ui/react-focus-guards";import{RemoveScroll as fe}from"react-remove-scroll";import{hideOthers as pe}from"aria-hidden";import{useDirection as me}from"@radix-ui/react-direction";import he from"dayjs";import ge from"dayjs/plugin/localizedFormat";import _e from"dayjs/plugin/relativeTime";import{isEqual as ve}from"lodash-es";import*as ye from"react-resizable-panels";function be(e){switch(e){case`xs`:return`size-4`;case`sm`:return`size-6`;case`md`:return`size-8`;case`lg`:return`size-10`;case`xl`:return`size-12`;case`2xl`:return`size-14`;default:throw Error(`Unexpected size: ${e}`)}}function xe({size:e,src:n,name:r,shape:i=`circle`,color:a=`bg-muted text-muted`,className:o}){let s=i===`circle`?`rounded-full`:`rounded-md`,c=be(e||`md`);if(n)return t(`img`,{className:`inline-block ${c} ${s} ${a} ${o}`,src:n,alt:r||n,title:r});if(r){let[n,i]=r.split(` `),l=i?`${n[0]}${i[0]}`:`${n[0]}${n[1]}`;return t(`span`,{className:`inline-flex ${c} items-center justify-center ${s} ${a} ${o}`,title:r,children:t(`span`,{className:`${e===`xs`?`text-[0.6rem]`:`text-xs`} font-medium leading-none text-current`,children:l})})}return t(`span`,{className:`inline-block ${c} overflow-hidden ${s} ${a}`,children:t(`svg`,{className:`h-full w-full text-foreground`,fill:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:t(`path`,{d:`M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z`})})})}function Se({size:e,shape:n=`circle`,color:r=`bg-muted`,className:i,children:a}){let o=n===`circle`?`rounded-full`:`rounded-md`,s=be(e||`md`);return t(`span`,{className:`inline-block ${s} overflow-hidden ${o} ${r} ${i}`,children:a})}function Ce({className:e,children:n}){return t(`div`,{className:r(`flex items-center justify-center`,e),children:n})}function we(e){return t(`svg`,{viewBox:`0 0 25 16`,fill:`currentColor`,"aria-hidden":`true`,...e,children:t(`path`,{d:`M19.4 6C18.7 2.6 15.7 0 12 0 9.1 0 6.6 1.6 5.4 4 2.3 4.4 0 6.9 0 10c0 3.3 2.7 6 6 6h13c2.8 0 5-2.2 5-5 0-2.6-2.1-4.8-4.6-5z`})})}
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v1.57.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const Te=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();
|
|
9
9
|
/**
|
|
10
10
|
* @license lucide-react v1.57.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
function
|
|
15
|
+
function Ee(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Te(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}
|
|
16
16
|
/**
|
|
17
17
|
* @license lucide-react v1.57.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const De=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Oe=e=>{
|
|
23
23
|
/**
|
|
24
24
|
* @license lucide-react v1.57.0 - ISC
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the ISC license.
|
|
27
27
|
* See the LICENSE file in the root directory of this source tree.
|
|
28
28
|
*/
|
|
29
|
-
let t=
|
|
29
|
+
let t=De(e);return t.charAt(0).toUpperCase()+t.slice(1)},ke=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ae={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}
|
|
30
30
|
/**
|
|
31
31
|
* @license lucide-react v1.57.0 - ISC
|
|
32
32
|
*
|
|
@@ -46,21 +46,21 @@ let t=Te(e);return t.charAt(0).toUpperCase()+t.slice(1)},De=(...e)=>e.filter((e,
|
|
|
46
46
|
* This source code is licensed under the ISC license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
|
-
function
|
|
49
|
+
function je(e){return e!=null}function Me(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ae.width,a=e.size??e.height??Ae.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ke(...c):ke(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ae[`stroke-width`])*Number(e.size??e.width??Ae.width)/Number(t.size??t.width??Ae.width):t.strokeWidth??Ae[`stroke-width`];return[`svg`,{...Object.entries(Ae).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&je(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&je(t.width)&&{[r(`width`)]:t.width},...`height`in t&&je(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}
|
|
50
50
|
/**
|
|
51
51
|
* @license lucide-react v1.57.0 - ISC
|
|
52
52
|
*
|
|
53
53
|
* This source code is licensed under the ISC license.
|
|
54
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
55
|
*/
|
|
56
|
-
function
|
|
56
|
+
function Ne(e,t={}){return Me(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}
|
|
57
57
|
/**
|
|
58
58
|
* @license lucide-react v1.57.0 - ISC
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
62
|
*/
|
|
63
|
-
const
|
|
63
|
+
const Pe=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Fe=d({}),Ie=()=>g(Fe),Le=p(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},p)=>{
|
|
64
64
|
/**
|
|
65
65
|
* @license lucide-react v1.57.0 - ISC
|
|
66
66
|
*
|
|
@@ -73,167 +73,167 @@ const Me=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)re
|
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
74
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
75
|
*/
|
|
76
|
-
let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=
|
|
76
|
+
let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=Ie()??{},b=!!c||Pe(d),[x,S,C=[]]=Ne(u,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:ke(y,s),hasA11yProp:b,attributes:d});return f(x,{ref:p,...S},[...C.map(([e,t])=>f(e,t)),...Array.isArray(c)?c:[c]])});
|
|
77
77
|
/**
|
|
78
78
|
* @license lucide-react v1.57.0 - ISC
|
|
79
79
|
*
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
82
|
*/
|
|
83
|
-
function
|
|
83
|
+
function L(e,t=[],n=[]){let r=typeof e==`string`?Ee(e,t,n):e,i=p(({className:e,...t},n)=>f(Le,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Oe(r.name)),i}
|
|
84
84
|
/**
|
|
85
85
|
* @license lucide-react v1.57.0 - ISC
|
|
86
86
|
*
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
88
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
89
|
*/
|
|
90
|
-
const
|
|
90
|
+
const R={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};R.node;const Re=L(R),ze={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
|
|
91
91
|
/**
|
|
92
92
|
* @license lucide-react v1.57.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
96
|
*/
|
|
97
|
-
;
|
|
97
|
+
;ze.node;const Be=L(ze),Ve={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}
|
|
98
98
|
/**
|
|
99
99
|
* @license lucide-react v1.57.0 - ISC
|
|
100
100
|
*
|
|
101
101
|
* This source code is licensed under the ISC license.
|
|
102
102
|
* See the LICENSE file in the root directory of this source tree.
|
|
103
103
|
*/
|
|
104
|
-
;
|
|
104
|
+
;Ve.node;const He=L(Ve),Ue={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}
|
|
105
105
|
/**
|
|
106
106
|
* @license lucide-react v1.57.0 - ISC
|
|
107
107
|
*
|
|
108
108
|
* This source code is licensed under the ISC license.
|
|
109
109
|
* See the LICENSE file in the root directory of this source tree.
|
|
110
110
|
*/
|
|
111
|
-
;
|
|
111
|
+
;Ue.node;const We=L(Ue),Ge={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]}
|
|
112
112
|
/**
|
|
113
113
|
* @license lucide-react v1.57.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
;
|
|
118
|
+
;Ge.node;const Ke=L(Ge),qe={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]}
|
|
119
119
|
/**
|
|
120
120
|
* @license lucide-react v1.57.0 - ISC
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
124
|
*/
|
|
125
|
-
;
|
|
125
|
+
;qe.node;const Je=L(qe),Ye={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]}
|
|
126
126
|
/**
|
|
127
127
|
* @license lucide-react v1.57.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
131
|
*/
|
|
132
|
-
;
|
|
132
|
+
;Ye.node;const Xe=L(Ye),Ze={name:`computer`,size:24,node:[[`path`,{d:`M12 18h6`,key:`aqd8w3`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M8 6h1`,key:`tn6mkg`}],[`rect`,{x:`2`,y:`14`,width:`20`,height:`8`,rx:`2`,key:`rlpjsu`}],[`rect`,{x:`4`,y:`2`,width:`16`,height:`12`,rx:`2`,key:`fhup8x`}]]}
|
|
133
133
|
/**
|
|
134
134
|
* @license lucide-react v1.57.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
138
|
*/
|
|
139
|
-
;
|
|
139
|
+
;Ze.node;const Qe=L(Ze),$e={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}
|
|
140
140
|
/**
|
|
141
141
|
* @license lucide-react v1.57.0 - ISC
|
|
142
142
|
*
|
|
143
143
|
* This source code is licensed under the ISC license.
|
|
144
144
|
* See the LICENSE file in the root directory of this source tree.
|
|
145
145
|
*/
|
|
146
|
-
|
|
146
|
+
;$e.node;const et=L($e),tt={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]}
|
|
147
147
|
/**
|
|
148
148
|
* @license lucide-react v1.57.0 - ISC
|
|
149
149
|
*
|
|
150
150
|
* This source code is licensed under the ISC license.
|
|
151
151
|
* See the LICENSE file in the root directory of this source tree.
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
;tt.node;const nt=L(tt),rt={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]}
|
|
154
154
|
/**
|
|
155
155
|
* @license lucide-react v1.57.0 - ISC
|
|
156
156
|
*
|
|
157
157
|
* This source code is licensed under the ISC license.
|
|
158
158
|
* See the LICENSE file in the root directory of this source tree.
|
|
159
159
|
*/
|
|
160
|
-
;
|
|
160
|
+
;rt.node;const it=L(rt),at={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]}
|
|
161
161
|
/**
|
|
162
162
|
* @license lucide-react v1.57.0 - ISC
|
|
163
163
|
*
|
|
164
164
|
* This source code is licensed under the ISC license.
|
|
165
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
166
166
|
*/
|
|
167
|
-
;
|
|
167
|
+
;at.node;const ot=L(at),st={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
|
|
168
168
|
/**
|
|
169
169
|
* @license lucide-react v1.57.0 - ISC
|
|
170
170
|
*
|
|
171
171
|
* This source code is licensed under the ISC license.
|
|
172
172
|
* See the LICENSE file in the root directory of this source tree.
|
|
173
173
|
*/
|
|
174
|
-
;
|
|
174
|
+
;st.node;const ct=L(st),lt={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}
|
|
175
175
|
/**
|
|
176
176
|
* @license lucide-react v1.57.0 - ISC
|
|
177
177
|
*
|
|
178
178
|
* This source code is licensed under the ISC license.
|
|
179
179
|
* See the LICENSE file in the root directory of this source tree.
|
|
180
180
|
*/
|
|
181
|
-
;
|
|
181
|
+
;lt.node;const ut=L(lt),dt={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]}
|
|
182
182
|
/**
|
|
183
183
|
* @license lucide-react v1.57.0 - ISC
|
|
184
184
|
*
|
|
185
185
|
* This source code is licensed under the ISC license.
|
|
186
186
|
* See the LICENSE file in the root directory of this source tree.
|
|
187
187
|
*/
|
|
188
|
-
;
|
|
188
|
+
;dt.node;const ft=L(dt),pt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]}
|
|
189
189
|
/**
|
|
190
190
|
* @license lucide-react v1.57.0 - ISC
|
|
191
191
|
*
|
|
192
192
|
* This source code is licensed under the ISC license.
|
|
193
193
|
* See the LICENSE file in the root directory of this source tree.
|
|
194
194
|
*/
|
|
195
|
-
;
|
|
195
|
+
;pt.node;const mt=L(pt),ht={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]}
|
|
196
196
|
/**
|
|
197
197
|
* @license lucide-react v1.57.0 - ISC
|
|
198
198
|
*
|
|
199
199
|
* This source code is licensed under the ISC license.
|
|
200
200
|
* See the LICENSE file in the root directory of this source tree.
|
|
201
201
|
*/
|
|
202
|
-
;
|
|
202
|
+
;ht.node;const gt=L(ht),_t={name:`square-plus`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]],aliases:[`plus-square`]}
|
|
203
203
|
/**
|
|
204
204
|
* @license lucide-react v1.57.0 - ISC
|
|
205
205
|
*
|
|
206
206
|
* This source code is licensed under the ISC license.
|
|
207
207
|
* See the LICENSE file in the root directory of this source tree.
|
|
208
208
|
*/
|
|
209
|
-
;
|
|
209
|
+
;_t.node;const vt=L(_t),yt={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]}
|
|
210
210
|
/**
|
|
211
211
|
* @license lucide-react v1.57.0 - ISC
|
|
212
212
|
*
|
|
213
213
|
* This source code is licensed under the ISC license.
|
|
214
214
|
* See the LICENSE file in the root directory of this source tree.
|
|
215
215
|
*/
|
|
216
|
-
;
|
|
216
|
+
;yt.node;const bt=L(yt),xt={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]}
|
|
217
217
|
/**
|
|
218
218
|
* @license lucide-react v1.57.0 - ISC
|
|
219
219
|
*
|
|
220
220
|
* This source code is licensed under the ISC license.
|
|
221
221
|
* See the LICENSE file in the root directory of this source tree.
|
|
222
222
|
*/
|
|
223
|
-
;
|
|
223
|
+
;xt.node;const St=L(xt),Ct={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
|
|
224
224
|
/**
|
|
225
225
|
* @license lucide-react v1.57.0 - ISC
|
|
226
226
|
*
|
|
227
227
|
* This source code is licensed under the ISC license.
|
|
228
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
229
|
*/
|
|
230
|
-
;xt.node;const St=z(xt);function Ct(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;case`ne`:return`sw`;case`nw`:return`se`;case`se`:return`nw`;case`sw`:return`ne`;default:return e}}function wt(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var Tt=class{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case`top`:this.top=t.top-n.height-this.gap,this.alignAxis=`x`;break;case`bottom`:this.top=t.bottom+this.gap,this.alignAxis=`x`;break;case`left`:this.left=t.left-n.width-this.gap,this.alignAxis=`y`;break;case`right`:this.left=t.right+this.gap,this.alignAxis=`y`;break;case`ne`:this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case`nw`:this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case`se`:this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case`sw`:this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case`start`:this.alignAxis===`x`?this.left=t.left:this.top=t.top;break;case`end`:this.alignAxis===`x`?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case`center`:this.alignAxis===`x`?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case`fill`:this.alignAxis===`x`?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw Error(`Invalid position. Cannot compute x,y coordinates`);let r=this.width!=null,i=this.height!=null,a=this.width??t.width,o=this.height??t.height;return{rect:new DOMRect(this.left??0,this.top??0,a,o),constrainWidth:r,constrainHeight:i,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){let t=wt(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Ct(e.position);if(t!==e.position)return{...e,position:t}}return null}};function Et(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function Dt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Ot(e,t,n,r){let i=new Tt(e.gap),a=i.computePosition(e,t,n),o=Dt(a.rect,r,`x`),s=Dt(a.rect,r,`y`);if(o&&s)return a;let c=null;return o||(c=i.flipAxis(e,`x`)),s||(c=i.flipAxis(c||e,`y`)),c?(a=new Tt(i.gap).computePosition(c,t,n),Et(a.rect,r)?a:null):null}function kt(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return i<=n||a<=r?null:new DOMRect(n,r,i-n,a-r)}function At(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=kt(e[n].getBoundingClientRect(),t),!t)return null;return t}function jt(e){let t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){let r=getComputedStyle(e);if(t&&r.overflowY!==`visible`||n&&r.overflowX!==`visible`)return!0}return!1}function Mt(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)jt(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var Nt=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=Mt(this.anchor,this.root),this.visibleClientRect=At(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){let t=this.scrollableParents,n=()=>{this.update()};window.addEventListener(`resize`,n);for(let e of t)e.addEventListener(`scroll`,n);let r;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(()=>{r&&document.addEventListener(`click`,r)},0));let i;this.options.closeOnEsc&&(i=e=>{e.key===`Escape`&&this.tryClose()},window.setTimeout(()=>{i&&document.addEventListener(`keydown`,i)},0));let a=this.options.blockPageScroll;return a&&(document.body.style.overflow=`hidden`,document.body.style.height=`100%`),()=>{window.removeEventListener(`resize`,n);for(let e of t)e.removeEventListener(`scroll`,n);r&&document.removeEventListener(`click`,r),i&&document.removeEventListener(`keydown`,i),a&&(document.body.style.overflow=``,document.body.style.height=``)}}open(e,t){if(this.context)throw Error(`The popup controller is already bound to an element`);this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display=``,e.style.visibility=`hidden`,this.update(),this.options.onOpen?.(this))}close(){if(!this.context)throw Error(`The popup controller is not bound to an element`);this.tryClose()}tryClose(){this.context&&=(this.options.onClose?.(this),this.context.cleanup(),this.context.element.style.display=`none`,void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;let e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),i=this.visibleClientRect;if(!i)return;let a=Ot(t,n,r,i);this.context.position=a||void 0,a&&(a.constrainHeight&&(e.style.height=`${a.rect.height}px`),a.constrainWidth&&(e.style.width=`${a.rect.width}px`),e.style.left=`${a.rect.left}px`,e.style.top=`${a.rect.top}px`,e.style.visibility=`visible`)}createPopupElement(){let e=document.createElement(`div`);return e.style.margin=`0`,e.style.padding=`0`,e.style.border=`none`,e.style.background=`transparent`,e.className=`composable-Popup`,e}};const Pt=d(void 0);function Ft(){let e=g(Pt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function It({ctrlRef:e,id:n,constraints:r,isOpen:i,children:a,className:o,onClose:s,onOpen:c,zIndex:l,position:u,anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h}){let g=C(null),[v,y]=w(),b=C(s),x=C(c);return b.current=s,x.current=c,_(()=>{if(!d)throw Error(`Anchor element is required`);let e=new Nt({anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h,onClose:()=>b.current?.(),onOpen:()=>x.current?.()});return y(e),()=>{e.tryClose()}},[d,h,p,m,f]),_(()=>{e&&(e.current=v)},[v,e]),_(()=>{v&&g.current?v.isOpen!==i&&(i?v.open(g.current,r):v.close()):v?.isOpen&&!i&&v.close()},[r,i,v]),t(Pt.Provider,{value:v,children:i&&E(t(`div`,{id:n,style:{visibility:`hidden`,position:u||`absolute`,zIndex:l||100},ref:g,className:o,children:a}),document.body)})}function Lt({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(It,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function Rt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var zt=class{filter(e,t){let n=t.toLowerCase();return e.filter(e=>this.valueOf(e).toLowerCase().includes(n))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}createItem(e){return null}},Bt=class e extends zt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},Vt=class e extends Bt{createItem(e){return e}static instance=new e};function Ht(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:`w-72 mt-1 border-popover bg-popover text-popover-foreground shadow-md overflow-auto p-0 z-10`,inputClass:r(t?`block m-0 p-0 border-0 focus:outline-none focus:ring-0`:`block sm:text-sm sm:leading-6 bg-muted rounded-md border-0 shadow-sm ring-1 ring-inset ring-muted placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-primary py-1.5`,e?`w-full`:`!w-auto`),optionClass:`py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-info`,Input:Wt,Menu:Kt,Toggle:Gt}}function Ut({menuAlign:r=`fill`,menuGap:i,focusOnMount:a,onSelect:s,value:c,zIndex:l,unstyledInput:u,fullWidth:d,api:f,layout:p,adapter:m,items:h,placeholder:g,clearable:v,noMatchMessage:y,openOnFocus:b}){let[x]=w(Rt()),S=C(void 0),T=C(null),E=p?Object.assign(Ht(d,u),p):Ht(d,u),D=o.useRef(null),O=qt({adapter:m,items:h,value:c,popupId:x});_(()=>{T.current&&a&&T.current.focus()},[a]),_(()=>{O.onSelect=s,O.popupCtrl=S.current},[O,s]),_(()=>{if(f&&O&&T.current)return f.current={open:()=>O.openMenu(),close:()=>O.closeMenu(),toggle:()=>O.toggleMenu(),setInputValue:e=>O.inputText=e,inputValue:O.inputText||``,selectedItem:O.selectedItem,focus:()=>T.current?.focus()},()=>{f.current=null}},[f,O]);let k=O.isMenuOpen&&(O.filteredItems.length>0||!!y);return n(e,{children:[t(E.Input,{boxRef:D,inputRef:T,ctrl:O,layout:E,placeholder:g,clearable:v,openOnFocus:b}),t(Lt,{id:x,ctrlRef:S,className:`combobox-popup`,closeOnClick:!0,closeOnEsc:!0,onClose:()=>O.closeMenu(),isOpen:k,anchor:D,zIndex:l,constraints:{position:`bottom`,align:r,gap:i??4},children:t(E.Menu,{fillWidth:r===`fill`,items:O.filteredItems,ctrl:O,layout:E,adapter:m,noMatchMessage:y})})]})}function Wt({inputRef:e,placeholder:r,boxRef:i,ctrl:a,layout:o,clearable:s,openOnFocus:c}){let l=o.Toggle,u=s&&a.selectedItem!=null,d=+!!l+ +!!u,f=d>0?{paddingRight:`${o.buttonWidth*d+o.buttonRight}px`}:void 0;return n(`div`,{className:`relative`,ref:i,children:[t(`input`,{ref:e,placeholder:r,...a.getInputProps(),onFocus:c?()=>a.openMenu():void 0,style:f,className:o.inputClass}),n(`div`,{style:{position:`absolute`,right:`${o.buttonRight}px`,top:0,bottom:0,display:`flex`,alignItems:`center`,gap:`2px`},children:[u&&t(`button`,{type:`button`,style:{border:`none`,padding:0,margin:0,backgroundColor:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,width:`${o.buttonWidth}px`},onClick:()=>{a.selectedItem=null},children:t(St,{className:`w-4 h-4`})}),l&&t(`button`,{type:`button`,style:{width:`${o.buttonWidth}px`,border:`none`,padding:0,margin:0,backgroundColor:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},...a.getToggleButtonProps(),children:t(l,{ctrl:a,layout:o})})]})]})}function Gt({ctrl:e}){return e.isMenuOpen?t(He,{className:`w-4 h-4`}):t(Re,{className:`w-4 h-4`})}function Kt({fillWidth:e,items:n,layout:i,ctrl:a,adapter:o,noMatchMessage:s}){let{highlightedIndex:c,selectedItem:l}=a;return n.length===0?s?t(`div`,{style:{width:e?`100%`:void 0},className:i.menuClass,children:s}):null:t(`ul`,{style:{width:e?`100%`:void 0,maxHeight:i.maxMenuHeight?`${i.maxMenuHeight}px`:`240px`},className:i.menuClass,...a.getMenuProps(),children:n.map((e,n)=>t(`li`,{"data-index":n,className:r(i.optionClass,c===n&&`option-highlighted`,l===e&&`option-selected`),...a.getItemProps(e,n),children:o.renderOption(e)},o.idOf(e)))})}function qt(e){let[t,n]=w(new Jt(e));return _(()=>{t?.withState(n)},[t]),t}var Jt=class e{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText=``;_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,typeof n==`string`?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items}withState(e){return this.setState=e,this}clone(){let t=new e({adapter:this.adapter,items:this.items,popupId:this.popupId});return t.setState=this.setState,t.onSelect=this.onSelect,t._inputText=this._inputText,t._highlightedIndex=this._highlightedIndex,t._selectedItem=this._selectedItem,t._isMenuOpen=this._isMenuOpen,t._filteredItems=this._filteredItems,t.popupCtrl=this.popupCtrl,t}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):``,this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){let e=this.popupCtrl,t=e.context?.position?.position;t&&t===`top`&&window.setTimeout(()=>{e.update()},100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;let n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){let e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{let t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{let n=t.key;if(n===`Enter`){if(this.highlightedIndex!=null)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){let e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else n===`ArrowDown`?this.isMenuOpen?this.highlightIndex(this.highlightedIndex===null?0:Yt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Xt(this.highlightedIndex,e.length),!0)}}}};function Yt(e,t){return(e+1)%t}function Xt(e,t){return(e-1+t)%t}function Zt({options:e,creatable:n,...r}){let i=n?Vt.instance:Bt.instance;return t(Ut,{adapter:i,items:e,...r})}function Qt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var $t=Object.defineProperty,en=(e,t)=>$t(e,`name`,{value:t,configurable:!0});function tn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}en(tn,`setRef`);function nn(...e){return t=>{let n=!1,r=e.map(e=>{let r=tn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():tn(e[t],null)}}}}en(nn,`composeRefs`);function V(...e){return a.useCallback(nn(...e),e)}en(V,`useComposedRefs`);var rn=Object.defineProperty,an=(e,t)=>rn(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
231
|
-
function
|
|
232
|
-
function
|
|
233
|
-
function
|
|
234
|
-
function Mn(e,n=[]){let r=[];function i(n,i){let o=a.createContext(i);o.displayName=n+`Context`;let s=r.length;r=[...r,i];let c=/* @__PURE__ */ An(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return/* @__PURE__ */ t(l.Provider,{value:u,children:i})},`Provider`);c.displayName=n+`Provider`;function l(t,r,c={}){let{optional:l=!1}=c,u=r?.[e]?.[s]||o,d=a.useContext(u);if(d)return d;if(i!==void 0)return i;if(!l)throw Error(`\`${t}\` must be used within \`${n}\``)}return An(l,`useContext`),[c,l]}An(i,`createContext`);let o=/* @__PURE__ */ An(()=>{let t=r.map(e=>a.createContext(e));return/* @__PURE__ */ An(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,Nn(o,...n)]}An(Mn,`createContextScope`);function Nn(...e){let t=e[0];if(e.length===1)return t;let n=/* @__PURE__ */ An(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return/* @__PURE__ */ An(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}An(Nn,`composeContextScopes`);var Pn=globalThis?.document?a.useLayoutEffect:()=>{},Fn=Object.defineProperty,In=(e,t)=>Fn(e,`name`,{value:t,configurable:!0}),Ln=a.useId||(()=>void 0),Rn=0;function W(e){let[t,n]=a.useState(Ln());return Pn(()=>{e||n(e=>e??String(Rn++))},[e]),e||(t?`radix-${t}`:``)}In(W,`useId`);var zn=typeof document<`u`?x:function(){};function Bn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Bn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Bn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Vn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hn(e,t){let n=Vn(e);return Math.round(t*n)/n}function Un(e){let t=a.useRef(e);return zn(()=>{t.current=e}),t}function Wn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=a.useState(r);Bn(p,r)||m(r);let[h,g]=a.useState(null),[_,v]=a.useState(null),y=a.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=a.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=a.useRef(null),w=a.useRef(null),E=a.useRef(d),D=l!=null,O=Un(l),k=Un(i),A=Un(u),j=a.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),te(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Bn(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);zn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);zn(()=>(M.current=!0,()=>{M.current=!1}),[]),zn(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=a.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=a.useMemo(()=>({reference:x,floating:S}),[x,S]),F=a.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Hn(P.floating,d.x),r=Hn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Vn(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}const Gn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:R({element:r.current,padding:i}).fn(n):r?R({element:r,padding:i}).fn(n):{}}}},Kn=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},qn=(e,t)=>{let n=oe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jn=(e,t)=>({fn:ie(e).fn,options:[e,t]}),Yn=(e,t)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xn=(e,t)=>{let n=se(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{let n=re(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qn=(e,t)=>{let n=Gn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0}),G=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=/* @__PURE__ */ on(`Primitive.${n}`),i=a.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),/* @__PURE__ */ t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function tr(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}er(tr,`dispatchDiscreteCustomEvent`);var nr=Object.defineProperty,rr=(e,t)=>nr(e,`name`,{value:t,configurable:!0}),ir=a.useInsertionEffect;function ar(e){let t=a.useRef(e);return typeof ir==`function`?ir(()=>{t.current=e}):Pn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}rr(ar,`useCallbackRef`);var or=Object.defineProperty,sr=(e,t)=>or(e,`name`,{value:t,configurable:!0});function cr(e){let[t,n]=a.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}sr(cr,`useSize`);var lr=Object.defineProperty,ur=(e,t)=>lr(e,`name`,{value:t,configurable:!0}),dr={Partial:`partial`,Always:`always`},fr={Optimized:`optimized`,Always:`always`},pr=`Popper`,[mr,hr]=/* @__PURE__ */ Mn(pr),[gr,_r]=mr(pr),vr=/* @__PURE__ */ ur(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return/* @__PURE__ */ t(gr,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),yr=`PopperAnchor`,br=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ur(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=_r(yr,r),c=a.useRef(null),l=s.onAnchorChange,u=V(n,a.useCallback(e=>{c.current=e,e&&l(e)},[l])),d=a.useRef(null);a.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&l(d.current)});let f=s.placementState&&Dr(s.placementState),p=f?.[0],m=f?.[1];return i?null:/* @__PURE__ */ t(G.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),xr=`PopperContent`,[Sr,Cr]=mr(xr),wr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ur(function(e,n){let{__scopePopper:r,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=dr.Partial,hideWhenDetached:m=!1,updatePositionStrategy:h=fr.Optimized,onPlaced:g,..._}=e,v=_r(xr,r),[y,b]=a.useState(null),x=V(n,b),[S,C]=a.useState(null),w=cr(S),T=w?.width??0,E=w?.height??0,D=i+(s===`center`?``:`-`+s),O=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],A=k.length>0,j={padding:O,boundary:k.filter(Tr),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=Wn({strategy:`fixed`,placement:D,whileElementsMounted:/* @__PURE__ */ ur((...e)=>ee(...e,{animationFrame:h===fr.Always}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Kn({mainAxis:o+E,alignmentAxis:c}),u&&qn({mainAxis:!0,crossAxis:!1,...p===dr.Partial?{limiter:Jn()}:{},...j}),u&&Yn({...j}),Xn({...j,apply:/* @__PURE__ */ ur(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Qn({element:S,padding:l}),Er({arrowWidth:T,arrowHeight:E}),m&&Zn(A?{strategy:`referenceHidden`,...j}:{strategy:`referenceHidden`,padding:j.padding,altBoundary:j.altBoundary})]}),L=v.setPlacementState;Pn(()=>(L(P),()=>{L(void 0)}),[P,L]);let[R,te]=Dr(P),ne=ar(g);Pn(()=>{F&&ne?.()},[F,ne]);let re=I.arrow?.x,ie=I.arrow?.y,ae=I.arrow?.centerOffset!==0,[oe,se]=a.useState();return Pn(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),/* @__PURE__ */ t(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:/* @__PURE__ */ t(Sr,{scope:r,placedSide:R,placedAlign:te,onArrowChange:C,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:/* @__PURE__ */ t(G.div,{"data-side":R,"data-align":te,..._,ref:x,style:{..._.style,animation:F?_.style?.animation:`none`}})})})},`PopperContent`));function Tr(e){return e!==null}ur(Tr,`isNotNull`);var Er=/* @__PURE__ */ ur(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Dr(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Dr(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ur(Dr,`getSideAndAlignFromPlacement`);var Or=Object.defineProperty,kr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>Or(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);Pn(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(/* @__PURE__ */ t(G.div,{...i,ref:n}),c):null},`Portal`)),Ar=Object.defineProperty,jr=(e,t)=>Ar(e,`name`,{value:t,configurable:!0});function Mr(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}jr(Mr,`useStateMachine`);var Nr=/* @__PURE__ */ jr(e=>{let{present:t,children:n}=e,r=Pr(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=Ir(r.ref,Rr(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function Pr(e){let[t,n]=a.useState(),r=a.useRef(null),i=a.useRef(e),o=a.useRef(`none`),s=a.useRef(void 0),[c,l]=Mr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return a.useEffect(()=>{c===`mounted`?(o.current=s.current??Lr(r.current),s.current=void 0):o.current=`none`},[c]),Pn(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=Lr(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),Pn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=/* @__PURE__ */ jr(a=>{let o=Lr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=/* @__PURE__ */ jr(e=>{e.target===t&&(o.current=Lr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:a.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=Lr(t)}else r.current=null;n(e)},[])}}jr(Pr,`usePresence`);function Fr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}jr(Fr,`setRef`);function Ir(...e){let t=a.useRef(e);return t.current=e,a.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Fr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Fr(n[e],null)}}},[])}jr(Ir,`useStableComposedRefs`);function Lr(e){return e?.animationName||`none`}jr(Lr,`getAnimationName`);function Rr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}jr(Rr,`getElementRef`);var zr=Object.defineProperty,Br=(e,t)=>zr(e,`name`,{value:t,configurable:!0}),Vr=a.useEffectEvent,Hr=a.useInsertionEffect;function Ur(e){if(typeof Vr==`function`)return Vr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Hr==`function`?Hr(()=>{t.current=e}):Pn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}Br(Ur,`useEffectEvent`);var Wr=Object.defineProperty,Gr=(e,t)=>Wr(e,`name`,{value:t,configurable:!0}),Kr=a.useInsertionEffect||Pn;function qr({prop:e,defaultProp:t,onChange:n=/* @__PURE__ */ Gr(()=>{},`onChange`),caller:r}){let[i,o,s]=Jr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Yr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}Gr(qr,`useControllableState`);function Jr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return Kr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}Gr(Jr,`useUncontrolledState`);function Yr(e){return typeof e==`function`}Gr(Yr,`isFunction`);var Xr=Symbol(`RADIX:SYNC_STATE`);function Zr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=Ur(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Xr)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=a.useRef(m);a.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=a.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return a.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Xr,state:i})},[i,f.state,l]),[g,p]}Gr(Zr,`useControllableStateReducer`);var Qr=Object.defineProperty,$r=(e,t)=>Qr(e,`name`,{value:t,configurable:!0}),ei=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ti=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $r(function(e,n){return/* @__PURE__ */ t(G.span,{...e,ref:n,style:{...ei,...e.style}})},`VisuallyHidden`)),ni=Object.defineProperty,ri=(e,t)=>ni(e,`name`,{value:t,configurable:!0}),[ii,ai]=/* @__PURE__ */ Mn(`Tooltip`,[hr]),oi=hr(),si=`TooltipProvider`,ci=700,li=`tooltip.open`,[ui,di]=ii(si),fi=/* @__PURE__ */ ri(e=>{let{__scopeTooltip:n,delayDuration:r=ci,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=a.useRef(!0),l=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),/* @__PURE__ */ t(ui,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),c.current=!1)},[i]),onClose:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:a.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})},`TooltipProvider`),pi=`Tooltip`,[mi,hi]=ii(pi),gi=/* @__PURE__ */ ri(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=di(pi,e.__scopeTooltip),d=oi(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=W(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=qr({prop:i,defaultProp:o??!1,onChange:/* @__PURE__ */ ri(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(li))):u.onClose(),s?.(e)},`onChange`),caller:pi}),C=a.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);a.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=m??g;return/* @__PURE__ */ t(vr,{...d,children:/* @__PURE__ */ t(mi,{scope:n,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?E():w()},[u.isOpenDelayedRef,E,w]),onTriggerLeave:a.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:r})})},`Tooltip`),_i=`TooltipTrigger`,vi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ri(function(e,n){let{__scopeTooltip:r,"aria-describedby":i,...o}=e,s=hi(_i,r),c=di(_i,r),l=oi(r),u=V(n,a.useRef(null),s.onTriggerChange),d=a.useRef(!1),f=a.useRef(!1),p=a.useCallback(()=>d.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),/* @__PURE__ */ t(br,{asChild:!0,...l,children:/* @__PURE__ */ t(G.button,{"aria-describedby":s.open?Pi(i,s.contentId):i,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:U(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!c.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:U(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:U(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:U(e.onBlur,s.onClose),onClick:U(e.onClick,s.onClose)})})},`TooltipTrigger`)),yi=`TooltipPortal`,[bi,xi]=ii(yi,{forceMount:void 0}),Si=/* @__PURE__ */ ri(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=hi(yi,n);return/* @__PURE__ */ t(bi,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Nr,{present:r||o.open,children:/* @__PURE__ */ t(kr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),Ci=`TooltipContent`,wi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ri(function(e,n){let r=xi(Ci,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=hi(Ci,e.__scopeTooltip);return/* @__PURE__ */ t(Nr,{present:i||s.open,children:s.disableHoverableContent?/* @__PURE__ */ t(Di,{side:a,...o,ref:n}):/* @__PURE__ */ t(Ti,{side:a,...o,ref:n})})},`TooltipContent`)),Ti=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ri(function(e,n){let r=hi(Ci,e.__scopeTooltip),i=di(Ci,e.__scopeTooltip),o=a.useRef(null),s=V(n,o),[c,l]=a.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=i,m=a.useCallback(()=>{l(null),p(!1)},[p]),h=a.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ki(r,Oi(r,n.getBoundingClientRect())),a=Ai(t.getBoundingClientRect()),o=Mi([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=/* @__PURE__ */ ri(e=>h(e,f),`handleTriggerLeave`),t=/* @__PURE__ */ ri(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),a.useEffect(()=>{if(c){let e=/* @__PURE__ */ ri(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!ji(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),/* @__PURE__ */ t(Di,{...e,ref:s})},`TooltipContentHoverable`)),Ei=/* @__PURE__ */ ln(`TooltipContent`),Di=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ri(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=hi(Ci,i),p=oi(i),{onClose:m}=f,[h,g]=a.useState(null),_=V(r,g);I(h),a.useEffect(()=>(document.addEventListener(li,m),()=>document.removeEventListener(li,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=/* @__PURE__ */ ri(e=>{e.target instanceof Node&&e.target.contains(f.trigger)&&m()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[f.trigger,m]);let{setContentId:v}=f;return Pn(()=>(v(c),()=>{v(void 0)}),[c,v]),/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:/* @__PURE__ */ n(wr,{"data-state":f.stateAttribute,role:s?void 0:`tooltip`,id:s?void 0:f.contentId,...p,...d,ref:_,style:{...d.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[/* @__PURE__ */ t(Ei,{children:o}),s?/* @__PURE__ */ t(ti,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function Oi(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}ri(Oi,`getExitSideFromRect`);function ki(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}ri(ki,`getPaddedExitPoints`);function Ai(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}ri(Ai,`getPointsFromRect`);function ji(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}ri(ji,`isPointInPolygon`);function Mi(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Ni(t)}ri(Mi,`getHull`);function Ni(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}ri(Ni,`getHullPresorted`);function Pi(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}ri(Pi,`concatAriaDescribedby`);const Fi=o.createContext(void 0);function Ii(e,t=`plugin-portal-container`){let n=e instanceof Document?e.body:e;for(let e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;let r=document.createElement(`div`);return r.id=t,n.appendChild(r),r}function Li({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(Fi),i=o.useRef(null),[a,s]=o.useState(r||void 0);return o.useEffect(()=>{if(r){s(r);return}if(i.current){let e=i.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){let t=Ii(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(Fi.Provider,{value:a||void 0,children:e})}function Ri(){return o.useContext(Fi)}const zi=fi,Bi=gi,Vi=vi,Hi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=Ri();return t(Si,{container:o,children:t(wi,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:H(`max-w-[90vw]`,`z-50 overflow-hidden rounded-md bg-tooltips border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});Hi.displayName=wi.displayName;function Ui({description:e,children:r,size:i=`sm`,placement:o=`top`,className:s,asChild:c}){let[l,u]=a.useState(!1),d=a.useRef(!1);return a.useEffect(()=>{let e=()=>{u(!1),d.current=!0,requestAnimationFrame(()=>{d.current=!1})};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,e)}},[]),t(zi,{delayDuration:0,children:n(Bi,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(Vi,{className:`cursor-pointer`,asChild:c,children:r}),t(Hi,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const Wi=/* @__PURE__ */ new Set;function Gi(e,t,n){_(()=>{t&&!Wi.has(e)&&(Wi.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Ki(e){return a.Children.toArray(e).some(e=>{if(typeof e==`string`)return e.trim().length>0;if(typeof e==`number`)return!0;if(a.isValidElement(e)){let t=e.props;return t[`aria-hidden`]===!0||t[`aria-hidden`]===`true`?!1:Ki(t.children)}return!1})}const qi=A(`hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{destructive:`bg-destructive text-destructive ring-1 ring-inset ring-destructive/50 shadow-xs hover:bg-destructive/50`,outline:`border border-input bg-background shadow-xs hover:bg-muted ring-inset`,secondary:`bg-info text-info shadow-xs hover:bg-mixer-info/10 ring-inset`,ghost:`hover:bg-muted/50 ring-inset`,link:`text-foreground underline-offset-4 hover:underline ring-inset`,primary:`bg-primary text-primary shadow-xs hover:bg-primary/90 ring-inset`,unstyled:``},size:{xs:`h-7 rounded px-2 py-1 text-xs gap-x-1`,sm:`h-8 rounded px-3 text-xs`,md:`h-9 rounded-md px-4 py-2`,lg:`h-10 rounded-md px-3`,xl:`rounded-md px-3.5 py-2.5 text-sm gap-x-2`,icon:`p-0 m-0 rounded-full`,none:``}},defaultVariants:{variant:`primary`,size:`md`}}),K=a.forwardRef(({className:r,variant:i,size:a,asChild:o=!1,alt:s,isDisabled:c,isLoading:l,title:u,tooltipPlacement:d=`top`,onClick:f,type:p,...m},h)=>{Gi(`Button.alt`,s!==void 0,"use `title` instead — it drives the same tooltip and the accessible name. `alt` remains an alias for one release.");let g=o?sn:`button`,_=o?p:p??`button`,v=u??s,y=m[`aria-label`]??s??(Ki(m.children)?void 0:u),b=o?m.children:n(e,{children:[l&&t(ot,{className:`animate-spin`}),m.children]}),x=t(g,{className:H(qi({variant:i,size:a}),r),disabled:c||l||m.disabled,ref:h,onClick:f,type:_,autoFocus:!1,...m,"aria-label":y,children:b});return v?t(Ui,{description:v,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:d,children:x}):x});K.displayName=`Button`;const Ji=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,BtnIcon:o,"aria-label":s,...c},l)=>{let[u,d]=w(!1),{t:f}=k();Gi(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let p=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{d(!0),setTimeout(()=>d(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||f(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:f(`misc.failedToCopy`),duration:2e3})})},m=s??a??f(`misc.copy`);return t(K,{ref:l,className:H(i),variant:`unstyled`,size:e||`sm`,onClick:p,...c,title:m,children:u?t(Ie,{className:`text-success`}):o??t(Qe,{className:`size-4`})})});Ji.displayName=`CopyButton`;function Yi({buttonLabel:e,title:r,children:i,onClick:a}){return t(`div`,{className:`flex items-center justify-center h-full text-center`,children:n(`div`,{className:`py-12`,children:[t(`svg`,{className:`mx-auto size-12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{vectorEffect:`non-scaling-stroke`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z`})}),t(`h3`,{className:`mt-2 text-sm font-semibold`,children:r}),t(`p`,{className:`mt-1 text-sm text-muted`,children:i}),t(`div`,{className:`mt-6`,children:n(K,{onClick:a,children:[t(ft,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Xi(e){return e.isFile}function Zi(e){return e.isDirectory}function Qi(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function $i({children:e,onUpload:r}){let i=C(null);return n(`label`,{style:{cursor:`pointer`},children:[e,t(`input`,{ref:i,type:`file`,style:{display:`none`},onChange:()=>{i.current?.files&&r(Qi(i.current.files))}})]})}function ea({onUpload:e}){let r=ia({onUpload:e});return t(`div`,{...r,className:`flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-muted hover:bg-background border-border`,children:n(`label`,{htmlFor:`dropzone-file`,className:`flex flex-col items-center justify-center w-full h-full`,children:[n(`div`,{className:`flex flex-col items-center justify-center pt-5 pb-6`,children:[t(`svg`,{className:`w-8 h-8 mb-4 text-muted`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 16`,children:t(`path`,{stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2`})}),n(`p`,{className:`mb-2 text-sm text-muted`,children:[t(`span`,{className:`font-semibold`,children:`Click to upload`}),` or drag and drop`]}),t(`p`,{className:`text-xs text-muted`,children:`SVG, PNG, JPG or GIF (MAX. 800x400px)`})]}),t(`input`,{id:`dropzone-file`,type:`file`,className:`hidden`})]})})}function ta(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function na(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function ra(e){e&&delete e.__dragOver_cnt__}function ia({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),ra(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Xi(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(Zi(e)){let i=e.createReader(),a=[],o=()=>{i.readEntries(i=>{if(!i.length)Promise.all(a).then(e=>r(e.flat()));else{for(let r of i)a.push(n(r,`${t+e.name}/`));o()}})};o()}});for(let e=0;e<i.length;e++){let r=i[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{let n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{ta(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{na(r.current)&&r.current?.classList.remove(t)},ref:r}}function aa({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(Ui,{description:e,placement:r,children:t(nt,{className:H(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function oa(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function sa(){try{return ce.isDev}catch{return!1}}function ca({description:e,helpText:i,error:a,required:o,label:c,className:d,direction:f=`column`,children:p,disabled:h=!1,fullWidthLabel:g=!1,childrenId:_}){let y=v(),b=v(),x=v(),S=_??y,w=C(!1),T=s.toArray(p).filter(m),E=T.length===1?T[0]:void 0,D=E?.type===l,O=!!E&&!D,k=!1,A=p;if(O&&E){let e=E,t=e.props??{},n=oa(t[`aria-describedby`],i?b:void 0,a?x:void 0),r=t[`aria-invalid`]??(a?!0:void 0);A=u(e,{id:t.id??S,"aria-describedby":n,"aria-invalid":r}),k=!0}else sa()&&!w.current&&(i||a||_===void 0)&&(w.current=!0,console.warn("[@vertesia/ui] FormItem received zero, multiple, or a fragment as element children. ARIA wiring skipped. Pass `childrenId` and set `id` / `aria-describedby` / `aria-invalid` on your input manually, or wrap the input in a single non-fragment element."));let j=k||_?S:void 0;return n(`div`,{className:r(`flex w-full space-y-1`,d,f===`row`?`flex-row justify-between items-center gap-2`:f===`row-reverse`?`flex-row-reverse justify-between items-center gap-2`:`flex-col`),children:[n(`div`,{className:r(`flex items-center gap-1 mb-0`,g&&`w-full`),children:[n(`label`,{htmlFor:j,className:`text-sm font-medium mb-1 ${h?`text-muted`:``} ${g&&`flex-1`}`,children:[c,o?t(`span`,{className:`text-destructive -mt-4 ms-1`,children:`*`}):``]}),e&&t(`div`,{className:`mx-2 flex w-4 items-center`,children:t(aa,{description:e})})]}),A,i&&t(`p`,{id:b,className:`text-xs text-muted`,children:i}),a&&t(`p`,{id:x,className:`text-xs text-destructive`,children:a})]})}function la(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const ua=A(`inline-flex items-center rounded-md px-2 py-1 text-xs font-medium`,{variants:{variant:{default:`text-foreground bg-muted`,secondary:`bg-secondary text-info`,destructive:`bg-destructive text-destructive`,attention:`bg-attention text-attention`,success:`bg-success text-success`,info:`bg-info text-info`,done:`bg-done text-done`,outline:`bg-transparent border border-border text-foreground`}},defaultVariants:{variant:`default`}});function da({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:la(i)}:{};return t(`span`,{className:H(ua({variant:n}),e),...o,...a,children:r})}const fa=A(`inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border`,{variants:{variant:{default:``,success:``,destructive:``,attention:``,done:``,info:``,outline:``}},defaultVariants:{variant:`default`}}),pa=A(`h-1.5 w-1.5`,{variants:{variant:{default:`fill-foreground`,success:`fill-success`,destructive:`fill-destructive`,attention:`fill-attention`,done:`fill-done`,info:`fill-info`,outline:`fill-foreground`}},defaultVariants:{variant:`default`}});function ma({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:H(fa({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:H(pa({variant:e}),i),viewBox:`0 0 6 6`,"aria-hidden":`true`,children:t(`circle`,{cx:3,cy:3,r:3})})}),t(`span`,{className:`truncate`,children:a})]})}function ha({value:e=[],onChange:i,className:a,delimiters:o=`, `,placeholder:s,autoFocus:c,disabled:l=!1}){let[u,d]=w(``),f=t=>{if(l)return;let n=t.currentTarget.value;n?.trim()&&(i([...e,n.trim()]),d(``))},p=t=>{if(l)return;let n=t.currentTarget.value,r=!n.trim(),a=t.key;a===`Enter`||o.indexOf(a)>-1?(t.preventDefault(),e&&!r&&(i([...e,n.trim()]),d(``))):a===`Backspace`&&r&&e&&e.length>0&&(e.pop(),i([...e]))},m=t=>{if(l)return;let n=t.clipboardData.getData(`text`);if(n){t.preventDefault();let r=o.split(``).map(e=>e===` `?`\\s`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`[${r}]+`),s=n.split(a).map(e=>e.trim()).filter(e=>e.length>0);s.length>0&&i([...e,...s]),d(``)}},h=t=>{l||e&&e.length>0&&(e.splice(t,1),i([...e]))};return n(`div`,{className:r(a,`w-full flex flex-wrap items-center gap-1 p-2 py-1.5`,`rounded-md text-sm 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`,l&&`opacity-50 cursor-not-allowed`),children:[e&&e.length>0&&e.map((e,n)=>t(Ui,{description:`click to remove`,children:t(da,{variant:`secondary`,onClick:()=>h(n),className:r(`flex-shrink-0 transition-colors`,l?`cursor-not-allowed`:`cursor-pointer hover:bg-destructive hover:text-destructive`),title:e,children:t(`span`,{className:`break-all`,children:e})})},`item-${n}`)),t(`input`,{className:`flex-1 min-w-[80px] m-0 p-0 px-1 border-0 bg-transparent text-sm placeholder:text-muted focus:outline-none focus:ring-0 disabled:cursor-not-allowed`,type:`text`,value:u,onBlur:f,onKeyDown:p,onPaste:m,onChange:e=>d(e.currentTarget.value),placeholder:!e||e.length===0?s:``,autoFocus:c,disabled:l})]})}function ga({underline:e=`always`,className:n,children:i,...a}){let o;return e===`always`?o=`underline`:e===`hover`&&(o=`hover:underline`),t(`a`,{className:r(`text-info`,n,o),...a,children:i})}function _a({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}_a.Item=p(function(e,n){let{current:i,children:a,className:o,href:s=`#`,onClick:c,...l}=e;return t(`li`,{className:r(o,i?`bg-muted`:``,`w-full p-2 ps-3 text-sm leading-6 font-semibold hover:bg-muted`),children:t(`a`,{ref:n,href:s,onClick:e=>{c?(e.preventDefault(),c(e)):s===`#`&&e.preventDefault()},className:`w-full flex items-center gap-x-3`,...l,children:a})})});const va=`rounded-md text-sm 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`,ya={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:va,INPUT:`${va} py-1.5`};function ba(e){return e==null||Number.isNaN(e)?``:e.toString()}const xa=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(ba(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=ba(e);d(t)}},[e]),t(`input`,{onWheel:a?e=>{e.currentTarget.blur()}:c.onWheel,type:`number`,value:u,onChange:e=>{let t=e.target.value;d(t),t===``?n?.(void 0,t):n?.(parseFloat(t),t)},className:r(i,ya.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),Sa=d({});function Ca(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const wa=typeof window<`u`?x:_,Ta=/* @__PURE__ */ d(null);function Ea(e,t){e.indexOf(t)===-1&&e.push(t)}function Da(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const Oa=(e,t,n)=>n>t?t:n<e?e:n,ka={},Aa=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ja=e=>typeof e==`object`&&!!e,Ma=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
|
|
235
|
-
function
|
|
236
|
-
function Ua(e,t,n,r){if(e===t&&n===r)return Pa;let i=t=>Ha(t,0,1,e,n);return e=>e===0||e===1?e:Va(i(e),t,r)}const Wa=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ga=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),Ka=/*@__PURE__*/ Ua(.33,1.53,.69,.99),qa=/*@__PURE__*/ Ga(Ka),Ja=/*@__PURE__*/ Wa(qa),Ya=e=>e>=1?1:(e*=2)<1?.5*qa(e):.5*(2-2**(-10*(e-1))),Xa=e=>1-Math.sin(Math.acos(e)),Za=/* @__PURE__ */ Ga(Xa),Qa=/* @__PURE__ */ Wa(Xa),$a=/*@__PURE__*/ Ua(.42,0,1,1),eo=/*@__PURE__*/ Ua(0,0,.58,1),to=/*@__PURE__*/ Ua(.42,0,.58,1),no=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`,ro=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,io={linear:Pa,easeIn:$a,easeInOut:to,easeOut:eo,circIn:Xa,circInOut:Qa,circOut:Za,backIn:qa,backInOut:Ja,backOut:Ka,anticipate:Ya},ao=e=>typeof e==`string`,oo=e=>{if(/* @__PURE__ */ ro(e)){e.length;let[t,n,r,i]=e;return/* @__PURE__ */ Ua(t,n,r,i)}return ao(e)?(io[e],`${e}`,io[e]):e},so={delta:0,timestamp:0,isProcessing:!1};let co;function lo(){co=void 0}const uo={now:()=>(co===void 0&&uo.set(so.isProcessing||ka.useManualTiming?so.timestamp:performance.now()),co),set:e=>{co=e,queueMicrotask(lo)}},fo=e=>Math.round(e*1e5)/1e5,po=e=>t=>typeof t==`string`&&t.startsWith(e),mo=/*@__PURE__*/ po(`--`),ho=/*@__PURE__*/ po(`var(--`),go=e=>ho(e)?_o.test(e.split(`/*`)[0].trim()):!1,_o=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vo(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const yo={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},bo={...yo,transform:e=>Oa(0,1,e)},xo={...yo,default:1},So=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Co(e){return e==null}const wo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,To=(e,t)=>n=>!!(typeof n==`string`&&wo.test(n)&&n.startsWith(e)||t&&!Co(n)&&Object.prototype.hasOwnProperty.call(n,t)),Eo=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(So);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Do=e=>Oa(0,255,e),Oo={...yo,transform:e=>Math.round(Do(e))},ko={test:/*@__PURE__*/ To(`rgb`,`red`),parse:/*@__PURE__*/ Eo(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Oo.transform(e)+`, `+Oo.transform(t)+`, `+Oo.transform(n)+`, `+fo(bo.transform(r))+`)`};function Ao(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const jo={test:/*@__PURE__*/ To(`#`),parse:Ao,transform:ko.transform},Mo=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),No=/*@__PURE__*/ Mo(`deg`),Po=/*@__PURE__*/ Mo(`%`),q=/*@__PURE__*/ Mo(`px`),Fo=/*@__PURE__*/ Mo(`vh`),Io=/*@__PURE__*/ Mo(`vw`),Lo={...Po,parse:e=>Po.parse(e)/100,transform:e=>Po.transform(e*100)},Ro={test:/*@__PURE__*/ To(`hsl`,`hue`),parse:/*@__PURE__*/ Eo(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Po.transform(fo(t))+`, `+Po.transform(fo(n))+`, `+fo(bo.transform(r))+`)`},zo={test:e=>ko.test(e)||jo.test(e)||Ro.test(e),parse:e=>ko.test(e)?ko.parse(e):Ro.test(e)?Ro.parse(e):jo.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?ko.transform(e):Ro.transform(e),getAnimatableNone:e=>{let t=zo.parse(e);return t.alpha=0,zo.transform(t)}},Bo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Vo=/*@__PURE__*/ new RegExp(So.source),Ho=/*@__PURE__*/ new RegExp(Bo.source,`i`);function Uo(e){return isNaN(e)&&typeof e==`string`&&(Vo.test(e)||Ho.test(e))}const Wo=`number`,Go=`color`,Ko=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function qo(e){let t=e.toString();return Vo.test(t)||Ho.test(t)}function Jo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Ko,e=>(zo.test(e)?(r.color.push(a),i.push(Go),n.push(zo.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Wo),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Yo(e){return Jo(e).values}function Xo({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Wo?fo(r[a]):e===Go?zo.transform(r[a]):r[a]}return i}}function Zo(e){return Xo(Jo(e))}const Qo=e=>typeof e==`number`?0:zo.test(e)?zo.getAnimatableNone(e):e,$o=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Qo(e);function es(e){let t=Jo(e);return Xo(t)(t.values.map((e,n)=>$o(e,t.split[n])))}const ts={test:Uo,parse:Yo,createTransformer:Zo,getAnimatableNone:es};function ns(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function rs({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ns(s,r,e+1/3),a=ns(s,r,e),o=ns(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function is(e,t){return n=>n>0?t:e}const J=(e,t,n)=>e+(t-e)*n,as=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},os=[jo,ko,Ro],ss=e=>os.find(t=>t.test(e));function cs(e){let t=ss(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===Ro&&(n=rs(n)),n}const ls=(e,t)=>{let n=cs(e),r=cs(t);if(!n||!r)return is(e,t);let i={...n};return e=>(i.red=as(n.red,r.red,e),i.green=as(n.green,r.green,e),i.blue=as(n.blue,r.blue,e),i.alpha=J(n.alpha,r.alpha,e),ko.transform(i))},us=/* @__PURE__ */ new Set([`none`,`hidden`]);function ds(e,t){return us.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function fs(e,t){return n=>J(e,t,n)}function ps(e){return typeof e==`number`?fs:typeof e==`string`?go(e)?is:zo.test(e)?ls:_s:Array.isArray(e)?ms:typeof e==`object`?zo.test(e)?ls:hs:is}function ms(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ps(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function hs(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ps(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function gs(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const _s=(e,t)=>{let n=ts.createTransformer(t),r=Jo(e),i=Jo(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?us.has(e)&&!i.values.length||us.has(t)&&!r.values.length?ds(e,t):Fa(ms(gs(r,i),i.values),n):(`${e}${t}`,is(e,t))},vs=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ys(e,t){let n=vs.exec(e);if(!n)return;let r=vs.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>fo(J(a,o,e))+i}function bs(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return J(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=ys(e,t);if(n)return n}return ps(e)(e,t)}const xs=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Ss(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a=/* @__PURE__ */ new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function Cs(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=xs.reduce((e,t)=>(e[t]=Ss(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=ka.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:xs.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<xs.length;t++)o[xs[t]].cancel(e)},state:n,steps:o}}const{schedule:Y,cancel:ws,steps:Ts}=/* @__PURE__ */ Cs(typeof requestAnimationFrame<`u`?requestAnimationFrame:Pa,!0,so),Es=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Y.update(t,e),stop:()=>ws(t),now:()=>so.isProcessing?so.timestamp:uo.now()}},Ds=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Os=2e4;function ks(e,t=50,n=Os,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function As(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(ks(r),Os);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:/* @__PURE__ */ za(i)}}const js={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},Ms=e=>e<0?1/Math.max(1+e,js.minDamping):Math.max(1-e,js.minDamping);function Ns(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Fs(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Ps(e,t){return e*Math.sqrt(1-t*t)}function Fs(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const Is=.001;function Ls({duration:e=js.duration,bounce:t=js.bounce}){let n,r;js.maxDuration;let i=Ms(t);e=Oa(js.minDuration,js.maxDuration,/* @__PURE__ */ za(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Ps(t,i),o=Math.exp(-r);return Is-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Ps(t*t,i);return(-n(t)+Is>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Fs(n,r,a),s=o*Ns(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ Ra(e)}}const Rs=(e,t)=>(t?e>=0:e>0)&&e<1/0;function zs(e,t){if(Rs(e,t))return e}function Bs(e){let t=zs(e.stiffness),n=zs(e.damping,!0),r=zs(e.mass),i={...e,stiffness:t??js.stiffness,damping:n??js.damping,mass:r??js.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=Ms(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Ns(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Ls(i)),i.isResolvedFromDuration=!0;(!Rs(i.stiffness)||!Rs(i.damping,!0))&&(i.stiffness=js.stiffness,i.damping=js.damping)}return i}function Vs(e=js.visualDuration,t=js.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Bs({...n}),f=e=>d?0:-/* @__PURE__ */ za(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ za(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?js.restSpeed.granular:js.restSpeed.default),g.restDelta=n.restDelta||(e?js.restDelta.granular:js.restDelta.default)};_();let v,y,b;if(p<1){let e=Ps(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ Ra(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ Ra(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(ks(S),Os),t=Ds(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Vs.applyToOptions=e=>{let t=As(e,100,Vs);return e.ease=t.ease,e.duration=/* @__PURE__ */ Ra(t.duration),e.type=`keyframes`,e};function Hs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Vs({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Us(e,t,n){let r=[],i=n||ka.mix||bs,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||Pa:t;a=Fa(e,a)}r.push(a)}return r}function Ws(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Us(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ Ia(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Oa(e[0],e[a-1],t)):l}function Gs(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ Ia(0,t,r);e.push(J(n,1,i))}}function Ks(e){let t=[0];return Gs(t,e.length-1),t}function qs(e,t){return e.map(e=>e*t)}function Js(e,t){return e.map(()=>t||to).splice(0,e.length-1)}function Ys({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ no(r)?r.map(oo):oo(r)||to,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(ka.mix||bs)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Oa(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Ws(qs(n&&n.length===t.length?n:Ks(t),e),t,{ease:Array.isArray(i)?i:Js(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}function Xs(e,t,n){let r=Math.max(t-5,0);return/* @__PURE__ */ Ba(n-e(r),t-r)}function Zs(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Xs(t=>e.next(t).value,t,e.next(t).value)}const Qs=e=>e!==null;function $s(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Qs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const ec={decay:Hs,inertia:Hs,tween:Ys,keyframes:Ys,spring:Vs};function tc(e){typeof e.type==`string`&&(e.type=ec[e.type])}function nc(e,t){return{kind:e,animation:t,timestamp:uo.now(),frameTimestamp:so.timestamp,frameIsProcessing:so.isProcessing}}function rc(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...nc(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function ic(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...nc(`layout-animation-start`,e),node:t})}catch{}}var ac=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}};const oc=e=>e/100;var sc=class extends ac{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==uo.now()&&this.tick(uo.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),rc(this,this.options)}initAnimation(){let{options:e}=this;tc(e);let{type:t=Ys,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ys;s!==Ys&&typeof o[0]!=`number`&&(this.mixKeyframes=Fa(oc,bs(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=ks(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Oa(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Hs&&(b.value=$s(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return/* @__PURE__ */ za(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ za(e)}get time(){return/* @__PURE__ */ za(this.currentTime)}set time(e){e=/* @__PURE__ */ Ra(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Zs(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(uo.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ za(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Es,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(uo.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};const cc=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function lc(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(So)||[];if(!r)return e;let i=n.replace(r,``),a=+!!cc.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const uc=/\b([a-z-]*)\(.*?\)/gu,dc={...ts,getAnimatableNone:e=>{let t=e.match(uc);return t?t.map(lc).join(` `):e}},fc={...ts,getAnimatableNone:e=>{let t=ts.parse(e);return ts.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},pc={...yo,transform:Math.round},mc={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,rotate:No,pathRotation:No,rotateX:No,rotateY:No,rotateZ:No,scale:xo,scaleX:xo,scaleY:xo,scaleZ:xo,skew:No,skewX:No,skewY:No,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:bo,originX:Lo,originY:Lo,originZ:q,zIndex:pc,fillOpacity:bo,strokeOpacity:bo,numOctaves:pc},hc={...mc,color:zo,backgroundColor:zo,outlineColor:zo,fill:zo,stroke:zo,borderColor:zo,borderTopColor:zo,borderRightColor:zo,borderBottomColor:zo,borderLeftColor:zo,filter:dc,WebkitFilter:dc,mask:fc,WebkitMask:fc},gc=e=>hc[e],_c=/*@__PURE__*/ new Set([dc,fc]);function vc(e,t){let n=gc(e);return _c.has(n)||(n=ts),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function yc(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const bc=e=>e*180/Math.PI,xc=e=>{let t=bc(Math.atan2(e[1],e[0]));return Cc(t)},Sc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:xc,rotateZ:xc,skewX:e=>bc(Math.atan(e[1])),skewY:e=>bc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cc=e=>(e%=360,e<0&&(e+=360),e),wc=xc,Tc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ec=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Dc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Tc,scaleY:Ec,scale:e=>(Tc(e)+Ec(e))/2,rotateX:e=>Cc(bc(Math.atan2(e[6],e[5]))),rotateY:e=>Cc(bc(Math.atan2(-e[2],e[0]))),rotateZ:wc,rotate:wc,skewX:e=>bc(Math.atan(e[4])),skewY:e=>bc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Oc(e){return+!!e.includes(`scale`)}function kc(e,t){if(!e||e===`none`)return Oc(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Dc,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Sc,i=t}if(!i)return Oc(t);let a=r[t],o=i[1].split(`,`).map(jc);return typeof a==`function`?a(o):o[a]}const Ac=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return kc(n,t)};function jc(e){return parseFloat(e.trim())}const Mc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Nc=/* @__PURE__ */ new Set([...Mc,`pathRotation`]),Pc=e=>e===yo||e===q,Fc=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Ic=Mc.filter(e=>!Fc.has(e));function Lc(e){let t=[];return Ic.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}const Rc=/* @__PURE__ */ new Set([`bottom`,`right`]);function zc(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}const Bc={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>zc(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>zc(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>kc(e,`x`),y:({transform:e})=>kc(e,`y`)};Bc.translateX=Bc.x,Bc.translateY=Bc.y;const Vc=/* @__PURE__ */ new Set;let Hc=!1,Uc=!1,Wc=!1;function Gc(){if(Uc){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Vc.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Rc.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=Lc(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Uc=!1,Hc=!1,Vc.forEach(e=>e.complete(Wc)),Vc.clear()}function Kc(){Vc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Uc=!0)})}function qc(){Wc=!0,Kc(),Gc(),Wc=!1}function Jc(e,t,n){if(typeof e==`string`){if(Aa(e)||Ma(e))return parseFloat(e);if(!ts.test(e)&&ts.test(n))return vc(t,n)}return e??void 0}var Yc=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Vc.add(this),Hc||(Hc=!0,Y.read(Kc),Y.resolveKeyframes(Gc))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Jc(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}yc(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vc.delete(this)}cancel(){this.state===`scheduled`&&(Vc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Xc=e=>e.startsWith(`--`);function Zc(e,t,n){Xc(t)?e.style.setProperty(t,n):e.style[t]=n}const Qc={};function $c(e,t){let n=/* @__PURE__ */ Na(e);return()=>Qc[t]??n()}const el=/* @__PURE__ */ $c(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),tl=/*@__PURE__*/ $c(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),nl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,rl={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ nl([0,.65,.55,1]),circOut:/*@__PURE__*/ nl([.55,0,1,.45]),backIn:/*@__PURE__*/ nl([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ nl([.33,1.53,.69,.99])};function il(e,t){if(e)return typeof e==`function`?tl()?Ds(e,t):`ease-out`:/* @__PURE__ */ ro(e)?nl(e):Array.isArray(e)?e.map(e=>il(e,t)||rl.easeOut):rl[e]}function al(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=il(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function ol(e){return typeof e==`function`&&`applyToOptions`in e}function sl({type:e,...t}){return ol(e)&&tl()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var cl=class extends ac{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=sl(e);this.animation=al(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=$s(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Zc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},rc(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ za(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ za(e)}get time(){return/* @__PURE__ */ za(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ Ra(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n,...r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&el()?(this.animation.timeline=e,Object.assign(this.animation,r),t?.(this.animation),Pa):n(this)}};const ll={anticipate:Ya,backInOut:Ja,circInOut:Qa};function ul(e){return e in ll}function dl(e){typeof e.ease==`string`&&ul(e.ease)&&(e.ease=ll[e.ease])}var fl=class extends cl{constructor(e){dl(e),tc(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new sc({...a,autoplay:!1}),s=Math.max(10,uo.now()-this.startTime),c=Oa(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&Zc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const pl=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(ts.test(e)||e===`0`)&&!e.startsWith(`url(`));function ml(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function hl(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=pl(i,t),s=pl(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):ml(e)||(n===`spring`||ol(n))&&r}function gl(e){e.duration=0,e.type=`keyframes`}const _l=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),vl=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yl(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&vl.test(e[t]))return!0;return!1}const bl=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),xl=/*@__PURE__*/ Na(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Sl(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(_l.has(n)||bl.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return xl()&&(_l.has(n)||bl.has(n)&&yl(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Cl=class extends ac{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=uo.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Yc;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=uo.now();let u=!0;hl(e,i,a,o)||(u=!1,(ka.instantAnimations||!s)&&l?.($s(e,n,t)),e[0]=e[e.length-1],gl(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&Sl(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new fl(n)}catch{m=new sc(n)}}else m=new sc(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),qc()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function wl(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const Tl=e=>!isNaN(parseFloat(e)),El={current:void 0};var Dl=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=uo.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=uo.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Tl(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new La)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new La,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Y.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=/* @__PURE__ */ new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return El.current&&El.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=uo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return/* @__PURE__ */ Ba(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ol(e,t){return new Dl(e,t)}function kl(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Al(e,t){let n=e?.[t]??e?.default??e;return n===e?n:kl(n,e)}const jl={type:`spring`,stiffness:500,damping:25,restSpeed:10},Ml=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nl={type:`keyframes`,duration:.8},Pl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Fl=(e,{keyframes:t})=>t.length>2?Nl:Nc.has(e)?e.startsWith(`scale`)?Ml(t[1]):jl:Pl,Il=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Ll(e){for(let t in e)if(!Il.has(t))return!0;return!1}const Rl=(e,t,n,r={},i,a)=>o=>{let s=Al(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ Ra(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Ll(s)||Object.assign(u,Fl(e,u)),u.duration&&=/* @__PURE__ */ Ra(u.duration),u.repeatDelay&&=/* @__PURE__ */ Ra(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gl(u),u.delay===0&&(d=!0)),(ka.instantAnimations||ka.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,gl(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=$s(u.keyframes,s);if(e!==void 0){Y.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new sc(u):new Cl(u)},zl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bl(e){let t=zl.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Vl(e,t,n=1){`${e}`;let[r,i]=Bl(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Aa(e)?parseFloat(e):e}return go(i)?Vl(i,t,n+1):i}function Hl(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ul(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Hl(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Wl(e,t,n){return Ul(e.getProps(),t,n,e)}const Gl=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Kl=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Mc]),ql=e=>Array.isArray(e);function Jl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ol(n))}function Yl(e){return ql(e)?e[e.length-1]||0:e}function Xl(e,t){let{transitionEnd:n={},transition:r={},...i}=Wl(e,t)||{};i={...i,...n};for(let t in i)Jl(e,t,Yl(i[t]))}const Zl=e=>!!(e&&e.getVelocity);function Ql(e){return!!(Zl(e)&&e.add)}function $l(e,t){let n=e.getValue(`willChange`);if(Ql(n))return n.add(t);if(!n&&ka.WillChange){let n=new ka.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function eu(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const tu=`data-`+eu(`framerAppearId`);function nu(e){return e.props[tu]}const ru=typeof window<`u`;function iu({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function au(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?kl(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&iu(f,t))continue;let o={delay:n,...Al(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Y.update(()=>r.set(i));continue}let p=!1;if(ru&&window.MotionHandoffAnimation){let n=nu(e);if(n){let e=window.MotionHandoffAnimation(n,t,Y);e!==null&&(o.startTime=e,p=!0)}}$l(e,t);let m=l??e.shouldReduceMotion;r.start(Rl(t,r,i,m&&Kl.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Y.update(()=>{o&&Xl(e,o)});d.length?Promise.all(d).then(t):t()}return d}function ou(e,t,n={}){let r=Wl(e,t,Gl(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?au(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(ou(e,t,{...n,delay:r+(typeof o==`function`?0:o)+wl(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function su(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>ou(e,t,n))):typeof t==`string`?ou(e,t,n):Promise.all(au(e,Wl(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}const cu={test:e=>e===`auto`,parse:e=>e},lu=e=>t=>t.test(e),uu=[yo,q,Po,No,Io,Fo,cu],du=e=>uu.find(lu(e));function fu(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Ma(e)}const pu=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function mu(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!pu.has(t)&&qo(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=vc(n,i))}var hu=class extends Yc{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),go(r))){let i=Vl(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Kl.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=du(r),o=du(i);if(vo(r)!==vo(i)&&Bc[n]){this.needsMeasurement=!0;return}if(a!==o){if(Pc(a)&&Pc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Bc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||fu(e[t]))&&n.push(t);n.length&&mu(e,n,t)}measure(){let{element:e,name:t}=this;return Bc[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const gu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function _u(e){return ja(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function vu(e){return ja(e)&&`ownerSVGElement`in e}const yu=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function bu(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}const xu={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Su=Mc.length;function Cu(e,t,n){let r=``,i=!0;for(let a=0;a<Su;a++){let o=Mc[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=yu(s,mc[o]);if(!c){i=!1;let t=xu[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${yu(a,mc.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function wu(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Nc.has(e)){o=!0;continue}if(mo(e)){i[e]=n;continue}{let t=yu(n,mc[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Cu(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const Tu={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Eu={offset:`strokeDashoffset`,array:`strokeDasharray`};function Du(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Tu:Eu;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Ou=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ku(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(wu(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Ou)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Du(d,i,a,o,!1)}function Au({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ju({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Mu(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Nu(e){return e===void 0||e===1}function Pu({scale:e,scaleX:t,scaleY:n}){return!Nu(e)||!Nu(t)||!Nu(n)}function Fu(e){return Pu(e)||Iu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Iu(e){return Lu(e.x)||Lu(e.y)}function Lu(e){return e&&e!==`0%`}function Ru(e,t,n){return n+t*(e-n)}function zu(e,t,n,r,i){return i!==void 0&&(e=Ru(e,i,r)),Ru(e,n,r)+t}function Bu(e,t=0,n=1,r,i){e.min=zu(e.min,t,n,r,i),e.max=zu(e.max,t,n,r,i)}function Vu(e,{x:t,y:n}){Bu(e.x,t.translate,t.scale,t.originPoint),Bu(e.y,n.translate,n.scale,n.originPoint)}const Hu=.999999999999,Uu=1.0000000000001;function Wu(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Gu(e.x,-a.scroll.offset.x),Gu(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Vu(e,o)),r&&Fu(a.latestValues)&&Ju(e,a.latestValues,a.layout?.layoutBox))}t.x<Uu&&t.x>Hu&&(t.x=1),t.y<Uu&&t.y>Hu&&(t.y=1)}function Gu(e,t){e.min+=t,e.max+=t}function Ku(e,t,n,r,i=.5){Bu(e,t,n,J(e.min,e.max,i),r)}function qu(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Ju(e,t,n){let r=n??e;Ku(e.x,qu(t.x,r.x),t.scaleX,t.scale,t.originX),Ku(e.y,qu(t.y,r.y),t.scaleY,t.scale,t.originY)}function Yu(e,t){return Au(Mu(e.getBoundingClientRect(),t))}function Xu(e,t,n){let r=Yu(e,n),{scroll:i}=t;return i&&(Gu(r.x,i.offset.x),Gu(r.y,i.offset.y)),r}const{schedule:Zu,cancel:Qu}=/* @__PURE__ */ Cs(queueMicrotask,!1),$u={x:!1,y:!1};function ed(){return $u.x||$u.y}function td(e){return e===`x`||e===`y`?$u[e]?null:($u[e]=!0,()=>{$u[e]=!1}):$u.x||$u.y?null:($u.x=$u.y=!0,()=>{$u.x=$u.y=!1})}function nd(e,t){let n=bu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function rd(e){return!(e.pointerType===`touch`||ed())}function id(e,t,n={}){let[r,i,a]=nd(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!rd(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const ad=(e,t)=>t?e===t||ad(e,t.parentElement):!1,od=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,sd=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function cd(e){return sd.has(e.tagName)||e.isContentEditable===!0}const ld=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function ud(e){return ld.has(e.tagName)||e.isContentEditable===!0}const dd=/* @__PURE__ */ new WeakSet;function fd(e){return t=>{t.key===`Enter`&&e(t)}}function pd(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const md=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=fd(()=>{if(dd.has(n))return;pd(n,`down`);let e=fd(()=>{pd(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>pd(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function hd(e){return od(e)&&!ed()}const gd=/* @__PURE__ */ new WeakSet;function _d(e,t,n={}){let[r,i,a]=nd(e,n),o=e=>{let r=e.currentTarget;if(!hd(e)||gd.has(e))return;dd.add(r),n.stopPropagation&&gd.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),dd.has(r)&&dd.delete(r),hd(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||ad(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),_u(e)&&(e.addEventListener(`focus`,e=>md(e,i)),!cd(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}const vd=/* @__PURE__ */ new WeakMap;let yd;const bd=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:vu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],xd=/*@__PURE__*/ bd(`inline`,`width`,`offsetWidth`),Sd=/*@__PURE__*/ bd(`block`,`height`,`offsetHeight`);function Cd({target:e,borderBoxSize:t}){vd.get(e)?.forEach(n=>{n(e,{get width(){return xd(e,t)},get height(){return Sd(e,t)}})})}function wd(e){e.forEach(Cd)}function Td(){typeof ResizeObserver<`u`&&(yd=new ResizeObserver(wd))}function Ed(e,t){yd||Td();let n=bu(e);return n.forEach(e=>{let n=vd.get(e);n||(n=/* @__PURE__ */ new Set,vd.set(e,n)),n.add(t),yd?.observe(e)}),()=>{n.forEach(e=>{let n=vd.get(e);n?.delete(t),n?.size||yd?.unobserve(e)})}}const Dd=/* @__PURE__ */ new Set;let Od;function kd(){Od=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Dd.forEach(t=>t(e))},window.addEventListener(`resize`,Od)}function Ad(e){return Dd.add(e),Od||kd(),()=>{Dd.delete(e),!Dd.size&&typeof Od==`function`&&(window.removeEventListener(`resize`,Od),Od=void 0)}}function jd(e,t){return typeof e==`function`?Ad(e):Ed(e,t)}const Md={value:null,addProjectionMetrics:null};function Nd(e){return vu(e)&&e.tagName===`svg`}const Pd=e=>typeof e==`number`?e:parseFloat(e),Fd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Id=()=>({x:Fd(),y:Fd()}),Ld=()=>({min:0,max:0}),Rd=()=>({x:Ld(),y:Ld()}),zd=/* @__PURE__ */ new WeakMap;function Bd(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Vd(e){return typeof e==`string`||Array.isArray(e)}const Hd=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ud=[`initial`,...Hd];function Wd(e){if(Bd(e.animate))return!0;for(let t=0;t<Ud.length;t++)if(Vd(e[Ud[t]]))return!0;return!1}function Gd(e){return!!(Wd(e)||e.variants)}function Kd(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Zl(i))e.addValue(r,i);else if(Zl(a))e.addValue(r,Ol(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Ol(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const qd={current:null},Jd={current:!1},Yd=typeof window<`u`;function Xd(){if(Jd.current=!0,Yd){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>qd.current=e.matches;e.addEventListener(`change`,t),t()}else qd.current=!1}}const Zd=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Qd={};function $d(e){Qd=e}function ef(){return Qd}var tf=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Yc,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=uo.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Y.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Wd(t),this.isVariantNode=Gd(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&Zl(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,zd.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Jd.current||Xd(),this.shouldReduceMotion=qd.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ws(this.notifyUpdate),ws(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=/* @__PURE__ */ new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&_l.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new cl({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ Ra(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Nc.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Y.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Qd){let t=Qd[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Rd()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Zd.length;t++){let n=Zd[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Kd(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Ol(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Aa(n)||Ma(n))?n=parseFloat(n):typeof n!=`number`&&!ts.test(n)&&ts.test(t)&&(n=vc(e,t)),this.setBaseTarget(e,Zl(n)?n.get():n)),Zl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new La),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Zu.render(this.render)}},nf=class extends tf{constructor(){super(...arguments),this.KeyframeResolver=hu}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;Zl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},rf=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function af(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}const of={};function sf(e,{layout:t,layoutId:n}){return Nc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!of[e]||e===`opacity`)}function cf(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Zl(r[t])||i&&Zl(i[t])||sf(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function lf(e){return window.getComputedStyle(e)}var uf=class extends nf{constructor(){super(...arguments),this.type=`html`,this.renderInstance=af}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Nc.has(t))return this.projection?.isProjecting?Oc(t):Ac(e,t);{let n=lf(e),r=(mo(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Yu(e,t)}build(e,t,n){wu(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return cf(e,t,n)}};const df=/* @__PURE__ */ new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ff=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function pf(e,t,n,r){af(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(df.has(n)?n:eu(n),t.attrs[n])}function mf(e,t,n){let r=cf(e,t,n);for(let n in e)if(Zl(e[n])||Zl(t[n])){let t=Mc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var hf=class extends nf{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Rd}getBaseTargetFromProps(e,t){return Nc.has(t)?super.getBaseTargetFromProps(e,t)??Oc(t):e[t]}getDefaultValue(e){return Nc.has(e)?this.latestValues[e]??Oc(e):void 0}readValueFromInstance(e,t){if(Nc.has(t)){let e=gc(t);return e&&e.default||0}if(Ou.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=df.has(t)?t:eu(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return mf(e,t,n)}build(e,t,n){ku(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){pf(e,t,n,r)}mount(e){this.isSVGTag=ff(e.tagName),super.mount(e)}};function gf(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const _f=[...Hd].reverse();function vf(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>su(e,t,n))),n=bf(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=/* @__PURE__ */ new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(_f.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?Vd(g)||g===!1?g:void 0:h,v=Vd(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||Bd(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=yf(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=Wl(e,n,Gl(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!gf(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=Wl(s,n)?.transition?.delayChildren;r.delay=wl(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&Wl(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!Zl(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=bf(),i=!0}}}function yf(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!gf(t,e):!1}function bf(){let e={};for(let t of Hd)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function xf(e,t){e.min=t.min,e.max=t.max}function Sf(e,t){xf(e.x,t.x),xf(e.y,t.y)}function Cf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function wf(e){return e.max-e.min}function Tf(e,t,n){return Math.abs(e-t)<=n}function Ef(e,t,n,r=.5){e.origin=r,e.originPoint=J(t.min,t.max,e.origin),e.scale=wf(n)/wf(t),e.translate=J(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Df(e,t,n,r){Ef(e.x,t.x,n.x,r?r.originX:void 0),Ef(e.y,t.y,n.y,r?r.originY:void 0)}function Of(e,t,n,r=0){e.min=(r?J(n.min,n.max,r):n.min)+t.min,e.max=e.min+wf(t)}function kf(e,t,n,r){Of(e.x,t.x,n.x,r?.x),Of(e.y,t.y,n.y,r?.y)}function Af(e,t,n,r=0){let i=r?J(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+wf(t)}function jf(e,t,n,r){Af(e.x,t.x,n.x,r?.x),Af(e.y,t.y,n.y,r?.y)}function Mf(e,t,n,r,i){return e-=t,e=Ru(e,1/n,r),i!==void 0&&(e=Ru(e,1/i,r)),e}function Nf(e,t=0,n=1,r=.5,i,a=e,o=e){if(Po.test(t)&&(t=parseFloat(t),t=J(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=J(a.min,a.max,r);e===a&&(s-=t),e.min=Mf(e.min,t,n,s,i),e.max=Mf(e.max,t,n,s,i)}function Pf(e,t,[n,r,i],a,o){Nf(e,t[n],t[r],t[i],t.scale,a,o)}const Ff=[`x`,`scaleX`,`originX`],If=[`y`,`scaleY`,`originY`];function Lf(e,t,n,r){Pf(e.x,t,Ff,n?n.x:void 0,r?r.x:void 0),Pf(e.y,t,If,n?n.y:void 0,r?r.y:void 0)}function Rf(e){return e.translate===0&&e.scale===1}function zf(e){return Rf(e.x)&&Rf(e.y)}function Bf(e,t){return e.min===t.min&&e.max===t.max}function Vf(e,t){return Bf(e.x,t.x)&&Bf(e.y,t.y)}function Hf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Uf(e,t){return Hf(e.x,t.x)&&Hf(e.y,t.y)}function Wf(e){return wf(e.x)/wf(e.y)}function Gf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Kf(e){return[e(`x`),e(`y`)]}function qf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Jf={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(q.test(e))e=parseFloat(e);else return e}return`${qf(e,t.target.x)}% ${qf(e,t.target.y)}%`}},Yf={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=ts.parse(e);if(i.length>5)return r;let a=ts.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=J(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function Xf(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const Zf=gu.length,Qf=e=>typeof e==`number`||q.test(e);function $f(e,t,n,r,i,a){i?(e.opacity=J(0,n.opacity??1,tp(r)),e.opacityExit=J(t.opacity??1,0,np(r))):a&&(e.opacity=J(t.opacity??1,n.opacity??1,r));for(let i=0;i<Zf;i++){let a=gu[i],o=ep(t,a),s=ep(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Qf(o)===Qf(s)?(e[a]=Math.max(J(Pd(o),Pd(s),r),0),(Po.test(s)||Po.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=J(t.rotate||0,n.rotate||0,r))}function ep(e,t){return e[t]===void 0?e.borderRadius:e[t]}const tp=/*@__PURE__*/ rp(0,.5,Za),np=/*@__PURE__*/ rp(.5,.95,Pa);function rp(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ Ia(e,t,r))}function ip(e,t,n){let r=Zl(e)?e:Ol(e);return r.start(Rl(``,r,t,n)),r.animation}function ap(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const op=(e,t)=>e.depth-t.depth;var sp=class{constructor(){this.children=[],this.isDirty=!1}add(e){Ea(this.children,e),this.isDirty=!0}remove(e){Da(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(op),this.isDirty=!1,this.children.forEach(e)}};function cp(e,t){let n=uo.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(ws(r),e(a-t))};return Y.setup(r,!0),()=>ws(r)}function lp(e){return Zl(e)?e.get():e}var up=class{constructor(){this.members=[]}add(e){Ea(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Da(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Da(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const dp={borderRadius:{...Jf,applyTo:[...gu]},borderTopLeftRadius:Jf,borderTopRightRadius:Jf,borderBottomLeftRadius:Jf,borderBottomRightRadius:Jf,boxShadow:Yf},fp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(of,{...dp,...of});const pp={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},mp=[``,`X`,`Y`,`Z`];let hp=0;function gp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function _p(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=nu(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Y,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&_p(r)}function vp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=hp++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=/* @__PURE__ */ new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Md.value&&(pp.nodes=pp.calculatedTargetDeltas=pp.calculatedProjections=0),this.nodes.forEach(xp),this.nodes.forEach(jp),this.nodes.forEach(Mp),this.nodes.forEach(Sp),Md.addProjectionMetrics&&Md.addProjectionMetrics(pp)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new sp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new La),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=vu(t)&&!Nd(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Y.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=cp(i,250),fp.hasAnimatedSinceResize&&(fp.hasAnimatedSinceResize=!1,this.nodes.forEach(Ap)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||zp,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Uf(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Al(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Ap(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ws(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Np),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&_p(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Tp),this.nodes.forEach(wp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ep);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Dp),this.nodes.forEach(Op),this.nodes.forEach(kp),this.nodes.forEach(yp),this.nodes.forEach(bp)):this.nodes.forEach(Ep),this.clearAllSnapshots();let e=uo.now();so.delta=Oa(0,1e3/60,e-so.timestamp),so.timestamp=e,so.isProcessing=!0,Ts.update.process(so),Ts.preRender.process(so),Ts.render.process(so),so.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cp),this.sharedNodes.forEach(Pp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Y.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Y.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!wf(this.snapshot.measuredBox.x)&&!wf(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Rd(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!zf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Fu(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Up(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Rd();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Gp))){let{scroll:e}=this.root;e&&(Gu(t.x,e.offset.x),Gu(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Rd();if(Sf(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Sf(t,e),Gu(t.x,i.offset.x),Gu(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Rd();Sf(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Gu(r.x,-n.scroll.offset.x),Gu(r.y,-n.scroll.offset.y)),Fu(n.latestValues)&&Ju(r,n.latestValues,n.layout?.layoutBox)}return Fu(this.latestValues)&&Ju(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Rd();Sf(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Fu(n.latestValues))continue;let r;n.instance&&(Pu(n.latestValues)&&n.updateSnapshot(),r=Rd(),Sf(r,n.measurePageBox())),Lf(t,n.latestValues,n.snapshot?.layoutBox,r)}return Fu(this.latestValues)&&Lf(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==so.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=so.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Rd(),this.targetWithTransforms=Rd()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),kf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Sf(this.target,this.layout.layoutBox),Vu(this.target,this.targetDelta)):Sf(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Md.value&&pp.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Pu(this.parent.latestValues)||Iu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Rd(),this.relativeTargetOrigin=Rd(),jf(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Sf(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===so.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Sf(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Wu(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Rd());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cf(this.prevProjectionDelta.x,this.projectionDelta.x),Cf(this.prevProjectionDelta.y,this.projectionDelta.y)),Df(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Gf(this.projectionDelta.x,this.prevProjectionDelta.x)||!Gf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Md.value&&pp.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Id(),this.projectionDelta=Id(),this.projectionDeltaWithTransform=Id()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Id();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Rd(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Rp));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=J(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=J(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Fp(o.x,e.x,n),Fp(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jf(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Lp(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Vf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Rd(),Sf(f,this.relativeTarget)),c&&(this.animationValues=a,$f(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(ws(this.pendingAnimation),void 0),this.pendingAnimation=Y.update(()=>{fp.hasAnimatedSinceResize=!0,this.motionValue||=Ol(0),this.motionValue.jump(0,!1),this.currentAnimation=ip(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),ic(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Wp(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Rd();let t=wf(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=wf(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Sf(t,i),Ju(t,r),Df(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new up),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&gp(`z`,e,r,this.animationValues);for(let t=0;t<mp.length;t++)gp(`rotate${mp[t]}`,e,r,this.animationValues),gp(`skew${mp[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=lp(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=lp(t?.pointerEvents)||``),this.hasProjected&&!Fu(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Xf(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in of){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=of[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?lp(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(wp),this.root.sharedNodes.clear()}}}function yp(e){e.updateLayout()}function bp(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Kf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=wf(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;xf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Wp(i,t.layoutBox,n)&&Kf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=wf(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Id();Df(o,n,t.layoutBox);let s=Id();a?Df(s,e.applyTransform(r,!0),t.measuredBox):Df(s,n,t.layoutBox);let c=!zf(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Rd();jf(s,t.layoutBox,i.layoutBox,o);let c=Rd();jf(c,n,a.layoutBox,o),Uf(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function xp(e){Md.value&&pp.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Sp(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Cp(e){e.clearSnapshot()}function wp(e){e.clearMeasurements()}function Tp(e){e.isLayoutDirty=!0,e.updateLayout()}function Ep(e){e.isLayoutDirty=!1}function Dp(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Op(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function kp(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ap(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function jp(e){e.resolveTargetDelta()}function Mp(e){e.calcProjection()}function Np(e){e.resetSkewAndRotation()}function Pp(e){e.removeLeadSnapshot()}function Fp(e,t,n){e.translate=J(t.translate,0,n),e.scale=J(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ip(e,t,n,r){e.min=J(t.min,n.min,r),e.max=J(t.max,n.max,r)}function Lp(e,t,n,r){Ip(e.x,t.x,n.x,r),Ip(e.y,t.y,n.y,r)}function Rp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const zp={duration:.45,ease:[.4,0,.1,1]},Bp=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vp=Bp(`applewebkit/`)&&!Bp(`chrome/`)?Math.round:Pa;function Hp(e){e.min=Vp(e.min),e.max=Vp(e.max)}function Up(e){Hp(e.x),Hp(e.y)}function Wp(e,t,n){return e===`position`||e===`preserve-aspect`&&!Tf(Wf(t),Wf(n),.2)}function Gp(e){return e!==e.root&&e.scroll?.wasRoot}const Kp=vp({attachResizeListener:(e,t)=>ap(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qp={current:void 0},Jp=vp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qp.current){let e=new Kp({});e.mount(window),e.setOptions({layoutScroll:!0}),qp.current=e}return qp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Yp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Xp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Zp(...e){return t=>{let n=!1,r=e.map(e=>{let r=Xp(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Xp(e[t],null)}}}}function Qp(...e){return a.useCallback(Zp(...e),e)}var $p=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(_u(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=_u(e)&&e.offsetWidth||0,r=_u(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function em({children:e,isPresent:n,anchorX:r,anchorY:i,root:o,pop:s}){let c=v(),l=C(null),u=C({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=g(Yp),f=Qp(l,s===!1?void 0:e.props?.ref??e?.ref);return b(()=>{let{width:e,height:t,top:a,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=r===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=i===`bottom`?`bottom: ${m}`:`top: ${a}`;l.current.dataset.motionPopId=c;let y=document.createElement(`style`);d&&(y.nonce=d);let b=o??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
230
|
+
;Ct.node;const wt=L(Ct);function Tt(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;case`ne`:return`sw`;case`nw`:return`se`;case`se`:return`nw`;case`sw`:return`ne`;default:return e}}function Et(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var Dt=class{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case`top`:this.top=t.top-n.height-this.gap,this.alignAxis=`x`;break;case`bottom`:this.top=t.bottom+this.gap,this.alignAxis=`x`;break;case`left`:this.left=t.left-n.width-this.gap,this.alignAxis=`y`;break;case`right`:this.left=t.right+this.gap,this.alignAxis=`y`;break;case`ne`:this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case`nw`:this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case`se`:this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case`sw`:this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case`start`:this.alignAxis===`x`?this.left=t.left:this.top=t.top;break;case`end`:this.alignAxis===`x`?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case`center`:this.alignAxis===`x`?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case`fill`:this.alignAxis===`x`?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw Error(`Invalid position. Cannot compute x,y coordinates`);let r=this.width!=null,i=this.height!=null,a=this.width??t.width,o=this.height??t.height;return{rect:new DOMRect(this.left??0,this.top??0,a,o),constrainWidth:r,constrainHeight:i,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){let t=Et(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Tt(e.position);if(t!==e.position)return{...e,position:t}}return null}};function Ot(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function kt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function At(e,t,n,r){let i=new Dt(e.gap),a=i.computePosition(e,t,n),o=kt(a.rect,r,`x`),s=kt(a.rect,r,`y`);if(o&&s)return a;let c=null;return o||(c=i.flipAxis(e,`x`)),s||(c=i.flipAxis(c||e,`y`)),c?(a=new Dt(i.gap).computePosition(c,t,n),Ot(a.rect,r)?a:null):null}function jt(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return i<=n||a<=r?null:new DOMRect(n,r,i-n,a-r)}function Mt(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=jt(e[n].getBoundingClientRect(),t),!t)return null;return t}function Nt(e){let t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){let r=getComputedStyle(e);if(t&&r.overflowY!==`visible`||n&&r.overflowX!==`visible`)return!0}return!1}function Pt(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)Nt(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var Ft=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=Pt(this.anchor,this.root),this.visibleClientRect=Mt(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){let t=this.scrollableParents,n=()=>{this.update()};window.addEventListener(`resize`,n);for(let e of t)e.addEventListener(`scroll`,n);let r;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(()=>{r&&document.addEventListener(`click`,r)},0));let i;this.options.closeOnEsc&&(i=e=>{e.key===`Escape`&&this.tryClose()},window.setTimeout(()=>{i&&document.addEventListener(`keydown`,i)},0));let a=this.options.blockPageScroll;return a&&(document.body.style.overflow=`hidden`,document.body.style.height=`100%`),()=>{window.removeEventListener(`resize`,n);for(let e of t)e.removeEventListener(`scroll`,n);r&&document.removeEventListener(`click`,r),i&&document.removeEventListener(`keydown`,i),a&&(document.body.style.overflow=``,document.body.style.height=``)}}open(e,t){if(this.context)throw Error(`The popup controller is already bound to an element`);this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display=``,e.style.visibility=`hidden`,this.update(),this.options.onOpen?.(this))}close(){if(!this.context)throw Error(`The popup controller is not bound to an element`);this.tryClose()}tryClose(){this.context&&=(this.options.onClose?.(this),this.context.cleanup(),this.context.element.style.display=`none`,void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;let e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),i=this.visibleClientRect;if(!i)return;let a=At(t,n,r,i);this.context.position=a||void 0,a&&(a.constrainHeight&&(e.style.height=`${a.rect.height}px`),a.constrainWidth&&(e.style.width=`${a.rect.width}px`),e.style.left=`${a.rect.left}px`,e.style.top=`${a.rect.top}px`,e.style.visibility=`visible`)}createPopupElement(){let e=document.createElement(`div`);return e.style.margin=`0`,e.style.padding=`0`,e.style.border=`none`,e.style.background=`transparent`,e.className=`composable-Popup`,e}};const It=d(void 0);function Lt(){let e=g(It);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function Rt({ctrlRef:e,id:n,constraints:r,isOpen:i,children:a,className:o,onClose:s,onOpen:c,zIndex:l,position:u,anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h}){let g=C(null),[v,y]=w(),b=C(s),x=C(c);return b.current=s,x.current=c,_(()=>{if(!d)throw Error(`Anchor element is required`);let e=new Ft({anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h,onClose:()=>b.current?.(),onOpen:()=>x.current?.()});return y(e),()=>{e.tryClose()}},[d,h,p,m,f]),_(()=>{e&&(e.current=v)},[v,e]),_(()=>{v&&g.current?v.isOpen!==i&&(i?v.open(g.current,r):v.close()):v?.isOpen&&!i&&v.close()},[r,i,v]),t(It.Provider,{value:v,children:i&&E(t(`div`,{id:n,style:{visibility:`hidden`,position:u||`absolute`,zIndex:l||100},ref:g,className:o,children:a}),document.body)})}function zt({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(Rt,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function Bt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var Vt=class{filter(e,t){let n=t.toLowerCase();return e.filter(e=>this.valueOf(e).toLowerCase().includes(n))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}createItem(e){return null}},Ht=class e extends Vt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},Ut=class e extends Ht{createItem(e){return e}static instance=new e};function Wt(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:`w-72 mt-1 border-popover bg-popover text-popover-foreground shadow-md overflow-auto p-0 z-10`,inputClass:r(t?`block m-0 p-0 border-0 focus:outline-none focus:ring-0`:`block sm:text-sm sm:leading-6 bg-muted rounded-md border-0 shadow-sm ring-1 ring-inset ring-muted placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-primary py-1.5`,e?`w-full`:`!w-auto`),optionClass:`py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-info`,Input:Kt,Menu:Jt,Toggle:qt}}function Gt({menuAlign:r=`fill`,menuGap:i,focusOnMount:a,onSelect:s,value:c,zIndex:l,unstyledInput:u,fullWidth:d,api:f,layout:p,adapter:m,items:h,placeholder:g,clearable:v,noMatchMessage:y,openOnFocus:b}){let[x]=w(Bt()),S=C(void 0),T=C(null),E=p?Object.assign(Wt(d,u),p):Wt(d,u),D=o.useRef(null),O=Yt({adapter:m,items:h,value:c,popupId:x});_(()=>{T.current&&a&&T.current.focus()},[a]),_(()=>{O.onSelect=s,O.popupCtrl=S.current},[O,s]),_(()=>{if(f&&O&&T.current)return f.current={open:()=>O.openMenu(),close:()=>O.closeMenu(),toggle:()=>O.toggleMenu(),setInputValue:e=>O.inputText=e,inputValue:O.inputText||``,selectedItem:O.selectedItem,focus:()=>T.current?.focus()},()=>{f.current=null}},[f,O]);let k=O.isMenuOpen&&(O.filteredItems.length>0||!!y);return n(e,{children:[t(E.Input,{boxRef:D,inputRef:T,ctrl:O,layout:E,placeholder:g,clearable:v,openOnFocus:b}),t(zt,{id:x,ctrlRef:S,className:`combobox-popup`,closeOnClick:!0,closeOnEsc:!0,onClose:()=>O.closeMenu(),isOpen:k,anchor:D,zIndex:l,constraints:{position:`bottom`,align:r,gap:i??4},children:t(E.Menu,{fillWidth:r===`fill`,items:O.filteredItems,ctrl:O,layout:E,adapter:m,noMatchMessage:y})})]})}function Kt({inputRef:e,placeholder:r,boxRef:i,ctrl:a,layout:o,clearable:s,openOnFocus:c}){let l=o.Toggle,u=s&&a.selectedItem!=null,d=+!!l+ +!!u,f=d>0?{paddingRight:`${o.buttonWidth*d+o.buttonRight}px`}:void 0;return n(`div`,{className:`relative`,ref:i,children:[t(`input`,{ref:e,placeholder:r,...a.getInputProps(),onFocus:c?()=>a.openMenu():void 0,style:f,className:o.inputClass}),n(`div`,{style:{position:`absolute`,right:`${o.buttonRight}px`,top:0,bottom:0,display:`flex`,alignItems:`center`,gap:`2px`},children:[u&&t(`button`,{type:`button`,style:{border:`none`,padding:0,margin:0,backgroundColor:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,width:`${o.buttonWidth}px`},onClick:()=>{a.selectedItem=null},children:t(wt,{className:`w-4 h-4`})}),l&&t(`button`,{type:`button`,style:{width:`${o.buttonWidth}px`,border:`none`,padding:0,margin:0,backgroundColor:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},...a.getToggleButtonProps(),children:t(l,{ctrl:a,layout:o})})]})]})}function qt({ctrl:e}){return e.isMenuOpen?t(We,{className:`w-4 h-4`}):t(Be,{className:`w-4 h-4`})}function Jt({fillWidth:e,items:n,layout:i,ctrl:a,adapter:o,noMatchMessage:s}){let{highlightedIndex:c,selectedItem:l}=a;return n.length===0?s?t(`div`,{style:{width:e?`100%`:void 0},className:i.menuClass,children:s}):null:t(`ul`,{style:{width:e?`100%`:void 0,maxHeight:i.maxMenuHeight?`${i.maxMenuHeight}px`:`240px`},className:i.menuClass,...a.getMenuProps(),children:n.map((e,n)=>t(`li`,{"data-index":n,className:r(i.optionClass,c===n&&`option-highlighted`,l===e&&`option-selected`),...a.getItemProps(e,n),children:o.renderOption(e)},o.idOf(e)))})}function Yt(e){let[t,n]=w(new Xt(e));return _(()=>{t?.withState(n)},[t]),t}var Xt=class e{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText=``;_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,typeof n==`string`?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items}withState(e){return this.setState=e,this}clone(){let t=new e({adapter:this.adapter,items:this.items,popupId:this.popupId});return t.setState=this.setState,t.onSelect=this.onSelect,t._inputText=this._inputText,t._highlightedIndex=this._highlightedIndex,t._selectedItem=this._selectedItem,t._isMenuOpen=this._isMenuOpen,t._filteredItems=this._filteredItems,t.popupCtrl=this.popupCtrl,t}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):``,this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){let e=this.popupCtrl,t=e.context?.position?.position;t&&t===`top`&&window.setTimeout(()=>{e.update()},100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;let n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){let e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{let t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{let n=t.key;if(n===`Enter`){if(this.highlightedIndex!=null)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){let e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else n===`ArrowDown`?this.isMenuOpen?this.highlightIndex(this.highlightedIndex===null?0:Zt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Qt(this.highlightedIndex,e.length),!0)}}}};function Zt(e,t){return(e+1)%t}function Qt(e,t){return(e-1+t)%t}function $t({options:e,creatable:n,...r}){let i=n?Ut.instance:Ht.instance;return t(Gt,{adapter:i,items:e,...r})}function en({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var tn=Object.defineProperty,nn=(e,t)=>tn(e,`name`,{value:t,configurable:!0});function rn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}nn(rn,`setRef`);function an(...e){return t=>{let n=!1,r=e.map(e=>{let r=rn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rn(e[t],null)}}}}nn(an,`composeRefs`);function z(...e){return a.useCallback(an(...e),e)}nn(z,`useComposedRefs`);var on=Object.defineProperty,sn=(e,t)=>on(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
231
|
+
function cn(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];r=yn(r),a.Children.forEach(r,e=>{if(hn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;_n(n)&&typeof Cn==`function`;)n=Cn(n._payload);o=fn(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=a.cloneElement(o,void 0,c):!s&&a.Children.count(r)===1&&a.isValidElement(r)&&(o=r);let l=o?mn(o):void 0,u=z(n,l);if(!o){if(r||r===0)throw Error(s?Sn(e):xn(e));return r}let d=pn(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}sn(cn,`createSlot`);var ln=/* @__PURE__ */ cn(`Slot`),un=Symbol.for(`radix.slottable`);// @__NO_SIDE_EFFECTS__
|
|
232
|
+
function dn(e){let t=/* @__PURE__ */ sn(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=un,t}sn(dn,`createSlottable`);var fn=/* @__PURE__ */ sn((e,t)=>`child`in e.props?a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null:a.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function pn(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=bn(a,i))}return{...e,...n}}sn(pn,`mergeProps`);function mn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}sn(mn,`getElementRef`);function hn(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===un}sn(hn,`isSlottable`);var gn=Symbol.for(`react.lazy`);function _n(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===gn&&`_payload`in e&&vn(e._payload)}sn(_n,`isLazyComponent`);function vn(e){return typeof e==`object`&&!!e&&`then`in e}sn(vn,`isPromiseLike`);function yn(e){let t=e;for(;_n(t)&&typeof Cn==`function`;)t=Cn(t._payload);return t}sn(yn,`useUnwrappedLazy`);function bn(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}sn(bn,`concatAriaDescribedby`);var xn=/* @__PURE__ */ sn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Sn=/* @__PURE__ */ sn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Cn=a.use;function B(...e){return j(i(e))}var wn=Object.defineProperty,Tn=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),En=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return/* @__PURE__ */ Tn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Tn(V,`composeEventHandlers`);function Dn(e){if(!En)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Tn(Dn,`getOwnerWindow`);function On(e){if(!En)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Tn(On,`getOwnerDocument`);function kn(e,t=!1){let{activeElement:n}=On(e);if(!n?.nodeName)return null;if(An(n)&&n.contentDocument)return kn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=On(n).getElementById(e);if(t)return t}}return n}Tn(kn,`getActiveElement`);function An(e){return e.tagName===`IFRAME`}Tn(An,`isFrame`);var jn=Object.defineProperty,Mn=(e,t)=>jn(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
233
|
+
function Nn(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=/* @__PURE__ */ Mn(e=>{let{children:n,...i}=e,o=a.useMemo(()=>i,Object.values(i));return/* @__PURE__ */ t(r.Provider,{value:o,children:n})},`Provider`);i.displayName=e+`Provider`;function o(t,i={}){let{optional:o=!1}=i,s=a.useContext(r);if(s)return s;if(n!==void 0)return n;if(!o)throw Error(`\`${t}\` must be used within \`${e}\``)}return Mn(o,`useContext`),[i,o]}Mn(Nn,`createContext`);// @__NO_SIDE_EFFECTS__
|
|
234
|
+
function Pn(e,n=[]){let r=[];function i(n,i){let o=a.createContext(i);o.displayName=n+`Context`;let s=r.length;r=[...r,i];let c=/* @__PURE__ */ Mn(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return/* @__PURE__ */ t(l.Provider,{value:u,children:i})},`Provider`);c.displayName=n+`Provider`;function l(t,r,c={}){let{optional:l=!1}=c,u=r?.[e]?.[s]||o,d=a.useContext(u);if(d)return d;if(i!==void 0)return i;if(!l)throw Error(`\`${t}\` must be used within \`${n}\``)}return Mn(l,`useContext`),[c,l]}Mn(i,`createContext`);let o=/* @__PURE__ */ Mn(()=>{let t=r.map(e=>a.createContext(e));return/* @__PURE__ */ Mn(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,Fn(o,...n)]}Mn(Pn,`createContextScope`);function Fn(...e){let t=e[0];if(e.length===1)return t;let n=/* @__PURE__ */ Mn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return/* @__PURE__ */ Mn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Mn(Fn,`composeContextScopes`);var In=globalThis?.document?a.useLayoutEffect:()=>{},Ln=Object.defineProperty,Rn=(e,t)=>Ln(e,`name`,{value:t,configurable:!0}),zn=a.useId||(()=>void 0),Bn=0;function H(e){let[t,n]=a.useState(zn());return In(()=>{e||n(e=>e??String(Bn++))},[e]),e||(t?`radix-${t}`:``)}Rn(H,`useId`);var Vn=typeof document<`u`?x:function(){};function Hn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Hn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Hn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Un(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wn(e,t){let n=Un(e);return Math.round(t*n)/n}function Gn(e){let t=a.useRef(e);return Vn(()=>{t.current=e}),t}function Kn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=a.useState(r);Hn(p,r)||m(r);let[h,g]=a.useState(null),[_,v]=a.useState(null),y=a.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=a.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=a.useRef(null),w=a.useRef(null),E=a.useRef(d),D=l!=null,O=Gn(l),k=Gn(i),A=Gn(u),j=a.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),re(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Hn(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Vn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);Vn(()=>(M.current=!0,()=>{M.current=!1}),[]),Vn(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=a.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=a.useMemo(()=>({reference:x,floating:S}),[x,S]),F=a.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Wn(P.floating,d.x),r=Wn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Un(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}const qn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:te({element:r.current,padding:i}).fn(n):r?te({element:r,padding:i}).fn(n):{}}}},Jn=(e,t)=>{let n=se(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{let n=ce(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xn=(e,t)=>({fn:oe(e).fn,options:[e,t]}),Zn=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qn=(e,t)=>{let n=le(e);return{name:n.name,fn:n.fn,options:[e,t]}},$n=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},er=(e,t)=>{let n=qn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var tr=Object.defineProperty,nr=(e,t)=>tr(e,`name`,{value:t,configurable:!0}),U=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=/* @__PURE__ */ cn(`Primitive.${n}`),i=a.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),/* @__PURE__ */ t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function rr(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}nr(rr,`dispatchDiscreteCustomEvent`);var ir=Object.defineProperty,ar=(e,t)=>ir(e,`name`,{value:t,configurable:!0}),or=a.useInsertionEffect;function sr(e){let t=a.useRef(e);return typeof or==`function`?or(()=>{t.current=e}):In(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}ar(sr,`useCallbackRef`);var cr=Object.defineProperty,lr=(e,t)=>cr(e,`name`,{value:t,configurable:!0});function ur(e){let[t,n]=a.useState(void 0);return In(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}lr(ur,`useSize`);var dr=Object.defineProperty,fr=(e,t)=>dr(e,`name`,{value:t,configurable:!0}),pr={Partial:`partial`,Always:`always`},mr={Optimized:`optimized`,Always:`always`},hr=`Popper`,[gr,_r]=/* @__PURE__ */ Pn(hr),[vr,yr]=gr(hr),br=/* @__PURE__ */ fr(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return/* @__PURE__ */ t(vr,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),xr=`PopperAnchor`,Sr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ fr(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=yr(xr,r),c=a.useRef(null),l=s.onAnchorChange,u=z(n,a.useCallback(e=>{c.current=e,e&&l(e)},[l])),d=a.useRef(null);a.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&l(d.current)});let f=s.placementState&&kr(s.placementState),p=f?.[0],m=f?.[1];return i?null:/* @__PURE__ */ t(U.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),Cr=`PopperContent`,[wr,Tr]=gr(Cr),Er=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ fr(function(e,n){let{__scopePopper:r,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=pr.Partial,hideWhenDetached:m=!1,updatePositionStrategy:h=mr.Optimized,onPlaced:g,..._}=e,v=yr(Cr,r),[y,b]=a.useState(null),x=z(n,b),[S,C]=a.useState(null),w=ur(S),T=w?.width??0,E=w?.height??0,D=i+(s===`center`?``:`-`+s),O=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],A=k.length>0,j={padding:O,boundary:k.filter(Dr),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:ee}=Kn({strategy:`fixed`,placement:D,whileElementsMounted:/* @__PURE__ */ fr((...e)=>ne(...e,{animationFrame:h===mr.Always}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Jn({mainAxis:o+E,alignmentAxis:c}),u&&Yn({mainAxis:!0,crossAxis:!1,...p===pr.Partial?{limiter:Xn()}:{},...j}),u&&Zn({...j}),Qn({...j,apply:/* @__PURE__ */ fr(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&er({element:S,padding:l}),Or({arrowWidth:T,arrowHeight:E}),m&&$n(A?{strategy:`referenceHidden`,...j}:{strategy:`referenceHidden`,padding:j.padding,altBoundary:j.altBoundary})]}),I=v.setPlacementState;In(()=>(I(P),()=>{I(void 0)}),[P,I]);let[te,re]=kr(P),ie=sr(g);In(()=>{F&&ie?.()},[F,ie]);let ae=ee.arrow?.x,oe=ee.arrow?.y,se=ee.arrow?.centerOffset!==0,[ce,le]=a.useState();return In(()=>{y&&le(window.getComputedStyle(y).zIndex)},[y]),/* @__PURE__ */ t(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(` `),...ee.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:/* @__PURE__ */ t(wr,{scope:r,placedSide:te,placedAlign:re,onArrowChange:C,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:/* @__PURE__ */ t(U.div,{"data-side":te,"data-align":re,..._,ref:x,style:{..._.style,animation:F?_.style?.animation:`none`}})})})},`PopperContent`));function Dr(e){return e!==null}fr(Dr,`isNotNull`);var Or=/* @__PURE__ */ fr(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=kr(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function kr(e){let[t,n=`center`]=e.split(`-`);return[t,n]}fr(kr,`getSideAndAlignFromPlacement`);var Ar=Object.defineProperty,jr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>Ar(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);In(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(/* @__PURE__ */ t(U.div,{...i,ref:n}),c):null},`Portal`)),Mr=Object.defineProperty,Nr=(e,t)=>Mr(e,`name`,{value:t,configurable:!0});function Pr(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}Nr(Pr,`useStateMachine`);var Fr=/* @__PURE__ */ Nr(e=>{let{present:t,children:n}=e,r=Ir(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=Rr(r.ref,Br(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function Ir(e){let[t,n]=a.useState(),r=a.useRef(null),i=a.useRef(e),o=a.useRef(`none`),s=a.useRef(void 0),[c,l]=Pr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return a.useEffect(()=>{c===`mounted`?(o.current=s.current??zr(r.current),s.current=void 0):o.current=`none`},[c]),In(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=zr(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),In(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=/* @__PURE__ */ Nr(a=>{let o=zr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=/* @__PURE__ */ Nr(e=>{e.target===t&&(o.current=zr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:a.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=zr(t)}else r.current=null;n(e)},[])}}Nr(Ir,`usePresence`);function Lr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Nr(Lr,`setRef`);function Rr(...e){let t=a.useRef(e);return t.current=e,a.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Lr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Lr(n[e],null)}}},[])}Nr(Rr,`useStableComposedRefs`);function zr(e){return e?.animationName||`none`}Nr(zr,`getAnimationName`);function Br(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Nr(Br,`getElementRef`);var Vr=Object.defineProperty,Hr=(e,t)=>Vr(e,`name`,{value:t,configurable:!0}),Ur=a.useEffectEvent,Wr=a.useInsertionEffect;function Gr(e){if(typeof Ur==`function`)return Ur(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Wr==`function`?Wr(()=>{t.current=e}):In(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}Hr(Gr,`useEffectEvent`);var Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0}),Jr=a.useInsertionEffect||In;function Yr({prop:e,defaultProp:t,onChange:n=/* @__PURE__ */ qr(()=>{},`onChange`),caller:r}){let[i,o,s]=Xr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Zr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}qr(Yr,`useControllableState`);function Xr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return Jr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}qr(Xr,`useUncontrolledState`);function Zr(e){return typeof e==`function`}qr(Zr,`isFunction`);var Qr=Symbol(`RADIX:SYNC_STATE`);function $r(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=Gr(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Qr)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=a.useRef(m);a.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=a.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return a.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Qr,state:i})},[i,f.state,l]),[g,p]}qr($r,`useControllableStateReducer`);var ei=Object.defineProperty,ti=(e,t)=>ei(e,`name`,{value:t,configurable:!0}),ni=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ri=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ti(function(e,n){return/* @__PURE__ */ t(U.span,{...e,ref:n,style:{...ni,...e.style}})},`VisuallyHidden`)),ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0}),[oi,si]=/* @__PURE__ */ Pn(`Tooltip`,[_r]),ci=_r(),li=`TooltipProvider`,ui=700,di=`tooltip.open`,[fi,pi]=oi(li),mi=/* @__PURE__ */ ai(e=>{let{__scopeTooltip:n,delayDuration:r=ui,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=a.useRef(!0),l=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),/* @__PURE__ */ t(fi,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),c.current=!1)},[i]),onClose:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:a.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})},`TooltipProvider`),hi=`Tooltip`,[gi,_i]=oi(hi),vi=/* @__PURE__ */ ai(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=pi(hi,e.__scopeTooltip),d=ci(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=H(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=Yr({prop:i,defaultProp:o??!1,onChange:/* @__PURE__ */ ai(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(di))):u.onClose(),s?.(e)},`onChange`),caller:hi}),C=a.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);a.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=m??g;return/* @__PURE__ */ t(br,{...d,children:/* @__PURE__ */ t(gi,{scope:n,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?E():w()},[u.isOpenDelayedRef,E,w]),onTriggerLeave:a.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:r})})},`Tooltip`),yi=`TooltipTrigger`,bi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ai(function(e,n){let{__scopeTooltip:r,"aria-describedby":i,...o}=e,s=_i(yi,r),c=pi(yi,r),l=ci(r),u=z(n,a.useRef(null),s.onTriggerChange),d=a.useRef(!1),f=a.useRef(!1),p=a.useCallback(()=>d.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),/* @__PURE__ */ t(Sr,{asChild:!0,...l,children:/* @__PURE__ */ t(U.button,{"aria-describedby":s.open?Ii(i,s.contentId):i,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!c.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:V(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:V(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:V(e.onBlur,s.onClose),onClick:V(e.onClick,s.onClose)})})},`TooltipTrigger`)),xi=`TooltipPortal`,[Si,Ci]=oi(xi,{forceMount:void 0}),wi=/* @__PURE__ */ ai(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=_i(xi,n);return/* @__PURE__ */ t(Si,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Fr,{present:r||o.open,children:/* @__PURE__ */ t(jr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),Ti=`TooltipContent`,Ei=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ai(function(e,n){let r=Ci(Ti,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=_i(Ti,e.__scopeTooltip);return/* @__PURE__ */ t(Fr,{present:i||s.open,children:s.disableHoverableContent?/* @__PURE__ */ t(ki,{side:a,...o,ref:n}):/* @__PURE__ */ t(Di,{side:a,...o,ref:n})})},`TooltipContent`)),Di=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ai(function(e,n){let r=_i(Ti,e.__scopeTooltip),i=pi(Ti,e.__scopeTooltip),o=a.useRef(null),s=z(n,o),[c,l]=a.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=i,m=a.useCallback(()=>{l(null),p(!1)},[p]),h=a.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ji(r,Ai(r,n.getBoundingClientRect())),a=Mi(t.getBoundingClientRect()),o=Pi([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=/* @__PURE__ */ ai(e=>h(e,f),`handleTriggerLeave`),t=/* @__PURE__ */ ai(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),a.useEffect(()=>{if(c){let e=/* @__PURE__ */ ai(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!Ni(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),/* @__PURE__ */ t(ki,{...e,ref:s})},`TooltipContentHoverable`)),Oi=/* @__PURE__ */ dn(`TooltipContent`),ki=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ai(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=_i(Ti,i),p=ci(i),{onClose:m}=f,[h,g]=a.useState(null),_=z(r,g);ee(h),a.useEffect(()=>(document.addEventListener(di,m),()=>document.removeEventListener(di,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=/* @__PURE__ */ ai(e=>{e.target instanceof Node&&e.target.contains(f.trigger)&&m()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[f.trigger,m]);let{setContentId:v}=f;return In(()=>(v(c),()=>{v(void 0)}),[c,v]),/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:/* @__PURE__ */ n(Er,{"data-state":f.stateAttribute,role:s?void 0:`tooltip`,id:s?void 0:f.contentId,...p,...d,ref:_,style:{...d.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[/* @__PURE__ */ t(Oi,{children:o}),s?/* @__PURE__ */ t(ri,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function Ai(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}ai(Ai,`getExitSideFromRect`);function ji(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}ai(ji,`getPaddedExitPoints`);function Mi(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}ai(Mi,`getPointsFromRect`);function Ni(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}ai(Ni,`isPointInPolygon`);function Pi(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Fi(t)}ai(Pi,`getHull`);function Fi(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}ai(Fi,`getHullPresorted`);function Ii(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}ai(Ii,`concatAriaDescribedby`);const Li=o.createContext(void 0);function Ri(e,t=`plugin-portal-container`){let n=e instanceof Document?e.body:e;for(let e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;let r=document.createElement(`div`);return r.id=t,n.appendChild(r),r}function zi({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(Li),i=o.useRef(null),[a,s]=o.useState(r||void 0);return o.useEffect(()=>{if(r)s(r);else if(i.current){let e=i.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){let t=Ri(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(Li.Provider,{value:a||void 0,children:e})}function Bi(){return o.useContext(Li)}const Vi=mi,Hi=vi,Ui=bi,Wi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=Bi();return t(wi,{container:o,children:t(Ei,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:B(`max-w-[90vw]`,`z-50 overflow-hidden rounded-md bg-tooltips border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});Wi.displayName=Ei.displayName;function Gi({description:e,children:r,size:i=`sm`,placement:o=`top`,className:s,asChild:c}){let[l,u]=a.useState(!1),d=a.useRef(!1);return a.useEffect(()=>{let e=()=>{u(!1),d.current=!0,requestAnimationFrame(()=>{d.current=!1})};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,e)}},[]),t(Vi,{delayDuration:0,children:n(Hi,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(Ui,{className:`cursor-pointer`,asChild:c,children:r}),t(Wi,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const Ki=/* @__PURE__ */ new Set;function qi(e,t,n){_(()=>{t&&!Ki.has(e)&&(Ki.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Ji(e){return a.Children.toArray(e).some(e=>{if(typeof e==`string`)return e.trim().length>0;if(typeof e==`number`)return!0;if(a.isValidElement(e)){let t=e.props;return t[`aria-hidden`]===!0||t[`aria-hidden`]===`true`?!1:Ji(t.children)}return!1})}const Yi=A(`hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{destructive:`bg-destructive text-destructive ring-1 ring-inset ring-destructive/50 shadow-xs hover:bg-destructive/50`,outline:`border border-input bg-background shadow-xs hover:bg-muted ring-inset`,secondary:`bg-info text-info shadow-xs hover:bg-mixer-info/10 ring-inset`,ghost:`hover:bg-muted/50 ring-inset`,link:`text-foreground underline-offset-4 hover:underline ring-inset`,primary:`bg-primary text-primary shadow-xs hover:bg-primary/90 ring-inset`,unstyled:``},size:{xs:`h-7 rounded px-2 py-1 text-xs gap-x-1`,sm:`h-8 rounded px-3 text-xs`,md:`h-9 rounded-md px-4 py-2`,lg:`h-10 rounded-md px-3`,xl:`rounded-md px-3.5 py-2.5 text-sm gap-x-2`,icon:`p-0 m-0 rounded-full`,none:``}},defaultVariants:{variant:`primary`,size:`md`}}),W=a.forwardRef(({className:r,variant:i,size:a,asChild:o=!1,alt:s,isDisabled:c,isLoading:l,title:u,tooltipPlacement:d=`top`,onClick:f,type:p,...m},h)=>{qi(`Button.alt`,s!==void 0,"use `title` instead — it drives the same tooltip and the accessible name. `alt` remains an alias for one release.");let g=o?ln:`button`,_=o?p:p??`button`,v=u??s,y=m[`aria-label`]??s??(Ji(m.children)?void 0:u),b=o?m.children:n(e,{children:[l&&t(ct,{className:`animate-spin`}),m.children]}),x=t(g,{className:B(Yi({variant:i,size:a}),r),disabled:c||l||m.disabled,ref:h,onClick:f,type:_,autoFocus:!1,...m,"aria-label":y,children:b});return v?t(Gi,{description:v,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:d,children:x}):x});W.displayName=`Button`;const Xi=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,BtnIcon:o,"aria-label":s,...c},l)=>{let[u,d]=w(!1),{t:f}=k();qi(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let p=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{d(!0),setTimeout(()=>d(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||f(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:f(`misc.failedToCopy`),duration:2e3})})},m=s??a??f(`misc.copy`);return t(W,{ref:l,className:B(i),variant:`unstyled`,size:e||`sm`,onClick:p,...c,title:m,children:u?t(Re,{className:`text-success`}):o??t(et,{className:`size-4`})})});Xi.displayName=`CopyButton`;function Zi({buttonLabel:e,title:r,children:i,onClick:a}){return t(`div`,{className:`flex items-center justify-center h-full text-center`,children:n(`div`,{className:`py-12`,children:[t(`svg`,{className:`mx-auto size-12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{vectorEffect:`non-scaling-stroke`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z`})}),t(`h3`,{className:`mt-2 text-sm font-semibold`,children:r}),t(`p`,{className:`mt-1 text-sm text-muted`,children:i}),t(`div`,{className:`mt-6`,children:n(W,{onClick:a,children:[t(mt,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Qi(e){return e.isFile}function $i(e){return e.isDirectory}function ea(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function ta({children:e,onUpload:r}){let i=C(null);return n(`label`,{style:{cursor:`pointer`},children:[e,t(`input`,{ref:i,type:`file`,style:{display:`none`},onChange:()=>{i.current?.files&&r(ea(i.current.files))}})]})}function na({onUpload:e}){let r=oa({onUpload:e});return t(`div`,{...r,className:`flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-muted hover:bg-background border-border`,children:n(`label`,{htmlFor:`dropzone-file`,className:`flex flex-col items-center justify-center w-full h-full`,children:[n(`div`,{className:`flex flex-col items-center justify-center pt-5 pb-6`,children:[t(`svg`,{className:`w-8 h-8 mb-4 text-muted`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 16`,children:t(`path`,{stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2`})}),n(`p`,{className:`mb-2 text-sm text-muted`,children:[t(`span`,{className:`font-semibold`,children:`Click to upload`}),` or drag and drop`]}),t(`p`,{className:`text-xs text-muted`,children:`SVG, PNG, JPG or GIF (MAX. 800x400px)`})]}),t(`input`,{id:`dropzone-file`,type:`file`,className:`hidden`})]})})}function ra(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function ia(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function aa(e){e&&delete e.__dragOver_cnt__}function oa({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),aa(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Qi(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if($i(e)){let i=e.createReader(),a=[],o=()=>{i.readEntries(i=>{if(!i.length)Promise.all(a).then(e=>r(e.flat()));else{for(let r of i)a.push(n(r,`${t+e.name}/`));o()}})};o()}});for(let e=0;e<i.length;e++){let r=i[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{let n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{ra(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{ia(r.current)&&r.current?.classList.remove(t)},ref:r}}function sa({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(Gi,{description:e,placement:r,children:t(it,{className:B(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function ca(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function la(){try{return ue.isDev}catch{return!1}}function ua({description:e,helpText:i,error:a,required:o,label:c,className:d,direction:f=`column`,children:p,disabled:h=!1,fullWidthLabel:g=!1,childrenId:_}){let y=v(),b=v(),x=v(),S=_??y,w=C(!1),T=s.toArray(p).filter(m),E=T.length===1?T[0]:void 0,D=E?.type===l,O=!!E&&!D,k=!1,A=p;if(O&&E){let e=E,t=e.props??{},n=ca(t[`aria-describedby`],i?b:void 0,a?x:void 0),r=t[`aria-invalid`]??(a?!0:void 0);A=u(e,{id:t.id??S,"aria-describedby":n,"aria-invalid":r}),k=!0}else la()&&!w.current&&(i||a||_===void 0)&&(w.current=!0,console.warn("[@vertesia/ui] FormItem received zero, multiple, or a fragment as element children. ARIA wiring skipped. Pass `childrenId` and set `id` / `aria-describedby` / `aria-invalid` on your input manually, or wrap the input in a single non-fragment element."));let j=k||_?S:void 0;return n(`div`,{className:r(`flex w-full space-y-1`,d,f===`row`?`flex-row justify-between items-center gap-2`:f===`row-reverse`?`flex-row-reverse justify-between items-center gap-2`:`flex-col`),children:[n(`div`,{className:r(`flex items-center gap-1 mb-0`,g&&`w-full`),children:[n(`label`,{htmlFor:j,className:`text-sm font-medium mb-1 ${h?`text-muted`:``} ${g&&`flex-1`}`,children:[c,o?t(`span`,{className:`text-destructive -mt-4 ms-1`,children:`*`}):``]}),e&&t(`div`,{className:`mx-2 flex w-4 items-center`,children:t(sa,{description:e})})]}),A,i&&t(`p`,{id:b,className:`text-xs text-muted`,children:i}),a&&t(`p`,{id:x,className:`text-xs text-destructive`,children:a})]})}function da(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const fa=A(`inline-flex items-center rounded-md px-2 py-1 text-xs font-medium`,{variants:{variant:{default:`text-foreground bg-muted`,secondary:`bg-secondary text-info`,destructive:`bg-destructive text-destructive`,attention:`bg-attention text-attention`,success:`bg-success text-success`,info:`bg-info text-info`,done:`bg-done text-done`,outline:`bg-transparent border border-border text-foreground`}},defaultVariants:{variant:`default`}});function pa({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:da(i)}:{};return t(`span`,{className:B(fa({variant:n}),e),...o,...a,children:r})}const ma=A(`inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border`,{variants:{variant:{default:``,success:``,destructive:``,attention:``,done:``,info:``,outline:``}},defaultVariants:{variant:`default`}}),ha=A(`h-1.5 w-1.5`,{variants:{variant:{default:`fill-foreground`,success:`fill-success`,destructive:`fill-destructive`,attention:`fill-attention`,done:`fill-done`,info:`fill-info`,outline:`fill-foreground`}},defaultVariants:{variant:`default`}});function ga({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:B(ma({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:B(ha({variant:e}),i),viewBox:`0 0 6 6`,"aria-hidden":`true`,children:t(`circle`,{cx:3,cy:3,r:3})})}),t(`span`,{className:`truncate`,children:a})]})}function _a({value:e=[],onChange:i,className:a,delimiters:o=`, `,placeholder:s,autoFocus:c,disabled:l=!1}){let[u,d]=w(``),f=t=>{if(l)return;let n=t.currentTarget.value;n?.trim()&&(i([...e,n.trim()]),d(``))},p=t=>{if(l)return;let n=t.currentTarget.value,r=!n.trim(),a=t.key;a===`Enter`||o.indexOf(a)>-1?(t.preventDefault(),e&&!r&&(i([...e,n.trim()]),d(``))):a===`Backspace`&&r&&e&&e.length>0&&(e.pop(),i([...e]))},m=t=>{if(l)return;let n=t.clipboardData.getData(`text`);if(n){t.preventDefault();let r=o.split(``).map(e=>e===` `?`\\s`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`[${r}]+`),s=n.split(a).map(e=>e.trim()).filter(e=>e.length>0);s.length>0&&i([...e,...s]),d(``)}},h=t=>{l||e&&e.length>0&&(e.splice(t,1),i([...e]))};return n(`div`,{className:r(a,`w-full flex flex-wrap items-center gap-1 p-2 py-1.5`,`rounded-md text-sm 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`,l&&`opacity-50 cursor-not-allowed`),children:[e&&e.length>0&&e.map((e,n)=>t(Gi,{description:`click to remove`,children:t(pa,{variant:`secondary`,onClick:()=>h(n),className:r(`flex-shrink-0 transition-colors`,l?`cursor-not-allowed`:`cursor-pointer hover:bg-destructive hover:text-destructive`),title:e,children:t(`span`,{className:`break-all`,children:e})})},`item-${n}`)),t(`input`,{className:`flex-1 min-w-[80px] m-0 p-0 px-1 border-0 bg-transparent text-sm placeholder:text-muted focus:outline-none focus:ring-0 disabled:cursor-not-allowed`,type:`text`,value:u,onBlur:f,onKeyDown:p,onPaste:m,onChange:e=>d(e.currentTarget.value),placeholder:!e||e.length===0?s:``,autoFocus:c,disabled:l})]})}function va({underline:e=`always`,className:n,children:i,...a}){let o;return e===`always`?o=`underline`:e===`hover`&&(o=`hover:underline`),t(`a`,{className:r(`text-info`,n,o),...a,children:i})}function ya({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}ya.Item=p(function(e,n){let{current:i,children:a,className:o,href:s=`#`,onClick:c,...l}=e;return t(`li`,{className:r(o,i?`bg-muted`:``,`w-full p-2 ps-3 text-sm leading-6 font-semibold hover:bg-muted`),children:t(`a`,{ref:n,href:s,onClick:e=>{c?(e.preventDefault(),c(e)):s===`#`&&e.preventDefault()},className:`w-full flex items-center gap-x-3`,...l,children:a})})});const ba=`rounded-md text-sm 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`,xa={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:ba,INPUT:`${ba} py-1.5`};function Sa(e){return e==null||Number.isNaN(e)?``:e.toString()}const Ca=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(Sa(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=Sa(e);d(t)}},[e]),t(`input`,{onWheel:a?e=>{e.currentTarget.blur()}:c.onWheel,type:`number`,value:u,onChange:e=>{let t=e.target.value;d(t),t===``?n?.(void 0,t):n?.(parseFloat(t),t)},className:r(i,xa.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),wa=d({});function Ta(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const Ea=typeof window<`u`?x:_,Da=/* @__PURE__ */ d(null);function Oa(e,t){e.indexOf(t)===-1&&e.push(t)}function ka(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const Aa=(e,t,n)=>n>t?t:n<e?e:n,ja={},Ma=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Na=e=>typeof e==`object`&&!!e,Pa=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
|
|
235
|
+
function Fa(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ia=/* @__NO_SIDE_EFFECTS__ */ e=>e,La=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ra=/* @__NO_SIDE_EFFECTS__ */ (e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var za=class{constructor(){this.subscriptions=[]}add(e){return Oa(this.subscriptions,e),()=>this.remove(e)}remove(e){ka(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const Ba=/* @__NO_SIDE_EFFECTS__ */ e=>e*1e3,Va=/* @__NO_SIDE_EFFECTS__ */ e=>e/1e3,Ha=/* @__NO_SIDE_EFFECTS__ */ (e,t)=>t?1e3/t*e:0,Ua=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);/*#__NO_SIDE_EFFECTS__*/
|
|
236
|
+
function Wa(e,t,n,r){return e===t&&n===r?Ia:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=Ua(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(Ua(s+1e-7,e,n)-i-r)}return Ua(s,t,r)}}const Ga=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ka=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),qa=/*@__PURE__*/ Wa(.33,1.53,.69,.99),Ja=/*@__PURE__*/ Ka(qa),Ya=/*@__PURE__*/ Ga(Ja),Xa=e=>e>=1?1:(e*=2)<1?.5*Ja(e):.5*(2-2**(-10*(e-1))),Za=e=>1-Math.sin(Math.acos(e)),Qa=/* @__PURE__ */ Ka(Za),$a=/* @__PURE__ */ Ga(Za),eo=/*@__PURE__*/ Wa(.42,0,1,1),to=/*@__PURE__*/ Wa(0,0,.58,1),no=/*@__PURE__*/ Wa(.42,0,.58,1),ro=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`,io=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,ao={linear:Ia,easeIn:eo,easeInOut:no,easeOut:to,circIn:Za,circInOut:$a,circOut:Qa,backIn:Ja,backInOut:Ya,backOut:qa,anticipate:Xa},oo=e=>typeof e==`string`,so=e=>{if(/* @__PURE__ */ io(e)){e.length;let[t,n,r,i]=e;return/* @__PURE__ */ Wa(t,n,r,i)}return oo(e)?(ao[e],`${e}`,ao[e]):e},G={delta:0,timestamp:0,isProcessing:!1};let co;function lo(){co=void 0}const K={now:()=>(co===void 0&&K.set(G.isProcessing||ja.useManualTiming?G.timestamp:performance.now()),co),set:e=>{co=e,queueMicrotask(lo)}},uo=e=>Math.round(e*1e5)/1e5,fo=e=>t=>typeof t==`string`&&t.startsWith(e),po=/*@__PURE__*/ fo(`--`),mo=/*@__PURE__*/ fo(`var(--`),ho=e=>mo(e)?go.test(e.split(`/*`)[0].trim()):!1,go=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _o(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const vo={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},yo={...vo,transform:e=>Aa(0,1,e)},bo={...vo,default:1},xo=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function So(e){return e==null}const Co=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wo=(e,t)=>n=>!!(typeof n==`string`&&Co.test(n)&&n.startsWith(e)||t&&!So(n)&&Object.prototype.hasOwnProperty.call(n,t)),To=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(xo);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Eo=e=>Aa(0,255,e),Do={...vo,transform:e=>Math.round(Eo(e))},Oo={test:/*@__PURE__*/ wo(`rgb`,`red`),parse:/*@__PURE__*/ To(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Do.transform(e)+`, `+Do.transform(t)+`, `+Do.transform(n)+`, `+uo(yo.transform(r))+`)`};function ko(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Ao={test:/*@__PURE__*/ wo(`#`),parse:ko,transform:Oo.transform},jo=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mo=/*@__PURE__*/ jo(`deg`),No=/*@__PURE__*/ jo(`%`),q=/*@__PURE__*/ jo(`px`),Po=/*@__PURE__*/ jo(`vh`),Fo=/*@__PURE__*/ jo(`vw`),Io={...No,parse:e=>No.parse(e)/100,transform:e=>No.transform(e*100)},Lo={test:/*@__PURE__*/ wo(`hsl`,`hue`),parse:/*@__PURE__*/ To(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+No.transform(uo(t))+`, `+No.transform(uo(n))+`, `+uo(yo.transform(r))+`)`},Ro={test:e=>Oo.test(e)||Ao.test(e)||Lo.test(e),parse:e=>Oo.test(e)?Oo.parse(e):Lo.test(e)?Lo.parse(e):Ao.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Oo.transform(e):Lo.transform(e),getAnimatableNone:e=>{let t=Ro.parse(e);return t.alpha=0,Ro.transform(t)}},zo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Bo=/*@__PURE__*/ new RegExp(xo.source),Vo=/*@__PURE__*/ new RegExp(zo.source,`i`);function Ho(e){return isNaN(e)&&typeof e==`string`&&(Bo.test(e)||Vo.test(e))}const Uo=`number`,Wo=`color`,Go=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ko(e){let t=e.toString();return Bo.test(t)||Vo.test(t)}function qo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Go,e=>(Ro.test(e)?(r.color.push(a),i.push(Wo),n.push(Ro.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Uo),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Jo(e){return qo(e).values}function Yo({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Uo?uo(r[a]):e===Wo?Ro.transform(r[a]):r[a]}return i}}function Xo(e){return Yo(qo(e))}const Zo=e=>typeof e==`number`?0:Ro.test(e)?Ro.getAnimatableNone(e):e,Qo=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Zo(e);function $o(e){let t=qo(e);return Yo(t)(t.values.map((e,n)=>Qo(e,t.split[n])))}const es={test:Ho,parse:Jo,createTransformer:Xo,getAnimatableNone:$o};function ts(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ns({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ts(s,r,e+1/3),a=ts(s,r,e),o=ts(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function rs(e,t){return n=>n>0?t:e}const J=(e,t,n)=>e+(t-e)*n,is=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},as=[Ao,Oo,Lo],os=e=>as.find(t=>t.test(e));function ss(e){let t=os(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===Lo&&(n=ns(n)),n}const cs=(e,t)=>{let n=ss(e),r=ss(t);if(!n||!r)return rs(e,t);let i={...n};return e=>(i.red=is(n.red,r.red,e),i.green=is(n.green,r.green,e),i.blue=is(n.blue,r.blue,e),i.alpha=J(n.alpha,r.alpha,e),Oo.transform(i))},ls=/* @__PURE__ */ new Set([`none`,`hidden`]);function us(e,t){return ls.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ds(e,t){return n=>J(e,t,n)}function fs(e){return typeof e==`number`?ds:typeof e==`string`?ho(e)?rs:Ro.test(e)?cs:gs:Array.isArray(e)?ps:typeof e==`object`?Ro.test(e)?cs:ms:rs}function ps(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>fs(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ms(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=fs(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function hs(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const gs=(e,t)=>{let n=es.createTransformer(t),r=qo(e),i=qo(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ls.has(e)&&!i.values.length||ls.has(t)&&!r.values.length?us(e,t):La(ps(hs(r,i),i.values),n):(`${e}${t}`,rs(e,t))},_s=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function vs(e,t){let n=_s.exec(e);if(!n)return;let r=_s.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>uo(J(a,o,e))+i}function ys(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return J(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=vs(e,t);if(n)return n}return fs(e)(e,t)}const bs=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function xs(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a=/* @__PURE__ */ new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function Ss(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=bs.reduce((e,t)=>(e[t]=xs(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=ja.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:bs.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<bs.length;t++)o[bs[t]].cancel(e)},state:n,steps:o}}const{schedule:Y,cancel:Cs,steps:ws}=/* @__PURE__ */ Ss(typeof requestAnimationFrame<`u`?requestAnimationFrame:Ia,!0,G),Ts=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Y.update(t,e),stop:()=>Cs(t),now:()=>G.isProcessing?G.timestamp:K.now()}},Es=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Ds=2e4;function Os(e,t=50,n=Ds,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function ks(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(Os(o),Ds);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:/* @__PURE__ */ Va(s)}}const As={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},js=e=>e<0?1/Math.max(1+e,As.minDamping):Math.max(1-e,As.minDamping);function Ms(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Ps(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Ns(e,t){return e*Math.sqrt(1-t*t)}function Ps(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const Fs=.001;function Is({duration:e=As.duration,bounce:t=As.bounce}){let n,r;As.maxDuration;let i=js(t);e=Aa(As.minDuration,As.maxDuration,/* @__PURE__ */ Va(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Ns(t,i),o=Math.exp(-r);return Fs-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Ns(t*t,i);return(-n(t)+Fs>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Ps(n,r,a),s=o*Ms(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ Ba(e)}}const Ls=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Rs(e,t){if(Ls(e,t))return e}function zs(e){let t=Rs(e.stiffness),n=Rs(e.damping,!0),r=Rs(e.mass),i={...e,stiffness:t??As.stiffness,damping:n??As.damping,mass:r??As.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=js(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Ms(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Is(i)),i.isResolvedFromDuration=!0;(!Ls(i.stiffness)||!Ls(i.damping,!0))&&(i.stiffness=As.stiffness,i.damping=As.damping)}return i}function Bs(e=As.visualDuration,t=As.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=zs({...n}),f=e=>d?0:-/* @__PURE__ */ Va(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ Va(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?As.restSpeed.granular:As.restSpeed.default),g.restDelta=n.restDelta||(e?As.restDelta.granular:As.restDelta.default)};_();let v,y,b;if(p<1){let e=Ns(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ Ba(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ Ba(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Os(S),Ds),t=Es(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Bs.applyToOptions=e=>{let t=ks(e,100,Bs);return e.ease=t.ease,e.duration=/* @__PURE__ */ Ba(t.duration),e.type=`keyframes`,e};function Vs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Bs({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Hs(e,t,n){let r=[],i=n||ja.mix||ys,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||Ia:t;a=La(e,a)}r.push(a)}return r}function Us(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Hs(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ Ra(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Aa(e[0],e[a-1],t)):l}function Ws(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ Ra(0,t,r);e.push(J(n,1,i))}}function Gs(e){let t=[0];return Ws(t,e.length-1),t}function Ks(e,t){return e.map(e=>e*t)}function qs(e,t){return e.map(()=>t||no).splice(0,e.length-1)}function Js({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ ro(r)?r.map(so):so(r)||no,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(ja.mix||ys)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Aa(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Us(Ks(n&&n.length===t.length?n:Gs(t),e),t,{ease:Array.isArray(i)?i:qs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}function Ys(e,t,n){let r=Math.max(t-5,0);return/* @__PURE__ */ Ha(n-e(r),t-r)}function Xs(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Ys(t=>e.next(t).value,t,e.next(t).value)}const Zs=e=>e!==null;function Qs(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Zs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const $s={decay:Vs,inertia:Vs,tween:Js,keyframes:Js,spring:Bs};function ec(e){typeof e.type==`string`&&(e.type=$s[e.type])}const tc=(e,t)=>t-e>40&&!ja.useManualTiming?t:e;function nc(e,t){return{kind:e,animation:t,timestamp:K.now(),frameTimestamp:G.timestamp,frameIsProcessing:G.isProcessing}}function rc(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...nc(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function ic(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...nc(`layout-animation-start`,e),node:t})}catch{}}var ac=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}};const oc=e=>e/100,sc=e=>Math.round(e*1e4)/1e4;var cc=class extends ac{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==K.now()&&this.tick(K.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),rc(this,this.options)}initAnimation(){let{options:e}=this;ec(e);let{type:t=Js,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Js;s!==Js&&typeof o[0]!=`number`&&(this.mixKeyframes=La(oc,ys(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Os(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=tc(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;!d&&i!==null&&(p=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==Vs&&(f.value=Qs(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??sc((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==Vs?Qs(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=Aa(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}then(e,t){return this.finished.then(e,t)}get duration(){return/* @__PURE__ */ Va(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Va(e)}get time(){return/* @__PURE__ */ Va(this.currentTime)}set time(e){e=/* @__PURE__ */ Ba(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Xs(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(K.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ Va(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ts,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(K.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};const lc=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function uc(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(xo)||[];if(!r)return e;let i=n.replace(r,``),a=+!!lc.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const dc=/\b([a-z-]*)\(.*?\)/gu,fc={...es,getAnimatableNone:e=>{let t=e.match(dc);return t?t.map(uc).join(` `):e}},pc={...es,getAnimatableNone:e=>{let t=es.parse(e);return es.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},mc={...vo,transform:Math.round},hc={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,rotate:Mo,pathRotation:Mo,rotateX:Mo,rotateY:Mo,rotateZ:Mo,scale:bo,scaleX:bo,scaleY:bo,scaleZ:bo,skew:Mo,skewX:Mo,skewY:Mo,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:yo,originX:Io,originY:Io,originZ:q,zIndex:mc,fillOpacity:yo,strokeOpacity:yo,numOctaves:mc},gc={...hc,color:Ro,backgroundColor:Ro,outlineColor:Ro,fill:Ro,stroke:Ro,borderColor:Ro,borderTopColor:Ro,borderRightColor:Ro,borderBottomColor:Ro,borderLeftColor:Ro,filter:fc,WebkitFilter:fc,mask:pc,WebkitMask:pc},_c=e=>gc[e],vc=/*@__PURE__*/ new Set([fc,pc]);function yc(e,t){let n=_c(e);return vc.has(n)||(n=es),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function bc(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const xc=e=>e*180/Math.PI,Sc=e=>{let t=xc(Math.atan2(e[1],e[0]));return wc(t)},Cc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Sc,rotateZ:Sc,skewX:e=>xc(Math.atan(e[1])),skewY:e=>xc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},wc=e=>(e%=360,e<0&&(e+=360),e),Tc=Sc,Ec=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Dc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Oc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ec,scaleY:Dc,scale:e=>(Ec(e)+Dc(e))/2,rotateX:e=>wc(xc(Math.atan2(e[6],e[5]))),rotateY:e=>wc(xc(Math.atan2(-e[2],e[0]))),rotateZ:Tc,rotate:Tc,skewX:e=>xc(Math.atan(e[4])),skewY:e=>xc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function kc(e){return+!!e.includes(`scale`)}function Ac(e,t){if(!e||e===`none`)return kc(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Oc,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Cc,i=t}if(!i)return kc(t);let a=r[t],o=i[1].split(`,`).map(Mc);return typeof a==`function`?a(o):o[a]}const jc=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ac(n,t)};function Mc(e){return parseFloat(e.trim())}const Nc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Pc=/* @__PURE__ */ new Set([...Nc,`pathRotation`]),Fc=e=>e===vo||e===q,Ic=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Lc=Nc.filter(e=>!Ic.has(e));function Rc(e){let t=[];return Lc.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}const zc=/* @__PURE__ */ new Set([`bottom`,`right`]);function Bc(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}const Vc={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Bc(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Bc(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Ac(e,`x`),y:({transform:e})=>Ac(e,`y`)};Vc.translateX=Vc.x,Vc.translateY=Vc.y;const Hc=/* @__PURE__ */ new Set;let Uc=!1,Wc=!1,Gc=!1;function Kc(){if(Wc){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Hc.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),zc.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=Rc(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Wc=!1,Uc=!1,Hc.forEach(e=>e.complete(Gc)),Hc.clear()}function qc(){Hc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Wc=!0)})}function Jc(){Gc=!0,qc(),Kc(),Gc=!1}function Yc(e,t,n){if(typeof e==`string`){if(Ma(e)||Pa(e))return parseFloat(e);if(!es.test(e)&&es.test(n))return yc(t,n)}return e??void 0}var Xc=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Hc.add(this),Uc||(Uc=!0,Y.read(qc),Y.resolveKeyframes(Kc))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Yc(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}bc(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Hc.delete(this)}cancel(){this.state===`scheduled`&&(Hc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Zc=e=>e.startsWith(`--`);function Qc(e,t,n){Zc(t)?e.style.setProperty(t,n):e.style[t]=n}const $c={};function el(e,t){let n=/* @__PURE__ */ Fa(e);return()=>$c[t]??n()}const tl=/* @__PURE__ */ el(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),nl=/*@__PURE__*/ el(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),rl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,il={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ rl([0,.65,.55,1]),circOut:/*@__PURE__*/ rl([.55,0,1,.45]),backIn:/*@__PURE__*/ rl([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ rl([.33,1.53,.69,.99])};function al(e,t){if(e)return typeof e==`function`?nl()?Es(e,t):`ease-out`:/* @__PURE__ */ io(e)?rl(e):Array.isArray(e)?e.map(e=>al(e,t)||il.easeOut):il[e]}function ol(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=al(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function sl(e){return typeof e==`function`&&`applyToOptions`in e}function cl({type:e,...t}){return sl(e)&&nl()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var ll=class extends ac{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=cl(e);this.animation=ol(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Qs(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Qc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},rc(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ Va(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Va(e)}get time(){return/* @__PURE__ */ Va(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ Ba(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&tl()?(this.animation.timeline=e,t?.(this.animation),Ia):n(this)}};const ul={anticipate:Xa,backInOut:Ya,circInOut:$a};function dl(e){return e in ul}function fl(e){typeof e.ease==`string`&&dl(e.ease)&&(e.ease=ul[e.ease])}var pl=class extends ll{constructor(e){fl(e),ec(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(K.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new cc({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?Aa(0,10,a):0,s=this.sample(a);n&&r&&Qc(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}};const ml=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(es.test(e)||e===`0`)&&!e.startsWith(`url(`));function hl(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function gl(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ml(i,t),s=ml(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):hl(e)||(n===`spring`||sl(n))&&r}function _l(e){e.duration=0,e.type=`keyframes`}const vl=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),yl=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function bl(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&yl.test(e[t]))return!0;return!1}const xl=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Sl=/*@__PURE__*/ Fa(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Cl(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(vl.has(n)||xl.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Sl()&&(vl.has(n)||xl.has(n)&&bl(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}const wl=(e,t)=>t&&typeof e==`number`?t.transform(e):e,Tl={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},El=Nc.length;function Dl(e,t,n){let r=``,i=!0;for(let a=0;a<El;a++){let o=Nc[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=wl(s,hc[o]);if(!c){i=!1;let t=Tl[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${wl(a,hc.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}const Ol=/* @__PURE__ */ new WeakMap,kl=.001,Al=e=>/^(linear|ease(In|Out|InOut))$/.test(e),jl=(e,t)=>e-t,Ml=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(J(e,t,i/n));return r},Nl=e=>e.motionValue.owner,Pl=e=>Ol.get(e),Fl=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),Il=({name:e,motionValue:t})=>e&&Nc.includes(e)&&t?.owner?.current instanceof HTMLElement&&Sl()&&nl();function Ll(e){let t=Nl(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(Fl(t,`transform`)||`none`)===`none`&&!Fl(t,`pathRotation`)&&!t.projection?.isProjecting()}var Rl=class extends cc{constructor(e){let t=Nl(e).current,{driver:n=Ts}=e,r=Ll(e);e.driver=e=>{let r=n(e);return{js:r,now:r.now,start:(e=!0)=>{let n=Pl(t);!n||n.isJS?r.start(e):n.schedule(!1,!e)},stop:()=>{r.stop();let e=Pl(t);e?.schedule(!e.isFinishing)}}},super(e),this.canAccelerate=r;let{stop:i}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),i()}}get group(){return Pl(Nl(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(K.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=/* @__PURE__ */ io(n)?rl(n):Al(n)&&il[n];if(o&&!i&&!r&&e.length===2&&t===Js&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||Js)===Js?u||Gs(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=K.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||zl(Nl(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(K.now())}get time(){return this.isAccelerated()?/* @__PURE__ */ Va(Aa(0,this.totalDuration,this.at(K.now())-(this.options.delay||0))):super.time}set time(e){super.time=e}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function zl(e){let t=e.current,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Map,i={},a=[],o=/* @__PURE__ */ new Map,s=[],c=!1,l=!1,u=!1,d=-1/0,f=e=>{for(let t of n)if(t.name===e)return!0},p=(t,n)=>{let o={};for(let s of t===void 0?Nc:a){let a=r.get(s),c=t===void 0?Fl(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},m=(e,t)=>{let n=``,r=p(e,t);for(let e in r)n+=(Tl[e]||e)+`(`+wl(r[e],hc[e])+`) `;return n||`none`},h=(e=p())=>{t.style.transform=Dl(e,{})},g=(e=!0)=>{e&&h(),s.forEach(({animation:e})=>e.cancel()),s=[]},_=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=K.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),E.schedule(!1)}),e.oncancel=()=>s.includes(r)&&E.demote(),s.push(r)},v=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},y=(e,t,n,r)=>{let i=Math.min(200,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Ml(t,n,i).concat(r).sort(jl),o=e=>/* @__PURE__ */ Ra(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e[e.length-1]-n,i=e.map(e=>r?(e-n)/r:e-n);if(!r){if(i.some(e=>!(Math.abs(e)<=kl)))return}else if(!s)s=i,c=e=>(t.numberAt(e)-n)/r;else if(i.some((e,t)=>!(Math.abs(e-s[t])<=kl)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=kl))return`linear`;let l=[],u=(e,t=c(e))=>l.push(sc(t)+` `+sc(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&v(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},b=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?.001:.1))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...v(e=>r.numberAt(e),t,n));i.push(n)}},s=Ml(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(jl))e>c&&o(c,e,0),c=e;return i.sort(jl)},x=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},S=(e,n,r,i={fill:`both`},a,o)=>{let s=e.flatMap(e=>e.boundaries(n,r)),c=o||y(e,n,r,s),l=c?[n,r]:b(e,n,r,s),u=l.map(e=>m(e,a)),d={transform:u};return c||(d.offset=l.map(e=>/* @__PURE__ */ Ra(n,r,e))),u.every(e=>e===u[0])&&(h(p(n,a)),d=null),t.animate(d,{...i,duration:r-n,easing:c||`linear`})},C=c=>{let l=c,u=0,d=0,f=[],p=[],m=/* @__PURE__ */ new Set;r.clear(),o=/* @__PURE__ */ new Map;for(let e of n){r.set(e.name,e);let[t,n]=e.timing(),i=t===1/0;if(o.set(e,[e.at(c),e.speed,i]),i)e.sync();else{if(e.speed<0)return;if(n){if(u){let e=(t-d)/n;if(Math.abs(n-u)>1||Math.abs(e-Math.round(e))*u>1)return}else u=n,d=t;p.push(e)}else m.add(t);f.push(e),l=Math.max(l,t)}}i={},a=Nc.filter(t=>{if(r.has(t))return!0;let n=i[t]=Fl(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),g(!1);let h=!u&&x(f);try{if(h&&h[1]>c){let[e,t,n]=h;_(S(f,e,t,void 0,void 0,n),e-c,t-e)}else l>c&&(_(S(f,c,l),0,l-c),m.forEach(e=>e<l-1&&_(t.animate(null,{duration:e-c}),0,e-c)));if(u){let e=d+Math.floor((l-d)/u)*u;_(S(p,e,e+u,{iterations:1/0,iterationStart:(l-e)/u,fill:`forwards`},l),l-c)}}catch{return}return s.length||g(),!0},w=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r?(n.playbackRate=r,n.startTime=e-o/r):(n.pause(),n.currentTime=o)}return!0},T=()=>{let r=K.now();if(E.isJS||(E.isFinishing=!0,n.forEach(t=>{let[n,a]=t.timing();t.state===`running`&&t.speed>0&&!a&&n<=r+1&&(t.complete(),i[t.name]=Fl(e,t.name),o.has(t)||(c=!0))}),E.isFinishing=!1),l=!1,n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),!n.size){Ol.delete(t),E.isJS||g();return}for(let e of n)if(!e.canAccelerate)return E.demote(!0);E.isJS&&(E.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let a=c,s=u;if(c=u=!1,a||!w(r)){if(s){if(r-d<100)return E.demote();d=r}if(!C(r))return E.demote()}},E={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){c||=e,u||=!!t,l||(l=!0,G.isProcessing?Y.render(T,!1,!0):queueMicrotask(T))},check(){if(!E.isJS){for(let t in i)if(Fl(e,t)!==i[t]&&!f(t))return E.schedule(!0,!0)}},demote(e){E.isJS||(n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),E.isJS=!0,o=/* @__PURE__ */ new Map,g(),n.forEach(e=>e.state===`running`&&e.js?.start()))}};return Ol.set(t,E),E}var Bl=class extends ac{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=K.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Xc;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=K.now();let u=!0;gl(e,i,a,o)||(u=!1,(ja.instantAnimations||!s)&&l?.(Qs(e,n,t)),e[0]=e[e.length-1],_l(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&Cl(n),p=!f&&Il(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=tc(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new pl(n)}catch{m=new cc(n)}}else m=p?new Rl(n):new cc(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Jc()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Vl(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const Hl=e=>!isNaN(parseFloat(e)),Ul={current:void 0};var Wl=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=K.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=K.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Hl(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new za)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new za,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Y.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=/* @__PURE__ */ new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){Ul.current&&Ul.current.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=K.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return/* @__PURE__ */ Ha(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Gl(e,t){return new Wl(e,t)}function Kl(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function ql(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Kl(n,e)}const Jl={type:`spring`,stiffness:500,damping:25,restSpeed:10},Yl=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Xl={type:`keyframes`,duration:.8},Zl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Ql=(e,{keyframes:t})=>t.length>2?Xl:Pc.has(e)?e.startsWith(`scale`)?Yl(t[1]):Jl:Zl,$l=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function eu(e){for(let t in e)if(!$l.has(t))return!0;return!1}const tu=(e,t,n,r={},i,a)=>o=>{let s=ql(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ Ba(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};eu(s)||Object.assign(u,Ql(e,u)),u.duration&&=/* @__PURE__ */ Ba(u.duration),u.repeatDelay&&=/* @__PURE__ */ Ba(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(_l(u),u.delay===0&&(d=!0)),(ja.instantAnimations||ja.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,_l(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Qs(u.keyframes,s);if(e!==void 0){Y.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new cc(u):new Bl(u)},nu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ru(e){let t=nu.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function iu(e,t,n=1){`${e}`;let[r,i]=ru(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Ma(e)?parseFloat(e):e}return ho(i)?iu(i,t,n+1):i}function au(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function ou(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...au(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function su(e,t,n){return ou(e.getProps(),t,n,e)}const cu=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,lu=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Nc]),uu=e=>Array.isArray(e);function du(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Gl(n))}function fu(e){return uu(e)?e[e.length-1]||0:e}function pu(e,t){let{transitionEnd:n={},transition:r={},...i}=su(e,t)||{};i={...i,...n};for(let t in i)du(e,t,fu(i[t]))}const mu=e=>!!(e&&e.getVelocity);function hu(e){return!!(mu(e)&&e.add)}function gu(e,t){let n=e.getValue(`willChange`);if(hu(n))return n.add(t);if(!n&&ja.WillChange){let n=new ja.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function _u(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const vu=`data-`+_u(`framerAppearId`);function yu(e){return e.props[vu]}const bu=typeof window<`u`;function xu({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Su(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Kl(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&xu(f,t))continue;let o={delay:n,...ql(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Y.update(()=>r.set(i));continue}let p=!1;if(bu&&window.MotionHandoffAnimation){let n=yu(e);if(n){let e=window.MotionHandoffAnimation(n,t,Y);e!==null&&(o.startTime=e,p=!0)}}gu(e,t);let m=l??e.shouldReduceMotion;r.start(tu(t,r,i,m&&lu.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Y.update(()=>{o&&pu(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Cu(e,t,n={}){let r=su(e,t,cu(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Su(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Cu(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Vl(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function wu(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Cu(e,t,n))):typeof t==`string`?Cu(e,t,n):Promise.all(Su(e,su(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}const Tu={test:e=>e===`auto`,parse:e=>e},Eu=e=>t=>t.test(e),Du=[vo,q,No,Mo,Fo,Po,Tu],Ou=e=>Du.find(Eu(e));function ku(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Pa(e)}const Au=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function ju(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Au.has(t)&&Ko(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=yc(n,i))}var Mu=class extends Xc{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(_o(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),ho(r))){let i=iu(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!lu.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Ou(r),o=Ou(i);if(_o(r)!==_o(i)&&Vc[n])this.needsMeasurement=!0;else if(a!==o){if(Fc(a)&&Fc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Vc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||ku(e[t]))&&n.push(t);n.length&&ju(e,n,t)}measure(){let{element:e,name:t}=this;return Vc[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const Nu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Pu(e){return Na(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Fu(e){return Na(e)&&`ownerSVGElement`in e}function Iu(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function Lu(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Pc.has(e))o=!0;else if(po(e))i[e]=n;else{let t=wl(n,hc[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Dl(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const Ru={offset:`stroke-dashoffset`,array:`stroke-dasharray`},zu={offset:`strokeDashoffset`,array:`strokeDasharray`};function Bu(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Ru:zu;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Vu=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Hu(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Lu(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Vu)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Bu(d,i,a,o,!1)}function Uu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Wu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gu(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ku(e){return e===void 0||e===1}function qu({scale:e,scaleX:t,scaleY:n}){return!Ku(e)||!Ku(t)||!Ku(n)}function Ju(e){return qu(e)||Yu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yu(e){return Xu(e.x)||Xu(e.y)}function Xu(e){return e&&e!==`0%`}function Zu(e,t,n){return n+t*(e-n)}function Qu(e,t,n,r,i){return i!==void 0&&(e=Zu(e,i,r)),Zu(e,n,r)+t}function $u(e,t=0,n=1,r,i){e.min=Qu(e.min,t,n,r,i),e.max=Qu(e.max,t,n,r,i)}function ed(e,{x:t,y:n}){$u(e.x,t.translate,t.scale,t.originPoint),$u(e.y,n.translate,n.scale,n.originPoint)}const td=.999999999999,nd=1.0000000000001;function rd(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(id(e.x,-a.scroll.offset.x),id(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ed(e,o)),r&&Ju(a.latestValues)&&sd(e,a.latestValues,a.layout?.layoutBox))}t.x<nd&&t.x>td&&(t.x=1),t.y<nd&&t.y>td&&(t.y=1)}function id(e,t){e.min+=t,e.max+=t}function ad(e,t,n,r,i=.5){$u(e,t,n,J(e.min,e.max,i),r)}function od(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function sd(e,t,n){let r=n??e;ad(e.x,od(t.x,r.x),t.scaleX,t.scale,t.originX),ad(e.y,od(t.y,r.y),t.scaleY,t.scale,t.originY)}function cd(e,t){return Uu(Gu(e.getBoundingClientRect(),t))}function ld(e,t,n){let r=cd(e,n),{scroll:i}=t;return i&&(id(r.x,i.offset.x),id(r.y,i.offset.y)),r}const{schedule:ud,cancel:dd}=/* @__PURE__ */ Ss(queueMicrotask,!1),fd={x:!1,y:!1};function pd(){return fd.x||fd.y}function md(e){return e===`x`||e===`y`?fd[e]?null:(fd[e]=!0,()=>{fd[e]=!1}):fd.x||fd.y?null:(fd.x=fd.y=!0,()=>{fd.x=fd.y=!1})}function hd(e,t){let n=Iu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function gd(e){return!(e.pointerType===`touch`||pd())}function _d(e,t,n={}){let[r,i,a]=hd(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!gd(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const vd=(e,t)=>t?e===t||vd(e,t.parentElement):!1,yd=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,bd=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function xd(e){return bd.has(e.tagName)||e.isContentEditable===!0}const Sd=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Cd(e){return Sd.has(e.tagName)||e.isContentEditable===!0}const wd=/* @__PURE__ */ new WeakSet;function Td(e){return t=>{t.key===`Enter`&&e(t)}}function Ed(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Dd=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Td(()=>{if(wd.has(n))return;Ed(n,`down`);let e=Td(()=>{Ed(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Ed(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Od(e){return yd(e)&&!pd()}const kd=/* @__PURE__ */ new WeakSet;function Ad(e,t,n={}){let[r,i,a]=hd(e,n),o=e=>{let r=e.currentTarget;if(!Od(e)||kd.has(e))return;wd.add(r),n.stopPropagation&&kd.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),wd.has(r)&&wd.delete(r),Od(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||vd(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Pu(e)&&(e.addEventListener(`focus`,e=>Dd(e,i)),!xd(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}const jd=/* @__PURE__ */ new WeakMap;let Md;const Nd=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Fu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Pd=/*@__PURE__*/ Nd(`inline`,`width`,`offsetWidth`),Fd=/*@__PURE__*/ Nd(`block`,`height`,`offsetHeight`);function Id({target:e,borderBoxSize:t}){jd.get(e)?.forEach(n=>{n(e,{get width(){return Pd(e,t)},get height(){return Fd(e,t)}})})}function Ld(e){e.forEach(Id)}function Rd(){typeof ResizeObserver<`u`&&(Md=new ResizeObserver(Ld))}function zd(e,t){Md||Rd();let n=Iu(e);return n.forEach(e=>{let n=jd.get(e);n||(n=/* @__PURE__ */ new Set,jd.set(e,n)),n.add(t),Md?.observe(e)}),()=>{n.forEach(e=>{let n=jd.get(e);n?.delete(t),n?.size||Md?.unobserve(e)})}}const Bd=/* @__PURE__ */ new Set;let Vd;function Hd(){Vd=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Bd.forEach(t=>t(e))},window.addEventListener(`resize`,Vd)}function Ud(e){return Bd.add(e),Vd||Hd(),()=>{Bd.delete(e),!Bd.size&&typeof Vd==`function`&&(window.removeEventListener(`resize`,Vd),Vd=void 0)}}function Wd(e,t){return typeof e==`function`?Ud(e):zd(e,t)}const Gd={value:null,addProjectionMetrics:null};function Kd(e){return Fu(e)&&e.tagName===`svg`}const qd=e=>typeof e==`number`?e:parseFloat(e),Jd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yd=()=>({x:Jd(),y:Jd()}),Xd=()=>({min:0,max:0}),Zd=()=>({x:Xd(),y:Xd()}),Qd=/* @__PURE__ */ new WeakMap;function $d(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function ef(e){return typeof e==`string`||Array.isArray(e)}const tf=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],nf=[`initial`,...tf];function rf(e){if($d(e.animate))return!0;for(let t=0;t<nf.length;t++)if(ef(e[nf[t]]))return!0;return!1}function af(e){return!!(rf(e)||e.variants)}function of(e,t,n){for(let r in t){let i=t[r],a=n[r];if(mu(i))e.addValue(r,i);else if(mu(a))e.addValue(r,Gl(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Gl(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const sf={current:null},cf={current:!1},lf=typeof window<`u`;function uf(){if(cf.current=!0,lf){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>sf.current=e.matches;e.addEventListener(`change`,t),t()}else sf.current=!1}}const df=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let ff={};function pf(e){ff=e}function mf(){return ff}var hf=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Xc,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=K.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Y.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=rf(t),this.isVariantNode=af(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&mu(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,Qd.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(cf.current||uf(),this.shouldReduceMotion=sf.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Cs(this.notifyUpdate),Cs(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=/* @__PURE__ */ new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&vl.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new ll({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ Ba(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Pc.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Y.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Ol.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in ff){let t=ff[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Zd()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&Ol.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<df.length;t++){let n=df[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=of(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Gl(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Ma(n)||Pa(n))?n=parseFloat(n):typeof n!=`number`&&!es.test(n)&&es.test(t)&&(n=yc(e,t)),this.setBaseTarget(e,mu(n)?n.get():n)),mu(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new za),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){ud.render(this.render)}},gf=class extends hf{constructor(){super(...arguments),this.KeyframeResolver=Mu}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;mu(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},_f=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function vf(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}const yf={};function bf(e,{layout:t,layoutId:n}){return Pc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!yf[e]||e===`opacity`)}function xf(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(mu(r[t])||i&&mu(i[t])||bf(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Sf(e){return window.getComputedStyle(e)}var Cf=class extends gf{constructor(){super(...arguments),this.type=`html`,this.renderInstance=vf}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Pc.has(t))return this.projection?.isProjecting?kc(t):jc(e,t);{let n=Sf(e),r=(po(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return cd(e,t)}build(e,t,n){Lu(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return xf(e,t,n)}};const wf=/* @__PURE__ */ new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Tf=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Ef(e,t,n,r){vf(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(wf.has(n)?n:_u(n),t.attrs[n])}function Df(e,t,n){let r=xf(e,t,n);for(let n in e)if(mu(e[n])||mu(t[n])){let t=Nc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Of=class extends gf{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Zd}getBaseTargetFromProps(e,t){return Pc.has(t)?super.getBaseTargetFromProps(e,t)??kc(t):e[t]}getDefaultValue(e){return Pc.has(e)?this.latestValues[e]??kc(e):void 0}readValueFromInstance(e,t){if(Pc.has(t)){let e=_c(t);return e&&e.default||0}if(Vu.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=wf.has(t)?t:_u(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Df(e,t,n)}build(e,t,n){Hu(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ef(e,t,n,r)}mount(e){this.isSVGTag=Tf(e.tagName),super.mount(e)}};function kf(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Af=[...tf].reverse();function jf(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>wu(e,t,n))),n=Nf(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=/* @__PURE__ */ new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(Af.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?ef(g)||g===!1?g:void 0:h,v=ef(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||$d(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=Mf(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=su(e,n,cu(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!kf(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=su(s,n)?.transition?.delayChildren;r.delay=Vl(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&su(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!mu(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=Nf(),i=!0}}}function Mf(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!kf(t,e):!1}function Nf(){let e={};for(let t of tf)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function Pf(e,t){e.min=t.min,e.max=t.max}function Ff(e,t){Pf(e.x,t.x),Pf(e.y,t.y)}function If(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Lf(e){return e.max-e.min}function Rf(e,t,n){return Math.abs(e-t)<=n}function zf(e,t,n,r=.5){e.origin=r,e.originPoint=J(t.min,t.max,e.origin),e.scale=Lf(n)/Lf(t),e.translate=J(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Bf(e,t,n,r){zf(e.x,t.x,n.x,r?r.originX:void 0),zf(e.y,t.y,n.y,r?r.originY:void 0)}function Vf(e,t,n,r=0){e.min=(r?J(n.min,n.max,r):n.min)+t.min,e.max=e.min+Lf(t)}function Hf(e,t,n,r){Vf(e.x,t.x,n.x,r?.x),Vf(e.y,t.y,n.y,r?.y)}function Uf(e,t,n,r=0){let i=r?J(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Lf(t)}function Wf(e,t,n,r){Uf(e.x,t.x,n.x,r?.x),Uf(e.y,t.y,n.y,r?.y)}function Gf(e,t,n,r,i){return e-=t,e=Zu(e,1/n,r),i!==void 0&&(e=Zu(e,1/i,r)),e}function Kf(e,t=0,n=1,r=.5,i,a=e,o=e){if(No.test(t)&&(t=parseFloat(t),t=J(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=J(a.min,a.max,r);e===a&&(s-=t),e.min=Gf(e.min,t,n,s,i),e.max=Gf(e.max,t,n,s,i)}function qf(e,t,[n,r,i],a,o){Kf(e,t[n],t[r],t[i],t.scale,a,o)}const Jf=[`x`,`scaleX`,`originX`],Yf=[`y`,`scaleY`,`originY`];function Xf(e,t,n,r){qf(e.x,t,Jf,n?n.x:void 0,r?r.x:void 0),qf(e.y,t,Yf,n?n.y:void 0,r?r.y:void 0)}function Zf(e){return e.translate===0&&e.scale===1}function Qf(e){return Zf(e.x)&&Zf(e.y)}function $f(e,t){return e.min===t.min&&e.max===t.max}function ep(e,t){return $f(e.x,t.x)&&$f(e.y,t.y)}function tp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function np(e,t){return tp(e.x,t.x)&&tp(e.y,t.y)}function rp(e){return Lf(e.x)/Lf(e.y)}function ip(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ap(e){return[e(`x`),e(`y`)]}function op(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const sp={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(q.test(e))e=parseFloat(e);else return e}return`${op(e,t.target.x)}% ${op(e,t.target.y)}%`}},cp={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=es.parse(e);if(i.length>5)return r;let a=es.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=J(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function lp(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const up=Nu.length,dp=e=>typeof e==`number`||q.test(e);function fp(e,t,n,r,i,a){i?(e.opacity=J(0,n.opacity??1,mp(r)),e.opacityExit=J(t.opacity??1,0,hp(r))):a&&(e.opacity=J(t.opacity??1,n.opacity??1,r));for(let i=0;i<up;i++){let a=Nu[i],o=pp(t,a),s=pp(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||dp(o)===dp(s)?(e[a]=Math.max(J(qd(o),qd(s),r),0),(No.test(s)||No.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=J(t.rotate||0,n.rotate||0,r))}function pp(e,t){return e[t]===void 0?e.borderRadius:e[t]}const mp=/*@__PURE__*/ gp(0,.5,Qa),hp=/*@__PURE__*/ gp(.5,.95,Ia);function gp(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ Ra(e,t,r))}function _p(e,t,n){let r=mu(e)?e:Gl(e);return r.start(tu(``,r,t,n)),r.animation}function vp(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const yp=(e,t)=>e.depth-t.depth;var bp=class{constructor(){this.children=[],this.isDirty=!1}add(e){Oa(this.children,e),this.isDirty=!0}remove(e){ka(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(yp),this.isDirty=!1,this.children.forEach(e)}};function xp(e,t){let n=K.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Cs(r),e(a-t))};return Y.setup(r,!0),()=>Cs(r)}function Sp(e){return mu(e)?e.get():e}var Cp=class{constructor(){this.members=[]}add(e){Oa(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(ka(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(ka(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const wp={borderRadius:{...sp,applyTo:[...Nu]},borderTopLeftRadius:sp,borderTopRightRadius:sp,borderBottomLeftRadius:sp,borderBottomRightRadius:sp,boxShadow:cp},Tp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(yf,{...wp,...yf});const Ep={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Dp=[``,`X`,`Y`,`Z`];let Op=0;function kp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}const Ap=({instance:e})=>e&&Ol.get(e)?.demote();function jp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=yu(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Y,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&jp(r)}function Mp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Op++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=/* @__PURE__ */ new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Gd.value&&(Ep.nodes=Ep.calculatedTargetDeltas=Ep.calculatedProjections=0),this.nodes.forEach(Fp),this.nodes.forEach(Kp),this.nodes.forEach(qp),this.nodes.forEach(Ip),Gd.addProjectionMetrics&&Gd.addProjectionMetrics(Ep)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new bp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new za),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Fu(t)&&!Kd(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Y.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=xp(i,250),Tp.hasAnimatedSinceResize&&(Tp.hasAnimatedSinceResize=!1,this.nodes.forEach(Gp)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||em,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!np(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...ql(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Gp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Cs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Jp),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jp(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Ap(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,Ap(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(zp),this.nodes.forEach(Rp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Hp),this.nodes.forEach(Up),this.nodes.forEach(Wp),this.nodes.forEach(Np),this.nodes.forEach(Pp)):this.nodes.forEach(Bp),this.clearAllSnapshots();let e=K.now();G.delta=Aa(0,1e3/60,e-G.timestamp),G.timestamp=e,G.isProcessing=!0,ws.update.process(G),ws.preRender.process(G),ws.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ud.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lp),this.sharedNodes.forEach(Yp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Y.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Y.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Lf(this.snapshot.measuredBox.x)&&!Lf(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Zd(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&Ap(this);let t=this.projectionDelta&&!Qf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ju(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),im(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Zd();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(om))){let{scroll:e}=this.root;e&&(id(t.x,e.offset.x),id(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Zd();if(Ff(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Ff(t,e),id(t.x,i.offset.x),id(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Zd();Ff(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(id(r.x,-n.scroll.offset.x),id(r.y,-n.scroll.offset.y)),Ju(n.latestValues)&&sd(r,n.latestValues,n.layout?.layoutBox)}return Ju(this.latestValues)&&sd(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Zd();Ff(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ju(n.latestValues))continue;let r;n.instance&&(qu(n.latestValues)&&n.updateSnapshot(),r=Zd(),Ff(r,n.measurePageBox())),Xf(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ju(this.latestValues)&&Xf(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=G.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Zd(),this.targetWithTransforms=Zd()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Hf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ff(this.target,this.layout.layoutBox),ed(this.target,this.targetDelta)):Ff(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Gd.value&&Ep.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||qu(this.parent.latestValues)||Yu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Zd(),this.relativeTargetOrigin=Zd(),Wf(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Ff(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===G.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Ff(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;rd(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Zd());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(If(this.prevProjectionDelta.x,this.projectionDelta.x),If(this.prevProjectionDelta.y,this.projectionDelta.y)),Bf(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!ip(this.projectionDelta.x,this.prevProjectionDelta.x)||!ip(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Gd.value&&Ep.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Yd(),this.projectionDelta=Yd(),this.projectionDeltaWithTransform=Yd()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Yd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Zd(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some($p));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=J(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=J(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Xp(o.x,e.x,n),Xp(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Wf(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Qp(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&ep(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Zd(),Ff(f,this.relativeTarget)),c&&(this.animationValues=a,fp(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Cs(this.pendingAnimation),void 0),this.pendingAnimation=Y.update(()=>{Tp.hasAnimatedSinceResize=!0,this.motionValue||=Gl(0),this.motionValue.jump(0,!1),this.currentAnimation=_p(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),ic(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&am(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Zd();let t=Lf(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Lf(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Ff(t,i),sd(t,r),Bf(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Cp),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&kp(`z`,e,r,this.animationValues);for(let t=0;t<Dp.length;t++)kp(`rotate${Dp[t]}`,e,r,this.animationValues),kp(`skew${Dp[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Sp(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Sp(t?.pointerEvents)||``),this.hasProjected&&!Ju(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=lp(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in yf){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=yf[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Sp(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Rp),this.root.sharedNodes.clear()}}}function Np(e){e.updateLayout(),Vp(e)}function Pp(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)ap(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Lf(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Pf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else am(i,t.layoutBox,n)&&ap(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Lf(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Yd();Bf(o,n,t.layoutBox);let s=Yd();a?Bf(s,e.applyTransform(r,!0),t.measuredBox):Bf(s,n,t.layoutBox);let c=!Qf(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Zd();Wf(s,t.layoutBox,i.layoutBox,o);let c=Zd();Wf(c,n,a.layoutBox,o),np(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Fp(e){Gd.value&&Ep.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ip(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Lp(e){e.clearSnapshot()}function Rp(e){e.clearMeasurements()}function zp(e){e.isLayoutDirty=!0,e.updateLayout()}function Bp(e){e.isLayoutDirty=!1}function Vp(e){let{snapshot:t,dragAncestor:n}=e,r=n?.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;ap(e=>id(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Hp(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Up(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Wp(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Gp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Kp(e){e.resolveTargetDelta()}function qp(e){e.calcProjection()}function Jp(e){e.resetSkewAndRotation()}function Yp(e){e.removeLeadSnapshot()}function Xp(e,t,n){e.translate=J(t.translate,0,n),e.scale=J(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Zp(e,t,n,r){e.min=J(t.min,n.min,r),e.max=J(t.max,n.max,r)}function Qp(e,t,n,r){Zp(e.x,t.x,n.x,r),Zp(e.y,t.y,n.y,r)}function $p(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const em={duration:.45,ease:[.4,0,.1,1]},tm=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nm=tm(`applewebkit/`)&&!tm(`chrome/`)?Math.round:Ia;function rm(e){e.min=nm(e.min),e.max=nm(e.max)}function im(e){rm(e.x),rm(e.y)}function am(e,t,n){return e===`position`||e===`preserve-aspect`&&!Rf(rp(t),rp(n),.2)}function om(e){return e!==e.root&&e.scroll?.wasRoot}const sm=Mp({attachResizeListener:(e,t)=>vp(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),cm={current:void 0},lm=Mp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cm.current){let e=new sm({});e.mount(window),e.setOptions({layoutScroll:!0}),cm.current=e}return cm.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),um=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function dm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function fm(...e){return t=>{let n=!1,r=e.map(e=>{let r=dm(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():dm(e[t],null)}}}}function pm(...e){return a.useCallback(fm(...e),e)}var mm=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Pu(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Pu(e)&&e.offsetWidth||0,r=Pu(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function hm({children:e,isPresent:n,anchorX:r,anchorY:i,root:o,pop:s}){let c=v(),l=C(null),u=C({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=g(um),f=pm(l,s===!1?void 0:e.props?.ref??e?.ref);return b(()=>{let{width:e,height:t,top:a,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=r===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=i===`bottom`?`bottom: ${m}`:`top: ${a}`,y=l.current;y.dataset.motionPopId=c;let b=y.ownerDocument,x=b.createElement(`style`);d&&(x.nonce=d);let S=o??b.head;return S.appendChild(x),x.sheet&&x.sheet.insertRule(`
|
|
237
237
|
[data-motion-pop-id="${c}"] {
|
|
238
238
|
position: absolute !important;
|
|
239
239
|
width: ${e}px !important;
|
|
@@ -241,9 +241,9 @@ function Ua(e,t,n,r){if(e===t&&n===r)return Pa;let i=t=>Ha(t,0,1,e,n);return e=>
|
|
|
241
241
|
${_}px !important;
|
|
242
242
|
${v}px !important;
|
|
243
243
|
}
|
|
244
|
-
`),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[n]),t($p,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const tm=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=Ca(nm),p=v(),m=C(r),h=C(i);wa(()=>{m.current=r,h.current=i});let g=!0,_=S(()=>(g=!1,{id:p,initial:n,isPresent:r,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;i&&i()},register:e=>(f.set(e,!1),()=>{f.delete(e),!m.current&&!f.size&&h.current?.()})}),[r,f,i]);return s&&g&&(_={..._}),S(()=>{f.forEach((e,t)=>f.set(t,!1))},[r]),a.useEffect(()=>{!r&&!f.size&&i&&i()},[r]),e=t(em,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(Ta.Provider,{value:_,children:e})};function nm(){return/* @__PURE__ */ new Map}function rm(e=!0){let t=g(Ta);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=v();_(()=>{if(e)return i(a)},[e]);let o=h(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const im=e=>e.key||``;function am(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const om=({children:n,custom:r,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,anchorY:u=`top`,root:d})=>{let[f,p]=rm(c),m=S(()=>am(n),[n]),h=c&&!f?[]:m.map(im),_=C(!0),v=Ca(()=>/* @__PURE__ */ new Map),y=C(/* @__PURE__ */ new Set),[b,x]=w(m),[T,E]=w(m);wa(()=>{c&&!f&&!T.length&&p?.()},[f,c,T.length,p]),wa(()=>{_.current=!1;for(let e=0;e<T.length;e++){let t=im(T[e]);h.includes(t)?(v.delete(t),y.current.delete(t)):v.get(t)!==!0&&v.set(t,!1)}},[T,h.length,h.join(`-`)]);let D=[];if(m!==b){let e=[...m],t=0;for(let n of T){let r=h.indexOf(im(n));r===-1?(e.splice(t++,0,n),D.push(n)):t=r+D.length+1}return D.every(e=>v.get(im(e)))?e=m:s===`wait`&&(e=D),E(am(e)),x(m),null}let{forceRender:O}=g(Sa);return t(e,{children:T.map(e=>{let n=im(e),g=c&&!f?!1:m===T||h.includes(n);return t(tm,{isPresent:g,initial:!_.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:g?void 0:()=>{if(y.current.has(n))return;if(v.has(n))y.current.add(n),v.set(n,!0);else return;let e=!0;v.forEach(t=>{t||(e=!1)}),e&&(O?.(),x([]),c&&p?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},sm=d({strict:!1}),cm={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]};let lm=!1;function um(){if(lm)return;let e={};for(let t in cm)e[t]={isEnabled:e=>cm[t].some(t=>!!e[t])};$d(e),lm=!0}function dm(){return um(),ef()}function fm(e){let t=dm();for(let n in e)t[n]={...t[n],...e[n]};$d(t)}const pm=/* @__PURE__ */ d({});function mm(e,t){if(Wd(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Vd(t)?t:void 0,animate:Vd(n)?n:void 0}}return e.inherit===!1?{}:t}function hm(e){let{initial:t,animate:n}=mm(e,g(pm));return S(()=>({initial:t,animate:n}),[gm(t),gm(n)])}function gm(e){return Array.isArray(e)?e.join(` `):e}const _m=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function vm(e,t,n){for(let r in t)!Zl(t[r])&&!sf(r,n)&&(e[r]=t[r])}function ym({transformTemplate:e},t){return S(()=>{let n=_m();return wu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bm(e,t){let n=e.style||{},r={};return vm(r,n,e),Object.assign(r,ym(e,t)),r}function xm(e,t){let n={},r=bm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Sm=()=>({..._m(),attrs:{}});function Cm(e,t,n,r){let i=S(()=>{let n=Sm();return ku(n,t,ff(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};vm(t,e.style,e),i.style={...t,...i.style}}return i}const wm=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Tm(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||wm.has(e)}function Em(e,t){return e.startsWith(`on`)?!Tm(e):t?.(e)??!Tm(e)}function Dm(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Zl(e[a])||(Em(a,r)||n===!0&&Tm(a)||!t&&!Tm(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const Om=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function km(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Om.indexOf(e)>-1||/[A-Z]/u.test(e))}function Am(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??km(e)?Cm:xm)(t,r,i,e),u=Dm(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>Zl(p)?p.get():p,[p]);return f(e,{...d,children:m})}function jm({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Mm(n,r,i,e),renderState:t()}}function Mm(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=lp(a[e]);let{initial:o,animate:s}=e,c=Wd(e),l=Gd(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Bd(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Ul(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const Nm=e=>(t,n)=>{let r=g(pm),i=g(Ta),a=()=>jm(e,t,r,i);return n?a():Ca(a)},Pm=/*@__PURE__*/ Nm({scrapeMotionValuesFromProps:cf,createRenderState:_m}),Fm=/*@__PURE__*/ Nm({scrapeMotionValuesFromProps:mf,createRenderState:Sm}),Im=Symbol.for(`motionComponentSymbol`);function Lm(e,t,n){let r=C(n);b(()=>{r.current=n});let i=C(null);return h(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}const Rm=d({});function zm(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Bm(e,t,n,r,i,a){let{visualElement:o}=g(pm),s=g(sm),c=g(Ta),l=g(Yp),u=l.reducedMotion,d=l.skipAnimations,f=C(null),p=C(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=g(Rm);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Vm(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[tu],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return wa(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),wa(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),!1),m.enteringChildren=void 0)}),m}function Vm(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Hm(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&zm(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Hm(e){if(e)return e.options.allowProjection===!1?Hm(e.parent):e.projection}function Um(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&fm(a);let s=i?i===`svg`:km(e),c=s?Fm:Pm;function l(i,l){let u,d={...g(Yp),...i,layoutId:Wm(i)},{isStatic:f,isValidProp:p}=d,m=hm(i),h=c(i,f);if(!f&&typeof window<`u`){Gm(d,a);let t=Km(d);u=t.MeasureLayout,m.visualElement=Bm(e,h,d,o,t.ProjectionNode,s)}return n(pm.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,Am(e,i,Lm(h,m.visualElement,l),h,f,r,s,p)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=p(l);return u[Im]=e,u}function Wm({layoutId:e}){let t=g(Sa).id;return t&&e!==void 0?t+`-`+e:e}function Gm(e,t){g(sm).strict}function Km(e){let{drag:t,layout:n}=dm();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function qm(e,t){if(typeof Proxy>`u`)return Um;let n=/* @__PURE__ */ new Map,r=(n,r)=>Um(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Um(a,void 0,e,t)),n.get(a))})}const Jm=(e,t)=>t.isSVG??km(e)?new hf(t):new uf(t,{allowProjection:e!==l});var Ym=class extends rf{constructor(e){super(e),e.animationState||=vf(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Bd(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let Xm=0;const Zm={animation:{Feature:Ym},exit:{Feature:class extends rf{constructor(){super(...arguments),this.id=Xm++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Wl(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Qm(e){return{point:{x:e.pageX,y:e.pageY}}}const $m=e=>t=>od(t)&&e(t,Qm(t));function eh(e,t,n,r){return ap(e,t,$m(n),r)}const th=({current:e})=>e?e.ownerDocument.defaultView:null,nh=(e,t)=>Math.abs(e-t);function rh(e,t){let n=nh(e.x,t.x),r=nh(e.y,t.y);return Math.sqrt(n**2+r**2)}const ih=/*#__PURE__*/ new Set([`auto`,`scroll`]);var ah=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=oh(this.lastRawMoveEventInfo,this.transformPagePoint));let e=ch(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=rh(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:uo.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=oh(t,this.transformPagePoint),this.hasPendingMove=!0,Y.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=ch(e.type===`pointercancel`?this.lastMoveEventInfo:oh(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!od(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=oh(Qm(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=so;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,ch(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Fa(eh(this.contextWindow,`pointermove`,this.handlePointerMove,d),eh(this.contextWindow,`pointerup`,this.handlePointerUp,d),eh(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ih.has(e.overflowX)||ih.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Y.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ws(this.updatePoint)}};function oh(e,t){return t?{point:t(e.point)}:e}function sh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ch({point:e},t){return{point:e,delta:sh(e,uh(t)),offset:sh(e,lh(t)),velocity:dh(t,.1)}}function lh(e){return e[0]}function uh(e){return e[e.length-1]}function dh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=uh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ Ra(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ Ra(t)*2&&(r=e[1]);let a=/* @__PURE__ */ za(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function fh(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?J(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?J(n,e,r.max):Math.min(e,n)),e}function ph(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function mh(e,{top:t,left:n,bottom:r,right:i}){return{x:ph(e.x,n,i),y:ph(e.y,t,r)}}function hh(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function gh(e,t){return{x:hh(e.x,t.x),y:hh(e.y,t.y)}}function _h(e,t){let n=.5,r=wf(e),i=wf(t);return i>r?n=/* @__PURE__ */ Ia(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ Ia(e.min,e.max-i,t.min)),Oa(0,1,n)}function vh(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const yh=.35;function bh(e=yh){return e===!1?e=0:e===!0&&(e=yh),{x:xh(e,`left`,`right`),y:xh(e,`top`,`bottom`)}}function xh(e,t,n){return{min:Sh(e,t),max:Sh(e,n)}}function Sh(e,t){return typeof e==`number`?e:e[t]||0}const Ch=/* @__PURE__ */ new WeakMap;var wh=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Rd(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=td(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Kf(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Po.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=wf(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Y.update(()=>i(e,t),!1,!0),$l(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Oh(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Y.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new ah(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:th(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Y.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Dh(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=fh(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&zm(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?mh(n.layoutBox,e):!1,this.elastic=bh(t),r!==this.constraints&&!zm(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Kf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=vh(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!zm(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Xu(n,r.root,this.visualElement.getTransformPagePoint()),a=gh(r.layout.layoutBox,i);if(t){let e=t(ju(a));this.hasMutatedConstraints=!!e,e&&(a=Au(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Kf(o=>{if(!Dh(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return $l(this.visualElement,e),n.start(Rl(e,n,0,t,this.visualElement,!1))}stopAnimation(){Kf(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Kf(e=>{if(!Dh(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-J(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!zm(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Kf(e=>{let t=this.getAxisMotionValue(e).get();i[e]=_h({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Kf(t=>{let n=this.getAxisMotionValue(t);if(!Dh(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(J(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ch.set(this.visualElement,this);let e=this.visualElement.current,t=eh(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ud(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();zm(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Eh(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Y.read(r);let o=ap(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Kf(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=yh,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Th(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Eh(e,t,n){let r=jd(e,Th(n)),i=jd(t,Th(n));return()=>{r(),i()}}function Dh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Oh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var kh=class extends rf{constructor(e){super(e),this.removeGroupControls=Pa,this.removeListeners=Pa,this.controls=new wh(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Pa}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const Ah=e=>(t,n)=>{e&&Y.update(()=>e(t,n),!1,!0)};var jh=class extends rf{constructor(){super(...arguments),this.removePointerDownListener=Pa}onPointerDown(e){this.session=new ah(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:th(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ah(e),onStart:Ah(t),onMove:Ah(n),onEnd:(e,t)=>{delete this.session,r&&Y.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=eh(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};let Mh=!1;var Nh=class extends c{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Mh&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),fp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Mh=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Y.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Zu.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Mh=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Ph(e){let[n,r]=rm(),i=g(Sa);return t(Nh,{...e,layoutGroup:i,switchLayoutGroup:g(Rm),isPresent:n,safeToRemove:r})}const Fh={pan:{Feature:jh},drag:{Feature:kh,ProjectionNode:Jp,MeasureLayout:Ph}};function Ih(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Y.postRender(()=>i(t,Qm(t)))}var Lh=class extends rf{mount(){let{current:e}=this.node;e&&(this.unmount=id(e,(e,t)=>(Ih(this.node,t,`Start`),e=>Ih(this.node,e,`End`))))}unmount(){}},Rh=class extends rf{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Fa(ap(this.node.current,`focus`,()=>this.onFocus()),ap(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function zh(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Y.postRender(()=>i(t,Qm(t)))}var Bh=class extends rf{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=_d(e,(e,t)=>(zh(this.node,t,`Start`),(e,{success:t})=>zh(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const Vh=/* @__PURE__ */ new WeakMap,Hh=/* @__PURE__ */ new WeakMap,Uh=e=>{let t=Vh.get(e.target);t&&t(e)},Wh=e=>{e.forEach(Uh)};function Gh({root:e,...t}){let n=e||document;Hh.has(n)||Hh.set(n,{});let r=Hh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Wh,{root:e,...t})),r[i]}function Kh(e,t,n){let r=Gh(t);return Vh.set(e,n),r.observe(e),()=>{Vh.delete(e),r.unobserve(e)}}const qh={some:0,all:1};var Jh=class extends rf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:qh[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Kh(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Yh(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Yh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Xh={inView:{Feature:Jh},tap:{Feature:Bh},focus:{Feature:Rh},hover:{Feature:Lh}},Zh={layout:{ProjectionNode:Jp,MeasureLayout:Ph}},Qh=/*@__PURE__*/ qm({...Zm,...Xh,...Fh,...Zh},Jm);function $h({children:e,overlayContent:r,className:i=``,overlayClassName:a=``,position:o=`right`,width:s,height:c,showCloseButton:l=!0,onOpen:u,onClose:d,triggerClassName:f=``,backdropClassName:p=``,animationConfig:m={type:`spring`,stiffness:300,damping:30}}){let[h,g]=w(!1),_=()=>{g(!0),u?.()},v=()=>{g(!1),d?.()},y=eg(o),b=tg(o,s,c);return n(`div`,{className:`flex items-center justify-center w-full ${i}`,children:[t(K,{variant:`unstyled`,size:`none`,onClick:_,className:`w-full align-left cursor-pointer ${f}`,children:e}),h&&t(`div`,{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${p}`,children:n(Qh.div,{...y,transition:m,className:`${b} ${a}`,children:[l&&t(`div`,{className:`absolute top-2 end-2 z-10`,children:t(K,{onClick:v,variant:`primary`,children:t(St,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function eg(e){switch(e){case`left`:return{initial:{x:`-100%`},animate:{x:0},exit:{x:`-100%`}};case`right`:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}};case`top`:return{initial:{y:`-100%`},animate:{y:0},exit:{y:`-100%`}};case`bottom`:return{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`}};case`center`:return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}};default:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}}}}function tg(e,t,n){let r=`fixed bg-white shadow-lg p-4 relative`;switch(e){case`left`:return`${r} left-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`right`:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`top`:return`${r} top-[var(--header-height)] start-0 end-0 ${n||`h-80`}`;case`bottom`:return`${r} bottom-0 start-0 end-0 ${n||`h-80`}`;case`center`:return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||`w-96`} ${n||`max-h-96`}`;default:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`}}const ng=`--tailwind-portal`;function rg({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(ng);t||(t=e.createElement(`DIV`),t.id=ng,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function ig({path:e,maxItems:r=3,className:i,separator:o}){let s=e||[],c=e=>{let n=typeof e.label==`string`&&e.label.length>20?`${e.label.slice(0,17)}...`:e.label;return e.onClick?t(lg,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(lg,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(ug,{children:n})};if(s.length<=r)return t(ag,{className:H(`w-full flex items-center`,i),children:t(og,{children:s.map((e,r)=>n(a.Fragment,{children:[t(sg,{children:c(e)}),r<s.length-1&&t(dg,{children:o??t(Be,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(ag,{className:H(`w-full flex items-center`,i),children:n(og,{children:[t(sg,{children:t(fg,{})}),t(dg,{children:o??t(Be,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(sg,{children:c(e)}),r<l.length-1&&t(dg,{children:o??t(Be,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const ag=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));ag.displayName=`Breadcrumb`;const og=a.forwardRef(({className:e,...n},r)=>t(`ol`,{ref:r,className:H(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted sm:gap-2.5`,e),...n}));og.displayName=`BreadcrumbList`;const sg=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:H(`inline-flex items-center gap-1.5 text-muted`,e),...n}));sg.displayName=`BreadcrumbItem`;const cg=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:H(`transition-colors hover:text-muted`,n),...r}));cg.displayName=`BreadcrumbLink`;const lg=a.forwardRef(({className:e,href:n,onClick:r,...i},a)=>t(K,{variant:`ghost`,size:`md`,ref:a,className:H(`p-0! hover:underline! hover:bg-background!`,e),onClick:e=>{e.preventDefault(),r&&r(e)},...i}));lg.displayName=`BreadcrumbButton`;const ug=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:H(`font-normal text-foreground`,e),...n}));ug.displayName=`BreadcrumbPage`;const dg=({children:e,className:n,...r})=>t(`li`,{role:`presentation`,"aria-hidden":`true`,className:H(`[&>svg]:w-3.5 [&>svg]:h-3.5`,n),...r,children:e??t(Be,{className:`cn-rtl-flip`})});dg.displayName=`BreadcrumbSeparator`;const fg=({className:e,...r})=>n(`span`,{role:`presentation`,"aria-hidden":`true`,className:H(`flex h-9 w-9 items-center justify-center`,e),...r,children:[t(et,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});fg.displayName=`BreadcrumbEllipsis`;const pg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));pg.displayName=`Card`;const mg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`flex flex-col p-6`,e),...n}));mg.displayName=`CardHeader`;const hg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`font-semibold leading-none tracking-tight`,e),...n}));hg.displayName=`CardTitle`;const gg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`text-sm text-muted`,e),...n}));gg.displayName=`CardDescription`;const _g=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`p-6 pt-0`,e),...n}));_g.displayName=`CardContent`;const vg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`flex items-center p-6 pt-0`,e),...n}));vg.displayName=`CardFooter`;var yg=Object.defineProperty,bg=(e,t)=>yg(e,`name`,{value:t,configurable:!0}),xg=`Checkbox`,[Sg,Cg]=/* @__PURE__ */ Mn(xg),[wg,Tg]=Sg(xg);function Eg(e){let{__scopeCheckbox: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]=qr({prop:r,defaultProp:o??!1,onChange:u,caller:xg}),[g,_]=a.useState(null),[v,y]=a.useState(null),[b,x]=a.useState(null),S=!g||!!c||!!g.closest(`form`),C={checked:m,disabled:s,setChecked:h,control:g,setControl:_,name:l,form:c,value:f,userClick:b,onUserClick:x,required:d,defaultChecked:!Fg(o)&&o,isFormControl:S,bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(wg,{scope:n,...C,children:Pg(p)?p(C):i})}bg(Eg,`CheckboxProvider`);var Dg=`CheckboxTrigger`,Og=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bg(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...i},o){let{control:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,onUserClick:m,isFormControl:h,bubbleInput:g}=Tg(Dg,e),_=V(o,f),v=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=/* @__PURE__ */ bg(()=>p(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),/* @__PURE__ */ t(G.button,{type:`button`,role:`checkbox`,"aria-checked":Fg(u)?`mixed`:u,"aria-required":d,"data-state":Ig(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:_,onKeyDown:U(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:U(r,e=>{let t=e.isPropagationStopped();m({requestedChecked:Fg(u)?!0:!u,hasConsumerStoppedPropagation:t}),p(e=>Fg(e)?!0:!e),g&&h&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),kg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bg(function(r,i){let{__scopeCheckbox:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return/* @__PURE__ */ t(Eg,{__scopeCheckbox:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(Og,{...m,ref:i,__scopeCheckbox:a}),r&&/* @__PURE__ */ t(Ng,{__scopeCheckbox:a})]})})},`Checkbox`)),Ag=`CheckboxIndicator`,jg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bg(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=Tg(Ag,r);return/* @__PURE__ */ t(Nr,{present:i||Fg(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(G.span,{"data-state":Ig(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Mg=`CheckboxBubbleInput`,Ng=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bg(function({__scopeCheckbox:e,onClick:n,...r},i){let{control:o,userClick:s,checked:c,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:m,bubbleInput:h,setBubbleInput:g}=Tg(Mg,e),_=V(i,g),v=cr(o),y=a.useRef(!1),b=a.useRef(c),x=a.useRef(s),S=a.useRef(null);a.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=b.current!==c;b.current=c;let i=s!==null&&s!==x.current;if(x.current=s,i)S.current=r?null:s,r&&(e.indeterminate=Fg(c),n.call(e,!Fg(c)&&c)),e.dispatchEvent(new Event(`click`,{bubbles:!s.hasConsumerStoppedPropagation}));else if(r){let t=S.current;S.current=null;let r=t?.requestedChecked===c;y.current=!0,e.indeterminate=Fg(c),n.call(e,!Fg(c)&&c),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[h,c,s]);let C=a.useRef(!Fg(c)&&c);return/* @__PURE__ */ t(G.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??C.current,required:u,disabled:d,name:f,value:p,form:m,...r,tabIndex:-1,ref:_,onClick:U(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Pg(e){return typeof e==`function`}bg(Pg,`isFunction`);function Fg(e){return e===`indeterminate`}bg(Fg,`isIndeterminate`);function Ig(e){return Fg(e)?`indeterminate`:e?`checked`:`unchecked`}bg(Ig,`getState`);const Lg=a.forwardRef(({className:e,...n},r)=>t(kg,{ref:r,className:H(`peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white`,e),...n,children:t(jg,{className:H(`flex items-center justify-center text-current`),children:t(Ie,{className:`size-4`})})}));Lg.displayName=kg.displayName;var Rg=Object.defineProperty,zg=(e,t)=>Rg(e,`name`,{value:t,configurable:!0}),Bg=`Collapsible`,[Vg,Hg]=/* @__PURE__ */ Mn(Bg),[Ug,Wg]=Vg(Bg),Gg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ zg(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=qr({prop:i,defaultProp:o??!1,onChange:c,caller:Bg});return/* @__PURE__ */ t(Ug,{scope:r,disabled:s,contentId:W(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:/* @__PURE__ */ t(G.div,{"data-state":Zg(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),Kg=`CollapsibleTrigger`,qg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ zg(function(e,n){let{__scopeCollapsible:r,...i}=e,a=Wg(Kg,r);return/* @__PURE__ */ t(G.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":Zg(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:U(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),Jg=`CollapsibleContent`,Yg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ zg(function(e,n){let{forceMount:r,...i}=e,a=Wg(Jg,e.__scopeCollapsible);return/* @__PURE__ */ t(Nr,{present:r||a.open,children:({present:e})=>/* @__PURE__ */ t(Xg,{...i,ref:n,present:e})})},`CollapsibleContent`)),Xg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ zg(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=Wg(Jg,r),[l,u]=a.useState(i),d=a.useRef(null),f=V(n,d),p=a.useRef(0),m=p.current,h=a.useRef(0),g=h.current,_=c.open||l,v=a.useRef(_),y=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),Pn(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();p.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(i)}},[c.open,i]),/* @__PURE__ */ t(G.div,{"data-state":Zg(c.open),"data-disabled":c.disabled?``:void 0,id:c.contentId,hidden:!_,...s,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:_&&o})},`CollapsibleContentImpl`));function Zg(e){return e?`open`:`closed`}zg(Zg,`getState`);function Qg({...e}){return t(Gg,{"data-slot":`collapsible`,...e})}function $g({...e}){return t(qg,{"data-slot":`collapsible-trigger`,...e})}function e_({...e}){return t(Yg,{"data-slot":`collapsible-content`,...e})}var t_=1,n_=.9,r_=.8,i_=.17,a_=.1,o_=.999,s_=.9999,c_=.99,l_=/[\\\/_+.#"@\[\(\{&]/,u_=/[\\\/_+.#"@\[\(\{&]/g,d_=/[\s-]/,f_=/[\s-]/g;function p_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?t_:c_;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=p_(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=t_:l_.test(e.charAt(l-1))?(d*=r_,p=e.slice(i,l-1).match(u_),p&&i>0&&(d*=o_**+p.length)):d_.test(e.charAt(l-1))?(d*=n_,m=e.slice(i,l-1).match(f_),m&&i>0&&(d*=o_**+m.length)):(d*=i_,i>0&&(d*=o_**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=s_)),(d<a_&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=p_(e,t,n,r,l+1,a+2,o),f*a_>d&&(d=f*a_)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function m_(e){return e.toLowerCase().replace(f_,` `)}function h_(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,p_(e,t,m_(e),m_(t),0,0,{})}var g_=Object.defineProperty,__=(e,t)=>g_(e,`name`,{value:t,configurable:!0}),v_=`Dialog`,[y_,b_]=/* @__PURE__ */ Mn(v_),[x_,S_]=y_(v_),C_=/* @__PURE__ */ __(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=a.useRef(null),u=a.useRef(null),{nodes:d,registry:f}=L(),[p,m]=qr({prop:i,defaultProp:o??!1,onChange:s,caller:v_}),[h,g]=a.useState(0),[_,v]=a.useState(0);return/* @__PURE__ */ t(x_,{scope:n,triggerRef:l,contentRef:u,contentId:W(),titleId:W(),descriptionId:W(),titlePresent:h>0,descriptionPresent:_>0,setTitleCount:g,setDescriptionCount:v,open:p,onOpenChange:m,onOpenToggle:a.useCallback(()=>m(e=>!e),[m]),modal:c,branchNodes:d,branchRegistry:f,children:r})},`Dialog`),w_=`DialogTrigger`,T_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,a=S_(w_,r),o=V(n,a.triggerRef);return/* @__PURE__ */ t(G.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":W_(a.open),...i,ref:o,onClick:U(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),E_=`DialogPortal`,[D_,O_]=y_(E_,{forceMount:void 0}),k_=/* @__PURE__ */ __(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=S_(E_,n);return/* @__PURE__ */ t(D_,{scope:n,forceMount:r,children:a.Children.map(i,e=>/* @__PURE__ */ t(Nr,{present:r||s.open,children:/* @__PURE__ */ t(kr,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),A_=`DialogOverlay`,j_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let r=O_(A_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=S_(A_,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Nr,{present:i||o.open,children:/* @__PURE__ */ t(N_,{...a,ref:n})}):null},`DialogOverlay`)),M_=/* @__PURE__ */ on(`DialogOverlay.RemoveScroll`),N_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,o=S_(A_,r),s=V(n,N());return/* @__PURE__ */ t(ue,{as:M_,allowPinchZoom:!0,shards:a.useMemo(()=>[o.contentRef,...o.branchNodes.map(e=>({current:e}))],[o.contentRef,o.branchNodes]),children:/* @__PURE__ */ t(G.div,{"data-state":W_(o.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),P_=`DialogContent`,F_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let r=O_(P_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=S_(P_,e.__scopeDialog);return/* @__PURE__ */ t(Nr,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(I_,{...a,ref:n}):/* @__PURE__ */ t(L_,{...a,ref:n})})},`DialogContent`)),I_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let r=S_(P_,e.__scopeDialog),i=a.useRef(null),o=V(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(R_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),L_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let r=S_(P_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(R_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`DialogContentNonModal`)),R_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,"aria-describedby":s,children:c,...l}=e,u=S_(P_,r);return le(),/* @__PURE__ */ t(F,{registry:u.branchRegistry,children:/* @__PURE__ */ t(P,{asChild:!0,loop:!0,trapped:i,branches:u.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:o,children:/* @__PURE__ */ t(M,{role:`dialog`,id:u.contentId,"aria-labelledby":u.titlePresent?u.titleId:void 0,"aria-describedby":u.descriptionPresent?U_(s,u.descriptionId):s,"data-state":W_(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1),children:c})})})},`DialogContentImpl`)),z_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,a=S_(`DialogTitle`,r),{setTitleCount:o}=a;return Pn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(G.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),B_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,a=S_(`DialogDescription`,r),{setDescriptionCount:o}=a;return Pn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(G.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),V_=`DialogClose`,H_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,a=S_(V_,r);return/* @__PURE__ */ t(G.button,{type:`button`,...i,ref:n,onClick:U(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function U_(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}__(U_,`concatAriaDescribedby`);function W_(e){return e?`open`:`closed`}__(W_,`getState`);var G_=`[cmdk-group=""]`,K_=`[cmdk-group-items=""]`,q_=`[cmdk-group-heading=""]`,J_=`[cmdk-item=""]`,Y_=`${J_}:not([aria-disabled="true"])`,X_=`cmdk-item-select`,Z_=`data-value`,Q_=(e,t,n)=>h_(e,t,n),$_=a.createContext(void 0),ev=()=>a.useContext($_),tv=a.createContext(void 0),nv=()=>a.useContext(tv),rv=a.createContext(void 0),iv=a.forwardRef((e,t)=>{let n=vv(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=vv(()=>/* @__PURE__ */ new Set),i=vv(()=>/* @__PURE__ */ new Map),o=vv(()=>/* @__PURE__ */ new Map),s=vv(()=>/* @__PURE__ */ new Set),c=gv(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=W(),b=W(),x=W(),S=a.useRef(null),C=xv();_v(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),_v(()=>{C(6,A)},[]);let w=a.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),T=a.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{o.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=c.current?.filter??Q_;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(K_);t?t.appendChild(e.parentElement===t?e:e.closest(`${K_} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${K_} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${G_}[${Z_}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Z_);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(G_)?.querySelector(q_))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${J_}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(Y_)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(Z_))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(Z_))}function F(e){let t=j()?.closest(G_),n;for(;t&&!n;)t=e>0?mv(t,G_):hv(t,G_),n=t?.querySelector(Y_);n?w.setState(`value`,n.getAttribute(Z_)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return a.createElement(G.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:_&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(X_);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:wv},l),Cv(e,e=>a.createElement(tv.Provider,{value:w},a.createElement($_.Provider,{value:T},e))))}),av=a.forwardRef((e,t)=>{let n=W(),r=a.useRef(null),i=a.useContext(rv),o=ev(),s=gv(e),c=s.current?.forceMount??i?.forceMount;_v(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=bv(n,r,[e.value,e.children,r],e.keywords),u=nv(),d=yv(e=>e.value&&e.value===l.current),f=yv(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);a.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(X_,p),()=>t.removeEventListener(X_,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return a.createElement(G.div,{ref:nn(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),ov=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=W(),c=a.useRef(null),l=a.useRef(null),u=W(),d=ev(),f=yv(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));_v(()=>d.group(s),[]),bv(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(G.div,{ref:nn(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&a.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Cv(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(rv.Provider,{value:p},e))))}),sv=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=yv(e=>!e.search);return!n&&!o?null:a.createElement(G.div,{ref:nn(i,t),...r,"cmdk-separator":``,role:`separator`})}),cv=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=nv(),s=yv(e=>e.search),c=yv(e=>e.selectedItemId),l=ev();return a.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),a.createElement(G.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),lv=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=yv(e=>e.selectedItemId),l=ev();return a.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),a.createElement(G.div,{ref:nn(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Cv(e,e=>a.createElement(`div`,{ref:nn(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),uv=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(C_,{open:n,onOpenChange:r},a.createElement(k_,{container:s},a.createElement(j_,{"cmdk-overlay":``,className:i}),a.createElement(F_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(iv,{ref:t,...c}))))}),dv=a.forwardRef((e,t)=>yv(e=>e.filtered.count===0)?a.createElement(G.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),fv=a.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return a.createElement(G.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Cv(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),pv=Object.assign(iv,{List:lv,Item:av,Input:cv,Group:ov,Separator:sv,Dialog:uv,Empty:dv,Loading:fv});function mv(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function hv(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function gv(e){let t=a.useRef(e);return _v(()=>{t.current=e}),t}var _v=typeof window>`u`?a.useEffect:a.useLayoutEffect;function vv(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function yv(e){let t=nv(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function bv(e,t,n,r=[]){let i=a.useRef(),o=ev();return _v(()=>{var a;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());o.value(e,s,c),(a=t.current)==null||a.setAttribute(Z_,s),i.current=s}),i}var xv=()=>{let[e,t]=a.useState(),n=vv(()=>/* @__PURE__ */ new Map);return _v(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Sv(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Cv({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(Sv(t),{ref:t.ref},n(t.props.children)):n(t)}var wv={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Tv({children:e}){return t(`span`,{style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`},children:e})}const Ev=d(!1);function Dv(){return!!g(Ev)}function Ov({children:e}){return t(Ev.Provider,{value:!0,children:e})}function kv({className:e,children:r,isOpen:i,onClose:a,description:o=`Modal Description`,noCloseButton:s=!1,allowOverflow:c=!1,disableCloseOnClickOutside:l=!1,size:u=`md`,action:d}){let f=e=>{e||a()};function p(){switch(u){case`sm`:return`max-w-[20vw]`;case`md`:return`max-w-[60vw] lg:max-w-[40vw]`;case`lg`:return`max-w-[80vw] md:max-w-[60vw]`;case`xl`:return`max-w-[95vw] lg:max-w-[80vw]`;case`full`:return`h-[calc(100vh-2rem)] max-w-[calc(100vw-2rem)]`;default:return`max-w-[60vw] lg:max-w-[40vw]`}}return n(Nv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(Lv,{className:`z-50 fixed inset-0 bg-black/80`}),t(Tv,{children:t(zv,{children:o})}),n(Rv,{className:H(`min-h-20 p-4`,`fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg`,p(),e),children:[t(`div`,{className:`top-4 end-4 absolute`,children:n(`div`,{className:`flex gap-2`,children:[d&&d,!s&&t(Iv,{onClick:()=>f(!1),asChild:!0,autoFocus:!1,children:t(K,{variant:`outline`,title:`Close`,className:`data-[state=open]:bg-muted opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted transition-opacity disabled:pointer-events-none`,children:t(St,{className:`size-4`})})})]})}),t(Ov,{children:r})]})]})}const Av=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(Bv,{className:H(o?`border-b-solid border-b border-b-1 pb-2 mb-4`:``,`text-lg font-semibold leading-6 tracking-tight`,{"py-2":!a},i),...s,children:[e,a&&t(zv,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(Tv,{children:[t(Bv,{children:e}),a&&t(zv,{children:a})]}),jv=({children:e,className:n,...r})=>t(`div`,{className:H(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),Mv=({align:e=`right`,children:n,className:r,...i})=>t(`div`,{className:H(`w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end gap-2`,{left:`justify-start`,center:`justify-center`,right:`justify-end`}[e],r),...i,children:n}),Nv=C_,Pv=T_,Fv=k_,Iv=H_,Lv=a.forwardRef(({className:e,...n},r)=>t(j_,{ref:r,className:H(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));Lv.displayName=j_.displayName;const Rv=a.forwardRef(({className:e,children:r,...i},a)=>{let o=Ri();return n(Fv,{container:o,children:[t(Lv,{}),t(F_,{ref:a,className:H(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...i,children:r})]})});Rv.displayName=F_.displayName;const zv=a.forwardRef(({className:e,...n},r)=>t(B_,{ref:r,className:H(`text-sm text-muted`,e),...n}));zv.displayName=B_.displayName;const Bv=a.forwardRef(({className:e,...n},r)=>t(z_,{ref:r,className:H(`text-lg font-semibold leading-none tracking-tight`,e),...n}));Bv.displayName=z_.displayName;const Vv=a.forwardRef(({className:e,...n},r)=>t(pv,{ref:r,className:H(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));Vv.displayName=pv.displayName;const Hv=({children:e,...n})=>t(Nv,{...n,children:t(Rv,{className:`shadow-lg p-0 overflow-hidden`,children:t(Vv,{className:`[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:e})})}),Uv=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(mt,{className:`opacity-50 size-4 shrink-0`}),t(pv.Input,{ref:i,className:H(`focus:ring-0`,`border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted disabled:cursor-not-allowed disabled:opacity-50`,e),...r})]}));Uv.displayName=pv.Input.displayName;const Wv=a.forwardRef(({className:e,...n},r)=>t(pv.List,{ref:r,className:H(`overflow-y-auto overflow-x-hidden`,e),...n}));Wv.displayName=pv.List.displayName;const Gv=a.forwardRef((e,n)=>t(pv.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));Gv.displayName=pv.Empty.displayName;const Kv=a.forwardRef(({className:e,...n},r)=>t(pv.Group,{ref:r,className:H(`overflow-y-auto overflow-x-hidden p-1 text-foreground`,`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,e),...n}));Kv.displayName=pv.Group.displayName;const qv=a.forwardRef(({className:e,...n},r)=>t(pv.Separator,{ref:r,className:H(`-mx-1 h-px bg-border`,e),...n}));qv.displayName=pv.Separator.displayName;const Jv=a.forwardRef(({className:e,...n},r)=>t(pv.Item,{ref:r,className:H(`hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-muted data-[selected=true]:text-muted data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...n}));Jv.displayName=pv.Item.displayName;const Yv=({className:e,...n})=>t(`span`,{className:H(`ms-auto text-xs tracking-widest text-muted`,e),...n});Yv.displayName=`CommandShortcut`;var Xv=Object.defineProperty,Zv=(e,t)=>Xv(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
245
|
-
function
|
|
246
|
-
function iy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ Mn(n),[o,s]=r(n);o.displayName=e+`CollectionStableContextProvider`;let[c,l]=r(n);c.displayName=e+`CollectionStatefulContextProvider`;let u=/* @__PURE__ */ Zv(({state:e,...n})=>e?/* @__PURE__ */ t(f,{...n,state:e}):/* @__PURE__ */ t(d,{...n}),`CollectionProvider`);u.displayName=n;let d=/* @__PURE__ */ Zv(e=>{let n=y();return/* @__PURE__ */ t(f,{...e,state:n})},`CollectionInit`);d.displayName=e+`CollectionInit`;let f=/* @__PURE__ */ Zv(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[l,u]=a.useState(null),d=V(s,u),[f,p]=i,m=a.useRef(new ey),h=a.useCallback(()=>{let e=m.current;return sy(e)||e.sort(cy),e},[]);return a.useEffect(()=>{if(!l)return;let e=ly(()=>{p(e=>{let t=e.toSorted(cy);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(l,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[l,p]),/* @__PURE__ */ t(o,{scope:n,collectionElementRef:d,collectionElementRefObject:s,getCollection:h,setCollection:p,registryRef:m,children:/* @__PURE__ */ t(c,{scope:n,collectionElement:l,collection:f,children:r})})},`CollectionProviderImpl`);f.displayName=e+`CollectionProviderImpl`;let p=e+`CollectionSlot`,m=/* @__PURE__ */ on(p),h=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=V(n,s(p,r).collectionElementRef);return/* @__PURE__ */ t(m,{ref:a,children:i})});h.displayName=p;let g=e+`CollectionItemSlot`,_=/* @__PURE__ */ on(g),v=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),{setCollection:l,registryRef:u}=s(g,r),d=a.useRef(o);ay(d.current,o)||(d.current=o);let f=d.current,p=V(n,a.useCallback(e=>{let t=u.current;e?t.set(e,{...d.current,element:e}):c.current&&t.delete(c.current)},[u]),c);Pn(()=>{let e=c.current,t=u.current;e&&t.has(e)&&t.set(e,{...f,element:e})},[f,u]);let m=a.useRef(null);return a.useEffect(()=>{let e=c.current,t=m.current;((t?.element??null)!==e||e&&t?.itemData!==f)&&(m.current=e?{element:e,itemData:f}:null,l(n=>{let r=new ey(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...f,element:e}),r.sort(cy)}))}),a.useEffect(()=>()=>{let e=m.current;m.current=null,e&&l(t=>{if(!t.has(e.element))return t;let n=new ey(t);return n.delete(e.element),n})},[l]),/* @__PURE__ */ t(_,{"data-radix-collection-item":``,ref:p,children:i})});v.displayName=g;function y(){return a.useState(new ey)}Zv(y,`useInitCollection`);function b(t){let{collection:n}=l(e+`CollectionConsumer`,t);return n}Zv(b,`useCollection`);function x(t){let{getCollection:n}=s(e+`CollectionConsumer`,t);return n}return Zv(x,`useGetCollection`),[{Provider:u,Slot:h,ItemSlot:v},{createCollectionScope:i,useCollection:b,useGetCollection:x,useInitCollection:y}]}Zv(iy,`createCollection`);function ay(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Zv(ay,`shallowEqual`);function oy(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Zv(oy,`isElementPreceding`);function sy(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Zv(sy,`isInDocumentOrder`);function cy(e,t){return!e[1].element||!t[1].element?0:oy(e[1].element,t[1].element)?-1:1}Zv(cy,`sortByDocumentPosition`);function ly(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Zv(ly,`getChildListObserver`);var uy=Object.defineProperty,dy=(e,t)=>uy(e,`name`,{value:t,configurable:!0}),fy=!1;function py(){let[e,t]=a.useState(fy);return a.useEffect(()=>{fy||(fy=!0,t(!0))},[]),e}dy(py,`useIsHydrated`);var my=a.useSyncExternalStore;function hy(){return()=>{}}dy(hy,`subscribe`);function gy(){return my(hy,()=>!0,()=>!1)}dy(gy,`useIsHydratedModern`);var _y=typeof my==`function`?gy:py,vy=Object.defineProperty,yy=(e,t)=>vy(e,`name`,{value:t,configurable:!0}),by=`rovingFocusGroup.onEntryFocus`,xy={bubbles:!1,cancelable:!0},Sy=`RovingFocusGroup`,[Cy,wy,Ty]=/* @__PURE__ */ Qv(Sy),[Ey,Dy]=/* @__PURE__ */ Mn(Sy,[Ty]),Oy={Vertical:`vertical`,Horizontal:`horizontal`},ky={LTR:`ltr`,RTL:`rtl`},[Ay,jy]=Ey(Sy),My=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yy(function(e,n){return/* @__PURE__ */ t(Cy.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Cy.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ny,{...e,ref:n})})})},`RovingFocusGroup`)),Ny=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yy(function(e,n){let{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=a.useRef(null),h=V(n,m),g=fe(s),[_,v]=qr({prop:c,defaultProp:l??null,onChange:u,caller:Sy}),[y,b]=a.useState(!1),x=ar(d),S=wy(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(by,x),()=>e.removeEventListener(by,x)},[x]),/* @__PURE__ */ t(Ay,{scope:r,orientation:i,dir:g,loop:o,currentTabStopId:_,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>T(e=>e-1),[]),children:/* @__PURE__ */ t(G.div,{tabIndex:y||w===0?-1:0,"data-orientation":i,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:U(e.onMouseDown,()=>{C.current=!0}),onFocus:U(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(by,xy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);zy([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}C.current=!1}),onBlur:U(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Py=`RovingFocusGroupItem`,Fy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yy(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=W(),d=s||u,f=jy(Py,r),p=f.currentTabStopId===d,m=wy(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=_y();return Pn(()=>{if(v&&i)return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!v&&i)return h(),()=>g()},[v,i,h,g]),/* @__PURE__ */ t(Cy.ItemSlot,{scope:r,id:d,focusable:i,active:o,children:/* @__PURE__ */ t(G.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:U(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:U(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:U(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ry(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?By(n,r+1):n.slice(r+1)}setTimeout(()=>zy(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})},`RovingFocusGroupItem`)),Iy={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ly(e,t){return t===ky.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}yy(Ly,`getDirectionAwareKey`);function Ry(e,t,n){let r=Ly(e.key,n);if(!(t===Oy.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Oy.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Iy[r]}yy(Ry,`getFocusIntent`);function zy(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}yy(zy,`focusFirst`);function By(e,t){return e.map((n,r)=>e[(t+r)%e.length])}yy(By,`wrapArray`);var Vy=Object.defineProperty,X=(e,t)=>Vy(e,`name`,{value:t,configurable:!0}),Hy={LTR:`ltr`,RTL:`rtl`},Uy=[`Enter`,` `],Wy=[`ArrowDown`,`PageUp`,`Home`],Gy=[`ArrowUp`,`PageDown`,`End`],Ky=[...Wy,...Gy],qy={ltr:[...Uy,`ArrowRight`],rtl:[...Uy,`ArrowLeft`]},Jy={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Yy=`Menu`,[Xy,Zy,Qy]=/* @__PURE__ */ Qv(Yy),[$y,eb]=/* @__PURE__ */ Mn(Yy,[Qy,hr,Dy]),tb=hr(),nb=Dy(),[rb,ib]=$y(Yy),[ab,ob]=$y(Yy),sb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=tb(n),[u,d]=a.useState(null),f=a.useRef(!1),p=ar(s),m=fe(o);return a.useEffect(()=>{let e=/* @__PURE__ */ X(()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ X(()=>f.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),a.useEffect(()=>{if(!r)return;let e=/* @__PURE__ */ X(()=>p(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[r,p]),/* @__PURE__ */ t(vr,{...l,children:/* @__PURE__ */ t(rb,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:/* @__PURE__ */ t(ab,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),cb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e,a=tb(r);return/* @__PURE__ */ t(br,{...a,...i,ref:n})},`MenuAnchor`)),lb=`MenuPortal`,[ub,db]=$y(lb,{forceMount:void 0}),fb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=ib(lb,n);return/* @__PURE__ */ t(ub,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Nr,{present:r||o.open,children:/* @__PURE__ */ t(kr,{asChild:!0,container:a,children:i})})})},`MenuPortal`),pb=`MenuContent`,[mb,hb]=$y(pb),gb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=db(pb,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=ib(pb,e.__scopeMenu),s=ob(pb,e.__scopeMenu);return/* @__PURE__ */ t(Xy.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Nr,{present:i||o.open,children:/* @__PURE__ */ t(Xy.Slot,{scope:e.__scopeMenu,children:s.modal?/* @__PURE__ */ t(_b,{...a,ref:n}):/* @__PURE__ */ t(vb,{...a,ref:n})})})})},`MenuContent`)),_b=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ib(pb,e.__scopeMenu),i=a.useRef(null),o=V(n,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(bb,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentModal`)),vb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ib(pb,e.__scopeMenu);return/* @__PURE__ */ t(bb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),yb=/* @__PURE__ */ on(`MenuContent.ScrollLock`),bb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=ib(pb,r),y=ob(pb,r),b=tb(r),x=nb(r),S=Zy(r),[C,w]=a.useState(null),T=a.useRef(null),[E,D]=a.useState(null);I(E);let{nodes:O,registry:k}=L(),A=!!(o||g),j=V(n,T,v.onContentChange,D),N=a.useRef(0),R=a.useRef(``),ee=a.useRef(0),te=a.useRef(null),ne=a.useRef(`right`),re=a.useRef(0),ie=a.useMemo(()=>g?[T,...O.map(e=>({current:e}))]:[],[T,O,g]),ae=g?ue:a.Fragment,oe=g?{as:yb,allowPinchZoom:!0,shards:ie}:void 0,se=/* @__PURE__ */ X(e=>{let t=R.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Zb(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){R.current=e,window.clearTimeout(N.current),e!==``&&(N.current=window.setTimeout(()=>s(``),1e3))}X(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);a.useEffect(()=>()=>window.clearTimeout(N.current),[]),le();let ce=a.useCallback(e=>ne.current===te.current?.side&&$b(e,te.current?.area),[]);return/* @__PURE__ */ t(mb,{scope:r,searchRef:R,onItemEnter:a.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),onItemLeave:a.useCallback(e=>{ce(e)||(T.current?.focus(),w(null))},[ce]),onTriggerLeave:a.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:a.useCallback(e=>{te.current=e},[]),children:/* @__PURE__ */ t(F,{registry:A?k:null,children:/* @__PURE__ */ t(ae,{...oe,children:/* @__PURE__ */ t(P,{asChild:!0,trapped:o,branches:O,onMountAutoFocus:U(s,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:/* @__PURE__ */ t(My,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:U(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ t(wr,{role:`menu`,"aria-orientation":`vertical`,"data-state":Kb(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:j,style:{outline:`none`,..._.style},onKeyDown:U(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&se(e.key));let i=T.current;if(e.target!==i||!Ky.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Gy.includes(e.key)&&a.reverse(),Yb(a)}),onBlur:U(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),R.current=``)}),onPointerMove:U(e.onPointerMove,ex(e=>{let t=e.target,n=re.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>re.current?`right`:`left`;ne.current=t,re.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),xb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(G.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Sb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(G.div,{...i,ref:n})},`MenuLabel`)),Cb=`MenuItem`,wb=`menu.itemSelect`,Tb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=ob(Cb,e.__scopeMenu),l=hb(Cb,e.__scopeMenu),u=V(n,s),d=a.useRef(!1),f=/* @__PURE__ */ X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(wb,{bubbles:!0,cancelable:!0});e.addEventListener(wb,e=>i?.(e),{once:!0}),tr(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return/* @__PURE__ */ t(Eb,{...o,ref:u,disabled:r,onClick:U(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:U(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:U(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(l.searchRef.current===``||e.key!==` `)&&Uy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Eb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=hb(Cb,r),l=nb(r),u=a.useRef(null),d=V(n,u),[f,p]=a.useState(!1),[m,h]=a.useState(``);return a.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[s.children]),/* @__PURE__ */ t(Xy.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:/* @__PURE__ */ t(Fy,{asChild:!0,...l,focusable:!i,children:/* @__PURE__ */ t(G.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...s,ref:d,onPointerMove:U(e.onPointerMove,ex(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,ex(e=>c.onItemLeave(e))),onFocus:U(e.onFocus,()=>p(!0)),onBlur:U(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Db=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return/* @__PURE__ */ t(Pb,{scope:e.__scopeMenu,checked:r,children:/* @__PURE__ */ t(Tb,{role:`menuitemcheckbox`,"aria-checked":qb(r)?`mixed`:r,...a,ref:n,"data-state":Jb(r),onSelect:U(a.onSelect,()=>i?.(qb(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Ob,kb]=$y(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ X(()=>{},`onValueChange`)}),Ab=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=ar(i);return/* @__PURE__ */ t(Ob,{scope:e.__scopeMenu,value:r,onValueChange:o,children:/* @__PURE__ */ t(xb,{...a,ref:n})})},`MenuRadioGroup`)),jb=`MenuRadioItem`,Mb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,...i}=e,a=kb(jb,e.__scopeMenu),o=r===a.value;return/* @__PURE__ */ t(Pb,{scope:e.__scopeMenu,checked:o,children:/* @__PURE__ */ t(Tb,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":Jb(o),onSelect:U(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Nb=`MenuItemIndicator`,[Pb,Fb]=$y(Nb,{checked:!1}),Ib=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=Fb(Nb,r);return/* @__PURE__ */ t(Nr,{present:i||qb(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(G.span,{...a,ref:n,"data-state":Jb(o.checked)})})},`MenuItemIndicator`)),Lb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(G.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),Rb=`MenuSub`,[zb,Bb]=$y(Rb),Vb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=ib(Rb,n),c=tb(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=ar(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),/* @__PURE__ */ t(vr,{...c,children:/* @__PURE__ */ t(rb,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:/* @__PURE__ */ t(zb,{scope:n,contentId:W(),triggerId:W(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),Hb=`MenuSubTrigger`,Ub=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ib(Hb,e.__scopeMenu),i=ob(Hb,e.__scopeMenu),o=Bb(Hb,e.__scopeMenu),s=hb(Hb,e.__scopeMenu),c=a.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);a.useEffect(()=>f,[f]),a.useEffect(()=>{let e=l.current;return()=>{window.clearTimeout(e),u(null)}},[l,u]);let p=V(n,o.onTriggerChange);return/* @__PURE__ */ t(cb,{asChild:!0,...d,children:/* @__PURE__ */ t(Eb,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":Kb(r.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,ex(t=>{s.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:U(e.onPointerLeave,ex(e=>{f();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,i=n===`right`,a=i?-5:5,o=t[i?`left`:`right`],c=t[i?`right`:`left`];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:o,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:U(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(s.searchRef.current===``||t.key!==` `)&&qy[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Wb=`MenuSubContent`,Gb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=db(pb,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=ib(pb,e.__scopeMenu),l=ob(pb,e.__scopeMenu),u=Bb(Wb,e.__scopeMenu),d=a.useRef(null),f=V(n,d);return/* @__PURE__ */ t(Xy.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Nr,{present:i||c.open,children:/* @__PURE__ */ t(Xy.Slot,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(bb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:l.dir===Hy.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:U(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Jy[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function Kb(e){return e?`open`:`closed`}X(Kb,`getOpenState`);function qb(e){return e===`indeterminate`}X(qb,`isIndeterminate`);function Jb(e){return qb(e)?`indeterminate`:e?`checked`:`unchecked`}X(Jb,`getCheckedState`);function Yb(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(Yb,`focusFirst`);function Xb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Xb,`wrapArray`);function Zb(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Xb(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(Zb,`getNextMatch`);function Qb(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X(Qb,`isPointInPolygon`);function $b(e,t){return t?Qb({x:e.clientX,y:e.clientY},t):!1}X($b,`isPointerInGraceArea`);function ex(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(ex,`whenMouse`);var tx=Object.defineProperty,nx=(e,t)=>tx(e,`name`,{value:t,configurable:!0}),rx=`DropdownMenu`,[ix,ax]=/* @__PURE__ */ Mn(rx,[eb]),ox=eb(),[sx,cx]=ix(rx),lx=/* @__PURE__ */ nx(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=ox(n),d=a.useRef(null),[f,p]=qr({prop:o,defaultProp:s??!1,onChange:c,caller:rx});return/* @__PURE__ */ t(sx,{scope:n,triggerId:W(),triggerRef:d,contentId:W(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:/* @__PURE__ */ t(sb,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),ux=`DropdownMenuTrigger`,dx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=cx(ux,r),s=ox(r),c=V(n,o.triggerRef);return/* @__PURE__ */ t(cb,{asChild:!0,...s,children:/* @__PURE__ */ t(G.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:U(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:U(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),fx=/* @__PURE__ */ nx(e=>{let{__scopeDropdownMenu:n,...r}=e,i=ox(n);return/* @__PURE__ */ t(fb,{...i,...r})},`DropdownMenuPortal`),px=`DropdownMenuContent`,mx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=cx(px,r),s=ox(r),c=a.useRef(!1);return/* @__PURE__ */ t(gb,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:n,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{c.current||o.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:U(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!o.modal||r)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),hx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(xb,{...a,...i,ref:n})},`DropdownMenuGroup`)),gx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Sb,{...a,...i,ref:n})},`DropdownMenuLabel`)),_x=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Tb,{...a,...i,ref:n})},`DropdownMenuItem`)),vx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Db,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),yx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Ab,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),bx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Mb,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),xx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Ib,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),Sx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Lb,{...a,...i,ref:n})},`DropdownMenuSeparator`)),Cx=/* @__PURE__ */ nx(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=ox(n),[c,l]=qr({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return/* @__PURE__ */ t(Vb,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),wx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Ub,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),Tx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Gb,{...a,...i,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`));const Ex=a.createContext(!1);function Dx({...e}){return t(lx,{"data-slot":`dropdown-menu`,...e})}function Ox({...e}){return t(fx,{"data-slot":`dropdown-menu-portal`,...e})}function kx({...e}){return t(dx,{"data-slot":`dropdown-menu-trigger`,...e})}function Ax({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(fx,{children:t(mx,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:n,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden`,e),...i})})}function jx({...e}){return t(hx,{"data-slot":`dropdown-menu-group`,...e})}function Mx({className:e,inset:n,variant:r=`default`,...i}){return t(_x,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:H(`hover:bg-muted focus:bg-muted data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i})}function Nx({className:e,children:r,checked:i,inset:a,...o}){return n(vx,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:H(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:i,...o,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:t(xx,{children:t(Ie,{})})}),r]})}function Px({...e}){return t(yx,{"data-slot":`dropdown-menu-radio-group`,...e})}function Fx({className:e,children:r,inset:i,...a}){return n(bx,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:H(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-radio-item-indicator`,children:t(xx,{children:t(Ie,{})})}),r]})}function Ix({className:e,inset:n,...r}){return t(gx,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:H(`text-muted px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function Lx({className:e,...n}){return t(Sx,{"data-slot":`dropdown-menu-separator`,className:H(`bg-border -mx-1 my-1 h-px`,e),...n})}function Rx({className:e,...n}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:H(`text-muted group-focus/dropdown-menu-item:text-muted ms-auto text-xs tracking-widest`,e),...n})}function zx({...e}){return t(Cx,{"data-slot":`dropdown-menu-sub`,...e})}function Bx({className:e,inset:r,children:i,...a}){return n(wx,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":r,className:H(`focus:bg-muted focus:text-muted data-open:bg-muted data-open:text-muted not-data-[variant=destructive]:focus:**:text-muted gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,t(Be,{className:`cn-rtl-flip ms-auto`})]})}function Vx({className:e,...n}){return t(Tx,{"data-slot":`dropdown-menu-sub-content`,className:H(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden`,e),...n})}const Hx={left:`start`,center:`center`,right:`end`};function Ux({trigger:e,children:r,align:i=`right`,hover:o}){let[s,c]=a.useState(!1),l=a.useRef(null);return o?n(`div`,{className:`relative inline-flex`,onMouseEnter:()=>{l.current&&clearTimeout(l.current),c(!0)},onMouseLeave:()=>{l.current=setTimeout(()=>c(!1),80)},children:[e,s&&t(`div`,{className:H(`absolute top-full pt-1 z-50`,i===`right`?`end-0`:i===`center`?`left-1/2 -translate-x-1/2`:`start-0`),children:t(`div`,{className:`min-w-32 rounded-lg p-1 shadow-md ring-1 ring-foreground/10 bg-popover text-popover-foreground`,children:t(Ex.Provider,{value:!0,children:r})})})]}):n(Dx,{children:[t(kx,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(Ax,{align:Hx[i],className:`w-max`,children:r})]})}function Wx({children:e,label:r}){return n(jx,{children:[r&&t(Ix,{children:r}),e]})}function Gx({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(Ex),l=H(`w-full gap-2 rounded-md px-1.5 py-1 text-sm text-nowrap [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,o===`destructive`?`text-destructive`:``,i?`pointer-events-none opacity-50`:`hover:bg-muted focus:bg-muted`,s);return c?n?t(`a`,{href:n,className:l,children:e}):t(`button`,{type:`button`,className:l,disabled:i,onClick:e=>{e.stopPropagation(),r?.(e)},children:e}):t(Mx,{className:H(`data-[disabled]:pointer-events-none data-[disabled]:opacity-50 text-nowrap`,s),disabled:i,variant:o,onClick:e=>{e.stopPropagation(),r?.(e)},asChild:!!n,children:n?t(`a`,{href:n,children:e}):e})}const Kx=({children:e,className:n})=>{let r=C(null),[i,a]=w(`auto`);return _(()=>{if(r.current){let e=new ResizeObserver(e=>{let t=e[0].contentRect.height;a(t)});return e.observe(r.current),()=>{e.disconnect()}}},[]),t(`div`,{className:H(n,`overflow-hidden transition-all duration-100 ease-in`),style:{height:i},children:t(`div`,{ref:r,children:e})})},qx=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);(Jx(i,a)||!r)&&Object.defineProperty(e,n,a)},Jx=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Yx=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Xx=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Zx=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),Qx=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),$x=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=Xx.bind(null,r,t.toString());Object.defineProperty(i,"name",Qx);let{writable:a,enumerable:o,configurable:s}=Zx;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function eS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))qx(e,t,r,n);return Yx(e,t),$x(e,t,r),e}const tS=2147483647,nS=/* @__PURE__ */ new WeakMap,rS=/* @__PURE__ */ new WeakMap,iS=/* @__PURE__ */ new WeakMap;function aS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now()){e.delete(t);return}return n}}function oS(e,{cacheKey:t,cache:n=/* @__PURE__ */ new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>tS)throw TypeError(`The \`maxAge\` option cannot exceed ${tS}.`);if(r<0)throw TypeError("The `maxAge` option should not be a negative number.")}let i=function(...a){let o=t?t(a):a[0],s=aS(n,o);if(s)return s.data;let c=e.apply(this,a),l=typeof r==`function`?r(...a):r;if(l!==void 0&&l!==1/0){if(!Number.isFinite(l))throw TypeError("The `maxAge` function must return a finite number, `0`, or `Infinity`.");if(l<=0)return c;if(l>tS)throw TypeError(`The \`maxAge\` function result cannot exceed ${tS}.`)}if(n.set(o,{data:c,maxAge:l===void 0||l===1/0?1/0:Date.now()+l}),l!==void 0&&l!==1/0){let e=setTimeout(()=>{n.delete(o),rS.get(i)?.delete(e)},l);e.unref?.();let t=rS.get(i)??/* @__PURE__ */ new Set;t.add(e),rS.set(i,t)}return c};return eS(i,e,{ignoreNonConfigurable:!0}),nS.set(i,n),iS.set(i,t??(e=>e[0])),i}function sS(e){return typeof e==`string`}function cS(e,t,n){return n.indexOf(e)===t}function lS(e){return e.toLowerCase()===e}function uS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function dS(e){if(!e)return e;if(e===`C`||e===`posix`||e===`POSIX`)return`en-US`;if(e.indexOf(`.`)!==-1){var t=e.split(`.`)[0],n=t===void 0?``:t;return dS(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return dS(n)}if(e.indexOf(`-`)===-1||!lS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function fS(e){var t=e===void 0?{}:e,n=t.useFallbackLocale,r=n===void 0||n,i=t.fallbackLocale,a=i===void 0?`en-US`:i,o=[];if(typeof navigator<`u`){for(var s=navigator.languages||[],c=[],l=0,u=s;l<u.length;l++){var d=u[l];c=c.concat(uS(d))}var f=navigator.language,p=f&&uS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(sS).map(dS).filter(cS)}var pS=oS(fS,{cacheKey:JSON.stringify});function mS(e){return pS(e)[0]||null}var hS=oS(mS,{cacheKey:JSON.stringify});const gS=/* @__PURE__ */ new Map;function _S(e){return function(t,n){let r=t||hS();gS.has(r)||gS.set(r,/* @__PURE__ */ new Map);let i=gS.get(r);if(!i.has(e)){let t=new Intl.DateTimeFormat(r||void 0,e);i.set(e,t.format.bind(t))}return i.get(e)(n)}}function vS(e){let t=new Date(e);return new Date(t.setHours(12))}function yS(e){return(t,n)=>_S(e)(t,vS(n))}const bS={day:`numeric`},xS={day:`numeric`,month:`long`,year:`numeric`},SS={month:`long`},CS={month:`long`,year:`numeric`},wS={weekday:`short`},TS={weekday:`long`},ES={year:`numeric`},DS=yS(bS),OS=yS(xS),kS=yS(SS),AS=yS(CS),jS=yS(wS),MS=yS(TS),NS=yS(ES);function PS(e,t,n){return function(r,i=n){return t(e(r)+i)}}function FS(e){return function(t){return/* @__PURE__ */ new Date(e(t).getTime()-1)}}function IS(e,t){return function(n){return[e(n),t(n)]}}function Z(e){if(e instanceof Date)return e.getFullYear();if(typeof e==`number`)return e;let t=Number.parseInt(e,10);if(typeof e==`string`&&!Number.isNaN(t))return t;throw Error(`Failed to get year from date: ${e}.`)}function LS(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function RS(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function zS(e){let t=Z(e),n=t+(-t+1)%100,r=/* @__PURE__ */ new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const BS=PS(Z,zS,-100),VS=PS(Z,zS,100),HS=FS(VS),US=PS(Z,HS,-100),WS=IS(zS,HS);function GS(e){let t=Z(e),n=t+(-t+1)%10,r=/* @__PURE__ */ new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const KS=PS(Z,GS,-10),qS=PS(Z,GS,10),JS=FS(qS),YS=PS(Z,JS,-10),XS=IS(GS,JS);function ZS(e){let t=Z(e),n=/* @__PURE__ */ new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const QS=PS(Z,ZS,-1),$S=PS(Z,ZS,1),eC=FS($S),tC=PS(Z,eC,-1),nC=IS(ZS,eC);function rC(e,t){return function(n,r=t){let i=Z(n),a=LS(n)+r,o=/* @__PURE__ */ new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function iC(e){let t=Z(e),n=LS(e),r=/* @__PURE__ */ new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const aC=rC(iC,-1),oC=rC(iC,1),sC=FS(oC),cC=rC(sC,-1),lC=IS(iC,sC);function uC(e,t){return function(n,r=t){let i=Z(n),a=LS(n),o=RS(n)+r,s=/* @__PURE__ */ new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function dC(e){let t=Z(e),n=LS(e),r=RS(e),i=/* @__PURE__ */ new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const fC=FS(uC(dC,1)),pC=IS(dC,fC);function mC(e){return RS(sC(e))}const hC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},gC={gregory:[`en-CA`,`en-US`,`es-AR`,`es-BO`,`es-CL`,`es-CO`,`es-CR`,`es-DO`,`es-EC`,`es-GT`,`es-HN`,`es-MX`,`es-NI`,`es-PA`,`es-PE`,`es-PR`,`es-SV`,`es-VE`,`pt-BR`],hebrew:[`he`,`he-IL`],islamic:[`ar`,`ar-AE`,`ar-BH`,`ar-DZ`,`ar-EG`,`ar-IQ`,`ar-JO`,`ar-KW`,`ar-LY`,`ar-OM`,`ar-QA`,`ar-SA`,`ar-SD`,`ar-SY`,`ar-YE`,`dv`,`dv-MV`,`ps`,`ps-AR`]},_C=[0,1,2,3,4,5,6],vC=_C[0],yC=_C[5],bC=_C[6];function xC(e,t=hC.ISO_8601){let n=e.getDay();switch(t){case hC.ISO_8601:return(n+6)%7;case hC.ISLAMIC:return(n+1)%7;case hC.HEBREW:case hC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function SC(e){return Z(zS(e))}function CC(e){return Z(GS(e))}function wC(e,t=hC.ISO_8601){let n=Z(e),r=LS(e),i=e.getDate()-xC(e,t);return new Date(n,r,i)}function TC(e,t=hC.ISO_8601){let n=t===hC.GREGORY?hC.GREGORY:hC.ISO_8601,r=wC(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===hC.ISO_8601?4:1),o=wC(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function EC(e,t){switch(e){case`century`:return zS(t);case`decade`:return GS(t);case`year`:return ZS(t);case`month`:return iC(t);case`day`:return dC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function DC(e,t){switch(e){case`century`:return BS(t);case`decade`:return KS(t);case`year`:return QS(t);case`month`:return aC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function OC(e,t){switch(e){case`century`:return VS(t);case`decade`:return qS(t);case`year`:return $S(t);case`month`:return oC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function kC(e,t){switch(e){case`decade`:return KS(t,-100);case`year`:return QS(t,-10);case`month`:return aC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function AC(e,t){switch(e){case`decade`:return qS(t,100);case`year`:return $S(t,10);case`month`:return oC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function jC(e,t){switch(e){case`century`:return HS(t);case`decade`:return JS(t);case`year`:return eC(t);case`month`:return sC(t);case`day`:return fC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function MC(e,t){switch(e){case`century`:return US(t);case`decade`:return YS(t);case`year`:return tC(t);case`month`:return cC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function NC(e,t){switch(e){case`decade`:return YS(t,-100);case`year`:return tC(t,-10);case`month`:return cC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function PC(e,t){switch(e){case`century`:return WS(t);case`decade`:return XS(t);case`year`:return nC(t);case`month`:return lC(t);case`day`:return pC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function FC(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[EC(e,r[0]),jC(e,r[1])]}function IC(e,t,n){return n.map(n=>(t||NS)(e,n)).join(` – `)}function LC(e,t,n){return IC(e,t,WS(n))}function RC(e,t,n){return IC(e,t,XS(n))}function zC(e){return e.getDay()===(/* @__PURE__ */ new Date()).getDay()}function BC(e,t=hC.ISO_8601){let n=e.getDay();switch(t){case hC.ISLAMIC:case hC.HEBREW:return n===yC||n===bC;case hC.ISO_8601:case hC.GREGORY:return n===bC||n===vC;default:throw Error(`Unsupported calendar type.`)}}const VC=`react-calendar__navigation`;function HC({activeStartDate:r,drillUp:i,formatMonthYear:a=AS,formatYear:o=NS,locale:s,maxDate:c,minDate:l,navigationAriaLabel:u=``,navigationAriaLive:d,navigationLabel:f,next2AriaLabel:p=``,next2Label:m=`»`,nextAriaLabel:h=``,nextLabel:g=`›`,prev2AriaLabel:_=``,prev2Label:v=`«`,prevAriaLabel:y=``,prevLabel:b=`‹`,setActiveStartDate:x,showDoubleView:S,view:C,views:w}){let T=w.indexOf(C)>0,E=C!==`century`,D=DC(C,r),O=E?kC(C,r):void 0,k=OC(C,r),A=E?AC(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=MC(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=NC(C,r);return l&&l>=e})(),N=c&&c<k,P=E&&c&&c<A;function F(){x(D,`prev`)}function I(){x(O,`prev2`)}function L(){x(k,`next`)}function R(){x(A,`next2`)}function ee(e){let t=(()=>{switch(C){case`century`:return LC(s,o,e);case`decade`:return RC(s,o,e);case`year`:return o(s,e);case`month`:return a(s,e);default:throw Error(`Invalid view: ${C}.`)}})();return f?f({date:e,label:t,locale:s||hS()||void 0,view:C}):t}function te(){let a=`${VC}__label`;return n(`button`,{"aria-label":u,"aria-live":d,className:a,disabled:!T,onClick:i,style:{flexGrow:1},type:`button`,children:[t(`span`,{className:`${a}__labelText ${a}__labelText--from`,children:ee(r)}),S?n(e,{children:[t(`span`,{className:`${a}__divider`,children:` – `}),t(`span`,{className:`${a}__labelText ${a}__labelText--to`,children:ee(k)})]}):null]})}return n(`div`,{className:VC,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${VC}__arrow ${VC}__prev2-button`,disabled:M,onClick:I,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${VC}__arrow ${VC}__prev-button`,disabled:j,onClick:F,type:`button`,children:b}),te(),g!==null&&t(`button`,{"aria-label":h,className:`${VC}__arrow ${VC}__next-button`,disabled:N,onClick:L,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${VC}__arrow ${VC}__next2-button`,disabled:P,onClick:R,type:`button`,children:m}):null]})}function UC(e){return`${e}%`}function WC({children:e,className:n,count:r,direction:i,offset:a,style:o,wrap:c,...l}){return t(`div`,{className:n,style:{display:`flex`,flexDirection:i,flexWrap:c?`wrap`:`nowrap`,...o},...l,children:s.map(e,(e,t)=>{let n=a&&t===0?UC(100*a/r):null;return u(e,{...e.props,style:{flexBasis:UC(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function GC(e,t,n){return t&&t>e?t:n&&n<e?n:e}function KC(e,t){return t[0]<=e&&t[1]>=e}function qC(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function JC(e,t){return KC(e[0],t)||KC(e[1],t)}function YC(e,t,n){let r=JC(t,e),i=[];if(r){i.push(n);let r=KC(e[0],t),a=KC(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function XC(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function ZC(e){if(!e)throw Error(`args is required`);let{value:t,date:n,hover:r}=e,i=`react-calendar__tile`,a=[i];if(!n)return a;let o=/* @__PURE__ */ new Date,s=(()=>{if(Array.isArray(n))return n;let{dateType:t}=e;if(!t)throw Error(`dateType is required when date is not an array of two dates`);return PC(t,n)})();if(KC(o,s)&&a.push(`${i}--now`),!t||!XC(t))return a;let c=(()=>{if(Array.isArray(t))return t;let{valueType:n}=e;if(!n)throw Error(`valueType is required when value is not an array of two dates`);return PC(n,t)})();qC(c,s)?a.push(`${i}--active`):JC(c,s)&&a.push(`${i}--hasActive`);let l=YC(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=YC(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function QC({className:e,count:n=3,dateTransform:r,dateType:i,end:a,hover:o,offset:s,renderTile:c,start:l,step:u=1,value:d,valueType:f}){let p=[];for(let e=l;e<=a;e+=u){let t=r(e);p.push(c({classes:ZC({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(WC,{className:e,count:n,offset:s,wrap:!0,children:p})}function $C(e){let{activeStartDate:i,children:a,classes:o,date:s,formatAbbr:c,locale:l,maxDate:u,maxDateTransform:d,minDate:f,minDateTransform:p,onClick:m,onMouseOver:h,style:g,tileClassName:_,tileContent:v,tileDisabled:y,view:b}=e,x=S(()=>typeof _==`function`?_({activeStartDate:i,date:s,view:b}):_,[i,s,_,b]),C=S(()=>typeof v==`function`?v({activeStartDate:i,date:s,view:b}):v,[i,s,v,b]);return n(`button`,{className:r(o,x),disabled:f&&p(f)>s||u&&d(u)<s||y?.({activeStartDate:i,date:s,view:b}),onClick:m?e=>m(s,e):void 0,onFocus:h?()=>h(s):void 0,onMouseOver:h?()=>h(s):void 0,style:g,type:`button`,children:[c?t(`abbr`,{"aria-label":c(l,s),children:a}):a,C]})}const ew=`react-calendar__century-view__decades__decade`;function tw({classes:e=[],currentCentury:n,formatYear:r=NS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(ew),zS(a).getFullYear()!==n&&s.push(`${ew}--neighboringCentury`),t($C,{...i,classes:s,maxDateTransform:JS,minDateTransform:GS,view:`century`,children:RC(o,r,a)})}function nw(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=SC(n),l=c+(i?119:99);return t(QC,{className:`react-calendar__century-view__decades`,dateTransform:GS,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(tw,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function rw(e){function n(){return t(nw,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const iw=`react-calendar__decade-view__years__year`;function aw({classes:e=[],currentDecade:n,formatYear:r=NS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(iw),GS(a).getFullYear()!==n&&s.push(`${iw}--neighboringDecade`),t($C,{...i,classes:s,maxDateTransform:eC,minDateTransform:ZS,view:`decade`,children:r(o,a)})}function ow(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=CC(n),l=c+(i?11:9);return t(QC,{className:`react-calendar__decade-view__years`,dateTransform:ZS,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(aw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function sw(e){function n(){return t(ow,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const cw=`react-calendar__month-view__days__day`;function lw({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=DS,formatLongDate:a=OS,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(cw),BC(s,e)&&l.push(`${cw}--weekend`),s.getMonth()!==r&&l.push(`${cw}--neighboringMonth`),t($C,{...o,classes:l,formatAbbr:a,maxDateTransform:fC,minDateTransform:dC,view:`month`,children:i(c,s)})}function uw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=LS(n),f=a||o,p=xC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=mC(n);if(o){let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-xC(t,r)-1)}return e})();return t(QC,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),dC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(lw,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const dw=`react-calendar__month-view__weekdays`,fw=`${dw}__weekday`;function pw(e){let{calendarType:n,formatShortWeekday:i=jS,formatWeekday:a=MS,locale:o,onMouseLeave:s}=e,c=iC(/* @__PURE__ */ new Date),l=Z(c),u=LS(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-xC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(fw,zC(s)&&`${fw}--current`,BC(s,n)&&`${fw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(WC,{className:dw,count:7,onFocus:s,onMouseOver:s,children:d})}const mw=`react-calendar__tile`;function hw(e){let{onClickWeekNumber:n,weekNumber:r}=e,i=t(`span`,{children:r});if(n){let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`button`,{...o,className:mw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:mw,children:i})}}function gw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=mC(n)-(7-xC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=LS(n),i=RS(n),a=[];for(let n=0;n<s;n+=1)a.push(wC(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>TC(e,r));return t(WC,{className:`react-calendar__month-view__weekNumbers`,count:s,direction:`column`,onFocus:a,onMouseOver:a,style:{flexBasis:`calc(100% * (1 / 8)`,flexShrink:0},children:l.map((e,n)=>{let r=c[n];if(!r)throw Error(`date is not defined`);return t(hw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function _w(e){if(e){for(let[t,n]of Object.entries(gC))if(n.includes(e))return t}return hC.ISO_8601}function vw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=_w(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(pw,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(gw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(uw,{calendarType:c,...p})}let _=`react-calendar__month-view`;return t(`div`,{className:r(_,f?`${_}--weekNumbers`:``),children:n(`div`,{style:{display:`flex`,alignItems:`flex-end`},children:[h(),n(`div`,{style:{flexGrow:1,width:`100%`},children:[m(),g()]})]})})}function yw({classes:e=[],formatMonth:n=kS,formatMonthYear:r=AS,...i}){let{date:a,locale:o}=i;return t($C,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:sC,minDateTransform:iC,view:`year`,children:n(o,a)})}function bw(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(QC,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(s,e,1),iC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(yw,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function xw(e){function n(){return t(bw,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const Sw=`react-calendar`,Cw=[`century`,`decade`,`year`,`month`],ww=[`decade`,`year`,`month`,`day`],Tw=/* @__PURE__ */ new Date;Tw.setFullYear(1,0,1),Tw.setHours(0,0,0,0);const Ew=/* @__PURE__ */ new Date(864e13);function Dw(e){return e instanceof Date?e:new Date(e)}function Ow(e,t){return Cw.slice(Cw.indexOf(e),Cw.indexOf(t)+1)}function kw(e,t,n){return Ow(t,n).indexOf(e)!==-1}function Aw(e,t,n){return e&&kw(e,t,n)?e:n}function jw(e){let t=Cw.indexOf(e);return ww[t]}function Mw(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=Dw(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function Nw({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=Mw(e,i);if(!a)return null;let o=jw(r);return GC((()=>{switch(i){case 0:return EC(o,a);case 1:return jC(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const Pw=e=>Nw(e,0),Fw=e=>Nw(e,1),Iw=e=>[Pw,Fw].map(t=>t(e));function Lw({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return EC(Aw(a,r,t),Pw({value:i,minDate:n,maxDate:e,maxDetail:t})||/* @__PURE__ */ new Date)}function Rw({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=Aw(l,s,a),d=e||t;return d?EC(u,d):Lw({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function zw(e){return e&&(!Array.isArray(e)||e.length===1)}function Bw(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var Vw=p(function(e,i){let{activeStartDate:a,allowPartialRange:o,calendarType:s,className:c,"data-testid":l,defaultActiveStartDate:u,defaultValue:d,defaultView:f,formatDay:p,formatLongDate:m,formatMonth:g,formatMonthYear:_,formatShortWeekday:v,formatWeekday:b,formatYear:x,goToRangeStartOnSelect:S=!0,inputRef:C,locale:T,maxDate:E=Ew,maxDetail:D=`month`,minDate:O=Tw,minDetail:k=`century`,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:F,nextLabel:I,onActiveStartDateChange:L,onChange:R,onClickDay:ee,onClickDecade:te,onClickMonth:ne,onClickWeekNumber:re,onClickYear:ie,onDrillDown:ae,onDrillUp:oe,onViewChange:se,prev2AriaLabel:ce,prev2Label:le,prevAriaLabel:ue,prevLabel:de,returnValue:fe=`start`,selectRange:pe,showDoubleView:me,showFixedNumberOfWeeks:he,showNavigation:ge=!0,showNeighboringCentury:_e,showNeighboringDecade:ve,showNeighboringMonth:ye=!0,showWeekNumbers:be,tileClassName:xe,tileContent:Se,tileDisabled:Ce,value:we,view:Te}=e,[Ee,De]=w(u),[Oe,ke]=w(null),[Ae,je]=w(Array.isArray(d)?d.map(e=>e===null?null:Dw(e)):d==null?null:Dw(d)),[Me,Ne]=w(f),Pe=a||Ee||Rw({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:we,view:Te}),Fe=(()=>{let e=pe&&zw(Ae)||we===void 0?Ae:we;return e?Array.isArray(e)?e.map(e=>e===null?null:Dw(e)):e===null?null:Dw(e):null})(),z=jw(D),B=Aw(Te||Me,k,D),Ie=Ow(k,D),Le=pe?Oe:null,Re=Ie.indexOf(B)<Ie.length-1,ze=Ie.indexOf(B)>0,Be=h(e=>(()=>{switch(fe){case`start`:return Pw;case`end`:return Fw;case`range`:return Iw;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,fe]),Ve=h((e,t)=>{De(e);let n={action:t,activeStartDate:e,value:Fe,view:B};L&&!Bw(Pe,e)&&L(n)},[Pe,L,Fe,B]),He=h((e,t)=>{let n=(()=>{switch(B){case`century`:return te;case`decade`:return ie;case`year`:return ne;case`month`:return ee;default:throw Error(`Invalid view: ${B}.`)}})();n&&n(e,t)},[ee,te,ne,ie,B]),Ue=h((e,t)=>{if(!Re)return;He(e,t);let n=Ie[Ie.indexOf(B)+1];if(!n)throw Error(`Attempted to drill down from the lowest view.`);De(e),Ne(n);let r={action:`drillDown`,activeStartDate:e,value:Fe,view:n};L&&!Bw(Pe,e)&&L(r),se&&B!==n&&se(r),ae&&ae(r)},[Pe,Re,L,He,ae,se,Fe,B,Ie]),We=h(()=>{if(!ze)return;let e=Ie[Ie.indexOf(B)-1];if(!e)throw Error(`Attempted to drill up from the highest view.`);let t=EC(e,Pe);De(t),Ne(e);let n={action:`drillUp`,activeStartDate:t,value:Fe,view:e};L&&!Bw(Pe,t)&&L(n),se&&B!==e&&se(n),oe&&oe(n)},[Pe,ze,L,oe,se,Fe,B,Ie]),Ge=h((e,t)=>{let n=Fe;He(e,t);let r=pe&&!zw(n),i;if(pe){if(r)i=EC(z,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=FC(z,n,e)}}else i=Be(e);let a=!pe||r||S?Lw({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:B}):null;t.persist(),De(a),je(i);let s={action:`onChange`,activeStartDate:a,value:i,view:B};if(L&&!Bw(Pe,a)&&L(s),R){if(pe){if(!zw(i))R(i||null,t);else if(o){if(Array.isArray(i))throw Error(`value must not be an array`);R([i||null,null],t)}}else R(i||null,t)}},[Pe,o,Be,S,E,D,O,k,L,R,He,pe,Fe,z,B]);function Ke(e){ke(e)}function qe(){ke(null)}y(i,()=>({activeStartDate:Pe,drillDown:Ue,drillUp:We,onChange:Ge,setActiveStartDate:Ve,value:Fe,view:B}),[Pe,Ue,We,Ge,Ve,Fe,B]);function Je(e){let n={activeStartDate:e?OC(B,Pe):EC(B,Pe),hover:Le,locale:T,maxDate:E,minDate:O,onClick:Re?Ue:Ge,onMouseOver:pe?Ke:void 0,tileClassName:xe,tileContent:Se,tileDisabled:Ce,value:Fe,valueType:z};switch(B){case`century`:return t(rw,{formatYear:x,showNeighboringCentury:_e,...n});case`decade`:return t(sw,{formatYear:x,showNeighboringDecade:ve,...n});case`year`:return t(xw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(vw,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:re,onMouseLeave:pe?qe:void 0,showFixedNumberOfWeeks:he===void 0?me:he,showNeighboringMonth:ye,showWeekNumbers:be,...n});default:throw Error(`Invalid view: ${B}.`)}}function Ye(){return ge?t(HC,{activeStartDate:Pe,drillUp:We,formatMonthYear:_,formatYear:x,locale:T,maxDate:E,minDate:O,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:F,nextLabel:I,prev2AriaLabel:ce,prev2Label:le,prevAriaLabel:ue,prevLabel:de,setActiveStartDate:Ve,showDoubleView:me,view:B,views:Ie}):null}return n(`div`,{className:r(Sw,pe&&(Array.isArray(Fe)?Fe:[Fe]).length===1&&`${Sw}--selectRange`,me&&`${Sw}--doubleView`,c),"data-testid":l,ref:C,children:[Ye(),n(`div`,{className:`${Sw}__viewContainer`,onBlur:pe?qe:void 0,onMouseLeave:pe?qe:void 0,children:[Je(),me?Je(!0):null]})]})});pe.extend(he),pe.extend(me);var Q=pe,Hw=Object.defineProperty,Uw=(e,t)=>Hw(e,`name`,{value:t,configurable:!0}),Ww=`Popover`,[Gw,Kw]=/* @__PURE__ */ Mn(Ww,[hr]),qw=hr(),[Jw,Yw]=Gw(Ww),Xw=/* @__PURE__ */ Uw(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=qw(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=a.useState(0),[h,g]=a.useState(0),[_,v]=qr({prop:i,defaultProp:o??!1,onChange:s,caller:Ww});return/* @__PURE__ */ t(vr,{...l,children:/* @__PURE__ */ t(Jw,{scope:n,contentId:W(),titleId:W(),descriptionId:W(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,triggerRef:u,open:_,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:c,children:r})})},`Popover`),Zw=`PopoverAnchor`,Qw=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let{__scopePopover:r,...i}=e,o=Yw(Zw,r),s=qw(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),/* @__PURE__ */ t(br,{...s,...i,ref:n})},`PopoverAnchor`)),$w=`PopoverTrigger`,eT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let{__scopePopover:r,...i}=e,a=Yw($w,r),o=qw(r),s=V(n,a.triggerRef),c=/* @__PURE__ */ t(G.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":pT(a.open),...i,ref:s,onClick:U(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:/* @__PURE__ */ t(br,{asChild:!0,...o,children:c})},`PopoverTrigger`)),tT=`PopoverPortal`,[nT,rT]=Gw(tT,{forceMount:void 0}),iT=/* @__PURE__ */ Uw(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=Yw(tT,n);return/* @__PURE__ */ t(nT,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Nr,{present:r||o.open,children:/* @__PURE__ */ t(kr,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),aT=`PopoverContent`,oT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let r=rT(aT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=Yw(aT,e.__scopePopover);return/* @__PURE__ */ t(Nr,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(cT,{...a,ref:n}):/* @__PURE__ */ t(lT,{...a,ref:n})})},`PopoverContent`)),sT=/* @__PURE__ */ on(`PopoverContent.RemoveScroll`),cT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let r=Yw(aT,e.__scopePopover),i=a.useRef(null),o=V(n,i),s=a.useRef(!1),{nodes:c,registry:l}=L();return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(ue,{as:sT,allowPinchZoom:!0,shards:a.useMemo(()=>[i,...c.map(e=>({current:e}))],[i,c]),children:/* @__PURE__ */ t(uT,{...e,ref:o,branchNodes:c,branchRegistry:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),lT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let r=Yw(aT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(uT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`PopoverContentNonModal`)),uT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,"aria-describedby":p,branchNodes:m,branchRegistry:h,...g}=e,_=Yw(aT,r),v=qw(r),[y,b]=a.useState(null),x=V(n,b);return I(y),le(),/* @__PURE__ */ t(F,{registry:h,children:/* @__PURE__ */ t(P,{asChild:!0,loop:!0,trapped:i,branches:m,onMountAutoFocus:o,onUnmountAutoFocus:s,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ t(wr,{"data-state":pT(_.open),role:`dialog`,id:_.contentId,"aria-labelledby":_.titlePresent?_.titleId:void 0,"aria-describedby":_.descriptionPresent?mT(p,_.descriptionId):p,...v,...g,ref:x,style:{...g.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`)),dT=`PopoverClose`,fT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let{__scopePopover:r,...i}=e,a=Yw(dT,r);return/* @__PURE__ */ t(G.button,{type:`button`,...i,ref:n,onClick:U(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function pT(e){return e?`open`:`closed`}Uw(pT,`getState`);function mT(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Uw(mT,`concatAriaDescribedby`);const hT=a.createContext(null),gT=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(hT.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(Xw,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function _T(e=!1,t=()=>{},n){e&&t(n===`enter`)}const vT=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(hT);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(eT,{ref:r,asChild:!0,onMouseEnter:()=>_T(s,o,`enter`),onMouseLeave:()=>_T(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});vT.displayName=eT.displayName;const yT=Qw,bT=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(hT);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=Ri();return t(iT,{container:u,children:t(oT,{ref:o,align:n,side:r,onMouseEnter:()=>_T(l,c,`enter`),onMouseLeave:()=>_T(l,c,`leave`),className:H(`z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-border shadow-md focus:outline-none animate-in`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});bT.displayName=oT.displayName;const xT=fT;xT.displayName=fT.displayName;function ST(){let e=a.useContext(hT);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const CT=`
|
|
244
|
+
`),()=>{l.current?.removeAttribute(`data-motion-pop-id`),S.contains(x)&&S.removeChild(x)}},[n]),t(mm,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const gm=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=Ta(_m),p=v(),m=C(r),h=C(i);Ea(()=>{m.current=r,h.current=i});let g=!0,_=S(()=>(g=!1,{id:p,initial:n,isPresent:r,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;i&&i()},register:e=>(f.set(e,!1),()=>{f.delete(e),!m.current&&!f.size&&h.current?.()})}),[r,f,i]);return s&&g&&(_={..._}),S(()=>{f.forEach((e,t)=>f.set(t,!1))},[r]),a.useEffect(()=>{!r&&!f.size&&i&&i()},[r]),e=t(hm,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(Da.Provider,{value:_,children:e})};function _m(){return/* @__PURE__ */ new Map}function vm(e=!0){let t=g(Da);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=v();_(()=>{if(e)return i(a)},[e]);let o=h(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const ym=e=>e.key||``;function bm(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const xm=({children:n,custom:r,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,anchorY:u=`top`,root:d})=>{let[f,p]=vm(c),m=S(()=>bm(n),[n]),h=c&&!f?[]:m.map(ym),_=C(!0),v=Ta(()=>/* @__PURE__ */ new Map),y=C(/* @__PURE__ */ new Set),[b,x]=w(m),[T,E]=w(m);Ea(()=>{c&&!f&&!T.length&&p?.()},[f,c,T.length,p]),Ea(()=>{_.current=!1;for(let e=0;e<T.length;e++){let t=ym(T[e]);h.includes(t)?(v.delete(t),y.current.delete(t)):v.get(t)!==!0&&v.set(t,!1)}},[T,h.length,h.join(`-`)]);let D=[];if(m!==b){let e=[...m],t=0;for(let n of T){let r=h.indexOf(ym(n));r===-1?(e.splice(t++,0,n),D.push(n)):t=r+D.length+1}return D.every(e=>v.get(ym(e)))?e=m:s===`wait`&&(e=D),E(bm(e)),x(m),null}let{forceRender:O}=g(wa);return t(e,{children:T.map(e=>{let n=ym(e),g=c&&!f?!1:m===T||h.includes(n);return t(gm,{isPresent:g,initial:!_.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:g?void 0:()=>{if(y.current.has(n))return;if(v.has(n))y.current.add(n),v.set(n,!0);else return;let e=!0;v.forEach(t=>{t||(e=!1)}),e&&(O?.(),x([]),c&&p?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},Sm=d({strict:!1}),Cm={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]};let wm=!1;function Tm(){if(wm)return;let e={};for(let t in Cm)e[t]={isEnabled:e=>Cm[t].some(t=>!!e[t])};pf(e),wm=!0}function Em(){return Tm(),mf()}function Dm(e){let t=Em();for(let n in e)t[n]={...t[n],...e[n]};pf(t)}const Om=/* @__PURE__ */ d({});function km(e,t){if(rf(e)){let{initial:t,animate:n}=e;return{initial:t===!1||ef(t)?t:void 0,animate:ef(n)?n:void 0}}return e.inherit===!1?{}:t}function Am(e){let{initial:t,animate:n}=km(e,g(Om));return S(()=>({initial:t,animate:n}),[jm(t),jm(n)])}function jm(e){return Array.isArray(e)?e.join(` `):e}const Mm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Nm(e,t,n){for(let r in t)!mu(t[r])&&!bf(r,n)&&(e[r]=t[r])}function Pm({transformTemplate:e},t){return S(()=>{let n=Mm();return Lu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Fm(e,t){let n=e.style||{},r={};return Nm(r,n,e),Object.assign(r,Pm(e,t)),r}function Im(e,t){let n={},r=Fm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Lm=()=>({...Mm(),attrs:{}});function Rm(e,t,n,r){let i=S(()=>{let n=Lm();return Hu(n,t,Tf(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Nm(t,e.style,e),i.style={...t,...i.style}}return i}const zm=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Bm(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||zm.has(e)}function Vm(e,t){return e.startsWith(`on`)?!Bm(e):t?.(e)??!Bm(e)}function Hm(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(mu(e[a])||(Vm(a,r)||n===!0&&Bm(a)||!t&&!Bm(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const Um=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Wm(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Um.indexOf(e)>-1||/[A-Z]/u.test(e))}function Gm(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Wm(e)?Rm:Im)(t,r,i,e),u=Hm(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>mu(p)?p.get():p,[p]);return f(e,{...d,children:m})}function Km({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:qm(n,r,i,e),renderState:t()}}function qm(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Sp(a[e]);let{initial:o,animate:s}=e,c=rf(e),l=af(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!$d(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=ou(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const Jm=e=>(t,n)=>{let r=g(Om),i=g(Da),a=()=>Km(e,t,r,i);return n?a():Ta(a)},Ym=/*@__PURE__*/ Jm({scrapeMotionValuesFromProps:xf,createRenderState:Mm}),Xm=/*@__PURE__*/ Jm({scrapeMotionValuesFromProps:Df,createRenderState:Lm}),Zm=Symbol.for(`motionComponentSymbol`);function Qm(e,t,n){let r=C(n);b(()=>{r.current=n});let i=C(null);return h(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}const $m=d({});function eh(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function th(e,t,n,r,i,a){let{visualElement:o}=g(Om),s=g(Sm),c=g(Da),l=g(um),u=l.reducedMotion,d=l.skipAnimations,f=C(null),p=C(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=g($m);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&nh(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[vu],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Ea(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Ea(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),!1),m.enteringChildren=void 0)}),m}function nh(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:rh(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&eh(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function rh(e){if(e)return e.options.allowProjection===!1?rh(e.parent):e.projection}function ih(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&Dm(a);let s=i?i===`svg`:Wm(e),c=s?Xm:Ym;function l(i,l){let u,d={...g(um),...i,layoutId:ah(i)},{isStatic:f,isValidProp:p}=d,m=Am(i),h=c(i,f);if(!f&&typeof window<`u`){oh(d,a);let t=sh(d);u=t.MeasureLayout,m.visualElement=th(e,h,d,o,t.ProjectionNode,s)}return n(Om.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,Gm(e,i,Qm(h,m.visualElement,l),h,f,r,s,p)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=p(l);return u[Zm]=e,u}function ah({layoutId:e}){let t=g(wa).id;return t&&e!==void 0?t+`-`+e:e}function oh(e,t){g(Sm).strict}function sh(e){let{drag:t,layout:n}=Em();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ch(e,t){if(typeof Proxy>`u`)return ih;let n=/* @__PURE__ */ new Map,r=(n,r)=>ih(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,ih(a,void 0,e,t)),n.get(a))})}const lh=(e,t)=>t.isSVG??Wm(e)?new Of(t):new Cf(t,{allowProjection:e!==l});var uh=class extends _f{constructor(e){super(e),e.animationState||=jf(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();$d(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let dh=0;const fh={animation:{Feature:uh},exit:{Feature:class extends _f{constructor(){super(...arguments),this.id=dh++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=su(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function ph(e){return{point:{x:e.pageX,y:e.pageY}}}const mh=e=>t=>yd(t)&&e(t,ph(t));function hh(e,t,n,r){return vp(e,t,mh(n),r)}const gh=({current:e})=>e?e.ownerDocument.defaultView:null,_h=(e,t)=>Math.abs(e-t);function vh(e,t){let n=_h(e.x,t.x),r=_h(e.y,t.y);return Math.sqrt(n**2+r**2)}const yh=/*#__PURE__*/ new Set([`auto`,`scroll`]);var bh=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xh(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Ch(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=vh(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:K.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=xh(t,this.transformPagePoint),this.hasPendingMove=!0,Y.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Ch(e.type===`pointercancel`?this.lastMoveEventInfo:xh(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!yd(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=xh(ph(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=G;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Ch(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=La(hh(this.contextWindow,`pointermove`,this.handlePointerMove,d),hh(this.contextWindow,`pointerup`,this.handlePointerUp,d),hh(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(yh.has(e.overflowX)||yh.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Y.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Cs(this.updatePoint)}};function xh(e,t){return t?{point:t(e.point)}:e}function Sh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ch({point:e},t){return{point:e,delta:Sh(e,Th(t)),offset:Sh(e,wh(t)),velocity:Eh(t,.1)}}function wh(e){return e[0]}function Th(e){return e[e.length-1]}function Eh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Th(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ Ba(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ Ba(t)*2&&(r=e[1]);let a=/* @__PURE__ */ Va(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Dh(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?J(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?J(n,e,r.max):Math.min(e,n)),e}function Oh(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function kh(e,{top:t,left:n,bottom:r,right:i}){return{x:Oh(e.x,n,i),y:Oh(e.y,t,r)}}function Ah(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function jh(e,t){return{x:Ah(e.x,t.x),y:Ah(e.y,t.y)}}function Mh(e,t){let n=.5,r=Lf(e),i=Lf(t);return i>r?n=/* @__PURE__ */ Ra(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ Ra(e.min,e.max-i,t.min)),Aa(0,1,n)}function Nh(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ph=.35;function Fh(e=Ph){return e===!1?e=0:e===!0&&(e=Ph),{x:Ih(e,`left`,`right`),y:Ih(e,`top`,`bottom`)}}function Ih(e,t,n){return{min:Lh(e,t),max:Lh(e,n)}}function Lh(e,t){return typeof e==`number`?e:e[t]||0}const Rh=/* @__PURE__ */ new WeakMap;var zh=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Zd(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=md(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ap(e=>{let t=this.getAxisMotionValue(e).get()||0;if(No.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Lf(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Y.update(()=>i(e,t),!1,!0),gu(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;r&&this.currentDirection===null?(this.currentDirection=Uh(o),this.currentDirection!==null&&i&&i(this.currentDirection)):(this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Y.update(()=>a(e,t),!1,!0))},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new bh(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:gh(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Y.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Hh(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Dh(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&eh(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?kh(n.layoutBox,e):!1,this.elastic=Fh(t),r!==this.constraints&&!eh(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&ap(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Nh(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!eh(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=ld(n,r.root,this.visualElement.getTransformPagePoint()),a=jh(r.layout.layoutBox,i);if(t){let e=t(Wu(a));this.hasMutatedConstraints=!!e,e&&(a=Uu(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=ap(o=>{if(!Hh(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return gu(this.visualElement,e),n.start(tu(e,n,0,t,this.visualElement,!1))}stopAnimation(){ap(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();ap(e=>{if(!Hh(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-J(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!eh(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};ap(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Mh({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ap(t=>{let n=this.getAxisMotionValue(t);if(!Hh(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(J(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Rh.set(this.visualElement,this);let e=this.visualElement.current,t=hh(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Cd(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();eh(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Vh(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Y.read(r);let o=vp(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ap(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Ph,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Bh(e){let t=!0;return()=>{t?t=!1:e()}}function Vh(e,t,n){let r=Wd(e,Bh(n)),i=Wd(t,Bh(n));return()=>{r(),i()}}function Hh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Uh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Wh=class extends _f{constructor(e){super(e),this.removeGroupControls=Ia,this.removeListeners=Ia,this.controls=new zh(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ia}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const Gh=e=>(t,n)=>{e&&Y.update(()=>e(t,n),!1,!0)};var Kh=class extends _f{constructor(){super(...arguments),this.removePointerDownListener=Ia}onPointerDown(e){this.session=new bh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gh(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Gh(e),onStart:Gh(t),onMove:Gh(n),onEnd:(e,t)=>{delete this.session,r&&Y.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=hh(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};let qh=!1;var Jh=class extends c{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),qh&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Tp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),qh=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Y.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),ud.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;qh=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Yh(e){let[n,r]=vm(),i=g(wa);return t(Jh,{...e,layoutGroup:i,switchLayoutGroup:g($m),isPresent:n,safeToRemove:r})}const Xh={pan:{Feature:Kh},drag:{Feature:Wh,ProjectionNode:lm,MeasureLayout:Yh}};function Zh(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Y.postRender(()=>i(t,ph(t)))}var Qh=class extends _f{mount(){let{current:e}=this.node;e&&(this.unmount=_d(e,(e,t)=>(Zh(this.node,t,`Start`),e=>Zh(this.node,e,`End`))))}unmount(){}},$h=class extends _f{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=La(vp(this.node.current,`focus`,()=>this.onFocus()),vp(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function eg(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Y.postRender(()=>i(t,ph(t)))}var tg=class extends _f{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Ad(e,(e,t)=>(eg(this.node,t,`Start`),(e,{success:t})=>eg(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const ng=/* @__PURE__ */ new WeakMap,rg=/* @__PURE__ */ new WeakMap,ig=e=>{let t=ng.get(e.target);t&&t(e)},ag=e=>{e.forEach(ig)};function og({root:e,...t}){let n=e||document;rg.has(n)||rg.set(n,{});let r=rg.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(ag,{root:e,...t})),r[i]}function sg(e,t,n){let r=og(t);return ng.set(e,n),r.observe(e),()=>{ng.delete(e),r.unobserve(e)}}const cg={some:0,all:1};var lg=class extends _f{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:cg[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=sg(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(ug(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function ug({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const dg={inView:{Feature:lg},tap:{Feature:tg},focus:{Feature:$h},hover:{Feature:Qh}},fg={layout:{ProjectionNode:lm,MeasureLayout:Yh}},pg=/*@__PURE__*/ ch({...fh,...dg,...Xh,...fg},lh);function mg({children:e,overlayContent:r,className:i=``,overlayClassName:a=``,position:o=`right`,width:s,height:c,showCloseButton:l=!0,onOpen:u,onClose:d,triggerClassName:f=``,backdropClassName:p=``,animationConfig:m={type:`spring`,stiffness:300,damping:30}}){let[h,g]=w(!1),_=()=>{g(!0),u?.()},v=()=>{g(!1),d?.()},y=hg(o),b=gg(o,s,c);return n(`div`,{className:`flex items-center justify-center w-full ${i}`,children:[t(W,{variant:`unstyled`,size:`none`,onClick:_,className:`w-full align-left cursor-pointer ${f}`,children:e}),h&&t(`div`,{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${p}`,children:n(pg.div,{...y,transition:m,className:`${b} ${a}`,children:[l&&t(`div`,{className:`absolute top-2 end-2 z-10`,children:t(W,{onClick:v,variant:`primary`,children:t(wt,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function hg(e){switch(e){case`left`:return{initial:{x:`-100%`},animate:{x:0},exit:{x:`-100%`}};case`right`:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}};case`top`:return{initial:{y:`-100%`},animate:{y:0},exit:{y:`-100%`}};case`bottom`:return{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`}};case`center`:return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}};default:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}}}}function gg(e,t,n){let r=`fixed bg-white shadow-lg p-4 relative`;switch(e){case`left`:return`${r} left-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`right`:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`top`:return`${r} top-[var(--header-height)] start-0 end-0 ${n||`h-80`}`;case`bottom`:return`${r} bottom-0 start-0 end-0 ${n||`h-80`}`;case`center`:return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||`w-96`} ${n||`max-h-96`}`;default:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`}}const _g=`--tailwind-portal`;function vg({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(_g);t||(t=e.createElement(`DIV`),t.id=_g,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function yg({path:e,maxItems:r=3,className:i,separator:o}){let s=e||[],c=e=>{let n=typeof e.label==`string`&&e.label.length>20?`${e.label.slice(0,17)}...`:e.label;return e.onClick?t(wg,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(wg,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(Tg,{children:n})};if(s.length<=r)return t(bg,{className:B(`w-full flex items-center`,i),children:t(xg,{children:s.map((e,r)=>n(a.Fragment,{children:[t(Sg,{children:c(e)}),r<s.length-1&&t(Eg,{children:o??t(He,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(bg,{className:B(`w-full flex items-center`,i),children:n(xg,{children:[t(Sg,{children:t(Dg,{})}),t(Eg,{children:o??t(He,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(Sg,{children:c(e)}),r<l.length-1&&t(Eg,{children:o??t(He,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const bg=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));bg.displayName=`Breadcrumb`;const xg=a.forwardRef(({className:e,...n},r)=>t(`ol`,{ref:r,className:B(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted sm:gap-2.5`,e),...n}));xg.displayName=`BreadcrumbList`;const Sg=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:B(`inline-flex items-center gap-1.5 text-muted`,e),...n}));Sg.displayName=`BreadcrumbItem`;const Cg=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:B(`transition-colors hover:text-muted`,n),...r}));Cg.displayName=`BreadcrumbLink`;const wg=a.forwardRef(({className:e,href:n,onClick:r,...i},a)=>t(W,{variant:`ghost`,size:`md`,ref:a,className:B(`p-0! hover:underline! hover:bg-background!`,e),onClick:e=>{e.preventDefault(),r&&r(e)},...i}));wg.displayName=`BreadcrumbButton`;const Tg=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:B(`font-normal text-foreground`,e),...n}));Tg.displayName=`BreadcrumbPage`;const Eg=({children:e,className:n,...r})=>t(`li`,{role:`presentation`,"aria-hidden":`true`,className:B(`[&>svg]:w-3.5 [&>svg]:h-3.5`,n),...r,children:e??t(He,{className:`cn-rtl-flip`})});Eg.displayName=`BreadcrumbSeparator`;const Dg=({className:e,...r})=>n(`span`,{role:`presentation`,"aria-hidden":`true`,className:B(`flex h-9 w-9 items-center justify-center`,e),...r,children:[t(nt,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});Dg.displayName=`BreadcrumbEllipsis`;const Og=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));Og.displayName=`Card`;const kg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex flex-col p-6`,e),...n}));kg.displayName=`CardHeader`;const Ag=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`font-semibold leading-none tracking-tight`,e),...n}));Ag.displayName=`CardTitle`;const jg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`text-sm text-muted`,e),...n}));jg.displayName=`CardDescription`;const Mg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`p-6 pt-0`,e),...n}));Mg.displayName=`CardContent`;const Ng=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex items-center p-6 pt-0`,e),...n}));Ng.displayName=`CardFooter`;var Pg=Object.defineProperty,Fg=(e,t)=>Pg(e,`name`,{value:t,configurable:!0}),Ig=`Checkbox`,[Lg,Rg]=/* @__PURE__ */ Pn(Ig),[zg,Bg]=Lg(Ig);function Vg(e){let{__scopeCheckbox: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]=Yr({prop:r,defaultProp:o??!1,onChange:u,caller:Ig}),[g,_]=a.useState(null),[v,y]=a.useState(null),[b,x]=a.useState(null),S=!g||!!c||!!g.closest(`form`),C={checked:m,disabled:s,setChecked:h,control:g,setControl:_,name:l,form:c,value:f,userClick:b,onUserClick:x,required:d,defaultChecked:!Xg(o)&&o,isFormControl:S,bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(zg,{scope:n,...C,children:Yg(p)?p(C):i})}Fg(Vg,`CheckboxProvider`);var Hg=`CheckboxTrigger`,Ug=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Fg(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...i},o){let{control:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,onUserClick:m,isFormControl:h,bubbleInput:g}=Bg(Hg,e),_=z(o,f),v=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=/* @__PURE__ */ Fg(()=>p(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),/* @__PURE__ */ t(U.button,{type:`button`,role:`checkbox`,"aria-checked":Xg(u)?`mixed`:u,"aria-required":d,"data-state":Zg(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:_,onKeyDown:V(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:V(r,e=>{let t=e.isPropagationStopped();m({requestedChecked:Xg(u)?!0:!u,hasConsumerStoppedPropagation:t}),p(e=>Xg(e)?!0:!e),g&&h&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),Wg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Fg(function(r,i){let{__scopeCheckbox:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return/* @__PURE__ */ t(Vg,{__scopeCheckbox:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(Ug,{...m,ref:i,__scopeCheckbox:a}),r&&/* @__PURE__ */ t(Jg,{__scopeCheckbox:a})]})})},`Checkbox`)),Gg=`CheckboxIndicator`,Kg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Fg(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=Bg(Gg,r);return/* @__PURE__ */ t(Fr,{present:i||Xg(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{"data-state":Zg(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),qg=`CheckboxBubbleInput`,Jg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Fg(function({__scopeCheckbox:e,onClick:n,...r},i){let{control:o,userClick:s,checked:c,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:m,bubbleInput:h,setBubbleInput:g}=Bg(qg,e),_=z(i,g),v=ur(o),y=a.useRef(!1),b=a.useRef(c),x=a.useRef(s),S=a.useRef(null);a.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=b.current!==c;b.current=c;let i=s!==null&&s!==x.current;if(x.current=s,i)S.current=r?null:s,r&&(e.indeterminate=Xg(c),n.call(e,!Xg(c)&&c)),e.dispatchEvent(new Event(`click`,{bubbles:!s.hasConsumerStoppedPropagation}));else if(r){let t=S.current;S.current=null;let r=t?.requestedChecked===c;y.current=!0,e.indeterminate=Xg(c),n.call(e,!Xg(c)&&c),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[h,c,s]);let C=a.useRef(!Xg(c)&&c);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??C.current,required:u,disabled:d,name:f,value:p,form:m,...r,tabIndex:-1,ref:_,onClick:V(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Yg(e){return typeof e==`function`}Fg(Yg,`isFunction`);function Xg(e){return e===`indeterminate`}Fg(Xg,`isIndeterminate`);function Zg(e){return Xg(e)?`indeterminate`:e?`checked`:`unchecked`}Fg(Zg,`getState`);const Qg=a.forwardRef(({className:e,...n},r)=>t(Wg,{ref:r,className:B(`peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white`,e),...n,children:t(Kg,{className:B(`flex items-center justify-center text-current`),children:t(Re,{className:`size-4`})})}));Qg.displayName=Wg.displayName;var $g=Object.defineProperty,e_=(e,t)=>$g(e,`name`,{value:t,configurable:!0}),t_=`Collapsible`,[n_,r_]=/* @__PURE__ */ Pn(t_),[i_,a_]=n_(t_),o_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ e_(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=Yr({prop:i,defaultProp:o??!1,onChange:c,caller:t_});return/* @__PURE__ */ t(i_,{scope:r,disabled:s,contentId:H(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:/* @__PURE__ */ t(U.div,{"data-state":f_(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),s_=`CollapsibleTrigger`,c_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ e_(function(e,n){let{__scopeCollapsible:r,...i}=e,a=a_(s_,r);return/* @__PURE__ */ t(U.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":f_(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:V(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),l_=`CollapsibleContent`,u_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ e_(function(e,n){let{forceMount:r,...i}=e,a=a_(l_,e.__scopeCollapsible);return/* @__PURE__ */ t(Fr,{present:r||a.open,children:({present:e})=>/* @__PURE__ */ t(d_,{...i,ref:n,present:e})})},`CollapsibleContent`)),d_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ e_(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=a_(l_,r),[l,u]=a.useState(i),d=a.useRef(null),f=z(n,d),p=a.useRef(0),m=p.current,h=a.useRef(0),g=h.current,_=c.open||l,v=a.useRef(_),y=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),In(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();p.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(i)}},[c.open,i]),/* @__PURE__ */ t(U.div,{"data-state":f_(c.open),"data-disabled":c.disabled?``:void 0,id:c.contentId,hidden:!_,...s,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:_&&o})},`CollapsibleContentImpl`));function f_(e){return e?`open`:`closed`}e_(f_,`getState`);function p_({...e}){return t(o_,{"data-slot":`collapsible`,...e})}function m_({...e}){return t(c_,{"data-slot":`collapsible-trigger`,...e})}function h_({...e}){return t(u_,{"data-slot":`collapsible-content`,...e})}var g_=1,__=.9,v_=.8,y_=.17,b_=.1,x_=.999,S_=.9999,C_=.99,w_=/[\\\/_+.#"@\[\(\{&]/,T_=/[\\\/_+.#"@\[\(\{&]/g,E_=/[\s-]/,D_=/[\s-]/g;function O_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?g_:C_;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=O_(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=g_:w_.test(e.charAt(l-1))?(d*=v_,p=e.slice(i,l-1).match(T_),p&&i>0&&(d*=x_**+p.length)):E_.test(e.charAt(l-1))?(d*=__,m=e.slice(i,l-1).match(D_),m&&i>0&&(d*=x_**+m.length)):(d*=y_,i>0&&(d*=x_**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=S_)),(d<b_&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=O_(e,t,n,r,l+1,a+2,o),f*b_>d&&(d=f*b_)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function k_(e){return e.toLowerCase().replace(D_,` `)}function A_(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,O_(e,t,k_(e),k_(t),0,0,{})}var j_=Object.defineProperty,M_=(e,t)=>j_(e,`name`,{value:t,configurable:!0}),N_=`Dialog`,[P_,F_]=/* @__PURE__ */ Pn(N_),[I_,L_]=P_(N_),R_=/* @__PURE__ */ M_(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=a.useRef(null),u=a.useRef(null),{nodes:d,registry:f}=I(),[p,m]=Yr({prop:i,defaultProp:o??!1,onChange:s,caller:N_}),[h,g]=a.useState(0),[_,v]=a.useState(0);return/* @__PURE__ */ t(I_,{scope:n,triggerRef:l,contentRef:u,contentId:H(),titleId:H(),descriptionId:H(),titlePresent:h>0,descriptionPresent:_>0,setTitleCount:g,setDescriptionCount:v,open:p,onOpenChange:m,onOpenToggle:a.useCallback(()=>m(e=>!e),[m]),modal:c,branchNodes:d,branchRegistry:f,children:r})},`Dialog`),z_=`DialogTrigger`,B_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,a=L_(z_,r),o=z(n,a.triggerRef);return/* @__PURE__ */ t(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":av(a.open),...i,ref:o,onClick:V(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),V_=`DialogPortal`,[H_,U_]=P_(V_,{forceMount:void 0}),W_=/* @__PURE__ */ M_(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=L_(V_,n);return/* @__PURE__ */ t(H_,{scope:n,forceMount:r,children:a.Children.map(i,e=>/* @__PURE__ */ t(Fr,{present:r||s.open,children:/* @__PURE__ */ t(jr,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),G_=`DialogOverlay`,K_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let r=U_(G_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=L_(G_,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Fr,{present:i||o.open,children:/* @__PURE__ */ t(J_,{...a,ref:n})}):null},`DialogOverlay`)),q_=/* @__PURE__ */ cn(`DialogOverlay.RemoveScroll`),J_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,o=L_(G_,r),s=z(n,N());return/* @__PURE__ */ t(fe,{as:q_,allowPinchZoom:!0,shards:a.useMemo(()=>[o.contentRef,...o.branchNodes.map(e=>({current:e}))],[o.contentRef,o.branchNodes]),children:/* @__PURE__ */ t(U.div,{"data-state":av(o.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),Y_=`DialogContent`,X_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let r=U_(Y_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=L_(Y_,e.__scopeDialog);return/* @__PURE__ */ t(Fr,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(Z_,{...a,ref:n}):/* @__PURE__ */ t(Q_,{...a,ref:n})})},`DialogContent`)),Z_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let r=L_(Y_,e.__scopeDialog),i=a.useRef(null),o=z(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return pe(e)},[]),/* @__PURE__ */ t($_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Q_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let r=L_(Y_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t($_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`DialogContentNonModal`)),$_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,"aria-describedby":s,children:c,...l}=e,u=L_(Y_,r);return de(),/* @__PURE__ */ t(F,{registry:u.branchRegistry,children:/* @__PURE__ */ t(P,{asChild:!0,loop:!0,trapped:i,branches:u.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:o,children:/* @__PURE__ */ t(M,{role:`dialog`,id:u.contentId,"aria-labelledby":u.titlePresent?u.titleId:void 0,"aria-describedby":u.descriptionPresent?iv(s,u.descriptionId):s,"data-state":av(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1),children:c})})})},`DialogContentImpl`)),ev=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,a=L_(`DialogTitle`,r),{setTitleCount:o}=a;return In(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),tv=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,a=L_(`DialogDescription`,r),{setDescriptionCount:o}=a;return In(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),nv=`DialogClose`,rv=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,a=L_(nv,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function iv(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}M_(iv,`concatAriaDescribedby`);function av(e){return e?`open`:`closed`}M_(av,`getState`);var ov=`[cmdk-group=""]`,sv=`[cmdk-group-items=""]`,cv=`[cmdk-group-heading=""]`,lv=`[cmdk-item=""]`,uv=`${lv}:not([aria-disabled="true"])`,dv=`cmdk-item-select`,fv=`data-value`,pv=(e,t,n)=>A_(e,t,n),mv=a.createContext(void 0),hv=()=>a.useContext(mv),gv=a.createContext(void 0),_v=()=>a.useContext(gv),vv=a.createContext(void 0),yv=a.forwardRef((e,t)=>{let n=Nv(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=Nv(()=>/* @__PURE__ */ new Set),i=Nv(()=>/* @__PURE__ */ new Map),o=Nv(()=>/* @__PURE__ */ new Map),s=Nv(()=>/* @__PURE__ */ new Set),c=jv(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=H(),b=H(),x=H(),S=a.useRef(null),C=Iv();Mv(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),Mv(()=>{C(6,A)},[]);let w=a.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),T=a.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{o.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=c.current?.filter??pv;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(sv);t?t.appendChild(e.parentElement===t?e:e.closest(`${sv} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${sv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${ov}[${fv}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(fv);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ov)?.querySelector(cv))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${lv}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(uv)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(fv))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(fv))}function F(e){let t=j()?.closest(ov),n;for(;t&&!n;)t=e>0?kv(t,ov):Av(t,ov),n=t?.querySelector(uv);n?w.setState(`value`,n.getAttribute(fv)):P(e)}let ee=()=>N(M().length-1),I=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?F(1):P(1)},te=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return a.createElement(U.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:_&&e.ctrlKey&&te(e);break;case`ArrowUp`:te(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(dv);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:zv},l),Rv(e,e=>a.createElement(gv.Provider,{value:w},a.createElement(mv.Provider,{value:T},e))))}),bv=a.forwardRef((e,t)=>{let n=H(),r=a.useRef(null),i=a.useContext(vv),o=hv(),s=jv(e),c=s.current?.forceMount??i?.forceMount;Mv(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=Fv(n,r,[e.value,e.children,r],e.keywords),u=_v(),d=Pv(e=>e.value&&e.value===l.current),f=Pv(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);a.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(dv,p),()=>t.removeEventListener(dv,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return a.createElement(U.div,{ref:an(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),xv=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=H(),c=a.useRef(null),l=a.useRef(null),u=H(),d=hv(),f=Pv(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));Mv(()=>d.group(s),[]),Fv(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(U.div,{ref:an(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&a.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Rv(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(vv.Provider,{value:p},e))))}),Sv=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=Pv(e=>!e.search);return!n&&!o?null:a.createElement(U.div,{ref:an(i,t),...r,"cmdk-separator":``,role:`separator`})}),Cv=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=_v(),s=Pv(e=>e.search),c=Pv(e=>e.selectedItemId),l=hv();return a.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),a.createElement(U.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),wv=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=Pv(e=>e.selectedItemId),l=hv();return a.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),a.createElement(U.div,{ref:an(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Rv(e,e=>a.createElement(`div`,{ref:an(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),Tv=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(R_,{open:n,onOpenChange:r},a.createElement(W_,{container:s},a.createElement(K_,{"cmdk-overlay":``,className:i}),a.createElement(X_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(yv,{ref:t,...c}))))}),Ev=a.forwardRef((e,t)=>Pv(e=>e.filtered.count===0)?a.createElement(U.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Dv=a.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return a.createElement(U.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Rv(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),Ov=Object.assign(yv,{List:wv,Item:bv,Input:Cv,Group:xv,Separator:Sv,Dialog:Tv,Empty:Ev,Loading:Dv});function kv(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Av(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function jv(e){let t=a.useRef(e);return Mv(()=>{t.current=e}),t}var Mv=typeof window>`u`?a.useEffect:a.useLayoutEffect;function Nv(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function Pv(e){let t=_v(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function Fv(e,t,n,r=[]){let i=a.useRef(),o=hv();return Mv(()=>{var a;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());o.value(e,s,c),(a=t.current)==null||a.setAttribute(fv,s),i.current=s}),i}var Iv=()=>{let[e,t]=a.useState(),n=Nv(()=>/* @__PURE__ */ new Map);return Mv(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Lv(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Rv({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(Lv(t),{ref:t.ref},n(t.props.children)):n(t)}var zv={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Bv({children:e}){return t(`span`,{style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`},children:e})}const Vv=d(!1);function Hv(){return!!g(Vv)}function Uv({children:e}){return t(Vv.Provider,{value:!0,children:e})}function Wv({className:e,children:r,isOpen:i,onClose:a,description:o=`Modal Description`,noCloseButton:s=!1,allowOverflow:c=!1,disableCloseOnClickOutside:l=!1,size:u=`md`,action:d}){let f=e=>{e||a()};function p(){switch(u){case`sm`:return`max-w-[20vw]`;case`md`:return`max-w-[60vw] lg:max-w-[40vw]`;case`lg`:return`max-w-[80vw] md:max-w-[60vw]`;case`xl`:return`max-w-[95vw] lg:max-w-[80vw]`;case`full`:return`h-[calc(100vh-2rem)] max-w-[calc(100vw-2rem)]`;default:return`max-w-[60vw] lg:max-w-[40vw]`}}return n(Jv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(Qv,{className:`z-50 fixed inset-0 bg-black/80`}),t(Bv,{children:t(ey,{children:o})}),n($v,{className:B(`min-h-20 p-4`,`fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg`,p(),e),children:[t(`div`,{className:`top-4 end-4 absolute`,children:n(`div`,{className:`flex gap-2`,children:[d&&d,!s&&t(Zv,{onClick:()=>f(!1),asChild:!0,autoFocus:!1,children:t(W,{variant:`outline`,title:`Close`,className:`data-[state=open]:bg-muted opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted transition-opacity disabled:pointer-events-none`,children:t(wt,{className:`size-4`})})})]})}),t(Uv,{children:r})]})]})}const Gv=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(ty,{className:B(o?`border-b-solid border-b border-b-1 pb-2 mb-4`:``,`text-lg font-semibold leading-6 tracking-tight`,{"py-2":!a},i),...s,children:[e,a&&t(ey,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(Bv,{children:[t(ty,{children:e}),a&&t(ey,{children:a})]}),Kv=({children:e,className:n,...r})=>t(`div`,{className:B(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),qv=({align:e=`right`,children:n,className:r,...i})=>t(`div`,{className:B(`w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end gap-2`,{left:`justify-start`,center:`justify-center`,right:`justify-end`}[e],r),...i,children:n}),Jv=R_,Yv=B_,Xv=W_,Zv=rv,Qv=a.forwardRef(({className:e,...n},r)=>t(K_,{ref:r,className:B(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));Qv.displayName=K_.displayName;const $v=a.forwardRef(({className:e,children:r,...i},a)=>{let o=Bi();return n(Xv,{container:o,children:[t(Qv,{}),t(X_,{ref:a,className:B(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...i,children:r})]})});$v.displayName=X_.displayName;const ey=a.forwardRef(({className:e,...n},r)=>t(tv,{ref:r,className:B(`text-sm text-muted`,e),...n}));ey.displayName=tv.displayName;const ty=a.forwardRef(({className:e,...n},r)=>t(ev,{ref:r,className:B(`text-lg font-semibold leading-none tracking-tight`,e),...n}));ty.displayName=ev.displayName;const ny=a.forwardRef(({className:e,...n},r)=>t(Ov,{ref:r,className:B(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));ny.displayName=Ov.displayName;const ry=({children:e,...n})=>t(Jv,{...n,children:t($v,{className:`shadow-lg p-0 overflow-hidden`,children:t(ny,{className:`[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:e})})}),iy=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(gt,{className:`opacity-50 size-4 shrink-0`}),t(Ov.Input,{ref:i,className:B(`focus:ring-0`,`border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted disabled:cursor-not-allowed disabled:opacity-50`,e),...r})]}));iy.displayName=Ov.Input.displayName;const ay=a.forwardRef(({className:e,...n},r)=>t(Ov.List,{ref:r,className:B(`overflow-y-auto overflow-x-hidden`,e),...n}));ay.displayName=Ov.List.displayName;const oy=a.forwardRef((e,n)=>t(Ov.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));oy.displayName=Ov.Empty.displayName;const sy=a.forwardRef(({className:e,...n},r)=>t(Ov.Group,{ref:r,className:B(`overflow-y-auto overflow-x-hidden p-1 text-foreground`,`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,e),...n}));sy.displayName=Ov.Group.displayName;const cy=a.forwardRef(({className:e,...n},r)=>t(Ov.Separator,{ref:r,className:B(`-mx-1 h-px bg-border`,e),...n}));cy.displayName=Ov.Separator.displayName;const ly=a.forwardRef(({className:e,...n},r)=>t(Ov.Item,{ref:r,className:B(`hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-muted data-[selected=true]:text-muted data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...n}));ly.displayName=Ov.Item.displayName;const uy=({className:e,...n})=>t(`span`,{className:B(`ms-auto text-xs tracking-widest text-muted`,e),...n});uy.displayName=`CommandShortcut`;var dy=Object.defineProperty,fy=(e,t)=>dy(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
245
|
+
function py(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ Pn(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),c=/* @__PURE__ */ fy(e=>{let{scope:n,children:r}=e,i=a.useRef(null),s=a.useRef(/* @__PURE__ */ new Map).current;return/* @__PURE__ */ t(o,{scope:n,itemMap:s,collectionRef:i,children:r})},`CollectionProvider`);c.displayName=n;let l=e+`CollectionSlot`,u=/* @__PURE__ */ cn(l),d=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(l,r).collectionRef);return/* @__PURE__ */ t(u,{ref:a,children:i})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=/* @__PURE__ */ cn(f),h=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),l=z(n,c),u=s(f,r);return a.useEffect(()=>(u.itemMap.set(c,{ref:c,...o}),()=>void u.itemMap.delete(c))),/* @__PURE__ */ t(m,{[p]:``,ref:l,children:i})});h.displayName=f;function g(t){let n=s(e+`CollectionConsumer`,t);return a.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return fy(g,`useCollection`),[{Provider:c,Slot:d,ItemSlot:h},g,i]}fy(py,`createCollection`);var my=/* @__PURE__ */ new WeakMap,hy=class e extends Map{static{fy(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],my.set(this,!0)}set(e,t){return my.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=vy(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=gy(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=gy(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return gy(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function gy(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=_y(e,t);return n===-1?void 0:e[n]}fy(gy,`at`);function _y(e,t){let n=e.length,r=vy(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}fy(_y,`toSafeIndex`);function vy(e){return e!==e||e===0?0:Math.trunc(e)}fy(vy,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
|
|
246
|
+
function yy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ Pn(n),[o,s]=r(n);o.displayName=e+`CollectionStableContextProvider`;let[c,l]=r(n);c.displayName=e+`CollectionStatefulContextProvider`;let u=/* @__PURE__ */ fy(({state:e,...n})=>e?/* @__PURE__ */ t(f,{...n,state:e}):/* @__PURE__ */ t(d,{...n}),`CollectionProvider`);u.displayName=n;let d=/* @__PURE__ */ fy(e=>{let n=y();return/* @__PURE__ */ t(f,{...e,state:n})},`CollectionInit`);d.displayName=e+`CollectionInit`;let f=/* @__PURE__ */ fy(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[l,u]=a.useState(null),d=z(s,u),[f,p]=i,m=a.useRef(new hy),h=a.useCallback(()=>{let e=m.current;return Sy(e)||e.sort(Cy),e},[]);return a.useEffect(()=>{if(!l)return;let e=wy(()=>{p(e=>{let t=e.toSorted(Cy);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(l,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[l,p]),/* @__PURE__ */ t(o,{scope:n,collectionElementRef:d,collectionElementRefObject:s,getCollection:h,setCollection:p,registryRef:m,children:/* @__PURE__ */ t(c,{scope:n,collectionElement:l,collection:f,children:r})})},`CollectionProviderImpl`);f.displayName=e+`CollectionProviderImpl`;let p=e+`CollectionSlot`,m=/* @__PURE__ */ cn(p),h=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(p,r).collectionElementRef);return/* @__PURE__ */ t(m,{ref:a,children:i})});h.displayName=p;let g=e+`CollectionItemSlot`,_=/* @__PURE__ */ cn(g),v=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),{setCollection:l,registryRef:u}=s(g,r),d=a.useRef(o);by(d.current,o)||(d.current=o);let f=d.current,p=z(n,a.useCallback(e=>{let t=u.current;e?t.set(e,{...d.current,element:e}):c.current&&t.delete(c.current)},[u]),c);In(()=>{let e=c.current,t=u.current;e&&t.has(e)&&t.set(e,{...f,element:e})},[f,u]);let m=a.useRef(null);return a.useEffect(()=>{let e=c.current,t=m.current;((t?.element??null)!==e||e&&t?.itemData!==f)&&(m.current=e?{element:e,itemData:f}:null,l(n=>{let r=new hy(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...f,element:e}),r.sort(Cy)}))}),a.useEffect(()=>()=>{let e=m.current;m.current=null,e&&l(t=>{if(!t.has(e.element))return t;let n=new hy(t);return n.delete(e.element),n})},[l]),/* @__PURE__ */ t(_,{"data-radix-collection-item":``,ref:p,children:i})});v.displayName=g;function y(){return a.useState(new hy)}fy(y,`useInitCollection`);function b(t){let{collection:n}=l(e+`CollectionConsumer`,t);return n}fy(b,`useCollection`);function x(t){let{getCollection:n}=s(e+`CollectionConsumer`,t);return n}return fy(x,`useGetCollection`),[{Provider:u,Slot:h,ItemSlot:v},{createCollectionScope:i,useCollection:b,useGetCollection:x,useInitCollection:y}]}fy(yy,`createCollection`);function by(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}fy(by,`shallowEqual`);function xy(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}fy(xy,`isElementPreceding`);function Sy(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}fy(Sy,`isInDocumentOrder`);function Cy(e,t){return!e[1].element||!t[1].element?0:xy(e[1].element,t[1].element)?-1:1}fy(Cy,`sortByDocumentPosition`);function wy(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}fy(wy,`getChildListObserver`);var Ty=Object.defineProperty,Ey=(e,t)=>Ty(e,`name`,{value:t,configurable:!0}),Dy=!1;function Oy(){let[e,t]=a.useState(Dy);return a.useEffect(()=>{Dy||(Dy=!0,t(!0))},[]),e}Ey(Oy,`useIsHydrated`);var ky=a.useSyncExternalStore;function Ay(){return()=>{}}Ey(Ay,`subscribe`);function jy(){return ky(Ay,()=>!0,()=>!1)}Ey(jy,`useIsHydratedModern`);var My=typeof ky==`function`?jy:Oy,Ny=Object.defineProperty,Py=(e,t)=>Ny(e,`name`,{value:t,configurable:!0}),Fy=`rovingFocusGroup.onEntryFocus`,Iy={bubbles:!1,cancelable:!0},Ly=`RovingFocusGroup`,[Ry,zy,By]=/* @__PURE__ */ py(Ly),[Vy,Hy]=/* @__PURE__ */ Pn(Ly,[By]),Uy={Vertical:`vertical`,Horizontal:`horizontal`},Wy={LTR:`ltr`,RTL:`rtl`},[Gy,Ky]=Vy(Ly),qy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Py(function(e,n){return/* @__PURE__ */ t(Ry.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ry.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Jy,{...e,ref:n})})})},`RovingFocusGroup`)),Jy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Py(function(e,n){let{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=a.useRef(null),h=z(n,m),g=me(s),[_,v]=Yr({prop:c,defaultProp:l??null,onChange:u,caller:Ly}),[y,b]=a.useState(!1),x=sr(d),S=zy(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Fy,x),()=>e.removeEventListener(Fy,x)},[x]),/* @__PURE__ */ t(Gy,{scope:r,orientation:i,dir:g,loop:o,currentTabStopId:_,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>T(e=>e-1),[]),children:/* @__PURE__ */ t(U.div,{tabIndex:y||w===0?-1:0,"data-orientation":i,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(Fy,Iy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);eb([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}C.current=!1}),onBlur:V(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Yy=`RovingFocusGroupItem`,Xy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Py(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=H(),d=s||u,f=Ky(Yy,r),p=f.currentTabStopId===d,m=zy(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=My();return In(()=>{if(v&&i)return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!v&&i)return h(),()=>g()},[v,i,h,g]),/* @__PURE__ */ t(Ry.ItemSlot,{scope:r,id:d,focusable:i,active:o,children:/* @__PURE__ */ t(U.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:V(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:V(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:V(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=$y(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?tb(n,r+1):n.slice(r+1)}setTimeout(()=>eb(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})},`RovingFocusGroupItem`)),Zy={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Qy(e,t){return t===Wy.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Py(Qy,`getDirectionAwareKey`);function $y(e,t,n){let r=Qy(e.key,n);if(!(t===Uy.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Uy.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Zy[r]}Py($y,`getFocusIntent`);function eb(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Py(eb,`focusFirst`);function tb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Py(tb,`wrapArray`);var nb=Object.defineProperty,X=(e,t)=>nb(e,`name`,{value:t,configurable:!0}),rb={LTR:`ltr`,RTL:`rtl`},ib=[`Enter`,` `],ab=[`ArrowDown`,`PageUp`,`Home`],ob=[`ArrowUp`,`PageDown`,`End`],sb=[...ab,...ob],cb={ltr:[...ib,`ArrowRight`],rtl:[...ib,`ArrowLeft`]},lb={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},ub=`Menu`,[db,fb,pb]=/* @__PURE__ */ py(ub),[mb,hb]=/* @__PURE__ */ Pn(ub,[pb,_r,Hy]),gb=_r(),_b=Hy(),[vb,yb]=mb(ub),[bb,xb]=mb(ub),Sb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=gb(n),[u,d]=a.useState(null),f=a.useRef(!1),p=sr(s),m=me(o);return a.useEffect(()=>{let e=/* @__PURE__ */ X(()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ X(()=>f.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),a.useEffect(()=>{if(!r)return;let e=/* @__PURE__ */ X(()=>p(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[r,p]),/* @__PURE__ */ t(br,{...l,children:/* @__PURE__ */ t(vb,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:/* @__PURE__ */ t(bb,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),Cb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e,a=gb(r);return/* @__PURE__ */ t(Sr,{...a,...i,ref:n})},`MenuAnchor`)),wb=`MenuPortal`,[Tb,Eb]=mb(wb,{forceMount:void 0}),Db=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=yb(wb,n);return/* @__PURE__ */ t(Tb,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Fr,{present:r||o.open,children:/* @__PURE__ */ t(jr,{asChild:!0,container:a,children:i})})})},`MenuPortal`),Ob=`MenuContent`,[kb,Ab]=mb(Ob),jb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=Eb(Ob,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=yb(Ob,e.__scopeMenu),s=xb(Ob,e.__scopeMenu);return/* @__PURE__ */ t(db.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Fr,{present:i||o.open,children:/* @__PURE__ */ t(db.Slot,{scope:e.__scopeMenu,children:s.modal?/* @__PURE__ */ t(Mb,{...a,ref:n}):/* @__PURE__ */ t(Nb,{...a,ref:n})})})})},`MenuContent`)),Mb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=yb(Ob,e.__scopeMenu),i=a.useRef(null),o=z(n,i);return a.useEffect(()=>{let e=i.current;if(e)return pe(e)},[]),/* @__PURE__ */ t(Fb,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentModal`)),Nb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=yb(Ob,e.__scopeMenu);return/* @__PURE__ */ t(Fb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),Pb=/* @__PURE__ */ cn(`MenuContent.ScrollLock`),Fb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=yb(Ob,r),y=xb(Ob,r),b=gb(r),x=_b(r),S=fb(r),[C,w]=a.useState(null),T=a.useRef(null),[E,D]=a.useState(null);ee(E);let{nodes:O,registry:k}=I(),A=!!(o||g),j=z(n,T,v.onContentChange,D),N=a.useRef(0),te=a.useRef(``),ne=a.useRef(0),re=a.useRef(null),ie=a.useRef(`right`),ae=a.useRef(0),oe=a.useMemo(()=>g?[T,...O.map(e=>({current:e}))]:[],[T,O,g]),se=g?fe:a.Fragment,ce=g?{as:Pb,allowPinchZoom:!0,shards:oe}:void 0,le=/* @__PURE__ */ X(e=>{let t=te.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=fx(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){te.current=e,window.clearTimeout(N.current),e!==``&&(N.current=window.setTimeout(()=>s(``),1e3))}X(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);a.useEffect(()=>()=>window.clearTimeout(N.current),[]),de();let ue=a.useCallback(e=>ie.current===re.current?.side&&mx(e,re.current?.area),[]);return/* @__PURE__ */ t(kb,{scope:r,searchRef:te,onItemEnter:a.useCallback(e=>{ue(e)&&e.preventDefault()},[ue]),onItemLeave:a.useCallback(e=>{ue(e)||(T.current?.focus(),w(null))},[ue]),onTriggerLeave:a.useCallback(e=>{ue(e)&&e.preventDefault()},[ue]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:a.useCallback(e=>{re.current=e},[]),children:/* @__PURE__ */ t(F,{registry:A?k:null,children:/* @__PURE__ */ t(se,{...ce,children:/* @__PURE__ */ t(P,{asChild:!0,trapped:o,branches:O,onMountAutoFocus:V(s,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:/* @__PURE__ */ t(qy,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:V(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ t(Er,{role:`menu`,"aria-orientation":`vertical`,"data-state":sx(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:j,style:{outline:`none`,..._.style},onKeyDown:V(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&le(e.key));let i=T.current;if(e.target!==i||!sb.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);ob.includes(e.key)&&a.reverse(),ux(a)}),onBlur:V(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),te.current=``)}),onPointerMove:V(e.onPointerMove,hx(e=>{let t=e.target,n=ae.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ae.current?`right`:`left`;ie.current=t,ae.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Ib=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Lb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{...i,ref:n})},`MenuLabel`)),Rb=`MenuItem`,zb=`menu.itemSelect`,Bb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=xb(Rb,e.__scopeMenu),l=Ab(Rb,e.__scopeMenu),u=z(n,s),d=a.useRef(!1),f=/* @__PURE__ */ X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(zb,{bubbles:!0,cancelable:!0});e.addEventListener(zb,e=>i?.(e),{once:!0}),rr(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return/* @__PURE__ */ t(Vb,{...o,ref:u,disabled:r,onClick:V(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:V(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:V(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(l.searchRef.current===``||e.key!==` `)&&ib.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Vb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=Ab(Rb,r),l=_b(r),u=a.useRef(null),d=z(n,u),[f,p]=a.useState(!1),[m,h]=a.useState(``);return a.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[s.children]),/* @__PURE__ */ t(db.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:/* @__PURE__ */ t(Xy,{asChild:!0,...l,focusable:!i,children:/* @__PURE__ */ t(U.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...s,ref:d,onPointerMove:V(e.onPointerMove,hx(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,hx(e=>c.onItemLeave(e))),onFocus:V(e.onFocus,()=>p(!0)),onBlur:V(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Hb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return/* @__PURE__ */ t(Yb,{scope:e.__scopeMenu,checked:r,children:/* @__PURE__ */ t(Bb,{role:`menuitemcheckbox`,"aria-checked":cx(r)?`mixed`:r,...a,ref:n,"data-state":lx(r),onSelect:V(a.onSelect,()=>i?.(cx(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Ub,Wb]=mb(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ X(()=>{},`onValueChange`)}),Gb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=sr(i);return/* @__PURE__ */ t(Ub,{scope:e.__scopeMenu,value:r,onValueChange:o,children:/* @__PURE__ */ t(Ib,{...a,ref:n})})},`MenuRadioGroup`)),Kb=`MenuRadioItem`,qb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,...i}=e,a=Wb(Kb,e.__scopeMenu),o=r===a.value;return/* @__PURE__ */ t(Yb,{scope:e.__scopeMenu,checked:o,children:/* @__PURE__ */ t(Bb,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":lx(o),onSelect:V(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Jb=`MenuItemIndicator`,[Yb,Xb]=mb(Jb,{checked:!1}),Zb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=Xb(Jb,r);return/* @__PURE__ */ t(Fr,{present:i||cx(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{...a,ref:n,"data-state":lx(o.checked)})})},`MenuItemIndicator`)),Qb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),$b=`MenuSub`,[ex,tx]=mb($b),nx=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=yb($b,n),c=gb(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=sr(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),/* @__PURE__ */ t(br,{...c,children:/* @__PURE__ */ t(vb,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:/* @__PURE__ */ t(ex,{scope:n,contentId:H(),triggerId:H(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),rx=`MenuSubTrigger`,ix=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=yb(rx,e.__scopeMenu),i=xb(rx,e.__scopeMenu),o=tx(rx,e.__scopeMenu),s=Ab(rx,e.__scopeMenu),c=a.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);a.useEffect(()=>f,[f]),a.useEffect(()=>{let e=l.current;return()=>{window.clearTimeout(e),u(null)}},[l,u]);let p=z(n,o.onTriggerChange);return/* @__PURE__ */ t(Cb,{asChild:!0,...d,children:/* @__PURE__ */ t(Vb,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":sx(r.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,hx(t=>{s.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:V(e.onPointerLeave,hx(e=>{f();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,i=n===`right`,a=i?-5:5,o=t[i?`left`:`right`],c=t[i?`right`:`left`];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:o,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(s.searchRef.current===``||t.key!==` `)&&cb[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),ax=`MenuSubContent`,ox=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=Eb(Ob,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=yb(Ob,e.__scopeMenu),l=xb(Ob,e.__scopeMenu),u=tx(ax,e.__scopeMenu),d=a.useRef(null),f=z(n,d);return/* @__PURE__ */ t(db.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Fr,{present:i||c.open,children:/* @__PURE__ */ t(db.Slot,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Fb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:l.dir===rb.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:V(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:V(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=lb[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function sx(e){return e?`open`:`closed`}X(sx,`getOpenState`);function cx(e){return e===`indeterminate`}X(cx,`isIndeterminate`);function lx(e){return cx(e)?`indeterminate`:e?`checked`:`unchecked`}X(lx,`getCheckedState`);function ux(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(ux,`focusFirst`);function dx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(dx,`wrapArray`);function fx(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=dx(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(fx,`getNextMatch`);function px(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X(px,`isPointInPolygon`);function mx(e,t){return t?px({x:e.clientX,y:e.clientY},t):!1}X(mx,`isPointerInGraceArea`);function hx(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(hx,`whenMouse`);var gx=Object.defineProperty,_x=(e,t)=>gx(e,`name`,{value:t,configurable:!0}),vx=`DropdownMenu`,[yx,bx]=/* @__PURE__ */ Pn(vx,[hb]),xx=hb(),[Sx,Cx]=yx(vx),wx=/* @__PURE__ */ _x(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=xx(n),d=a.useRef(null),[f,p]=Yr({prop:o,defaultProp:s??!1,onChange:c,caller:vx});return/* @__PURE__ */ t(Sx,{scope:n,triggerId:H(),triggerRef:d,contentId:H(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:/* @__PURE__ */ t(Sb,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),Tx=`DropdownMenuTrigger`,Ex=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=Cx(Tx,r),s=xx(r),c=z(n,o.triggerRef);return/* @__PURE__ */ t(Cb,{asChild:!0,...s,children:/* @__PURE__ */ t(U.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:V(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:V(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Dx=/* @__PURE__ */ _x(e=>{let{__scopeDropdownMenu:n,...r}=e,i=xx(n);return/* @__PURE__ */ t(Db,{...i,...r})},`DropdownMenuPortal`),Ox=`DropdownMenuContent`,kx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=Cx(Ox,r),s=xx(r),c=a.useRef(!1);return/* @__PURE__ */ t(jb,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:n,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{c.current||o.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:V(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!o.modal||r)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Ax=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Ib,{...a,...i,ref:n})},`DropdownMenuGroup`)),jx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Lb,{...a,...i,ref:n})},`DropdownMenuLabel`)),Mx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Bb,{...a,...i,ref:n})},`DropdownMenuItem`)),Nx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Hb,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),Px=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Gb,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),Fx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(qb,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),Ix=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Zb,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),Lx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Qb,{...a,...i,ref:n})},`DropdownMenuSeparator`)),Rx=/* @__PURE__ */ _x(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=xx(n),[c,l]=Yr({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return/* @__PURE__ */ t(nx,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),zx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(ix,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),Bx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(ox,{...a,...i,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`));const Vx=a.createContext(!1);function Hx({...e}){return t(wx,{"data-slot":`dropdown-menu`,...e})}function Ux({...e}){return t(Dx,{"data-slot":`dropdown-menu-portal`,...e})}function Wx({...e}){return t(Ex,{"data-slot":`dropdown-menu-trigger`,...e})}function Gx({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(Dx,{children:t(kx,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:n,className:B(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden`,e),...i})})}function Kx({...e}){return t(Ax,{"data-slot":`dropdown-menu-group`,...e})}function qx({className:e,inset:n,variant:r=`default`,...i}){return t(Mx,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:B(`hover:bg-muted focus:bg-muted data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i})}function Jx({className:e,children:r,checked:i,inset:a,...o}){return n(Nx,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:B(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:i,...o,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:t(Ix,{children:t(Re,{})})}),r]})}function Yx({...e}){return t(Px,{"data-slot":`dropdown-menu-radio-group`,...e})}function Xx({className:e,children:r,inset:i,...a}){return n(Fx,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:B(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-radio-item-indicator`,children:t(Ix,{children:t(Re,{})})}),r]})}function Zx({className:e,inset:n,...r}){return t(jx,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:B(`text-muted px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function Qx({className:e,...n}){return t(Lx,{"data-slot":`dropdown-menu-separator`,className:B(`bg-border -mx-1 my-1 h-px`,e),...n})}function $x({className:e,...n}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:B(`text-muted group-focus/dropdown-menu-item:text-muted ms-auto text-xs tracking-widest`,e),...n})}function eS({...e}){return t(Rx,{"data-slot":`dropdown-menu-sub`,...e})}function tS({className:e,inset:r,children:i,...a}){return n(zx,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":r,className:B(`focus:bg-muted focus:text-muted data-open:bg-muted data-open:text-muted not-data-[variant=destructive]:focus:**:text-muted gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,t(He,{className:`cn-rtl-flip ms-auto`})]})}function nS({className:e,...n}){return t(Bx,{"data-slot":`dropdown-menu-sub-content`,className:B(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden`,e),...n})}const rS={left:`start`,center:`center`,right:`end`};function iS({trigger:e,children:r,align:i=`right`,hover:o}){let[s,c]=a.useState(!1),l=a.useRef(null);return o?n(`div`,{className:`relative inline-flex`,onMouseEnter:()=>{l.current&&clearTimeout(l.current),c(!0)},onMouseLeave:()=>{l.current=setTimeout(()=>c(!1),80)},children:[e,s&&t(`div`,{className:B(`absolute top-full pt-1 z-50`,i===`right`?`end-0`:i===`center`?`left-1/2 -translate-x-1/2`:`start-0`),children:t(`div`,{className:`min-w-32 rounded-lg p-1 shadow-md ring-1 ring-foreground/10 bg-popover text-popover-foreground`,children:t(Vx.Provider,{value:!0,children:r})})})]}):n(Hx,{children:[t(Wx,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(Gx,{align:rS[i],className:`w-max`,children:r})]})}function aS({children:e,label:r}){return n(Kx,{children:[r&&t(Zx,{children:r}),e]})}function oS({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(Vx),l=B(`w-full gap-2 rounded-md px-1.5 py-1 text-sm text-nowrap [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,o===`destructive`?`text-destructive`:``,i?`pointer-events-none opacity-50`:`hover:bg-muted focus:bg-muted`,s);return c?n?t(`a`,{href:n,className:l,children:e}):t(`button`,{type:`button`,className:l,disabled:i,onClick:e=>{e.stopPropagation(),r?.(e)},children:e}):t(qx,{className:B(`data-[disabled]:pointer-events-none data-[disabled]:opacity-50 text-nowrap`,s),disabled:i,variant:o,onClick:e=>{e.stopPropagation(),r?.(e)},asChild:!!n,children:n?t(`a`,{href:n,children:e}):e})}const sS=({children:e,className:n})=>{let r=C(null),[i,a]=w(`auto`);return _(()=>{if(r.current){let e=new ResizeObserver(e=>{let t=e[0].contentRect.height;a(t)});return e.observe(r.current),()=>{e.disconnect()}}},[]),t(`div`,{className:B(n,`overflow-hidden transition-all duration-100 ease-in`),style:{height:i},children:t(`div`,{ref:r,children:e})})},cS=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);(lS(i,a)||!r)&&Object.defineProperty(e,n,a)},lS=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},uS=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},dS=(e,t)=>`/* Wrapped ${e}*/\n${t}`,fS=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),pS=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),mS=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=dS.bind(null,r,t.toString());Object.defineProperty(i,"name",pS);let{writable:a,enumerable:o,configurable:s}=fS;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function hS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))cS(e,t,r,n);return uS(e,t),mS(e,t,r),e}const gS=2147483647,_S=/* @__PURE__ */ new WeakMap,vS=/* @__PURE__ */ new WeakMap,yS=/* @__PURE__ */ new WeakMap;function bS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now())e.delete(t);else return n}}function xS(e,{cacheKey:t,cache:n=/* @__PURE__ */ new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>gS)throw TypeError(`The \`maxAge\` option cannot exceed ${gS}.`);if(r<0)throw TypeError("The `maxAge` option should not be a negative number.")}let i=function(...a){let o=t?t(a):a[0],s=bS(n,o);if(s)return s.data;let c=e.apply(this,a),l=typeof r==`function`?r(...a):r;if(l!==void 0&&l!==1/0){if(!Number.isFinite(l))throw TypeError("The `maxAge` function must return a finite number, `0`, or `Infinity`.");if(l<=0)return c;if(l>gS)throw TypeError(`The \`maxAge\` function result cannot exceed ${gS}.`)}if(n.set(o,{data:c,maxAge:l===void 0||l===1/0?1/0:Date.now()+l}),l!==void 0&&l!==1/0){let e=setTimeout(()=>{n.delete(o),vS.get(i)?.delete(e)},l);e.unref?.();let t=vS.get(i)??/* @__PURE__ */ new Set;t.add(e),vS.set(i,t)}return c};return hS(i,e,{ignoreNonConfigurable:!0}),_S.set(i,n),yS.set(i,t??(e=>e[0])),i}function SS(e){return typeof e==`string`}function CS(e,t,n){return n.indexOf(e)===t}function wS(e){return e.toLowerCase()===e}function TS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function ES(e){if(!e)return e;if(e===`C`||e===`posix`||e===`POSIX`)return`en-US`;if(e.indexOf(`.`)!==-1){var t=e.split(`.`)[0],n=t===void 0?``:t;return ES(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return ES(n)}if(e.indexOf(`-`)===-1||!wS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function DS(e){var t=e===void 0?{}:e,n=t.useFallbackLocale,r=n===void 0||n,i=t.fallbackLocale,a=i===void 0?`en-US`:i,o=[];if(typeof navigator<`u`){for(var s=navigator.languages||[],c=[],l=0,u=s;l<u.length;l++){var d=u[l];c=c.concat(TS(d))}var f=navigator.language,p=f&&TS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(SS).map(ES).filter(CS)}var OS=xS(DS,{cacheKey:JSON.stringify});function kS(e){return OS(e)[0]||null}var AS=xS(kS,{cacheKey:JSON.stringify});const jS=/* @__PURE__ */ new Map;function MS(e){return function(t,n){let r=t||AS();jS.has(r)||jS.set(r,/* @__PURE__ */ new Map);let i=jS.get(r);if(!i.has(e)){let t=new Intl.DateTimeFormat(r||void 0,e);i.set(e,t.format.bind(t))}return i.get(e)(n)}}function NS(e){let t=new Date(e);return new Date(t.setHours(12))}function PS(e){return(t,n)=>MS(e)(t,NS(n))}const FS={day:`numeric`},IS={day:`numeric`,month:`long`,year:`numeric`},LS={month:`long`},RS={month:`long`,year:`numeric`},zS={weekday:`short`},BS={weekday:`long`},VS={year:`numeric`},HS=PS(FS),US=PS(IS),WS=PS(LS),GS=PS(RS),KS=PS(zS),qS=PS(BS),JS=PS(VS);function YS(e,t,n){return function(r,i=n){return t(e(r)+i)}}function XS(e){return function(t){return/* @__PURE__ */ new Date(e(t).getTime()-1)}}function ZS(e,t){return function(n){return[e(n),t(n)]}}function Z(e){if(e instanceof Date)return e.getFullYear();if(typeof e==`number`)return e;let t=Number.parseInt(e,10);if(typeof e==`string`&&!Number.isNaN(t))return t;throw Error(`Failed to get year from date: ${e}.`)}function QS(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function $S(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function eC(e){let t=Z(e),n=t+(-t+1)%100,r=/* @__PURE__ */ new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const tC=YS(Z,eC,-100),nC=YS(Z,eC,100),rC=XS(nC),iC=YS(Z,rC,-100),aC=ZS(eC,rC);function oC(e){let t=Z(e),n=t+(-t+1)%10,r=/* @__PURE__ */ new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const sC=YS(Z,oC,-10),cC=YS(Z,oC,10),lC=XS(cC),uC=YS(Z,lC,-10),dC=ZS(oC,lC);function fC(e){let t=Z(e),n=/* @__PURE__ */ new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const pC=YS(Z,fC,-1),mC=YS(Z,fC,1),hC=XS(mC),gC=YS(Z,hC,-1),_C=ZS(fC,hC);function vC(e,t){return function(n,r=t){let i=Z(n),a=QS(n)+r,o=/* @__PURE__ */ new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function yC(e){let t=Z(e),n=QS(e),r=/* @__PURE__ */ new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const bC=vC(yC,-1),xC=vC(yC,1),SC=XS(xC),CC=vC(SC,-1),wC=ZS(yC,SC);function TC(e,t){return function(n,r=t){let i=Z(n),a=QS(n),o=$S(n)+r,s=/* @__PURE__ */ new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function EC(e){let t=Z(e),n=QS(e),r=$S(e),i=/* @__PURE__ */ new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const DC=XS(TC(EC,1)),OC=ZS(EC,DC);function kC(e){return $S(SC(e))}const AC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},jC={gregory:[`en-CA`,`en-US`,`es-AR`,`es-BO`,`es-CL`,`es-CO`,`es-CR`,`es-DO`,`es-EC`,`es-GT`,`es-HN`,`es-MX`,`es-NI`,`es-PA`,`es-PE`,`es-PR`,`es-SV`,`es-VE`,`pt-BR`],hebrew:[`he`,`he-IL`],islamic:[`ar`,`ar-AE`,`ar-BH`,`ar-DZ`,`ar-EG`,`ar-IQ`,`ar-JO`,`ar-KW`,`ar-LY`,`ar-OM`,`ar-QA`,`ar-SA`,`ar-SD`,`ar-SY`,`ar-YE`,`dv`,`dv-MV`,`ps`,`ps-AR`]},MC=[0,1,2,3,4,5,6],NC=MC[0],PC=MC[5],FC=MC[6];function IC(e,t=AC.ISO_8601){let n=e.getDay();switch(t){case AC.ISO_8601:return(n+6)%7;case AC.ISLAMIC:return(n+1)%7;case AC.HEBREW:case AC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function LC(e){return Z(eC(e))}function RC(e){return Z(oC(e))}function zC(e,t=AC.ISO_8601){let n=Z(e),r=QS(e),i=e.getDate()-IC(e,t);return new Date(n,r,i)}function BC(e,t=AC.ISO_8601){let n=t===AC.GREGORY?AC.GREGORY:AC.ISO_8601,r=zC(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===AC.ISO_8601?4:1),o=zC(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function VC(e,t){switch(e){case`century`:return eC(t);case`decade`:return oC(t);case`year`:return fC(t);case`month`:return yC(t);case`day`:return EC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function HC(e,t){switch(e){case`century`:return tC(t);case`decade`:return sC(t);case`year`:return pC(t);case`month`:return bC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function UC(e,t){switch(e){case`century`:return nC(t);case`decade`:return cC(t);case`year`:return mC(t);case`month`:return xC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function WC(e,t){switch(e){case`decade`:return sC(t,-100);case`year`:return pC(t,-10);case`month`:return bC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function GC(e,t){switch(e){case`decade`:return cC(t,100);case`year`:return mC(t,10);case`month`:return xC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function KC(e,t){switch(e){case`century`:return rC(t);case`decade`:return lC(t);case`year`:return hC(t);case`month`:return SC(t);case`day`:return DC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function qC(e,t){switch(e){case`century`:return iC(t);case`decade`:return uC(t);case`year`:return gC(t);case`month`:return CC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function JC(e,t){switch(e){case`decade`:return uC(t,-100);case`year`:return gC(t,-10);case`month`:return CC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function YC(e,t){switch(e){case`century`:return aC(t);case`decade`:return dC(t);case`year`:return _C(t);case`month`:return wC(t);case`day`:return OC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function XC(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[VC(e,r[0]),KC(e,r[1])]}function ZC(e,t,n){return n.map(n=>(t||JS)(e,n)).join(` – `)}function QC(e,t,n){return ZC(e,t,aC(n))}function $C(e,t,n){return ZC(e,t,dC(n))}function ew(e){return e.getDay()===(/* @__PURE__ */ new Date()).getDay()}function tw(e,t=AC.ISO_8601){let n=e.getDay();switch(t){case AC.ISLAMIC:case AC.HEBREW:return n===PC||n===FC;case AC.ISO_8601:case AC.GREGORY:return n===FC||n===NC;default:throw Error(`Unsupported calendar type.`)}}const nw=`react-calendar__navigation`;function rw({activeStartDate:r,drillUp:i,formatMonthYear:a=GS,formatYear:o=JS,locale:s,maxDate:c,minDate:l,navigationAriaLabel:u=``,navigationAriaLive:d,navigationLabel:f,next2AriaLabel:p=``,next2Label:m=`»`,nextAriaLabel:h=``,nextLabel:g=`›`,prev2AriaLabel:_=``,prev2Label:v=`«`,prevAriaLabel:y=``,prevLabel:b=`‹`,setActiveStartDate:x,showDoubleView:S,view:C,views:w}){let T=w.indexOf(C)>0,E=C!==`century`,D=HC(C,r),O=E?WC(C,r):void 0,k=UC(C,r),A=E?GC(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=qC(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=JC(C,r);return l&&l>=e})(),N=c&&c<k,P=E&&c&&c<A;function F(){x(D,`prev`)}function ee(){x(O,`prev2`)}function I(){x(k,`next`)}function te(){x(A,`next2`)}function ne(e){let t=(()=>{switch(C){case`century`:return QC(s,o,e);case`decade`:return $C(s,o,e);case`year`:return o(s,e);case`month`:return a(s,e);default:throw Error(`Invalid view: ${C}.`)}})();return f?f({date:e,label:t,locale:s||AS()||void 0,view:C}):t}function re(){let a=`${nw}__label`;return n(`button`,{"aria-label":u,"aria-live":d,className:a,disabled:!T,onClick:i,style:{flexGrow:1},type:`button`,children:[t(`span`,{className:`${a}__labelText ${a}__labelText--from`,children:ne(r)}),S?n(e,{children:[t(`span`,{className:`${a}__divider`,children:` – `}),t(`span`,{className:`${a}__labelText ${a}__labelText--to`,children:ne(k)})]}):null]})}return n(`div`,{className:nw,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${nw}__arrow ${nw}__prev2-button`,disabled:M,onClick:ee,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${nw}__arrow ${nw}__prev-button`,disabled:j,onClick:F,type:`button`,children:b}),re(),g!==null&&t(`button`,{"aria-label":h,className:`${nw}__arrow ${nw}__next-button`,disabled:N,onClick:I,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${nw}__arrow ${nw}__next2-button`,disabled:P,onClick:te,type:`button`,children:m}):null]})}function iw(e){return`${e}%`}function aw({children:e,className:n,count:r,direction:i,offset:a,style:o,wrap:c,...l}){return t(`div`,{className:n,style:{display:`flex`,flexDirection:i,flexWrap:c?`wrap`:`nowrap`,...o},...l,children:s.map(e,(e,t)=>{let n=a&&t===0?iw(100*a/r):null;return u(e,{...e.props,style:{flexBasis:iw(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function ow(e,t,n){return t&&t>e?t:n&&n<e?n:e}function sw(e,t){return t[0]<=e&&t[1]>=e}function cw(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function lw(e,t){return sw(e[0],t)||sw(e[1],t)}function uw(e,t,n){let r=lw(t,e),i=[];if(r){i.push(n);let r=sw(e[0],t),a=sw(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function dw(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function fw(e){if(!e)throw Error(`args is required`);let{value:t,date:n,hover:r}=e,i=`react-calendar__tile`,a=[i];if(!n)return a;let o=/* @__PURE__ */ new Date,s=(()=>{if(Array.isArray(n))return n;let{dateType:t}=e;if(!t)throw Error(`dateType is required when date is not an array of two dates`);return YC(t,n)})();if(sw(o,s)&&a.push(`${i}--now`),!t||!dw(t))return a;let c=(()=>{if(Array.isArray(t))return t;let{valueType:n}=e;if(!n)throw Error(`valueType is required when value is not an array of two dates`);return YC(n,t)})();cw(c,s)?a.push(`${i}--active`):lw(c,s)&&a.push(`${i}--hasActive`);let l=uw(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=uw(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function pw({className:e,count:n=3,dateTransform:r,dateType:i,end:a,hover:o,offset:s,renderTile:c,start:l,step:u=1,value:d,valueType:f}){let p=[];for(let e=l;e<=a;e+=u){let t=r(e);p.push(c({classes:fw({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(aw,{className:e,count:n,offset:s,wrap:!0,children:p})}function mw(e){let{activeStartDate:i,children:a,classes:o,date:s,formatAbbr:c,locale:l,maxDate:u,maxDateTransform:d,minDate:f,minDateTransform:p,onClick:m,onMouseOver:h,style:g,tileClassName:_,tileContent:v,tileDisabled:y,view:b}=e,x=S(()=>typeof _==`function`?_({activeStartDate:i,date:s,view:b}):_,[i,s,_,b]),C=S(()=>typeof v==`function`?v({activeStartDate:i,date:s,view:b}):v,[i,s,v,b]);return n(`button`,{className:r(o,x),disabled:f&&p(f)>s||u&&d(u)<s||y?.({activeStartDate:i,date:s,view:b}),onClick:m?e=>m(s,e):void 0,onFocus:h?()=>h(s):void 0,onMouseOver:h?()=>h(s):void 0,style:g,type:`button`,children:[c?t(`abbr`,{"aria-label":c(l,s),children:a}):a,C]})}const hw=`react-calendar__century-view__decades__decade`;function gw({classes:e=[],currentCentury:n,formatYear:r=JS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(hw),eC(a).getFullYear()!==n&&s.push(`${hw}--neighboringCentury`),t(mw,{...i,classes:s,maxDateTransform:lC,minDateTransform:oC,view:`century`,children:$C(o,r,a)})}function _w(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=LC(n),l=c+(i?119:99);return t(pw,{className:`react-calendar__century-view__decades`,dateTransform:oC,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(gw,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function vw(e){function n(){return t(_w,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const yw=`react-calendar__decade-view__years__year`;function bw({classes:e=[],currentDecade:n,formatYear:r=JS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(yw),oC(a).getFullYear()!==n&&s.push(`${yw}--neighboringDecade`),t(mw,{...i,classes:s,maxDateTransform:hC,minDateTransform:fC,view:`decade`,children:r(o,a)})}function xw(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=RC(n),l=c+(i?11:9);return t(pw,{className:`react-calendar__decade-view__years`,dateTransform:fC,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(bw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function Sw(e){function n(){return t(xw,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const Cw=`react-calendar__month-view__days__day`;function ww({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=HS,formatLongDate:a=US,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(Cw),tw(s,e)&&l.push(`${Cw}--weekend`),s.getMonth()!==r&&l.push(`${Cw}--neighboringMonth`),t(mw,{...o,classes:l,formatAbbr:a,maxDateTransform:DC,minDateTransform:EC,view:`month`,children:i(c,s)})}function Tw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=QS(n),f=a||o,p=IC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=kC(n);if(o){let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-IC(t,r)-1)}return e})();return t(pw,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),EC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(ww,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const Ew=`react-calendar__month-view__weekdays`,Dw=`${Ew}__weekday`;function Ow(e){let{calendarType:n,formatShortWeekday:i=KS,formatWeekday:a=qS,locale:o,onMouseLeave:s}=e,c=yC(/* @__PURE__ */ new Date),l=Z(c),u=QS(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-IC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(Dw,ew(s)&&`${Dw}--current`,tw(s,n)&&`${Dw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(aw,{className:Ew,count:7,onFocus:s,onMouseOver:s,children:d})}const kw=`react-calendar__tile`;function Aw(e){let{onClickWeekNumber:n,weekNumber:r}=e,i=t(`span`,{children:r});if(n){let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`button`,{...o,className:kw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:kw,children:i})}}function jw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=kC(n)-(7-IC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=QS(n),i=$S(n),a=[];for(let n=0;n<s;n+=1)a.push(zC(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>BC(e,r));return t(aw,{className:`react-calendar__month-view__weekNumbers`,count:s,direction:`column`,onFocus:a,onMouseOver:a,style:{flexBasis:`calc(100% * (1 / 8)`,flexShrink:0},children:l.map((e,n)=>{let r=c[n];if(!r)throw Error(`date is not defined`);return t(Aw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function Mw(e){if(e){for(let[t,n]of Object.entries(jC))if(n.includes(e))return t}return AC.ISO_8601}function Nw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=Mw(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(Ow,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(jw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(Tw,{calendarType:c,...p})}let _=`react-calendar__month-view`;return t(`div`,{className:r(_,f?`${_}--weekNumbers`:``),children:n(`div`,{style:{display:`flex`,alignItems:`flex-end`},children:[h(),n(`div`,{style:{flexGrow:1,width:`100%`},children:[m(),g()]})]})})}function Pw({classes:e=[],formatMonth:n=WS,formatMonthYear:r=GS,...i}){let{date:a,locale:o}=i;return t(mw,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:SC,minDateTransform:yC,view:`year`,children:n(o,a)})}function Fw(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(pw,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(s,e,1),yC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(Pw,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function Iw(e){function n(){return t(Fw,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const Lw=`react-calendar`,Rw=[`century`,`decade`,`year`,`month`],zw=[`decade`,`year`,`month`,`day`],Bw=/* @__PURE__ */ new Date;Bw.setFullYear(1,0,1),Bw.setHours(0,0,0,0);const Vw=/* @__PURE__ */ new Date(864e13);function Hw(e){return e instanceof Date?e:new Date(e)}function Uw(e,t){return Rw.slice(Rw.indexOf(e),Rw.indexOf(t)+1)}function Ww(e,t,n){return Uw(t,n).indexOf(e)!==-1}function Gw(e,t,n){return e&&Ww(e,t,n)?e:n}function Kw(e){let t=Rw.indexOf(e);return zw[t]}function qw(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=Hw(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function Jw({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=qw(e,i);if(!a)return null;let o=Kw(r);return ow((()=>{switch(i){case 0:return VC(o,a);case 1:return KC(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const Yw=e=>Jw(e,0),Xw=e=>Jw(e,1),Zw=e=>[Yw,Xw].map(t=>t(e));function Qw({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return VC(Gw(a,r,t),Yw({value:i,minDate:n,maxDate:e,maxDetail:t})||/* @__PURE__ */ new Date)}function $w({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=Gw(l,s,a),d=e||t;return d?VC(u,d):Qw({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function eT(e){return e&&(!Array.isArray(e)||e.length===1)}function tT(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var nT=p(function(e,i){let{activeStartDate:a,allowPartialRange:o,calendarType:s,className:c,"data-testid":l,defaultActiveStartDate:u,defaultValue:d,defaultView:f,formatDay:p,formatLongDate:m,formatMonth:g,formatMonthYear:_,formatShortWeekday:v,formatWeekday:b,formatYear:x,goToRangeStartOnSelect:S=!0,inputRef:C,locale:T,maxDate:E=Vw,maxDetail:D=`month`,minDate:O=Bw,minDetail:k=`century`,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:F,nextLabel:ee,onActiveStartDateChange:I,onChange:te,onClickDay:ne,onClickDecade:re,onClickMonth:ie,onClickWeekNumber:ae,onClickYear:oe,onDrillDown:se,onDrillUp:ce,onViewChange:le,prev2AriaLabel:ue,prev2Label:de,prevAriaLabel:fe,prevLabel:pe,returnValue:me=`start`,selectRange:he,showDoubleView:ge,showFixedNumberOfWeeks:_e,showNavigation:ve=!0,showNeighboringCentury:ye,showNeighboringDecade:be,showNeighboringMonth:xe=!0,showWeekNumbers:Se,tileClassName:Ce,tileContent:we,tileDisabled:Te,value:Ee,view:De}=e,[Oe,ke]=w(u),[Ae,je]=w(null),[Me,Ne]=w(Array.isArray(d)?d.map(e=>e===null?null:Hw(e)):d==null?null:Hw(d)),[Pe,Fe]=w(f),Ie=a||Oe||$w({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:Ee,view:De}),Le=(()=>{let e=he&&eT(Me)||Ee===void 0?Me:Ee;return e?Array.isArray(e)?e.map(e=>e===null?null:Hw(e)):e===null?null:Hw(e):null})(),L=Kw(D),R=Gw(De||Pe,k,D),Re=Uw(k,D),ze=he?Ae:null,Be=Re.indexOf(R)<Re.length-1,Ve=Re.indexOf(R)>0,He=h(e=>(()=>{switch(me){case`start`:return Yw;case`end`:return Xw;case`range`:return Zw;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,me]),Ue=h((e,t)=>{ke(e);let n={action:t,activeStartDate:e,value:Le,view:R};I&&!tT(Ie,e)&&I(n)},[Ie,I,Le,R]),We=h((e,t)=>{let n=(()=>{switch(R){case`century`:return re;case`decade`:return oe;case`year`:return ie;case`month`:return ne;default:throw Error(`Invalid view: ${R}.`)}})();n&&n(e,t)},[ne,re,ie,oe,R]),Ge=h((e,t)=>{if(!Be)return;We(e,t);let n=Re[Re.indexOf(R)+1];if(!n)throw Error(`Attempted to drill down from the lowest view.`);ke(e),Fe(n);let r={action:`drillDown`,activeStartDate:e,value:Le,view:n};I&&!tT(Ie,e)&&I(r),le&&R!==n&&le(r),se&&se(r)},[Ie,Be,I,We,se,le,Le,R,Re]),Ke=h(()=>{if(!Ve)return;let e=Re[Re.indexOf(R)-1];if(!e)throw Error(`Attempted to drill up from the highest view.`);let t=VC(e,Ie);ke(t),Fe(e);let n={action:`drillUp`,activeStartDate:t,value:Le,view:e};I&&!tT(Ie,t)&&I(n),le&&R!==e&&le(n),ce&&ce(n)},[Ie,Ve,I,ce,le,Le,R,Re]),qe=h((e,t)=>{let n=Le;We(e,t);let r=he&&!eT(n),i;if(he){if(r)i=VC(L,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=XC(L,n,e)}}else i=He(e);let a=!he||r||S?Qw({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:R}):null;t.persist(),ke(a),Ne(i);let s={action:`onChange`,activeStartDate:a,value:i,view:R};if(I&&!tT(Ie,a)&&I(s),te){if(he){if(!eT(i))te(i||null,t);else if(o){if(Array.isArray(i))throw Error(`value must not be an array`);te([i||null,null],t)}}else te(i||null,t)}},[Ie,o,He,S,E,D,O,k,I,te,We,he,Le,L,R]);function Je(e){je(e)}function Ye(){je(null)}y(i,()=>({activeStartDate:Ie,drillDown:Ge,drillUp:Ke,onChange:qe,setActiveStartDate:Ue,value:Le,view:R}),[Ie,Ge,Ke,qe,Ue,Le,R]);function Xe(e){let n={activeStartDate:e?UC(R,Ie):VC(R,Ie),hover:ze,locale:T,maxDate:E,minDate:O,onClick:Be?Ge:qe,onMouseOver:he?Je:void 0,tileClassName:Ce,tileContent:we,tileDisabled:Te,value:Le,valueType:L};switch(R){case`century`:return t(vw,{formatYear:x,showNeighboringCentury:ye,...n});case`decade`:return t(Sw,{formatYear:x,showNeighboringDecade:be,...n});case`year`:return t(Iw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(Nw,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:ae,onMouseLeave:he?Ye:void 0,showFixedNumberOfWeeks:_e===void 0?ge:_e,showNeighboringMonth:xe,showWeekNumbers:Se,...n});default:throw Error(`Invalid view: ${R}.`)}}function Ze(){return ve?t(rw,{activeStartDate:Ie,drillUp:Ke,formatMonthYear:_,formatYear:x,locale:T,maxDate:E,minDate:O,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:F,nextLabel:ee,prev2AriaLabel:ue,prev2Label:de,prevAriaLabel:fe,prevLabel:pe,setActiveStartDate:Ue,showDoubleView:ge,view:R,views:Re}):null}return n(`div`,{className:r(Lw,he&&(Array.isArray(Le)?Le:[Le]).length===1&&`${Lw}--selectRange`,ge&&`${Lw}--doubleView`,c),"data-testid":l,ref:C,children:[Ze(),n(`div`,{className:`${Lw}__viewContainer`,onBlur:he?Ye:void 0,onMouseLeave:he?Ye:void 0,children:[Xe(),ge?Xe(!0):null]})]})});he.extend(_e),he.extend(ge);var Q=he,rT=Object.defineProperty,iT=(e,t)=>rT(e,`name`,{value:t,configurable:!0}),aT=`Popover`,[oT,sT]=/* @__PURE__ */ Pn(aT,[_r]),cT=_r(),[lT,uT]=oT(aT),dT=/* @__PURE__ */ iT(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=cT(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=a.useState(0),[h,g]=a.useState(0),[_,v]=Yr({prop:i,defaultProp:o??!1,onChange:s,caller:aT});return/* @__PURE__ */ t(br,{...l,children:/* @__PURE__ */ t(lT,{scope:n,contentId:H(),titleId:H(),descriptionId:H(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,triggerRef:u,open:_,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:c,children:r})})},`Popover`),fT=`PopoverAnchor`,pT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let{__scopePopover:r,...i}=e,o=uT(fT,r),s=cT(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),/* @__PURE__ */ t(Sr,{...s,...i,ref:n})},`PopoverAnchor`)),mT=`PopoverTrigger`,hT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let{__scopePopover:r,...i}=e,a=uT(mT,r),o=cT(r),s=z(n,a.triggerRef),c=/* @__PURE__ */ t(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":OT(a.open),...i,ref:s,onClick:V(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:/* @__PURE__ */ t(Sr,{asChild:!0,...o,children:c})},`PopoverTrigger`)),gT=`PopoverPortal`,[_T,vT]=oT(gT,{forceMount:void 0}),yT=/* @__PURE__ */ iT(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=uT(gT,n);return/* @__PURE__ */ t(_T,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Fr,{present:r||o.open,children:/* @__PURE__ */ t(jr,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),bT=`PopoverContent`,xT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let r=vT(bT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=uT(bT,e.__scopePopover);return/* @__PURE__ */ t(Fr,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(CT,{...a,ref:n}):/* @__PURE__ */ t(wT,{...a,ref:n})})},`PopoverContent`)),ST=/* @__PURE__ */ cn(`PopoverContent.RemoveScroll`),CT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let r=uT(bT,e.__scopePopover),i=a.useRef(null),o=z(n,i),s=a.useRef(!1),{nodes:c,registry:l}=I();return a.useEffect(()=>{let e=i.current;if(e)return pe(e)},[]),/* @__PURE__ */ t(fe,{as:ST,allowPinchZoom:!0,shards:a.useMemo(()=>[i,...c.map(e=>({current:e}))],[i,c]),children:/* @__PURE__ */ t(TT,{...e,ref:o,branchNodes:c,branchRegistry:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),wT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let r=uT(bT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(TT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`PopoverContentNonModal`)),TT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,"aria-describedby":p,branchNodes:m,branchRegistry:h,...g}=e,_=uT(bT,r),v=cT(r),[y,b]=a.useState(null),x=z(n,b);return ee(y),de(),/* @__PURE__ */ t(F,{registry:h,children:/* @__PURE__ */ t(P,{asChild:!0,loop:!0,trapped:i,branches:m,onMountAutoFocus:o,onUnmountAutoFocus:s,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ t(Er,{"data-state":OT(_.open),role:`dialog`,id:_.contentId,"aria-labelledby":_.titlePresent?_.titleId:void 0,"aria-describedby":_.descriptionPresent?kT(p,_.descriptionId):p,...v,...g,ref:x,style:{...g.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`)),ET=`PopoverClose`,DT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let{__scopePopover:r,...i}=e,a=uT(ET,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function OT(e){return e?`open`:`closed`}iT(OT,`getState`);function kT(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}iT(kT,`concatAriaDescribedby`);const AT=a.createContext(null),jT=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(AT.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(dT,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function MT(e=!1,t=()=>{},n){e&&t(n===`enter`)}const NT=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(AT);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(hT,{ref:r,asChild:!0,onMouseEnter:()=>MT(s,o,`enter`),onMouseLeave:()=>MT(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});NT.displayName=hT.displayName;const PT=pT,FT=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(AT);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=Bi();return t(yT,{container:u,children:t(xT,{ref:o,align:n,side:r,onMouseEnter:()=>MT(l,c,`enter`),onMouseLeave:()=>MT(l,c,`leave`),className:B(`z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-border shadow-md focus:outline-none animate-in`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});FT.displayName=xT.displayName;const IT=DT;IT.displayName=DT.displayName;function LT(){let e=a.useContext(AT);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const RT=`
|
|
247
247
|
.calendar-wrapper .react-calendar__navigation {
|
|
248
248
|
display: flex !important;
|
|
249
249
|
justify-content: space-between !important;
|
|
@@ -329,12 +329,12 @@ function iy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ Mn(n),[o,s]=r(
|
|
|
329
329
|
text-align: center !important;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
`,
|
|
332
|
+
`,zT=({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(jT,{_open:o,onOpenChange:s,children:[t(NT,{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(FT,{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:RT}),t(nT,{value:f,onChange:m,selectRange:!0,returnValue:`range`,maxDate:(()=>{let e=/* @__PURE__ */ 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=/* @__PURE__ */ 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(W,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(W,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:RT}),t(nT,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{let e=/* @__PURE__ */ 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=/* @__PURE__ */ 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 BT({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=w(i||n),[s,c]=w(!1);return _(()=>{r?(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)}})():o(i||n)},[n,r,i]),s?t(`span`,{className:`text-muted`,children:`Loading...`}):t(e,{children:a})}const VT=({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(jT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(NT,{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(BT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(FT,{className:`w-[300px] p-0`,children:t(sS,{children:n(ny,{children:[t(iy,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(ay,{children:[t(oy,{children:m(`filter.noResultsFound`)}),t(sy,{children:i.map(e=>n(ly,{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(BT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(cy,{}),t(sy,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(ly,{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(Qg,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(BT,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},HT=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(jT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(NT,{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(FT,{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(_a,{value:s,onChange:c,placeholder:`Add ${e.toLowerCase()}...`}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},UT=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`}}),WT=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:B(UT({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(W,{variant:`link`,size:`icon`,type:`button`,onClick:f,className:`clear-button opacity-0 transition-opacity duration-200
|
|
333
333
|
absolute top-1/2 -translate-y-1/2 text-muted !hover:text-destructive cursor-pointer
|
|
334
|
-
flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(St,{size:16})})]})});kT.displayName=`Input`;const AT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(gT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(vT,{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(bT,{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(kT,{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(K,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(K,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function jT({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,_=/* @__PURE__ */ 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:CT}),t(Vw,{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=/* @__PURE__ */ 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(K,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(K,{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:CT}),t(Vw,{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=/* @__PURE__ */ 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 MT({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(Jv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(TT,{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(K,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(K,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function NT({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(ha,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(K,{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 PT({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(kT,{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(K,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(K,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function FT(e,n,r){switch(e.type){case`date`:return t(wT,{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(AT,{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(DT,{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(ET,{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 IT({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}),FT(e,r,i),t(K,{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(St,{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 LT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),RT=({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(/* @__PURE__ */ 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(HT(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(HT(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(LT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},zT=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(LT),{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=>HT(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(Gv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(Jv,{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(gT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(vT,{asChild:!0,children:n(K,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:H(`transition group flex gap-1.5`,e),children:[t(it,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(bT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(Vv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(Uv,{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(Wv,{children:t(Kv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(jT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(PT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(NT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(MT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},BT=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(LT);return t(`div`,{className:H(e),children:t(IT,{filters:n,setFilters:r,filterGroups:i})})},VT=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(LT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(K,{variant:`outline`,size:`md`,className:H(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function HT(e){return typeof e==`string`?e:e.value||``}var UT;(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`})(UT||={});const WT=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:H({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})});WT.displayName=`Heading`;function GT({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":F,"aria-invalid":I}){let L=C(null),[R,ee]=w(!1),[te,ne]=w(0),[re,ie]=w(``),ae=v(),oe=v(),se=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?KT(e,T)===KT(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=L.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ne(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let ce=e=>{if(x){let t=Array.isArray(s)?s:[];le(e,t)?c(t.filter(t=>!ue(t,e))):c([...t,e])}else c(e)},le=(e,t)=>!t||t.length===0?!1:t.some(t=>ue(t,e)),ue=(e,t)=>e==null||t==null?e===t:typeof T==`string`?KT(e,T)===KT(t,T):typeof T==`function`?T(e,t):ge(e,t),de=i||[];function fe(e){return e?typeof e==`string`?t=>String(KT(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let pe=re.toLowerCase(),me=fe(f);de=de.filter(e=>me(e).includes(pe));let he=()=>{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},_e=()=>{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`]})]})},ve=(e,r)=>{let i=x?le(e,Array.isArray(s)?s:[]):s!=null&&ue(s,e);return t(Jv,{onSelect:()=>ce(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(Ie,{className:`size-4`})]}):n(xT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Ie,{className:`size-4`})]})},`option-${r}`)},ye=(()=>{if(!o)return null;let e=[],t=/* @__PURE__ */ new Map;for(let n of de){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})(),be=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1 shrink-0`,children:[t(`div`,{className:`mx-2`,children:t(mt,{className:`size-4`})}),t(kT,{variant:`unstyled`,value:re,onChange:ie,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(Vv,{className:E?`min-h-0 flex-1`:`overflow-hidden`,children:n(Wv,{className:E?`min-h-0 flex-1 overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(Gv,{children:`No result found.`}),ye?ye.map(e=>t(Kv,{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)=>ve(t,`${e.key}-${n}`))},e.key)):t(Kv,{children:de?.map((e,t)=>ve(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(gt,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(`flex flex-col`,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(ot,{className:`size-4 animate-spin`})}):be()});let xe=!!p,Se=M??(xe?void 0:typeof m==`string`?m:void 0),Ce=N??(xe?oe:void 0),we=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Te=I===!0||I===`true`||se?!0:I===!1||I===`false`?!1:void 0;return n(gT,{onOpenChange:ee,children:[n(`div`,{ref:L,className:r(`relative`,h),children:[t(vT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":R,"aria-controls":ae,"aria-label":Se,"aria-labelledby":Ce,"aria-describedby":F,"aria-invalid":Te,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&&(se||Te?`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`,we&&`pe-10`)),children:D?t(ot,{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:oe,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,se&&`text-destructive`),children:[se&&t(Ui,{description:k,placement:`top`,asChild:!0,children:t(bt,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?_e():he()]})]}),!d&&t(We,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),we&&!D&&t(K,{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(St,{className:`size-4`})})]}),t(bT,{id:ae,style:{width:`${te}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:be()})]})}function KT(e,t){return typeof e==`object`&&e?e[t]:void 0}const qT={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 JT({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(GT,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>qT[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var YT=Object.defineProperty,XT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>YT(e,`name`,{value:t,configurable:!0}))(function(e,n){return/* @__PURE__ */ t(G.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 ZT=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),QT=a.forwardRef(({className:e,required:r,...i},a)=>n(XT,{ref:a,className:H(ZT(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));QT.displayName=XT.displayName;function $T({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Je,{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(bt,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Ke,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(nt,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(nt,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(nt,{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 eE({title:e,className:r,children:i,action:a,actionLabel:o}){return n($T,{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(K,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function tE({title:e,className:n,children:r}){return t($T,{status:`info`,title:e,className:n,children:r})}function nE({title:e,className:n,children:r}){return t($T,{status:`warning`,title:e,className:n,children:r})}function rE({title:e,className:n,children:r}){return t($T,{status:`success`,title:e,className:n,children:r})}function iE({title:e,className:n,children:r}){return t($T,{status:`default`,title:e,className:n,children:r})}function aE({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(kv,{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(bt,{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(Av,{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(ca,{label:l??u,children:t(kT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(Mv,{align:`right`,children:[t(K,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(K,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function oE(){return g(sE)}const sE=d(()=>{}),cE={success:Ke,error:Je,warning:bt,info:nt},lE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function uE({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=cE[e.status]||nt,u=lE[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(om,{onExitComplete:r,children:i&&t(Qh.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(St,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function dE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(sE.Provider,{value:o,children:r}),i&&t(rg,{children:t(uE,{data:i,onClose:()=>o(null)})})]})}function fE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=oE();return t(aE,{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 pE=4,mE={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 hE(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 gE({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(Dx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(kx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Re,{className:`ms-1 size-4`})]})}),t(Ax,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function _E({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=mE[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=hE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:H(`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:H(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:H(c.base,c.inactive),children:[h,t(Re,{className:c.icon})]})]}),n(`div`,{className:H(`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:H(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(gE,{label:h,triggerClassName:H(c.base,m?c.active:c.inactive),icon:t(Re,{className:c.icon}),children:p.map(e=>t(Mx,{disabled:e.disabled,onClick:()=>i(e.name),className:H(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function vE({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?Re:He,{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(aa,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(K,{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 yE=Object.defineProperty,bE=(e,t)=>yE(e,`name`,{value:t,configurable:!0}),xE=`Radio`,[SE,CE]=/* @__PURE__ */ Mn(xE),[wE,TE]=SE(xE);function EE(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),[_,v]=a.useState(null),y={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,userClick:_,onUserClick:v,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:/* @__PURE__ */ bE(()=>l?.(),`onCheck`)};return/* @__PURE__ */ t(wE,{scope:n,...y,children:NE(f)?f(y):i})}bE(EE,`RadioProvider`);var DE=`RadioTrigger`,OE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,onUserClick:u,isFormControl:d,bubbleInput:f}=TE(DE,e),p=V(i,c);return/* @__PURE__ */ t(G.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":PE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:p,onClick:U(n,e=>{let t=e.isPropagationStopped();a||(u({hasConsumerStoppedPropagation:t}),l()),f&&d&&(t||e.stopPropagation())})})},`RadioTrigger`)),kE=`RadioIndicator`,AE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=TE(kE,r);return/* @__PURE__ */ t(Nr,{present:i||o.checked,children:/* @__PURE__ */ t(G.span,{"data-state":PE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),jE=`RadioBubbleInput`,ME=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(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,userClick:h}=TE(jE,e),g=V(i,m),_=cr(o),v=a.useRef(!1),y=a.useRef(s),b=a.useRef(h),x=a.useRef(null);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=y.current!==s;y.current=s;let i=h!==null&&h!==b.current;if(b.current=h,i)x.current=r?null:h,r&&n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!h.hasConsumerStoppedPropagation}));else if(r){let t=x.current;x.current=null;let r=s&&t!==null;v.current=!0,n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),v.current=!1}},[p,s,h]);let S=a.useRef(s);return/* @__PURE__ */ t(G.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:g,onClick:U(n,e=>{v.current&&e.stopPropagation()}),style:{...r.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function NE(e){return typeof e==`function`}bE(NE,`isFunction`);function PE(e){return e?`checked`:`unchecked`}bE(PE,`getState`);var FE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],IE=`RadioGroup`,[LE,RE]=/* @__PURE__ */ Mn(IE,[Dy,CE]),zE=Dy(),BE=CE(),[VE,HE]=LE(IE),UE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(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=zE(r),_=fe(f),[v,y]=qr({prop:c,defaultProp:s??null,onChange:m,caller:IE}),[b,x]=a.useState(null),S=V(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=/* @__PURE__ */ bE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),/* @__PURE__ */ t(VE,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:/* @__PURE__ */ t(My,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:/* @__PURE__ */ t(G.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),WE=`RadioGroupItemProvider`,GE=`RadioGroupItemTrigger`;function KE(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=HE(WE,n),c=BE(n),l=s.disabled||i;return/* @__PURE__ */ t(EE,{...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})}bE(KE,`RadioGroupItemProvider`);var qE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=zE(r),s=BE(r),{checked:c,disabled:l}=TE(GE,s.__scopeRadio),u=a.useRef(null),d=V(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=/* @__PURE__ */ bE(e=>{FE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ bE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ t(Fy,{asChild:!0,...o,focusable:!l,active:c,children:/* @__PURE__ */ t(OE,{...s,...i,ref:d,onKeyDown:U(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:U(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),JE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return/* @__PURE__ */ t(KE,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(qE,{...c,ref:i,__scopeRadioGroup:a}),r&&/* @__PURE__ */ t(YE,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),YE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=BE(r);return/* @__PURE__ */ t(ME,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),XE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=BE(r);return/* @__PURE__ */ t(AE,{...a,...i,ref:n})},`RadioGroupIndicator`));function ZE({className:e,...n}){return t(JE,{"data-slot":`radio-group-item`,className:H(`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(XE,{"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 QE=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function $E({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(UE,{"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(JE,{value:o(e),className:H(`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 eD({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:H(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function tD(e){return typeof e==`number`?`${e}%`:e}function nD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:tD(e),minSize:tD(n),maxSize:tD(r),collapsedSize:tD(i),...a})}function rD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:H(`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(ct,{className:`size-4 rotate-90`})})})}var iD=Object.defineProperty,aD=(e,t)=>iD(e,`name`,{value:t,configurable:!0}),oD={Horizontal:`horizontal`,Vertical:`vertical`},sD=oD.Horizontal,cD=Object.values(oD),lD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ aD(function(e,n){let{decorative:r,orientation:i=sD,...a}=e,o=uD(i)?i:sD,s=o===oD.Vertical?o:void 0,c=r?{role:`none`}:{"aria-orientation":s,role:`separator`};return/* @__PURE__ */ t(G.div,{"data-orientation":o,...c,...a,ref:n})},`Separator`));function uD(e){return cD.includes(e)}aD(uD,`isValidOrientation`);const dD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(lD,{ref:a,decorative:r,orientation:n,className:H(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));dD.displayName=lD.displayName;var fD=Object.defineProperty,pD=(e,t)=>fD(e,`name`,{value:t,configurable:!0});function mD(e,[t,n]){return Math.min(n,Math.max(t,e))}pD(mD,`clamp`);var hD=Object.defineProperty,$=(e,t)=>hD(e,`name`,{value:t,configurable:!0}),gD={Vertical:`vertical`,Horizontal:`horizontal`},_D={LTR:`ltr`,RTL:`rtl`},vD=[`PageUp`,`PageDown`],yD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],bD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},xD=`Slider`,[SD,CD,wD]=/* @__PURE__ */ Qv(xD),[TD,ED]=/* @__PURE__ */ Mn(xD,[wD]),[DD,OD]=TD(xD),kD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=gD.Horizontal,disabled:l=!1,minStepsBetweenThumbs:u=0,preserveThumbOrder:d=!1,defaultValue:f=[i],value:p,onValueChange:m=/* @__PURE__ */ $(()=>{},`onValueChange`),onValueCommit:h=/* @__PURE__ */ $(()=>{},`onValueCommit`),inverted:g=!1,form:_,...v}=e,y=a.useRef(/* @__PURE__ */ new Set),b=a.useRef(0),x=a.useRef(!1),[S,C]=a.useState(null),w=c===gD.Horizontal?MD:ND,[T,E]=a.useState(null),D=V(n,E),[O=[],k]=qr({prop:p,defaultProp:f,onChange:/* @__PURE__ */ $(e=>{[...y.current][b.current]?.focus({preventScroll:!0,focusVisible:x.current}),x.current=!1,m(e)},`onChange`)}),A=a.useRef(O),j=a.useRef(O);a.useEffect(()=>{let e=_?T?.ownerDocument.getElementById(_):T?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ $(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[T,_,k]);function M(e){F(e,ZD(O,e))}$(M,`handleSlideStart`);function N(e){F(e,b.current)}$(N,`handleSlideMove`);function P(){String(O)!==String(A.current)&&h(O)}$(P,`handleSlideEnd`);function F(e,t,{commit:n}={commit:!1}){let r=nO(s),a=mD(rO(Math.round((e-i)/s)*s+i,r),[i,o]),c=u*s;function l(e){let n=d?mD(a,[e[t-1]===void 0?i:e[t-1]+c,e[t+1]===void 0?o:e[t+1]-c]):a,r=JD(e,n,t);return eO(r,c)?{nextValues:r,changedIndex:d?t:r.indexOf(n),hasChanged:String(r)!==String(e)}:null}$(l,`getNextValues`);let f=l(O);f?.hasChanged&&C(f.nextValues),k((e=[])=>{let t=l(e);return t?(b.current=t.changedIndex,t.hasChanged&&n&&h(t.nextValues),t.hasChanged?t.nextValues:e):e})}return $(F,`updateValues`),/* @__PURE__ */ t(DD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:b,thumbs:y.current,values:O,orientation:c,form:_,userRequestedValues:S,children:/* @__PURE__ */ t(SD.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(SD.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(w,{"aria-disabled":l,"data-disabled":l?``:void 0,...v,ref:D,onPointerDown:U(v.onPointerDown,()=>{l||(A.current=O,x.current=!1)}),min:i,max:o,inverted:g,onSlideStart:l?void 0:M,onSlideMove:l?void 0:N,onSlideEnd:l?void 0:P,onHomeKeyDown:()=>{l||(x.current=!0,F(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(x.current=!0,F(o,O.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){x.current=!0;let n=vD.includes(e.key)||e.shiftKey&&yD.includes(e.key)?10:1,r=b.current,a=O[r];F(iO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[AD,jD]=TD(xD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),MD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(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=V(n,m),g=a.useRef(void 0),_=fe(o),v=_===_D.LTR,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=tO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),/* @__PURE__ */ t(AD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:/* @__PURE__ */ t(PD,{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=bD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),ND=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(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=V(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=tO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),/* @__PURE__ */ t(AD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:/* @__PURE__ */ t(PD,{"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=bD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),PD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=OD(xD,r);return/* @__PURE__ */ t(G.span,{...u,ref:n,onKeyDown:U(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):vD.concat(yD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:U(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:U(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:U(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),FD=`SliderTrack`,ID=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=OD(FD,r);return/* @__PURE__ */ t(G.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),LD=`SliderRange`,RD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,o=OD(LD,r),s=jD(LD,r),c=V(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>YD(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return/* @__PURE__ */ t(G.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[zD,BD]=TD(`SliderThumb`),VD=`SliderThumbProvider`;function HD(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=OD(VD,n),c=CD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=cr(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:YD(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/* @__PURE__ */ t(zD,{scope:n,..._,children:aO(o)?o(_):i})}$(HD,`SliderThumbProvider`);var UD=`SliderThumbTrigger`,WD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=OD(UD,r),o=jD(UD,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=BD(UD,r),f=V(n,d),p=XD(s,a.values.length),m=u?.[o.size],h=m?QD(m,l,o.direction):0;return/* @__PURE__ */ t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:/* @__PURE__ */ t(SD.ItemSlot,{scope:r,children:/* @__PURE__ */ t(G.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:U(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),GD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return/* @__PURE__ */ t(HD,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(WD,{...s,ref:i,__scopeSlider:a}),o?/* @__PURE__ */ t(qD,{__scopeSlider:a},r):null]})})},`SliderThumb`)),KD=`SliderBubbleInput`,qD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function({__scopeSlider:e,onInput:n,...r},i){let{index:o,value:s,name:c,form:l}=BD(KD,e),{userRequestedValues:u}=OD(KD,e),d=a.useRef(null),f=V(d,i),p=a.useRef(!1),m=a.useRef(s),h=a.useRef(u),g=a.useRef(u);return a.useEffect(()=>{let e=d.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=m.current,i=r!==s;m.current=s;let a=u!==g.current;if(g.current=u,i&&n){let t=u!==h.current;h.current=u;let i=u?.[o];p.current=!(t&&(a&&i!==r||i===s));let c=new Event(`input`,{bubbles:!0});n.call(e,s),e.dispatchEvent(c),p.current=!1}},[o,s,u]),/* @__PURE__ */ t(G.input,{style:{display:`none`},name:c,form:l,...r,ref:f,defaultValue:s,onInput:U(n,e=>{p.current&&e.stopPropagation()})})},`SliderBubbleInput`));function JD(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(JD,`getNextSortedValues`);function YD(e,t,n){return mD(100/(n-t)*(e-t),[0,100])}$(YD,`convertValueToPercentage`);function XD(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(XD,`getLabel`);function ZD(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)}$(ZD,`getClosestValueIndex`);function QD(e,t,n){let r=e/2;return(r-tO([0,50],[0,r])(t)*n)*n}$(QD,`getThumbInBoundsOffset`);function $D(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$($D,`getStepsBetweenValues`);function eO(e,t){if(t>0){let n=$D(e);return Math.min(...n)>=t}return!0}$(eO,`hasMinStepsBetweenValues`);function tO(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])}}$(tO,`linearScale`);function nO(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}$(nO,`getDecimalCount`);function rO(e,t){let n=10**t;return Math.round(e*n)/n}$(rO,`roundValue`);function iO(e,{min:t,step:n,direction:r,multiplier:i}){let a=nO(n),o=(e-t)/n,s=Math.round(o),c=rO(s*n+t,a)===rO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),rO(l*n+t,a)}$(iO,`getNextStepValue`);function aO(e){return typeof e==`function`}$(aO,`isFunction`);const oO=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(kD,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:H(`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(ID,{"data-slot":`slider-track`,className:H(`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(RD,{"data-slot":`slider-range`,className:H(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(GD,{"data-slot":`slider-thumb`,"aria-label":d,className:H(`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))]})});oO.displayName=kD.displayName;var sO=Object.defineProperty,cO=(e,t)=>sO(e,`name`,{value:t,configurable:!0}),lO=`Switch`,[uO,dO]=/* @__PURE__ */ Mn(lO),[fO,pO]=uO(lO);function mO(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]=qr({prop:r,defaultProp:o??!1,onChange:u,caller:lO}),[g,_]=a.useState(null),[v,y]=a.useState(null),[b,x]=a.useState(null),S={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,userClick:b,onUserClick:x,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(fO,{scope:n,...S,children:SO(p)?p(S):i})}cO(mO,`SwitchProvider`);var hO=`SwitchTrigger`,gO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ cO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,onUserClick:m,isFormControl:h,bubbleInput:g}=pO(hO,e),_=V(i,f),v=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ cO(()=>p(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),/* @__PURE__ */ t(G.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":CO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:_,onClick:U(n,e=>{let t=e.isPropagationStopped();m({requestedChecked:!u,hasConsumerStoppedPropagation:t}),p(e=>!e),g&&h&&(t||e.stopPropagation())})})},`SwitchTrigger`)),_O=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ cO(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/* @__PURE__ */ t(mO,{__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})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(gO,{...m,ref:i,__scopeSwitch:a}),r&&/* @__PURE__ */ t(xO,{__scopeSwitch:a})]})})},`Switch`)),vO=`SwitchThumb`,yO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ cO(function(e,n){let{__scopeSwitch:r,...i}=e,a=pO(vO,r);return/* @__PURE__ */ t(G.span,{"data-state":CO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),bO=`SwitchBubbleInput`,xO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ cO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,userClick:s,checked:c,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:m,bubbleInput:h,setBubbleInput:g}=pO(bO,e),_=V(i,g),v=cr(o),y=a.useRef(!1),b=a.useRef(c),x=a.useRef(s),S=a.useRef(null);a.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=b.current!==c;b.current=c;let i=s!==null&&s!==x.current;if(x.current=s,i)S.current=r?null:s,r&&n.call(e,c),e.dispatchEvent(new Event(`click`,{bubbles:!s.hasConsumerStoppedPropagation}));else if(r){let t=S.current;S.current=null;let r=t?.requestedChecked===c;y.current=!0,n.call(e,c),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[h,c,s]);let C=a.useRef(c);return/* @__PURE__ */ t(G.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??C.current,required:u,disabled:d,name:f,value:p,form:m,...r,tabIndex:-1,ref:_,onClick:U(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function SO(e){return typeof e==`function`}cO(SO,`isFunction`);function CO(e){return e?`checked`:`unchecked`}cO(CO,`getState`);const wO={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 TO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=wO[r],f=t(_O,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:H(`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(yO,{"data-slot":`switch-thumb`,className:H(`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:H(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var EO=Object.defineProperty,DO=(e,t)=>EO(e,`name`,{value:t,configurable:!0}),OO={Automatic:`automatic`,Manual:`manual`},kO=`Tabs`,[AO,jO]=/* @__PURE__ */ Mn(kO,[Dy]),MO=Dy(),[NO,PO]=AO(kO),FO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ DO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=OO.Automatic,...u}=e,d=fe(c),[f,p]=qr({prop:i,onChange:a,defaultProp:o??``,caller:kO});return/* @__PURE__ */ t(NO,{scope:r,baseId:W(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:/* @__PURE__ */ t(G.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),IO=`TabsList`,LO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ DO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=PO(IO,r),s=MO(r);return/* @__PURE__ */ t(My,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:/* @__PURE__ */ t(G.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),RO=`TabsTrigger`,zO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ DO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=PO(RO,r),c=MO(r),l=HO(s.baseId,i),u=UO(s.baseId,i),d=i===s.value;return/* @__PURE__ */ t(Fy,{asChild:!0,...c,focusable:!a,active:d,children:/* @__PURE__ */ t(G.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:U(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),s.onValueChange(i)):e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:U(e.onFocus,()=>{let e=s.activationMode!==OO.Manual;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),BO=`TabsContent`,VO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ DO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=PO(BO,r),u=HO(l.baseId,i),d=UO(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),/* @__PURE__ */ t(Nr,{present:o||f,children:({present:r})=>/* @__PURE__ */ t(G.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 HO(e,t){return`${e}-trigger-${t}`}DO(HO,`makeTriggerId`);function UO(e,t){return`${e}-content-${t}`}DO(UO,`makeContentId`);const WO=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),GO=({orientation:e=`horizontal`,tabs:n,defaultValue:r,current:i,className:o,fullWidth:s,fullHeight:c,children:l,onTabChange:u,responsive:d=!1,variant:f=`tabs`,updateHash:p=!0,canChangeTab:m})=>{let h=a.useMemo(()=>n.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[n]),[g,_]=a.useState(()=>{let e=typeof i==`function`?i():i;if(e)return e;let t=window.location.hash,n=t?t.substring(1):void 0;return n&&h.some(e=>e.name===n)?n:r||h[0]?.name});a.useEffect(()=>{let e=typeof i==`function`?i():i;e&&e!==g&&_(e)},[i,g]),a.useEffect(()=>{if(i)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&h.some(e=>e.name===t)?_(t):!e&&r&&_(r)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[i,h,r]);let v=a.useCallback(e=>{if(e===g||!m||m(e,g)){if(_(e),p&&!i){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}u&&u(e)}},[i,u,p,m,g]),y=a.useCallback(e=>{v(e)},[v]);return t(WO.Provider,{value:{orientation:e,tabs:h,size:s?h.length:0,current:g,setTab:y,responsive:d,variant:f,updateHash:p,canChangeTab:m},children:t(FO,{orientation:e,defaultValue:g||h[0]?.name,value:g,onValueChange:v,className:H(`flex-1 flex flex-col min-h-0 px-2`,c&&`h-full`,o),children:l})})},KO=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m,orientation:h}=a.useContext(WO),g=o??h??`horizontal`,_=c!==0,v=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(GT,{label:`Tab`,className:H(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=>{v(e.name)}})}),t(JO,{size:c,variant:f,className:H(_?`w-full`:``,i&&`sticky top-0 bg-background z-10`,g===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(YO,{className:H(g===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>v(e.name),children:e.label},e.name))})]})},qO=({className:n})=>{let{tabs:r}=a.useContext(WO);return r?t(e,{children:r.map(e=>t(XO,{value:e.name,className:n,children:e.content},e.name))}):null},JO=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(WO.Provider,{value:{size:n,variant:r},children:t(LO,{ref:a,className:H(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));JO.displayName=LO.displayName;const YO=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(WO),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(zO,{ref:o,className:H(r===`tabs`?H(`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`):H(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`border border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});YO.displayName=zO.displayName;const XO=a.forwardRef(({className:e,...n},r)=>t(VO,{ref:r,className:H(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));XO.displayName=VO.displayName;const ZO=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`}}),QO=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:H(ZO({size:n,weight:r,className:e})),...i}));QO.displayName=`Text`;function $O({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:H(`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 ek=d({theme:`system`,setTheme:()=>null});function tk({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(a!==`system`){e.classList.remove(`light`,`dark`),e.classList.add(a);return}let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.classList.remove(`light`,`dark`),e.classList.add(t.matches?`dark`:`light`)};return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a]),_(()=>{let e=e=>{if(e.storageArea!==localStorage||e.key!==r&&e.key!==null)return;let t=e.newValue;o(t===`dark`||t===`light`||t===`system`?t:n)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[n,r]);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(ek.Provider,{...i,value:c,children:e})}const nk=()=>{let e=g(ek);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function rk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(K,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function ik({label:e,className:r}={}){let{setTheme:i,theme:a}=nk(),{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(rk,{current:a,option:`system`,setTheme:i,icon:t(Xe,{}),alt:o(`theme.system`)}),t(rk,{current:a,option:`light`,setTheme:i,icon:t(vt,{}),alt:o(`theme.light`)}),t(rk,{current:a,option:`dark`,setTheme:i,icon:t(ut,{}),alt:o(`theme.dark`)})]})]})}function ak(e,n){return{label:String(e),check:t(n?Ie:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function ok({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(kT,{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(ak(e,r),i)):i=ak(e,r),t(sk,{option:e,onSelect:g,layout:i,noCheck:l,isSelected:r},`option-${n}`)})]})}function sk({option:e,onSelect:i,layout:a,noCheck:o,isSelected:s}){return n(K,{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 ck({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(rg,{children:t(om,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(Qh.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(Qh.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(ct,{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(lk,{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 lk({onClose:e}){return t(K,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(St,{className:`size-6`,"aria-hidden":`true`})})}function uk(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}`)}}const dk=d(void 0),fk=dk.Provider;function pk({size:e,className:i}){let a=uk(e||`md`),o=g(dk);return o?t(o,{className:r(a,i)}):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 mk({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(hT),[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())),F=f&&v&&!a.includes(v)&&!i.includes(v),I=P.length+ +!!F;_(()=>{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 L=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},R=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},ee=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(vT,{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-info ring-1 ring-info/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-md`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>ee(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(St,{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-info ring-1 ring-info/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-md`),children:[e,t(`button`,{type:`button`,onClick:t=>ee(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(St,{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&&I>0){e.preventDefault(),e.stopPropagation(),b===P.length&&F?R(v):b<P.length&&L(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<I-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(bT,{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&&!F?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:()=>L(e),onKeyDown:la(()=>L(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))}),F&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(K,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>R(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 hk(e){return t(gT,{click:!0,children:t(mk,{...e})})}function gk({className:e,children:n,...i}){return t(`table`,{className:r(`
|
|
334
|
+
flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(wt,{size:16})})]})});WT.displayName=`Input`;const GT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(jT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(NT,{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(FT,{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(WT,{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(W,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function KT({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,_=/* @__PURE__ */ 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:RT}),t(nT,{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=/* @__PURE__ */ 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(W,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(W,{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:RT}),t(nT,{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=/* @__PURE__ */ 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 qT({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(ly,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(BT,{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(W,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(W,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function JT({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(_a,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(W,{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 YT({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(WT,{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(W,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(W,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function XT(e,n,r){switch(e.type){case`date`:return t(zT,{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(GT,{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(HT,{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(VT,{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}),XT(e,r,i),t(W,{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(wt,{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 QT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),$T=({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(/* @__PURE__ */ 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(rE(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(rE(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(QT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},eE=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(QT),{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=>rE(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(oy,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(ly,{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(jT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(NT,{asChild:!0,children:n(W,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:B(`transition group flex gap-1.5`,e),children:[t(ot,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(FT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(ny,{children:[a.find(e=>e.name===u)?.type===`select`&&t(iy,{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(ay,{children:t(sy,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(KT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(YT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(JT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(qT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},tE=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(QT);return t(`div`,{className:B(e),children:t(ZT,{filters:n,setFilters:r,filterGroups:i})})},nE=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(QT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(W,{variant:`outline`,size:`md`,className:B(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function rE(e){return typeof e==`string`?e:e.value||``}var iE;(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`})(iE||={});const aE=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:B({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})});aE.displayName=`Heading`;function oE({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":F,"aria-invalid":ee}){let I=C(null),[te,ne]=w(!1),[re,ie]=w(0),[ae,oe]=w(``),se=v(),ce=v(),le=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?sE(e,T)===sE(s,T):typeof T==`function`?T(e,s):ve(e,s)),[O,x,s,i,T]);_(()=>{let e=I.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ie(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let ue=e=>{if(x){let t=Array.isArray(s)?s:[];de(e,t)?c(t.filter(t=>!fe(t,e))):c([...t,e])}else c(e)},de=(e,t)=>!t||t.length===0?!1:t.some(t=>fe(t,e)),fe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?sE(e,T)===sE(t,T):typeof T==`function`?T(e,t):ve(e,t),pe=i||[];function me(e){return e?typeof e==`string`?t=>String(sE(t,e)).toLowerCase():t=>e(t).toLowerCase():e=>String(e).toLowerCase()}let he=ae.toLowerCase(),ge=me(f);pe=pe.filter(e=>ge(e).includes(he));let _e=()=>{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},ye=()=>{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`]})]})},be=(e,r)=>{let i=x?de(e,Array.isArray(s)?s:[]):s!=null&&fe(s,e);return t(ly,{onSelect:()=>ue(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(Re,{className:`size-4`})]}):n(IT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Re,{className:`size-4`})]})},`option-${r}`)},xe=(()=>{if(!o)return null;let e=[],t=/* @__PURE__ */ new Map;for(let n of pe){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})(),Se=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1 shrink-0`,children:[t(`div`,{className:`mx-2`,children:t(gt,{className:`size-4`})}),t(WT,{variant:`unstyled`,value:ae,onChange:oe,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(ny,{className:E?`min-h-0 flex-1`:`overflow-hidden`,children:n(ay,{className:E?`min-h-0 flex-1 overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(oy,{children:`No result found.`}),xe?xe.map(e=>t(sy,{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)=>be(t,`${e.key}-${n}`))},e.key)):t(sy,{children:pe?.map((e,t)=>be(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(vt,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(`flex flex-col`,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(ct,{className:`size-4 animate-spin`})}):Se()});let Ce=!!p,we=M??(Ce?void 0:typeof m==`string`?m:void 0),Te=N??(Ce?ce:void 0),Ee=!!y&&!!s&&(!Array.isArray(s)||s.length>0),De=ee===!0||ee===`true`||le?!0:ee===!1||ee===`false`?!1:void 0;return n(jT,{onOpenChange:ne,children:[n(`div`,{ref:I,className:r(`relative`,h),children:[t(NT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":te,"aria-controls":se,"aria-label":we,"aria-labelledby":Te,"aria-describedby":F,"aria-invalid":De,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&&(le||De?`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`,Ee&&`pe-10`)),children:D?t(ct,{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:ce,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,le&&`text-destructive`),children:[le&&t(Gi,{description:k,placement:`top`,asChild:!0,children:t(St,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?ye():_e()]})]}),!d&&t(Ke,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),Ee&&!D&&t(W,{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(wt,{className:`size-4`})})]}),t(FT,{id:se,style:{width:`${re}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Se()})]})}function sE(e,t){return typeof e==`object`&&e?e[t]:void 0}const cE={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 lE({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(oE,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>cE[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var uE=Object.defineProperty,dE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>uE(e,`name`,{value:t,configurable:!0}))(function(e,n){return/* @__PURE__ */ t(U.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 fE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),pE=a.forwardRef(({className:e,required:r,...i},a)=>n(dE,{ref:a,className:B(fE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));pE.displayName=dE.displayName;function mE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Xe,{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(St,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Je,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(it,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(it,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(it,{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 hE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(mE,{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(W,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function gE({title:e,className:n,children:r}){return t(mE,{status:`info`,title:e,className:n,children:r})}function _E({title:e,className:n,children:r}){return t(mE,{status:`warning`,title:e,className:n,children:r})}function vE({title:e,className:n,children:r}){return t(mE,{status:`success`,title:e,className:n,children:r})}function yE({title:e,className:n,children:r}){return t(mE,{status:`default`,title:e,className:n,children:r})}function bE({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(Wv,{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(St,{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(Gv,{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(ua,{label:l??u,children:t(WT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(qv,{align:`right`,children:[t(W,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(W,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function xE(){return g(SE)}const SE=d(()=>{}),CE={success:Je,error:Xe,warning:St,info:it},wE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function TE({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=CE[e.status]||it,u=wE[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(xm,{onExitComplete:r,children:i&&t(pg.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(wt,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function EE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(SE.Provider,{value:o,children:r}),i&&t(vg,{children:t(TE,{data:i,onClose:()=>o(null)})})]})}function DE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=xE();return t(bE,{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 OE=4,kE={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 AE(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 jE({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(Hx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Wx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Be,{className:`ms-1 size-4`})]})}),t(Gx,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function ME({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=kE[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=AE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:B(`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:B(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:B(c.base,c.inactive),children:[h,t(Be,{className:c.icon})]})]}),n(`div`,{className:B(`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:B(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(jE,{label:h,triggerClassName:B(c.base,m?c.active:c.inactive),icon:t(Be,{className:c.icon}),children:p.map(e=>t(qx,{disabled:e.disabled,onClick:()=>i(e.name),className:B(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function NE({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?Be:We,{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(sa,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(W,{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 PE=Object.defineProperty,FE=(e,t)=>PE(e,`name`,{value:t,configurable:!0}),IE=`Radio`,[LE,RE]=/* @__PURE__ */ Pn(IE),[zE,BE]=LE(IE);function VE(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),[_,v]=a.useState(null),y={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,userClick:_,onUserClick:v,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:/* @__PURE__ */ FE(()=>l?.(),`onCheck`)};return/* @__PURE__ */ t(zE,{scope:n,...y,children:JE(f)?f(y):i})}FE(VE,`RadioProvider`);var HE=`RadioTrigger`,UE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,onUserClick:u,isFormControl:d,bubbleInput:f}=BE(HE,e),p=z(i,c);return/* @__PURE__ */ t(U.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":YE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:p,onClick:V(n,e=>{let t=e.isPropagationStopped();a||(u({hasConsumerStoppedPropagation:t}),l()),f&&d&&(t||e.stopPropagation())})})},`RadioTrigger`)),WE=`RadioIndicator`,GE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=BE(WE,r);return/* @__PURE__ */ t(Fr,{present:i||o.checked,children:/* @__PURE__ */ t(U.span,{"data-state":YE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),KE=`RadioBubbleInput`,qE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(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,userClick:h}=BE(KE,e),g=z(i,m),_=ur(o),v=a.useRef(!1),y=a.useRef(s),b=a.useRef(h),x=a.useRef(null);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=y.current!==s;y.current=s;let i=h!==null&&h!==b.current;if(b.current=h,i)x.current=r?null:h,r&&n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!h.hasConsumerStoppedPropagation}));else if(r){let t=x.current;x.current=null;let r=s&&t!==null;v.current=!0,n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),v.current=!1}},[p,s,h]);let S=a.useRef(s);return/* @__PURE__ */ t(U.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:g,onClick:V(n,e=>{v.current&&e.stopPropagation()}),style:{...r.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function JE(e){return typeof e==`function`}FE(JE,`isFunction`);function YE(e){return e?`checked`:`unchecked`}FE(YE,`getState`);var XE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],ZE=`RadioGroup`,[QE,$E]=/* @__PURE__ */ Pn(ZE,[Hy,RE]),eD=Hy(),tD=RE(),[nD,rD]=QE(ZE),iD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(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=eD(r),_=me(f),[v,y]=Yr({prop:c,defaultProp:s??null,onChange:m,caller:ZE}),[b,x]=a.useState(null),S=z(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=/* @__PURE__ */ FE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),/* @__PURE__ */ t(nD,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:/* @__PURE__ */ t(qy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:/* @__PURE__ */ t(U.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),aD=`RadioGroupItemProvider`,oD=`RadioGroupItemTrigger`;function sD(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=rD(aD,n),c=tD(n),l=s.disabled||i;return/* @__PURE__ */ t(VE,{...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})}FE(sD,`RadioGroupItemProvider`);var cD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=eD(r),s=tD(r),{checked:c,disabled:l}=BE(oD,s.__scopeRadio),u=a.useRef(null),d=z(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=/* @__PURE__ */ FE(e=>{XE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ FE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ t(Xy,{asChild:!0,...o,focusable:!l,active:c,children:/* @__PURE__ */ t(UE,{...s,...i,ref:d,onKeyDown:V(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:V(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),lD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return/* @__PURE__ */ t(sD,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(cD,{...c,ref:i,__scopeRadioGroup:a}),r&&/* @__PURE__ */ t(uD,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),uD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=tD(r);return/* @__PURE__ */ t(qE,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),dD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=tD(r);return/* @__PURE__ */ t(GE,{...a,...i,ref:n})},`RadioGroupIndicator`));function fD({className:e,...n}){return t(lD,{"data-slot":`radio-group-item`,className:B(`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(dD,{"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 pD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function mD({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(iD,{"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(lD,{value:o(e),className:B(`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 hD({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(ye.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:B(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function gD(e){return typeof e==`number`?`${e}%`:e}function _D({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(ye.Panel,{"data-slot":`resizable-panel`,defaultSize:gD(e),minSize:gD(n),maxSize:gD(r),collapsedSize:gD(i),...a})}function vD({withHandle:e,className:n,...r}){return t(ye.Separator,{"data-slot":`resizable-handle`,className:B(`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(ut,{className:`size-4 rotate-90`})})})}var yD=Object.defineProperty,bD=(e,t)=>yD(e,`name`,{value:t,configurable:!0}),xD={Horizontal:`horizontal`,Vertical:`vertical`},SD=xD.Horizontal,CD=Object.values(xD),wD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bD(function(e,n){let{decorative:r,orientation:i=SD,...a}=e,o=TD(i)?i:SD,s=o===xD.Vertical?o:void 0,c=r?{role:`none`}:{"aria-orientation":s,role:`separator`};return/* @__PURE__ */ t(U.div,{"data-orientation":o,...c,...a,ref:n})},`Separator`));function TD(e){return CD.includes(e)}bD(TD,`isValidOrientation`);const ED=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(wD,{ref:a,decorative:r,orientation:n,className:B(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));ED.displayName=wD.displayName;var DD=Object.defineProperty,OD=(e,t)=>DD(e,`name`,{value:t,configurable:!0});function kD(e,[t,n]){return Math.min(n,Math.max(t,e))}OD(kD,`clamp`);var AD=Object.defineProperty,$=(e,t)=>AD(e,`name`,{value:t,configurable:!0}),jD={Vertical:`vertical`,Horizontal:`horizontal`},MD={LTR:`ltr`,RTL:`rtl`},ND=[`PageUp`,`PageDown`],PD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],FD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},ID=`Slider`,[LD,RD,zD]=/* @__PURE__ */ py(ID),[BD,VD]=/* @__PURE__ */ Pn(ID,[zD]),[HD,UD]=BD(ID),WD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=jD.Horizontal,disabled:l=!1,minStepsBetweenThumbs:u=0,preserveThumbOrder:d=!1,defaultValue:f=[i],value:p,onValueChange:m=/* @__PURE__ */ $(()=>{},`onValueChange`),onValueCommit:h=/* @__PURE__ */ $(()=>{},`onValueCommit`),inverted:g=!1,form:_,...v}=e,y=a.useRef(/* @__PURE__ */ new Set),b=a.useRef(0),x=a.useRef(!1),[S,C]=a.useState(null),w=c===jD.Horizontal?qD:JD,[T,E]=a.useState(null),D=z(n,E),[O=[],k]=Yr({prop:p,defaultProp:f,onChange:/* @__PURE__ */ $(e=>{[...y.current][b.current]?.focus({preventScroll:!0,focusVisible:x.current}),x.current=!1,m(e)},`onChange`)}),A=a.useRef(O),j=a.useRef(O);a.useEffect(()=>{let e=_?T?.ownerDocument.getElementById(_):T?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ $(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[T,_,k]);function M(e){F(e,fO(O,e))}$(M,`handleSlideStart`);function N(e){F(e,b.current)}$(N,`handleSlideMove`);function P(){String(O)!==String(A.current)&&h(O)}$(P,`handleSlideEnd`);function F(e,t,{commit:n}={commit:!1}){let r=_O(s),a=kD(vO(Math.round((e-i)/s)*s+i,r),[i,o]),c=u*s;function l(e){let n=d?kD(a,[e[t-1]===void 0?i:e[t-1]+c,e[t+1]===void 0?o:e[t+1]-c]):a,r=lO(e,n,t);return hO(r,c)?{nextValues:r,changedIndex:d?t:r.indexOf(n),hasChanged:String(r)!==String(e)}:null}$(l,`getNextValues`);let f=l(O);f?.hasChanged&&C(f.nextValues),k((e=[])=>{let t=l(e);return t?(b.current=t.changedIndex,t.hasChanged&&n&&h(t.nextValues),t.hasChanged?t.nextValues:e):e})}return $(F,`updateValues`),/* @__PURE__ */ t(HD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:b,thumbs:y.current,values:O,orientation:c,form:_,userRequestedValues:S,children:/* @__PURE__ */ t(LD.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(LD.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(w,{"aria-disabled":l,"data-disabled":l?``:void 0,...v,ref:D,onPointerDown:V(v.onPointerDown,()=>{l||(A.current=O,x.current=!1)}),min:i,max:o,inverted:g,onSlideStart:l?void 0:M,onSlideMove:l?void 0:N,onSlideEnd:l?void 0:P,onHomeKeyDown:()=>{l||(x.current=!0,F(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(x.current=!0,F(o,O.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){x.current=!0;let n=ND.includes(e.key)||e.shiftKey&&PD.includes(e.key)?10:1,r=b.current,a=O[r];F(yO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[GD,KD]=BD(ID,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),qD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(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=z(n,m),g=a.useRef(void 0),_=me(o),v=_===MD.LTR,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=gO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),/* @__PURE__ */ t(GD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:/* @__PURE__ */ t(YD,{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=FD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),JD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(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=z(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=gO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),/* @__PURE__ */ t(GD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:/* @__PURE__ */ t(YD,{"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=FD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),YD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=UD(ID,r);return/* @__PURE__ */ t(U.span,{...u,ref:n,onKeyDown:V(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):ND.concat(PD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:V(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:V(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:V(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),XD=`SliderTrack`,ZD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=UD(XD,r);return/* @__PURE__ */ t(U.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),QD=`SliderRange`,$D=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,o=UD(QD,r),s=KD(QD,r),c=z(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>uO(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return/* @__PURE__ */ t(U.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[eO,tO]=BD(`SliderThumb`),nO=`SliderThumbProvider`;function rO(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=UD(nO,n),c=RD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=ur(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:uO(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/* @__PURE__ */ t(eO,{scope:n,..._,children:bO(o)?o(_):i})}$(rO,`SliderThumbProvider`);var iO=`SliderThumbTrigger`,aO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=UD(iO,r),o=KD(iO,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=tO(iO,r),f=z(n,d),p=dO(s,a.values.length),m=u?.[o.size],h=m?pO(m,l,o.direction):0;return/* @__PURE__ */ t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:/* @__PURE__ */ t(LD.ItemSlot,{scope:r,children:/* @__PURE__ */ t(U.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:V(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),oO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return/* @__PURE__ */ t(rO,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(aO,{...s,ref:i,__scopeSlider:a}),o?/* @__PURE__ */ t(cO,{__scopeSlider:a},r):null]})})},`SliderThumb`)),sO=`SliderBubbleInput`,cO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function({__scopeSlider:e,onInput:n,...r},i){let{index:o,value:s,name:c,form:l}=tO(sO,e),{userRequestedValues:u}=UD(sO,e),d=a.useRef(null),f=z(d,i),p=a.useRef(!1),m=a.useRef(s),h=a.useRef(u),g=a.useRef(u);return a.useEffect(()=>{let e=d.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=m.current,i=r!==s;m.current=s;let a=u!==g.current;if(g.current=u,i&&n){let t=u!==h.current;h.current=u;let i=u?.[o];p.current=!(t&&(a&&i!==r||i===s));let c=new Event(`input`,{bubbles:!0});n.call(e,s),e.dispatchEvent(c),p.current=!1}},[o,s,u]),/* @__PURE__ */ t(U.input,{style:{display:`none`},name:c,form:l,...r,ref:f,defaultValue:s,onInput:V(n,e=>{p.current&&e.stopPropagation()})})},`SliderBubbleInput`));function lO(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(lO,`getNextSortedValues`);function uO(e,t,n){return kD(100/(n-t)*(e-t),[0,100])}$(uO,`convertValueToPercentage`);function dO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(dO,`getLabel`);function fO(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)}$(fO,`getClosestValueIndex`);function pO(e,t,n){let r=e/2;return(r-gO([0,50],[0,r])(t)*n)*n}$(pO,`getThumbInBoundsOffset`);function mO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(mO,`getStepsBetweenValues`);function hO(e,t){if(t>0){let n=mO(e);return Math.min(...n)>=t}return!0}$(hO,`hasMinStepsBetweenValues`);function gO(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])}}$(gO,`linearScale`);function _O(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}$(_O,`getDecimalCount`);function vO(e,t){let n=10**t;return Math.round(e*n)/n}$(vO,`roundValue`);function yO(e,{min:t,step:n,direction:r,multiplier:i}){let a=_O(n),o=(e-t)/n,s=Math.round(o),c=vO(s*n+t,a)===vO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),vO(l*n+t,a)}$(yO,`getNextStepValue`);function bO(e){return typeof e==`function`}$(bO,`isFunction`);const xO=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(WD,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:B(`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(ZD,{"data-slot":`slider-track`,className:B(`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($D,{"data-slot":`slider-range`,className:B(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(oO,{"data-slot":`slider-thumb`,"aria-label":d,className:B(`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))]})});xO.displayName=WD.displayName;var SO=Object.defineProperty,CO=(e,t)=>SO(e,`name`,{value:t,configurable:!0}),wO=`Switch`,[TO,EO]=/* @__PURE__ */ Pn(wO),[DO,OO]=TO(wO);function kO(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]=Yr({prop:r,defaultProp:o??!1,onChange:u,caller:wO}),[g,_]=a.useState(null),[v,y]=a.useState(null),[b,x]=a.useState(null),S={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,userClick:b,onUserClick:x,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(DO,{scope:n,...S,children:LO(p)?p(S):i})}CO(kO,`SwitchProvider`);var AO=`SwitchTrigger`,jO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ CO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,onUserClick:m,isFormControl:h,bubbleInput:g}=OO(AO,e),_=z(i,f),v=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ CO(()=>p(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),/* @__PURE__ */ t(U.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":RO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:_,onClick:V(n,e=>{let t=e.isPropagationStopped();m({requestedChecked:!u,hasConsumerStoppedPropagation:t}),p(e=>!e),g&&h&&(t||e.stopPropagation())})})},`SwitchTrigger`)),MO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ CO(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/* @__PURE__ */ t(kO,{__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})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(jO,{...m,ref:i,__scopeSwitch:a}),r&&/* @__PURE__ */ t(IO,{__scopeSwitch:a})]})})},`Switch`)),NO=`SwitchThumb`,PO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ CO(function(e,n){let{__scopeSwitch:r,...i}=e,a=OO(NO,r);return/* @__PURE__ */ t(U.span,{"data-state":RO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),FO=`SwitchBubbleInput`,IO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ CO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,userClick:s,checked:c,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:m,bubbleInput:h,setBubbleInput:g}=OO(FO,e),_=z(i,g),v=ur(o),y=a.useRef(!1),b=a.useRef(c),x=a.useRef(s),S=a.useRef(null);a.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=b.current!==c;b.current=c;let i=s!==null&&s!==x.current;if(x.current=s,i)S.current=r?null:s,r&&n.call(e,c),e.dispatchEvent(new Event(`click`,{bubbles:!s.hasConsumerStoppedPropagation}));else if(r){let t=S.current;S.current=null;let r=t?.requestedChecked===c;y.current=!0,n.call(e,c),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[h,c,s]);let C=a.useRef(c);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??C.current,required:u,disabled:d,name:f,value:p,form:m,...r,tabIndex:-1,ref:_,onClick:V(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function LO(e){return typeof e==`function`}CO(LO,`isFunction`);function RO(e){return e?`checked`:`unchecked`}CO(RO,`getState`);const zO={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 BO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=zO[r],f=t(MO,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:B(`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(PO,{"data-slot":`switch-thumb`,className:B(`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:B(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var VO=Object.defineProperty,HO=(e,t)=>VO(e,`name`,{value:t,configurable:!0}),UO={Automatic:`automatic`,Manual:`manual`},WO=`Tabs`,[GO,KO]=/* @__PURE__ */ Pn(WO,[Hy]),qO=Hy(),[JO,YO]=GO(WO),XO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ HO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=UO.Automatic,...u}=e,d=me(c),[f,p]=Yr({prop:i,onChange:a,defaultProp:o??``,caller:WO});return/* @__PURE__ */ t(JO,{scope:r,baseId:H(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:/* @__PURE__ */ t(U.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),ZO=`TabsList`,QO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ HO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=YO(ZO,r),s=qO(r);return/* @__PURE__ */ t(qy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:/* @__PURE__ */ t(U.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),$O=`TabsTrigger`,ek=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ HO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=YO($O,r),c=qO(r),l=rk(s.baseId,i),u=ik(s.baseId,i),d=i===s.value;return/* @__PURE__ */ t(Xy,{asChild:!0,...c,focusable:!a,active:d,children:/* @__PURE__ */ t(U.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:V(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),s.onValueChange(i)):e.preventDefault()}),onKeyDown:V(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:V(e.onFocus,()=>{let e=s.activationMode!==UO.Manual;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),tk=`TabsContent`,nk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ HO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=YO(tk,r),u=rk(l.baseId,i),d=ik(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),/* @__PURE__ */ t(Fr,{present:o||f,children:({present:r})=>/* @__PURE__ */ t(U.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 rk(e,t){return`${e}-trigger-${t}`}HO(rk,`makeTriggerId`);function ik(e,t){return`${e}-content-${t}`}HO(ik,`makeContentId`);const ak=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),ok=({orientation:e=`horizontal`,tabs:n,defaultValue:r,current:i,className:o,fullWidth:s,fullHeight:c,children:l,onTabChange:u,responsive:d=!1,variant:f=`tabs`,updateHash:p=!0,canChangeTab:m})=>{let h=a.useMemo(()=>n.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[n]),[g,_]=a.useState(()=>{let e=typeof i==`function`?i():i;if(e)return e;let t=window.location.hash,n=t?t.substring(1):void 0;return n&&h.some(e=>e.name===n)?n:r||h[0]?.name});a.useEffect(()=>{let e=typeof i==`function`?i():i;e&&e!==g&&_(e)},[i,g]),a.useEffect(()=>{if(i)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&h.some(e=>e.name===t)?_(t):!e&&r&&_(r)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[i,h,r]);let v=a.useCallback(e=>{if(e===g||!m||m(e,g)){if(_(e),p&&!i){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}u&&u(e)}},[i,u,p,m,g]),y=a.useCallback(e=>{v(e)},[v]);return t(ak.Provider,{value:{orientation:e,tabs:h,size:s?h.length:0,current:g,setTab:y,responsive:d,variant:f,updateHash:p,canChangeTab:m},children:t(XO,{orientation:e,defaultValue:g||h[0]?.name,value:g,onValueChange:v,className:B(`flex-1 flex flex-col min-h-0 px-2`,c&&`h-full`,o),children:l})})},sk=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m,orientation:h}=a.useContext(ak),g=o??h??`horizontal`,_=c!==0,v=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(oE,{label:`Tab`,className:B(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=>{v(e.name)}})}),t(lk,{size:c,variant:f,className:B(_?`w-full`:``,i&&`sticky top-0 bg-background z-10`,g===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(uk,{className:B(g===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>v(e.name),children:e.label},e.name))})]})},ck=({className:n})=>{let{tabs:r}=a.useContext(ak);return r?t(e,{children:r.map(e=>t(dk,{value:e.name,className:n,children:e.content},e.name))}):null},lk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(ak.Provider,{value:{size:n,variant:r},children:t(QO,{ref:a,className:B(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));lk.displayName=QO.displayName;const uk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(ak),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(ek,{ref:o,className:B(r===`tabs`?B(`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`):B(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`border border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});uk.displayName=ek.displayName;const dk=a.forwardRef(({className:e,...n},r)=>t(nk,{ref:r,className:B(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));dk.displayName=nk.displayName;const fk=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`}}),pk=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:B(fk({size:n,weight:r,className:e})),...i}));pk.displayName=`Text`;function mk({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:B(`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 hk=d({theme:`system`,setTheme:()=>null});function gk({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(a!==`system`){e.classList.remove(`light`,`dark`),e.classList.add(a);return}let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.classList.remove(`light`,`dark`),e.classList.add(t.matches?`dark`:`light`)};return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a]),_(()=>{let e=e=>{if(e.storageArea!==localStorage||e.key!==r&&e.key!==null)return;let t=e.newValue;o(t===`dark`||t===`light`||t===`system`?t:n)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[n,r]);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(hk.Provider,{...i,value:c,children:e})}const _k=()=>{let e=g(hk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function vk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(W,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function yk({label:e,className:r}={}){let{setTheme:i,theme:a}=_k(),{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(vk,{current:a,option:`system`,setTheme:i,icon:t(Qe,{}),alt:o(`theme.system`)}),t(vk,{current:a,option:`light`,setTheme:i,icon:t(bt,{}),alt:o(`theme.light`)}),t(vk,{current:a,option:`dark`,setTheme:i,icon:t(ft,{}),alt:o(`theme.dark`)})]})]})}function bk(e,n){return{label:String(e),check:t(n?Re:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function xk({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(WT,{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(bk(e,r),i)):i=bk(e,r),t(Sk,{option:e,onSelect:g,layout:i,noCheck:l,isSelected:r},`option-${n}`)})]})}function Sk({option:e,onSelect:i,layout:a,noCheck:o,isSelected:s}){return n(W,{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 Ck({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(vg,{children:t(xm,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(pg.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(pg.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(ut,{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(wk,{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 wk({onClose:e}){return t(W,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(wt,{className:`size-6`,"aria-hidden":`true`})})}function Tk(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}`)}}const Ek=d(void 0),Dk=Ek.Provider;function Ok({size:e,className:i}){let a=Tk(e||`md`),o=g(Ek);return o?t(o,{className:r(a,i)}):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 kk({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(AT),[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())),F=f&&v&&!a.includes(v)&&!i.includes(v),ee=P.length+ +!!F;_(()=>{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 I=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},te=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},ne=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(NT,{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-info ring-1 ring-info/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-md`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>ne(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(wt,{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-info ring-1 ring-info/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-md`),children:[e,t(`button`,{type:`button`,onClick:t=>ne(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(wt,{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&&ee>0)e.preventDefault(),e.stopPropagation(),b===P.length&&F?te(v):b<P.length&&I(P[b]);else if(e.key===`ArrowDown`)e.preventDefault(),e.stopPropagation(),M?x(e=>e<ee-1?e+1:e):N(!0);else if(e.key===`ArrowUp`)e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);else if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),N(!1);else 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)}else!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(FT,{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&&!F?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:()=>I(e),onKeyDown:da(()=>I(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))}),F&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(W,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>te(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 Ak(e){return t(jT,{click:!0,children:t(kk,{...e})})}function jk({className:e,children:n,...i}){return t(`table`,{className:r(`
|
|
335
335
|
divide-y divide-border
|
|
336
336
|
[&>tbody]:divide-y [&>tbody]:divide-border
|
|
337
337
|
[&_th]:text-start [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted
|
|
338
338
|
[&_td]:px-3 [&_td]:py-4 [&_td]:text-sm
|
|
339
|
-
`,e),...i,children:n})}function _k({children:e}){return t(`thead`,{className:`sticky top-0 bg-background z-10 after:absolute after:bottom-0 after:start-0 after:w-full after:h-px after:bg-muted/20`,children:e})}function vk({columns:e}){return t(`tr`,{className:`hover:bg-muted`,children:Array(e).fill(0).map((e,n)=>t(`td`,{children:t(`div`,{className:`animate-pulse rounded-xs h-5 bg-muted`})},`skeleton-cell-${n}`))})}function yk({isLoading:e=!1,columns:n,rows:r=3,children:i}){let a=Array.from({length:r},(e,t)=>`skeleton-row-${t}`);return t(`tbody`,{children:e?a.map(e=>t(vk,{columns:n},e)):i})}function bk({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function xk({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function Sk({sortDirection:e=`none`,onSort:r,sortIndicator:i,disabled:a=!1,children:o,className:s,scope:c=`col`,...l}){return t(`th`,{scope:c,"aria-sort":e,className:s,...l,children:a?n(`span`,{className:`inline-flex items-center gap-1`,children:[o,i?.(e)]}):n(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 bg-transparent border-0 p-0 m-0 text-inherit font-inherit cursor-pointer hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm`,children:[o,i?.(e)]})})}var Ck=class{_value;watchers=[];name;constructor(e,t){this._value=e,this.name=t}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function wk(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var Tk=class{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e?.(this.current),this}};function Ek(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function Dk(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Ok(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function kk(e,t){_(()=>e.watch(t),[e,t])}function Ak(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function jk(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function Mk(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var Nk=class{compute;_value;watchers=[];unsubscribers=[];name;constructor(e,t,n){this.compute=e,this.name=n,this.recalculate();for(let e of t)this.unsubscribers.push(e.watch(()=>this.recalculate()))}recalculate(){let e=this.compute();if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}get value(){return this._value}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}dispose(){for(let e of this.unsubscribers)e();this.watchers=[]}},Pk=class{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function Fk(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Ik(e,t){let n=C(null);return _(()=>{let r=r=>{n.current&&!n.current.contains(r.target)&&(t?.(r)||e(r))},i=window.setTimeout(()=>{document.addEventListener(`click`,r)},0);return()=>{window.clearTimeout(i),document.removeEventListener(`click`,r)}},[e,t]),n}function Lk(){let[e,t]=w(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn(`Clipboard not supported`),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn(`Copy failed`,e),t(null),!1}}]}function Rk(e){_(()=>{let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=t=>e(t.matches);return t.addEventListener(`change`,n),e(t.matches),()=>t.removeEventListener(`change`,n)},[e])}function zk(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function Bk(e,t,n){let r=[],i=new EventSource(e);return i.addEventListener(`message`,e=>{let n=JSON.parse(e.data);n&&(r.push(n),t(r.join(``)))}),i.addEventListener(`close`,e=>{i.close(),n(JSON.parse(e.data))}),()=>{i.close()}}function Vk(e,t,n){let r=C(t),i=C(n);r.current=t,i.current=n,_(()=>{let t,n=!1,a=e=>r.current(e),o=e=>i.current(e);return typeof e==`function`?e().then(e=>{n||(t=Bk(e,a,o))}):t=Bk(e,a,o),()=>{n=!0,t?.()}},[e])}function Hk(e){return e instanceof Error?e:Error(String(e))}function Uk(e,t){Array.isArray(t)&&(t={deps:t});let n=t||{},[r,i]=w(void 0),[a,o]=w(!1),[s,c]=w(n.defaultValue),l=C(e);l.current=e;let u=C(n);u.current=n;let d=h(()=>{let e=u.current;return e.start?.(),o(!0),i(void 0),l.current().then(t=>{i(void 0),c(t),e.onSuccess?.(t)}).catch(t=>{let n=Hk(t);i(n),e.onError?.(n)}).finally(()=>{o(!1),e.end?.()})},[]);return _(()=>{let e=u.current;(!e.condition||e.condition())&&d()},[d,...n.deps??[]]),{data:s,isLoading:a,error:r,setData:c,refetch:d}}function Wk(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),Uk(e,t)}function Gk(e=!1){let[t,n]=w(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function Kk(e,t,n={}){let r=C(t);r.current=t;let i=C(n);i.current=n;let a=n.threshold||1;_(()=>{let t=e.current,n=new IntersectionObserver(e=>{let t=e[0].isIntersecting;i.current.leave?t||r.current(e[0]):t&&r.current(e[0])},{threshold:a});return t&&n.observe(t),()=>{t&&n.unobserve(t)}},[e,a,...n.deps??[]])}function qk(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const Jk=typeof window<`u`?x:_;function Yk(e,t=[]){let n=e.pageSize||50,[r,i]=w(null),[a,o]=w(e.payload),[s,c]=w(null),[l,u]=w([]),[d,f]=w(null),[p,m]=w(!1),[h,g]=w(0),v=C(0),y=C(e.search);y.current=e.search;let b=e=>{i(null),u([]),f(null),o(e),g(e=>e+1)},x=()=>{d!==null&&i(d)};return _(()=>{v.current+=1;let e=v.current;m(!0),y.current(a,r,n).then(t=>{e===v.current&&(u(r===null?t.result:e=>[...e,...t.result]),f(t.nextPage),c(null))}).catch(t=>{e===v.current&&c(t)}).finally(()=>{e===v.current&&m(!1)})},[...t,a,h,r,n]),Kk(e.nextPageTrigger,()=>{!p&&d&&x()},{threshold:.1,deps:[d,p]}),{search:b,refresh:()=>b(a),searchMore:x,result:l,page:r,hasMore:d!==null,error:s,isSearching:p}}function Xk(e,t=[]){return Yk({...e,async search(t,n,r){let i=n??0,a=i*r,o=await e.search(t,a,r);return{result:o,nextPage:o.length===0?null:i+1}}},t)}var Zk=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function Qk(e){return new Zk(w(e))}function $k(...e){return j(i(e))}function eA(e){return typeof e==`object`&&!!e&&`message`in e}function tA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:eA(e)&&typeof e.message==`string`?e.message:t}function nA(e,t){let n=e.selectionStart,r=e.selectionEnd,i=e.value,a=`${i.slice(0,n)}\n${i.slice(r)}`;t?.(a),requestAnimationFrame(()=>{e.selectionStart=e.selectionEnd=n+1})}export{Kx as AnimateChangeInHeight,ye as Avatar,da as Badge,ig as Breadcrumbs,K as Button,pg as Card,_g as CardContent,gg as CardDescription,vg as CardFooter,mg as CardHeader,hg as CardTitle,xe as Center,Lg as Checkbox,Se as CloudIcon,Qg as Collapsible,e_ as CollapsibleContent,$g as CollapsibleTrigger,Ut as ComboBox,Vv as Command,Hv as CommandDialog,Gv as CommandEmpty,Kv as CommandGroup,Uv as CommandInput,Jv as CommandItem,Wv as CommandList,qv as CommandSeparator,Yv as CommandShortcut,Nk as ComputedProperty,aE as ConfirmModal,Ji as CopyButton,It as DOMPopup,wT as DateCombobox,iE as DefaultBox,fE as DeleteModal,Nv as Dialog,Iv as DialogClose,Rv as DialogContent,zv as DialogDescription,Lv as DialogOverlay,Fv as DialogPortal,Bv as DialogTitle,Pv as DialogTrigger,Qt as Divider,ma as DotBadge,ea as DropZone,Ux as Dropdown,Dx as DropdownMenu,Nx as DropdownMenuCheckboxItem,Ax as DropdownMenuContent,jx as DropdownMenuGroup,Mx as DropdownMenuItem,Ix as DropdownMenuLabel,Ox as DropdownMenuPortal,Px as DropdownMenuRadioGroup,Fx as DropdownMenuRadioItem,Lx as DropdownMenuSeparator,Rx as DropdownMenuShortcut,zx as DropdownMenuSub,Vx as DropdownMenuSubContent,Bx as DropdownMenuSubTrigger,kx as DropdownMenuTrigger,Yi as EmptyCollection,eE as ErrorBox,$i as FileUploadInput,BT as FilterBar,zT as FilterBtn,VT as FilterClear,UT as FilterOperator,RT as FilterProvider,ca as FormItem,WT as Heading,tE as InfoBox,aa as InfoTip,kT as Input,ha as InputList,QT as Label,JT as LanguageSwitcher,ga as Link,Wx as MenuGroup,Gx as MenuItem,_a as MenuList,$T as MessageBox,kv as Modal,jv as ModalBody,Ov as ModalContextProvider,Mv as ModalFooter,Av as ModalTitle,rk as ModeOption,ik as ModeToggle,xa as NumberInput,pE as OVERFLOW_TAB_GAP_PX,zt as OptionAdapter,gE as OverflowMoreMenu,_E as OverflowTabsBar,$h as Overlay,vE as Panel,gT as Popover,yT as PopoverAnchor,xT as PopoverClose,bT as PopoverContent,hT as PopoverContext,vT as PopoverTrigger,Lt as Popup,Nt as PopupController,rg as Portal,Fi as PortalContainerContext,Li as PortalContainerProvider,Ck as Property,$E as RadioGroup,QE as RadioGroupAdapter,ZE as RadioGroupItem,rD as ResizableHandle,nD as ResizablePanel,eD as ResizablePanelGroup,vk as RowSkeleton,GT as SelectBox,ok as SelectList,ET as SelectionCombobox,dD as Separator,Pk as SharedState,Zk as SharedValue,ck as SidePanel,Zt as SimpleCombobox,oO as Slider,Tk as Slot,Sk as SortableTableHeaderCell,pk as Spinner,fk as SpinnerIconProvider,DT as StringListCombobox,Bt as StringOptionAdapter,Vt as StringOptionAdapterWithCreate,ya as Styles,rE as SuccessBox,be as SvgAvatar,TO as Switch,yk as TBody,_k as THead,bk as TR,gk as Table,xk as TableHeaderCell,GO as Tabs,KO as TabsBar,XO as TabsContent,JO as TabsList,qO as TabsPanel,YO as TabsTrigger,hk as TagsInput,QO as Text,AT as TextCombobox,$O as Textarea,tk as ThemeProvider,ek as ThemeProviderContext,sE as ToastContext,dE as ToastProvider,Bi as Tooltip,Hi as TooltipContent,zi as TooltipProvider,Vi as TooltipTrigger,Ui as VTooltip,nE as WarningBox,qi as buttonVariants,$k as cn,Ot as computePosition,wk as createCompositeStateProvider,tA as errorMessage,Ht as getDefaultComboBoxLayout,nA as insertNewlineAtCursor,la as onActivateKey,Ik as useClickOutside,qt as useComboboxCtrl,Ek as useCompositeState,Lk as useCopyToClipboard,Rk as useDarkMode,zk as useDebounce,Xk as useDefaultScrollableSearch,Mk as useDefineSlot,ia as useDropZone,Vk as useEventSource,Uk as useFetch,Wk as useFetchOnce,Gk as useFlag,Dk as useGetCompositeStateProperty,Kk as useIntersectionObserver,qk as useIsFirstRendering,Dv as useIsInModal,hE as useOverflowTabs,ST as usePopoverContext,Ft as usePopupController,Ri as usePortalContainer,Jk as useSafeLayoutEffect,Yk as useScrollableSearch,Ok as useSetCompositeStateProperty,Qk as useSharedValue,Ak as useSlot,nk as useTheme,oE as useToast,kk as useWatchCompositeStateProperty,Fk as useWatchSharedState,jk as useWatchSlot};
|
|
339
|
+
`,e),...i,children:n})}function Mk({children:e}){return t(`thead`,{className:`sticky top-0 bg-background z-10 after:absolute after:bottom-0 after:start-0 after:w-full after:h-px after:bg-muted/20`,children:e})}function Nk({columns:e}){return t(`tr`,{className:`hover:bg-muted`,children:Array(e).fill(0).map((e,n)=>t(`td`,{children:t(`div`,{className:`animate-pulse rounded-xs h-5 bg-muted`})},`skeleton-cell-${n}`))})}function Pk({isLoading:e=!1,columns:n,rows:r=3,children:i}){let a=Array.from({length:r},(e,t)=>`skeleton-row-${t}`);return t(`tbody`,{children:e?a.map(e=>t(Nk,{columns:n},e)):i})}function Fk({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function Ik({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function Lk({sortDirection:e=`none`,onSort:r,sortIndicator:i,disabled:a=!1,children:o,className:s,scope:c=`col`,...l}){return t(`th`,{scope:c,"aria-sort":e,className:s,...l,children:a?n(`span`,{className:`inline-flex items-center gap-1`,children:[o,i?.(e)]}):n(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 bg-transparent border-0 p-0 m-0 text-inherit font-inherit cursor-pointer hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm`,children:[o,i?.(e)]})})}var Rk=class{_value;watchers=[];name;constructor(e,t){this._value=e,this.name=t}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function zk(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var Bk=class{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e?.(this.current),this}};function Vk(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function Hk(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Uk(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function Wk(e,t){_(()=>e.watch(t),[e,t])}function Gk(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function Kk(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function qk(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var Jk=class{compute;_value;watchers=[];unsubscribers=[];name;constructor(e,t,n){this.compute=e,this.name=n,this.recalculate();for(let e of t)this.unsubscribers.push(e.watch(()=>this.recalculate()))}recalculate(){let e=this.compute();if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}get value(){return this._value}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}dispose(){for(let e of this.unsubscribers)e();this.watchers=[]}},Yk=class{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function Xk(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Zk(e,t){let n=C(null);return _(()=>{let r=r=>{n.current&&!n.current.contains(r.target)&&(t?.(r)||e(r))},i=window.setTimeout(()=>{document.addEventListener(`click`,r)},0);return()=>{window.clearTimeout(i),document.removeEventListener(`click`,r)}},[e,t]),n}function Qk(){let[e,t]=w(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn(`Clipboard not supported`),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn(`Copy failed`,e),t(null),!1}}]}function $k(e){_(()=>{let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=t=>e(t.matches);return t.addEventListener(`change`,n),e(t.matches),()=>t.removeEventListener(`change`,n)},[e])}function eA(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function tA(e,t,n){let r=[],i=new EventSource(e);return i.addEventListener(`message`,e=>{let n=JSON.parse(e.data);n&&(r.push(n),t(r.join(``)))}),i.addEventListener(`close`,e=>{i.close(),n(JSON.parse(e.data))}),()=>{i.close()}}function nA(e,t,n){let r=C(t),i=C(n);r.current=t,i.current=n,_(()=>{let t,n=!1,a=e=>r.current(e),o=e=>i.current(e);return typeof e==`function`?e().then(e=>{n||(t=tA(e,a,o))}):t=tA(e,a,o),()=>{n=!0,t?.()}},[e])}function rA(e){return e instanceof Error?e:Error(String(e))}function iA(e,t){Array.isArray(t)&&(t={deps:t});let n=t||{},[r,i]=w(void 0),[a,o]=w(!1),[s,c]=w(n.defaultValue),l=C(e);l.current=e;let u=C(n);u.current=n;let d=h(()=>{let e=u.current;return e.start?.(),o(!0),i(void 0),l.current().then(t=>{i(void 0),c(t),e.onSuccess?.(t)}).catch(t=>{let n=rA(t);i(n),e.onError?.(n)}).finally(()=>{o(!1),e.end?.()})},[]);return _(()=>{let e=u.current;(!e.condition||e.condition())&&d()},[d,...n.deps??[]]),{data:s,isLoading:a,error:r,setData:c,refetch:d}}function aA(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),iA(e,t)}function oA(e=!1){let[t,n]=w(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function sA(e,t,n={}){let r=C(t);r.current=t;let i=C(n);i.current=n;let a=n.threshold||1;_(()=>{let t=e.current,n=new IntersectionObserver(e=>{let t=e[0].isIntersecting;i.current.leave?t||r.current(e[0]):t&&r.current(e[0])},{threshold:a});return t&&n.observe(t),()=>{t&&n.unobserve(t)}},[e,a,...n.deps??[]])}function cA(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const lA=typeof window<`u`?x:_;function uA(e,t=[]){let n=e.pageSize||50,[r,i]=w(null),[a,o]=w(e.payload),[s,c]=w(null),[l,u]=w([]),[d,f]=w(null),[p,m]=w(!1),[h,g]=w(0),v=C(0),y=C(e.search);y.current=e.search;let b=e=>{i(null),u([]),f(null),o(e),g(e=>e+1)},x=()=>{d!==null&&i(d)};return _(()=>{v.current+=1;let e=v.current;m(!0),y.current(a,r,n).then(t=>{e===v.current&&(u(r===null?t.result:e=>[...e,...t.result]),f(t.nextPage),c(null))}).catch(t=>{e===v.current&&c(t)}).finally(()=>{e===v.current&&m(!1)})},[...t,a,h,r,n]),sA(e.nextPageTrigger,()=>{!p&&d&&x()},{threshold:.1,deps:[d,p]}),{search:b,refresh:()=>b(a),searchMore:x,result:l,page:r,hasMore:d!==null,error:s,isSearching:p}}function dA(e,t=[]){return uA({...e,async search(t,n,r){let i=n??0,a=i*r,o=await e.search(t,a,r);return{result:o,nextPage:o.length===0?null:i+1}}},t)}var fA=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function pA(e){return new fA(w(e))}function mA(...e){return j(i(e))}function hA(e){return typeof e==`object`&&!!e&&`message`in e}function gA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:hA(e)&&typeof e.message==`string`?e.message:t}function _A(e,t){let n=e.selectionStart,r=e.selectionEnd,i=e.value,a=`${i.slice(0,n)}\n${i.slice(r)}`;t?.(a),requestAnimationFrame(()=>{e.selectionStart=e.selectionEnd=n+1})}export{sS as AnimateChangeInHeight,xe as Avatar,pa as Badge,yg as Breadcrumbs,W as Button,Og as Card,Mg as CardContent,jg as CardDescription,Ng as CardFooter,kg as CardHeader,Ag as CardTitle,Ce as Center,Qg as Checkbox,we as CloudIcon,p_ as Collapsible,h_ as CollapsibleContent,m_ as CollapsibleTrigger,Gt as ComboBox,ny as Command,ry as CommandDialog,oy as CommandEmpty,sy as CommandGroup,iy as CommandInput,ly as CommandItem,ay as CommandList,cy as CommandSeparator,uy as CommandShortcut,Jk as ComputedProperty,bE as ConfirmModal,Xi as CopyButton,Rt as DOMPopup,zT as DateCombobox,yE as DefaultBox,DE as DeleteModal,Jv as Dialog,Zv as DialogClose,$v as DialogContent,ey as DialogDescription,Qv as DialogOverlay,Xv as DialogPortal,ty as DialogTitle,Yv as DialogTrigger,en as Divider,ga as DotBadge,na as DropZone,iS as Dropdown,Hx as DropdownMenu,Jx as DropdownMenuCheckboxItem,Gx as DropdownMenuContent,Kx as DropdownMenuGroup,qx as DropdownMenuItem,Zx as DropdownMenuLabel,Ux as DropdownMenuPortal,Yx as DropdownMenuRadioGroup,Xx as DropdownMenuRadioItem,Qx as DropdownMenuSeparator,$x as DropdownMenuShortcut,eS as DropdownMenuSub,nS as DropdownMenuSubContent,tS as DropdownMenuSubTrigger,Wx as DropdownMenuTrigger,Zi as EmptyCollection,hE as ErrorBox,ta as FileUploadInput,tE as FilterBar,eE as FilterBtn,nE as FilterClear,iE as FilterOperator,$T as FilterProvider,ua as FormItem,aE as Heading,gE as InfoBox,sa as InfoTip,WT as Input,_a as InputList,pE as Label,lE as LanguageSwitcher,va as Link,aS as MenuGroup,oS as MenuItem,ya as MenuList,mE as MessageBox,Wv as Modal,Kv as ModalBody,Uv as ModalContextProvider,qv as ModalFooter,Gv as ModalTitle,vk as ModeOption,yk as ModeToggle,Ca as NumberInput,OE as OVERFLOW_TAB_GAP_PX,Vt as OptionAdapter,jE as OverflowMoreMenu,ME as OverflowTabsBar,mg as Overlay,NE as Panel,jT as Popover,PT as PopoverAnchor,IT as PopoverClose,FT as PopoverContent,AT as PopoverContext,NT as PopoverTrigger,zt as Popup,Ft as PopupController,vg as Portal,Li as PortalContainerContext,zi as PortalContainerProvider,Rk as Property,mD as RadioGroup,pD as RadioGroupAdapter,fD as RadioGroupItem,vD as ResizableHandle,_D as ResizablePanel,hD as ResizablePanelGroup,Nk as RowSkeleton,oE as SelectBox,xk as SelectList,VT as SelectionCombobox,ED as Separator,Yk as SharedState,fA as SharedValue,Ck as SidePanel,$t as SimpleCombobox,xO as Slider,Bk as Slot,Lk as SortableTableHeaderCell,Ok as Spinner,Dk as SpinnerIconProvider,HT as StringListCombobox,Ht as StringOptionAdapter,Ut as StringOptionAdapterWithCreate,xa as Styles,vE as SuccessBox,Se as SvgAvatar,BO as Switch,Pk as TBody,Mk as THead,Fk as TR,jk as Table,Ik as TableHeaderCell,ok as Tabs,sk as TabsBar,dk as TabsContent,lk as TabsList,ck as TabsPanel,uk as TabsTrigger,Ak as TagsInput,pk as Text,GT as TextCombobox,mk as Textarea,gk as ThemeProvider,hk as ThemeProviderContext,SE as ToastContext,EE as ToastProvider,Hi as Tooltip,Wi as TooltipContent,Vi as TooltipProvider,Ui as TooltipTrigger,Gi as VTooltip,_E as WarningBox,Yi as buttonVariants,mA as cn,At as computePosition,zk as createCompositeStateProvider,gA as errorMessage,Wt as getDefaultComboBoxLayout,_A as insertNewlineAtCursor,da as onActivateKey,Zk as useClickOutside,Yt as useComboboxCtrl,Vk as useCompositeState,Qk as useCopyToClipboard,$k as useDarkMode,eA as useDebounce,dA as useDefaultScrollableSearch,qk as useDefineSlot,oa as useDropZone,nA as useEventSource,iA as useFetch,aA as useFetchOnce,oA as useFlag,Hk as useGetCompositeStateProperty,sA as useIntersectionObserver,cA as useIsFirstRendering,Hv as useIsInModal,AE as useOverflowTabs,LT as usePopoverContext,Lt as usePopupController,Bi as usePortalContainer,lA as useSafeLayoutEffect,uA as useScrollableSearch,Uk as useSetCompositeStateProperty,pA as useSharedValue,Gk as useSlot,_k as useTheme,xE as useToast,Wk as useWatchCompositeStateProperty,Xk as useWatchSharedState,Kk as useWatchSlot};
|
|
340
340
|
//# sourceMappingURL=vertesia-ui-core.js.map
|