@vertesia/ui 1.6.0-dev.20261009.095813Z → 1.6.0-dev.20261014.015055Z

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/lib/boot/index.d.ts +12 -1
  2. package/lib/boot/index.d.ts.map +1 -1
  3. package/lib/boot/index.js +65 -10
  4. package/lib/boot/index.js.map +1 -1
  5. package/lib/boot/text.d.ts +13 -0
  6. package/lib/boot/text.d.ts.map +1 -0
  7. package/lib/boot/text.js +68 -0
  8. package/lib/boot/text.js.map +1 -0
  9. package/lib/features/agent/PayloadBuilder.d.ts +6 -0
  10. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  11. package/lib/features/agent/chat/ModernAgentConversation.js +6 -4
  12. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  13. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts.map +1 -1
  14. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js +58 -0
  15. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js.map +1 -1
  16. package/lib/features/agent/chat/SkillWidgetProvider.d.ts.map +1 -1
  17. package/lib/features/agent/chat/SkillWidgetProvider.js +3 -2
  18. package/lib/features/agent/chat/SkillWidgetProvider.js.map +1 -1
  19. package/lib/i18n/LanguageProvider.d.ts +9 -1
  20. package/lib/i18n/LanguageProvider.d.ts.map +1 -1
  21. package/lib/i18n/LanguageProvider.js +7 -4
  22. package/lib/i18n/LanguageProvider.js.map +1 -1
  23. package/lib/i18n/locales/ar.json +5 -1
  24. package/lib/i18n/locales/de.json +5 -1
  25. package/lib/i18n/locales/en.json +5 -1
  26. package/lib/i18n/locales/es.json +5 -1
  27. package/lib/i18n/locales/fr.json +5 -1
  28. package/lib/i18n/locales/it.json +5 -1
  29. package/lib/i18n/locales/ja.json +5 -1
  30. package/lib/i18n/locales/ko.json +5 -1
  31. package/lib/i18n/locales/pt.json +5 -1
  32. package/lib/i18n/locales/ru.json +5 -1
  33. package/lib/i18n/locales/tr.json +5 -1
  34. package/lib/i18n/locales/zh-TW.json +5 -1
  35. package/lib/i18n/locales/zh.json +5 -1
  36. package/lib/i18n/rtl.d.ts +4 -2
  37. package/lib/i18n/rtl.d.ts.map +1 -1
  38. package/lib/i18n/rtl.js +4 -2
  39. package/lib/i18n/rtl.js.map +1 -1
  40. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  41. package/lib/session/UserSessionProvider.js +10 -4
  42. package/lib/session/UserSessionProvider.js.map +1 -1
  43. package/lib/session/auth/oauth.d.ts.map +1 -1
  44. package/lib/session/auth/oauth.js +15 -11
  45. package/lib/session/auth/oauth.js.map +1 -1
  46. package/lib/shell/VertesiaShell.d.ts +7 -2
  47. package/lib/shell/VertesiaShell.d.ts.map +1 -1
  48. package/lib/shell/VertesiaShell.js +2 -2
  49. package/lib/shell/VertesiaShell.js.map +1 -1
  50. package/lib/shell/login/InviteAcceptModal.d.ts.map +1 -1
  51. package/lib/shell/login/InviteAcceptModal.js +83 -42
  52. package/lib/shell/login/InviteAcceptModal.js.map +1 -1
  53. package/lib/vertesia-ui-boot.js +52 -15
  54. package/lib/vertesia-ui-boot.js.map +1 -1
  55. package/lib/vertesia-ui-core.js +43 -43
  56. package/lib/vertesia-ui-core.js.map +1 -1
  57. package/lib/vertesia-ui-features.js +334 -334
  58. package/lib/vertesia-ui-features.js.map +1 -1
  59. package/lib/vertesia-ui-i18n.B1Nd8-dE.chunk.js +5 -0
  60. package/lib/vertesia-ui-i18n.B1Nd8-dE.chunk.js.map +1 -0
  61. package/lib/vertesia-ui-i18n.B2Z7mx1x.chunk.js +5 -0
  62. package/lib/vertesia-ui-i18n.B2Z7mx1x.chunk.js.map +1 -0
  63. package/lib/vertesia-ui-i18n.B756-YtS.chunk.js +5 -0
  64. package/lib/vertesia-ui-i18n.B756-YtS.chunk.js.map +1 -0
  65. package/lib/vertesia-ui-i18n.BICdgAEn.chunk.js +5 -0
  66. package/lib/vertesia-ui-i18n.BICdgAEn.chunk.js.map +1 -0
  67. package/lib/vertesia-ui-i18n.B_yx0c2A.chunk.js +5 -0
  68. package/lib/vertesia-ui-i18n.B_yx0c2A.chunk.js.map +1 -0
  69. package/lib/vertesia-ui-i18n.BwPrGiQn.chunk.js +5 -0
  70. package/lib/vertesia-ui-i18n.BwPrGiQn.chunk.js.map +1 -0
  71. package/lib/vertesia-ui-i18n.CfQbOHm3.chunk.js +5 -0
  72. package/lib/vertesia-ui-i18n.CfQbOHm3.chunk.js.map +1 -0
  73. package/lib/vertesia-ui-i18n.DMISlF16.chunk.js +5 -0
  74. package/lib/vertesia-ui-i18n.DMISlF16.chunk.js.map +1 -0
  75. package/lib/vertesia-ui-i18n.D_WA36Yq.chunk.js +5 -0
  76. package/lib/vertesia-ui-i18n.D_WA36Yq.chunk.js.map +1 -0
  77. package/lib/vertesia-ui-i18n.Dp3KuMs-.chunk.js +5 -0
  78. package/lib/vertesia-ui-i18n.Dp3KuMs-.chunk.js.map +1 -0
  79. package/lib/vertesia-ui-i18n.DsioKoQ3.chunk.js +5 -0
  80. package/lib/vertesia-ui-i18n.DsioKoQ3.chunk.js.map +1 -0
  81. package/lib/vertesia-ui-i18n.QEIqEPlv.chunk.js +5 -0
  82. package/lib/vertesia-ui-i18n.QEIqEPlv.chunk.js.map +1 -0
  83. package/lib/vertesia-ui-i18n.js +2 -2
  84. package/lib/vertesia-ui-i18n.js.map +1 -1
  85. package/lib/vertesia-ui-layout.js +15 -15
  86. package/lib/vertesia-ui-layout.js.map +1 -1
  87. package/lib/vertesia-ui-rich-text.js +44 -44
  88. package/lib/vertesia-ui-rich-text.js.map +1 -1
  89. package/lib/vertesia-ui-session.js +1 -1
  90. package/lib/vertesia-ui-session.js.map +1 -1
  91. package/lib/vertesia-ui-shell.js +51 -51
  92. package/lib/vertesia-ui-shell.js.map +1 -1
  93. package/lib/vertesia-ui-widgets.js +51 -51
  94. package/lib/vertesia-ui-widgets.js.map +1 -1
  95. package/package.json +20 -20
  96. package/src/boot/index.ts +74 -11
  97. package/src/boot/text.ts +80 -0
  98. package/src/features/agent/chat/ModernAgentConversation.tsx +7 -4
  99. package/src/features/agent/chat/ModernAgentOutput/SummaryConversation.ts +60 -0
  100. package/src/features/agent/chat/SkillWidgetProvider.tsx +3 -2
  101. package/src/i18n/LanguageProvider.tsx +16 -4
  102. package/src/i18n/locales/ar.json +5 -1
  103. package/src/i18n/locales/de.json +5 -1
  104. package/src/i18n/locales/en.json +5 -1
  105. package/src/i18n/locales/es.json +5 -1
  106. package/src/i18n/locales/fr.json +5 -1
  107. package/src/i18n/locales/it.json +5 -1
  108. package/src/i18n/locales/ja.json +5 -1
  109. package/src/i18n/locales/ko.json +5 -1
  110. package/src/i18n/locales/pt.json +5 -1
  111. package/src/i18n/locales/ru.json +5 -1
  112. package/src/i18n/locales/tr.json +5 -1
  113. package/src/i18n/locales/zh-TW.json +5 -1
  114. package/src/i18n/locales/zh.json +5 -1
  115. package/src/i18n/rtl.ts +5 -2
  116. package/src/session/UserSessionProvider.tsx +11 -4
  117. package/src/session/auth/oauth.ts +26 -12
  118. package/src/shell/VertesiaShell.tsx +8 -2
  119. package/src/shell/login/InviteAcceptModal.tsx +112 -65
  120. package/lib/vertesia-ui-i18n.1NWiB6fw.chunk.js +0 -5
  121. package/lib/vertesia-ui-i18n.1NWiB6fw.chunk.js.map +0 -1
  122. package/lib/vertesia-ui-i18n.6Ozlf6Ks.chunk.js +0 -5
  123. package/lib/vertesia-ui-i18n.6Ozlf6Ks.chunk.js.map +0 -1
  124. package/lib/vertesia-ui-i18n.AttJpg8U.chunk.js +0 -5
  125. package/lib/vertesia-ui-i18n.AttJpg8U.chunk.js.map +0 -1
  126. package/lib/vertesia-ui-i18n.BI_xdp49.chunk.js +0 -5
  127. package/lib/vertesia-ui-i18n.BI_xdp49.chunk.js.map +0 -1
  128. package/lib/vertesia-ui-i18n.C-2EEX6w.chunk.js +0 -5
  129. package/lib/vertesia-ui-i18n.C-2EEX6w.chunk.js.map +0 -1
  130. package/lib/vertesia-ui-i18n.CAmo54FO.chunk.js +0 -5
  131. package/lib/vertesia-ui-i18n.CAmo54FO.chunk.js.map +0 -1
  132. package/lib/vertesia-ui-i18n.CbBzmHNP.chunk.js +0 -5
  133. package/lib/vertesia-ui-i18n.CbBzmHNP.chunk.js.map +0 -1
  134. package/lib/vertesia-ui-i18n.DZgTzkIg.chunk.js +0 -5
  135. package/lib/vertesia-ui-i18n.DZgTzkIg.chunk.js.map +0 -1
  136. package/lib/vertesia-ui-i18n.DZsITxq5.chunk.js +0 -5
  137. package/lib/vertesia-ui-i18n.DZsITxq5.chunk.js.map +0 -1
  138. package/lib/vertesia-ui-i18n.Dbf2GHth.chunk.js +0 -5
  139. package/lib/vertesia-ui-i18n.Dbf2GHth.chunk.js.map +0 -1
  140. package/lib/vertesia-ui-i18n.lleWnH5n.chunk.js +0 -5
  141. package/lib/vertesia-ui-i18n.lleWnH5n.chunk.js.map +0 -1
  142. package/lib/vertesia-ui-i18n.wG_XSkbr.chunk.js +0 -5
  143. package/lib/vertesia-ui-i18n.wG_XSkbr.chunk.js.map +0 -1
