@mrpatronz/nexusflow 2.11.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +151 -12
  3. package/dist/analyzers/detect-deps.js +1 -1
  4. package/dist/analyzers/detect-deps.js.map +1 -1
  5. package/dist/commands/commit.d.ts.map +1 -1
  6. package/dist/commands/commit.js +15 -0
  7. package/dist/commands/commit.js.map +1 -1
  8. package/dist/commands/create.d.ts +10 -1
  9. package/dist/commands/create.d.ts.map +1 -1
  10. package/dist/commands/create.js +44 -23
  11. package/dist/commands/create.js.map +1 -1
  12. package/dist/commands/finish.d.ts.map +1 -1
  13. package/dist/commands/finish.js +15 -0
  14. package/dist/commands/finish.js.map +1 -1
  15. package/dist/commands/flow.d.ts +13 -0
  16. package/dist/commands/flow.d.ts.map +1 -0
  17. package/dist/commands/flow.js +91 -0
  18. package/dist/commands/flow.js.map +1 -0
  19. package/dist/commands/skill.d.ts +28 -0
  20. package/dist/commands/skill.d.ts.map +1 -0
  21. package/dist/commands/skill.js +250 -0
  22. package/dist/commands/skill.js.map +1 -0
  23. package/dist/commands/status.d.ts.map +1 -1
  24. package/dist/commands/status.js +14 -0
  25. package/dist/commands/status.js.map +1 -1
  26. package/dist/commands/tag.d.ts +13 -0
  27. package/dist/commands/tag.d.ts.map +1 -0
  28. package/dist/commands/tag.js +179 -0
  29. package/dist/commands/tag.js.map +1 -0
  30. package/dist/commands/verify.d.ts +16 -0
  31. package/dist/commands/verify.d.ts.map +1 -0
  32. package/dist/commands/verify.js +91 -0
  33. package/dist/commands/verify.js.map +1 -0
  34. package/dist/core/adapters/local-storage.d.ts.map +1 -1
  35. package/dist/core/adapters/local-storage.js +2 -2
  36. package/dist/core/adapters/local-storage.js.map +1 -1
  37. package/dist/core/commit.d.ts +2 -0
  38. package/dist/core/commit.d.ts.map +1 -1
  39. package/dist/core/commit.js +15 -0
  40. package/dist/core/commit.js.map +1 -1
  41. package/dist/core/domain-catalog.d.ts +9 -0
  42. package/dist/core/domain-catalog.d.ts.map +1 -0
  43. package/dist/core/domain-catalog.js +47 -0
  44. package/dist/core/domain-catalog.js.map +1 -0
  45. package/dist/core/domain-packs.d.ts +81 -0
  46. package/dist/core/domain-packs.d.ts.map +1 -0
  47. package/dist/core/domain-packs.js +443 -0
  48. package/dist/core/domain-packs.js.map +1 -0
  49. package/dist/core/generation-lock.d.ts.map +1 -1
  50. package/dist/core/generation-lock.js +1 -3
  51. package/dist/core/generation-lock.js.map +1 -1
  52. package/dist/core/lifecycle.d.ts +28 -0
  53. package/dist/core/lifecycle.d.ts.map +1 -0
  54. package/dist/core/lifecycle.js +411 -0
  55. package/dist/core/lifecycle.js.map +1 -0
  56. package/dist/core/verify.d.ts +39 -0
  57. package/dist/core/verify.d.ts.map +1 -0
  58. package/dist/core/verify.js +397 -0
  59. package/dist/core/verify.js.map +1 -0
  60. package/dist/core/work-guidance.d.ts +201 -0
  61. package/dist/core/work-guidance.d.ts.map +1 -0
  62. package/dist/core/work-guidance.js +225 -0
  63. package/dist/core/work-guidance.js.map +1 -0
  64. package/dist/core/workspace-state.d.ts +24 -3
  65. package/dist/core/workspace-state.d.ts.map +1 -1
  66. package/dist/core/workspace-state.js +93 -31
  67. package/dist/core/workspace-state.js.map +1 -1
  68. package/dist/core/workspace.d.ts.map +1 -1
  69. package/dist/core/workspace.js +7 -0
  70. package/dist/core/workspace.js.map +1 -1
  71. package/dist/generators/base.d.ts.map +1 -1
  72. package/dist/generators/base.js +38 -4
  73. package/dist/generators/base.js.map +1 -1
  74. package/dist/generators/index.d.ts.map +1 -1
  75. package/dist/generators/index.js +4 -0
  76. package/dist/generators/index.js.map +1 -1
  77. package/dist/generators/plan-generator.d.ts.map +1 -1
  78. package/dist/generators/plan-generator.js +6 -1
  79. package/dist/generators/plan-generator.js.map +1 -1
  80. package/dist/generators/skills-generator.d.ts.map +1 -1
  81. package/dist/generators/skills-generator.js +36 -3
  82. package/dist/generators/skills-generator.js.map +1 -1
  83. package/dist/gui/assets/AgentsPage-GCFiyNSm.js +3 -0
  84. package/dist/gui/assets/DashboardPage-51JHl4Hg.js +1 -0
  85. package/dist/gui/assets/{GettingStartedPage-1MOTng3B.js → GettingStartedPage-DH-zXYgU.js} +1 -1
  86. package/dist/gui/assets/ProjectsPage-DUv2fhI8.js +1 -0
  87. package/dist/gui/assets/ScaffoldRepoInline-Asao9IqG.js +1 -0
  88. package/dist/gui/assets/SettingsPage--pnZKpmm.js +1 -0
  89. package/dist/gui/assets/SkillsPage-BPq8arO5.js +7 -0
  90. package/dist/gui/assets/StartWorkPage-CypGEQZ0.js +1 -0
  91. package/dist/gui/assets/{StrategiesPage-CdCbbIu-.js → StrategiesPage-BHAzXMnc.js} +2 -2
  92. package/dist/gui/assets/WorkroomsPage-BYC8c-rP.js +4 -0
  93. package/dist/gui/assets/WorkspacesPage-DRASo1aL.js +13 -0
  94. package/dist/gui/assets/{alert-dialog-u7qgb9Hq.js → alert-dialog-BD3wT0w3.js} +1 -1
  95. package/dist/gui/assets/badge-DTBzXOWn.js +1 -0
  96. package/dist/gui/assets/index-er-mkc2S.css +2 -0
  97. package/dist/gui/assets/index-jcGHcXQ1.js +57 -0
  98. package/dist/gui/assets/square-check-big-Bj8Rf_dH.js +1 -0
  99. package/dist/gui/assets/tabs-DfbdubLX.js +1 -0
  100. package/dist/gui/assets/{useAriaLabelledBy-C4zV-1Ra.js → useAriaLabelledBy-BmJErI5a.js} +1 -1
  101. package/dist/gui/assets/vsc-Dn-smJni.js +1 -0
  102. package/dist/gui/index.html +3 -5
  103. package/dist/http/work-guidance-routes.d.ts +4 -0
  104. package/dist/http/work-guidance-routes.d.ts.map +1 -0
  105. package/dist/http/work-guidance-routes.js +44 -0
  106. package/dist/http/work-guidance-routes.js.map +1 -0
  107. package/dist/index.js +169 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/mcp/tools.d.ts.map +1 -1
  110. package/dist/mcp/tools.js +183 -0
  111. package/dist/mcp/tools.js.map +1 -1
  112. package/dist/resources/contracts.d.ts.map +1 -1
  113. package/dist/resources/contracts.js +2 -1
  114. package/dist/resources/contracts.js.map +1 -1
  115. package/dist/resources/fs-safety.d.ts.map +1 -1
  116. package/dist/resources/fs-safety.js +2 -1
  117. package/dist/resources/fs-safety.js.map +1 -1
  118. package/dist/resources/materializer.d.ts +3 -0
  119. package/dist/resources/materializer.d.ts.map +1 -1
  120. package/dist/resources/materializer.js +45 -19
  121. package/dist/resources/materializer.js.map +1 -1
  122. package/dist/server.d.ts.map +1 -1
  123. package/dist/server.js +327 -4
  124. package/dist/server.js.map +1 -1
  125. package/dist/static-resources/skills/contextspace-verify-release/SKILL.md +51 -0
  126. package/dist/static-resources/skills/contextspace-verify-release/references/evidence.md +21 -0
  127. package/dist/static-resources/skills/nexusflow-dev/SKILL.md +49 -0
  128. package/dist/static-resources/skills/nexusflow-dev/references/cli-conventions.md +15 -0
  129. package/dist/static-resources/skills/nexusflow-dev/references/verification-checklist.md +28 -0
  130. package/dist/static-resources/skills/nexusflow-lifecycle/SKILL.md +62 -0
  131. package/dist/static-resources/skills/nexusflow-lifecycle/references/epic-deliverables.md +22 -0
  132. package/dist/static-resources/skills/nexusflow-lifecycle/references/flow-selection-matrix.md +21 -0
  133. package/dist/static-resources/skills/nexusflow-lifecycle/references/stage-outcomes.md +23 -0
  134. package/dist/static-resources/workflows/epic-multi-slice.md +21 -0
  135. package/dist/static-resources/workflows/plan-implement-review.md +17 -6
  136. package/dist/static-resources/workflows/research-verify.md +15 -4
  137. package/dist/static-resources/workflows/solo-developer.md +11 -2
  138. package/dist/test-setup.d.ts +2 -0
  139. package/dist/test-setup.d.ts.map +1 -0
  140. package/dist/test-setup.js +8 -0
  141. package/dist/test-setup.js.map +1 -0
  142. package/dist/types.d.ts +175 -0
  143. package/dist/types.d.ts.map +1 -1
  144. package/dist/utils/resolve-workspace.d.ts.map +1 -1
  145. package/dist/utils/resolve-workspace.js +15 -8
  146. package/dist/utils/resolve-workspace.js.map +1 -1
  147. package/dist/utils/skills-catalog.d.ts +13 -9
  148. package/dist/utils/skills-catalog.d.ts.map +1 -1
  149. package/dist/utils/skills-catalog.js +241 -341
  150. package/dist/utils/skills-catalog.js.map +1 -1
  151. package/dist/utils/workflow-advisor.d.ts +1 -1
  152. package/dist/utils/workflow-advisor.d.ts.map +1 -1
  153. package/dist/utils/workflow-advisor.js +16 -4
  154. package/dist/utils/workflow-advisor.js.map +1 -1
  155. package/dist/utils/workflows.d.ts.map +1 -1
  156. package/dist/utils/workflows.js +5 -2
  157. package/dist/utils/workflows.js.map +1 -1
  158. package/dist/workrooms/contracts.d.ts +3 -3
  159. package/dist/workrooms/local-resources.d.ts +4 -1
  160. package/dist/workrooms/local-resources.d.ts.map +1 -1
  161. package/dist/workrooms/manager.d.ts +5 -2
  162. package/dist/workrooms/manager.d.ts.map +1 -1
  163. package/dist/workrooms/store.d.ts +2 -2
  164. package/package.json +3 -2
  165. package/resources/skills/contextspace-verify-release/SKILL.md +51 -0
  166. package/resources/skills/contextspace-verify-release/references/evidence.md +21 -0
  167. package/resources/skills/nexusflow-dev/SKILL.md +49 -0
  168. package/resources/skills/nexusflow-dev/references/cli-conventions.md +15 -0
  169. package/resources/skills/nexusflow-dev/references/verification-checklist.md +28 -0
  170. package/resources/skills/nexusflow-lifecycle/SKILL.md +62 -0
  171. package/resources/skills/nexusflow-lifecycle/references/epic-deliverables.md +22 -0
  172. package/resources/skills/nexusflow-lifecycle/references/flow-selection-matrix.md +21 -0
  173. package/resources/skills/nexusflow-lifecycle/references/stage-outcomes.md +23 -0
  174. package/resources/workflows/epic-multi-slice.md +21 -0
  175. package/resources/workflows/plan-implement-review.md +17 -6
  176. package/resources/workflows/research-verify.md +15 -4
  177. package/resources/workflows/solo-developer.md +11 -2
  178. package/dist/gui/assets/AgentsPage-DbivhmK0.js +0 -3
  179. package/dist/gui/assets/DashboardPage-D50Qrm3e.js +0 -1
  180. package/dist/gui/assets/NullStore-tdPen1kp.js +0 -1
  181. package/dist/gui/assets/ProjectsPage-srKgf7VN.js +0 -1
  182. package/dist/gui/assets/ScaffoldRepoInline-CP0yn5mw.js +0 -1
  183. package/dist/gui/assets/SettingsPage-DWmrLV8o.js +0 -1
  184. package/dist/gui/assets/SkillsPage-CKjTXdrd.js +0 -6
  185. package/dist/gui/assets/StartWorkPage-BCUnJ9k8.js +0 -1
  186. package/dist/gui/assets/WorkroomsPage-BcT-mGtT.js +0 -4
  187. package/dist/gui/assets/WorkspacesPage-CYFCm-7_.js +0 -2
  188. package/dist/gui/assets/badge-DwXvB44H.js +0 -1
  189. package/dist/gui/assets/chunk-BV7QT456-DfUBKG-z.js +0 -3
  190. package/dist/gui/assets/index-3tD_IeyQ.js +0 -55
  191. package/dist/gui/assets/index-CK5YRfPV.css +0 -2
  192. package/dist/gui/assets/square-check-big-BSIiYXPI.js +0 -1
  193. package/dist/gui/assets/tabs-BrHKp5bD.js +0 -1
  194. package/dist/gui/assets/vsc-D80c4gBT.js +0 -1