@@ -1,239 +1,239 @@
1
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{arrow as P,autoUpdate as ee,computePosition as te,flip as F,hide as ne,limitShift as re,offset as ie,shift as ae,size as oe}from"@floating-ui/dom";import{Env as se}from"@vertesia/ui/env";import{FocusScope as ce}from"@radix-ui/react-focus-scope";import{useFocusGuards as le}from"@radix-ui/react-focus-guards";import{RemoveScroll as ue}from"react-remove-scroll";import{hideOthers as de}from"aria-hidden";import{useDirection as fe}from"@radix-ui/react-direction";import pe from"dayjs";import me from"dayjs/plugin/localizedFormat";import he from"dayjs/plugin/relativeTime";import{isEqual as ge}from"lodash-es";import*as _e from"react-resizable-panels";function ve(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 ye({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=ve(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 be({size:e,shape:n=`circle`,color:r=`bg-muted`,className:i,children:a}){let o=n===`circle`?`rounded-full`:`rounded-md`,s=ve(e||`md`);return t(`span`,{className:`inline-block ${s} overflow-hidden ${o} ${r} ${i}`,children:a})}function xe({className:e,children:n}){return t(`div`,{className:r(`flex items-center justify-center`,e),children:n})}function Se(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
- * @license lucide-react v1.49.0 - ISC
3
+ * @license lucide-react v1.53.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
8
  const Ce=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();
9
9
  /**
10
- * @license lucide-react v1.49.0 - ISC
10
+ * @license lucide-react v1.53.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
15
  function we(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ce(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}
16
16
  /**
17
- * @license lucide-react v1.49.0 - ISC
17
+ * @license lucide-react v1.53.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
22
  const Te=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Ee=e=>{
23
23
  /**
24
- * @license lucide-react v1.49.0 - ISC
24
+ * @license lucide-react v1.53.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
29
  let t=Te(e);return t.charAt(0).toUpperCase()+t.slice(1)},De=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Oe={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
- * @license lucide-react v1.49.0 - ISC
31
+ * @license lucide-react v1.53.0 - ISC
32
32
  *
33
33
  * This source code is licensed under the ISC license.
34
34
  * See the LICENSE file in the root directory of this source tree.
35
35
  */
36
36
  /**
37
- * @license lucide-react v1.49.0 - ISC
37
+ * @license lucide-react v1.53.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
41
  */
42
42
  ;
43
43
  /**
44
- * @license lucide-react v1.49.0 - ISC
44
+ * @license lucide-react v1.53.0 - ISC
45
45
  *
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
49
  function ke(e){return e!=null}function Ae(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Oe.width,a=e.size??e.height??Oe.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?De(...c):De(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Oe[`stroke-width`])*Number(e.size??e.width??Oe.width)/Number(t.size??t.width??Oe.width):t.strokeWidth??Oe[`stroke-width`];return[`svg`,{...Object.entries(Oe).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ke(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ke(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ke(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
- * @license lucide-react v1.49.0 - ISC
51
+ * @license lucide-react v1.53.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
56
  function je(e,t={}){return Ae(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}
57
57
  /**
58
- * @license lucide-react v1.49.0 - ISC
58
+ * @license lucide-react v1.53.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
63
  const Me=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ne=d({}),Pe=()=>g(Ne),Fe=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
- * @license lucide-react v1.49.0 - ISC
65
+ * @license lucide-react v1.53.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
69
  */
70
70
  /**
71
- * @license lucide-react v1.49.0 - ISC
71
+ * @license lucide-react v1.53.0 - ISC
72
72
  *
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
76
  let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=Pe()??{},b=!!c||Me(d),[x,S,C=[]]=je(u,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:De(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
- * @license lucide-react v1.49.0 - ISC
78
+ * @license lucide-react v1.53.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
83
  function I(e,t=[],n=[]){let r=typeof e==`string`?we(e,t,n):e,i=p(({className:e,...t},n)=>f(Fe,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Ee(r.name)),i}
84
84
  /**
85
- * @license lucide-react v1.49.0 - ISC
85
+ * @license lucide-react v1.53.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
90
  const Ie={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ie.node;const L=I(Ie),Le={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
91
91
  /**
92
- * @license lucide-react v1.49.0 - ISC
92
+ * @license lucide-react v1.53.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
- ;Le.node;const R=I(Le),Re={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}
97
+ ;Le.node;const R=I(Le),Re={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}
98
98
  /**
99
- * @license lucide-react v1.49.0 - ISC
99
+ * @license lucide-react v1.53.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
- ;Re.node;const ze=I(Re),Be={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}
104
+ ;Re.node;const ze=I(Re),Be={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}
105
105
  /**
106
- * @license lucide-react v1.49.0 - ISC
106
+ * @license lucide-react v1.53.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
  ;Be.node;const Ve=I(Be),He={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
- * @license lucide-react v1.49.0 - ISC
113
+ * @license lucide-react v1.53.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
  ;He.node;const Ue=I(He),We={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
- * @license lucide-react v1.49.0 - ISC
120
+ * @license lucide-react v1.53.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
  ;We.node;const Ge=I(We),Ke={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
- * @license lucide-react v1.49.0 - ISC
127
+ * @license lucide-react v1.53.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
  ;Ke.node;const qe=I(Ke),Je={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
- * @license lucide-react v1.49.0 - ISC
134
+ * @license lucide-react v1.53.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
  ;Je.node;const Ye=I(Je),Xe={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
- * @license lucide-react v1.49.0 - ISC
141
+ * @license lucide-react v1.53.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
  ;Xe.node;const Ze=I(Xe),Qe={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
- * @license lucide-react v1.49.0 - ISC
148
+ * @license lucide-react v1.53.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
  ;Qe.node;const $e=I(Qe),et={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
- * @license lucide-react v1.49.0 - ISC
155
+ * @license lucide-react v1.53.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
  ;et.node;const tt=I(et),nt={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
- * @license lucide-react v1.49.0 - ISC
162
+ * @license lucide-react v1.53.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
  ;nt.node;const rt=I(nt),it={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
- * @license lucide-react v1.49.0 - ISC
169
+ * @license lucide-react v1.53.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
  ;it.node;const at=I(it),ot={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}
175
175
  /**
176
- * @license lucide-react v1.49.0 - ISC
176
+ * @license lucide-react v1.53.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
  ;ot.node;const st=I(ot),ct={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
- * @license lucide-react v1.49.0 - ISC
183
+ * @license lucide-react v1.53.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
  ;ct.node;const lt=I(ct),ut={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]}
189
189
  /**
190
- * @license lucide-react v1.49.0 - ISC
190
+ * @license lucide-react v1.53.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
  ;ut.node;const dt=I(ut),ft={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
- * @license lucide-react v1.49.0 - ISC
197
+ * @license lucide-react v1.53.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
  ;ft.node;const pt=I(ft),mt={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
- * @license lucide-react v1.49.0 - ISC
204
+ * @license lucide-react v1.53.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
  ;mt.node;const ht=I(mt),gt={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
- * @license lucide-react v1.49.0 - ISC
211
+ * @license lucide-react v1.53.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
  ;gt.node;const _t=I(gt),vt={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
- * @license lucide-react v1.49.0 - ISC
218
+ * @license lucide-react v1.53.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
  ;vt.node;const yt=I(vt),bt={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
224
224
  /**
225
- * @license lucide-react v1.49.0 - ISC
225
+ * @license lucide-react v1.53.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
- ;bt.node;const xt=I(bt);function St(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 Ct(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var wt=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=Ct(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=St(e.position);if(t!==e.position)return{...e,position:t}}return null}};function Tt(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function Et(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Dt(e,t,n,r){let i=new wt(e.gap),a=i.computePosition(e,t,n),o=Et(a.rect,r,`x`),s=Et(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 wt(i.gap).computePosition(c,t,n),Tt(a.rect,r)?a:null):null}function Ot(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 kt(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=Ot(e[n].getBoundingClientRect(),t),!t)return null;return t}function At(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 jt(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)At(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var Mt=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=jt(this.anchor,this.root),this.visibleClientRect=kt(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=Dt(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 Nt=d(void 0);function Pt(){let e=g(Nt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function Ft({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 Mt({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(Nt.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 It({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(Ft,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function Lt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var Rt=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}},zt=class e extends Rt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},Bt=class e extends zt{createItem(e){return e}static instance=new e};function Vt(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:Ut,Menu:Gt,Toggle:Wt}}function Ht({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(Lt()),S=C(void 0),T=C(null),E=p?Object.assign(Vt(d,u),p):Vt(d,u),D=o.useRef(null),O=Kt({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(It,{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 Ut({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(xt,{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 Wt({ctrl:e}){return e.isMenuOpen?t(Ve,{className:`w-4 h-4`}):t(R,{className:`w-4 h-4`})}function Gt({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 Kt(e){let[t,n]=w(new qt(e));return _(()=>{t?.withState(n)},[t]),t}var qt=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:Jt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Yt(this.highlightedIndex,e.length),!0)}}}};function Jt(e,t){return(e+1)%t}function Yt(e,t){return(e-1+t)%t}function Xt({options:e,creatable:n,...r}){let i=n?Bt.instance:zt.instance;return t(Ht,{adapter:i,items:e,...r})}function Zt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var Qt=Object.defineProperty,$t=(e,t)=>Qt(e,`name`,{value:t,configurable:!0});function en(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}$t(en,`setRef`);function tn(...e){return t=>{let n=!1,r=e.map(e=>{let r=en(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():en(e[t],null)}}}}$t(tn,`composeRefs`);function z(...e){return a.useCallback(tn(...e),e)}$t(z,`useComposedRefs`);var nn=Object.defineProperty,rn=(e,t)=>nn(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
230
+ ;bt.node;const xt=I(bt);function St(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 Ct(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var wt=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=Ct(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=St(e.position);if(t!==e.position)return{...e,position:t}}return null}};function Tt(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function Et(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Dt(e,t,n,r){let i=new wt(e.gap),a=i.computePosition(e,t,n),o=Et(a.rect,r,`x`),s=Et(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 wt(i.gap).computePosition(c,t,n),Tt(a.rect,r)?a:null):null}function Ot(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 kt(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=Ot(e[n].getBoundingClientRect(),t),!t)return null;return t}function At(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 jt(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)At(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var Mt=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=jt(this.anchor,this.root),this.visibleClientRect=kt(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=Dt(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 Nt=d(void 0);function Pt(){let e=g(Nt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function Ft({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 Mt({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(Nt.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 It({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(Ft,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function Lt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var Rt=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}},zt=class e extends Rt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},Bt=class e extends zt{createItem(e){return e}static instance=new e};function Vt(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:Ut,Menu:Gt,Toggle:Wt}}function Ht({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(Lt()),S=C(void 0),T=C(null),E=p?Object.assign(Vt(d,u),p):Vt(d,u),D=o.useRef(null),O=Kt({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(It,{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 Ut({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(xt,{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 Wt({ctrl:e}){return e.isMenuOpen?t(ze,{className:`w-4 h-4`}):t(R,{className:`w-4 h-4`})}function Gt({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 Kt(e){let[t,n]=w(new qt(e));return _(()=>{t?.withState(n)},[t]),t}var qt=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:Jt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Yt(this.highlightedIndex,e.length),!0)}}}};function Jt(e,t){return(e+1)%t}function Yt(e,t){return(e-1+t)%t}function Xt({options:e,creatable:n,...r}){let i=n?Bt.instance:zt.instance;return t(Ht,{adapter:i,items:e,...r})}function Zt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var Qt=Object.defineProperty,$t=(e,t)=>Qt(e,`name`,{value:t,configurable:!0});function en(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}$t(en,`setRef`);function tn(...e){return t=>{let n=!1,r=e.map(e=>{let r=en(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():en(e[t],null)}}}}$t(tn,`composeRefs`);function z(...e){return a.useCallback(tn(...e),e)}$t(z,`useComposedRefs`);var nn=Object.defineProperty,rn=(e,t)=>nn(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
231
231
  function an(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];mn(r)&&typeof vn==`function`&&(r=vn(r._payload)),a.Children.forEach(r,e=>{if(fn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;mn(n)&&typeof vn==`function`&&(n=vn(n._payload)),o=ln(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?dn(o):void 0,u=z(n,l);if(!o){if(r||r===0)throw Error(s?_n(e):gn(e));return r}let d=un(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}rn(an,`createSlot`);var on=/* @__PURE__ */ an(`Slot`),sn=Symbol.for(`radix.slottable`);// @__NO_SIDE_EFFECTS__
232
232
  function cn(e){let t=/* @__PURE__ */ rn(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=sn,t}rn(cn,`createSlottable`);var ln=/* @__PURE__ */ rn((e,t)=>{if(`child`in e.props){let t=e.props.child;return a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null}return a.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function un(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(` `))}return{...e,...n}}rn(un,`mergeProps`);function dn(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)}rn(dn,`getElementRef`);function fn(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===sn}rn(fn,`isSlottable`);var pn=Symbol.for(`react.lazy`);function mn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===pn&&`_payload`in e&&hn(e._payload)}rn(mn,`isLazyComponent`);function hn(e){return typeof e==`object`&&!!e&&`then`in e}rn(hn,`isPromiseLike`);var gn=/* @__PURE__ */ rn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),_n=/* @__PURE__ */ rn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),vn=a.use;function B(...e){return j(i(e))}var yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return/* @__PURE__ */ bn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}bn(V,`composeEventHandlers`);function Sn(e){if(!xn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}bn(Sn,`getOwnerWindow`);function Cn(e){if(!xn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}bn(Cn,`getOwnerDocument`);function wn(e,t=!1){let{activeElement:n}=Cn(e);if(!n?.nodeName)return null;if(Tn(n)&&n.contentDocument)return wn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Cn(n).getElementById(e);if(t)return t}}return n}bn(wn,`getActiveElement`);function Tn(e){return e.tagName===`IFRAME`}bn(Tn,`isFrame`);var En=Object.defineProperty,Dn=(e,t)=>En(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
233
233
  function On(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=/* @__PURE__ */ Dn(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 Dn(o,`useContext`),[i,o]}Dn(On,`createContext`);// @__NO_SIDE_EFFECTS__
234
234
  function kn(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__ */ Dn(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 Dn(l,`useContext`),[c,l]}Dn(i,`createContext`);let o=/* @__PURE__ */ Dn(()=>{let t=r.map(e=>a.createContext(e));return/* @__PURE__ */ Dn(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,An(o,...n)]}Dn(kn,`createContextScope`);function An(...e){let t=e[0];if(e.length===1)return t;let n=/* @__PURE__ */ Dn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return/* @__PURE__ */ Dn(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}Dn(An,`composeContextScopes`);var jn=globalThis?.document?a.useLayoutEffect:()=>{},Mn=Object.defineProperty,Nn=(e,t)=>Mn(e,`name`,{value:t,configurable:!0}),Pn=a.useId||(()=>void 0),Fn=0;function H(e){let[t,n]=a.useState(Pn());return jn(()=>{e||n(e=>e??String(Fn++))},[e]),e||(t?`radix-${t}`:``)}Nn(H,`useId`);var In=typeof document<`u`?x:function(){};function Ln(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(!Ln(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)&&!Ln(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zn(e,t){let n=Rn(e);return Math.round(t*n)/n}function Bn(e){let t=a.useRef(e);return In(()=>{t.current=e}),t}function Vn(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);Ln(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=Bn(l),k=Bn(i),A=Bn(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&&!Ln(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);In(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);In(()=>(M.current=!0,()=>{M.current=!1}),[]),In(()=>{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]),ee=a.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=zn(P.floating,d.x),r=zn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rn(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:ee}),[d,j,N,P,ee])}const Hn=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?{}:P({element:r.current,padding:i}).fn(n):r?P({element:r,padding:i}).fn(n):{}}}},Un=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wn=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gn=(e,t)=>({fn:re(e).fn,options:[e,t]}),Kn=(e,t)=>{let n=F(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)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{let n=Hn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Xn=Object.defineProperty,Zn=(e,t)=>Xn(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__ */ an(`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 Qn(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}Zn(Qn,`dispatchDiscreteCustomEvent`);var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0});function tr(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}er(tr,`useCallbackRef`);var nr=Object.defineProperty,rr=(e,t)=>nr(e,`name`,{value:t,configurable:!0});function ir(e){let[t,n]=a.useState(void 0);return jn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}rr(ir,`useSize`);var ar=Object.defineProperty,or=(e,t)=>ar(e,`name`,{value:t,configurable:!0}),sr=`Popper`,[cr,lr]=/* @__PURE__ */ kn(sr),[ur,dr]=cr(sr),fr=/* @__PURE__ */ or(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return/* @__PURE__ */ t(ur,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),pr=`PopperAnchor`,mr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ or(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=dr(pr,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&&xr(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`)),hr=`PopperContent`,[gr,_r]=cr(hr),vr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ or(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=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=dr(hr,r),[y,b]=a.useState(null),x=z(n,b),[S,C]=a.useState(null),w=ir(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(yr),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:te,middlewareData:F}=Vn({strategy:`fixed`,placement:D,whileElementsMounted:/* @__PURE__ */ or((...e)=>ee(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Un({mainAxis:o+E,alignmentAxis:c}),u&&Wn({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Gn():void 0,...j}),u&&Kn({...j}),qn({...j,apply:/* @__PURE__ */ or(({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&&Yn({element:S,padding:l}),br({arrowWidth:T,arrowHeight:E}),m&&Jn({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=v.setPlacementState;jn(()=>(ne(P),()=>{ne(void 0)}),[P,ne]);let[re,ie]=xr(P),ae=tr(g);jn(()=>{te&&ae?.()},[te,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[le,ue]=a.useState();return jn(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),/* @__PURE__ */ t(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:te?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:/* @__PURE__ */ t(gr,{scope:r,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:/* @__PURE__ */ t(U.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?_.style?.animation:`none`}})})})},`PopperContent`));function yr(e){return e!==null}or(yr,`isNotNull`);var br=/* @__PURE__ */ or(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]=xr(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 xr(e){let[t,n=`center`]=e.split(`-`);return[t,n]}or(xr,`getSideAndAlignFromPlacement`);var Sr=fr,Cr=mr,wr=vr,Tr=Object.defineProperty,Er=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>Tr(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);jn(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(/* @__PURE__ */ t(U.div,{...i,ref:n}),c):null},`Portal`)),Dr=Object.defineProperty,Or=(e,t)=>Dr(e,`name`,{value:t,configurable:!0});function kr(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}Or(kr,`useStateMachine`);var Ar=/* @__PURE__ */ Or(e=>{let{present:t,children:n}=e,r=jr(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=Nr(r.ref,Fr(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function jr(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]=kr(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??Pr(r.current),s.current=void 0):o.current=`none`},[c]),jn(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=Pr(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]),jn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=/* @__PURE__ */ Or(a=>{let o=Pr(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__ */ Or(e=>{e.target===t&&(o.current=Pr(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=Pr(t)}else r.current=null;n(e)},[])}}Or(jr,`usePresence`);function Mr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Or(Mr,`setRef`);function Nr(...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=Mr(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():Mr(n[e],null)}}},[])}Or(Nr,`useStableComposedRefs`);function Pr(e){return e?.animationName||`none`}Or(Pr,`getAnimationName`);function Fr(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)}Or(Fr,`getElementRef`);var Ir=Object.defineProperty,Lr=(e,t)=>Ir(e,`name`,{value:t,configurable:!0}),Rr=a.useEffectEvent,zr=a.useInsertionEffect;function Br(e){if(typeof Rr==`function`)return Rr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof zr==`function`?zr(()=>{t.current=e}):jn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}Lr(Br,`useEffectEvent`);var Vr=Object.defineProperty,Hr=(e,t)=>Vr(e,`name`,{value:t,configurable:!0}),Ur=a.useInsertionEffect||jn;function Wr({prop:e,defaultProp:t,onChange:n=/* @__PURE__ */ Hr(()=>{},`onChange`),caller:r}){let[i,o,s]=Gr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Kr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}Hr(Wr,`useControllableState`);function Gr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return Ur(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}Hr(Gr,`useUncontrolledState`);function Kr(e){return typeof e==`function`}Hr(Kr,`isFunction`);var qr=Symbol(`RADIX:SYNC_STATE`);function Jr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=Br(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]}Hr(Jr,`useControllableStateReducer`);var Yr=Object.defineProperty,Xr=(e,t)=>Yr(e,`name`,{value:t,configurable:!0}),Zr=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`}),Qr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Xr(function(e,n){return/* @__PURE__ */ t(U.span,{...e,ref:n,style:{...Zr,...e.style}})},`VisuallyHidden`)),$r=Object.defineProperty,ei=(e,t)=>$r(e,`name`,{value:t,configurable:!0}),[ti,ni]=/* @__PURE__ */ kn(`Tooltip`,[lr]),ri=lr(),ii=`TooltipProvider`,ai=700,oi=`tooltip.open`,[si,ci]=ti(ii),li=/* @__PURE__ */ ei(e=>{let{__scopeTooltip:n,delayDuration:r=ai,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(si,{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`),ui=`Tooltip`,[di,fi]=ti(ui),pi=/* @__PURE__ */ ei(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=ci(ui,e.__scopeTooltip),d=ri(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]=Wr({prop:i,defaultProp:o??!1,onChange:/* @__PURE__ */ ei(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(oi))):u.onClose(),s?.(e)},`onChange`),caller:ui}),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(Sr,{...d,children:/* @__PURE__ */ t(di,{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`),mi=`TooltipTrigger`,hi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ei(function(e,n){let{__scopeTooltip:r,...i}=e,o=fi(mi,r),s=ci(mi,r),c=ri(r),l=z(n,a.useRef(null),o.onTriggerChange),u=a.useRef(!1),d=a.useRef(!1),f=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),/* @__PURE__ */ t(Cr,{asChild:!0,...c,children:/* @__PURE__ */ t(U.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:l,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})},`TooltipTrigger`)),gi=`TooltipPortal`,[_i,vi]=ti(gi,{forceMount:void 0}),yi=/* @__PURE__ */ ei(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=fi(gi,n);return/* @__PURE__ */ t(_i,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Ar,{present:r||o.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),bi=`TooltipContent`,xi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ei(function(e,n){let r=vi(bi,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=fi(bi,e.__scopeTooltip);return/* @__PURE__ */ t(Ar,{present:i||s.open,children:s.disableHoverableContent?/* @__PURE__ */ t(wi,{side:a,...o,ref:n}):/* @__PURE__ */ t(Si,{side:a,...o,ref:n})})},`TooltipContent`)),Si=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ei(function(e,n){let r=fi(bi,e.__scopeTooltip),i=ci(bi,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=Ei(r,Ti(r,n.getBoundingClientRect())),a=Di(t.getBoundingClientRect()),o=ki([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=/* @__PURE__ */ ei(e=>h(e,f),`handleTriggerLeave`),t=/* @__PURE__ */ ei(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__ */ ei(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!Oi(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),/* @__PURE__ */ t(wi,{...e,ref:s})},`TooltipContentHoverable`)),Ci=/* @__PURE__ */ cn(`TooltipContent`),wi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ei(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=fi(bi,i),p=ri(i),{onClose:m}=f;a.useEffect(()=>(document.addEventListener(oi,m),()=>document.removeEventListener(oi,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=/* @__PURE__ */ ei(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:h}=f;return jn(()=>(h(c),()=>{h(void 0)}),[c,h]),/* @__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:r,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(Ci,{children:o}),s?/* @__PURE__ */ t(Qr,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function Ti(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`)}}ei(Ti,`getExitSideFromRect`);function Ei(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}ei(Ei,`getPaddedExitPoints`);function Di(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}]}ei(Di,`getPointsFromRect`);function Oi(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}ei(Oi,`isPointInPolygon`);function ki(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)),Ai(t)}ei(ki,`getHull`);function Ai(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)}ei(Ai,`getHullPresorted`);var ji=li,Mi=pi,Ni=hi,Pi=yi,Fi=xi;const Ii=o.createContext(void 0);function Li(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 Ri({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(Ii),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=Li(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(Ii.Provider,{value:a||void 0,children:e})}function zi(){return o.useContext(Ii)}const Bi=ji,Vi=Mi,Hi=Ni,Ui=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=zi();return t(Pi,{container:o,children:t(Fi,{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})})});Ui.displayName=Fi.displayName;function Wi({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(Bi,{delayDuration:0,children:n(Vi,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(Hi,{className:`cursor-pointer`,asChild:c,children:r}),t(Ui,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const Gi=/* @__PURE__ */ new Set;function Ki(e,t,n){_(()=>{t&&!Gi.has(e)&&(Gi.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function qi(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:qi(t.children)}return!1})}const Ji=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)=>{Ki(`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?on:`button`,_=o?p:p??`button`,v=u??s,y=m[`aria-label`]??s??(qi(m.children)?void 0:u),b=o?m.children:n(e,{children:[l&&t(at,{className:`animate-spin`}),m.children]}),x=t(g,{className:B(Ji({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(Wi,{description:v,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:d,children:x}):x});W.displayName=`Button`;const Yi=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();Ki(`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(L,{className:`text-success`}):o??t(Ze,{className:`size-4`})})});Yi.displayName=`CopyButton`;function Xi({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(dt,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Zi(e){return e.isFile}function Qi(e){return e.isDirectory}function $i(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function ea({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($i(i.current.files))}})]})}function ta({onUpload:e}){let r=aa({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 na(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function ra(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function ia(e){e&&delete e.__dragOver_cnt__}function aa({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),ia(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Zi(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(Qi(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:()=>{na(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{ra(r.current)&&r.current?.classList.remove(t)},ref:r}}function oa({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(Wi,{description:e,placement:r,children:t(tt,{className:B(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function sa(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function ca(){try{return se.isDev}catch{return!1}}function la({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=sa(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 ca()&&!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(oa,{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 ua(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const da=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 fa({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:ua(i)}:{};return t(`span`,{className:B(da({variant:n}),e),...o,...a,children:r})}const pa=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`}}),ma=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 ha({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:B(pa({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:B(ma({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 ga({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(Wi,{description:`click to remove`,children:t(fa,{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 _a({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 va({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}va.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 ya=`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`,ba={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:ya,INPUT:`${ya} py-1.5`};function xa(e){return e==null||Number.isNaN(e)?``:e.toString()}const Sa=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(xa(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=xa(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,ba.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),Ca=d({});function wa(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const Ta=typeof window<`u`?x:_,Ea=/* @__PURE__ */ d(null);function Da(e,t){e.indexOf(t)===-1&&e.push(t)}function Oa(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const ka=(e,t,n)=>n>t?t:n<e?e:n,Aa={},ja=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ma=e=>typeof e==`object`&&!!e,Na=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
235
235
  function Pa(e){let t;return()=>(t===void 0&&(t=e()),t)}const Fa=/* @__NO_SIDE_EFFECTS__ */ e=>e,Ia=(...e)=>e.reduce((e,t)=>n=>t(e(n))),La=/* @__NO_SIDE_EFFECTS__ */ (e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var Ra=class{constructor(){this.subscriptions=[]}add(e){return Da(this.subscriptions,e),()=>this.remove(e)}remove(e){Oa(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 za=/* @__NO_SIDE_EFFECTS__ */ e=>e*1e3,Ba=/* @__NO_SIDE_EFFECTS__ */ e=>e/1e3,Va=/* @__NO_SIDE_EFFECTS__ */ (e,t)=>t?1e3/t*e:0,Ha=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ua(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Ha(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}/*#__NO_SIDE_EFFECTS__*/
236
- function Wa(e,t,n,r){if(e===t&&n===r)return Fa;let i=t=>Ua(t,0,1,e,n);return e=>e===0||e===1?e:Ha(i(e),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:Fa,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 uo={now:()=>(co===void 0&&uo.set(G.isProcessing||Aa.useManualTiming?G.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=>ka(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=>ka(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(`%`),K=/*@__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))+`)`},q={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=q.parse(e);return t.alpha=0,q.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(So.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=>(q.test(e)?(r.color.push(a),i.push(Wo),n.push(q.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?fo(r[a]):e===Wo?q.transform(r[a]):r[a]}return i}}function Xo(e){return Yo(qo(e))}const Zo=e=>typeof e==`number`?0:q.test(e)?q.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=[jo,ko,Ro],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===Ro&&(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),ko.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`?go(e)?rs:q.test(e)?cs:gs:Array.isArray(e)?ps:typeof e==`object`?q.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):Ia(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=>fo(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=Aa.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:Fa,!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:uo.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 r=n({...e,keyframes:[0,t]}),i=Math.min(Os(r),Ds);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:/* @__PURE__ */ Ba(i)}}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=ka(As.minDuration,As.maxDuration,/* @__PURE__ */ Ba(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__ */ za(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__ */ Ba(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ Ba(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__ */ za(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ za(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__ */ za(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||Aa.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]||Fa:t;a=Ia(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__ */ La(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ka(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__ */ La(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:(Aa.mix||ys)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?ka(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__ */ Va(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])}function tc(e,t){return{kind:e,animation:t,timestamp:uo.now(),frameTimestamp:G.timestamp,frameIsProcessing:G.isProcessing}}function nc(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...tc(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function rc(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...tc(`layout-animation-start`,e),node:t})}catch{}}var ic=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 ac=e=>e/100;var oc=class extends ic{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(),nc(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=Ia(ac,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,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=ka(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!==Vs&&(b.value=Qs(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__ */ Ba(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Ba(e)}get time(){return/* @__PURE__ */ Ba(this.currentTime)}set time(e){e=/* @__PURE__ */ za(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(uo.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ Ba(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??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 sc=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function cc(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=+!!sc.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const lc=/\b([a-z-]*)\(.*?\)/gu,uc={...es,getAnimatableNone:e=>{let t=e.match(lc);return t?t.map(cc).join(` `):e}},dc={...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))}},fc={...yo,transform:Math.round},pc={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,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:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:bo,originX:Lo,originY:Lo,originZ:K,zIndex:fc,fillOpacity:bo,strokeOpacity:bo,numOctaves:fc},mc={...pc,color:q,backgroundColor:q,outlineColor:q,fill:q,stroke:q,borderColor:q,borderTopColor:q,borderRightColor:q,borderBottomColor:q,borderLeftColor:q,filter:uc,WebkitFilter:uc,mask:dc,WebkitMask:dc},hc=e=>mc[e],gc=/*@__PURE__*/ new Set([uc,dc]);function _c(e,t){let n=hc(e);return gc.has(n)||(n=es),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function vc(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const yc=e=>e*180/Math.PI,bc=e=>{let t=yc(Math.atan2(e[1],e[0]));return Sc(t)},xc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bc,rotateZ:bc,skewX:e=>yc(Math.atan(e[1])),skewY:e=>yc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Sc=e=>(e%=360,e<0&&(e+=360),e),Cc=bc,wc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Tc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ec={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wc,scaleY:Tc,scale:e=>(wc(e)+Tc(e))/2,rotateX:e=>Sc(yc(Math.atan2(e[6],e[5]))),rotateY:e=>Sc(yc(Math.atan2(-e[2],e[0]))),rotateZ:Cc,rotate:Cc,skewX:e=>yc(Math.atan(e[4])),skewY:e=>yc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Dc(e){return+!!e.includes(`scale`)}function Oc(e,t){if(!e||e===`none`)return Dc(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Ec,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xc,i=t}if(!i)return Dc(t);let a=r[t],o=i[1].split(`,`).map(Ac);return typeof a==`function`?a(o):o[a]}const kc=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Oc(n,t)};function Ac(e){return parseFloat(e.trim())}const jc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Mc=/* @__PURE__ */ new Set([...jc,`pathRotation`]),Nc=e=>e===yo||e===K,Pc=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Fc=jc.filter(e=>!Pc.has(e));function Ic(e){let t=[];return Fc.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 Lc=/* @__PURE__ */ new Set([`bottom`,`right`]);function Rc(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 zc={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Rc(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Rc(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})=>Oc(e,`x`),y:({transform:e})=>Oc(e,`y`)};zc.translateX=zc.x,zc.translateY=zc.y;const Bc=/* @__PURE__ */ new Set;let Vc=!1,Hc=!1,Uc=!1;function Wc(){if(Hc){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Bc.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Lc.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=Ic(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)})}Hc=!1,Vc=!1,Bc.forEach(e=>e.complete(Uc)),Bc.clear()}function Gc(){Bc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hc=!0)})}function Kc(){Uc=!0,Gc(),Wc(),Uc=!1}function qc(e,t,n){if(typeof e==`string`){if(ja(e)||Na(e))return parseFloat(e);if(!es.test(e)&&es.test(n))return _c(t,n)}return e??void 0}var Jc=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?(Bc.add(this),Vc||(Vc=!0,Y.read(Gc),Y.resolveKeyframes(Wc))):(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=qc(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])}vc(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bc.delete(this)}cancel(){this.state===`scheduled`&&(Bc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Yc=e=>e.startsWith(`--`);function Xc(e,t,n){Yc(t)?e.style.setProperty(t,n):e.style[t]=n}const Zc={};function Qc(e,t){let n=/* @__PURE__ */ Pa(e);return()=>Zc[t]??n()}const $c=/* @__PURE__ */ Qc(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),el=/*@__PURE__*/ Qc(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),tl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nl={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ tl([0,.65,.55,1]),circOut:/*@__PURE__*/ tl([.55,0,1,.45]),backIn:/*@__PURE__*/ tl([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ tl([.33,1.53,.69,.99])};function rl(e,t){if(e)return typeof e==`function`?el()?Es(e,t):`ease-out`:/* @__PURE__ */ io(e)?tl(e):Array.isArray(e)?e.map(e=>rl(e,t)||nl.easeOut):nl[e]}function il(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=rl(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 al(e){return typeof e==`function`&&`applyToOptions`in e}function ol({type:e,...t}){return al(e)&&el()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var sl=class extends ic{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=ol(e);this.animation=il(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),Xc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},nc(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__ */ Ba(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Ba(e)}get time(){return/* @__PURE__ */ Ba(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ za(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&&$c()?(this.animation.timeline=e,t?.(this.animation),Fa):n(this)}};const cl={anticipate:Xa,backInOut:Ya,circInOut:$a};function ll(e){return e in cl}function ul(e){typeof e.ease==`string`&&ll(e.ease)&&(e.ease=cl[e.ease])}var dl=class extends sl{constructor(e){ul(e),ec(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 oc({...a,autoplay:!1}),s=Math.max(10,uo.now()-this.startTime),c=ka(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&Xc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const fl=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(es.test(e)||e===`0`)&&!e.startsWith(`url(`));function pl(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 ml(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=fl(i,t),s=fl(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):pl(e)||(n===`spring`||al(n))&&r}function hl(e){e.duration=0,e.type=`keyframes`}const gl=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),_l=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function vl(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&_l.test(e[t]))return!0;return!1}const yl=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),bl=/*@__PURE__*/ Pa(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function xl(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(gl.has(n)||yl.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 bl()&&(gl.has(n)||yl.has(n)&&vl(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Sl=class extends ic{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||Jc;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;ml(e,i,a,o)||(u=!1,(Aa.instantAnimations||!s)&&l?.(Qs(e,n,t)),e[0]=e[e.length-1],hl(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&&xl(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new dl(n)}catch{m=new oc(n)}}else m=new oc(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(),Kc()),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 Cl(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 wl=e=>!isNaN(parseFloat(e)),Tl={current:void 0};var El=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=wl(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 Ra)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Ra,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 Tl.current&&Tl.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__ */ Va(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 Dl(e,t){return new El(e,t)}function Ol(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function kl(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Ol(n,e)}const Al={type:`spring`,stiffness:500,damping:25,restSpeed:10},jl=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ml={type:`keyframes`,duration:.8},Nl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Pl=(e,{keyframes:t})=>t.length>2?Ml:Mc.has(e)?e.startsWith(`scale`)?jl(t[1]):Al:Nl,Fl=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Il(e){for(let t in e)if(!Fl.has(t))return!0;return!1}const Ll=(e,t,n,r={},i,a)=>o=>{let s=kl(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ za(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};Il(s)||Object.assign(u,Pl(e,u)),u.duration&&=/* @__PURE__ */ za(u.duration),u.repeatDelay&&=/* @__PURE__ */ za(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(hl(u),u.delay===0&&(d=!0)),(Aa.instantAnimations||Aa.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,hl(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 oc(u):new Sl(u)},Rl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zl(e){let t=Rl.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Bl(e,t,n=1){`${e}`;let[r,i]=zl(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ja(e)?parseFloat(e):e}return go(i)?Bl(i,t,n+1):i}function Vl(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Hl(e,t,n,r){if(typeof t==`function`){let[i,a]=Vl(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Vl(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Ul(e,t,n){let r=e.getProps();return Hl(r,t,n===void 0?r.custom:n,e)}const Wl=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...jc]),Gl=e=>Array.isArray(e);function Kl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dl(n))}function ql(e){return Gl(e)?e[e.length-1]||0:e}function Jl(e,t){let{transitionEnd:n={},transition:r={},...i}=Ul(e,t)||{};i={...i,...n};for(let t in i)Kl(e,t,ql(i[t]))}const Yl=e=>!!(e&&e.getVelocity);function Xl(e){return!!(Yl(e)&&e.add)}function Zl(e,t){let n=e.getValue(`willChange`);if(Xl(n))return n.add(t);if(!n&&Aa.WillChange){let n=new Aa.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Ql(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const $l=`data-`+Ql(`framerAppearId`);function eu(e){return e.props[$l]}const tu=typeof window<`u`;function nu({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ru(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Ol(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&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&&nu(f,t))continue;let o={delay:n,...kl(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(tu&&window.MotionHandoffAnimation){let n=eu(e);if(n){let e=window.MotionHandoffAnimation(n,t,Y);e!==null&&(o.startTime=e,p=!0)}}Zl(e,t);let m=l??e.shouldReduceMotion;r.start(Ll(t,r,i,m&&Wl.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Y.update(()=>{o&&Jl(e,o)});d.length?Promise.all(d).then(t):t()}return d}function iu(e,t,n={}){let r=Ul(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(ru(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return au(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function au(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(iu(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Cl(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function ou(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>iu(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=iu(e,t,n);else{let i=typeof t==`function`?Ul(e,t,n.custom):t;r=Promise.all(ru(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const su={test:e=>e===`auto`,parse:e=>e},cu=e=>t=>t.test(e),lu=[yo,K,Po,No,Io,Fo,su],uu=e=>lu.find(cu(e));function du(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Na(e)}const fu=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function pu(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!fu.has(t)&&Ko(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=_c(n,i))}var mu=class extends Jc{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=Bl(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Wl.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=uu(r),o=uu(i);if(vo(r)!==vo(i)&&zc[n]){this.needsMeasurement=!0;return}if(a!==o){if(Nc(a)&&Nc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else zc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||du(e[t]))&&n.push(t);n.length&&pu(e,n,t)}measure(){let{element:e,name:t}=this;return zc[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 hu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function gu(e){return Ma(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function _u(e){return Ma(e)&&`ownerSVGElement`in e}const vu=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function yu(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 bu={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},xu=jc.length;function Su(e,t,n){let r=``,i=!0;for(let a=0;a<xu;a++){let o=jc[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=vu(s,pc[o]);if(!c){i=!1;let t=bu[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${vu(a,pc.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Cu(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(Mc.has(e)){o=!0;continue}if(mo(e)){i[e]=n;continue}{let t=vu(n,pc[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Su(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 wu={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Tu={offset:`strokeDashoffset`,array:`strokeDasharray`};function Eu(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?wu:Tu;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Du=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Ou(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Cu(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 Du)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&&Eu(d,i,a,o,!1)}function ku({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Au({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ju(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 Mu(e){return e===void 0||e===1}function Nu({scale:e,scaleX:t,scaleY:n}){return!Mu(e)||!Mu(t)||!Mu(n)}function Pu(e){return Nu(e)||Fu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Fu(e){return Iu(e.x)||Iu(e.y)}function Iu(e){return e&&e!==`0%`}function Lu(e,t,n){return n+t*(e-n)}function Ru(e,t,n,r,i){return i!==void 0&&(e=Lu(e,i,r)),Lu(e,n,r)+t}function zu(e,t=0,n=1,r,i){e.min=Ru(e.min,t,n,r,i),e.max=Ru(e.max,t,n,r,i)}function Bu(e,{x:t,y:n}){zu(e.x,t.translate,t.scale,t.originPoint),zu(e.y,n.translate,n.scale,n.originPoint)}const Vu=.999999999999,Hu=1.0000000000001;function Uu(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&&(Wu(e.x,-a.scroll.offset.x),Wu(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Bu(e,o)),r&&Pu(a.latestValues)&&qu(e,a.latestValues,a.layout?.layoutBox))}t.x<Hu&&t.x>Vu&&(t.x=1),t.y<Hu&&t.y>Vu&&(t.y=1)}function Wu(e,t){e.min+=t,e.max+=t}function Gu(e,t,n,r,i=.5){zu(e,t,n,J(e.min,e.max,i),r)}function Ku(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function qu(e,t,n){let r=n??e;Gu(e.x,Ku(t.x,r.x),t.scaleX,t.scale,t.originX),Gu(e.y,Ku(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ju(e,t){return ku(ju(e.getBoundingClientRect(),t))}function Yu(e,t,n){let r=Ju(e,n),{scroll:i}=t;return i&&(Wu(r.x,i.offset.x),Wu(r.y,i.offset.y)),r}const{schedule:Xu,cancel:Zu}=/* @__PURE__ */ Ss(queueMicrotask,!1),Qu={x:!1,y:!1};function $u(){return Qu.x||Qu.y}function ed(e){return e===`x`||e===`y`?Qu[e]?null:(Qu[e]=!0,()=>{Qu[e]=!1}):Qu.x||Qu.y?null:(Qu.x=Qu.y=!0,()=>{Qu.x=Qu.y=!1})}function td(e,t){let n=yu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function nd(e){return!(e.pointerType===`touch`||$u())}function rd(e,t,n={}){let[r,i,a]=td(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(!nd(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 id=(e,t)=>t?e===t||id(e,t.parentElement):!1,ad=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,od=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function sd(e){return od.has(e.tagName)||e.isContentEditable===!0}const cd=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function ld(e){return cd.has(e.tagName)||e.isContentEditable===!0}const ud=/* @__PURE__ */ new WeakSet;function dd(e){return t=>{t.key===`Enter`&&e(t)}}function fd(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const pd=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=dd(()=>{if(ud.has(n))return;fd(n,`down`);let e=dd(()=>{fd(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>fd(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function md(e){return ad(e)&&!$u()}const hd=/* @__PURE__ */ new WeakSet;function gd(e,t,n={}){let[r,i,a]=td(e,n),o=e=>{let r=e.currentTarget;if(!md(e)||hd.has(e))return;ud.add(r),n.stopPropagation&&hd.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ud.has(r)&&ud.delete(r),md(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||id(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),gu(e)&&(e.addEventListener(`focus`,e=>pd(e,i)),!sd(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}const _d=/* @__PURE__ */ new WeakMap;let vd;const yd=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:_u(r)&&`getBBox`in r?r.getBBox()[t]:r[n],bd=/*@__PURE__*/ yd(`inline`,`width`,`offsetWidth`),xd=/*@__PURE__*/ yd(`block`,`height`,`offsetHeight`);function Sd({target:e,borderBoxSize:t}){_d.get(e)?.forEach(n=>{n(e,{get width(){return bd(e,t)},get height(){return xd(e,t)}})})}function Cd(e){e.forEach(Sd)}function wd(){typeof ResizeObserver<`u`&&(vd=new ResizeObserver(Cd))}function Td(e,t){vd||wd();let n=yu(e);return n.forEach(e=>{let n=_d.get(e);n||(n=/* @__PURE__ */ new Set,_d.set(e,n)),n.add(t),vd?.observe(e)}),()=>{n.forEach(e=>{let n=_d.get(e);n?.delete(t),n?.size||vd?.unobserve(e)})}}const Ed=/* @__PURE__ */ new Set;let Dd;function Od(){Dd=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ed.forEach(t=>t(e))},window.addEventListener(`resize`,Dd)}function kd(e){return Ed.add(e),Dd||Od(),()=>{Ed.delete(e),!Ed.size&&typeof Dd==`function`&&(window.removeEventListener(`resize`,Dd),Dd=void 0)}}function Ad(e,t){return typeof e==`function`?kd(e):Td(e,t)}const jd={value:null,addProjectionMetrics:null};function Md(e){return _u(e)&&e.tagName===`svg`}const Nd=e=>typeof e==`number`?e:parseFloat(e),Pd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fd=()=>({x:Pd(),y:Pd()}),Id=()=>({min:0,max:0}),Ld=()=>({x:Id(),y:Id()}),Rd=/* @__PURE__ */ new WeakMap;function zd(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Bd(e){return typeof e==`string`||Array.isArray(e)}const Vd=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Hd=[`initial`,...Vd];function Ud(e){if(zd(e.animate))return!0;for(let t=0;t<Hd.length;t++)if(Bd(e[Hd[t]]))return!0;return!1}function Wd(e){return!!(Ud(e)||e.variants)}function Gd(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Yl(i))e.addValue(r,i);else if(Yl(a))e.addValue(r,Dl(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,Dl(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const Kd={current:null},qd={current:!1},Jd=typeof window<`u`;function Yd(){if(qd.current=!0,Jd){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Kd.current=e.matches;e.addEventListener(`change`,t),t()}else Kd.current=!1}}const Xd=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Zd={};function Qd(e){Zd=e}function $d(){return Zd}var ef=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=Jc,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=Ud(t),this.isVariantNode=Wd(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&&Yl(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];this.current=e,Rd.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(qd.current||Yd(),this.shouldReduceMotion=Kd.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&&gl.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new sl({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ za(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Mc.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||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Zd){let t=Zd[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):Ld()}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<Xd.length;t++){let n=Xd[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=Gd(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}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}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=Dl(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`&&(ja(n)||Na(n))?n=parseFloat(n):typeof n!=`number`&&!es.test(n)&&es.test(t)&&(n=_c(e,t)),this.setBaseTarget(e,Yl(n)?n.get():n)),Yl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Hl(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Yl(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Ra),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Xu.render(this.render)}},tf=class extends ef{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;Yl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},nf=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function rf(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 af={};function of(e,{layout:t,layoutId:n}){return Mc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!af[e]||e===`opacity`)}function sf(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Yl(r[t])||i&&Yl(i[t])||of(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function cf(e){return window.getComputedStyle(e)}var lf=class extends tf{constructor(){super(...arguments),this.type=`html`,this.renderInstance=rf}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Mc.has(t))return this.projection?.isProjecting?Dc(t):kc(e,t);{let n=cf(e),r=(mo(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ju(e,t)}build(e,t,n){Cu(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return sf(e,t,n)}};const uf=/* @__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`]),df=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ff(e,t,n,r){rf(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(uf.has(n)?n:Ql(n),t.attrs[n])}function pf(e,t,n){let r=sf(e,t,n);for(let n in e)if(Yl(e[n])||Yl(t[n])){let t=jc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var mf=class extends tf{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ld}getBaseTargetFromProps(e,t){return Mc.has(t)?super.getBaseTargetFromProps(e,t)??Dc(t):e[t]}getDefaultValue(e){return Mc.has(e)?this.latestValues[e]??Dc(e):void 0}readValueFromInstance(e,t){if(Mc.has(t)){let e=hc(t);return e&&e.default||0}if(Du.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=uf.has(t)?t:Ql(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return pf(e,t,n)}build(e,t,n){Ou(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ff(e,t,n,r)}mount(e){this.isSVGTag=df(e.tagName),super.mount(e)}};const hf=Hd.length;function gf(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&gf(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<hf;n++){let r=Hd[n],i=e.props[r];(Bd(i)||i===!1)&&(t[r]=i)}return t}function _f(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 vf=[...Vd].reverse(),yf=Vd.length;function bf(e){return t=>Promise.all(t.map(({animation:t,options:n})=>ou(e,t,n)))}function xf(e){let t=bf(e),n=wf(),r=!0,i=!1,a=t=>(n,r)=>{let i=Ul(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=gf(e.parent)||{},l=[],u=/* @__PURE__ */ new Set,d={},f=1/0;for(let t=0;t<yf;t++){let p=vf[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Bd(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||zd(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Sf(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Gl(t)&&Gl(n)?!_f(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Ul(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Cl(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Ul(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(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=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=wf(),i=!0}}}function Sf(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!_f(t,e):!1}function Cf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wf(){return{animate:Cf(!0),whileInView:Cf(),whileHover:Cf(),whileTap:Cf(),whileDrag:Cf(),whileFocus:Cf(),exit:Cf()}}function Tf(e,t){e.min=t.min,e.max=t.max}function Ef(e,t){Tf(e.x,t.x),Tf(e.y,t.y)}function Df(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Of(e){return e.max-e.min}function kf(e,t,n){return Math.abs(e-t)<=n}function Af(e,t,n,r=.5){e.origin=r,e.originPoint=J(t.min,t.max,e.origin),e.scale=Of(n)/Of(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 jf(e,t,n,r){Af(e.x,t.x,n.x,r?r.originX:void 0),Af(e.y,t.y,n.y,r?r.originY:void 0)}function Mf(e,t,n,r=0){e.min=(r?J(n.min,n.max,r):n.min)+t.min,e.max=e.min+Of(t)}function Nf(e,t,n,r){Mf(e.x,t.x,n.x,r?.x),Mf(e.y,t.y,n.y,r?.y)}function Pf(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+Of(t)}function Ff(e,t,n,r){Pf(e.x,t.x,n.x,r?.x),Pf(e.y,t.y,n.y,r?.y)}function If(e,t,n,r,i){return e-=t,e=Lu(e,1/n,r),i!==void 0&&(e=Lu(e,1/i,r)),e}function Lf(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=If(e.min,t,n,s,i),e.max=If(e.max,t,n,s,i)}function Rf(e,t,[n,r,i],a,o){Lf(e,t[n],t[r],t[i],t.scale,a,o)}const zf=[`x`,`scaleX`,`originX`],Bf=[`y`,`scaleY`,`originY`];function Vf(e,t,n,r){Rf(e.x,t,zf,n?n.x:void 0,r?r.x:void 0),Rf(e.y,t,Bf,n?n.y:void 0,r?r.y:void 0)}function Hf(e){return e.translate===0&&e.scale===1}function Uf(e){return Hf(e.x)&&Hf(e.y)}function Wf(e,t){return e.min===t.min&&e.max===t.max}function Gf(e,t){return Wf(e.x,t.x)&&Wf(e.y,t.y)}function Kf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function qf(e,t){return Kf(e.x,t.x)&&Kf(e.y,t.y)}function Jf(e){return Of(e.x)/Of(e.y)}function Yf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Xf(e){return[e(`x`),e(`y`)]}function Zf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Qf={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(K.test(e))e=parseFloat(e);else return e}return`${Zf(e,t.target.x)}% ${Zf(e,t.target.y)}%`}},$f={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 ep(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 tp=hu.length,np=e=>typeof e==`number`||K.test(e);function rp(e,t,n,r,i,a){i?(e.opacity=J(0,n.opacity??1,ap(r)),e.opacityExit=J(t.opacity??1,0,op(r))):a&&(e.opacity=J(t.opacity??1,n.opacity??1,r));for(let i=0;i<tp;i++){let a=hu[i],o=ip(t,a),s=ip(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||np(o)===np(s)?(e[a]=Math.max(J(Nd(o),Nd(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 ip(e,t){return e[t]===void 0?e.borderRadius:e[t]}const ap=/*@__PURE__*/ sp(0,.5,Qa),op=/*@__PURE__*/ sp(.5,.95,Fa);function sp(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ La(e,t,r))}function cp(e,t,n){let r=Yl(e)?e:Dl(e);return r.start(Ll(``,r,t,n)),r.animation}function lp(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const up=(e,t)=>e.depth-t.depth;var dp=class{constructor(){this.children=[],this.isDirty=!1}add(e){Da(this.children,e),this.isDirty=!0}remove(e){Oa(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(up),this.isDirty=!1,this.children.forEach(e)}};function fp(e,t){let n=uo.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Cs(r),e(a-t))};return Y.setup(r,!0),()=>Cs(r)}function pp(e){return Yl(e)?e.get():e}var mp=class{constructor(){this.members=[]}add(e){Da(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&&(Oa(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Oa(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 hp={borderRadius:{...Qf,applyTo:[...hu]},borderTopLeftRadius:Qf,borderTopRightRadius:Qf,borderBottomLeftRadius:Qf,borderBottomRightRadius:Qf,boxShadow:$f},gp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(af,{...hp,...af});const _p={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},vp=[``,`X`,`Y`,`Z`];let yp=0;function bp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function xp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=eu(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&&xp(r)}function Sp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=yp++,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,jd.value&&(_p.nodes=_p.calculatedTargetDeltas=_p.calculatedProjections=0),this.nodes.forEach(Tp),this.nodes.forEach(Fp),this.nodes.forEach(Ip),this.nodes.forEach(Ep),jd.addProjectionMetrics&&jd.addProjectionMetrics(_p)},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 dp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ra),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=_u(t)&&!Md(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=fp(i,250),gp.hasAnimatedSinceResize&&(gp.hasAnimatedSinceResize=!1,this.nodes.forEach(Pp)))})}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()||Up,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!qf(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={...kl(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||Pp(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}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Lp),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&&xp(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(kp),this.nodes.forEach(Op);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ap);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(jp),this.nodes.forEach(Mp),this.nodes.forEach(Np),this.nodes.forEach(Cp),this.nodes.forEach(wp)):this.nodes.forEach(Ap),this.clearAllSnapshots();let e=uo.now();G.delta=ka(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,Xu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Dp),this.sharedNodes.forEach(Rp)}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&&!Of(this.snapshot.measuredBox.x)&&!Of(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||=Ld(),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&&!Uf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Pu(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)),qp(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Ld();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Yp))){let{scroll:e}=this.root;e&&(Wu(t.x,e.offset.x),Wu(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Ld();if(Ef(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&&Ef(t,e),Wu(t.x,i.offset.x),Wu(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Ld();Ef(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&&(Wu(r.x,-n.scroll.offset.x),Wu(r.y,-n.scroll.offset.y)),Pu(n.latestValues)&&qu(r,n.latestValues,n.layout?.layoutBox)}return Pu(this.latestValues)&&qu(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Ld();Ef(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Pu(n.latestValues))continue;let r;n.instance&&(Nu(n.latestValues)&&n.updateSnapshot(),r=Ld(),Ef(r,n.measurePageBox())),Vf(t,n.latestValues,n.snapshot?.layoutBox,r)}return Pu(this.latestValues)&&Vf(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=Ld(),this.targetWithTransforms=Ld()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Nf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ef(this.target,this.layout.layoutBox),Bu(this.target,this.targetDelta)):Ef(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),jd.value&&_p.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Nu(this.parent.latestValues)||Fu(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=Ld(),this.relativeTargetOrigin=Ld(),Ff(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Ef(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;Ef(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Uu(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=Ld());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Df(this.prevProjectionDelta.x,this.projectionDelta.x),Df(this.prevProjectionDelta.y,this.projectionDelta.y)),jf(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Yf(this.projectionDelta.x,this.prevProjectionDelta.x)||!Yf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),jd.value&&_p.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=Fd(),this.projectionDelta=Fd(),this.projectionDeltaWithTransform=Fd()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Fd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Ld(),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(Hp));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):(zp(o.x,e.x,n),zp(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ff(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Vp(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Gf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Ld(),Ef(f,this.relativeTarget)),c&&(this.animationValues=a,rp(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(()=>{gp.hasAnimatedSinceResize=!0,this.motionValue||=Dl(0),this.motionValue.jump(0,!1),this.currentAnimation=cp(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()}}),rc(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&&Jp(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Ld();let t=Of(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Of(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Ef(t,i),qu(t,r),jf(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new mp),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&&bp(`z`,e,r,this.animationValues);for(let t=0;t<vp.length;t++)bp(`rotate${vp[t]}`,e,r,this.animationValues),bp(`skew${vp[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=pp(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=pp(t?.pointerEvents)||``),this.hasProjected&&!Pu(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=ep(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 af){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=af[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?pp(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Op),this.root.sharedNodes.clear()}}}function Cp(e){e.updateLayout()}function wp(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`)Xf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Of(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Tf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Jp(i,t.layoutBox,n)&&Xf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Of(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=Fd();jf(o,n,t.layoutBox);let s=Fd();a?jf(s,e.applyTransform(r,!0),t.measuredBox):jf(s,n,t.layoutBox);let c=!Uf(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=Ld();Ff(s,t.layoutBox,i.layoutBox,o);let c=Ld();Ff(c,n,a.layoutBox,o),qf(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 Tp(e){jd.value&&_p.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 Ep(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Dp(e){e.clearSnapshot()}function Op(e){e.clearMeasurements()}function kp(e){e.isLayoutDirty=!0,e.updateLayout()}function Ap(e){e.isLayoutDirty=!1}function jp(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Mp(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Np(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Pp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Fp(e){e.resolveTargetDelta()}function Ip(e){e.calcProjection()}function Lp(e){e.resetSkewAndRotation()}function Rp(e){e.removeLeadSnapshot()}function zp(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 Bp(e,t,n,r){e.min=J(t.min,n.min,r),e.max=J(t.max,n.max,r)}function Vp(e,t,n,r){Bp(e.x,t.x,n.x,r),Bp(e.y,t.y,n.y,r)}function Hp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Up={duration:.45,ease:[.4,0,.1,1]},Wp=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gp=Wp(`applewebkit/`)&&!Wp(`chrome/`)?Math.round:Fa;function Kp(e){e.min=Gp(e.min),e.max=Gp(e.max)}function qp(e){Kp(e.x),Kp(e.y)}function Jp(e,t,n){return e===`position`||e===`preserve-aspect`&&!kf(Jf(t),Jf(n),.2)}function Yp(e){return e!==e.root&&e.scroll?.wasRoot}const Xp=Sp({attachResizeListener:(e,t)=>lp(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Zp={current:void 0},Qp=Sp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zp.current){let e=new Xp({});e.mount(window),e.setOptions({layoutScroll:!0}),Zp.current=e}return Zp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),$p=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function em(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function tm(...e){return t=>{let n=!1,r=e.map(e=>{let r=em(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():em(e[t],null)}}}}function nm(...e){return a.useCallback(tm(...e),e)}var rm=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(gu(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=gu(e)&&e.offsetWidth||0,r=gu(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 im({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($p),f=nm(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(`
236
+ function Wa(e,t,n,r){if(e===t&&n===r)return Fa;let i=t=>Ua(t,0,1,e,n);return e=>e===0||e===1?e:Ha(i(e),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:Fa,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 uo={now:()=>(co===void 0&&uo.set(G.isProcessing||Aa.useManualTiming?G.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=>ka(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=>ka(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(`%`),K=/*@__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))+`)`},q={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=q.parse(e);return t.alpha=0,q.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(So.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=>(q.test(e)?(r.color.push(a),i.push(Wo),n.push(q.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?fo(r[a]):e===Wo?q.transform(r[a]):r[a]}return i}}function Xo(e){return Yo(qo(e))}const Zo=e=>typeof e==`number`?0:q.test(e)?q.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=[jo,ko,Ro],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===Ro&&(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),ko.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`?go(e)?rs:q.test(e)?cs:gs:Array.isArray(e)?ps:typeof e==`object`?q.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):Ia(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=>fo(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=Aa.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:Fa,!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:uo.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 r=n({...e,keyframes:[0,t]}),i=Math.min(Os(r),Ds);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:/* @__PURE__ */ Ba(i)}}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=ka(As.minDuration,As.maxDuration,/* @__PURE__ */ Ba(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__ */ za(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__ */ Ba(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ Ba(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__ */ za(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ za(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__ */ za(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||Aa.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]||Fa:t;a=Ia(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__ */ La(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ka(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__ */ La(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:(Aa.mix||ys)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?ka(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__ */ Va(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])}function tc(e,t){return{kind:e,animation:t,timestamp:uo.now(),frameTimestamp:G.timestamp,frameIsProcessing:G.isProcessing}}function nc(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...tc(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function rc(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...tc(`layout-animation-start`,e),node:t})}catch{}}var ic=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 ac=e=>e/100;var oc=class extends ic{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(),nc(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=Ia(ac,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,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=ka(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!==Vs&&(b.value=Qs(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__ */ Ba(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Ba(e)}get time(){return/* @__PURE__ */ Ba(this.currentTime)}set time(e){e=/* @__PURE__ */ za(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(uo.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ Ba(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??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 sc=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function cc(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=+!!sc.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const lc=/\b([a-z-]*)\(.*?\)/gu,uc={...es,getAnimatableNone:e=>{let t=e.match(lc);return t?t.map(cc).join(` `):e}},dc={...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))}},fc={...yo,transform:Math.round},pc={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,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:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:bo,originX:Lo,originY:Lo,originZ:K,zIndex:fc,fillOpacity:bo,strokeOpacity:bo,numOctaves:fc},mc={...pc,color:q,backgroundColor:q,outlineColor:q,fill:q,stroke:q,borderColor:q,borderTopColor:q,borderRightColor:q,borderBottomColor:q,borderLeftColor:q,filter:uc,WebkitFilter:uc,mask:dc,WebkitMask:dc},hc=e=>mc[e],gc=/*@__PURE__*/ new Set([uc,dc]);function _c(e,t){let n=hc(e);return gc.has(n)||(n=es),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function vc(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const yc=e=>e*180/Math.PI,bc=e=>{let t=yc(Math.atan2(e[1],e[0]));return Sc(t)},xc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bc,rotateZ:bc,skewX:e=>yc(Math.atan(e[1])),skewY:e=>yc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Sc=e=>(e%=360,e<0&&(e+=360),e),Cc=bc,wc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Tc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ec={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wc,scaleY:Tc,scale:e=>(wc(e)+Tc(e))/2,rotateX:e=>Sc(yc(Math.atan2(e[6],e[5]))),rotateY:e=>Sc(yc(Math.atan2(-e[2],e[0]))),rotateZ:Cc,rotate:Cc,skewX:e=>yc(Math.atan(e[4])),skewY:e=>yc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Dc(e){return+!!e.includes(`scale`)}function Oc(e,t){if(!e||e===`none`)return Dc(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Ec,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xc,i=t}if(!i)return Dc(t);let a=r[t],o=i[1].split(`,`).map(Ac);return typeof a==`function`?a(o):o[a]}const kc=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Oc(n,t)};function Ac(e){return parseFloat(e.trim())}const jc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Mc=/* @__PURE__ */ new Set([...jc,`pathRotation`]),Nc=e=>e===yo||e===K,Pc=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Fc=jc.filter(e=>!Pc.has(e));function Ic(e){let t=[];return Fc.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 Lc=/* @__PURE__ */ new Set([`bottom`,`right`]);function Rc(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 zc={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Rc(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Rc(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})=>Oc(e,`x`),y:({transform:e})=>Oc(e,`y`)};zc.translateX=zc.x,zc.translateY=zc.y;const Bc=/* @__PURE__ */ new Set;let Vc=!1,Hc=!1,Uc=!1;function Wc(){if(Hc){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Bc.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Lc.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=Ic(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)})}Hc=!1,Vc=!1,Bc.forEach(e=>e.complete(Uc)),Bc.clear()}function Gc(){Bc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hc=!0)})}function Kc(){Uc=!0,Gc(),Wc(),Uc=!1}function qc(e,t,n){if(typeof e==`string`){if(ja(e)||Na(e))return parseFloat(e);if(!es.test(e)&&es.test(n))return _c(t,n)}return e??void 0}var Jc=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?(Bc.add(this),Vc||(Vc=!0,Y.read(Gc),Y.resolveKeyframes(Wc))):(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=qc(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])}vc(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bc.delete(this)}cancel(){this.state===`scheduled`&&(Bc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Yc=e=>e.startsWith(`--`);function Xc(e,t,n){Yc(t)?e.style.setProperty(t,n):e.style[t]=n}const Zc={};function Qc(e,t){let n=/* @__PURE__ */ Pa(e);return()=>Zc[t]??n()}const $c=/* @__PURE__ */ Qc(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),el=/*@__PURE__*/ Qc(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),tl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nl={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ tl([0,.65,.55,1]),circOut:/*@__PURE__*/ tl([.55,0,1,.45]),backIn:/*@__PURE__*/ tl([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ tl([.33,1.53,.69,.99])};function rl(e,t){if(e)return typeof e==`function`?el()?Es(e,t):`ease-out`:/* @__PURE__ */ io(e)?tl(e):Array.isArray(e)?e.map(e=>rl(e,t)||nl.easeOut):nl[e]}function il(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=rl(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 al(e){return typeof e==`function`&&`applyToOptions`in e}function ol({type:e,...t}){return al(e)&&el()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var sl=class extends ic{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=ol(e);this.animation=il(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),Xc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},nc(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__ */ Ba(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Ba(e)}get time(){return/* @__PURE__ */ Ba(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ za(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&&$c()?(this.animation.timeline=e,Object.assign(this.animation,r),t?.(this.animation),Fa):n(this)}};const cl={anticipate:Xa,backInOut:Ya,circInOut:$a};function ll(e){return e in cl}function ul(e){typeof e.ease==`string`&&ll(e.ease)&&(e.ease=cl[e.ease])}var dl=class extends sl{constructor(e){ul(e),ec(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 oc({...a,autoplay:!1}),s=Math.max(10,uo.now()-this.startTime),c=ka(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&Xc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const fl=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(es.test(e)||e===`0`)&&!e.startsWith(`url(`));function pl(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 ml(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=fl(i,t),s=fl(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):pl(e)||(n===`spring`||al(n))&&r}function hl(e){e.duration=0,e.type=`keyframes`}const gl=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),_l=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function vl(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&_l.test(e[t]))return!0;return!1}const yl=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),bl=/*@__PURE__*/ Pa(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function xl(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(gl.has(n)||yl.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 bl()&&(gl.has(n)||yl.has(n)&&vl(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Sl=class extends ic{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||Jc;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;ml(e,i,a,o)||(u=!1,(Aa.instantAnimations||!s)&&l?.(Qs(e,n,t)),e[0]=e[e.length-1],hl(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&&xl(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new dl(n)}catch{m=new oc(n)}}else m=new oc(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(),Kc()),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 Cl(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 wl=e=>!isNaN(parseFloat(e)),Tl={current:void 0};var El=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=wl(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 Ra)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Ra,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 Tl.current&&Tl.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__ */ Va(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 Dl(e,t){return new El(e,t)}function Ol(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function kl(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Ol(n,e)}const Al={type:`spring`,stiffness:500,damping:25,restSpeed:10},jl=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ml={type:`keyframes`,duration:.8},Nl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Pl=(e,{keyframes:t})=>t.length>2?Ml:Mc.has(e)?e.startsWith(`scale`)?jl(t[1]):Al:Nl,Fl=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Il(e){for(let t in e)if(!Fl.has(t))return!0;return!1}const Ll=(e,t,n,r={},i,a)=>o=>{let s=kl(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ za(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};Il(s)||Object.assign(u,Pl(e,u)),u.duration&&=/* @__PURE__ */ za(u.duration),u.repeatDelay&&=/* @__PURE__ */ za(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(hl(u),u.delay===0&&(d=!0)),(Aa.instantAnimations||Aa.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,hl(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 oc(u):new Sl(u)},Rl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zl(e){let t=Rl.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Bl(e,t,n=1){`${e}`;let[r,i]=zl(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ja(e)?parseFloat(e):e}return go(i)?Bl(i,t,n+1):i}function Vl(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Hl(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Vl(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Ul(e,t,n){return Hl(e.getProps(),t,n,e)}const Wl=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Gl=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...jc]),Kl=e=>Array.isArray(e);function ql(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dl(n))}function Jl(e){return Kl(e)?e[e.length-1]||0:e}function Yl(e,t){let{transitionEnd:n={},transition:r={},...i}=Ul(e,t)||{};i={...i,...n};for(let t in i)ql(e,t,Jl(i[t]))}const Xl=e=>!!(e&&e.getVelocity);function Zl(e){return!!(Xl(e)&&e.add)}function Ql(e,t){let n=e.getValue(`willChange`);if(Zl(n))return n.add(t);if(!n&&Aa.WillChange){let n=new Aa.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function $l(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const eu=`data-`+$l(`framerAppearId`);function tu(e){return e.props[eu]}const nu=typeof window<`u`;function ru({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function iu(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Ol(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&&ru(f,t))continue;let o={delay:n,...kl(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(nu&&window.MotionHandoffAnimation){let n=tu(e);if(n){let e=window.MotionHandoffAnimation(n,t,Y);e!==null&&(o.startTime=e,p=!0)}}Ql(e,t);let m=l??e.shouldReduceMotion;r.start(Ll(t,r,i,m&&Gl.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Y.update(()=>{o&&Yl(e,o)});d.length?Promise.all(d).then(t):t()}return d}function au(e,t,n={}){let r=Ul(e,t,Wl(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?iu(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(au(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Cl(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 ou(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>au(e,t,n))):typeof t==`string`?au(e,t,n):Promise.all(iu(e,Ul(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}const su={test:e=>e===`auto`,parse:e=>e},cu=e=>t=>t.test(e),lu=[yo,K,Po,No,Io,Fo,su],uu=e=>lu.find(cu(e));function du(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Na(e)}const fu=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function pu(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!fu.has(t)&&Ko(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=_c(n,i))}var mu=class extends Jc{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=Bl(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Gl.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=uu(r),o=uu(i);if(vo(r)!==vo(i)&&zc[n]){this.needsMeasurement=!0;return}if(a!==o){if(Nc(a)&&Nc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else zc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||du(e[t]))&&n.push(t);n.length&&pu(e,n,t)}measure(){let{element:e,name:t}=this;return zc[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 hu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function gu(e){return Ma(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function _u(e){return Ma(e)&&`ownerSVGElement`in e}const vu=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function yu(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 bu={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},xu=jc.length;function Su(e,t,n){let r=``,i=!0;for(let a=0;a<xu;a++){let o=jc[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=vu(s,pc[o]);if(!c){i=!1;let t=bu[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${vu(a,pc.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Cu(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(Mc.has(e)){o=!0;continue}if(mo(e)){i[e]=n;continue}{let t=vu(n,pc[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Su(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 wu={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Tu={offset:`strokeDashoffset`,array:`strokeDasharray`};function Eu(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?wu:Tu;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Du=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Ou(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Cu(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 Du)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&&Eu(d,i,a,o,!1)}function ku({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Au({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ju(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 Mu(e){return e===void 0||e===1}function Nu({scale:e,scaleX:t,scaleY:n}){return!Mu(e)||!Mu(t)||!Mu(n)}function Pu(e){return Nu(e)||Fu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Fu(e){return Iu(e.x)||Iu(e.y)}function Iu(e){return e&&e!==`0%`}function Lu(e,t,n){return n+t*(e-n)}function Ru(e,t,n,r,i){return i!==void 0&&(e=Lu(e,i,r)),Lu(e,n,r)+t}function zu(e,t=0,n=1,r,i){e.min=Ru(e.min,t,n,r,i),e.max=Ru(e.max,t,n,r,i)}function Bu(e,{x:t,y:n}){zu(e.x,t.translate,t.scale,t.originPoint),zu(e.y,n.translate,n.scale,n.originPoint)}const Vu=.999999999999,Hu=1.0000000000001;function Uu(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&&(Wu(e.x,-a.scroll.offset.x),Wu(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Bu(e,o)),r&&Pu(a.latestValues)&&qu(e,a.latestValues,a.layout?.layoutBox))}t.x<Hu&&t.x>Vu&&(t.x=1),t.y<Hu&&t.y>Vu&&(t.y=1)}function Wu(e,t){e.min+=t,e.max+=t}function Gu(e,t,n,r,i=.5){zu(e,t,n,J(e.min,e.max,i),r)}function Ku(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function qu(e,t,n){let r=n??e;Gu(e.x,Ku(t.x,r.x),t.scaleX,t.scale,t.originX),Gu(e.y,Ku(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ju(e,t){return ku(ju(e.getBoundingClientRect(),t))}function Yu(e,t,n){let r=Ju(e,n),{scroll:i}=t;return i&&(Wu(r.x,i.offset.x),Wu(r.y,i.offset.y)),r}const{schedule:Xu,cancel:Zu}=/* @__PURE__ */ Ss(queueMicrotask,!1),Qu={x:!1,y:!1};function $u(){return Qu.x||Qu.y}function ed(e){return e===`x`||e===`y`?Qu[e]?null:(Qu[e]=!0,()=>{Qu[e]=!1}):Qu.x||Qu.y?null:(Qu.x=Qu.y=!0,()=>{Qu.x=Qu.y=!1})}function td(e,t){let n=yu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function nd(e){return!(e.pointerType===`touch`||$u())}function rd(e,t,n={}){let[r,i,a]=td(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(!nd(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 id=(e,t)=>t?e===t||id(e,t.parentElement):!1,ad=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,od=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function sd(e){return od.has(e.tagName)||e.isContentEditable===!0}const cd=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function ld(e){return cd.has(e.tagName)||e.isContentEditable===!0}const ud=/* @__PURE__ */ new WeakSet;function dd(e){return t=>{t.key===`Enter`&&e(t)}}function fd(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const pd=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=dd(()=>{if(ud.has(n))return;fd(n,`down`);let e=dd(()=>{fd(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>fd(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function md(e){return ad(e)&&!$u()}const hd=/* @__PURE__ */ new WeakSet;function gd(e,t,n={}){let[r,i,a]=td(e,n),o=e=>{let r=e.currentTarget;if(!md(e)||hd.has(e))return;ud.add(r),n.stopPropagation&&hd.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ud.has(r)&&ud.delete(r),md(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||id(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),gu(e)&&(e.addEventListener(`focus`,e=>pd(e,i)),!sd(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}const _d=/* @__PURE__ */ new WeakMap;let vd;const yd=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:_u(r)&&`getBBox`in r?r.getBBox()[t]:r[n],bd=/*@__PURE__*/ yd(`inline`,`width`,`offsetWidth`),xd=/*@__PURE__*/ yd(`block`,`height`,`offsetHeight`);function Sd({target:e,borderBoxSize:t}){_d.get(e)?.forEach(n=>{n(e,{get width(){return bd(e,t)},get height(){return xd(e,t)}})})}function Cd(e){e.forEach(Sd)}function wd(){typeof ResizeObserver<`u`&&(vd=new ResizeObserver(Cd))}function Td(e,t){vd||wd();let n=yu(e);return n.forEach(e=>{let n=_d.get(e);n||(n=/* @__PURE__ */ new Set,_d.set(e,n)),n.add(t),vd?.observe(e)}),()=>{n.forEach(e=>{let n=_d.get(e);n?.delete(t),n?.size||vd?.unobserve(e)})}}const Ed=/* @__PURE__ */ new Set;let Dd;function Od(){Dd=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ed.forEach(t=>t(e))},window.addEventListener(`resize`,Dd)}function kd(e){return Ed.add(e),Dd||Od(),()=>{Ed.delete(e),!Ed.size&&typeof Dd==`function`&&(window.removeEventListener(`resize`,Dd),Dd=void 0)}}function Ad(e,t){return typeof e==`function`?kd(e):Td(e,t)}const jd={value:null,addProjectionMetrics:null};function Md(e){return _u(e)&&e.tagName===`svg`}const Nd=e=>typeof e==`number`?e:parseFloat(e),Pd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fd=()=>({x:Pd(),y:Pd()}),Id=()=>({min:0,max:0}),Ld=()=>({x:Id(),y:Id()}),Rd=/* @__PURE__ */ new WeakMap;function zd(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Bd(e){return typeof e==`string`||Array.isArray(e)}const Vd=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Hd=[`initial`,...Vd];function Ud(e){if(zd(e.animate))return!0;for(let t=0;t<Hd.length;t++)if(Bd(e[Hd[t]]))return!0;return!1}function Wd(e){return!!(Ud(e)||e.variants)}function Gd(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Xl(i))e.addValue(r,i);else if(Xl(a))e.addValue(r,Dl(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,Dl(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const Kd={current:null},qd={current:!1},Jd=typeof window<`u`;function Yd(){if(qd.current=!0,Jd){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Kd.current=e.matches;e.addEventListener(`change`,t),t()}else Kd.current=!1}}const Xd=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Zd={};function Qd(e){Zd=e}function $d(){return Zd}var ef=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=Jc,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=Ud(t),this.isVariantNode=Wd(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&&Xl(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,Rd.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:(qd.current||Yd(),this.shouldReduceMotion=Kd.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&&gl.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new sl({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ za(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Mc.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 Zd){let t=Zd[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):Ld()}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<Xd.length;t++){let n=Xd[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=Gd(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=Dl(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`&&(ja(n)||Na(n))?n=parseFloat(n):typeof n!=`number`&&!es.test(n)&&es.test(t)&&(n=_c(e,t)),this.setBaseTarget(e,Xl(n)?n.get():n)),Xl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new Ra),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Xu.render(this.render)}},tf=class extends ef{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;Xl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},nf=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function rf(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 af={};function of(e,{layout:t,layoutId:n}){return Mc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!af[e]||e===`opacity`)}function sf(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Xl(r[t])||i&&Xl(i[t])||of(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function cf(e){return window.getComputedStyle(e)}var lf=class extends tf{constructor(){super(...arguments),this.type=`html`,this.renderInstance=rf}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Mc.has(t))return this.projection?.isProjecting?Dc(t):kc(e,t);{let n=cf(e),r=(mo(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ju(e,t)}build(e,t,n){Cu(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return sf(e,t,n)}};const uf=/* @__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`]),df=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ff(e,t,n,r){rf(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(uf.has(n)?n:$l(n),t.attrs[n])}function pf(e,t,n){let r=sf(e,t,n);for(let n in e)if(Xl(e[n])||Xl(t[n])){let t=jc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var mf=class extends tf{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ld}getBaseTargetFromProps(e,t){return Mc.has(t)?super.getBaseTargetFromProps(e,t)??Dc(t):e[t]}getDefaultValue(e){return Mc.has(e)?this.latestValues[e]??Dc(e):void 0}readValueFromInstance(e,t){if(Mc.has(t)){let e=hc(t);return e&&e.default||0}if(Du.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=uf.has(t)?t:$l(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return pf(e,t,n)}build(e,t,n){Ou(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ff(e,t,n,r)}mount(e){this.isSVGTag=df(e.tagName),super.mount(e)}};function hf(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 gf=[...Vd].reverse();function _f(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>ou(e,t,n))),n=yf(),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(gf.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?Bd(g)||g===!1?g:void 0:h,v=Bd(_),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||zd(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=vf(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}=Ul(e,n,Wl(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)?!hf(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=Ul(s,n)?.transition?.delayChildren;r.delay=Cl(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&Ul(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&&!Xl(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=yf(),i=!0}}}function vf(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!hf(t,e):!1}function yf(){let e={};for(let t of Vd)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function bf(e,t){e.min=t.min,e.max=t.max}function xf(e,t){bf(e.x,t.x),bf(e.y,t.y)}function Sf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Cf(e){return e.max-e.min}function wf(e,t,n){return Math.abs(e-t)<=n}function Tf(e,t,n,r=.5){e.origin=r,e.originPoint=J(t.min,t.max,e.origin),e.scale=Cf(n)/Cf(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 Ef(e,t,n,r){Tf(e.x,t.x,n.x,r?r.originX:void 0),Tf(e.y,t.y,n.y,r?r.originY:void 0)}function Df(e,t,n,r=0){e.min=(r?J(n.min,n.max,r):n.min)+t.min,e.max=e.min+Cf(t)}function Of(e,t,n,r){Df(e.x,t.x,n.x,r?.x),Df(e.y,t.y,n.y,r?.y)}function kf(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+Cf(t)}function Af(e,t,n,r){kf(e.x,t.x,n.x,r?.x),kf(e.y,t.y,n.y,r?.y)}function jf(e,t,n,r,i){return e-=t,e=Lu(e,1/n,r),i!==void 0&&(e=Lu(e,1/i,r)),e}function Mf(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=jf(e.min,t,n,s,i),e.max=jf(e.max,t,n,s,i)}function Nf(e,t,[n,r,i],a,o){Mf(e,t[n],t[r],t[i],t.scale,a,o)}const Pf=[`x`,`scaleX`,`originX`],Ff=[`y`,`scaleY`,`originY`];function If(e,t,n,r){Nf(e.x,t,Pf,n?n.x:void 0,r?r.x:void 0),Nf(e.y,t,Ff,n?n.y:void 0,r?r.y:void 0)}function Lf(e){return e.translate===0&&e.scale===1}function Rf(e){return Lf(e.x)&&Lf(e.y)}function zf(e,t){return e.min===t.min&&e.max===t.max}function Bf(e,t){return zf(e.x,t.x)&&zf(e.y,t.y)}function Vf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Hf(e,t){return Vf(e.x,t.x)&&Vf(e.y,t.y)}function Uf(e){return Cf(e.x)/Cf(e.y)}function Wf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Gf(e){return[e(`x`),e(`y`)]}function Kf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const qf={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(K.test(e))e=parseFloat(e);else return e}return`${Kf(e,t.target.x)}% ${Kf(e,t.target.y)}%`}},Jf={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 Yf(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 Xf=hu.length,Zf=e=>typeof e==`number`||K.test(e);function Qf(e,t,n,r,i,a){i?(e.opacity=J(0,n.opacity??1,ep(r)),e.opacityExit=J(t.opacity??1,0,tp(r))):a&&(e.opacity=J(t.opacity??1,n.opacity??1,r));for(let i=0;i<Xf;i++){let a=hu[i],o=$f(t,a),s=$f(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Zf(o)===Zf(s)?(e[a]=Math.max(J(Nd(o),Nd(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 $f(e,t){return e[t]===void 0?e.borderRadius:e[t]}const ep=/*@__PURE__*/ np(0,.5,Qa),tp=/*@__PURE__*/ np(.5,.95,Fa);function np(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ La(e,t,r))}function rp(e,t,n){let r=Xl(e)?e:Dl(e);return r.start(Ll(``,r,t,n)),r.animation}function ip(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const ap=(e,t)=>e.depth-t.depth;var op=class{constructor(){this.children=[],this.isDirty=!1}add(e){Da(this.children,e),this.isDirty=!0}remove(e){Oa(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ap),this.isDirty=!1,this.children.forEach(e)}};function sp(e,t){let n=uo.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Cs(r),e(a-t))};return Y.setup(r,!0),()=>Cs(r)}function cp(e){return Xl(e)?e.get():e}var lp=class{constructor(){this.members=[]}add(e){Da(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&&(Oa(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Oa(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 up={borderRadius:{...qf,applyTo:[...hu]},borderTopLeftRadius:qf,borderTopRightRadius:qf,borderBottomLeftRadius:qf,borderBottomRightRadius:qf,boxShadow:Jf},dp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(af,{...up,...af});const fp={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},pp=[``,`X`,`Y`,`Z`];let mp=0;function hp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function gp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=tu(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&&gp(r)}function _p({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=mp++,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,jd.value&&(fp.nodes=fp.calculatedTargetDeltas=fp.calculatedProjections=0),this.nodes.forEach(bp),this.nodes.forEach(Ap),this.nodes.forEach(jp),this.nodes.forEach(xp),jd.addProjectionMetrics&&jd.addProjectionMetrics(fp)},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 op)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ra),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=_u(t)&&!Md(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=sp(i,250),dp.hasAnimatedSinceResize&&(dp.hasAnimatedSinceResize=!1,this.nodes.forEach(kp)))})}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()||Rp,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Hf(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={...kl(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||kp(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}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Mp),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&&gp(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(wp),this.nodes.forEach(Cp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Tp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ep),this.nodes.forEach(Dp),this.nodes.forEach(Op),this.nodes.forEach(vp),this.nodes.forEach(yp)):this.nodes.forEach(Tp),this.clearAllSnapshots();let e=uo.now();G.delta=ka(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,Xu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Sp),this.sharedNodes.forEach(Np)}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&&!Cf(this.snapshot.measuredBox.x)&&!Cf(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||=Ld(),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&&!Rf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Pu(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)),Hp(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Ld();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Wp))){let{scroll:e}=this.root;e&&(Wu(t.x,e.offset.x),Wu(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Ld();if(xf(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&&xf(t,e),Wu(t.x,i.offset.x),Wu(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Ld();xf(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&&(Wu(r.x,-n.scroll.offset.x),Wu(r.y,-n.scroll.offset.y)),Pu(n.latestValues)&&qu(r,n.latestValues,n.layout?.layoutBox)}return Pu(this.latestValues)&&qu(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Ld();xf(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Pu(n.latestValues))continue;let r;n.instance&&(Nu(n.latestValues)&&n.updateSnapshot(),r=Ld(),xf(r,n.measurePageBox())),If(t,n.latestValues,n.snapshot?.layoutBox,r)}return Pu(this.latestValues)&&If(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=Ld(),this.targetWithTransforms=Ld()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Of(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):xf(this.target,this.layout.layoutBox),Bu(this.target,this.targetDelta)):xf(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),jd.value&&fp.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Nu(this.parent.latestValues)||Fu(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=Ld(),this.relativeTargetOrigin=Ld(),Af(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),xf(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;xf(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Uu(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=Ld());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Sf(this.prevProjectionDelta.x,this.projectionDelta.x),Sf(this.prevProjectionDelta.y,this.projectionDelta.y)),Ef(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Wf(this.projectionDelta.x,this.prevProjectionDelta.x)||!Wf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),jd.value&&fp.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=Fd(),this.projectionDelta=Fd(),this.projectionDeltaWithTransform=Fd()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Fd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Ld(),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(Lp));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):(Pp(o.x,e.x,n),Pp(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Af(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ip(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Bf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Ld(),xf(f,this.relativeTarget)),c&&(this.animationValues=a,Qf(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(()=>{dp.hasAnimatedSinceResize=!0,this.motionValue||=Dl(0),this.motionValue.jump(0,!1),this.currentAnimation=rp(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()}}),rc(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&&Up(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Ld();let t=Cf(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Cf(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}xf(t,i),qu(t,r),Ef(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new lp),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&&hp(`z`,e,r,this.animationValues);for(let t=0;t<pp.length;t++)hp(`rotate${pp[t]}`,e,r,this.animationValues),hp(`skew${pp[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=cp(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=cp(t?.pointerEvents)||``),this.hasProjected&&!Pu(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Yf(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 af){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=af[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?cp(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Cp),this.root.sharedNodes.clear()}}}function vp(e){e.updateLayout()}function yp(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`)Gf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Cf(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;bf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Up(i,t.layoutBox,n)&&Gf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Cf(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=Fd();Ef(o,n,t.layoutBox);let s=Fd();a?Ef(s,e.applyTransform(r,!0),t.measuredBox):Ef(s,n,t.layoutBox);let c=!Rf(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=Ld();Af(s,t.layoutBox,i.layoutBox,o);let c=Ld();Af(c,n,a.layoutBox,o),Hf(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 bp(e){jd.value&&fp.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 xp(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Sp(e){e.clearSnapshot()}function Cp(e){e.clearMeasurements()}function wp(e){e.isLayoutDirty=!0,e.updateLayout()}function Tp(e){e.isLayoutDirty=!1}function Ep(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Dp(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Op(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function kp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ap(e){e.resolveTargetDelta()}function jp(e){e.calcProjection()}function Mp(e){e.resetSkewAndRotation()}function Np(e){e.removeLeadSnapshot()}function Pp(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 Fp(e,t,n,r){e.min=J(t.min,n.min,r),e.max=J(t.max,n.max,r)}function Ip(e,t,n,r){Fp(e.x,t.x,n.x,r),Fp(e.y,t.y,n.y,r)}function Lp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Rp={duration:.45,ease:[.4,0,.1,1]},zp=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Bp=zp(`applewebkit/`)&&!zp(`chrome/`)?Math.round:Fa;function Vp(e){e.min=Bp(e.min),e.max=Bp(e.max)}function Hp(e){Vp(e.x),Vp(e.y)}function Up(e,t,n){return e===`position`||e===`preserve-aspect`&&!wf(Uf(t),Uf(n),.2)}function Wp(e){return e!==e.root&&e.scroll?.wasRoot}const Gp=_p({attachResizeListener:(e,t)=>ip(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Kp={current:void 0},qp=_p({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Kp.current){let e=new Gp({});e.mount(window),e.setOptions({layoutScroll:!0}),Kp.current=e}return Kp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Jp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Yp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Xp(...e){return t=>{let n=!1,r=e.map(e=>{let r=Yp(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():Yp(e[t],null)}}}}function Zp(...e){return a.useCallback(Xp(...e),e)}var Qp=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(gu(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=gu(e)&&e.offsetWidth||0,r=gu(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 $p({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(Jp),f=Zp(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(`
237
237
  [data-motion-pop-id="${c}"] {
238
238
  position: absolute !important;
239
239
  width: ${e}px !important;
@@ -241,9 +241,9 @@ function Wa(e,t,n,r){if(e===t&&n===r)return Fa;let i=t=>Ua(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(rm,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const am=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=wa(om),p=v(),m=C(r),h=C(i);Ta(()=>{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(im,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(Ea.Provider,{value:_,children:e})};function om(){return/* @__PURE__ */ new Map}function sm(e=!0){let t=g(Ea);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 cm=e=>e.key||``;function lm(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const um=({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]=sm(c),m=S(()=>lm(n),[n]),h=c&&!f?[]:m.map(cm),_=C(!0),v=wa(()=>/* @__PURE__ */ new Map),y=C(/* @__PURE__ */ new Set),[b,x]=w(m),[T,E]=w(m);Ta(()=>{c&&!f&&!T.length&&p?.()},[f,c,T.length,p]),Ta(()=>{_.current=!1;for(let e=0;e<T.length;e++){let t=cm(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(cm(n));r===-1?(e.splice(t++,0,n),D.push(n)):t=r+D.length+1}return D.every(e=>v.get(cm(e)))?e=m:s===`wait`&&(e=D),E(lm(e)),x(m),null}let{forceRender:O}=g(Ca);return t(e,{children:T.map(e=>{let n=cm(e),g=c&&!f?!1:m===T||h.includes(n);return t(am,{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)})})},dm=d({strict:!1}),fm={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 pm=!1;function mm(){if(pm)return;let e={};for(let t in fm)e[t]={isEnabled:e=>fm[t].some(t=>!!e[t])};Qd(e),pm=!0}function hm(){return mm(),$d()}function gm(e){let t=hm();for(let n in e)t[n]={...t[n],...e[n]};Qd(t)}const _m=/* @__PURE__ */ d({});function vm(e,t){if(Ud(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Bd(t)?t:void 0,animate:Bd(n)?n:void 0}}return e.inherit===!1?{}:t}function ym(e){let{initial:t,animate:n}=vm(e,g(_m));return S(()=>({initial:t,animate:n}),[bm(t),bm(n)])}function bm(e){return Array.isArray(e)?e.join(` `):e}const xm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Sm(e,t,n){for(let r in t)!Yl(t[r])&&!of(r,n)&&(e[r]=t[r])}function Cm({transformTemplate:e},t){return S(()=>{let n=xm();return Cu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function wm(e,t){let n=e.style||{},r={};return Sm(r,n,e),Object.assign(r,Cm(e,t)),r}function Tm(e,t){let n={},r=wm(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 Em=()=>({...xm(),attrs:{}});function Dm(e,t,n,r){let i=S(()=>{let n=Em();return Ou(n,t,df(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Sm(t,e.style,e),i.style={...t,...i.style}}return i}const Om=/* @__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 km(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Om.has(e)}function Am(e,t){return e.startsWith(`on`)?!km(e):t?.(e)??!km(e)}function jm(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Yl(e[a])||(Am(a,r)||n===!0&&km(a)||!t&&!km(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const Mm=[`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 Nm(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Mm.indexOf(e)>-1||/[A-Z]/u.test(e))}function Pm(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Nm(e)?Dm:Tm)(t,r,i,e),u=jm(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>Yl(p)?p.get():p,[p]);return f(e,{...d,children:m})}function Fm({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Im(n,r,i,e),renderState:t()}}function Im(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=pp(a[e]);let{initial:o,animate:s}=e,c=Ud(e),l=Wd(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`&&!zd(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Hl(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 Lm=e=>(t,n)=>{let r=g(_m),i=g(Ea),a=()=>Fm(e,t,r,i);return n?a():wa(a)},Rm=/*@__PURE__*/ Lm({scrapeMotionValuesFromProps:sf,createRenderState:xm}),zm=/*@__PURE__*/ Lm({scrapeMotionValuesFromProps:pf,createRenderState:Em}),Bm=Symbol.for(`motionComponentSymbol`);function Vm(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 Hm=d({});function Um(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Wm(e,t,n,r,i,a){let{visualElement:o}=g(_m),s=g(dm),c=g(Ea),l=g($p),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(Hm);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Gm(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[$l],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Ta(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Ta(()=>{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 Gm(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:Km(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Um(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Km(e){if(e)return e.options.allowProjection===!1?Km(e.parent):e.projection}function qm(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&gm(a);let s=i?i===`svg`:Nm(e),c=s?zm:Rm;function l(i,l){let u,d={...g($p),...i,layoutId:Jm(i)},{isStatic:f,isValidProp:p}=d,m=ym(i),h=c(i,f);if(!f&&typeof window<`u`){Ym(d,a);let t=Xm(d);u=t.MeasureLayout,m.visualElement=Wm(e,h,d,o,t.ProjectionNode,s)}return n(_m.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,Pm(e,i,Vm(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[Bm]=e,u}function Jm({layoutId:e}){let t=g(Ca).id;return t&&e!==void 0?t+`-`+e:e}function Ym(e,t){g(dm).strict}function Xm(e){let{drag:t,layout:n}=hm();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Zm(e,t){if(typeof Proxy>`u`)return qm;let n=/* @__PURE__ */ new Map,r=(n,r)=>qm(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,qm(a,void 0,e,t)),n.get(a))})}const Qm=(e,t)=>t.isSVG??Nm(e)?new mf(t):new lf(t,{allowProjection:e!==l});var $m=class extends nf{constructor(e){super(e),e.animationState||=xf(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();zd(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 eh=0;const th={animation:{Feature:$m},exit:{Feature:class extends nf{constructor(){super(...arguments),this.id=eh++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=Ul(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.blockInitialAnimation=!1,this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1,this.exitAnimation=void 0;return}let r=this.exitAnimation=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.exitAnimation===r&&(this.isExitComplete=!0,t(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function nh(e){return{point:{x:e.pageX,y:e.pageY}}}const rh=e=>t=>ad(t)&&e(t,nh(t));function ih(e,t,n,r){return lp(e,t,rh(n),r)}const ah=({current:e})=>e?e.ownerDocument.defaultView:null,oh=(e,t)=>Math.abs(e-t);function sh(e,t){let n=oh(e.x,t.x),r=oh(e.y,t.y);return Math.sqrt(n**2+r**2)}const ch=/*#__PURE__*/ new Set([`auto`,`scroll`]);var lh=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=uh(this.lastRawMoveEventInfo,this.transformPagePoint));let e=fh(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=sh(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=uh(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=fh(e.type===`pointercancel`?this.lastMoveEventInfo:uh(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!ad(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=uh(nh(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=G;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,fh(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Ia(ih(this.contextWindow,`pointermove`,this.handlePointerMove,d),ih(this.contextWindow,`pointerup`,this.handlePointerUp,d),ih(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ch.has(e.overflowX)||ch.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 uh(e,t){return t?{point:t(e.point)}:e}function dh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fh({point:e},t){return{point:e,delta:dh(e,mh(t)),offset:dh(e,ph(t)),velocity:hh(t,.1)}}function ph(e){return e[0]}function mh(e){return e[e.length-1]}function hh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=mh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ za(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ za(t)*2&&(r=e[1]);let a=/* @__PURE__ */ Ba(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 gh(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 _h(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 vh(e,{top:t,left:n,bottom:r,right:i}){return{x:_h(e.x,n,i),y:_h(e.y,t,r)}}function yh(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 bh(e,t){return{x:yh(e.x,t.x),y:yh(e.y,t.y)}}function xh(e,t){let n=.5,r=Of(e),i=Of(t);return i>r?n=/* @__PURE__ */ La(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ La(e.min,e.max-i,t.min)),ka(0,1,n)}function Sh(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 Ch=.35;function wh(e=Ch){return e===!1?e=0:e===!0&&(e=Ch),{x:Th(e,`left`,`right`),y:Th(e,`top`,`bottom`)}}function Th(e,t,n){return{min:Eh(e,t),max:Eh(e,n)}}function Eh(e,t){return typeof e==`number`?e:e[t]||0}const Dh=/* @__PURE__ */ new WeakMap;var Oh=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=Ld(),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=ed(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),Xf(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=Of(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Y.update(()=>i(e,t),!1,!0),Zl(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=Mh(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 lh(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:ah(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||!jh(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=gh(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&&Um(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?vh(n.layoutBox,e):!1,this.elastic=wh(t),r!==this.constraints&&!Um(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Xf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Sh(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Um(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=Yu(n,r.root,this.visualElement.getTransformPagePoint()),a=bh(r.layout.layoutBox,i);if(t){let e=t(Au(a));this.hasMutatedConstraints=!!e,e&&(a=ku(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Xf(o=>{if(!jh(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 Zl(this.visualElement,e),n.start(Ll(e,n,0,t,this.visualElement,!1))}stopAnimation(){Xf(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();Xf(e=>{if(!jh(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(!Um(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Xf(e=>{let t=this.getAxisMotionValue(e).get();i[e]=xh({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(),Xf(t=>{let n=this.getAxisMotionValue(t);if(!jh(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;Dh.set(this.visualElement,this);let e=this.visualElement.current,t=ih(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ld(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Um(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Ah(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=lp(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Xf(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=Ch,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function kh(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Ah(e,t,n){let r=Ad(e,kh(n)),i=Ad(t,kh(n));return()=>{r(),i()}}function jh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Mh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Nh=class extends nf{constructor(e){super(e),this.removeGroupControls=Fa,this.removeListeners=Fa,this.controls=new Oh(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fa}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 Ph=e=>(t,n)=>{e&&Y.update(()=>e(t,n),!1,!0)};var Fh=class extends nf{constructor(){super(...arguments),this.removePointerDownListener=Fa}onPointerDown(e){this.session=new lh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ah(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ph(e),onStart:Ph(t),onMove:Ph(n),onEnd:(e,t)=>{delete this.session,r&&Y.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=ih(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 Ih=!1;var Lh=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),Ih&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),gp.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}),Ih=!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(),Xu.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ih=!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 Rh(e){let[n,r]=sm(),i=g(Ca);return t(Lh,{...e,layoutGroup:i,switchLayoutGroup:g(Hm),isPresent:n,safeToRemove:r})}const zh={pan:{Feature:Fh},drag:{Feature:Nh,ProjectionNode:Qp,MeasureLayout:Rh}};function Bh(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,nh(t)))}var Vh=class extends nf{mount(){let{current:e}=this.node;e&&(this.unmount=rd(e,(e,t)=>(Bh(this.node,t,`Start`),e=>Bh(this.node,e,`End`))))}unmount(){}},Hh=class extends nf{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=Ia(lp(this.node.current,`focus`,()=>this.onFocus()),lp(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Uh(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,nh(t)))}var Wh=class extends nf{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=gd(e,(e,t)=>(Uh(this.node,t,`Start`),(e,{success:t})=>Uh(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const Gh=/* @__PURE__ */ new WeakMap,Kh=/* @__PURE__ */ new WeakMap,qh=e=>{let t=Gh.get(e.target);t&&t(e)},Jh=e=>{e.forEach(qh)};function Yh({root:e,...t}){let n=e||document;Kh.has(n)||Kh.set(n,{});let r=Kh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Jh,{root:e,...t})),r[i]}function Xh(e,t,n){let r=Yh(t);return Gh.set(e,n),r.observe(e),()=>{Gh.delete(e),r.unobserve(e)}}const Zh={some:0,all:1};var Qh=class extends nf{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:Zh[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=Xh(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($h(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function $h({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const eg={inView:{Feature:Qh},tap:{Feature:Wh},focus:{Feature:Hh},hover:{Feature:Vh}},tg={layout:{ProjectionNode:Qp,MeasureLayout:Rh}},ng=/*@__PURE__*/ Zm({...th,...eg,...zh,...tg},Qm);function rg({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=ig(o),b=ag(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(ng.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(xt,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function ig(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 ag(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 og=`--tailwind-portal`;function sg({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(og);t||(t=e.createElement(`DIV`),t.id=og,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function cg({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(pg,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(pg,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(mg,{children:n})};if(s.length<=r)return t(lg,{className:B(`w-full flex items-center`,i),children:t(ug,{children:s.map((e,r)=>n(a.Fragment,{children:[t(dg,{children:c(e)}),r<s.length-1&&t(hg,{children:o??t(ze,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(lg,{className:B(`w-full flex items-center`,i),children:n(ug,{children:[t(dg,{children:t(gg,{})}),t(hg,{children:o??t(ze,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(dg,{children:c(e)}),r<l.length-1&&t(hg,{children:o??t(ze,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const lg=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));lg.displayName=`Breadcrumb`;const ug=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}));ug.displayName=`BreadcrumbList`;const dg=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:B(`inline-flex items-center gap-1.5 text-muted`,e),...n}));dg.displayName=`BreadcrumbItem`;const fg=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:B(`transition-colors hover:text-muted`,n),...r}));fg.displayName=`BreadcrumbLink`;const pg=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}));pg.displayName=`BreadcrumbButton`;const mg=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:B(`font-normal text-foreground`,e),...n}));mg.displayName=`BreadcrumbPage`;const hg=({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(ze,{className:`cn-rtl-flip`})});hg.displayName=`BreadcrumbSeparator`;const gg=({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($e,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});gg.displayName=`BreadcrumbEllipsis`;const _g=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));_g.displayName=`Card`;const vg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex flex-col p-6`,e),...n}));vg.displayName=`CardHeader`;const yg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`font-semibold leading-none tracking-tight`,e),...n}));yg.displayName=`CardTitle`;const bg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`text-sm text-muted`,e),...n}));bg.displayName=`CardDescription`;const xg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`p-6 pt-0`,e),...n}));xg.displayName=`CardContent`;const Sg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex items-center p-6 pt-0`,e),...n}));Sg.displayName=`CardFooter`;var Cg=Object.defineProperty,wg=(e,t)=>Cg(e,`name`,{value:t,configurable:!0}),Tg=`Checkbox`,[Eg,Dg]=/* @__PURE__ */ kn(Tg),[Og,kg]=Eg(Tg);function Ag(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]=Wr({prop:r,defaultProp:o??!1,onChange:u,caller:Tg}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C=!g||!!c||!!g.closest(`form`),w={checked:m,disabled:s,setChecked:h,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:!zg(o)&&o,isFormControl:C,bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(Og,{scope:n,...w,children:Rg(p)?p(w):i})}wg(Ag,`CheckboxProvider`);var jg=`CheckboxTrigger`,Mg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ wg(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...i},o){let{control:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=kg(jg,e),v=z(o,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=/* @__PURE__ */ wg(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),/* @__PURE__ */ t(U.button,{type:`button`,role:`checkbox`,"aria-checked":zg(u)?`mixed`:u,"aria-required":d,"data-state":Bg(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:v,onKeyDown:V(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:V(r,e=>{h(),p(e=>zg(e)?!0:!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`CheckboxTrigger`)),Ng=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ wg(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(Ag,{__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(Mg,{...m,ref:i,__scopeCheckbox:a}),r&&/* @__PURE__ */ t(Lg,{__scopeCheckbox:a})]})})},`Checkbox`)),Pg=`CheckboxIndicator`,Fg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ wg(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=kg(Pg,r);return/* @__PURE__ */ t(Ar,{present:i||zg(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{"data-state":Bg(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Ig=`CheckboxBubbleInput`,Lg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ wg(function({__scopeCheckbox:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=kg(Ig,e),v=z(i,_),y=ir(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=zg(l),n.call(e,!zg(l)&&l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(!zg(l)&&l);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:V(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Rg(e){return typeof e==`function`}wg(Rg,`isFunction`);function zg(e){return e===`indeterminate`}wg(zg,`isIndeterminate`);function Bg(e){return zg(e)?`indeterminate`:e?`checked`:`unchecked`}wg(Bg,`getState`);const Vg=a.forwardRef(({className:e,...n},r)=>t(Ng,{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(Fg,{className:B(`flex items-center justify-center text-current`),children:t(L,{className:`size-4`})})}));Vg.displayName=Ng.displayName;var Hg=Object.defineProperty,Ug=(e,t)=>Hg(e,`name`,{value:t,configurable:!0}),Wg=`Collapsible`,[Gg,Kg]=/* @__PURE__ */ kn(Wg),[qg,Jg]=Gg(Wg),Yg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Ug(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=Wr({prop:i,defaultProp:o??!1,onChange:c,caller:Wg});return/* @__PURE__ */ t(qg,{scope:r,disabled:s,contentId:H(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:/* @__PURE__ */ t(U.div,{"data-state":t_(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),Xg=`CollapsibleTrigger`,Zg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Ug(function(e,n){let{__scopeCollapsible:r,...i}=e,a=Jg(Xg,r);return/* @__PURE__ */ t(U.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":t_(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:V(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),Qg=`CollapsibleContent`,$g=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Ug(function(e,n){let{forceMount:r,...i}=e,a=Jg(Qg,e.__scopeCollapsible);return/* @__PURE__ */ t(Ar,{present:r||a.open,children:({present:e})=>/* @__PURE__ */ t(e_,{...i,ref:n,present:e})})},`CollapsibleContent`)),e_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Ug(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=Jg(Qg,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)},[]),jn(()=>{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":t_(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 t_(e){return e?`open`:`closed`}Ug(t_,`getState`);var n_=Yg,r_=Zg,i_=$g;function a_({...e}){return t(n_,{"data-slot":`collapsible`,...e})}function o_({...e}){return t(r_,{"data-slot":`collapsible-trigger`,...e})}function s_({...e}){return t(i_,{"data-slot":`collapsible-content`,...e})}var c_=1,l_=.9,u_=.8,d_=.17,f_=.1,p_=.999,m_=.9999,h_=.99,g_=/[\\\/_+.#"@\[\(\{&]/,__=/[\\\/_+.#"@\[\(\{&]/g,v_=/[\s-]/,y_=/[\s-]/g;function b_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?c_:h_;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=b_(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=c_:g_.test(e.charAt(l-1))?(d*=u_,p=e.slice(i,l-1).match(__),p&&i>0&&(d*=p_**+p.length)):v_.test(e.charAt(l-1))?(d*=l_,m=e.slice(i,l-1).match(y_),m&&i>0&&(d*=p_**+m.length)):(d*=d_,i>0&&(d*=p_**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=m_)),(d<f_&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=b_(e,t,n,r,l+1,a+2,o),f*f_>d&&(d=f*f_)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function x_(e){return e.toLowerCase().replace(y_,` `)}function S_(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,b_(e,t,x_(e),x_(t),0,0,{})}var C_=Object.defineProperty,w_=(e,t)=>C_(e,`name`,{value:t,configurable:!0}),T_=`Dialog`,[E_,D_]=/* @__PURE__ */ kn(T_),[O_,k_]=E_(T_),A_=/* @__PURE__ */ w_(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=a.useRef(null),u=a.useRef(null),[d,f]=Wr({prop:i,defaultProp:o??!1,onChange:s,caller:T_}),[p,m]=a.useState(0),[h,g]=a.useState(0);return/* @__PURE__ */ t(O_,{scope:n,triggerRef:l,contentRef:u,contentId:H(),titleId:H(),descriptionId:H(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(e=>!e),[f]),modal:c,children:r})},`Dialog`),j_=`DialogTrigger`,M_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let{__scopeDialog:r,...i}=e,a=k_(j_,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":Q_(a.open),...i,ref:o,onClick:V(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),N_=`DialogPortal`,[P_,F_]=E_(N_,{forceMount:void 0}),I_=/* @__PURE__ */ w_(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=k_(N_,n);return/* @__PURE__ */ t(P_,{scope:n,forceMount:r,children:a.Children.map(i,e=>/* @__PURE__ */ t(Ar,{present:r||s.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),L_=`DialogOverlay`,R_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let r=F_(L_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=k_(L_,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Ar,{present:i||o.open,children:/* @__PURE__ */ t(B_,{...a,ref:n})}):null},`DialogOverlay`)),z_=/* @__PURE__ */ an(`DialogOverlay.RemoveScroll`),B_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let{__scopeDialog:r,...i}=e,a=k_(L_,r),o=z(n,N());return/* @__PURE__ */ t(ue,{as:z_,allowPinchZoom:!0,shards:[a.contentRef],children:/* @__PURE__ */ t(U.div,{"data-state":Q_(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),V_=`DialogContent`,H_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let r=F_(V_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=k_(V_,e.__scopeDialog);return/* @__PURE__ */ t(Ar,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(U_,{...a,ref:n}):/* @__PURE__ */ t(W_,{...a,ref:n})})},`DialogContent`)),U_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let r=k_(V_,e.__scopeDialog),i=a.useRef(null),o=z(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(G_,{...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`)),W_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let r=k_(V_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(G_,{...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`)),G_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=k_(V_,i);return le(),/* @__PURE__ */ t(e,{children:/* @__PURE__ */ t(ce,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:/* @__PURE__ */ t(M,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":Q_(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),K_=`DialogTitle`,q_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let{__scopeDialog:r,...i}=e,a=k_(K_,r),{setTitleCount:o}=a;return jn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),J_=`DialogDescription`,Y_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let{__scopeDialog:r,...i}=e,a=k_(J_,r),{setDescriptionCount:o}=a;return jn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),X_=`DialogClose`,Z_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ w_(function(e,n){let{__scopeDialog:r,...i}=e,a=k_(X_,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function Q_(e){return e?`open`:`closed`}w_(Q_,`getState`);var $_=`[cmdk-group=""]`,ev=`[cmdk-group-items=""]`,tv=`[cmdk-group-heading=""]`,nv=`[cmdk-item=""]`,rv=`${nv}:not([aria-disabled="true"])`,iv=`cmdk-item-select`,av=`data-value`,ov=(e,t,n)=>S_(e,t,n),sv=a.createContext(void 0),cv=()=>a.useContext(sv),lv=a.createContext(void 0),uv=()=>a.useContext(lv),dv=a.createContext(void 0),fv=a.forwardRef((e,t)=>{let n=Ev(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=Ev(()=>/* @__PURE__ */ new Set),i=Ev(()=>/* @__PURE__ */ new Map),o=Ev(()=>/* @__PURE__ */ new Map),s=Ev(()=>/* @__PURE__ */ new Set),c=wv(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=kv();Tv(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),Tv(()=>{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??ov;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(ev);t?t.appendChild(e.parentElement===t?e:e.closest(`${ev} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ev} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${$_}[${av}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(av);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($_)?.querySelector(tv))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${nv}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(rv)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(av))}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(av))}function ee(e){let t=j()?.closest($_),n;for(;t&&!n;)t=e>0?Sv(t,$_):Cv(t,$_),n=t?.querySelector(rv);n?w.setState(`value`,n.getAttribute(av)):P(e)}let te=()=>N(M().length-1),F=e=>{e.preventDefault(),e.metaKey?te():e.altKey?ee(1):P(1)},ne=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?ee(-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&&F(e);break;case`ArrowDown`:F(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),te();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(iv);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Mv},l),jv(e,e=>a.createElement(lv.Provider,{value:w},a.createElement(sv.Provider,{value:T},e))))}),pv=a.forwardRef((e,t)=>{let n=H(),r=a.useRef(null),i=a.useContext(dv),o=cv(),s=wv(e),c=s.current?.forceMount??i?.forceMount;Tv(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=Ov(n,r,[e.value,e.children,r],e.keywords),u=uv(),d=Dv(e=>e.value&&e.value===l.current),f=Dv(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(iv,p),()=>t.removeEventListener(iv,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:tn(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)}),mv=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=cv(),f=Dv(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));Tv(()=>d.group(s),[]),Ov(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(U.div,{ref:tn(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),jv(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(dv.Provider,{value:p},e))))}),hv=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=Dv(e=>!e.search);return!n&&!o?null:a.createElement(U.div,{ref:tn(i,t),...r,"cmdk-separator":``,role:`separator`})}),gv=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=uv(),s=Dv(e=>e.search),c=Dv(e=>e.selectedItemId),l=cv();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)}})}),_v=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=Dv(e=>e.selectedItemId),l=cv();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:tn(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},jv(e,e=>a.createElement(`div`,{ref:tn(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),vv=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(A_,{open:n,onOpenChange:r},a.createElement(I_,{container:s},a.createElement(R_,{"cmdk-overlay":``,className:i}),a.createElement(H_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(fv,{ref:t,...c}))))}),yv=a.forwardRef((e,t)=>Dv(e=>e.filtered.count===0)?a.createElement(U.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),bv=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},jv(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),xv=Object.assign(fv,{List:_v,Item:pv,Input:gv,Group:mv,Separator:hv,Dialog:vv,Empty:yv,Loading:bv});function Sv(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Cv(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function wv(e){let t=a.useRef(e);return Tv(()=>{t.current=e}),t}var Tv=typeof window>`u`?a.useEffect:a.useLayoutEffect;function Ev(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function Dv(e){let t=uv(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function Ov(e,t,n,r=[]){let i=a.useRef(),o=cv();return Tv(()=>{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(av,s),i.current=s}),i}var kv=()=>{let[e,t]=a.useState(),n=Ev(()=>/* @__PURE__ */ new Map);return Tv(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Av(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function jv({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(Av(t),{ref:t.ref},n(t.props.children)):n(t)}var Mv={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Nv({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 Pv=d(!1);function Fv(){return!!g(Pv)}function Iv({children:e}){return t(Pv.Provider,{value:!0,children:e})}function Lv({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(Vv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(Gv,{className:`z-50 fixed inset-0 bg-black/80`}),t(Nv,{children:t(qv,{children:o})}),n(Kv,{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(Wv,{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(xt,{className:`size-4`})})})]})}),t(Iv,{children:r})]})]})}const Rv=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(Jv,{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(qv,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(Nv,{children:[t(Jv,{children:e}),a&&t(qv,{children:a})]}),zv=({children:e,className:n,...r})=>t(`div`,{className:B(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),Bv=({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}),Vv=A_,Hv=M_,Uv=I_,Wv=Z_,Gv=a.forwardRef(({className:e,...n},r)=>t(R_,{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}));Gv.displayName=R_.displayName;const Kv=a.forwardRef(({className:e,children:r,...i},a)=>{let o=zi();return n(Uv,{container:o,children:[t(Gv,{}),t(H_,{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})]})});Kv.displayName=H_.displayName;const qv=a.forwardRef(({className:e,...n},r)=>t(Y_,{ref:r,className:B(`text-sm text-muted`,e),...n}));qv.displayName=Y_.displayName;const Jv=a.forwardRef(({className:e,...n},r)=>t(q_,{ref:r,className:B(`text-lg font-semibold leading-none tracking-tight`,e),...n}));Jv.displayName=q_.displayName;const Yv=a.forwardRef(({className:e,...n},r)=>t(xv,{ref:r,className:B(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));Yv.displayName=xv.displayName;const Xv=({children:e,...n})=>t(Vv,{...n,children:t(Kv,{className:`shadow-lg p-0 overflow-hidden`,children:t(Yv,{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})})}),Zv=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(pt,{className:`opacity-50 size-4 shrink-0`}),t(xv.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})]}));Zv.displayName=xv.Input.displayName;const Qv=a.forwardRef(({className:e,...n},r)=>t(xv.List,{ref:r,className:B(`overflow-y-auto overflow-x-hidden`,e),...n}));Qv.displayName=xv.List.displayName;const $v=a.forwardRef((e,n)=>t(xv.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));$v.displayName=xv.Empty.displayName;const ey=a.forwardRef(({className:e,...n},r)=>t(xv.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}));ey.displayName=xv.Group.displayName;const ty=a.forwardRef(({className:e,...n},r)=>t(xv.Separator,{ref:r,className:B(`-mx-1 h-px bg-border`,e),...n}));ty.displayName=xv.Separator.displayName;const ny=a.forwardRef(({className:e,...n},r)=>t(xv.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}));ny.displayName=xv.Item.displayName;const ry=({className:e,...n})=>t(`span`,{className:B(`ms-auto text-xs tracking-widest text-muted`,e),...n});ry.displayName=`CommandShortcut`;var iy=Object.defineProperty,ay=(e,t)=>iy(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
245
- function oy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ kn(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),c=/* @__PURE__ */ ay(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__ */ an(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__ */ an(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 ay(g,`useCollection`),[{Provider:c,Slot:d,ItemSlot:h},g,i]}ay(oy,`createCollection`);var sy=/* @__PURE__ */ new WeakMap,cy=class e extends Map{static{ay(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],sy.set(this,!0)}set(e,t){return sy.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=dy(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}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);return r===-1?this:this.insert(r,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);return r===-1?this:this.insert(r+1,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=ly(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ly(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ly(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=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){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,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}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 ly(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=uy(e,t);return n===-1?void 0:e[n]}ay(ly,`at`);function uy(e,t){let n=e.length,r=dy(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ay(uy,`toSafeIndex`);function dy(e){return e!==e||e===0?0:Math.trunc(e)}ay(dy,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
246
- function fy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ kn(n),[o,s]=r(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new cy,setItemMap:/* @__PURE__ */ ay(()=>void 0,`setItemMap`)}),c=/* @__PURE__ */ ay(({state:e,...n})=>e?/* @__PURE__ */ t(u,{...n,state:e}):/* @__PURE__ */ t(l,{...n}),`CollectionProvider`);c.displayName=n;let l=/* @__PURE__ */ ay(e=>{let n=_();return/* @__PURE__ */ t(u,{...e,state:n})},`CollectionInit`);l.displayName=n+`Init`;let u=/* @__PURE__ */ ay(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[c,l]=a.useState(null),u=z(s,l),[d,f]=i;return a.useEffect(()=>{if(!c)return;let e=gy(()=>{});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c]),/* @__PURE__ */ t(o,{scope:n,itemMap:d,setItemMap:f,collectionRef:u,collectionRefObject:s,collectionElement:c,children:r})},`CollectionProviderImpl`);u.displayName=n+`Impl`;let d=e+`CollectionSlot`,f=/* @__PURE__ */ an(d),p=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(d,r).collectionRef);return/* @__PURE__ */ t(f,{ref:a,children:i})});p.displayName=d;let m=e+`CollectionItemSlot`,h=/* @__PURE__ */ an(m),g=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),[l,u]=a.useState(null),d=z(n,c,u),{setItemMap:f}=s(m,r),p=a.useRef(o);py(p.current,o)||(p.current=o);let g=p.current;return a.useEffect(()=>{let e=g;return f(t=>l?t.has(l)?t.set(l,{...e,element:l}).toSorted(hy):(t.set(l,{...e,element:l}),t.toSorted(hy)):t),()=>{f(e=>!l||!e.has(l)?e:(e.delete(l),new cy(e)))}},[l,g,f]),/* @__PURE__ */ t(h,{"data-radix-collection-item":``,ref:d,children:i})});g.displayName=m;function _(){return a.useState(new cy)}ay(_,`useInitCollection`);function v(t){let{itemMap:n}=s(e+`CollectionConsumer`,t);return n}return ay(v,`useCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:i,useCollection:v,useInitCollection:_}]}ay(fy,`createCollection`);function py(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}ay(py,`shallowEqual`);function my(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ay(my,`isElementPreceding`);function hy(e,t){return!e[1].element||!t[1].element?0:my(e[1].element,t[1].element)?-1:1}ay(hy,`sortByDocumentPosition`);function gy(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ay(gy,`getChildListObserver`);var _y=Object.defineProperty,vy=(e,t)=>_y(e,`name`,{value:t,configurable:!0}),yy=!1;function by(){let[e,t]=a.useState(yy);return a.useEffect(()=>{yy||(yy=!0,t(!0))},[]),e}vy(by,`useIsHydrated`);var xy=a.useSyncExternalStore;function Sy(){return()=>{}}vy(Sy,`subscribe`);function Cy(){return xy(Sy,()=>!0,()=>!1)}vy(Cy,`useIsHydratedModern`);var wy=typeof xy==`function`?Cy:by,Ty=Object.defineProperty,Ey=(e,t)=>Ty(e,`name`,{value:t,configurable:!0}),Dy=`rovingFocusGroup.onEntryFocus`,Oy={bubbles:!1,cancelable:!0},ky=`RovingFocusGroup`,[Ay,jy,My]=/* @__PURE__ */ oy(ky),[Ny,Py]=/* @__PURE__ */ kn(ky,[My]),[Fy,Iy]=Ny(ky),Ly=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Ey(function(e,n){return/* @__PURE__ */ t(Ay.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ay.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ry,{...e,ref:n})})})},`RovingFocusGroup`)),Ry=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Ey(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=fe(s),[_,v]=Wr({prop:c,defaultProp:l??null,onChange:u,caller:ky}),[y,b]=a.useState(!1),x=tr(d),S=jy(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Dy,x),()=>e.removeEventListener(Dy,x)},[x]),/* @__PURE__ */ t(Fy,{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(Dy,Oy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);Wy([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`)),zy=`RovingFocusGroupItem`,By=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Ey(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=H(),d=s||u,f=Iy(zy,r),p=f.currentTabStopId===d,m=jy(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=wy();return jn(()=>{if(v&&i)return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!v&&i)return h(),()=>g()},[v,i,h,g]),/* @__PURE__ */ t(Ay.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=Uy(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?Gy(n,r+1):n.slice(r+1)}setTimeout(()=>Wy(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})},`RovingFocusGroupItem`)),Vy={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Hy(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Ey(Hy,`getDirectionAwareKey`);function Uy(e,t,n){let r=Hy(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Vy[r]}Ey(Uy,`getFocusIntent`);function Wy(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Ey(Wy,`focusFirst`);function Gy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ey(Gy,`wrapArray`);var Ky=Ly,qy=By,Jy=Object.defineProperty,X=(e,t)=>Jy(e,`name`,{value:t,configurable:!0}),Yy=[`Enter`,` `],Xy=[`ArrowDown`,`PageUp`,`Home`],Zy=[`ArrowUp`,`PageDown`,`End`],Qy=[...Xy,...Zy],$y={ltr:[...Yy,`ArrowRight`],rtl:[...Yy,`ArrowLeft`]},eb={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},tb=`Menu`,[nb,rb,ib]=/* @__PURE__ */ oy(tb),[ab,ob]=/* @__PURE__ */ kn(tb,[ib,lr,Py]),sb=lr(),cb=Py(),[lb,ub]=ab(tb),[db,fb]=ab(tb),pb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=sb(n),[u,d]=a.useState(null),f=a.useRef(!1),p=tr(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(Sr,{...l,children:/* @__PURE__ */ t(lb,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:/* @__PURE__ */ t(db,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),mb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e,a=sb(r);return/* @__PURE__ */ t(Cr,{...a,...i,ref:n})},`MenuAnchor`)),hb=`MenuPortal`,[gb,_b]=ab(hb,{forceMount:void 0}),vb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=ub(hb,n);return/* @__PURE__ */ t(gb,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Ar,{present:r||o.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:a,children:i})})})},`MenuPortal`),yb=`MenuContent`,[bb,xb]=ab(yb),Sb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=_b(yb,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=ub(yb,e.__scopeMenu),s=fb(yb,e.__scopeMenu);return/* @__PURE__ */ t(nb.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Ar,{present:i||o.open,children:/* @__PURE__ */ t(nb.Slot,{scope:e.__scopeMenu,children:s.modal?/* @__PURE__ */ t(Cb,{...a,ref:n}):/* @__PURE__ */ t(wb,{...a,ref:n})})})})},`MenuContent`)),Cb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ub(yb,e.__scopeMenu),i=a.useRef(null),o=z(n,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(Eb,{...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`)),wb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ub(yb,e.__scopeMenu);return/* @__PURE__ */ t(Eb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),Tb=/* @__PURE__ */ an(`MenuContent.ScrollLock`),Eb=/* @__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=ub(yb,r),y=fb(yb,r),b=sb(r),x=cb(r),S=rb(r),[C,w]=a.useState(null),T=a.useRef(null),E=z(n,T,v.onContentChange),D=a.useRef(0),O=a.useRef(``),k=a.useRef(0),A=a.useRef(null),j=a.useRef(`right`),N=a.useRef(0),P=g?ue:a.Fragment,ee=g?{as:Tb,allowPinchZoom:!0}:void 0,te=/* @__PURE__ */ X(e=>{let t=O.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=rx(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(/* @__PURE__ */ X((function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`))(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);a.useEffect(()=>()=>window.clearTimeout(D.current),[]),le();let F=a.useCallback(e=>j.current===A.current?.side&&ax(e,A.current?.area),[]);return/* @__PURE__ */ t(bb,{scope:r,searchRef:O,onItemEnter:a.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:a.useCallback(e=>{F(e)||(T.current?.focus(),w(null))},[F]),onTriggerLeave:a.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:k,onPointerGraceIntentChange:a.useCallback(e=>{A.current=e},[]),children:/* @__PURE__ */ t(P,{...ee,children:/* @__PURE__ */ t(ce,{asChild:!0,trapped: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(Ky,{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(wr,{role:`menu`,"aria-orientation":`vertical`,"data-state":Qb(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,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&&te(e.key));let i=T.current;if(e.target!==i||!Qy.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Zy.includes(e.key)&&a.reverse(),tx(a)}),onBlur:V(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:V(e.onPointerMove,ox(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;j.current=t,N.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),Db=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Ob=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{...i,ref:n})},`MenuLabel`)),kb=`MenuItem`,Ab=`menu.itemSelect`,jb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=fb(kb,e.__scopeMenu),l=xb(kb,e.__scopeMenu),u=z(n,s),d=a.useRef(!1),f=/* @__PURE__ */ X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(Ab,{bubbles:!0,cancelable:!0});e.addEventListener(Ab,e=>i?.(e),{once:!0}),Qn(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return/* @__PURE__ */ t(Mb,{...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!==` `)&&Yy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Mb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=xb(kb,r),l=cb(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(nb.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:/* @__PURE__ */ t(qy,{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,ox(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,ox(e=>c.onItemLeave(e))),onFocus:V(e.onFocus,()=>p(!0)),onBlur:V(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Nb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return/* @__PURE__ */ t(Bb,{scope:e.__scopeMenu,checked:r,children:/* @__PURE__ */ t(jb,{role:`menuitemcheckbox`,"aria-checked":$b(r)?`mixed`:r,...a,ref:n,"data-state":ex(r),onSelect:V(a.onSelect,()=>i?.($b(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Pb,Fb]=ab(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ X(()=>{},`onValueChange`)}),Ib=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=tr(i);return/* @__PURE__ */ t(Pb,{scope:e.__scopeMenu,value:r,onValueChange:o,children:/* @__PURE__ */ t(Db,{...a,ref:n})})},`MenuRadioGroup`)),Lb=`MenuRadioItem`,Rb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,...i}=e,a=Fb(Lb,e.__scopeMenu),o=r===a.value;return/* @__PURE__ */ t(Bb,{scope:e.__scopeMenu,checked:o,children:/* @__PURE__ */ t(jb,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":ex(o),onSelect:V(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),zb=`MenuItemIndicator`,[Bb,Vb]=ab(zb,{checked:!1}),Hb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=Vb(zb,r);return/* @__PURE__ */ t(Ar,{present:i||$b(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{...a,ref:n,"data-state":ex(o.checked)})})},`MenuItemIndicator`)),Ub=/* @__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`)),Wb=`MenuSub`,[Gb,Kb]=ab(Wb),qb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=ub(Wb,n),c=sb(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=tr(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),/* @__PURE__ */ t(Sr,{...c,children:/* @__PURE__ */ t(lb,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:/* @__PURE__ */ t(Gb,{scope:n,contentId:H(),triggerId:H(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),Jb=`MenuSubTrigger`,Yb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ub(Jb,e.__scopeMenu),i=fb(Jb,e.__scopeMenu),o=Kb(Jb,e.__scopeMenu),s=xb(Jb,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(mb,{asChild:!0,...d,children:/* @__PURE__ */ t(Mb,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":Qb(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,ox(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,ox(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!==` `)&&$y[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Xb=`MenuSubContent`,Zb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=_b(yb,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=ub(yb,e.__scopeMenu),l=fb(yb,e.__scopeMenu),u=Kb(Xb,e.__scopeMenu),d=a.useRef(null),f=z(n,d);return/* @__PURE__ */ t(nb.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Ar,{present:i||c.open,children:/* @__PURE__ */ t(nb.Slot,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Eb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:l.dir===`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=eb[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function Qb(e){return e?`open`:`closed`}X(Qb,`getOpenState`);function $b(e){return e===`indeterminate`}X($b,`isIndeterminate`);function ex(e){return $b(e)?`indeterminate`:e?`checked`:`unchecked`}X(ex,`getCheckedState`);function tx(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(tx,`focusFirst`);function nx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(nx,`wrapArray`);function rx(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=nx(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(rx,`getNextMatch`);function ix(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(ix,`isPointInPolygon`);function ax(e,t){return t?ix({x:e.clientX,y:e.clientY},t):!1}X(ax,`isPointerInGraceArea`);function ox(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(ox,`whenMouse`);var sx=pb,cx=mb,lx=vb,ux=Sb,dx=Db,fx=Ob,px=jb,mx=Nb,hx=Ib,gx=Rb,_x=Hb,vx=Ub,yx=qb,bx=Yb,xx=Zb,Sx=Object.defineProperty,Cx=(e,t)=>Sx(e,`name`,{value:t,configurable:!0}),wx=`DropdownMenu`,[Tx,Ex]=/* @__PURE__ */ kn(wx,[ob]),Dx=ob(),[Ox,kx]=Tx(wx),Ax=/* @__PURE__ */ Cx(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=Dx(n),d=a.useRef(null),[f,p]=Wr({prop:o,defaultProp:s??!1,onChange:c,caller:wx});return/* @__PURE__ */ t(Ox,{scope:n,triggerId:H(),triggerRef:d,contentId:H(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:/* @__PURE__ */ t(sx,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),jx=`DropdownMenuTrigger`,Mx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=kx(jx,r),s=Dx(r),c=z(n,o.triggerRef);return/* @__PURE__ */ t(cx,{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`)),Nx=/* @__PURE__ */ Cx(e=>{let{__scopeDropdownMenu:n,...r}=e,i=Dx(n);return/* @__PURE__ */ t(lx,{...i,...r})},`DropdownMenuPortal`),Px=`DropdownMenuContent`,Fx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=kx(Px,r),s=Dx(r),c=a.useRef(!1);return/* @__PURE__ */ t(ux,{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`)),Ix=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(dx,{...a,...i,ref:n})},`DropdownMenuGroup`)),Lx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(fx,{...a,...i,ref:n})},`DropdownMenuLabel`)),Rx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(px,{...a,...i,ref:n})},`DropdownMenuItem`)),zx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(mx,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),Bx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(hx,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),Vx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(gx,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),Hx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(_x,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),Ux=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(vx,{...a,...i,ref:n})},`DropdownMenuSeparator`)),Wx=/* @__PURE__ */ Cx(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=Dx(n),[c,l]=Wr({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return/* @__PURE__ */ t(yx,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),Gx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(bx,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),Kx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Cx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Dx(r);return/* @__PURE__ */ t(xx,{...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`)),qx=Ax,Jx=Mx,Yx=Nx,Xx=Fx,Zx=Ix,Qx=Lx,$x=Rx,eS=zx,tS=Bx,nS=Vx,rS=Hx,iS=Ux,aS=Wx,oS=Gx,sS=Kx;const cS=a.createContext(!1);function lS({...e}){return t(qx,{"data-slot":`dropdown-menu`,...e})}function uS({...e}){return t(Yx,{"data-slot":`dropdown-menu-portal`,...e})}function dS({...e}){return t(Jx,{"data-slot":`dropdown-menu-trigger`,...e})}function fS({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(Yx,{children:t(Xx,{"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 pS({...e}){return t(Zx,{"data-slot":`dropdown-menu-group`,...e})}function mS({className:e,inset:n,variant:r=`default`,...i}){return t($x,{"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 hS({className:e,children:r,checked:i,inset:a,...o}){return n(eS,{"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(rS,{children:t(L,{})})}),r]})}function gS({...e}){return t(tS,{"data-slot":`dropdown-menu-radio-group`,...e})}function _S({className:e,children:r,inset:i,...a}){return n(nS,{"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(rS,{children:t(L,{})})}),r]})}function vS({className:e,inset:n,...r}){return t(Qx,{"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 yS({className:e,...n}){return t(iS,{"data-slot":`dropdown-menu-separator`,className:B(`bg-border -mx-1 my-1 h-px`,e),...n})}function bS({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 xS({...e}){return t(aS,{"data-slot":`dropdown-menu-sub`,...e})}function SS({className:e,inset:r,children:i,...a}){return n(oS,{"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(ze,{className:`cn-rtl-flip ms-auto`})]})}function CS({className:e,...n}){return t(sS,{"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 wS={left:`start`,center:`center`,right:`end`};function TS({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(cS.Provider,{value:!0,children:r})})})]}):n(lS,{children:[t(dS,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(fS,{align:wS[i],className:`w-max`,children:r})]})}function ES({children:e,label:r}){return n(pS,{children:[r&&t(vS,{children:r}),e]})}function DS({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(cS),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(mS,{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 OS=({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})})},kS=(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);(AS(i,a)||!r)&&Object.defineProperty(e,n,a)},AS=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)},jS=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},MS=(e,t)=>`/* Wrapped ${e}*/\n${t}`,NS=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),PS=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),FS=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=MS.bind(null,r,t.toString());Object.defineProperty(i,"name",PS);let{writable:a,enumerable:o,configurable:s}=NS;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function IS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))kS(e,t,r,n);return jS(e,t),FS(e,t,r),e}const LS=2147483647,RS=/* @__PURE__ */ new WeakMap,zS=/* @__PURE__ */ new WeakMap,BS=/* @__PURE__ */ new WeakMap;function VS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now()){e.delete(t);return}return n}}function HS(e,{cacheKey:t,cache:n=/* @__PURE__ */ new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>LS)throw TypeError(`The \`maxAge\` option cannot exceed ${LS}.`);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=VS(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>LS)throw TypeError(`The \`maxAge\` function result cannot exceed ${LS}.`)}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),zS.get(i)?.delete(e)},l);e.unref?.();let t=zS.get(i)??/* @__PURE__ */ new Set;t.add(e),zS.set(i,t)}return c};return IS(i,e,{ignoreNonConfigurable:!0}),RS.set(i,n),BS.set(i,t??(e=>e[0])),i}function US(e){return typeof e==`string`}function WS(e,t,n){return n.indexOf(e)===t}function GS(e){return e.toLowerCase()===e}function KS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function qS(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 qS(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return qS(n)}if(e.indexOf(`-`)===-1||!GS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function JS(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(KS(d))}var f=navigator.language,p=f&&KS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(US).map(qS).filter(WS)}var YS=HS(JS,{cacheKey:JSON.stringify});function XS(e){return YS(e)[0]||null}var ZS=HS(XS,{cacheKey:JSON.stringify});const QS=/* @__PURE__ */ new Map;function $S(e){return function(t,n){let r=t||ZS();QS.has(r)||QS.set(r,/* @__PURE__ */ new Map);let i=QS.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 eC(e){let t=new Date(e);return new Date(t.setHours(12))}function tC(e){return(t,n)=>$S(e)(t,eC(n))}const nC={day:`numeric`},rC={day:`numeric`,month:`long`,year:`numeric`},iC={month:`long`},aC={month:`long`,year:`numeric`},oC={weekday:`short`},sC={weekday:`long`},cC={year:`numeric`},lC=tC(nC),uC=tC(rC),dC=tC(iC),fC=tC(aC),pC=tC(oC),mC=tC(sC),hC=tC(cC);function gC(e,t,n){return function(r,i=n){return t(e(r)+i)}}function _C(e){return function(t){return/* @__PURE__ */ new Date(e(t).getTime()-1)}}function vC(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 yC(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function bC(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function xC(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 SC=gC(Z,xC,-100),CC=gC(Z,xC,100),wC=_C(CC),TC=gC(Z,wC,-100),EC=vC(xC,wC);function DC(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 OC=gC(Z,DC,-10),kC=gC(Z,DC,10),AC=_C(kC),jC=gC(Z,AC,-10),MC=vC(DC,AC);function NC(e){let t=Z(e),n=/* @__PURE__ */ new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const PC=gC(Z,NC,-1),FC=gC(Z,NC,1),IC=_C(FC),LC=gC(Z,IC,-1),RC=vC(NC,IC);function zC(e,t){return function(n,r=t){let i=Z(n),a=yC(n)+r,o=/* @__PURE__ */ new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function BC(e){let t=Z(e),n=yC(e),r=/* @__PURE__ */ new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const VC=zC(BC,-1),HC=zC(BC,1),UC=_C(HC),WC=zC(UC,-1),GC=vC(BC,UC);function KC(e,t){return function(n,r=t){let i=Z(n),a=yC(n),o=bC(n)+r,s=/* @__PURE__ */ new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function qC(e){let t=Z(e),n=yC(e),r=bC(e),i=/* @__PURE__ */ new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const JC=_C(KC(qC,1)),YC=vC(qC,JC);function XC(e){return bC(UC(e))}const ZC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},QC={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],ew=$C[0],tw=$C[5],nw=$C[6];function rw(e,t=ZC.ISO_8601){let n=e.getDay();switch(t){case ZC.ISO_8601:return(n+6)%7;case ZC.ISLAMIC:return(n+1)%7;case ZC.HEBREW:case ZC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function iw(e){return Z(xC(e))}function aw(e){return Z(DC(e))}function ow(e,t=ZC.ISO_8601){let n=Z(e),r=yC(e),i=e.getDate()-rw(e,t);return new Date(n,r,i)}function sw(e,t=ZC.ISO_8601){let n=t===ZC.GREGORY?ZC.GREGORY:ZC.ISO_8601,r=ow(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===ZC.ISO_8601?4:1),o=ow(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function cw(e,t){switch(e){case`century`:return xC(t);case`decade`:return DC(t);case`year`:return NC(t);case`month`:return BC(t);case`day`:return qC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function lw(e,t){switch(e){case`century`:return SC(t);case`decade`:return OC(t);case`year`:return PC(t);case`month`:return VC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function uw(e,t){switch(e){case`century`:return CC(t);case`decade`:return kC(t);case`year`:return FC(t);case`month`:return HC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function dw(e,t){switch(e){case`decade`:return OC(t,-100);case`year`:return PC(t,-10);case`month`:return VC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function fw(e,t){switch(e){case`decade`:return kC(t,100);case`year`:return FC(t,10);case`month`:return HC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function pw(e,t){switch(e){case`century`:return wC(t);case`decade`:return AC(t);case`year`:return IC(t);case`month`:return UC(t);case`day`:return JC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function mw(e,t){switch(e){case`century`:return TC(t);case`decade`:return jC(t);case`year`:return LC(t);case`month`:return WC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function hw(e,t){switch(e){case`decade`:return jC(t,-100);case`year`:return LC(t,-10);case`month`:return WC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function gw(e,t){switch(e){case`century`:return EC(t);case`decade`:return MC(t);case`year`:return RC(t);case`month`:return GC(t);case`day`:return YC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function _w(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[cw(e,r[0]),pw(e,r[1])]}function vw(e,t,n){return n.map(n=>(t||hC)(e,n)).join(` – `)}function yw(e,t,n){return vw(e,t,EC(n))}function bw(e,t,n){return vw(e,t,MC(n))}function xw(e){return e.getDay()===(/* @__PURE__ */ new Date()).getDay()}function Sw(e,t=ZC.ISO_8601){let n=e.getDay();switch(t){case ZC.ISLAMIC:case ZC.HEBREW:return n===tw||n===nw;case ZC.ISO_8601:case ZC.GREGORY:return n===nw||n===ew;default:throw Error(`Unsupported calendar type.`)}}const Cw=`react-calendar__navigation`;function ww({activeStartDate:r,drillUp:i,formatMonthYear:a=fC,formatYear:o=hC,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=lw(C,r),O=E?dw(C,r):void 0,k=uw(C,r),A=E?fw(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=mw(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=hw(C,r);return l&&l>=e})(),N=c&&c<k,P=E&&c&&c<A;function ee(){x(D,`prev`)}function te(){x(O,`prev2`)}function F(){x(k,`next`)}function ne(){x(A,`next2`)}function re(e){let t=(()=>{switch(C){case`century`:return yw(s,o,e);case`decade`:return bw(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||ZS()||void 0,view:C}):t}function ie(){let a=`${Cw}__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:re(r)}),S?n(e,{children:[t(`span`,{className:`${a}__divider`,children:` – `}),t(`span`,{className:`${a}__labelText ${a}__labelText--to`,children:re(k)})]}):null]})}return n(`div`,{className:Cw,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${Cw}__arrow ${Cw}__prev2-button`,disabled:M,onClick:te,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${Cw}__arrow ${Cw}__prev-button`,disabled:j,onClick:ee,type:`button`,children:b}),ie(),g!==null&&t(`button`,{"aria-label":h,className:`${Cw}__arrow ${Cw}__next-button`,disabled:N,onClick:F,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${Cw}__arrow ${Cw}__next2-button`,disabled:P,onClick:ne,type:`button`,children:m}):null]})}function Tw(e){return`${e}%`}function Ew({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?Tw(100*a/r):null;return u(e,{...e.props,style:{flexBasis:Tw(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function Dw(e,t,n){return t&&t>e?t:n&&n<e?n:e}function Ow(e,t){return t[0]<=e&&t[1]>=e}function kw(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function Aw(e,t){return Ow(e[0],t)||Ow(e[1],t)}function jw(e,t,n){let r=Aw(t,e),i=[];if(r){i.push(n);let r=Ow(e[0],t),a=Ow(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function Mw(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function Nw(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 gw(t,n)})();if(Ow(o,s)&&a.push(`${i}--now`),!t||!Mw(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 gw(n,t)})();kw(c,s)?a.push(`${i}--active`):Aw(c,s)&&a.push(`${i}--hasActive`);let l=jw(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=jw(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:Nw({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(Ew,{className:e,count:n,offset:s,wrap:!0,children:p})}function Fw(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 Iw=`react-calendar__century-view__decades__decade`;function Lw({classes:e=[],currentCentury:n,formatYear:r=hC,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(Iw),xC(a).getFullYear()!==n&&s.push(`${Iw}--neighboringCentury`),t(Fw,{...i,classes:s,maxDateTransform:AC,minDateTransform:DC,view:`century`,children:bw(o,r,a)})}function Rw(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=iw(n),l=c+(i?119:99);return t(Pw,{className:`react-calendar__century-view__decades`,dateTransform:DC,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(Lw,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function zw(e){function n(){return t(Rw,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const Bw=`react-calendar__decade-view__years__year`;function Vw({classes:e=[],currentDecade:n,formatYear:r=hC,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(Bw),DC(a).getFullYear()!==n&&s.push(`${Bw}--neighboringDecade`),t(Fw,{...i,classes:s,maxDateTransform:IC,minDateTransform:NC,view:`decade`,children:r(o,a)})}function Hw(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=aw(n),l=c+(i?11:9);return t(Pw,{className:`react-calendar__decade-view__years`,dateTransform:NC,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(Vw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function Uw(e){function n(){return t(Hw,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const Ww=`react-calendar__month-view__days__day`;function Gw({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=lC,formatLongDate:a=uC,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(Ww),Sw(s,e)&&l.push(`${Ww}--weekend`),s.getMonth()!==r&&l.push(`${Ww}--neighboringMonth`),t(Fw,{...o,classes:l,formatAbbr:a,maxDateTransform:JC,minDateTransform:qC,view:`month`,children:i(c,s)})}function Kw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=yC(n),f=a||o,p=rw(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=XC(n);if(o){let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-rw(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),qC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(Gw,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const qw=`react-calendar__month-view__weekdays`,Jw=`${qw}__weekday`;function Yw(e){let{calendarType:n,formatShortWeekday:i=pC,formatWeekday:a=mC,locale:o,onMouseLeave:s}=e,c=BC(/* @__PURE__ */ new Date),l=Z(c),u=yC(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-rw(c,n)),f=a(o,s);d.push(t(`div`,{className:r(Jw,xw(s)&&`${Jw}--current`,Sw(s,n)&&`${Jw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(Ew,{className:qw,count:7,onFocus:s,onMouseOver:s,children:d})}const Xw=`react-calendar__tile`;function Zw(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:Xw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:Xw,children:i})}}function Qw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=XC(n)-(7-rw(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=yC(n),i=bC(n),a=[];for(let n=0;n<s;n+=1)a.push(ow(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>sw(e,r));return t(Ew,{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(Zw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function $w(e){if(e){for(let[t,n]of Object.entries(QC))if(n.includes(e))return t}return ZC.ISO_8601}function eT(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(Yw,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(Qw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(Kw,{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 tT({classes:e=[],formatMonth:n=dC,formatMonthYear:r=fC,...i}){let{date:a,locale:o}=i;return t(Fw,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:UC,minDateTransform:BC,view:`year`,children:n(o,a)})}function nT(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),BC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(tT,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function rT(e){function n(){return t(nT,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const iT=`react-calendar`,aT=[`century`,`decade`,`year`,`month`],oT=[`decade`,`year`,`month`,`day`],sT=/* @__PURE__ */ new Date;sT.setFullYear(1,0,1),sT.setHours(0,0,0,0);const cT=/* @__PURE__ */ new Date(864e13);function lT(e){return e instanceof Date?e:new Date(e)}function uT(e,t){return aT.slice(aT.indexOf(e),aT.indexOf(t)+1)}function dT(e,t,n){return uT(t,n).indexOf(e)!==-1}function fT(e,t,n){return e&&dT(e,t,n)?e:n}function pT(e){let t=aT.indexOf(e);return oT[t]}function mT(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=lT(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function hT({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=mT(e,i);if(!a)return null;let o=pT(r);return Dw((()=>{switch(i){case 0:return cw(o,a);case 1:return pw(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const gT=e=>hT(e,0),_T=e=>hT(e,1),vT=e=>[gT,_T].map(t=>t(e));function yT({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return cw(fT(a,r,t),gT({value:i,minDate:n,maxDate:e,maxDetail:t})||/* @__PURE__ */ new Date)}function bT({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=fT(l,s,a),d=e||t;return d?cw(u,d):yT({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function xT(e){return e&&(!Array.isArray(e)||e.length===1)}function ST(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var CT=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=cT,maxDetail:D=`month`,minDate:O=sT,minDetail:k=`century`,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:ee,nextLabel:te,onActiveStartDateChange:F,onChange:ne,onClickDay:re,onClickDecade:ie,onClickMonth:ae,onClickWeekNumber:oe,onClickYear:se,onDrillDown:ce,onDrillUp:le,onViewChange:ue,prev2AriaLabel:de,prev2Label:fe,prevAriaLabel:pe,prevLabel:me,returnValue:he=`start`,selectRange:ge,showDoubleView:_e,showFixedNumberOfWeeks:ve,showNavigation:ye=!0,showNeighboringCentury:be,showNeighboringDecade:xe,showNeighboringMonth:Se=!0,showWeekNumbers:Ce,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:De,view:Oe}=e,[ke,Ae]=w(u),[je,Me]=w(null),[Ne,Pe]=w(Array.isArray(d)?d.map(e=>e===null?null:lT(e)):d==null?null:lT(d)),[Fe,I]=w(f),Ie=a||ke||bT({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:De,view:Oe}),L=(()=>{let e=ge&&xT(Ne)||De===void 0?Ne:De;return e?Array.isArray(e)?e.map(e=>e===null?null:lT(e)):e===null?null:lT(e):null})(),Le=pT(D),R=fT(Oe||Fe,k,D),Re=uT(k,D),ze=ge?je:null,Be=Re.indexOf(R)<Re.length-1,Ve=Re.indexOf(R)>0,He=h(e=>(()=>{switch(he){case`start`:return gT;case`end`:return _T;case`range`:return vT;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,he]),Ue=h((e,t)=>{Ae(e);let n={action:t,activeStartDate:e,value:L,view:R};F&&!ST(Ie,e)&&F(n)},[Ie,F,L,R]),We=h((e,t)=>{let n=(()=>{switch(R){case`century`:return ie;case`decade`:return se;case`year`:return ae;case`month`:return re;default:throw Error(`Invalid view: ${R}.`)}})();n&&n(e,t)},[re,ie,ae,se,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.`);Ae(e),I(n);let r={action:`drillDown`,activeStartDate:e,value:L,view:n};F&&!ST(Ie,e)&&F(r),ue&&R!==n&&ue(r),ce&&ce(r)},[Ie,Be,F,We,ce,ue,L,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=cw(e,Ie);Ae(t),I(e);let n={action:`drillUp`,activeStartDate:t,value:L,view:e};F&&!ST(Ie,t)&&F(n),ue&&R!==e&&ue(n),le&&le(n)},[Ie,Ve,F,le,ue,L,R,Re]),qe=h((e,t)=>{let n=L;We(e,t);let r=ge&&!xT(n),i;if(ge){if(r)i=cw(Le,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=_w(Le,n,e)}}else i=He(e);let a=!ge||r||S?yT({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:R}):null;t.persist(),Ae(a),Pe(i);let s={action:`onChange`,activeStartDate:a,value:i,view:R};if(F&&!ST(Ie,a)&&F(s),ne){if(ge){if(!xT(i))ne(i||null,t);else if(o){if(Array.isArray(i))throw Error(`value must not be an array`);ne([i||null,null],t)}}else ne(i||null,t)}},[Ie,o,He,S,E,D,O,k,F,ne,We,ge,L,Le,R]);function Je(e){Me(e)}function Ye(){Me(null)}y(i,()=>({activeStartDate:Ie,drillDown:Ge,drillUp:Ke,onChange:qe,setActiveStartDate:Ue,value:L,view:R}),[Ie,Ge,Ke,qe,Ue,L,R]);function Xe(e){let n={activeStartDate:e?uw(R,Ie):cw(R,Ie),hover:ze,locale:T,maxDate:E,minDate:O,onClick:Be?Ge:qe,onMouseOver:ge?Je:void 0,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:L,valueType:Le};switch(R){case`century`:return t(zw,{formatYear:x,showNeighboringCentury:be,...n});case`decade`:return t(Uw,{formatYear:x,showNeighboringDecade:xe,...n});case`year`:return t(rT,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(eT,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:oe,onMouseLeave:ge?Ye:void 0,showFixedNumberOfWeeks:ve===void 0?_e:ve,showNeighboringMonth:Se,showWeekNumbers:Ce,...n});default:throw Error(`Invalid view: ${R}.`)}}function Ze(){return ye?t(ww,{activeStartDate:Ie,drillUp:Ke,formatMonthYear:_,formatYear:x,locale:T,maxDate:E,minDate:O,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:ee,nextLabel:te,prev2AriaLabel:de,prev2Label:fe,prevAriaLabel:pe,prevLabel:me,setActiveStartDate:Ue,showDoubleView:_e,view:R,views:Re}):null}return n(`div`,{className:r(iT,ge&&(Array.isArray(L)?L:[L]).length===1&&`${iT}--selectRange`,_e&&`${iT}--doubleView`,c),"data-testid":l,ref:C,children:[Ze(),n(`div`,{className:`${iT}__viewContainer`,onBlur:ge?Ye:void 0,onMouseLeave:ge?Ye:void 0,children:[Xe(),_e?Xe(!0):null]})]})});pe.extend(he),pe.extend(me);var Q=pe,wT=Object.defineProperty,TT=(e,t)=>wT(e,`name`,{value:t,configurable:!0}),ET=`Popover`,[DT,OT]=/* @__PURE__ */ kn(ET,[lr]),kT=lr(),[AT,jT]=DT(ET),MT=/* @__PURE__ */ TT(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=kT(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=Wr({prop:i,defaultProp:o??!1,onChange:s,caller:ET});return/* @__PURE__ */ t(Sr,{...l,children:/* @__PURE__ */ t(AT,{scope:n,contentId:H(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:a.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:c,children:r})})},`Popover`),NT=`PopoverAnchor`,PT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ TT(function(e,n){let{__scopePopover:r,...i}=e,o=jT(NT,r),s=kT(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),/* @__PURE__ */ t(Cr,{...s,...i,ref:n})},`PopoverAnchor`)),FT=`PopoverTrigger`,IT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ TT(function(e,n){let{__scopePopover:r,...i}=e,a=jT(FT,r),o=kT(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":YT(a.open),...i,ref:s,onClick:V(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:/* @__PURE__ */ t(Cr,{asChild:!0,...o,children:c})},`PopoverTrigger`)),LT=`PopoverPortal`,[RT,zT]=DT(LT,{forceMount:void 0}),BT=/* @__PURE__ */ TT(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=jT(LT,n);return/* @__PURE__ */ t(RT,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Ar,{present:r||o.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),VT=`PopoverContent`,HT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ TT(function(e,n){let r=zT(VT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=jT(VT,e.__scopePopover);return/* @__PURE__ */ t(Ar,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(WT,{...a,ref:n}):/* @__PURE__ */ t(GT,{...a,ref:n})})},`PopoverContent`)),UT=/* @__PURE__ */ an(`PopoverContent.RemoveScroll`),WT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ TT(function(e,n){let r=jT(VT,e.__scopePopover),i=a.useRef(null),o=z(n,i),s=a.useRef(!1);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(ue,{as:UT,allowPinchZoom:!0,children:/* @__PURE__ */ t(KT,{...e,ref:o,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`)),GT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ TT(function(e,n){let r=jT(VT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(KT,{...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`)),KT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ TT(function(e,n){let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=jT(VT,r),m=kT(r);return le(),/* @__PURE__ */ t(ce,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ t(wr,{"data-state":YT(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:n,style:{...f.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`)),qT=`PopoverClose`,JT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ TT(function(e,n){let{__scopePopover:r,...i}=e,a=jT(qT,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function YT(e){return e?`open`:`closed`}TT(YT,`getState`);var XT=MT,ZT=PT,QT=IT,$T=BT,eE=HT,tE=JT;const nE=a.createContext(null),rE=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(nE.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(XT,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function iE(e=!1,t=()=>{},n){e&&t(n===`enter`)}const aE=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(nE);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(QT,{ref:r,asChild:!0,onMouseEnter:()=>iE(s,o,`enter`),onMouseLeave:()=>iE(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});aE.displayName=QT.displayName;const oE=ZT,sE=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(nE);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=zi();return t($T,{container:u,children:t(eE,{ref:o,align:n,side:r,onMouseEnter:()=>iE(l,c,`enter`),onMouseLeave:()=>iE(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})})});sE.displayName=eE.displayName;const cE=tE;cE.displayName=tE.displayName;function lE(){let e=a.useContext(nE);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const uE=`
244
+ `),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[n]),t(Qp,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const em=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=wa(tm),p=v(),m=C(r),h=C(i);Ta(()=>{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($p,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(Ea.Provider,{value:_,children:e})};function tm(){return/* @__PURE__ */ new Map}function nm(e=!0){let t=g(Ea);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 rm=e=>e.key||``;function im(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const am=({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]=nm(c),m=S(()=>im(n),[n]),h=c&&!f?[]:m.map(rm),_=C(!0),v=wa(()=>/* @__PURE__ */ new Map),y=C(/* @__PURE__ */ new Set),[b,x]=w(m),[T,E]=w(m);Ta(()=>{c&&!f&&!T.length&&p?.()},[f,c,T.length,p]),Ta(()=>{_.current=!1;for(let e=0;e<T.length;e++){let t=rm(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(rm(n));r===-1?(e.splice(t++,0,n),D.push(n)):t=r+D.length+1}return D.every(e=>v.get(rm(e)))?e=m:s===`wait`&&(e=D),E(im(e)),x(m),null}let{forceRender:O}=g(Ca);return t(e,{children:T.map(e=>{let n=rm(e),g=c&&!f?!1:m===T||h.includes(n);return t(em,{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)})})},om=d({strict:!1}),sm={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 cm=!1;function lm(){if(cm)return;let e={};for(let t in sm)e[t]={isEnabled:e=>sm[t].some(t=>!!e[t])};Qd(e),cm=!0}function um(){return lm(),$d()}function dm(e){let t=um();for(let n in e)t[n]={...t[n],...e[n]};Qd(t)}const fm=/* @__PURE__ */ d({});function pm(e,t){if(Ud(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Bd(t)?t:void 0,animate:Bd(n)?n:void 0}}return e.inherit===!1?{}:t}function mm(e){let{initial:t,animate:n}=pm(e,g(fm));return S(()=>({initial:t,animate:n}),[hm(t),hm(n)])}function hm(e){return Array.isArray(e)?e.join(` `):e}const gm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _m(e,t,n){for(let r in t)!Xl(t[r])&&!of(r,n)&&(e[r]=t[r])}function vm({transformTemplate:e},t){return S(()=>{let n=gm();return Cu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ym(e,t){let n=e.style||{},r={};return _m(r,n,e),Object.assign(r,vm(e,t)),r}function bm(e,t){let n={},r=ym(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 xm=()=>({...gm(),attrs:{}});function Sm(e,t,n,r){let i=S(()=>{let n=xm();return Ou(n,t,df(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};_m(t,e.style,e),i.style={...t,...i.style}}return i}const Cm=/* @__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 wm(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Cm.has(e)}function Tm(e,t){return e.startsWith(`on`)?!wm(e):t?.(e)??!wm(e)}function Em(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Xl(e[a])||(Tm(a,r)||n===!0&&wm(a)||!t&&!wm(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const Dm=[`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 Om(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Dm.indexOf(e)>-1||/[A-Z]/u.test(e))}function km(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Om(e)?Sm:bm)(t,r,i,e),u=Em(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>Xl(p)?p.get():p,[p]);return f(e,{...d,children:m})}function Am({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:jm(n,r,i,e),renderState:t()}}function jm(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=cp(a[e]);let{initial:o,animate:s}=e,c=Ud(e),l=Wd(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`&&!zd(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Hl(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 Mm=e=>(t,n)=>{let r=g(fm),i=g(Ea),a=()=>Am(e,t,r,i);return n?a():wa(a)},Nm=/*@__PURE__*/ Mm({scrapeMotionValuesFromProps:sf,createRenderState:gm}),Pm=/*@__PURE__*/ Mm({scrapeMotionValuesFromProps:pf,createRenderState:xm}),Fm=Symbol.for(`motionComponentSymbol`);function Im(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 Lm=d({});function Rm(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function zm(e,t,n,r,i,a){let{visualElement:o}=g(fm),s=g(om),c=g(Ea),l=g(Jp),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(Lm);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Bm(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[eu],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Ta(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Ta(()=>{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 Bm(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:Vm(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Rm(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Vm(e){if(e)return e.options.allowProjection===!1?Vm(e.parent):e.projection}function Hm(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&dm(a);let s=i?i===`svg`:Om(e),c=s?Pm:Nm;function l(i,l){let u,d={...g(Jp),...i,layoutId:Um(i)},{isStatic:f,isValidProp:p}=d,m=mm(i),h=c(i,f);if(!f&&typeof window<`u`){Wm(d,a);let t=Gm(d);u=t.MeasureLayout,m.visualElement=zm(e,h,d,o,t.ProjectionNode,s)}return n(fm.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,km(e,i,Im(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[Fm]=e,u}function Um({layoutId:e}){let t=g(Ca).id;return t&&e!==void 0?t+`-`+e:e}function Wm(e,t){g(om).strict}function Gm(e){let{drag:t,layout:n}=um();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Km(e,t){if(typeof Proxy>`u`)return Hm;let n=/* @__PURE__ */ new Map,r=(n,r)=>Hm(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Hm(a,void 0,e,t)),n.get(a))})}const qm=(e,t)=>t.isSVG??Om(e)?new mf(t):new lf(t,{allowProjection:e!==l});var Jm=class extends nf{constructor(e){super(e),e.animationState||=_f(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();zd(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 Ym=0;const Xm={animation:{Feature:Jm},exit:{Feature:class extends nf{constructor(){super(...arguments),this.id=Ym++}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}=Ul(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 Zm(e){return{point:{x:e.pageX,y:e.pageY}}}const Qm=e=>t=>ad(t)&&e(t,Zm(t));function $m(e,t,n,r){return ip(e,t,Qm(n),r)}const eh=({current:e})=>e?e.ownerDocument.defaultView:null,th=(e,t)=>Math.abs(e-t);function nh(e,t){let n=th(e.x,t.x),r=th(e.y,t.y);return Math.sqrt(n**2+r**2)}const rh=/*#__PURE__*/ new Set([`auto`,`scroll`]);var ih=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=ah(this.lastRawMoveEventInfo,this.transformPagePoint));let e=sh(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=nh(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=ah(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=sh(e.type===`pointercancel`?this.lastMoveEventInfo:ah(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!ad(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=ah(Zm(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=G;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,sh(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Ia($m(this.contextWindow,`pointermove`,this.handlePointerMove,d),$m(this.contextWindow,`pointerup`,this.handlePointerUp,d),$m(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(rh.has(e.overflowX)||rh.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 ah(e,t){return t?{point:t(e.point)}:e}function oh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sh({point:e},t){return{point:e,delta:oh(e,lh(t)),offset:oh(e,ch(t)),velocity:uh(t,.1)}}function ch(e){return e[0]}function lh(e){return e[e.length-1]}function uh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=lh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ za(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ za(t)*2&&(r=e[1]);let a=/* @__PURE__ */ Ba(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 fh(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 ph(e,{top:t,left:n,bottom:r,right:i}){return{x:fh(e.x,n,i),y:fh(e.y,t,r)}}function mh(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 hh(e,t){return{x:mh(e.x,t.x),y:mh(e.y,t.y)}}function gh(e,t){let n=.5,r=Cf(e),i=Cf(t);return i>r?n=/* @__PURE__ */ La(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ La(e.min,e.max-i,t.min)),ka(0,1,n)}function _h(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 vh=.35;function yh(e=vh){return e===!1?e=0:e===!0&&(e=vh),{x:bh(e,`left`,`right`),y:bh(e,`top`,`bottom`)}}function bh(e,t,n){return{min:xh(e,t),max:xh(e,n)}}function xh(e,t){return typeof e==`number`?e:e[t]||0}const Sh=/* @__PURE__ */ new WeakMap;var Ch=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=Ld(),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=ed(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),Gf(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=Cf(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Y.update(()=>i(e,t),!1,!0),Ql(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=Dh(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 ih(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:eh(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||!Eh(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&&Rm(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?ph(n.layoutBox,e):!1,this.elastic=yh(t),r!==this.constraints&&!Rm(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Gf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=_h(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Rm(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=Yu(n,r.root,this.visualElement.getTransformPagePoint()),a=hh(r.layout.layoutBox,i);if(t){let e=t(Au(a));this.hasMutatedConstraints=!!e,e&&(a=ku(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Gf(o=>{if(!Eh(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 Ql(this.visualElement,e),n.start(Ll(e,n,0,t,this.visualElement,!1))}stopAnimation(){Gf(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();Gf(e=>{if(!Eh(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(!Rm(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Gf(e=>{let t=this.getAxisMotionValue(e).get();i[e]=gh({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(),Gf(t=>{let n=this.getAxisMotionValue(t);if(!Eh(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;Sh.set(this.visualElement,this);let e=this.visualElement.current,t=$m(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ld(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Rm(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Th(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=ip(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Gf(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=vh,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function wh(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Th(e,t,n){let r=Ad(e,wh(n)),i=Ad(t,wh(n));return()=>{r(),i()}}function Eh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Dh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Oh=class extends nf{constructor(e){super(e),this.removeGroupControls=Fa,this.removeListeners=Fa,this.controls=new Ch(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fa}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 kh=e=>(t,n)=>{e&&Y.update(()=>e(t,n),!1,!0)};var Ah=class extends nf{constructor(){super(...arguments),this.removePointerDownListener=Fa}onPointerDown(e){this.session=new ih(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eh(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:kh(e),onStart:kh(t),onMove:kh(n),onEnd:(e,t)=>{delete this.session,r&&Y.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=$m(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 jh=!1;var Mh=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),jh&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),dp.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}),jh=!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(),Xu.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;jh=!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 Nh(e){let[n,r]=nm(),i=g(Ca);return t(Mh,{...e,layoutGroup:i,switchLayoutGroup:g(Lm),isPresent:n,safeToRemove:r})}const Ph={pan:{Feature:Ah},drag:{Feature:Oh,ProjectionNode:qp,MeasureLayout:Nh}};function Fh(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,Zm(t)))}var Ih=class extends nf{mount(){let{current:e}=this.node;e&&(this.unmount=rd(e,(e,t)=>(Fh(this.node,t,`Start`),e=>Fh(this.node,e,`End`))))}unmount(){}},Lh=class extends nf{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=Ia(ip(this.node.current,`focus`,()=>this.onFocus()),ip(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Rh(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,Zm(t)))}var zh=class extends nf{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=gd(e,(e,t)=>(Rh(this.node,t,`Start`),(e,{success:t})=>Rh(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const Bh=/* @__PURE__ */ new WeakMap,Vh=/* @__PURE__ */ new WeakMap,Hh=e=>{let t=Bh.get(e.target);t&&t(e)},Uh=e=>{e.forEach(Hh)};function Wh({root:e,...t}){let n=e||document;Vh.has(n)||Vh.set(n,{});let r=Vh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Uh,{root:e,...t})),r[i]}function Gh(e,t,n){let r=Wh(t);return Bh.set(e,n),r.observe(e),()=>{Bh.delete(e),r.unobserve(e)}}const Kh={some:0,all:1};var qh=class extends nf{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:Kh[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=Gh(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(Jh(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Jh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Yh={inView:{Feature:qh},tap:{Feature:zh},focus:{Feature:Lh},hover:{Feature:Ih}},Xh={layout:{ProjectionNode:qp,MeasureLayout:Nh}},Zh=/*@__PURE__*/ Km({...Xm,...Yh,...Ph,...Xh},qm);function Qh({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=$h(o),b=eg(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(Zh.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(xt,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function $h(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 eg(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 tg=`--tailwind-portal`;function ng({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(tg);t||(t=e.createElement(`DIV`),t.id=tg,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function rg({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(cg,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(cg,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(lg,{children:n})};if(s.length<=r)return t(ig,{className:B(`w-full flex items-center`,i),children:t(ag,{children:s.map((e,r)=>n(a.Fragment,{children:[t(og,{children:c(e)}),r<s.length-1&&t(ug,{children:o??t(Ve,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(ig,{className:B(`w-full flex items-center`,i),children:n(ag,{children:[t(og,{children:t(dg,{})}),t(ug,{children:o??t(Ve,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(og,{children:c(e)}),r<l.length-1&&t(ug,{children:o??t(Ve,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const ig=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));ig.displayName=`Breadcrumb`;const ag=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}));ag.displayName=`BreadcrumbList`;const og=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:B(`inline-flex items-center gap-1.5 text-muted`,e),...n}));og.displayName=`BreadcrumbItem`;const sg=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:B(`transition-colors hover:text-muted`,n),...r}));sg.displayName=`BreadcrumbLink`;const cg=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}));cg.displayName=`BreadcrumbButton`;const lg=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:B(`font-normal text-foreground`,e),...n}));lg.displayName=`BreadcrumbPage`;const ug=({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(Ve,{className:`cn-rtl-flip`})});ug.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($e,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});dg.displayName=`BreadcrumbEllipsis`;const fg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));fg.displayName=`Card`;const pg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex flex-col p-6`,e),...n}));pg.displayName=`CardHeader`;const mg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`font-semibold leading-none tracking-tight`,e),...n}));mg.displayName=`CardTitle`;const hg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`text-sm text-muted`,e),...n}));hg.displayName=`CardDescription`;const gg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`p-6 pt-0`,e),...n}));gg.displayName=`CardContent`;const _g=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex items-center p-6 pt-0`,e),...n}));_g.displayName=`CardFooter`;var vg=Object.defineProperty,yg=(e,t)=>vg(e,`name`,{value:t,configurable:!0}),bg=`Checkbox`,[xg,Sg]=/* @__PURE__ */ kn(bg),[Cg,wg]=xg(bg);function Tg(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]=Wr({prop:r,defaultProp:o??!1,onChange:u,caller:bg}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C=!g||!!c||!!g.closest(`form`),w={checked:m,disabled:s,setChecked:h,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:!Pg(o)&&o,isFormControl:C,bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(Cg,{scope:n,...w,children:Ng(p)?p(w):i})}yg(Tg,`CheckboxProvider`);var Eg=`CheckboxTrigger`,Dg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yg(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...i},o){let{control:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=wg(Eg,e),v=z(o,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=/* @__PURE__ */ yg(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),/* @__PURE__ */ t(U.button,{type:`button`,role:`checkbox`,"aria-checked":Pg(u)?`mixed`:u,"aria-required":d,"data-state":Fg(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:v,onKeyDown:V(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:V(r,e=>{h(),p(e=>Pg(e)?!0:!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`CheckboxTrigger`)),Og=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yg(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(Tg,{__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(Dg,{...m,ref:i,__scopeCheckbox:a}),r&&/* @__PURE__ */ t(Mg,{__scopeCheckbox:a})]})})},`Checkbox`)),kg=`CheckboxIndicator`,Ag=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yg(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=wg(kg,r);return/* @__PURE__ */ t(Ar,{present:i||Pg(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{"data-state":Fg(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),jg=`CheckboxBubbleInput`,Mg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yg(function({__scopeCheckbox:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=wg(jg,e),v=z(i,_),y=ir(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=Pg(l),n.call(e,!Pg(l)&&l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(!Pg(l)&&l);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:V(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Ng(e){return typeof e==`function`}yg(Ng,`isFunction`);function Pg(e){return e===`indeterminate`}yg(Pg,`isIndeterminate`);function Fg(e){return Pg(e)?`indeterminate`:e?`checked`:`unchecked`}yg(Fg,`getState`);const Ig=a.forwardRef(({className:e,...n},r)=>t(Og,{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(Ag,{className:B(`flex items-center justify-center text-current`),children:t(L,{className:`size-4`})})}));Ig.displayName=Og.displayName;var Lg=Object.defineProperty,Rg=(e,t)=>Lg(e,`name`,{value:t,configurable:!0}),zg=`Collapsible`,[Bg,Vg]=/* @__PURE__ */ kn(zg),[Hg,Ug]=Bg(zg),Wg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Rg(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=Wr({prop:i,defaultProp:o??!1,onChange:c,caller:zg});return/* @__PURE__ */ t(Hg,{scope:r,disabled:s,contentId:H(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:/* @__PURE__ */ t(U.div,{"data-state":Xg(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),Gg=`CollapsibleTrigger`,Kg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Rg(function(e,n){let{__scopeCollapsible:r,...i}=e,a=Ug(Gg,r);return/* @__PURE__ */ t(U.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":Xg(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:V(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),qg=`CollapsibleContent`,Jg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Rg(function(e,n){let{forceMount:r,...i}=e,a=Ug(qg,e.__scopeCollapsible);return/* @__PURE__ */ t(Ar,{present:r||a.open,children:({present:e})=>/* @__PURE__ */ t(Yg,{...i,ref:n,present:e})})},`CollapsibleContent`)),Yg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Rg(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=Ug(qg,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)},[]),jn(()=>{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":Xg(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 Xg(e){return e?`open`:`closed`}Rg(Xg,`getState`);var Zg=Wg,Qg=Kg,$g=Jg;function e_({...e}){return t(Zg,{"data-slot":`collapsible`,...e})}function t_({...e}){return t(Qg,{"data-slot":`collapsible-trigger`,...e})}function n_({...e}){return t($g,{"data-slot":`collapsible-content`,...e})}var r_=1,i_=.9,a_=.8,o_=.17,s_=.1,c_=.999,l_=.9999,u_=.99,d_=/[\\\/_+.#"@\[\(\{&]/,f_=/[\\\/_+.#"@\[\(\{&]/g,p_=/[\s-]/,m_=/[\s-]/g;function h_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?r_:u_;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=h_(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=r_:d_.test(e.charAt(l-1))?(d*=a_,p=e.slice(i,l-1).match(f_),p&&i>0&&(d*=c_**+p.length)):p_.test(e.charAt(l-1))?(d*=i_,m=e.slice(i,l-1).match(m_),m&&i>0&&(d*=c_**+m.length)):(d*=o_,i>0&&(d*=c_**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=l_)),(d<s_&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=h_(e,t,n,r,l+1,a+2,o),f*s_>d&&(d=f*s_)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function g_(e){return e.toLowerCase().replace(m_,` `)}function __(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,h_(e,t,g_(e),g_(t),0,0,{})}var v_=Object.defineProperty,y_=(e,t)=>v_(e,`name`,{value:t,configurable:!0}),b_=`Dialog`,[x_,S_]=/* @__PURE__ */ kn(b_),[C_,w_]=x_(b_),T_=/* @__PURE__ */ y_(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=a.useRef(null),u=a.useRef(null),[d,f]=Wr({prop:i,defaultProp:o??!1,onChange:s,caller:b_}),[p,m]=a.useState(0),[h,g]=a.useState(0);return/* @__PURE__ */ t(C_,{scope:n,triggerRef:l,contentRef:u,contentId:H(),titleId:H(),descriptionId:H(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(e=>!e),[f]),modal:c,children:r})},`Dialog`),E_=`DialogTrigger`,D_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(E_,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":q_(a.open),...i,ref:o,onClick:V(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),O_=`DialogPortal`,[k_,A_]=x_(O_,{forceMount:void 0}),j_=/* @__PURE__ */ y_(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=w_(O_,n);return/* @__PURE__ */ t(k_,{scope:n,forceMount:r,children:a.Children.map(i,e=>/* @__PURE__ */ t(Ar,{present:r||s.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),M_=`DialogOverlay`,N_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let r=A_(M_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=w_(M_,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Ar,{present:i||o.open,children:/* @__PURE__ */ t(F_,{...a,ref:n})}):null},`DialogOverlay`)),P_=/* @__PURE__ */ an(`DialogOverlay.RemoveScroll`),F_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(M_,r),o=z(n,N());return/* @__PURE__ */ t(ue,{as:P_,allowPinchZoom:!0,shards:[a.contentRef],children:/* @__PURE__ */ t(U.div,{"data-state":q_(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),I_=`DialogContent`,L_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let r=A_(I_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=w_(I_,e.__scopeDialog);return/* @__PURE__ */ t(Ar,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(R_,{...a,ref:n}):/* @__PURE__ */ t(z_,{...a,ref:n})})},`DialogContent`)),R_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let r=w_(I_,e.__scopeDialog),i=a.useRef(null),o=z(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(B_,{...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`)),z_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let r=w_(I_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(B_,{...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`)),B_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=w_(I_,i);return le(),/* @__PURE__ */ t(e,{children:/* @__PURE__ */ t(ce,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:/* @__PURE__ */ t(M,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":q_(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),V_=`DialogTitle`,H_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(V_,r),{setTitleCount:o}=a;return jn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),U_=`DialogDescription`,W_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(U_,r),{setDescriptionCount:o}=a;return jn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),G_=`DialogClose`,K_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(G_,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function q_(e){return e?`open`:`closed`}y_(q_,`getState`);var J_=`[cmdk-group=""]`,Y_=`[cmdk-group-items=""]`,X_=`[cmdk-group-heading=""]`,Z_=`[cmdk-item=""]`,Q_=`${Z_}:not([aria-disabled="true"])`,$_=`cmdk-item-select`,ev=`data-value`,tv=(e,t,n)=>__(e,t,n),nv=a.createContext(void 0),rv=()=>a.useContext(nv),iv=a.createContext(void 0),av=()=>a.useContext(iv),ov=a.createContext(void 0),sv=a.forwardRef((e,t)=>{let n=xv(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=xv(()=>/* @__PURE__ */ new Set),i=xv(()=>/* @__PURE__ */ new Map),o=xv(()=>/* @__PURE__ */ new Map),s=xv(()=>/* @__PURE__ */ new Set),c=yv(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=wv();bv(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),bv(()=>{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??tv;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(Y_);t?t.appendChild(e.parentElement===t?e:e.closest(`${Y_} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Y_} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${J_}[${ev}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ev);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(J_)?.querySelector(X_))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${Z_}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(Q_)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(ev))}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(ev))}function ee(e){let t=j()?.closest(J_),n;for(;t&&!n;)t=e>0?_v(t,J_):vv(t,J_),n=t?.querySelector(Q_);n?w.setState(`value`,n.getAttribute(ev)):P(e)}let te=()=>N(M().length-1),F=e=>{e.preventDefault(),e.metaKey?te():e.altKey?ee(1):P(1)},ne=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?ee(-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&&F(e);break;case`ArrowDown`:F(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),te();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event($_);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Dv},l),Ev(e,e=>a.createElement(iv.Provider,{value:w},a.createElement(nv.Provider,{value:T},e))))}),cv=a.forwardRef((e,t)=>{let n=H(),r=a.useRef(null),i=a.useContext(ov),o=rv(),s=yv(e),c=s.current?.forceMount??i?.forceMount;bv(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=Cv(n,r,[e.value,e.children,r],e.keywords),u=av(),d=Sv(e=>e.value&&e.value===l.current),f=Sv(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($_,p),()=>t.removeEventListener($_,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:tn(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)}),lv=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=rv(),f=Sv(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));bv(()=>d.group(s),[]),Cv(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(U.div,{ref:tn(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),Ev(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(ov.Provider,{value:p},e))))}),uv=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=Sv(e=>!e.search);return!n&&!o?null:a.createElement(U.div,{ref:tn(i,t),...r,"cmdk-separator":``,role:`separator`})}),dv=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=av(),s=Sv(e=>e.search),c=Sv(e=>e.selectedItemId),l=rv();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)}})}),fv=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=Sv(e=>e.selectedItemId),l=rv();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:tn(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Ev(e,e=>a.createElement(`div`,{ref:tn(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),pv=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(T_,{open:n,onOpenChange:r},a.createElement(j_,{container:s},a.createElement(N_,{"cmdk-overlay":``,className:i}),a.createElement(L_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(sv,{ref:t,...c}))))}),mv=a.forwardRef((e,t)=>Sv(e=>e.filtered.count===0)?a.createElement(U.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),hv=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},Ev(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),gv=Object.assign(sv,{List:fv,Item:cv,Input:dv,Group:lv,Separator:uv,Dialog:pv,Empty:mv,Loading:hv});function _v(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function vv(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function yv(e){let t=a.useRef(e);return bv(()=>{t.current=e}),t}var bv=typeof window>`u`?a.useEffect:a.useLayoutEffect;function xv(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function Sv(e){let t=av(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function Cv(e,t,n,r=[]){let i=a.useRef(),o=rv();return bv(()=>{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(ev,s),i.current=s}),i}var wv=()=>{let[e,t]=a.useState(),n=xv(()=>/* @__PURE__ */ new Map);return bv(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Tv(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Ev({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(Tv(t),{ref:t.ref},n(t.props.children)):n(t)}var Dv={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Ov({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 kv=d(!1);function Av(){return!!g(kv)}function jv({children:e}){return t(kv.Provider,{value:!0,children:e})}function Mv({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(Iv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(Bv,{className:`z-50 fixed inset-0 bg-black/80`}),t(Ov,{children:t(Hv,{children:o})}),n(Vv,{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(xt,{className:`size-4`})})})]})}),t(jv,{children:r})]})]})}const Nv=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(Uv,{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(Hv,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(Ov,{children:[t(Uv,{children:e}),a&&t(Hv,{children:a})]}),Pv=({children:e,className:n,...r})=>t(`div`,{className:B(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),Fv=({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}),Iv=T_,Lv=D_,Rv=j_,zv=K_,Bv=a.forwardRef(({className:e,...n},r)=>t(N_,{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}));Bv.displayName=N_.displayName;const Vv=a.forwardRef(({className:e,children:r,...i},a)=>{let o=zi();return n(Rv,{container:o,children:[t(Bv,{}),t(L_,{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})]})});Vv.displayName=L_.displayName;const Hv=a.forwardRef(({className:e,...n},r)=>t(W_,{ref:r,className:B(`text-sm text-muted`,e),...n}));Hv.displayName=W_.displayName;const Uv=a.forwardRef(({className:e,...n},r)=>t(H_,{ref:r,className:B(`text-lg font-semibold leading-none tracking-tight`,e),...n}));Uv.displayName=H_.displayName;const Wv=a.forwardRef(({className:e,...n},r)=>t(gv,{ref:r,className:B(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));Wv.displayName=gv.displayName;const Gv=({children:e,...n})=>t(Iv,{...n,children:t(Vv,{className:`shadow-lg p-0 overflow-hidden`,children:t(Wv,{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})})}),Kv=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(pt,{className:`opacity-50 size-4 shrink-0`}),t(gv.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})]}));Kv.displayName=gv.Input.displayName;const qv=a.forwardRef(({className:e,...n},r)=>t(gv.List,{ref:r,className:B(`overflow-y-auto overflow-x-hidden`,e),...n}));qv.displayName=gv.List.displayName;const Jv=a.forwardRef((e,n)=>t(gv.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));Jv.displayName=gv.Empty.displayName;const Yv=a.forwardRef(({className:e,...n},r)=>t(gv.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}));Yv.displayName=gv.Group.displayName;const Xv=a.forwardRef(({className:e,...n},r)=>t(gv.Separator,{ref:r,className:B(`-mx-1 h-px bg-border`,e),...n}));Xv.displayName=gv.Separator.displayName;const Zv=a.forwardRef(({className:e,...n},r)=>t(gv.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}));Zv.displayName=gv.Item.displayName;const Qv=({className:e,...n})=>t(`span`,{className:B(`ms-auto text-xs tracking-widest text-muted`,e),...n});Qv.displayName=`CommandShortcut`;var $v=Object.defineProperty,ey=(e,t)=>$v(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
245
+ function ty(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ kn(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),c=/* @__PURE__ */ ey(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__ */ an(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__ */ an(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 ey(g,`useCollection`),[{Provider:c,Slot:d,ItemSlot:h},g,i]}ey(ty,`createCollection`);var ny=/* @__PURE__ */ new WeakMap,ry=class e extends Map{static{ey(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ny.set(this,!0)}set(e,t){return ny.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=oy(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}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);return r===-1?this:this.insert(r,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);return r===-1?this:this.insert(r+1,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=iy(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=iy(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return iy(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=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){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,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}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 iy(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ay(e,t);return n===-1?void 0:e[n]}ey(iy,`at`);function ay(e,t){let n=e.length,r=oy(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ey(ay,`toSafeIndex`);function oy(e){return e!==e||e===0?0:Math.trunc(e)}ey(oy,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
246
+ function sy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ kn(n),[o,s]=r(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ry,setItemMap:/* @__PURE__ */ ey(()=>void 0,`setItemMap`)}),c=/* @__PURE__ */ ey(({state:e,...n})=>e?/* @__PURE__ */ t(u,{...n,state:e}):/* @__PURE__ */ t(l,{...n}),`CollectionProvider`);c.displayName=n;let l=/* @__PURE__ */ ey(e=>{let n=_();return/* @__PURE__ */ t(u,{...e,state:n})},`CollectionInit`);l.displayName=n+`Init`;let u=/* @__PURE__ */ ey(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[c,l]=a.useState(null),u=z(s,l),[d,f]=i;return a.useEffect(()=>{if(!c)return;let e=dy(()=>{});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c]),/* @__PURE__ */ t(o,{scope:n,itemMap:d,setItemMap:f,collectionRef:u,collectionRefObject:s,collectionElement:c,children:r})},`CollectionProviderImpl`);u.displayName=n+`Impl`;let d=e+`CollectionSlot`,f=/* @__PURE__ */ an(d),p=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(d,r).collectionRef);return/* @__PURE__ */ t(f,{ref:a,children:i})});p.displayName=d;let m=e+`CollectionItemSlot`,h=/* @__PURE__ */ an(m),g=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),[l,u]=a.useState(null),d=z(n,c,u),{setItemMap:f}=s(m,r),p=a.useRef(o);cy(p.current,o)||(p.current=o);let g=p.current;return a.useEffect(()=>{let e=g;return f(t=>l?t.has(l)?t.set(l,{...e,element:l}).toSorted(uy):(t.set(l,{...e,element:l}),t.toSorted(uy)):t),()=>{f(e=>!l||!e.has(l)?e:(e.delete(l),new ry(e)))}},[l,g,f]),/* @__PURE__ */ t(h,{"data-radix-collection-item":``,ref:d,children:i})});g.displayName=m;function _(){return a.useState(new ry)}ey(_,`useInitCollection`);function v(t){let{itemMap:n}=s(e+`CollectionConsumer`,t);return n}return ey(v,`useCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:i,useCollection:v,useInitCollection:_}]}ey(sy,`createCollection`);function cy(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}ey(cy,`shallowEqual`);function ly(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ey(ly,`isElementPreceding`);function uy(e,t){return!e[1].element||!t[1].element?0:ly(e[1].element,t[1].element)?-1:1}ey(uy,`sortByDocumentPosition`);function dy(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ey(dy,`getChildListObserver`);var fy=Object.defineProperty,py=(e,t)=>fy(e,`name`,{value:t,configurable:!0}),my=!1;function hy(){let[e,t]=a.useState(my);return a.useEffect(()=>{my||(my=!0,t(!0))},[]),e}py(hy,`useIsHydrated`);var gy=a.useSyncExternalStore;function _y(){return()=>{}}py(_y,`subscribe`);function vy(){return gy(_y,()=>!0,()=>!1)}py(vy,`useIsHydratedModern`);var yy=typeof gy==`function`?vy:hy,by=Object.defineProperty,xy=(e,t)=>by(e,`name`,{value:t,configurable:!0}),Sy=`rovingFocusGroup.onEntryFocus`,Cy={bubbles:!1,cancelable:!0},wy=`RovingFocusGroup`,[Ty,Ey,Dy]=/* @__PURE__ */ ty(wy),[Oy,ky]=/* @__PURE__ */ kn(wy,[Dy]),[Ay,jy]=Oy(wy),My=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ xy(function(e,n){return/* @__PURE__ */ t(Ty.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ty.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ny,{...e,ref:n})})})},`RovingFocusGroup`)),Ny=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ xy(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=fe(s),[_,v]=Wr({prop:c,defaultProp:l??null,onChange:u,caller:wy}),[y,b]=a.useState(!1),x=tr(d),S=Ey(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Sy,x),()=>e.removeEventListener(Sy,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(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(Sy,Cy);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:V(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Py=`RovingFocusGroupItem`,Fy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ xy(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=H(),d=s||u,f=jy(Py,r),p=f.currentTabStopId===d,m=Ey(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=yy();return jn(()=>{if(v&&i)return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!v&&i)return h(),()=>g()},[v,i,h,g]),/* @__PURE__ */ t(Ty.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=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===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}xy(Ly,`getDirectionAwareKey`);function Ry(e,t,n){let r=Ly(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Iy[r]}xy(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}xy(zy,`focusFirst`);function By(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xy(By,`wrapArray`);var Vy=My,Hy=Fy,Uy=Object.defineProperty,X=(e,t)=>Uy(e,`name`,{value:t,configurable:!0}),Wy=[`Enter`,` `],Gy=[`ArrowDown`,`PageUp`,`Home`],Ky=[`ArrowUp`,`PageDown`,`End`],qy=[...Gy,...Ky],Jy={ltr:[...Wy,`ArrowRight`],rtl:[...Wy,`ArrowLeft`]},Yy={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Xy=`Menu`,[Zy,Qy,$y]=/* @__PURE__ */ ty(Xy),[eb,tb]=/* @__PURE__ */ kn(Xy,[$y,lr,ky]),nb=lr(),rb=ky(),[ib,ab]=eb(Xy),[ob,sb]=eb(Xy),cb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=nb(n),[u,d]=a.useState(null),f=a.useRef(!1),p=tr(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(Sr,{...l,children:/* @__PURE__ */ t(ib,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:/* @__PURE__ */ t(ob,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),lb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e,a=nb(r);return/* @__PURE__ */ t(Cr,{...a,...i,ref:n})},`MenuAnchor`)),ub=`MenuPortal`,[db,fb]=eb(ub,{forceMount:void 0}),pb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=ab(ub,n);return/* @__PURE__ */ t(db,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Ar,{present:r||o.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:a,children:i})})})},`MenuPortal`),mb=`MenuContent`,[hb,gb]=eb(mb),_b=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=fb(mb,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=ab(mb,e.__scopeMenu),s=sb(mb,e.__scopeMenu);return/* @__PURE__ */ t(Zy.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Ar,{present:i||o.open,children:/* @__PURE__ */ t(Zy.Slot,{scope:e.__scopeMenu,children:s.modal?/* @__PURE__ */ t(vb,{...a,ref:n}):/* @__PURE__ */ t(yb,{...a,ref:n})})})})},`MenuContent`)),vb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ab(mb,e.__scopeMenu),i=a.useRef(null),o=z(n,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(xb,{...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`)),yb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ab(mb,e.__scopeMenu);return/* @__PURE__ */ t(xb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),bb=/* @__PURE__ */ an(`MenuContent.ScrollLock`),xb=/* @__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=ab(mb,r),y=sb(mb,r),b=nb(r),x=rb(r),S=Qy(r),[C,w]=a.useState(null),T=a.useRef(null),E=z(n,T,v.onContentChange),D=a.useRef(0),O=a.useRef(``),k=a.useRef(0),A=a.useRef(null),j=a.useRef(`right`),N=a.useRef(0),P=g?ue:a.Fragment,ee=g?{as:bb,allowPinchZoom:!0}:void 0,te=/* @__PURE__ */ X(e=>{let t=O.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Qb(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(/* @__PURE__ */ X((function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`))(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);a.useEffect(()=>()=>window.clearTimeout(D.current),[]),le();let F=a.useCallback(e=>j.current===A.current?.side&&ex(e,A.current?.area),[]);return/* @__PURE__ */ t(hb,{scope:r,searchRef:O,onItemEnter:a.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:a.useCallback(e=>{F(e)||(T.current?.focus(),w(null))},[F]),onTriggerLeave:a.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:k,onPointerGraceIntentChange:a.useCallback(e=>{A.current=e},[]),children:/* @__PURE__ */ t(P,{...ee,children:/* @__PURE__ */ t(ce,{asChild:!0,trapped: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(Vy,{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(wr,{role:`menu`,"aria-orientation":`vertical`,"data-state":qb(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,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&&te(e.key));let i=T.current;if(e.target!==i||!qy.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Ky.includes(e.key)&&a.reverse(),Xb(a)}),onBlur:V(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:V(e.onPointerMove,tx(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;j.current=t,N.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),Sb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Cb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{...i,ref:n})},`MenuLabel`)),wb=`MenuItem`,Tb=`menu.itemSelect`,Eb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=sb(wb,e.__scopeMenu),l=gb(wb,e.__scopeMenu),u=z(n,s),d=a.useRef(!1),f=/* @__PURE__ */ X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(Tb,{bubbles:!0,cancelable:!0});e.addEventListener(Tb,e=>i?.(e),{once:!0}),Qn(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return/* @__PURE__ */ t(Db,{...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!==` `)&&Wy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Db=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=gb(wb,r),l=rb(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(Zy.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:/* @__PURE__ */ t(Hy,{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,tx(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,tx(e=>c.onItemLeave(e))),onFocus:V(e.onFocus,()=>p(!0)),onBlur:V(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Ob=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return/* @__PURE__ */ t(Fb,{scope:e.__scopeMenu,checked:r,children:/* @__PURE__ */ t(Eb,{role:`menuitemcheckbox`,"aria-checked":Jb(r)?`mixed`:r,...a,ref:n,"data-state":Yb(r),onSelect:V(a.onSelect,()=>i?.(Jb(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[kb,Ab]=eb(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ X(()=>{},`onValueChange`)}),jb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=tr(i);return/* @__PURE__ */ t(kb,{scope:e.__scopeMenu,value:r,onValueChange:o,children:/* @__PURE__ */ t(Sb,{...a,ref:n})})},`MenuRadioGroup`)),Mb=`MenuRadioItem`,Nb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,...i}=e,a=Ab(Mb,e.__scopeMenu),o=r===a.value;return/* @__PURE__ */ t(Fb,{scope:e.__scopeMenu,checked:o,children:/* @__PURE__ */ t(Eb,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":Yb(o),onSelect:V(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Pb=`MenuItemIndicator`,[Fb,Ib]=eb(Pb,{checked:!1}),Lb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=Ib(Pb,r);return/* @__PURE__ */ t(Ar,{present:i||Jb(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{...a,ref:n,"data-state":Yb(o.checked)})})},`MenuItemIndicator`)),Rb=/* @__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`)),zb=`MenuSub`,[Bb,Vb]=eb(zb),Hb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=ab(zb,n),c=nb(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=tr(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),/* @__PURE__ */ t(Sr,{...c,children:/* @__PURE__ */ t(ib,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:/* @__PURE__ */ t(Bb,{scope:n,contentId:H(),triggerId:H(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),Ub=`MenuSubTrigger`,Wb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ab(Ub,e.__scopeMenu),i=sb(Ub,e.__scopeMenu),o=Vb(Ub,e.__scopeMenu),s=gb(Ub,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(lb,{asChild:!0,...d,children:/* @__PURE__ */ t(Db,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":qb(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,tx(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,tx(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!==` `)&&Jy[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Gb=`MenuSubContent`,Kb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=fb(mb,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=ab(mb,e.__scopeMenu),l=sb(mb,e.__scopeMenu),u=Vb(Gb,e.__scopeMenu),d=a.useRef(null),f=z(n,d);return/* @__PURE__ */ t(Zy.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Ar,{present:i||c.open,children:/* @__PURE__ */ t(Zy.Slot,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(xb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:l.dir===`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=Yy[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function qb(e){return e?`open`:`closed`}X(qb,`getOpenState`);function Jb(e){return e===`indeterminate`}X(Jb,`isIndeterminate`);function Yb(e){return Jb(e)?`indeterminate`:e?`checked`:`unchecked`}X(Yb,`getCheckedState`);function Xb(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(Xb,`focusFirst`);function Zb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Zb,`wrapArray`);function Qb(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=Zb(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(Qb,`getNextMatch`);function $b(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($b,`isPointInPolygon`);function ex(e,t){return t?$b({x:e.clientX,y:e.clientY},t):!1}X(ex,`isPointerInGraceArea`);function tx(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(tx,`whenMouse`);var nx=cb,rx=lb,ix=pb,ax=_b,ox=Sb,sx=Cb,cx=Eb,lx=Ob,ux=jb,dx=Nb,fx=Lb,px=Rb,mx=Hb,hx=Wb,gx=Kb,_x=Object.defineProperty,vx=(e,t)=>_x(e,`name`,{value:t,configurable:!0}),yx=`DropdownMenu`,[bx,xx]=/* @__PURE__ */ kn(yx,[tb]),Sx=tb(),[Cx,wx]=bx(yx),Tx=/* @__PURE__ */ vx(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=Sx(n),d=a.useRef(null),[f,p]=Wr({prop:o,defaultProp:s??!1,onChange:c,caller:yx});return/* @__PURE__ */ t(Cx,{scope:n,triggerId:H(),triggerRef:d,contentId:H(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:/* @__PURE__ */ t(nx,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),Ex=`DropdownMenuTrigger`,Dx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=wx(Ex,r),s=Sx(r),c=z(n,o.triggerRef);return/* @__PURE__ */ t(rx,{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`)),Ox=/* @__PURE__ */ vx(e=>{let{__scopeDropdownMenu:n,...r}=e,i=Sx(n);return/* @__PURE__ */ t(ix,{...i,...r})},`DropdownMenuPortal`),kx=`DropdownMenuContent`,Ax=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=wx(kx,r),s=Sx(r),c=a.useRef(!1);return/* @__PURE__ */ t(ax,{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`)),jx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(ox,{...a,...i,ref:n})},`DropdownMenuGroup`)),Mx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(sx,{...a,...i,ref:n})},`DropdownMenuLabel`)),Nx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(cx,{...a,...i,ref:n})},`DropdownMenuItem`)),Px=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(lx,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),Fx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(ux,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),Ix=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(dx,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),Lx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(fx,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),Rx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(px,{...a,...i,ref:n})},`DropdownMenuSeparator`)),zx=/* @__PURE__ */ vx(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=Sx(n),[c,l]=Wr({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return/* @__PURE__ */ t(mx,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),Bx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(hx,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),Vx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(gx,{...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`)),Hx=Tx,Ux=Dx,Wx=Ox,Gx=Ax,Kx=jx,qx=Mx,Jx=Nx,Yx=Px,Xx=Fx,Zx=Ix,Qx=Lx,$x=Rx,eS=zx,tS=Bx,nS=Vx;const rS=a.createContext(!1);function iS({...e}){return t(Hx,{"data-slot":`dropdown-menu`,...e})}function aS({...e}){return t(Wx,{"data-slot":`dropdown-menu-portal`,...e})}function oS({...e}){return t(Ux,{"data-slot":`dropdown-menu-trigger`,...e})}function sS({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(Wx,{children:t(Gx,{"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 cS({...e}){return t(Kx,{"data-slot":`dropdown-menu-group`,...e})}function lS({className:e,inset:n,variant:r=`default`,...i}){return t(Jx,{"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 uS({className:e,children:r,checked:i,inset:a,...o}){return n(Yx,{"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(Qx,{children:t(L,{})})}),r]})}function dS({...e}){return t(Xx,{"data-slot":`dropdown-menu-radio-group`,...e})}function fS({className:e,children:r,inset:i,...a}){return n(Zx,{"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(Qx,{children:t(L,{})})}),r]})}function pS({className:e,inset:n,...r}){return t(qx,{"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 mS({className:e,...n}){return t($x,{"data-slot":`dropdown-menu-separator`,className:B(`bg-border -mx-1 my-1 h-px`,e),...n})}function hS({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 gS({...e}){return t(eS,{"data-slot":`dropdown-menu-sub`,...e})}function _S({className:e,inset:r,children:i,...a}){return n(tS,{"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(Ve,{className:`cn-rtl-flip ms-auto`})]})}function vS({className:e,...n}){return t(nS,{"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 yS={left:`start`,center:`center`,right:`end`};function bS({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(rS.Provider,{value:!0,children:r})})})]}):n(iS,{children:[t(oS,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(sS,{align:yS[i],className:`w-max`,children:r})]})}function xS({children:e,label:r}){return n(cS,{children:[r&&t(pS,{children:r}),e]})}function SS({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(rS),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(lS,{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 CS=({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})})},wS=(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);(TS(i,a)||!r)&&Object.defineProperty(e,n,a)},TS=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)},ES=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},DS=(e,t)=>`/* Wrapped ${e}*/\n${t}`,OS=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),kS=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),AS=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=DS.bind(null,r,t.toString());Object.defineProperty(i,"name",kS);let{writable:a,enumerable:o,configurable:s}=OS;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function jS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))wS(e,t,r,n);return ES(e,t),AS(e,t,r),e}const MS=2147483647,NS=/* @__PURE__ */ new WeakMap,PS=/* @__PURE__ */ new WeakMap,FS=/* @__PURE__ */ new WeakMap;function IS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now()){e.delete(t);return}return n}}function LS(e,{cacheKey:t,cache:n=/* @__PURE__ */ new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>MS)throw TypeError(`The \`maxAge\` option cannot exceed ${MS}.`);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=IS(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>MS)throw TypeError(`The \`maxAge\` function result cannot exceed ${MS}.`)}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),PS.get(i)?.delete(e)},l);e.unref?.();let t=PS.get(i)??/* @__PURE__ */ new Set;t.add(e),PS.set(i,t)}return c};return jS(i,e,{ignoreNonConfigurable:!0}),NS.set(i,n),FS.set(i,t??(e=>e[0])),i}function RS(e){return typeof e==`string`}function zS(e,t,n){return n.indexOf(e)===t}function BS(e){return e.toLowerCase()===e}function VS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function HS(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 HS(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return HS(n)}if(e.indexOf(`-`)===-1||!BS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function US(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(VS(d))}var f=navigator.language,p=f&&VS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(RS).map(HS).filter(zS)}var WS=LS(US,{cacheKey:JSON.stringify});function GS(e){return WS(e)[0]||null}var KS=LS(GS,{cacheKey:JSON.stringify});const qS=/* @__PURE__ */ new Map;function JS(e){return function(t,n){let r=t||KS();qS.has(r)||qS.set(r,/* @__PURE__ */ new Map);let i=qS.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 YS(e){let t=new Date(e);return new Date(t.setHours(12))}function XS(e){return(t,n)=>JS(e)(t,YS(n))}const ZS={day:`numeric`},QS={day:`numeric`,month:`long`,year:`numeric`},$S={month:`long`},eC={month:`long`,year:`numeric`},tC={weekday:`short`},nC={weekday:`long`},rC={year:`numeric`},iC=XS(ZS),aC=XS(QS),oC=XS($S),sC=XS(eC),cC=XS(tC),lC=XS(nC),uC=XS(rC);function dC(e,t,n){return function(r,i=n){return t(e(r)+i)}}function fC(e){return function(t){return/* @__PURE__ */ new Date(e(t).getTime()-1)}}function pC(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 mC(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function hC(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function gC(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 _C=dC(Z,gC,-100),vC=dC(Z,gC,100),yC=fC(vC),bC=dC(Z,yC,-100),xC=pC(gC,yC);function SC(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 CC=dC(Z,SC,-10),wC=dC(Z,SC,10),TC=fC(wC),EC=dC(Z,TC,-10),DC=pC(SC,TC);function OC(e){let t=Z(e),n=/* @__PURE__ */ new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const kC=dC(Z,OC,-1),AC=dC(Z,OC,1),jC=fC(AC),MC=dC(Z,jC,-1),NC=pC(OC,jC);function PC(e,t){return function(n,r=t){let i=Z(n),a=mC(n)+r,o=/* @__PURE__ */ new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function FC(e){let t=Z(e),n=mC(e),r=/* @__PURE__ */ new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const IC=PC(FC,-1),LC=PC(FC,1),RC=fC(LC),zC=PC(RC,-1),BC=pC(FC,RC);function VC(e,t){return function(n,r=t){let i=Z(n),a=mC(n),o=hC(n)+r,s=/* @__PURE__ */ new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function HC(e){let t=Z(e),n=mC(e),r=hC(e),i=/* @__PURE__ */ new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const UC=fC(VC(HC,1)),WC=pC(HC,UC);function GC(e){return hC(RC(e))}const KC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},qC={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`]},JC=[0,1,2,3,4,5,6],YC=JC[0],XC=JC[5],ZC=JC[6];function QC(e,t=KC.ISO_8601){let n=e.getDay();switch(t){case KC.ISO_8601:return(n+6)%7;case KC.ISLAMIC:return(n+1)%7;case KC.HEBREW:case KC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function $C(e){return Z(gC(e))}function ew(e){return Z(SC(e))}function tw(e,t=KC.ISO_8601){let n=Z(e),r=mC(e),i=e.getDate()-QC(e,t);return new Date(n,r,i)}function nw(e,t=KC.ISO_8601){let n=t===KC.GREGORY?KC.GREGORY:KC.ISO_8601,r=tw(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===KC.ISO_8601?4:1),o=tw(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function rw(e,t){switch(e){case`century`:return gC(t);case`decade`:return SC(t);case`year`:return OC(t);case`month`:return FC(t);case`day`:return HC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function iw(e,t){switch(e){case`century`:return _C(t);case`decade`:return CC(t);case`year`:return kC(t);case`month`:return IC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function aw(e,t){switch(e){case`century`:return vC(t);case`decade`:return wC(t);case`year`:return AC(t);case`month`:return LC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function ow(e,t){switch(e){case`decade`:return CC(t,-100);case`year`:return kC(t,-10);case`month`:return IC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function sw(e,t){switch(e){case`decade`:return wC(t,100);case`year`:return AC(t,10);case`month`:return LC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function cw(e,t){switch(e){case`century`:return yC(t);case`decade`:return TC(t);case`year`:return jC(t);case`month`:return RC(t);case`day`:return UC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function lw(e,t){switch(e){case`century`:return bC(t);case`decade`:return EC(t);case`year`:return MC(t);case`month`:return zC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function uw(e,t){switch(e){case`decade`:return EC(t,-100);case`year`:return MC(t,-10);case`month`:return zC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function dw(e,t){switch(e){case`century`:return xC(t);case`decade`:return DC(t);case`year`:return NC(t);case`month`:return BC(t);case`day`:return WC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function fw(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[rw(e,r[0]),cw(e,r[1])]}function pw(e,t,n){return n.map(n=>(t||uC)(e,n)).join(` – `)}function mw(e,t,n){return pw(e,t,xC(n))}function hw(e,t,n){return pw(e,t,DC(n))}function gw(e){return e.getDay()===(/* @__PURE__ */ new Date()).getDay()}function _w(e,t=KC.ISO_8601){let n=e.getDay();switch(t){case KC.ISLAMIC:case KC.HEBREW:return n===XC||n===ZC;case KC.ISO_8601:case KC.GREGORY:return n===ZC||n===YC;default:throw Error(`Unsupported calendar type.`)}}const vw=`react-calendar__navigation`;function yw({activeStartDate:r,drillUp:i,formatMonthYear:a=sC,formatYear:o=uC,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=iw(C,r),O=E?ow(C,r):void 0,k=aw(C,r),A=E?sw(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=lw(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=uw(C,r);return l&&l>=e})(),N=c&&c<k,P=E&&c&&c<A;function ee(){x(D,`prev`)}function te(){x(O,`prev2`)}function F(){x(k,`next`)}function ne(){x(A,`next2`)}function re(e){let t=(()=>{switch(C){case`century`:return mw(s,o,e);case`decade`:return hw(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||KS()||void 0,view:C}):t}function ie(){let a=`${vw}__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:re(r)}),S?n(e,{children:[t(`span`,{className:`${a}__divider`,children:` – `}),t(`span`,{className:`${a}__labelText ${a}__labelText--to`,children:re(k)})]}):null]})}return n(`div`,{className:vw,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${vw}__arrow ${vw}__prev2-button`,disabled:M,onClick:te,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${vw}__arrow ${vw}__prev-button`,disabled:j,onClick:ee,type:`button`,children:b}),ie(),g!==null&&t(`button`,{"aria-label":h,className:`${vw}__arrow ${vw}__next-button`,disabled:N,onClick:F,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${vw}__arrow ${vw}__next2-button`,disabled:P,onClick:ne,type:`button`,children:m}):null]})}function bw(e){return`${e}%`}function xw({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?bw(100*a/r):null;return u(e,{...e.props,style:{flexBasis:bw(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function Sw(e,t,n){return t&&t>e?t:n&&n<e?n:e}function Cw(e,t){return t[0]<=e&&t[1]>=e}function ww(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function Tw(e,t){return Cw(e[0],t)||Cw(e[1],t)}function Ew(e,t,n){let r=Tw(t,e),i=[];if(r){i.push(n);let r=Cw(e[0],t),a=Cw(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 Ow(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 dw(t,n)})();if(Cw(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 dw(n,t)})();ww(c,s)?a.push(`${i}--active`):Tw(c,s)&&a.push(`${i}--hasActive`);let l=Ew(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=Ew(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function kw({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:Ow({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(xw,{className:e,count:n,offset:s,wrap:!0,children:p})}function Aw(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 jw=`react-calendar__century-view__decades__decade`;function Mw({classes:e=[],currentCentury:n,formatYear:r=uC,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(jw),gC(a).getFullYear()!==n&&s.push(`${jw}--neighboringCentury`),t(Aw,{...i,classes:s,maxDateTransform:TC,minDateTransform:SC,view:`century`,children:hw(o,r,a)})}function Nw(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=$C(n),l=c+(i?119:99);return t(kw,{className:`react-calendar__century-view__decades`,dateTransform:SC,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(Mw,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function Pw(e){function n(){return t(Nw,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const Fw=`react-calendar__decade-view__years__year`;function Iw({classes:e=[],currentDecade:n,formatYear:r=uC,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(Fw),SC(a).getFullYear()!==n&&s.push(`${Fw}--neighboringDecade`),t(Aw,{...i,classes:s,maxDateTransform:jC,minDateTransform:OC,view:`decade`,children:r(o,a)})}function Lw(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=ew(n),l=c+(i?11:9);return t(kw,{className:`react-calendar__decade-view__years`,dateTransform:OC,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(Iw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function Rw(e){function n(){return t(Lw,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const zw=`react-calendar__month-view__days__day`;function Bw({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=iC,formatLongDate:a=aC,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(zw),_w(s,e)&&l.push(`${zw}--weekend`),s.getMonth()!==r&&l.push(`${zw}--neighboringMonth`),t(Aw,{...o,classes:l,formatAbbr:a,maxDateTransform:UC,minDateTransform:HC,view:`month`,children:i(c,s)})}function Vw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=mC(n),f=a||o,p=QC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=GC(n);if(o){let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-QC(t,r)-1)}return e})();return t(kw,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),HC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(Bw,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const Hw=`react-calendar__month-view__weekdays`,Uw=`${Hw}__weekday`;function Ww(e){let{calendarType:n,formatShortWeekday:i=cC,formatWeekday:a=lC,locale:o,onMouseLeave:s}=e,c=FC(/* @__PURE__ */ new Date),l=Z(c),u=mC(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-QC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(Uw,gw(s)&&`${Uw}--current`,_w(s,n)&&`${Uw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(xw,{className:Hw,count:7,onFocus:s,onMouseOver:s,children:d})}const Gw=`react-calendar__tile`;function Kw(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:Gw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:Gw,children:i})}}function qw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=GC(n)-(7-QC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=mC(n),i=hC(n),a=[];for(let n=0;n<s;n+=1)a.push(tw(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>nw(e,r));return t(xw,{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(Kw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function Jw(e){if(e){for(let[t,n]of Object.entries(qC))if(n.includes(e))return t}return KC.ISO_8601}function Yw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=Jw(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(Ww,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(qw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(Vw,{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 Xw({classes:e=[],formatMonth:n=oC,formatMonthYear:r=sC,...i}){let{date:a,locale:o}=i;return t(Aw,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:RC,minDateTransform:FC,view:`year`,children:n(o,a)})}function Zw(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(kw,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(s,e,1),FC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(Xw,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function Qw(e){function n(){return t(Zw,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const $w=`react-calendar`,eT=[`century`,`decade`,`year`,`month`],tT=[`decade`,`year`,`month`,`day`],nT=/* @__PURE__ */ new Date;nT.setFullYear(1,0,1),nT.setHours(0,0,0,0);const rT=/* @__PURE__ */ new Date(864e13);function iT(e){return e instanceof Date?e:new Date(e)}function aT(e,t){return eT.slice(eT.indexOf(e),eT.indexOf(t)+1)}function oT(e,t,n){return aT(t,n).indexOf(e)!==-1}function sT(e,t,n){return e&&oT(e,t,n)?e:n}function cT(e){let t=eT.indexOf(e);return tT[t]}function lT(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=iT(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function uT({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=lT(e,i);if(!a)return null;let o=cT(r);return Sw((()=>{switch(i){case 0:return rw(o,a);case 1:return cw(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const dT=e=>uT(e,0),fT=e=>uT(e,1),pT=e=>[dT,fT].map(t=>t(e));function mT({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return rw(sT(a,r,t),dT({value:i,minDate:n,maxDate:e,maxDetail:t})||/* @__PURE__ */ new Date)}function hT({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=sT(l,s,a),d=e||t;return d?rw(u,d):mT({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function gT(e){return e&&(!Array.isArray(e)||e.length===1)}function _T(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var vT=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=rT,maxDetail:D=`month`,minDate:O=nT,minDetail:k=`century`,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:ee,nextLabel:te,onActiveStartDateChange:F,onChange:ne,onClickDay:re,onClickDecade:ie,onClickMonth:ae,onClickWeekNumber:oe,onClickYear:se,onDrillDown:ce,onDrillUp:le,onViewChange:ue,prev2AriaLabel:de,prev2Label:fe,prevAriaLabel:pe,prevLabel:me,returnValue:he=`start`,selectRange:ge,showDoubleView:_e,showFixedNumberOfWeeks:ve,showNavigation:ye=!0,showNeighboringCentury:be,showNeighboringDecade:xe,showNeighboringMonth:Se=!0,showWeekNumbers:Ce,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:De,view:Oe}=e,[ke,Ae]=w(u),[je,Me]=w(null),[Ne,Pe]=w(Array.isArray(d)?d.map(e=>e===null?null:iT(e)):d==null?null:iT(d)),[Fe,I]=w(f),Ie=a||ke||hT({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:De,view:Oe}),L=(()=>{let e=ge&&gT(Ne)||De===void 0?Ne:De;return e?Array.isArray(e)?e.map(e=>e===null?null:iT(e)):e===null?null:iT(e):null})(),Le=cT(D),R=sT(Oe||Fe,k,D),Re=aT(k,D),ze=ge?je:null,Be=Re.indexOf(R)<Re.length-1,Ve=Re.indexOf(R)>0,He=h(e=>(()=>{switch(he){case`start`:return dT;case`end`:return fT;case`range`:return pT;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,he]),Ue=h((e,t)=>{Ae(e);let n={action:t,activeStartDate:e,value:L,view:R};F&&!_T(Ie,e)&&F(n)},[Ie,F,L,R]),We=h((e,t)=>{let n=(()=>{switch(R){case`century`:return ie;case`decade`:return se;case`year`:return ae;case`month`:return re;default:throw Error(`Invalid view: ${R}.`)}})();n&&n(e,t)},[re,ie,ae,se,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.`);Ae(e),I(n);let r={action:`drillDown`,activeStartDate:e,value:L,view:n};F&&!_T(Ie,e)&&F(r),ue&&R!==n&&ue(r),ce&&ce(r)},[Ie,Be,F,We,ce,ue,L,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=rw(e,Ie);Ae(t),I(e);let n={action:`drillUp`,activeStartDate:t,value:L,view:e};F&&!_T(Ie,t)&&F(n),ue&&R!==e&&ue(n),le&&le(n)},[Ie,Ve,F,le,ue,L,R,Re]),qe=h((e,t)=>{let n=L;We(e,t);let r=ge&&!gT(n),i;if(ge){if(r)i=rw(Le,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=fw(Le,n,e)}}else i=He(e);let a=!ge||r||S?mT({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:R}):null;t.persist(),Ae(a),Pe(i);let s={action:`onChange`,activeStartDate:a,value:i,view:R};if(F&&!_T(Ie,a)&&F(s),ne){if(ge){if(!gT(i))ne(i||null,t);else if(o){if(Array.isArray(i))throw Error(`value must not be an array`);ne([i||null,null],t)}}else ne(i||null,t)}},[Ie,o,He,S,E,D,O,k,F,ne,We,ge,L,Le,R]);function Je(e){Me(e)}function Ye(){Me(null)}y(i,()=>({activeStartDate:Ie,drillDown:Ge,drillUp:Ke,onChange:qe,setActiveStartDate:Ue,value:L,view:R}),[Ie,Ge,Ke,qe,Ue,L,R]);function Xe(e){let n={activeStartDate:e?aw(R,Ie):rw(R,Ie),hover:ze,locale:T,maxDate:E,minDate:O,onClick:Be?Ge:qe,onMouseOver:ge?Je:void 0,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:L,valueType:Le};switch(R){case`century`:return t(Pw,{formatYear:x,showNeighboringCentury:be,...n});case`decade`:return t(Rw,{formatYear:x,showNeighboringDecade:xe,...n});case`year`:return t(Qw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(Yw,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:oe,onMouseLeave:ge?Ye:void 0,showFixedNumberOfWeeks:ve===void 0?_e:ve,showNeighboringMonth:Se,showWeekNumbers:Ce,...n});default:throw Error(`Invalid view: ${R}.`)}}function Ze(){return ye?t(yw,{activeStartDate:Ie,drillUp:Ke,formatMonthYear:_,formatYear:x,locale:T,maxDate:E,minDate:O,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:ee,nextLabel:te,prev2AriaLabel:de,prev2Label:fe,prevAriaLabel:pe,prevLabel:me,setActiveStartDate:Ue,showDoubleView:_e,view:R,views:Re}):null}return n(`div`,{className:r($w,ge&&(Array.isArray(L)?L:[L]).length===1&&`${$w}--selectRange`,_e&&`${$w}--doubleView`,c),"data-testid":l,ref:C,children:[Ze(),n(`div`,{className:`${$w}__viewContainer`,onBlur:ge?Ye:void 0,onMouseLeave:ge?Ye:void 0,children:[Xe(),_e?Xe(!0):null]})]})});pe.extend(he),pe.extend(me);var Q=pe,yT=Object.defineProperty,bT=(e,t)=>yT(e,`name`,{value:t,configurable:!0}),xT=`Popover`,[ST,CT]=/* @__PURE__ */ kn(xT,[lr]),wT=lr(),[TT,ET]=ST(xT),DT=/* @__PURE__ */ bT(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=wT(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=Wr({prop:i,defaultProp:o??!1,onChange:s,caller:xT});return/* @__PURE__ */ t(Sr,{...l,children:/* @__PURE__ */ t(TT,{scope:n,contentId:H(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:a.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:c,children:r})})},`Popover`),OT=`PopoverAnchor`,kT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let{__scopePopover:r,...i}=e,o=ET(OT,r),s=wT(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),/* @__PURE__ */ t(Cr,{...s,...i,ref:n})},`PopoverAnchor`)),AT=`PopoverTrigger`,jT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let{__scopePopover:r,...i}=e,a=ET(AT,r),o=wT(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":WT(a.open),...i,ref:s,onClick:V(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:/* @__PURE__ */ t(Cr,{asChild:!0,...o,children:c})},`PopoverTrigger`)),MT=`PopoverPortal`,[NT,PT]=ST(MT,{forceMount:void 0}),FT=/* @__PURE__ */ bT(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=ET(MT,n);return/* @__PURE__ */ t(NT,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Ar,{present:r||o.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),IT=`PopoverContent`,LT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let r=PT(IT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=ET(IT,e.__scopePopover);return/* @__PURE__ */ t(Ar,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(zT,{...a,ref:n}):/* @__PURE__ */ t(BT,{...a,ref:n})})},`PopoverContent`)),RT=/* @__PURE__ */ an(`PopoverContent.RemoveScroll`),zT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let r=ET(IT,e.__scopePopover),i=a.useRef(null),o=z(n,i),s=a.useRef(!1);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(ue,{as:RT,allowPinchZoom:!0,children:/* @__PURE__ */ t(VT,{...e,ref:o,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`)),BT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let r=ET(IT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(VT,{...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`)),VT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=ET(IT,r),m=wT(r);return le(),/* @__PURE__ */ t(ce,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ t(wr,{"data-state":WT(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:n,style:{...f.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`)),HT=`PopoverClose`,UT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let{__scopePopover:r,...i}=e,a=ET(HT,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function WT(e){return e?`open`:`closed`}bT(WT,`getState`);var GT=DT,KT=kT,qT=jT,JT=FT,YT=LT,XT=UT;const ZT=a.createContext(null),QT=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(ZT.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(GT,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function $T(e=!1,t=()=>{},n){e&&t(n===`enter`)}const eE=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(ZT);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(qT,{ref:r,asChild:!0,onMouseEnter:()=>$T(s,o,`enter`),onMouseLeave:()=>$T(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});eE.displayName=qT.displayName;const tE=KT,nE=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(ZT);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=zi();return t(JT,{container:u,children:t(YT,{ref:o,align:n,side:r,onMouseEnter:()=>$T(l,c,`enter`),onMouseLeave:()=>$T(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})})});nE.displayName=YT.displayName;const rE=XT;rE.displayName=XT.displayName;function iE(){let e=a.useContext(ZT);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const aE=`
247
247
  .calendar-wrapper .react-calendar__navigation {
248
248
  display: flex !important;
249
249
  justify-content: space-between !important;
@@ -329,12 +329,12 @@ function fy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ kn(n),[o,s]=r(
329
329
  text-align: center !important;
330
330
  }
331
331
 
332
- `,dE=({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(rE,{_open:o,onOpenChange:s,children:[t(aE,{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(sE,{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:uE}),t(CT,{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:uE}),t(CT,{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 fE({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=w(i||n),[s,c]=w(!1);return _(()=>{if(!r){o(i||n);return}(async()=>{c(!0);try{let e=r(n);if(e instanceof Promise){let t=await e;o(t)}else o(e)}catch(e){console.error(`Error rendering label:`,e),o(i||n)}finally{c(!1)}})()},[n,r,i]),s?t(`span`,{className:`text-muted`,children:`Loading...`}):t(e,{children:a})}const pE=({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(rE,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(aE,{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(fE,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(sE,{className:`w-[300px] p-0`,children:t(OS,{children:n(Yv,{children:[t(Zv,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(Qv,{children:[t($v,{children:m(`filter.noResultsFound`)}),t(ey,{children:i.map(e=>n(ny,{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(fE,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(ty,{}),t(ey,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(ny,{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(Vg,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(fE,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},mE=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(rE,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(aE,{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(sE,{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(ga,{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`})]})]})})]})},hE=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`}}),gE=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(hE({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
332
+ `,oE=({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(QT,{_open:o,onOpenChange:s,children:[t(eE,{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(nE,{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:aE}),t(vT,{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:aE}),t(vT,{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 sE({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=w(i||n),[s,c]=w(!1);return _(()=>{if(!r){o(i||n);return}(async()=>{c(!0);try{let e=r(n);if(e instanceof Promise){let t=await e;o(t)}else o(e)}catch(e){console.error(`Error rendering label:`,e),o(i||n)}finally{c(!1)}})()},[n,r,i]),s?t(`span`,{className:`text-muted`,children:`Loading...`}):t(e,{children:a})}const cE=({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(QT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(eE,{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(sE,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(nE,{className:`w-[300px] p-0`,children:t(CS,{children:n(Wv,{children:[t(Kv,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(qv,{children:[t(Jv,{children:m(`filter.noResultsFound`)}),t(Yv,{children:i.map(e=>n(Zv,{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(sE,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(Xv,{}),t(Yv,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(Zv,{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(Ig,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(sE,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},lE=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(QT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(eE,{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(nE,{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(ga,{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`})]})]})})]})},uE=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`}}),dE=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(uE({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(xt,{size:16})})]})});gE.displayName=`Input`;const _E=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(rE,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(aE,{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(sE,{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(gE,{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 vE({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:uE}),t(CT,{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:uE}),t(CT,{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 yE({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(ny,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(fE,{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 bE({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(ga,{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 xE({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(gE,{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 SE(e,n,r){switch(e.type){case`date`:return t(dE,{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(_E,{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(mE,{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(pE,{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 CE({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}),SE(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(xt,{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 wE=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),TE=({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(kE(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(kE(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(wE.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},EE=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(wE),{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=>kE(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($v,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(ny,{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(rE,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(aE,{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(rt,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(sE,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(Yv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(Zv,{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(Qv,{children:t(ey,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(vE,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(xE,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(bE,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(yE,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},DE=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(wE);return t(`div`,{className:B(e),children:t(CE,{filters:n,setFilters:r,filterGroups:i})})},OE=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(wE),{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 kE(e){return typeof e==`string`?e:e.value||``}var AE;(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`})(AE||={});const jE=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})});jE.displayName=`Heading`;function ME({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":ee,"aria-invalid":te}){let F=C(null),[ne,re]=w(!1),[ie,ae]=w(0),[oe,se]=w(``),ce=v(),le=v(),ue=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?NE(e,T)===NE(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ae(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let de=e=>{if(x){let t=Array.isArray(s)?s:[];fe(e,t)?c(t.filter(t=>!pe(t,e))):c([...t,e])}else c(e)},fe=(e,t)=>!t||t.length===0?!1:t.some(t=>pe(t,e)),pe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?NE(e,T)===NE(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(NE(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let _e=oe.toLowerCase(),ve=he(f);me=me.filter(e=>ve(e).includes(_e));let ye=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},be=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},xe=(e,r)=>{let i=x?fe(e,Array.isArray(s)?s:[]):s!=null&&pe(s,e);return t(ny,{onSelect:()=>de(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(L,{className:`size-4`})]}):n(cE,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(L,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=/* @__PURE__ */ new Map;for(let n of me){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Ce=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1 shrink-0`,children:[t(`div`,{className:`mx-2`,children:t(pt,{className:`size-4`})}),t(gE,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(Yv,{className:E?`min-h-0 flex-1`:`overflow-hidden`,children:n(Qv,{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($v,{children:`No result found.`}),Se?Se.map(e=>t(ey,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>xe(t,`${e.key}-${n}`))},e.key)):t(ey,{children:me?.map((e,t)=>xe(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-muted bg-transparent border-0`),children:[t(ht,{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(at,{className:`size-4 animate-spin`})}):Ce()});let we=!!p,Te=M??(we?void 0:typeof m==`string`?m:void 0),Ee=N??(we?le:void 0),De=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Oe=te===!0||te===`true`||ue?!0:te===!1||te===`false`?!1:void 0;return n(rE,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(aE,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":ne,"aria-controls":ce,"aria-label":Te,"aria-labelledby":Ee,"aria-describedby":ee,"aria-invalid":Oe,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(ue||Oe?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,De&&`pe-10`)),children:D?t(at,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:le,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,ue&&`text-destructive`),children:[ue&&t(Wi,{description:k,placement:`top`,asChild:!0,children:t(yt,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Ue,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!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(xt,{className:`size-4`})})]}),t(sE,{id:ce,style:{width:`${ie}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Ce()})]})}function NE(e,t){return typeof e==`object`&&e?e[t]:void 0}const PE={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 FE({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(ME,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>PE[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var IE=Object.defineProperty,LE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>IE(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 RE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),zE=a.forwardRef(({className:e,required:r,...i},a)=>n(LE,{ref:a,className:B(RE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));zE.displayName=LE.displayName;function BE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(qe,{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(yt,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Ge,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(tt,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(tt,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(tt,{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 VE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(BE,{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 HE({title:e,className:n,children:r}){return t(BE,{status:`info`,title:e,className:n,children:r})}function UE({title:e,className:n,children:r}){return t(BE,{status:`warning`,title:e,className:n,children:r})}function WE({title:e,className:n,children:r}){return t(BE,{status:`success`,title:e,className:n,children:r})}function GE({title:e,className:n,children:r}){return t(BE,{status:`default`,title:e,className:n,children:r})}function KE({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(Lv,{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(yt,{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(Rv,{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(la,{label:l??u,children:t(gE,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(Bv,{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 qE(){return g(JE)}const JE=d(()=>{}),YE={success:Ge,error:qe,warning:yt,info:tt},XE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function ZE({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=YE[e.status]||tt,u=XE[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(um,{onExitComplete:r,children:i&&t(ng.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(xt,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function QE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(JE.Provider,{value:o,children:r}),i&&t(sg,{children:t(ZE,{data:i,onClose:()=>o(null)})})]})}function $E({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=qE();return t(KE,{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 eD=4,tD={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 nD(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 rD({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(lS,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(dS,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(R,{className:`ms-1 size-4`})]})}),t(fS,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function iD({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=tD[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=nD(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(R,{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(rD,{label:h,triggerClassName:B(c.base,m?c.active:c.inactive),icon:t(R,{className:c.icon}),children:p.map(e=>t(mS,{disabled:e.disabled,onClick:()=>i(e.name),className:B(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function aD({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?R:Ve,{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(oa,{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 oD=Object.defineProperty,sD=(e,t)=>oD(e,`name`,{value:t,configurable:!0}),cD=`Radio`,[lD,uD]=/* @__PURE__ */ kn(cD),[dD,fD]=lD(cD);function pD(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),_=a.useRef(!1),[v,y]=a.useReducer(e=>e+1,0),b={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:/* @__PURE__ */ sD(()=>l?.(),`onCheck`)};return/* @__PURE__ */ t(dD,{scope:n,...b,children:bD(f)?f(b):i})}sD(pD,`RadioProvider`);var mD=`RadioTrigger`,hD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ sD(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,hasConsumerStoppedPropagationRef:u,onUserInteraction:d,isFormControl:f,bubbleInput:p}=fD(mD,e),m=z(i,c);return/* @__PURE__ */ t(U.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":xD(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:V(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),gD=`RadioIndicator`,_D=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ sD(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=fD(gD,r);return/* @__PURE__ */ t(Ar,{present:i||o.checked,children:/* @__PURE__ */ t(U.span,{"data-state":xD(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),vD=`RadioBubbleInput`,yD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ sD(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=fD(vD,e),_=z(i,m),v=ir(o),y=a.useRef(!1),b=a.useRef(s),x=a.useRef(g);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==s;b.current=s;let a=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[p,s,h,g]);let S=a.useRef(s);return/* @__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:_,onClick:V(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function bD(e){return typeof e==`function`}sD(bD,`isFunction`);function xD(e){return e?`checked`:`unchecked`}sD(xD,`getState`);var SD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],CD=`RadioGroup`,[wD,TD]=/* @__PURE__ */ kn(CD,[Py,uD]),ED=Py(),DD=uD(),[OD,kD]=wD(CD),AD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ sD(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),_=fe(f),[v,y]=Wr({prop:c,defaultProp:s??null,onChange:m,caller:CD}),[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__ */ sD(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),/* @__PURE__ */ t(OD,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:/* @__PURE__ */ t(Ky,{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`)),jD=`RadioGroupItemProvider`,MD=`RadioGroupItemTrigger`;function ND(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=kD(jD,n),c=DD(n),l=s.disabled||i;return/* @__PURE__ */ t(pD,{...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})}sD(ND,`RadioGroupItemProvider`);var PD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ sD(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=ED(r),s=DD(r),{checked:c,disabled:l}=fD(MD,s.__scopeRadio),u=a.useRef(null),d=z(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=/* @__PURE__ */ sD(e=>{SD.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ sD(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ t(qy,{asChild:!0,...o,focusable:!l,active:c,children:/* @__PURE__ */ t(hD,{...s,...i,ref:d,onKeyDown:V(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:V(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),FD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ sD(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return/* @__PURE__ */ t(ND,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(PD,{...c,ref:i,__scopeRadioGroup:a}),r&&/* @__PURE__ */ t(ID,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),ID=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ sD(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=DD(r);return/* @__PURE__ */ t(yD,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),LD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ sD(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=DD(r);return/* @__PURE__ */ t(_D,{...a,...i,ref:n})},`RadioGroupIndicator`));function RD({className:e,...n}){return t(FD,{"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(LD,{"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 zD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function BD({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(AD,{"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(FD,{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 VD({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:B(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function HD(e){return typeof e==`number`?`${e}%`:e}function UD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:HD(e),minSize:HD(n),maxSize:HD(r),collapsedSize:HD(i),...a})}function WD({withHandle:e,className:n,...r}){return t(_e.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(st,{className:`size-4 rotate-90`})})})}var GD=Object.defineProperty,KD=(e,t)=>GD(e,`name`,{value:t,configurable:!0}),qD=`horizontal`,JD=[`horizontal`,`vertical`],YD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ KD(function(e,n){let{decorative:r,orientation:i=qD,...a}=e,o=XD(i)?i:qD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return/* @__PURE__ */ t(U.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function XD(e){return JD.includes(e)}KD(XD,`isValidOrientation`);var ZD=YD;const QD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(ZD,{ref:a,decorative:r,orientation:n,className:B(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));QD.displayName=ZD.displayName;var $D=Object.defineProperty,eO=(e,t)=>$D(e,`name`,{value:t,configurable:!0});function tO(e,[t,n]){return Math.min(n,Math.max(t,e))}eO(tO,`clamp`);var nO=Object.defineProperty,rO=(e,t)=>nO(e,`name`,{value:t,configurable:!0});function iO(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}rO(iO,`usePrevious`);var aO=Object.defineProperty,$=(e,t)=>aO(e,`name`,{value:t,configurable:!0}),oO=[`PageUp`,`PageDown`],sO=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],cO={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},lO=`Slider`,[uO,dO,fO]=/* @__PURE__ */ oy(lO),[pO,mO]=/* @__PURE__ */ kn(lO,[fO]),[hO,gO]=pO(lO),_O=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[i],value:f,onValueChange:p=/* @__PURE__ */ $(()=>{},`onValueChange`),onValueCommit:m=/* @__PURE__ */ $(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(/* @__PURE__ */ new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?bO:xO,[S,C]=a.useState(null),w=z(n,C),[T=[],E]=Wr({prop:f,defaultProp:d,onChange:/* @__PURE__ */ $(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),D=a.useRef(T),O=a.useRef(T);a.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ $(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,zO(T,e))}$(k,`handleSlideStart`);function A(e){M(e,y.current)}$(A,`handleSlideMove`);function j(){String(T)!==String(D.current)&&m(T)}$(j,`handleSlideEnd`);function M(e,t,{commit:n}={commit:!1}){let r=WO(s),a=tO(GO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=IO(e,a,t);if(HO(r,u*s)){y.current=r.indexOf(a);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return $(M,`updateValues`),/* @__PURE__ */ t(hO,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:/* @__PURE__ */ t(uO.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(uO.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:V(_.onPointerDown,()=>{l||(D.current=T,b.current=!1)}),min:i,max:o,inverted:h,onSlideStart:l?void 0:k,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:j,onHomeKeyDown:()=>{l||(b.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,M(o,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){b.current=!0;let n=oO.includes(e.key)||e.shiftKey&&sO.includes(e.key)?10:1,r=y.current,a=T[r];M(KO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[vO,yO]=pO(lO,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),bO=/* @__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),_=fe(o),v=_===`ltr`,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=UO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),/* @__PURE__ */ t(vO,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:/* @__PURE__ */ t(SO,{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=cO[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),xO=/* @__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=UO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),/* @__PURE__ */ t(vO,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:/* @__PURE__ */ t(SO,{"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=cO[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),SO=/* @__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=gO(lO,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()):oO.concat(sO).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`)),CO=`SliderTrack`,wO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=gO(CO,r);return/* @__PURE__ */ t(U.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),TO=`SliderRange`,EO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,o=gO(TO,r),s=yO(TO,r),c=z(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>LO(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`)),[DO,OO]=pO(`SliderThumb`),kO=`SliderThumbProvider`;function AO(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=gO(kO,n),c=dO(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=ir(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:LO(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(DO,{scope:n,..._,children:qO(o)?o(_):i})}$(AO,`SliderThumbProvider`);var jO=`SliderThumbTrigger`,MO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=gO(jO,r),o=yO(jO,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=OO(jO,r),f=z(n,d),p=RO(s,a.values.length),m=u?.[o.size],h=m?BO(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(uO.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`)),NO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return/* @__PURE__ */ t(AO,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(MO,{...s,ref:i,__scopeSlider:a}),o?/* @__PURE__ */ t(FO,{__scopeSlider:a},r):null]})})},`SliderThumb`)),PO=`SliderBubbleInput`,FO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=OO(PO,e),c=a.useRef(null),l=z(c,r),u=iO(i);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[u,i]),/* @__PURE__ */ t(U.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function IO(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(IO,`getNextSortedValues`);function LO(e,t,n){return tO(100/(n-t)*(e-t),[0,100])}$(LO,`convertValueToPercentage`);function RO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(RO,`getLabel`);function zO(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)}$(zO,`getClosestValueIndex`);function BO(e,t,n){let r=e/2;return(r-UO([0,50],[0,r])(t)*n)*n}$(BO,`getThumbInBoundsOffset`);function VO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(VO,`getStepsBetweenValues`);function HO(e,t){if(t>0){let n=VO(e);return Math.min(...n)>=t}return!0}$(HO,`hasMinStepsBetweenValues`);function UO(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])}}$(UO,`linearScale`);function WO(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}$(WO,`getDecimalCount`);function GO(e,t){let n=10**t;return Math.round(e*n)/n}$(GO,`roundValue`);function KO(e,{min:t,step:n,direction:r,multiplier:i}){let a=WO(n),o=(e-t)/n,s=Math.round(o),c=GO(s*n+t,a)===GO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),GO(l*n+t,a)}$(KO,`getNextStepValue`);function qO(e){return typeof e==`function`}$(qO,`isFunction`);const JO=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(_O,{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(wO,{"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(EO,{"data-slot":`slider-range`,className:B(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(NO,{"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))]})});JO.displayName=_O.displayName;var YO=Object.defineProperty,XO=(e,t)=>YO(e,`name`,{value:t,configurable:!0}),ZO=`Switch`,[QO,$O]=/* @__PURE__ */ kn(ZO),[ek,tk]=QO(ZO);function nk(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]=Wr({prop:r,defaultProp:o??!1,onChange:u,caller:ZO}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(ek,{scope:n,...C,children:uk(p)?p(C):i})}XO(nk,`SwitchProvider`);var rk=`SwitchTrigger`,ik=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ XO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=tk(rk,e),v=z(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ XO(()=>p(y.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":dk(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:V(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),ak=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ XO(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(nk,{__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(ik,{...m,ref:i,__scopeSwitch:a}),r&&/* @__PURE__ */ t(lk,{__scopeSwitch:a})]})})},`Switch`)),ok=`SwitchThumb`,sk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ XO(function(e,n){let{__scopeSwitch:r,...i}=e,a=tk(ok,r);return/* @__PURE__ */ t(U.span,{"data-state":dk(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),ck=`SwitchBubbleInput`,lk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ XO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=tk(ck,e),v=z(i,_),y=ir(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(l);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:V(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function uk(e){return typeof e==`function`}XO(uk,`isFunction`);function dk(e){return e?`checked`:`unchecked`}XO(dk,`getState`);const fk={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 pk({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=fk[r],f=t(ak,{"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(sk,{"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 mk=Object.defineProperty,hk=(e,t)=>mk(e,`name`,{value:t,configurable:!0}),gk=`Tabs`,[_k,vk]=/* @__PURE__ */ kn(gk,[Py]),yk=Py(),[bk,xk]=_k(gk),Sk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ hk(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=fe(c),[f,p]=Wr({prop:i,onChange:a,defaultProp:o??``,caller:gk});return/* @__PURE__ */ t(bk,{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`)),Ck=`TabsList`,wk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ hk(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=xk(Ck,r),s=yk(r);return/* @__PURE__ */ t(Ky,{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`)),Tk=`TabsTrigger`,Ek=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ hk(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=xk(Tk,r),c=yk(r),l=kk(s.baseId,i),u=Ak(s.baseId,i),d=i===s.value;return/* @__PURE__ */ t(qy,{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?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!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),Dk=`TabsContent`,Ok=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ hk(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=xk(Dk,r),u=kk(l.baseId,i),d=Ak(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(Ar,{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 kk(e,t){return`${e}-trigger-${t}`}hk(kk,`makeTriggerId`);function Ak(e,t){return`${e}-content-${t}`}hk(Ak,`makeContentId`);var jk=Sk,Mk=wk,Nk=Ek,Pk=Ok;const Fk=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),Ik=({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(Fk.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(jk,{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})})},Lk=({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(Fk),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(ME,{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(zk,{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(Bk,{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))})]})},Rk=({className:n})=>{let{tabs:r}=a.useContext(Fk);return r?t(e,{children:r.map(e=>t(Vk,{value:e.name,className:n,children:e.content},e.name))}):null},zk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(Fk.Provider,{value:{size:n,variant:r},children:t(Mk,{ref:a,className:B(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));zk.displayName=Mk.displayName;const Bk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(Fk),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(Nk,{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})});Bk.displayName=Nk.displayName;const Vk=a.forwardRef(({className:e,...n},r)=>t(Pk,{ref:r,className:B(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));Vk.displayName=Pk.displayName;const Hk=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`}}),Uk=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:B(Hk({size:n,weight:r,className:e})),...i}));Uk.displayName=`Text`;function Wk({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 Gk=d({theme:`system`,setTheme:()=>null});function Kk({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(Gk.Provider,{...i,value:c,children:e})}const qk=()=>{let e=g(Gk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function Jk({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}=qk(),{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(Jk,{current:a,option:`system`,setTheme:i,icon:t(Ye,{}),alt:o(`theme.system`)}),t(Jk,{current:a,option:`light`,setTheme:i,icon:t(_t,{}),alt:o(`theme.light`)}),t(Jk,{current:a,option:`dark`,setTheme:i,icon:t(lt,{}),alt:o(`theme.dark`)})]})]})}function Xk(e,n){return{label:String(e),check:t(n?L:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function Zk({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(gE,{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(Xk(e,r),i)):i=Xk(e,r),t(Qk,{option:e,onSelect:g,layout:i,noCheck:l,isSelected:r},`option-${n}`)})]})}function Qk({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 $k({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(sg,{children:t(um,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(ng.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(ng.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(st,{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(eA,{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 eA({onClose:e}){return t(W,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(xt,{className:`size-6`,"aria-hidden":`true`})})}function tA(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 nA=d(void 0),rA=nA.Provider;function iA({size:e,className:i}){let a=tA(e||`md`),o=g(nA);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 aA({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(nE),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),ee=f&&v&&!a.includes(v)&&!i.includes(v),te=P.length+ +!!ee;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let F=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},ne=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},re=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(aE,{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=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(xt,{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=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(xt,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&te>0){e.preventDefault(),e.stopPropagation(),b===P.length&&ee?ne(v):b<P.length&&F(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<te-1?e+1:e):N(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(!1);return}if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t);return}!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(sE,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>F(e),onKeyDown:ua(()=>F(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-info text-foreground`:`hover:bg-muted/50`),children:e},e))}),ee&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(W,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>ne(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-info`,b===P.length?`bg-info`:`hover:bg-muted/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function oA(e){return t(rE,{click:!0,children:t(aA,{...e})})}function sA({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(xt,{size:16})})]})});dE.displayName=`Input`;const fE=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(QT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(eE,{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(nE,{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(dE,{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 pE({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:aE}),t(vT,{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:aE}),t(vT,{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 mE({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(Zv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(sE,{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 hE({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(ga,{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 gE({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(dE,{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 _E(e,n,r){switch(e.type){case`date`:return t(oE,{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(fE,{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(lE,{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(cE,{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 vE({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}),_E(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(xt,{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 yE=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),bE=({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(wE(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(wE(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(yE.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},xE=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(yE),{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=>wE(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(Jv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(Zv,{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(QT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(eE,{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(rt,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(nE,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(Wv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(Kv,{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(qv,{children:t(Yv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(pE,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(gE,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(hE,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(mE,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},SE=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(yE);return t(`div`,{className:B(e),children:t(vE,{filters:n,setFilters:r,filterGroups:i})})},CE=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(yE),{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 wE(e){return typeof e==`string`?e:e.value||``}var TE;(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`})(TE||={});const EE=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})});EE.displayName=`Heading`;function DE({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":ee,"aria-invalid":te}){let F=C(null),[ne,re]=w(!1),[ie,ae]=w(0),[oe,se]=w(``),ce=v(),le=v(),ue=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?OE(e,T)===OE(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ae(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let de=e=>{if(x){let t=Array.isArray(s)?s:[];fe(e,t)?c(t.filter(t=>!pe(t,e))):c([...t,e])}else c(e)},fe=(e,t)=>!t||t.length===0?!1:t.some(t=>pe(t,e)),pe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?OE(e,T)===OE(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(OE(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let _e=oe.toLowerCase(),ve=he(f);me=me.filter(e=>ve(e).includes(_e));let ye=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},be=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},xe=(e,r)=>{let i=x?fe(e,Array.isArray(s)?s:[]):s!=null&&pe(s,e);return t(Zv,{onSelect:()=>de(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(L,{className:`size-4`})]}):n(rE,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(L,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=/* @__PURE__ */ new Map;for(let n of me){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Ce=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1 shrink-0`,children:[t(`div`,{className:`mx-2`,children:t(pt,{className:`size-4`})}),t(dE,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(Wv,{className:E?`min-h-0 flex-1`:`overflow-hidden`,children:n(qv,{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(Jv,{children:`No result found.`}),Se?Se.map(e=>t(Yv,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>xe(t,`${e.key}-${n}`))},e.key)):t(Yv,{children:me?.map((e,t)=>xe(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-muted bg-transparent border-0`),children:[t(ht,{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(at,{className:`size-4 animate-spin`})}):Ce()});let we=!!p,Te=M??(we?void 0:typeof m==`string`?m:void 0),Ee=N??(we?le:void 0),De=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Oe=te===!0||te===`true`||ue?!0:te===!1||te===`false`?!1:void 0;return n(QT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(eE,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":ne,"aria-controls":ce,"aria-label":Te,"aria-labelledby":Ee,"aria-describedby":ee,"aria-invalid":Oe,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(ue||Oe?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,De&&`pe-10`)),children:D?t(at,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:le,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,ue&&`text-destructive`),children:[ue&&t(Wi,{description:k,placement:`top`,asChild:!0,children:t(yt,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Ue,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!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(xt,{className:`size-4`})})]}),t(nE,{id:ce,style:{width:`${ie}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Ce()})]})}function OE(e,t){return typeof e==`object`&&e?e[t]:void 0}const kE={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 AE({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(DE,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>kE[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var jE=Object.defineProperty,ME=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>jE(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 NE=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(ME,{ref:a,className:B(NE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));PE.displayName=ME.displayName;function FE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(qe,{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(yt,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Ge,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(tt,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(tt,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(tt,{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 IE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(FE,{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 LE({title:e,className:n,children:r}){return t(FE,{status:`info`,title:e,className:n,children:r})}function RE({title:e,className:n,children:r}){return t(FE,{status:`warning`,title:e,className:n,children:r})}function zE({title:e,className:n,children:r}){return t(FE,{status:`success`,title:e,className:n,children:r})}function BE({title:e,className:n,children:r}){return t(FE,{status:`default`,title:e,className:n,children:r})}function VE({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(Mv,{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(yt,{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(Nv,{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(la,{label:l??u,children:t(dE,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(Fv,{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 HE(){return g(UE)}const UE=d(()=>{}),WE={success:Ge,error:qe,warning:yt,info:tt},GE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function KE({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=WE[e.status]||tt,u=GE[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(am,{onExitComplete:r,children:i&&t(Zh.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(xt,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function qE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(UE.Provider,{value:o,children:r}),i&&t(ng,{children:t(KE,{data:i,onClose:()=>o(null)})})]})}function JE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=HE();return t(VE,{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 YE=4,XE={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 ZE(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 QE({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(iS,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(oS,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(R,{className:`ms-1 size-4`})]})}),t(sS,{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=XE[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=ZE(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(R,{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(QE,{label:h,triggerClassName:B(c.base,m?c.active:c.inactive),icon:t(R,{className:c.icon}),children:p.map(e=>t(lS,{disabled:e.disabled,onClick:()=>i(e.name),className:B(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function eD({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?R:ze,{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(oa,{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 tD=Object.defineProperty,nD=(e,t)=>tD(e,`name`,{value:t,configurable:!0}),rD=`Radio`,[iD,aD]=/* @__PURE__ */ kn(rD),[oD,sD]=iD(rD);function cD(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),_=a.useRef(!1),[v,y]=a.useReducer(e=>e+1,0),b={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:/* @__PURE__ */ nD(()=>l?.(),`onCheck`)};return/* @__PURE__ */ t(oD,{scope:n,...b,children:hD(f)?f(b):i})}nD(cD,`RadioProvider`);var lD=`RadioTrigger`,uD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,hasConsumerStoppedPropagationRef:u,onUserInteraction:d,isFormControl:f,bubbleInput:p}=sD(lD,e),m=z(i,c);return/* @__PURE__ */ t(U.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":gD(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:V(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),dD=`RadioIndicator`,fD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=sD(dD,r);return/* @__PURE__ */ t(Ar,{present:i||o.checked,children:/* @__PURE__ */ t(U.span,{"data-state":gD(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),pD=`RadioBubbleInput`,mD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=sD(pD,e),_=z(i,m),v=ir(o),y=a.useRef(!1),b=a.useRef(s),x=a.useRef(g);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==s;b.current=s;let a=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[p,s,h,g]);let S=a.useRef(s);return/* @__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:_,onClick:V(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function hD(e){return typeof e==`function`}nD(hD,`isFunction`);function gD(e){return e?`checked`:`unchecked`}nD(gD,`getState`);var _D=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],vD=`RadioGroup`,[yD,bD]=/* @__PURE__ */ kn(vD,[ky,aD]),xD=ky(),SD=aD(),[CD,wD]=yD(vD),TD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(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=xD(r),_=fe(f),[v,y]=Wr({prop:c,defaultProp:s??null,onChange:m,caller:vD}),[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__ */ nD(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),/* @__PURE__ */ t(CD,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:/* @__PURE__ */ t(Vy,{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`)),ED=`RadioGroupItemProvider`,DD=`RadioGroupItemTrigger`;function OD(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=wD(ED,n),c=SD(n),l=s.disabled||i;return/* @__PURE__ */ t(cD,{...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})}nD(OD,`RadioGroupItemProvider`);var kD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=xD(r),s=SD(r),{checked:c,disabled:l}=sD(DD,s.__scopeRadio),u=a.useRef(null),d=z(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=/* @__PURE__ */ nD(e=>{_D.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ nD(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ t(Hy,{asChild:!0,...o,focusable:!l,active:c,children:/* @__PURE__ */ t(uD,{...s,...i,ref:d,onKeyDown:V(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:V(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),AD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return/* @__PURE__ */ t(OD,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(kD,{...c,ref:i,__scopeRadioGroup:a}),r&&/* @__PURE__ */ t(jD,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),jD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=SD(r);return/* @__PURE__ */ t(mD,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),MD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=SD(r);return/* @__PURE__ */ t(fD,{...a,...i,ref:n})},`RadioGroupIndicator`));function ND({className:e,...n}){return t(AD,{"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(MD,{"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 FD({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(TD,{"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(AD,{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 ID({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:B(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function LD(e){return typeof e==`number`?`${e}%`:e}function RD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:LD(e),minSize:LD(n),maxSize:LD(r),collapsedSize:LD(i),...a})}function zD({withHandle:e,className:n,...r}){return t(_e.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(st,{className:`size-4 rotate-90`})})})}var BD=Object.defineProperty,VD=(e,t)=>BD(e,`name`,{value:t,configurable:!0}),HD=`horizontal`,UD=[`horizontal`,`vertical`],WD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ VD(function(e,n){let{decorative:r,orientation:i=HD,...a}=e,o=GD(i)?i:HD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return/* @__PURE__ */ t(U.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function GD(e){return UD.includes(e)}VD(GD,`isValidOrientation`);var KD=WD;const qD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(KD,{ref:a,decorative:r,orientation:n,className:B(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));qD.displayName=KD.displayName;var JD=Object.defineProperty,YD=(e,t)=>JD(e,`name`,{value:t,configurable:!0});function XD(e,[t,n]){return Math.min(n,Math.max(t,e))}YD(XD,`clamp`);var ZD=Object.defineProperty,QD=(e,t)=>ZD(e,`name`,{value:t,configurable:!0});function $D(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}QD($D,`usePrevious`);var eO=Object.defineProperty,$=(e,t)=>eO(e,`name`,{value:t,configurable:!0}),tO=[`PageUp`,`PageDown`],nO=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],rO={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},iO=`Slider`,[aO,oO,sO]=/* @__PURE__ */ ty(iO),[cO,lO]=/* @__PURE__ */ kn(iO,[sO]),[uO,dO]=cO(iO),fO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[i],value:f,onValueChange:p=/* @__PURE__ */ $(()=>{},`onValueChange`),onValueCommit:m=/* @__PURE__ */ $(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(/* @__PURE__ */ new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?hO:gO,[S,C]=a.useState(null),w=z(n,C),[T=[],E]=Wr({prop:f,defaultProp:d,onChange:/* @__PURE__ */ $(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),D=a.useRef(T),O=a.useRef(T);a.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ $(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,PO(T,e))}$(k,`handleSlideStart`);function A(e){M(e,y.current)}$(A,`handleSlideMove`);function j(){String(T)!==String(D.current)&&m(T)}$(j,`handleSlideEnd`);function M(e,t,{commit:n}={commit:!1}){let r=zO(s),a=XD(BO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=jO(e,a,t);if(LO(r,u*s)){y.current=r.indexOf(a);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return $(M,`updateValues`),/* @__PURE__ */ t(uO,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:/* @__PURE__ */ t(aO.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(aO.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:V(_.onPointerDown,()=>{l||(D.current=T,b.current=!1)}),min:i,max:o,inverted:h,onSlideStart:l?void 0:k,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:j,onHomeKeyDown:()=>{l||(b.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,M(o,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){b.current=!0;let n=tO.includes(e.key)||e.shiftKey&&nO.includes(e.key)?10:1,r=y.current,a=T[r];M(VO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[pO,mO]=cO(iO,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),hO=/* @__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),_=fe(o),v=_===`ltr`,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=RO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),/* @__PURE__ */ t(pO,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:/* @__PURE__ */ t(_O,{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=rO[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),gO=/* @__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=RO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),/* @__PURE__ */ t(pO,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:/* @__PURE__ */ t(_O,{"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=rO[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),_O=/* @__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=dO(iO,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()):tO.concat(nO).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`)),vO=`SliderTrack`,yO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=dO(vO,r);return/* @__PURE__ */ t(U.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),bO=`SliderRange`,xO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,o=dO(bO,r),s=mO(bO,r),c=z(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>MO(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`)),[SO,CO]=cO(`SliderThumb`),wO=`SliderThumbProvider`;function TO(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=dO(wO,n),c=oO(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=ir(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:MO(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(SO,{scope:n,..._,children:HO(o)?o(_):i})}$(TO,`SliderThumbProvider`);var EO=`SliderThumbTrigger`,DO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=dO(EO,r),o=mO(EO,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=CO(EO,r),f=z(n,d),p=NO(s,a.values.length),m=u?.[o.size],h=m?FO(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(aO.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(TO,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(DO,{...s,ref:i,__scopeSlider:a}),o?/* @__PURE__ */ t(AO,{__scopeSlider:a},r):null]})})},`SliderThumb`)),kO=`SliderBubbleInput`,AO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=CO(kO,e),c=a.useRef(null),l=z(c,r),u=$D(i);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[u,i]),/* @__PURE__ */ t(U.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function jO(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(jO,`getNextSortedValues`);function MO(e,t,n){return XD(100/(n-t)*(e-t),[0,100])}$(MO,`convertValueToPercentage`);function NO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(NO,`getLabel`);function PO(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)}$(PO,`getClosestValueIndex`);function FO(e,t,n){let r=e/2;return(r-RO([0,50],[0,r])(t)*n)*n}$(FO,`getThumbInBoundsOffset`);function IO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(IO,`getStepsBetweenValues`);function LO(e,t){if(t>0){let n=IO(e);return Math.min(...n)>=t}return!0}$(LO,`hasMinStepsBetweenValues`);function RO(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])}}$(RO,`linearScale`);function zO(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}$(zO,`getDecimalCount`);function BO(e,t){let n=10**t;return Math.round(e*n)/n}$(BO,`roundValue`);function VO(e,{min:t,step:n,direction:r,multiplier:i}){let a=zO(n),o=(e-t)/n,s=Math.round(o),c=BO(s*n+t,a)===BO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),BO(l*n+t,a)}$(VO,`getNextStepValue`);function HO(e){return typeof e==`function`}$(HO,`isFunction`);const UO=a.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:o,value:s,defaultValue:c,min:l=0,max:u=100,"aria-label":d,...f},p)=>{let m=a.useId(),h=Array.isArray(s)?s.length:Array.isArray(c)?c.length:1,g=a.useMemo(()=>Array.from({length:Math.max(1,h)},(e,t)=>`${m}-thumb-${t}`),[m,h]);return n(fO,{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(yO,{"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(xO,{"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))]})});UO.displayName=fO.displayName;var WO=Object.defineProperty,GO=(e,t)=>WO(e,`name`,{value:t,configurable:!0}),KO=`Switch`,[qO,JO]=/* @__PURE__ */ kn(KO),[YO,XO]=qO(KO);function ZO(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]=Wr({prop:r,defaultProp:o??!1,onChange:u,caller:KO}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(YO,{scope:n,...C,children:ak(p)?p(C):i})}GO(ZO,`SwitchProvider`);var QO=`SwitchTrigger`,$O=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ GO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=XO(QO,e),v=z(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ GO(()=>p(y.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":ok(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:V(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),ek=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ GO(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(ZO,{__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($O,{...m,ref:i,__scopeSwitch:a}),r&&/* @__PURE__ */ t(ik,{__scopeSwitch:a})]})})},`Switch`)),tk=`SwitchThumb`,nk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ GO(function(e,n){let{__scopeSwitch:r,...i}=e,a=XO(tk,r);return/* @__PURE__ */ t(U.span,{"data-state":ok(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),rk=`SwitchBubbleInput`,ik=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ GO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=XO(rk,e),v=z(i,_),y=ir(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(l);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:V(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function ak(e){return typeof e==`function`}GO(ak,`isFunction`);function ok(e){return e?`checked`:`unchecked`}GO(ok,`getState`);const sk={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 ck({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=sk[r],f=t(ek,{"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(nk,{"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 lk=Object.defineProperty,uk=(e,t)=>lk(e,`name`,{value:t,configurable:!0}),dk=`Tabs`,[fk,pk]=/* @__PURE__ */ kn(dk,[ky]),mk=ky(),[hk,gk]=fk(dk),_k=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ uk(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=fe(c),[f,p]=Wr({prop:i,onChange:a,defaultProp:o??``,caller:dk});return/* @__PURE__ */ t(hk,{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`)),vk=`TabsList`,yk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ uk(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=gk(vk,r),s=mk(r);return/* @__PURE__ */ t(Vy,{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`)),bk=`TabsTrigger`,xk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ uk(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=gk(bk,r),c=mk(r),l=wk(s.baseId,i),u=Tk(s.baseId,i),d=i===s.value;return/* @__PURE__ */ t(Hy,{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?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!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),Sk=`TabsContent`,Ck=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ uk(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=gk(Sk,r),u=wk(l.baseId,i),d=Tk(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(Ar,{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 wk(e,t){return`${e}-trigger-${t}`}uk(wk,`makeTriggerId`);function Tk(e,t){return`${e}-content-${t}`}uk(Tk,`makeContentId`);var Ek=_k,Dk=yk,Ok=xk,kk=Ck;const Ak=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),jk=({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(Ek,{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})})},Mk=({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(DE,{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(Pk,{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(Fk,{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))})]})},Nk=({className:n})=>{let{tabs:r}=a.useContext(Ak);return r?t(e,{children:r.map(e=>t(Ik,{value:e.name,className:n,children:e.content},e.name))}):null},Pk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(Ak.Provider,{value:{size:n,variant:r},children:t(Dk,{ref:a,className:B(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));Pk.displayName=Dk.displayName;const Fk=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(Ok,{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})});Fk.displayName=Ok.displayName;const Ik=a.forwardRef(({className:e,...n},r)=>t(kk,{ref:r,className:B(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));Ik.displayName=kk.displayName;const Lk=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`}}),Rk=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:B(Lk({size:n,weight:r,className:e})),...i}));Rk.displayName=`Text`;function zk({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 Bk=d({theme:`system`,setTheme:()=>null});function Vk({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(Bk.Provider,{...i,value:c,children:e})}const Hk=()=>{let e=g(Bk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function Uk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(W,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function Wk({label:e,className:r}={}){let{setTheme:i,theme:a}=Hk(),{t:o}=k(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(Uk,{current:a,option:`system`,setTheme:i,icon:t(Ye,{}),alt:o(`theme.system`)}),t(Uk,{current:a,option:`light`,setTheme:i,icon:t(_t,{}),alt:o(`theme.light`)}),t(Uk,{current:a,option:`dark`,setTheme:i,icon:t(lt,{}),alt:o(`theme.dark`)})]})]})}function Gk(e,n){return{label:String(e),check:t(n?L:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function Kk({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(dE,{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(Gk(e,r),i)):i=Gk(e,r),t(qk,{option:e,onSelect:g,layout:i,noCheck:l,isSelected:r},`option-${n}`)})]})}function qk({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 Jk({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(ng,{children:t(am,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(Zh.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(Zh.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(st,{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(Yk,{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 Yk({onClose:e}){return t(W,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(xt,{className:`size-6`,"aria-hidden":`true`})})}function Xk(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 Zk=d(void 0),Qk=Zk.Provider;function $k({size:e,className:i}){let a=Xk(e||`md`),o=g(Zk);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 eA({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(ZT),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),ee=f&&v&&!a.includes(v)&&!i.includes(v),te=P.length+ +!!ee;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let F=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},ne=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},re=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(eE,{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=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(xt,{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=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(xt,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&te>0){e.preventDefault(),e.stopPropagation(),b===P.length&&ee?ne(v):b<P.length&&F(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<te-1?e+1:e):N(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(!1);return}if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t);return}!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(nE,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>F(e),onKeyDown:ua(()=>F(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-info text-foreground`:`hover:bg-muted/50`),children:e},e))}),ee&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(W,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>ne(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-info`,b===P.length?`bg-info`:`hover:bg-muted/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function tA(e){return t(QT,{click:!0,children:t(eA,{...e})})}function nA({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 cA({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 lA({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 uA({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(lA,{columns:n},e)):i})}function dA({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function fA({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function pA({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 mA=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 hA(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var gA=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 _A(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function vA(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function yA(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function bA(e,t){_(()=>e.watch(t),[e,t])}function xA(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function SA(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function CA(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var wA=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=[]}},TA=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 EA(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function DA(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 OA(){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 kA(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 AA(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function jA(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 MA(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=jA(e,a,o))}):t=jA(e,a,o),()=>{n=!0,t?.()}},[e])}function NA(e){return e instanceof Error?e:Error(String(e))}function PA(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=NA(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 FA(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),PA(e,t)}function IA(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 LA(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 RA(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const zA=typeof window<`u`?x:_;function BA(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]),LA(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 VA(e,t=[]){return BA({...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 HA=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function UA(e){return new HA(w(e))}function WA(...e){return j(i(e))}function GA(e){return typeof e==`object`&&!!e&&`message`in e}function KA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:GA(e)&&typeof e.message==`string`?e.message:t}function qA(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{OS as AnimateChangeInHeight,ye as Avatar,fa as Badge,cg as Breadcrumbs,W as Button,_g as Card,xg as CardContent,bg as CardDescription,Sg as CardFooter,vg as CardHeader,yg as CardTitle,xe as Center,Vg as Checkbox,Se as CloudIcon,a_ as Collapsible,s_ as CollapsibleContent,o_ as CollapsibleTrigger,Ht as ComboBox,Yv as Command,Xv as CommandDialog,$v as CommandEmpty,ey as CommandGroup,Zv as CommandInput,ny as CommandItem,Qv as CommandList,ty as CommandSeparator,ry as CommandShortcut,wA as ComputedProperty,KE as ConfirmModal,Yi as CopyButton,Ft as DOMPopup,dE as DateCombobox,GE as DefaultBox,$E as DeleteModal,Vv as Dialog,Wv as DialogClose,Kv as DialogContent,qv as DialogDescription,Gv as DialogOverlay,Uv as DialogPortal,Jv as DialogTitle,Hv as DialogTrigger,Zt as Divider,ha as DotBadge,ta as DropZone,TS as Dropdown,lS as DropdownMenu,hS as DropdownMenuCheckboxItem,fS as DropdownMenuContent,pS as DropdownMenuGroup,mS as DropdownMenuItem,vS as DropdownMenuLabel,uS as DropdownMenuPortal,gS as DropdownMenuRadioGroup,_S as DropdownMenuRadioItem,yS as DropdownMenuSeparator,bS as DropdownMenuShortcut,xS as DropdownMenuSub,CS as DropdownMenuSubContent,SS as DropdownMenuSubTrigger,dS as DropdownMenuTrigger,Xi as EmptyCollection,VE as ErrorBox,ea as FileUploadInput,DE as FilterBar,EE as FilterBtn,OE as FilterClear,AE as FilterOperator,TE as FilterProvider,la as FormItem,jE as Heading,HE as InfoBox,oa as InfoTip,gE as Input,ga as InputList,zE as Label,FE as LanguageSwitcher,_a as Link,ES as MenuGroup,DS as MenuItem,va as MenuList,BE as MessageBox,Lv as Modal,zv as ModalBody,Iv as ModalContextProvider,Bv as ModalFooter,Rv as ModalTitle,Jk as ModeOption,Yk as ModeToggle,Sa as NumberInput,eD as OVERFLOW_TAB_GAP_PX,Rt as OptionAdapter,rD as OverflowMoreMenu,iD as OverflowTabsBar,rg as Overlay,aD as Panel,rE as Popover,oE as PopoverAnchor,cE as PopoverClose,sE as PopoverContent,nE as PopoverContext,aE as PopoverTrigger,It as Popup,Mt as PopupController,sg as Portal,Ii as PortalContainerContext,Ri as PortalContainerProvider,mA as Property,BD as RadioGroup,zD as RadioGroupAdapter,RD as RadioGroupItem,WD as ResizableHandle,UD as ResizablePanel,VD as ResizablePanelGroup,lA as RowSkeleton,ME as SelectBox,Zk as SelectList,pE as SelectionCombobox,QD as Separator,TA as SharedState,HA as SharedValue,$k as SidePanel,Xt as SimpleCombobox,JO as Slider,gA as Slot,pA as SortableTableHeaderCell,iA as Spinner,rA as SpinnerIconProvider,mE as StringListCombobox,zt as StringOptionAdapter,Bt as StringOptionAdapterWithCreate,ba as Styles,WE as SuccessBox,be as SvgAvatar,pk as Switch,uA as TBody,cA as THead,dA as TR,sA as Table,fA as TableHeaderCell,Ik as Tabs,Lk as TabsBar,Vk as TabsContent,zk as TabsList,Rk as TabsPanel,Bk as TabsTrigger,oA as TagsInput,Uk as Text,_E as TextCombobox,Wk as Textarea,Kk as ThemeProvider,Gk as ThemeProviderContext,JE as ToastContext,QE as ToastProvider,Vi as Tooltip,Ui as TooltipContent,Bi as TooltipProvider,Hi as TooltipTrigger,Wi as VTooltip,UE as WarningBox,Ji as buttonVariants,WA as cn,Dt as computePosition,hA as createCompositeStateProvider,KA as errorMessage,Vt as getDefaultComboBoxLayout,qA as insertNewlineAtCursor,ua as onActivateKey,DA as useClickOutside,Kt as useComboboxCtrl,_A as useCompositeState,OA as useCopyToClipboard,kA as useDarkMode,AA as useDebounce,VA as useDefaultScrollableSearch,CA as useDefineSlot,aa as useDropZone,MA as useEventSource,PA as useFetch,FA as useFetchOnce,IA as useFlag,vA as useGetCompositeStateProperty,LA as useIntersectionObserver,RA as useIsFirstRendering,Fv as useIsInModal,nD as useOverflowTabs,lE as usePopoverContext,Pt as usePopupController,zi as usePortalContainer,zA as useSafeLayoutEffect,BA as useScrollableSearch,yA as useSetCompositeStateProperty,UA as useSharedValue,xA as useSlot,qk as useTheme,qE as useToast,bA as useWatchCompositeStateProperty,EA as useWatchSharedState,SA as useWatchSlot};
339
+ `,e),...i,children:n})}function rA({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 iA({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 aA({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(iA,{columns:n},e)):i})}function oA({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function sA({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function cA({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 lA=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 uA(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var dA=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 fA(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function pA(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function mA(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function hA(e,t){_(()=>e.watch(t),[e,t])}function gA(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function _A(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function vA(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var yA=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=[]}},bA=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 xA(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function SA(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 CA(){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 wA(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 TA(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function EA(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 DA(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=EA(e,a,o))}):t=EA(e,a,o),()=>{n=!0,t?.()}},[e])}function OA(e){return e instanceof Error?e:Error(String(e))}function kA(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=OA(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=[]),kA(e,t)}function jA(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 MA(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 NA(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const PA=typeof window<`u`?x:_;function FA(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]),MA(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 IA(e,t=[]){return FA({...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 LA=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function RA(e){return new LA(w(e))}function zA(...e){return j(i(e))}function BA(e){return typeof e==`object`&&!!e&&`message`in e}function VA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:BA(e)&&typeof e.message==`string`?e.message:t}function HA(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{CS as AnimateChangeInHeight,ye as Avatar,fa as Badge,rg as Breadcrumbs,W as Button,fg as Card,gg as CardContent,hg as CardDescription,_g as CardFooter,pg as CardHeader,mg as CardTitle,xe as Center,Ig as Checkbox,Se as CloudIcon,e_ as Collapsible,n_ as CollapsibleContent,t_ as CollapsibleTrigger,Ht as ComboBox,Wv as Command,Gv as CommandDialog,Jv as CommandEmpty,Yv as CommandGroup,Kv as CommandInput,Zv as CommandItem,qv as CommandList,Xv as CommandSeparator,Qv as CommandShortcut,yA as ComputedProperty,VE as ConfirmModal,Yi as CopyButton,Ft as DOMPopup,oE as DateCombobox,BE as DefaultBox,JE as DeleteModal,Iv as Dialog,zv as DialogClose,Vv as DialogContent,Hv as DialogDescription,Bv as DialogOverlay,Rv as DialogPortal,Uv as DialogTitle,Lv as DialogTrigger,Zt as Divider,ha as DotBadge,ta as DropZone,bS as Dropdown,iS as DropdownMenu,uS as DropdownMenuCheckboxItem,sS as DropdownMenuContent,cS as DropdownMenuGroup,lS as DropdownMenuItem,pS as DropdownMenuLabel,aS as DropdownMenuPortal,dS as DropdownMenuRadioGroup,fS as DropdownMenuRadioItem,mS as DropdownMenuSeparator,hS as DropdownMenuShortcut,gS as DropdownMenuSub,vS as DropdownMenuSubContent,_S as DropdownMenuSubTrigger,oS as DropdownMenuTrigger,Xi as EmptyCollection,IE as ErrorBox,ea as FileUploadInput,SE as FilterBar,xE as FilterBtn,CE as FilterClear,TE as FilterOperator,bE as FilterProvider,la as FormItem,EE as Heading,LE as InfoBox,oa as InfoTip,dE as Input,ga as InputList,PE as Label,AE as LanguageSwitcher,_a as Link,xS as MenuGroup,SS as MenuItem,va as MenuList,FE as MessageBox,Mv as Modal,Pv as ModalBody,jv as ModalContextProvider,Fv as ModalFooter,Nv as ModalTitle,Uk as ModeOption,Wk as ModeToggle,Sa as NumberInput,YE as OVERFLOW_TAB_GAP_PX,Rt as OptionAdapter,QE as OverflowMoreMenu,$E as OverflowTabsBar,Qh as Overlay,eD as Panel,QT as Popover,tE as PopoverAnchor,rE as PopoverClose,nE as PopoverContent,ZT as PopoverContext,eE as PopoverTrigger,It as Popup,Mt as PopupController,ng as Portal,Ii as PortalContainerContext,Ri as PortalContainerProvider,lA as Property,FD as RadioGroup,PD as RadioGroupAdapter,ND as RadioGroupItem,zD as ResizableHandle,RD as ResizablePanel,ID as ResizablePanelGroup,iA as RowSkeleton,DE as SelectBox,Kk as SelectList,cE as SelectionCombobox,qD as Separator,bA as SharedState,LA as SharedValue,Jk as SidePanel,Xt as SimpleCombobox,UO as Slider,dA as Slot,cA as SortableTableHeaderCell,$k as Spinner,Qk as SpinnerIconProvider,lE as StringListCombobox,zt as StringOptionAdapter,Bt as StringOptionAdapterWithCreate,ba as Styles,zE as SuccessBox,be as SvgAvatar,ck as Switch,aA as TBody,rA as THead,oA as TR,nA as Table,sA as TableHeaderCell,jk as Tabs,Mk as TabsBar,Ik as TabsContent,Pk as TabsList,Nk as TabsPanel,Fk as TabsTrigger,tA as TagsInput,Rk as Text,fE as TextCombobox,zk as Textarea,Vk as ThemeProvider,Bk as ThemeProviderContext,UE as ToastContext,qE as ToastProvider,Vi as Tooltip,Ui as TooltipContent,Bi as TooltipProvider,Hi as TooltipTrigger,Wi as VTooltip,RE as WarningBox,Ji as buttonVariants,zA as cn,Dt as computePosition,uA as createCompositeStateProvider,VA as errorMessage,Vt as getDefaultComboBoxLayout,HA as insertNewlineAtCursor,ua as onActivateKey,SA as useClickOutside,Kt as useComboboxCtrl,fA as useCompositeState,CA as useCopyToClipboard,wA as useDarkMode,TA as useDebounce,IA as useDefaultScrollableSearch,vA as useDefineSlot,aa as useDropZone,DA as useEventSource,kA as useFetch,AA as useFetchOnce,jA as useFlag,pA as useGetCompositeStateProperty,MA as useIntersectionObserver,NA as useIsFirstRendering,Av as useIsInModal,ZE as useOverflowTabs,iE as usePopoverContext,Pt as usePopupController,zi as usePortalContainer,PA as useSafeLayoutEffect,FA as useScrollableSearch,mA as useSetCompositeStateProperty,RA as useSharedValue,gA as useSlot,Hk as useTheme,HE as useToast,hA as useWatchCompositeStateProperty,xA as useWatchSharedState,_A as useWatchSlot};
340
340
  //# sourceMappingURL=vertesia-ui-core.js.map