@@ -1 +0,0 @@
1
- import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,u as h,v as g}from"./button-CREn1mup.js";var _=g((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.8`})),v=g(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_()})),y=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),b={"data-starting-style":``},x={"data-ending-style":``},S={transitionStatus(e){return e===`starting`?b:e===`ending`?x:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=y.startingStyle]=`startingStyle`,e[e.endingStyle=y.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var C={"data-popup-open":``},w={"data-popup-open":``,"data-pressed":``},T={"data-open":``},E={"data-closed":``},D={"data-anchor-hidden":``},O={open(e){return e?C:null}},k={open(e){return e?w:null}},A={open(e){return e?T:E},anchorHidden(e){return e?D:null}},j={...A,...S},M=`none`,N=`trigger-press`,P=`trigger-hover`,F=`trigger-focus`,ee=`outside-press`,te=`item-press`,I=`close-press`,ne=`focus-out`,re=`escape-key`,ie=`list-navigation`,ae=`cancel-open`,oe=`sibling-open`,L=`disabled`,se=`missing`,R=`initial`,z=`imperative-action`,B=`window-resize`,ce=n(v(),1),V=o(),H=n(e(),1);function le({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=H.useRef(e!==void 0),[a,o]=H.useState(t);return[i?e:a,H.useCallback(e=>{i||o(e)},[])]}function ue(){return typeof window<`u`}function U(e){return fe(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function de(e){return((fe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fe(e){return ue()?e instanceof Node||e instanceof W(e).Node:!1}function G(e){return ue()?e instanceof Element||e instanceof W(e).Element:!1}function K(e){return ue()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function pe(e){return!ue()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function me(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Te(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function he(e){return/^(table|td|th)$/.test(U(e))}function ge(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _e=/transform|translate|scale|rotate|perspective|filter/,ve=/paint|layout|strict|content/,ye=e=>!!e&&e!==`none`,be;function xe(e){let t=G(e)?Te(e):e;return ye(t.transform)||ye(t.translate)||ye(t.scale)||ye(t.rotate)||ye(t.perspective)||!Ce()&&(ye(t.backdropFilter)||ye(t.filter))||_e.test(t.willChange||``)||ve.test(t.contain||``)}function Se(e){let t=De(e);for(;K(t)&&!we(t);){if(xe(t))return t;if(ge(t))return null;t=De(t)}return null}function Ce(){return be??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),be}function we(e){return/^(html|body|#document)$/.test(U(e))}function Te(e){return W(e).getComputedStyle(e)}function Ee(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function De(e){if(U(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||pe(e)&&e.host||de(e);return pe(t)?t.host:t}function Oe(e){let t=De(e);return we(t)?(e.ownerDocument||e).body:K(t)&&me(t)?t:Oe(t)}function ke(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Oe(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Ae(a);return t.concat(a,a.visualViewport||[],me(r)?r:[],e&&n?ke(e):[])}return t.concat(r,ke(r,[],n))}function Ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var je={...H},Me=je.useInsertionEffect,Ne=Me&&Me!==je.useLayoutEffect?Me:e=>e();function q(e){let t=a(Pe).current;return t.next=e,Ne(t.effect),t.trampoline}function Pe(){let e={next:void 0,callback:Fe,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Fe(){}var J=typeof document<`u`?H.useLayoutEffect:()=>{},Ie=H.createContext(void 0);function Le(e=!1){let t=H.useContext(Ie);if(t===void 0&&!e)throw Error(f(16));return t}function Re(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:H.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Y(e){return e?.ownerDocument||document}function ze(e,t,{detail:n=0}={}){e.dispatchEvent(new(W(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Be(e={}){let{disabled:n=!1,focusableWhenDisabled:r,tabIndex:i=0,native:a=!0,composite:o}=e,s=H.useRef(null),c=Le(!0),l=o??c!==void 0,{props:u}=Re({focusableWhenDisabled:r,disabled:n,composite:l,tabIndex:i,isNativeButton:a}),f=H.useCallback(()=>{let e=s.current;Ve(e)&&l&&n&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[n,u.disabled,l]);return J(f,[f]),{getButtonProps:H.useCallback((e={})=>{let{onClick:r,onMouseDown:i,onKeyUp:o,onKeyDown:s,onPointerDown:c,...f}=e;return d({onClick(e){if(n){e.preventDefault();return}r?.(e)},onMouseDown(e){n||i?.(e)},onKeyDown(e){if(n||(t(e),s?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,i=e.currentTarget,o=Ve(i),c=!a&&He(i),u=r&&(a?o:!c),d=e.key===`Enter`,f=e.key===` `,p=i.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&l&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),(!a||o)&&(e.preventBaseUIHandler(),ze(i,e));return}if(!u||a||!f&&!d){r&&c&&f&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),d&&(e.preventBaseUIHandler(),ze(i,e)))},onKeyUp(e){if(!n){if(t(e),o?.(e),e.target===e.currentTarget&&a&&l&&Ve(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),ze(e.currentTarget,e))}},onPointerDown(e){if(n){e.preventDefault();return}c?.(e)}},a?{type:`button`}:{role:`button`},u,f)},[n,u,l,a]),buttonRef:q(e=>{s.current=e,f()})}}function Ve(e){return K(e)&&e.tagName===`BUTTON`}function He(e){return K(e)&&e.tagName===`A`&&!!e.href}function Ue(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:We,platform:Ge,maxTouchPoints:Ke}=Ue(),qe=We.toLowerCase(),Je=Ge.toLowerCase(),Ye=/^i(os$|p)/.test(Je)||Je===`macintel`&&Ke>1,Xe=`android`,Ze=Je===Xe||qe.includes(Xe),Qe=!Ye&&Je.startsWith(`mac`);Je.startsWith(`win`),!Ze&&/^(linux|chrome os)/.test(Je);var $e=Qe||Ye,et=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!et&&qe.includes(`firefox`),!et&&qe.includes(`chrom`);var tt=$e,nt=/jsdom|happydom/.test(qe),rt=0;function it(e,t=`mui`){let[n,r]=H.useState(e),i=e||n;return H.useEffect(()=>{n??(rt+=1,r(`${t}-${rt}`))},[n,t]),i}var at=je.useId;function ot(e,t){if(at!==void 0){let n=at();return e??(t?`${t}-${n}`:n)}return it(e,t)}function st(e){return ot(e,`base-ui`)}function ct(e,t,n,i){let a=!1,o=!1,s=i??r;return{reason:e,event:t??new Event(`base-ui`),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:n,...s}}function lt(e){H.useEffect(e,m)}var ut=null;globalThis.requestAnimationFrame;var dt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},ft=class e{static create(){return new e}static request(e){return dt.request(e)}static cancel(e){return dt.cancel(e)}currentId=ut;request(e){this.cancel(),this.currentId=dt.request(()=>{this.currentId=ut,e()})}cancel=()=>{this.currentId!==ut&&(dt.cancel(this.currentId),this.currentId=ut)};disposeEffect=()=>this.cancel};function pt(){let e=a(ft.create).current;return lt(e.disposeEffect),e}function mt(e,t=!1,n=!1){let[r,i]=H.useState(e&&t?`idle`:void 0),[a,o]=H.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),J(()=>{if(!e&&a&&r!==`ending`&&n){let e=ft.request(()=>{i(`ending`)});return()=>{ft.cancel(e)}}},[e,a,r,n]),J(()=>{if(!e||t)return;let n=ft.request(()=>{i(void 0)});return()=>{ft.cancel(n)}},[t,e]),J(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=ft.request(()=>{i(`idle`)});return()=>{ft.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function X(e){return e==null?e:`current`in e?e.current:e}function ht(e,t=!1){let n=pt();return q((r,i=null)=>{n.cancel();let a=X(e);if(a==null)return;let o=a,s=()=>{ce.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function gt(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=q(i),o=ht(r,n);H.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var _t=0,vt=class e{static create(){return new e}currentId=_t;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=_t,t()},e)}isStarted(){return this.currentId!==_t}clear=()=>{this.currentId!==_t&&(clearTimeout(this.currentId),this.currentId=_t)};disposeEffect=()=>this.clear};function yt(){let e=a(vt.create).current;return lt(e.disposeEffect),e}function bt(e){e.preventDefault(),e.stopPropagation()}function xt(e){return`nativeEvent`in e}function St(e){return e.pointerType===``&&e.isTrusted?!0:Ze&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ct(e){return nt?!1:!Ze&&e.width===0&&e.height===0||Ze&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function wt(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Tt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Et=`data-base-ui-focusable`,Dt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Ot=`ArrowLeft`,kt=`ArrowRight`,At=`ArrowUp`,jt=`ArrowDown`;function Z(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&pe(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Mt(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Nt(e,t){if(!G(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Pt(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ft(e){return e.matches(`html,body`)}function It(e){return K(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Lt(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Dt}`)!=null}function Rt(e){return e?e.getAttribute(`role`)===`combobox`&&It(e):!1}function zt(e){if(!e||nt)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Bt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Vt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Ht(e){let t=a(Ut,e).current;return t.next=e,J(t.effect),t}function Ut(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Wt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Gt={...Wt,position:`fixed`,top:0,left:0},Kt={...Wt,position:`absolute`},qt=H.forwardRef(function(e,t){let[n,r]=H.useState();J(()=>{tt&&et&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,V.jsx)(`span`,{...e,ref:t,style:Gt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Jt(e,t){return t<0||t>=e.length}function Yt(e,t){return Zt(e.current,{disabledIndices:t})}function Xt(e,t){return Zt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Zt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Qt(e,a,r));return a}function Qt(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!en(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function $t(e){return e.visibility===`hidden`||e.visibility===`collapse`}function en(e,t=e?Te(e):null){return!e||!e.isConnected||!t||$t(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var tn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function nn(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return pe(n)?n.host:null}function rn(e){for(let t of Array.from(e.children))if(U(t)===`summary`)return t;return null}function an(e,t){let n=rn(t);return!!n&&(e===n||Q(n,e))}function on(e){let t=e?U(e):``;return e!=null&&e.matches(tn)&&(t!==`summary`||e.parentElement!=null&&U(e.parentElement)===`details`&&rn(e.parentElement)===e)&&(t!==`details`||rn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function sn(e){if(!on(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=nn(t)){let n=t!==e,r=U(t)===`slot`;if(t.hasAttribute(`inert`)||n&&U(t)===`details`&&!t.open&&!an(e,t)||t.hasAttribute(`hidden`)||!r&&!cn(t,n))return!1}return!0}function cn(e,t){let n=Te(e);return t?n.display!==`none`:en(e,n)}function ln(e){let t=e.tabIndex;if(t<0){let t=U(e);if(t===`details`||t===`audio`||t===`video`||K(e)&&e.isContentEditable)return 0}return t}function un(e){if(U(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function dn(e,t){let n=un(e);if(!n)return!0;let r=t.find(e=>{let t=un(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=un(e);return t?.name===n.name&&t.form===n.form})===n}function fn(e){if(K(e)&&U(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return K(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function pn(e,t){fn(e).forEach(e=>{on(e)&&t.push(e),pn(e,t)})}function mn(e,t,n){fn(e).forEach(e=>{K(e)&&e.matches(t)&&n.push(e),mn(e,t,n)})}function hn(e){return sn(e)&&ln(e)>=0}function gn(e){let t=[];return pn(e,t),t.filter(sn)}function _n(e){let t=gn(e);return t.filter(e=>ln(e)>=0&&dn(e,t))}function vn(e,t){let n=_n(e),r=n.length;if(r===0)return;let i=Z(Y(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function yn(e){return vn(Y(e).body,1)||e}function bn(e){return vn(Y(e).body,-1)||e}function xn(e,t){if(!e)return null;let n=_n(Y(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Sn(e){return xn(e,1)}function Cn(e){return xn(e,-1)}function wn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function Tn(e){_n(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function En(e){let t=[];mn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Dn(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Dn(e,t.id,n)])}function On(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function kn(e){return`data-base-ui-${e}`}var An=0;function jn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(An);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),c;let o=requestAnimationFrame(a);return An=o,()=>{An===o&&(cancelAnimationFrame(o),An=0)}}var Mn={inert:new WeakMap,"aria-hidden":new WeakMap},Nn=`data-base-ui-inert`,Pn={inert:new WeakSet,"aria-hidden":new WeakSet},Fn=new WeakMap,In=0;function Ln(e){return Pn[e]}function Rn(e){return e?pe(e)?e.host:Rn(e.parentNode):null}var zn=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Rn(t);return e.contains(n)?n:null}).filter(e=>e!=null),Bn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Vn=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{U(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Hn(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=zn(t,e),l=i?Vn(t,Bn(c),new Set(c)):[],u=[],d=[];if(a){let e=Mn[a],n=Ln(a);s=n,o=e;let r=zn(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Vn(t,Bn(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Fn.get(e)||0)+1;Fn.set(e,t),d.push(e),t===1&&e.setAttribute(Nn,``)}),In+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Fn.get(e)||0)-1;Fn.set(e,t),t||e.removeAttribute(Nn)}),--In,In||(Mn.inert=new WeakMap,Mn[`aria-hidden`]=new WeakMap,Pn.inert=new WeakSet,Pn[`aria-hidden`]=new WeakSet,Fn=new WeakMap)}}function Un(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Y(e[0]).body;return Hn(e,a,n,r,{mark:i})}var Wn={style:{transition:`none`}},Gn=`data-base-ui-click-trigger`,Kn={fallbackAxisSide:`none`},qn={fallbackAxisSide:`end`},Jn={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Yn=H.createContext(null),Xn=()=>H.useContext(Yn),Zn=kn(`portal`);function Qn(e={}){let{ref:t,container:n,componentProps:i=r,elementProps:a}=e,o=ot(),c=Xn()?.portalNode,[l,u]=H.useState(null),[d,f]=H.useState(null),p=q(e=>{e!==null&&f(e)}),m=H.useRef(null);J(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(fe(n)?n:n.current))??c??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,c]);let h=s(`div`,i,{ref:[t,p],props:[{id:o,[Zn]:``},a]}),g=l&&h?ce.createPortal(h,l):null;return{node:d,nodeId:H.isValidElement(h)?h.props.id:void 0,subtree:g}}var $n=H.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=Qn({container:o,ref:t,componentProps:e,elementProps:s}),d=H.useRef(null),f=H.useRef(null),p=H.useRef(null),m=H.useRef(null),[h,g]=H.useState(null),_=H.useRef(!1),v=h?.modal,y=h?.open,b=!!h&&!h.modal&&h.open&&!!c;H.useEffect(()=>{if(!c||v)return;function e(e){c&&e.relatedTarget&&wn(e)&&(e.type===`focusin`?_.current&&=(En(c),!1):(Tn(c),_.current=!0))}return Vt($(c,`focusin`,e,!0),$(c,`focusout`,e,!0))},[c,v]),J(()=>{!c||y!==!0||!_.current||(En(c),_.current=!1)},[y,c]);let x=H.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,V.jsxs)(H.Fragment,{children:[u,(0,V.jsxs)(Yn.Provider,{value:x,children:[b&&c&&(0,V.jsx)(qt,{"data-type":`outside`,ref:d,onFocus:e=>{wn(e,c)?p.current?.focus():bn(h?h.domReference:null)?.focus()}}),b&&c&&(0,V.jsx)(`span`,{"aria-owns":l,style:Jn}),c&&ce.createPortal(a,c),b&&c&&(0,V.jsx)(qt,{"data-type":`outside`,ref:f,onFocus:e=>{wn(e,c)?m.current?.focus():(yn(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ct(`focus-out`,e.nativeEvent)))}})]})]})});function er(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var tr=class{nodesRef={current:[]};events=er();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},nr=H.createContext(null),rr=H.createContext(null),ir=()=>H.useContext(nr)?.id||null,ar=e=>{let t=H.useContext(rr);return e??t};function or(e){let t=ot(),n=ar(e),r=ir();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function sr(e){let{children:t,id:n}=e,r=ir();return(0,V.jsx)(nr.Provider,{value:H.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function cr(e){let{children:t,externalTree:n}=e,r=a(()=>n??new tr).current;return(0,V.jsx)(rr.Provider,{value:r,children:t})}function lr(e,t){let n=W(Mt(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ur=20,dr=[];function fr(){dr=dr.filter(e=>e.deref()?.isConnected)}function pr(e){fr(),e&&U(e)!==`body`&&(dr.push(new WeakRef(e)),dr.length>ur&&(dr=dr.slice(-20)))}function mr(){return fr(),dr[dr.length-1]?.deref()}function hr(e){return e?hn(e)?e:_n(e)[0]||e:null}function gr(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=gn(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return hn(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function _r(e){let{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=q(()=>x.current.floatingContext?.nodeId),C=a===!1,w=Rt(v)&&C,T=Ht(a),E=Ht(o),D=Ht(u),O=Ht(_),k=ar(m),A=Xn(),j=H.useRef(!1),M=H.useRef(!1),N=H.useRef(!1),P=H.useRef(null),F=H.useRef(``),ee=H.useRef(``),te=H.useRef(null),I=H.useRef(null),re=i(te,p,A?.beforeInsideRef),ie=i(I,A?.afterInsideRef),ae=yt(),oe=yt(),L=pt(),se=A!=null,R=Bt(y),z=q((e=R)=>e?_n(e):[]),B=q(()=>h?.().filter(e=>e!=null)??[]);H.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(R,Z(Y(R)))&&z().length===0&&!w&&bt(e)}return $(Y(R),`keydown`,e)},[r,R,c,w,z]),H.useEffect(()=>{if(r||!_)return;let e=Y(R);function t(){N.current=!1}function n(e){let t=Mt(e),n=B(),r=Q(y,t)||Q(v,t)||Q(A?.portalNode,t)||n.some(e=>e===t||Q(e,t));N.current=!r,ee.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,oe.start(0,()=>{M.current=!1}))}function i(){ee.current=`keyboard`}return Vt($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,y,v,R,_,A,oe,B]),H.useEffect(()=>{if(r||!l)return;let e=Y(R);function t(){M.current=!0,oe.start(0,()=>{M.current=!1})}function n(e){let t=Mt(e);hn(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Mt(t);c&&n==null&&i!=null&&Q(y,i)&&pr(i),queueMicrotask(()=>{let a=S(),o=g.context.triggerElements,l=B(),u=n?.hasAttribute(kn(`focus-guard`))&&[te.current,I.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,X(f),X(d)].includes(n),p=!(Q(v,n)||Q(y,n)||Q(n,y)||Q(A?.portalNode,n)||l.some(e=>e===n||Q(e,n))||o.hasMatchingElement(e=>Q(e,n))||u||k&&(Dn(k.nodesRef.current,a).find(e=>Q(e.context?.elements.floating,n)||Q(e.context?.elements.domReference,n))||On(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Bt(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&R&&gr(R),s&&r!==v&&!en(i)&&Z(e)===e.body){if(K(R)&&(R.focus(),s===`popup`)){L.request(()=>{R.focus()});return}let e=z(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||R;K(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!c)&&n&&p&&!M.current&&(w||n!==mr())&&(j.current=!0,g.setOpen(!1,ct(ne,t)))})}function a(){N.current||(x.current.insideReactTree=!0,ae.start(0,()=>{x.current.insideReactTree=!1}))}let o=K(v)?v:null;if(!(!y&&!o))return Vt(o&&$(o,`focusout`,i),o&&$(o,`pointerdown`,t),y&&$(y,`focusin`,n),y&&$(y,`focusout`,i),y&&A&&$(y,`focusout`,a,!0))},[r,v,y,R,c,k,A,g,l,s,z,w,S,x,ae,oe,L,d,f,B]),H.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${kn(`portal`)}]`)||[]),t=(k?On(k.nodesRef.current,S()):[]).find(e=>Rt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Un([y,...e,te.current,I.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...B(),t,X(f),X(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Un([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,A,w,k,S,d,f,B]),J(()=>{if(!_||r||!K(R))return;F.current=``,ee.current=``;let e=Y(R),t=Z(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Q(R,t))return;let i=null,a=()=>(i??=z(R),i[0]||R),o;o=r===!0||r===null?a():X(r),o||=a();let s=Q(R,Z(e));jn(o,{preventScroll:o===R,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Z(e);return!(t!==o&&Q(R,t))}})})},[r,_,R,z,T,D,O]),J(()=>{if(r||!R)return;let e=Y(R),t=Z(e),n=D.current==null;pr(t);function i(e){if(e.open||(F.current=lr(e.nativeEvent,ee.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(St(e.nativeEvent)||Ct(e.nativeEvent))j.current=!1;else{let e=!1;Y(R).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&U(t)!==`body`?t:null,s=n?o||a:a||o;return s||=mr()||null,typeof i==`boolean`?s:X(i)||s||null}return()=>{b.off(`openchange`,i);let t=Z(e),n=B(),r=Q(y,t)||n.some(e=>e===t||Q(e,t))||k&&Dn(k.nodesRef.current,S(),!1).some(e=>Q(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=hr(c),i=typeof o!=`boolean`;if(o&&!j.current&&K(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,y,R,E,D,b,k,v,S,B]),J(()=>{if(!et||_||!y)return;let e=Z(Y(y));!K(e)||!It(e)||Q(y,e)&&e.blur()},[_,y]),J(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,g,l,v]),J(()=>{if(!(r||!R))return gr(R),()=>{queueMicrotask(fr)}},[r,R]);let ce=!r&&(!c||!w)&&(se||c);return(0,V.jsxs)(H.Fragment,{children:[ce&&(0,V.jsx)(qt,{"data-type":`inside`,ref:re,onFocus:e=>{if(c){let e=z();jn(e[e.length-1])}else A?.portalNode&&(j.current=!1,wn(e,A.portalNode)?yn(v)?.focus():X(f??A.beforeOutsideRef)?.focus())}}),n,ce&&(0,V.jsx)(qt,{"data-type":`inside`,ref:ie,onFocus:e=>{c?jn(z()[0]):A?.portalNode&&(l&&(j.current=!0),wn(e,A.portalNode)?bn(v)?.focus():X(d??A.afterOutsideRef)?.focus())}})]})}function vr(){return!1}function yr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function br(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=vr,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=ar(c),m=q(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=q(()=>a),{escapeKey:v,outsidePress:y}=yr(s),b=H.useRef(!1),x=H.useRef(!1),S=H.useRef(!1),C=H.useRef(!1),w=H.useRef(``),T=H.useRef(null),E=yt(),D=yt(),O=q(()=>{D.clear(),f.current.insideReactTree=!1}),k=q(e=>{let t=f.current.floatingContext?.nodeId;return(p?Dn(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=q(e=>Pt(e,l.select(`floatingElement`))||Pt(e,l.select(`domReferenceElement`))),j=q(e=>{o()&&l.setOpen(!1,ct(N,e.nativeEvent))}),M=q(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=ct(re,xt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),P=q(()=>{f.current.insideReactTree=!0,D.start(0,O)}),F=q(e=>{if(!u||!n||e.button!==0)return;let t=Mt(e.nativeEvent);Q(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),te=q(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});H.useEffect(()=>{if(!u||!n)return O;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new vt,t=new vt;function i(){e.clear(),C.current=!0}function a(){e.start(et?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&Dn(p.nodesRef.current,t).some(t=>Pt(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=Mt(e),r=`[${kn(`inert`)}]`,i=G(n)?n.getRootNode():null,a=Array.from((pe(i)?i:Y(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Q(e,n))))return;let s=G(n)?n:null;for(;s&&!we(s);){let e=De(s);if(we(e)||!G(e))break;s=e}if(!(a.length&&G(n)&&!Ft(n)&&!Q(n,l.select(`floatingElement`))&&a.every(e=>!Q(s,e)))){if(K(n)&&!(`touches`in e)){let t=we(n),r=Te(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,ct(ee,e)),O())}}}function N(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=Mt(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function te(e){w.current=`touch`,F(e,P)}function I(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?N(e):j(e)})}function ne(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function re(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function ie(e){F(e,re)}function ae(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function oe(e){F(e,ae)}let L=Y(d),se=Vt(r&&Vt($(L,`keydown`,M),$(L,`compositionstart`,i),$(L,`compositionend`,a)),g&&Vt($(L,`click`,I,!0),$(L,`pointerdown`,I,!0),$(L,`pointerup`,ne,!0),$(L,`pointercancel`,ne,!0),$(L,`mousedown`,I,!0),$(L,`mouseup`,ne,!0),$(L,`touchstart`,te,!0),$(L,`touchmove`,ie,!0),$(L,`touchend`,oe,!0)));return()=>{se(),e.clear(),t.clear(),s(),S.current=!1,O()}},[f,d,r,g,h,u,n,v,y,M,O,_,k,A,p,l,E]);let I=H.useMemo(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),ne=H.useMemo(()=>({onKeyDown:M,onPointerDown:te,onMouseDown:te,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[M,P,F,te]);return H.useMemo(()=>n?{reference:I,floating:ne,trigger:I}:{},[n,I,ne])}var xr=g((t=>{var n=e();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Sr=g(((e,t)=>{t.exports=xr()})),Cr=g((t=>{var n=e(),r=Sr();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),wr=g(((e,t)=>{t.exports=Cr()})),Tr=Sr(),Er=wr(),Dr=[],Or=void 0;function kr(){return Or}function Ar(e){Dr.push(e)}function jr(e){let t=(t,n)=>{let r=a(Nr).current,i;try{Or=r;for(let e of Dr)e.before(r);i=e(t,n);for(let e of Dr)e.after(r);r.didInitialize=!0}finally{Or=void 0}return i};return t.displayName=e.displayName||e.name,t}function Mr(e){return H.forwardRef(jr(e))}function Nr(){return{didInitialize:!1}}var Pr=h(19)?Lr:Rr;function Fr(e,t,n,r,i){return Pr(e,t,n,r,i)}function Ir(e,t,n,r,i){let a=H.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Tr.useSyncExternalStore)(e.subscribe,a,a)}Ar({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Tr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Lr(e,t,n,r,i){let a=kr();if(!a)return Ir(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Rr(e,t,n,r,i){return(0,Er.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var zr=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Fr(this,e,t,n,r)}},Br=class extends zr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){H.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;J(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){H.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return H.useDebugValue(e),Fr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){H.useDebugValue(e);let n=q(t??c);this.context[e]=n}useStateSetter(e){let t=H.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Vr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Hr=class extends Br{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:er(),nested:n,triggerElements:i},Vr),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Tt(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ur(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=H.useRef(null);r===void 0&&f.current===null&&(f.current=new Hr({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};G(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var Wr={tabIndex:-1,[Et]:``};function Gr(e){return t=>t!==`touch`||e.current}function Kr(e,t=!1){let n=ot(),r=ir()!=null,i=a(()=>e(n,r)).current;return Ur({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function qr({handle:e,store:t}){return J(()=>e.attachStore(t),[e,t]),null}function Jr(e,t){let n=H.useRef(null),r=H.useRef(null);return H.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Yr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Xr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Zr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Jr(e,n),o=q(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=H.useCallback(e=>{a(e),e&&o(e)},[a,o]);return J(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Qr(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=H.useRef(null),i=e.useState(`open`);J(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ct(M);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function $r(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=mt(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=q(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return gt({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ei(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r})},[e])}function ti(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ni=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},ri=`ArrowUp`,ii=`ArrowDown`,ai=`ArrowLeft`,oi=`ArrowRight`,si=`Home`,ci=new Set([ri,ii,ai,oi,si,`End`]),li=[`Shift`,`Control`,`Alt`,`Meta`];function ui(e){return K(e)&&e.tagName===`INPUT`}function di(e){return!!(ui(e)&&e.selectionStart!=null||K(e)&&e.tagName===`TEXTAREA`)}function fi(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=pi(e,t,`left`),a=mi(e),o=mi(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=pi(e,t,`top`),r=mi(e),i=mi(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function pi(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function mi(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function hi(e){return h(19)?e:e?`true`:void 0}var gi=H.createContext(void 0);function _i(){return H.useContext(gi)?.direction??`ltr`}var vi=H.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,V.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),yi={},bi={},xi=``;function Si(e,t){return me(e)?e:t}function Ci(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Si(t,n)).overflowY)}function wi(e){if(typeof document>`u`)return!1;let t=Y(e);return W(t).innerWidth-t.documentElement.clientWidth>0}function Ti(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Y(e),n=t.documentElement,r=t.body,i=Si(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ei(e){let t=Y(e),n=t.documentElement,r=t.body,i=Si(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Di(e){let t=Y(e),n=t.documentElement,r=t.body,i=W(n),a=0,o=0,s=!1,c=ft.create();if(et&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,yi={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},xi=n.style.scrollBehavior,bi={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Si(n,r);if(s=Ti(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,yi),Object.assign(r.style,bi),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=xi)}function d(){u(),c.request(l)}l();let f=$(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Oi=new class{lockCount=0;restore=null;timeoutLock=vt.create();timeoutUnlock=vt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Y(e),n=t.documentElement,r=t.body,i=W(n);if(Ci(i,n,r)){let t=new i.MutationObserver(()=>{Ci(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Ye||!wi(e);this.restore=a?Ei(e):Di(e)}};function ki(e=!0,t=null){J(()=>{if(e)return Oi.acquire(t)},[e,t])}var Ai=H.createContext(void 0),ji={disableStyleElements:!1};function Mi(){return H.useContext(Ai)??ji}var Ni={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Pi={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Fi={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},Ii={invalid:void 0,name:void 0,validityData:{state:Ni,errors:[],error:``,value:``,initialValue:null},setValidityData:c,disabled:void 0,setTouched:c,setDirty:c,setFilled:c,setFocused:c,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Pi,registerFieldControl:c,validation:{getValidationProps:(e,t=r)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:c,getInputControl:()=>null,commit:async()=>{},change:c}},Li=H.createContext(Ii);function Ri(e=!0){let t=H.useContext(Li);if(t.setValidityData===c&&!e)throw Error(f(28));return t}var zi=H.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:c,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function Bi(){return H.useContext(zi)}var Vi=H.createContext({controlId:void 0,registerControlId:c,labelId:void 0,setLabelId:c,messageIds:[],setMessageIds:c,getDescriptionProps:e=>e});function Hi(){return H.useContext(Vi)}function Ui(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:o}=Hi(),s=st(t),l=n?i:void 0,u=a(()=>Symbol()),d=H.useRef(!1),f=H.useRef(t!=null),p=q(()=>{!d.current||o===c||(d.current=!1,o(u.current,void 0))});return J(()=>{if(o===c)return;let e;if(n){let n=r?.current;e=G(n)&&n.closest(`label`)!=null?t??null:l??s}else if(t!=null)f.current=!0,e=t;else if(f.current)e=s;else{p();return}if(e===void 0){p();return}d.current=!0,o(u.current,e)},[t,r,l,o,n,s,u,p]),H.useEffect(()=>p,[p]),i??s}function Wi(e,t,n,r,i=!0,o){let{registerFieldControl:s}=Ri(),c=a(()=>Symbol());J(()=>{let a=c.current;if(!i){s(a,void 0);return}s(a,{controlRef:e,getValue:r,id:t,name:o,value:n})},[e,i,r,t,o,s,c,n]),J(()=>{let e=c.current;return()=>{s(e,void 0)}},[s,c])}var Gi=H.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFocused:b,setFilled:x,validationMode:S,validation:C}=Ri(),{clearErrors:w}=Bi(),T=g||c,E=h??a,D={...m,disabled:T},{labelId:O}=Hi(),k=Ui({id:i});J(()=>{let e=o!=null;C.inputRef.current?.value||e&&o!==``?x(!0):e&&o===``&&x(!1)},[C.inputRef,x,o]);let A=H.useRef(null);J(()=>{d&&A.current===Z(Y(A.current))&&b(!0)},[d,b]);let[j]=le({controlled:o,default:u,name:`FieldControl`,state:`value`}),N=o!==void 0,P=N?j:void 0,F=q(()=>C.inputRef.current?.value);return Wi(C.inputRef,k,P,F,!T,a),s(`input`,e,{ref:[t,A],state:D,props:[{id:k,disabled:T,name:E,ref:C.inputRef,"aria-labelledby":O,autoFocus:d,...N?{value:P}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;l?.(t,ct(M,e.nativeEvent)),v(t!==(y.initialValue??``)),x(t!==``),e.nativeEvent.defaultPrevented||(w(E),C.change(t))},onFocus(){b(!0)},onBlur(e){_(!0),b(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(_(!0),C.commit(e.currentTarget.value))}},p,e=>C.getValidationProps(T,e)],stateAttributesMapping:Fi})}),Ki=H.forwardRef(function(e,t){return(0,V.jsx)(Gi,{ref:t,...e})});function qi({className:e,size:t=`default`,unstyled:n=!1,nativeInput:r=!1,...i}){let a=l(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,i.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,i.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),o;if(r){let{style:e,onValueChange:n,...r}=i;o=(0,V.jsx)(`input`,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,style:typeof e==`function`?void 0:e,...r})}else o=(0,V.jsx)(Ki,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,...i});return(0,V.jsx)(`span`,{className:l(!n&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:o})}var Ji=u(`relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs`,lg:`h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm`,sm:`h-5 min-w-5 rounded-[.25rem] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]`},variant:{default:`bg-primary text-primary-foreground [button&,a&]:hover:bg-primary/90`,destructive:`bg-destructive text-white [button&,a&]:hover:bg-destructive/90`,error:`bg-destructive/8 text-destructive-foreground dark:bg-destructive/16`,info:`bg-info/8 text-info-foreground dark:bg-info/16`,outline:`border-input bg-background text-foreground dark:bg-input/32 [button&,a&]:hover:bg-accent/50 dark:[button&,a&]:hover:bg-input/48`,secondary:`bg-secondary text-secondary-foreground [button&,a&]:hover:bg-secondary/90`,success:`bg-success/8 text-success-foreground dark:bg-success/16`,warning:`bg-warning/8 text-warning-foreground dark:bg-warning/16`}}});function Yi({className:e,variant:t,size:n,render:r,...i}){let a={className:l(Ji({className:e,size:n,variant:t})),"data-slot":`badge`};return p({defaultTagName:`span`,props:d(a,i),render:r})}export{Wn as $,ze as $t,Qr as A,te as An,jt as At,jr as B,A as Bn,gt as Bt,fi as C,ae as Cn,Nt as Ct,Xr as D,ne as Dn,Z as Dt,qr as E,re as En,zt as Et,Zr as F,oe as Fn,St as Ft,sr as G,v as Gn,ct as Gt,Sr as H,k as Hn,mt as Ht,Ur as I,F as In,Ct as It,ir as J,nt as Jt,cr as K,st as Kt,Hr as L,P as Ln,bt as Lt,ei as M,se as Mn,kt as Mt,Kr as N,M as Nn,At as Nt,Gr as O,z as On,Q as Ot,ti as P,ee as Pn,wt as Pt,Gn as Q,Be as Qt,Br as R,N as Rn,vt as Rt,di as S,le as Sn,Lt as St,Wr as T,L as Tn,It as Tt,br as U,O as Un,pt as Ut,Mr as V,j as Vn,ht as Vt,_r as W,S as Wn,lt as Wt,tr as X,Ye as Xt,ar as Y,et as Yt,$n as Z,Qe as Zt,oi as _,we as _n,Kt as _t,Ui as a,Te as an,yn as at,si as b,ge as bn,$ as bt,Ri as c,Ae as cn,wn as ct,ki as d,ke as dn,Yt as dt,Y as en,Kn as et,vi as f,De as fn,en as ft,ai as g,K as gn,Gt as gt,ii as h,G as hn,qt as ht,Wi as i,q as in,Dn as it,$r as j,ie as jn,Ot as jt,Yr as k,R as kn,Mt as kt,Fi as l,U as ln,Zt as lt,hi as m,xe as mn,Qt as mt,qi as n,Le as nn,jn as nt,Hi as o,Se as on,Sn as ot,_i as p,W as pn,Jt as pt,or as q,ot as qt,Gi as r,J as rn,kn as rt,Bi as s,de as sn,Cn as st,Yi as t,Ie as tn,qn as tt,Mi as u,Ee as un,Xt as ut,ri as v,me as vn,Ht as vt,ni as w,I as wn,Rt as wt,li as x,Ce as xn,Bt as xt,ci as y,he as yn,Vt as yt,Fr as z,B as zn,yt as zt};
@@ -1,3 +0,0 @@
1
- import{_ as e,b as t,h as n}from"./button-CREn1mup.js";var r=n(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),i=t(e(),1),a=`modulepreload`,o=function(e){return`/`+e},s={},c=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),c=i?.nonce||i?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function u(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=l(t.map(t=>{if(t=o(t,n),t=u(t),t in s)return;s[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:a,r||(i.as=`script`),i.crossOrigin=``,i.href=t,c&&i.setAttribute(`nonce`,c),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},l=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,u=/^[\\/]{2}/;function d(e,t){return t+e.replace(/\\/g,`/`)}var f=`popstate`;function p(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function m(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=x(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),y(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:b(t))}function r(e,t){g(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return S(t,n,r,e)}function h(e,t){if(e===!1||e==null)throw Error(t)}function g(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _(){return Math.random().toString(36).substring(2,10)}function v(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function y(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?x(t):t,state:n,key:t&&t.key||r||_(),mask:i}}function b({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function x(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function S(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:_.location,delta:t})}function m(e,t){s=`PUSH`;let r=p(e)?e:y(_.location,e,t);n&&n(r,e),l=u()+1;let d=v(r,l),f=_.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:_.location,delta:1})}function h(e,t){s=`REPLACE`;let r=p(e)?e:y(_.location,e,t);n&&n(r,e),l=u();let i=v(r,l),d=_.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:_.location,delta:0})}function g(e){return C(i,e)}let _={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(f,d),c=e,()=>{i.removeEventListener(f,d),c=null}},createHref(e){return t(i,e)},createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return _}function C(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),h(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:b(t);return i=i.replace(/ $/,`%20`),!n&&u.test(i)&&(i=r+i),new URL(i,r)}function w(e,t,n=`/`){return T(e,t,n,!1)}function T(e,t,n,r,i){let a=A((typeof t==`string`?x(t):t).pathname||`/`,n);if(a==null)return null;let o=i??E(e),s=null,c=pe(a);for(let e=0;s==null&&e<o.length;++e)s=ue(o[e],c,r);return s}function E(e){let t=D(e);return te(t),t}function D(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;h(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=P([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(h(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),D(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ce(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=fe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ee(e.path))a(e,t,!0,n)}),t}function ee(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ee(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function te(e){e.sort((e,t)=>e.score===t.score?le(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ne=/^:[\w-]+$/,O=3,re=2,ie=1,ae=10,oe=-2,se=e=>e===`*`;function ce(e,t){let n=e.split(`/`),r=n.length;return n.some(se)&&(r+=oe),t&&(r+=re),n.filter(e=>!se(e)).reduce((e,t)=>e+(ne.test(t)?O:t===``?ie:ae),r)}function le(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ue(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?de(u,l,s.matcher,s.compiledParams):k(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=k({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:P([a,d.pathname]),pathnameBase:ve(P([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=P([a,d.pathnameBase]))}return o}function k(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fe(e.path,e.caseSensitive,e.end);return de(e,t,n,r)}function de(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=F(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=F(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function fe(e,t=!1,n=!0){g(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function pe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return g(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function A(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function me(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?x(e):e,a;return n?(n=_e(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?he(n.substring(1),`/`):he(n,t)):a=t,{pathname:a,search:ye(r),hash:be(i)}}function he(e,t){let n=F(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function j(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ge(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function M(e){let t=ge(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function N(e,t,n,r=!1){let i;typeof e==`string`?i=x(e):(i={...e},h(!i.pathname||!i.pathname.includes(`?`),j(`?`,`pathname`,`search`,i)),h(!i.pathname||!i.pathname.includes(`#`),j(`#`,`pathname`,`hash`,i)),h(!i.search||!i.search.includes(`#`),j(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=me(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var _e=e=>e.replace(/[\\/]{2,}/g,`/`),P=e=>_e(e.join(`/`));function F(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var ve=e=>F(e).replace(/^\/*/,`/`),ye=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,be=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,xe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Se(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ce(e){return P(e.map(e=>e.route.path).filter(Boolean))||`/`}var we=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Te(e,t){let n=e;if(typeof n!=`string`||!l.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(we)try{let e=new URL(window.location.href),r=u.test(n)?new URL(d(n,e.protocol)):new URL(n),a=A(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{g(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ee=new URL(`http://localhost`);function De(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ee)}catch{return Ee}}function Oe(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function ke(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function I(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Oe(i,n),s=!Oe(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!ke(e,i)||!Oe(i,a)))throw Error(`External navigation is not allowed`)}var Ae=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ae);var je=[`GET`,...Ae];new Set(je);var Me=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ne(e){try{return Me.includes(new URL(e).protocol)}catch{return!1}}var L=i.createContext(null);L.displayName=`DataRouter`;var R=i.createContext(null);R.displayName=`DataRouterState`;var Pe=i.createContext(!1);function Fe(){return i.useContext(Pe)}var Ie=i.createContext({isTransitioning:!1});Ie.displayName=`ViewTransition`;var Le=i.createContext(new Map);Le.displayName=`Fetchers`;var Re=i.createContext(null);Re.displayName=`Await`;var z=i.createContext(null);z.displayName=`Navigation`;var B=i.createContext(null);B.displayName=`Location`;var V=i.createContext({outlet:null,matches:[],isDataRoute:!1});V.displayName=`Route`;var H=i.createContext(null);H.displayName=`RouteError`;var ze=`REACT_ROUTER_ERROR`,Be=`REDIRECT`,Ve=`ROUTE_ERROR_RESPONSE`;function He(e){if(e.startsWith(`${ze}:${Be}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ue(e){if(e.startsWith(`${ze}:${Ve}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new xe(t.status,t.statusText,t.data)}catch{}}function We(e,{relative:t}={}){h(U(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=i.useContext(z),{hash:a,pathname:o,search:s}=K(e,{relative:t}),c=o;return n!==`/`&&(c=o===`/`?n:P([n,o])),r.createHref({pathname:c,search:s,hash:a})}function U(){return i.useContext(B)!=null}function W(){return h(U(),`useLocation() may be used only in the context of a <Router> component.`),i.useContext(B).location}var Ge=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ke(e){i.useContext(z).static||i.useLayoutEffect(e)}function G(){let{isDataRoute:e}=i.useContext(V);return e?ut():qe()}function qe(){h(U(),`useNavigate() may be used only in the context of a <Router> component.`);let e=i.useContext(L),{basename:t,navigator:n}=i.useContext(z),{matches:r}=i.useContext(V),{pathname:a}=W(),o=JSON.stringify(M(r)),s=i.useRef(!1);return Ke(()=>{s.current=!0}),i.useCallback((r,i={})=>{if(g(s.current,Ge),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=N(r,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:P([t,c.pathname])),I(typeof r==`string`?r:b(r),n.createHref(c),De(n),`reject`),(i.replace?n.replace:n.push)(c,i.state,i)},[t,n,o,a,e])}i.createContext(null);function K(e,{relative:t}={}){let{matches:n}=i.useContext(V),{pathname:r}=W(),a=JSON.stringify(M(n));return i.useMemo(()=>N(e,JSON.parse(a),r,t===`path`),[e,a,r,t])}function Je(e,t){return Ye(e,t)}function Ye(e,t,n){h(U(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=i.useContext(z),{matches:a}=i.useContext(V),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,u=o&&o.route;{let e=u&&u.path||``;ft(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
-
3
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=W(),f;if(t){let e=typeof t==`string`?x(t):t;h(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):w(e,{pathname:m});g(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),g(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let v=nt(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:P([l,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:P([l,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&v?i.createElement(B.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function Xe(){let e=lt(),t=Se(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:r},o={padding:`2px 4px`,backgroundColor:r},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=i.createElement(i.Fragment,null,i.createElement(`p`,null,`💿 Hey developer 👋`),i.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,i.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,i.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),i.createElement(i.Fragment,null,i.createElement(`h2`,null,`Unexpected Application Error!`),i.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?i.createElement(`pre`,{style:a},n):null,s)}var Ze=i.createElement(Xe,null),Qe=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ue(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:i.createElement(V.Provider,{value:this.props.routeContext},i.createElement(H.Provider,{value:e,children:this.props.component}));return this.context?i.createElement(et,{error:e},t):t}};Qe.contextType=Pe;var $e=new WeakMap;function et({children:e,error:t}){let{basename:n,navigator:r}=i.useContext(z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=He(t.digest);if(e){let a=$e.get(t);if(a)throw a;let o=Te(e.location,n),s=o.absoluteURL||o.to;if(I(e.location,s,De(r),`allow-explicit`),Ne(s))throw Error(`Invalid redirect location`);if(we&&!$e.get(t)){if(o.isExternal||e.reloadDocument)window.location.href=s;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace}));throw $e.set(t,n),n}}return i.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${s}`})}}return e}function tt({routeContext:e,match:t,children:n}){let r=i.useContext(L);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(V.Provider,{value:e},n)}function nt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,o=r?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);h(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r){s=r.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:i}=r,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!i||i[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=n?.onError,u=r&&l?(e,t)=>{l(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ce(r.matches),errorInfo:t})}:void 0;return a.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;r&&(d=o&&n.route.id?o[n.route.id]:void 0,p=n.route.errorElement||Ze,s&&(c<0&&l===0?(ft(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?i.createElement(n.route.Component,null):n.route.element?n.route.element:e,i.createElement(tt,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?i.createElement(Qe,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function rt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function it(e){let t=i.useContext(L);return h(t,rt(e)),t}function at(e){let t=i.useContext(R);return h(t,rt(e)),t}function ot(e){let t=i.useContext(V);return h(t,rt(e)),t}function st(e){let t=ot(e),n=t.matches[t.matches.length-1];return h(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ct(){return st(`useRouteId`)}function lt(){let e=i.useContext(H),t=at(`useRouteError`),n=st(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ut(){let{router:e}=it(`useNavigate`),t=st(`useNavigate`),n=i.useRef(!1);return Ke(()=>{n.current=!0}),i.useCallback(async(r,i={})=>{g(n.current,Ge),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var dt={};function ft(e,t,n){!t&&!dt[e]&&(dt[e]=!0,g(!1,n))}i.memo(pt);function pt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Ye(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function mt({to:e,replace:t,state:n,relative:r}){h(U(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a,navigator:o}=i.useContext(z);g(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:s}=i.useContext(V),{pathname:c}=W(),l=G(),u=N(e,M(s),c,r===`path`);I(typeof e==`string`?e:b(e),o.createHref(u),De(o),`reject`);let d=JSON.stringify(u);return i.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function ht(e){h(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function gt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:a,static:o=!1,useTransitions:s}){h(!U(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=i.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=x(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:_}=n,v=i.useMemo(()=>{let e=A(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:_},navigationType:r}},[c,u,d,f,p,m,r,_]);return g(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:i.createElement(z.Provider,{value:l},i.createElement(B.Provider,{children:t,value:v}))}function _t({children:e,location:t}){return Je(vt(e),t)}i.Component;function vt(e,t=[]){let n=[];return i.Children.forEach(e,(e,r)=>{if(!i.isValidElement(e))return;let a=[...t,r];if(e.type===i.Fragment){n.push.apply(n,vt(e.props.children,a));return}h(e.type===ht,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),h(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let o={id:e.props.id||a.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=vt(e.props.children,a)),n.push(o)}),n}var q=`get`,J=`application/x-www-form-urlencoded`;function Y(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function yt(e){return Y(e)&&e.tagName.toLowerCase()===`button`}function bt(e){return Y(e)&&e.tagName.toLowerCase()===`form`}function xt(e){return Y(e)&&e.tagName.toLowerCase()===`input`}function St(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ct(e,t){return e.button===0&&(!t||t===`_self`)&&!St(e)}function X(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function wt(e,t){let n=X(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Z=null;function Tt(){if(Z===null)try{new FormData(document.createElement(`form`),0),Z=!1}catch{Z=!0}return Z}var Et=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Dt(e){return e!=null&&!Et.has(e)?(g(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${J}"`),null):e}function Ot(e,t){let n,r,i,a,o;if(bt(e)){let o=e.getAttribute(`action`);r=o?A(o,t):null,n=e.getAttribute(`method`)||q,i=Dt(e.getAttribute(`enctype`))||J,a=new FormData(e)}else if(yt(e)||xt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?A(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||q,i=Dt(e.getAttribute(`formenctype`))||Dt(o.getAttribute(`enctype`))||J,a=new FormData(o,e),!Tt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Y(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=q,r=null,i=J,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function kt(e,t){if(e===!1||e==null)throw Error(t)}function At(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&A(i.pathname,t)===`/`?`${F(t)}/_root.${r}`:`${F(i.pathname)}.${r}`,i}async function jt(e,t){if(e.id in t)return t[e.id];try{let n=await c(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Mt(e){return e!=null&&typeof e.page==`string`}function Nt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Pt(e,t,n){return zt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await jt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Nt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Ft(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function It(e,t,{includeHydrateFallback:n}={}){return Lt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Lt(e){return[...new Set(e)]}function Rt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function zt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Mt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Rt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Bt(){let e=i.useContext(L);return kt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Vt(){let e=i.useContext(R);return kt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ht=i.createContext(void 0);Ht.displayName=`FrameworkContext`;function Q(){let e=i.useContext(Ht);return kt(e,`You must render this element inside a <HydratedRouter> element`),e}function Ut(e,t){let n=i.useContext(Ht),[r,a]=i.useState(!1),[o,s]=i.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=i.useRef(null);i.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),i.useEffect(()=>{if(r){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return n?e===`intent`?[o,p,{onFocus:$(c,m),onBlur:$(l,h),onMouseEnter:$(u,m),onMouseLeave:$(d,h),onTouchStart:$(f,m)}]:[o,p,{}]:[!1,p,{}]}function $(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Wt({page:e,...t}){let n=Fe(),{nonce:r}=Q(),{router:a}=Bt(),o=i.useMemo(()=>w(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&r&&(t={...t,nonce:r}),n?i.createElement(Kt,{page:e,matches:o,...t}):i.createElement(qt,{page:e,matches:o,...t})):null}function Gt(e){let{manifest:t,routeModules:n}=Q(),[r,a]=i.useState([]);return i.useEffect(()=>{let r=!1;return Pt(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),r}function Kt({page:e,matches:t,...n}){let r=W(),{future:a}=Q(),{basename:o}=Bt(),s=i.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=At(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),i=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:s.push(e.route.id);return i&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,r,t]);return i.createElement(i.Fragment,null,s.map(e=>i.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function qt({page:e,matches:t,...n}){let r=W(),{future:a,manifest:o,routeModules:s}=Q(),{basename:c}=Bt(),{loaderData:l,matches:u}=Vt(),d=i.useMemo(()=>Ft(e,t,u,o,r,`data`),[e,t,u,o,r]),f=i.useMemo(()=>Ft(e,t,u,o,r,`assets`),[e,t,u,o,r]),p=i.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,i=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:n.add(e.route.id))}),n.size===0)return[];let u=At(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return i&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.v8_trailingSlashAwareDataRequests,l,r,o,d,t,e,s]),m=i.useMemo(()=>It(f,o),[f,o]),h=Gt(f);return i.createElement(i.Fragment,null,p.map(e=>i.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>i.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>i.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Jt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}i.Component;var Yt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Yt&&(window.__reactRouterVersion=`7.18.3`)}catch{}function Xt({basename:e,children:t,useTransitions:n,window:r}){let a=i.useRef();a.current??=m({window:r,v5Compat:!0});let o=a.current,[s,c]=i.useState({action:o.action,location:o.location}),l=i.useCallback(e=>{n===!1?c(e):i.startTransition(()=>c(e))},[n]);return i.useLayoutEffect(()=>o.listen(l),[o,l]),i.createElement(gt,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,useTransitions:n})}var Zt=i.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:a,replace:o,mask:s,state:c,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=i.useContext(z),b=typeof d==`string`&&l.test(d),x=Te(d,_);d=x.to;let S=We(d,{relative:r}),C=W(),w=null;if(s){let e=N(s,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:P([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=Ut(n,h),ee=nn(d,{replace:o,mask:s,state:c,target:u,preventScrollReset:f,relative:r,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let ne=!(x.isExternal||a),O=i.createElement(`a`,{...h,...D,href:(ne?w:void 0)||x.absoluteURL||S,onClick:ne?te:e,ref:Jt(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?i.createElement(i.Fragment,null,O,i.createElement(Wt,{page:S})):O});Zt.displayName=`Link`;var Qt=i.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=K(o,{relative:l.relative}),f=W(),p=i.useContext(R),{navigator:m,basename:h}=i.useContext(z),g=p!=null&&ln(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=A(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return i.createElement(Zt,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});Qt.displayName=`NavLink`;var $t=i.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:s=q,action:c,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=i.useContext(z),v=sn(),y=cn(c,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&l.test(c);return i.createElement(`form`,{ref:g,method:b,action:y,onSubmit:r?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,c=r?.getAttribute(`formmethod`)||s,l=()=>v(r||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?i.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});$t.displayName=`Form`;function en(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tn(e){let t=i.useContext(L);return h(t,en(e)),t}function nn(e,{target:t,replace:n,mask:r,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=G(),f=W(),p=K(e,{relative:s});return i.useCallback(m=>{if(Ct(m,t)){m.preventDefault();let t=n===void 0?b(f)===b(p):n,h=()=>d(e,{replace:t,mask:r,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?i.startTransition(()=>h()):h()}},[f,d,p,n,r,a,t,e,o,s,c,l,u])}function rn(e){g(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=i.useRef(X(e)),n=i.useRef(!1),r=W(),a=i.useMemo(()=>wt(r.search,n.current?null:t.current),[r.search]),o=G();return[a,i.useCallback((e,t)=>{let r=X(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var an=0,on=()=>`__${String(++an)}__`;function sn(){let{router:e}=tn(`useSubmit`),{basename:t}=i.useContext(z),n=ct(),r=e.fetch,a=e.navigate;return i.useCallback(async(e,i={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ot(e,t);if(i.navigate===!1){let e=i.fetcherKey||on();await r(e,n,i.action||o,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:l,body:u,formMethod:i.method||s,formEncType:i.encType||c,flushSync:i.flushSync})}else await a(i.action||o,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:l,body:u,formMethod:i.method||s,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[r,a,t,n])}function cn(e,{relative:t}={}){let{basename:n}=i.useContext(z),r=i.useContext(V);h(r,`useFormAction must be used inside a RouteContext`);let[a]=r.matches.slice(-1),o={...K(e||`.`,{relative:t})},s=W();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(o.pathname=o.pathname===`/`?n:P([n,o.pathname])),b(o)}function ln(e,{relative:t}={}){let n=i.useContext(Ie);h(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=tn(`useViewTransitionState`),a=K(e,{relative:t});if(!n.isTransitioning)return!1;let o=A(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=A(n.nextLocation.pathname,r)||n.nextLocation.pathname;return k(a.pathname,s)!=null||k(a.pathname,o)!=null}export{ht as a,G as c,r as d,mt as i,rn as l,Zt as n,_t as o,Qt as r,W as s,Xt as t,c as u};