opencami 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +60 -0
  2. package/dist/client/assets/CSPContext-BBLAL_m_.js +1 -0
  3. package/dist/client/assets/DirectionContext-DXnZc0zz.js +1 -0
  4. package/dist/client/assets/_sessionKey-BidmO1-D.js +100 -0
  5. package/dist/client/assets/agents-CtZs_u1j.js +2 -0
  6. package/dist/client/assets/agents-screen-Basce5qo.js +1 -0
  7. package/dist/client/assets/bots-C_dWjy3z.js +2 -0
  8. package/dist/client/assets/bots-screen-n_xhYOEE.js +1 -0
  9. package/dist/client/assets/button-BaHefIXU.js +1 -0
  10. package/dist/client/assets/c-BIGW1oBm.js +1 -0
  11. package/dist/client/assets/{connect-D3baVDFL.js → connect-DHr3hhUR.js} +1 -1
  12. package/dist/client/assets/core-BrHBc0Zp.js +12 -0
  13. package/dist/client/assets/cpp-B-lmv-kZ.js +1 -0
  14. package/dist/client/assets/csharp-K5feNrxe.js +1 -0
  15. package/dist/client/assets/css-DPfMkruS.js +1 -0
  16. package/dist/client/assets/diff-D97Zzqfu.js +1 -0
  17. package/dist/client/assets/dockerfile-BcOcwvcX.js +1 -0
  18. package/dist/client/assets/engine-javascript-PwbX1GN8.js +141 -0
  19. package/dist/client/assets/file-explorer-screen-8t6M4Xco.js +1 -0
  20. package/dist/client/assets/files-BdlpK3Cy.js +2 -0
  21. package/dist/client/assets/go-Dn2_MT6a.js +1 -0
  22. package/dist/client/assets/graphql-ChdNCCLP.js +1 -0
  23. package/dist/client/assets/html-GMplVEZG.js +1 -0
  24. package/dist/client/assets/index-B2iG4EM1.js +3 -0
  25. package/dist/client/assets/{index-ByIsZcHh.js → index-GTR-Xzl2.js} +1 -1
  26. package/dist/client/assets/index-T4TOjvD0.js +1 -0
  27. package/dist/client/assets/java-CylS5w8V.js +1 -0
  28. package/dist/client/assets/javascript-wDzz0qaB.js +1 -0
  29. package/dist/client/assets/json-Cp-IABpG.js +1 -0
  30. package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
  31. package/dist/client/assets/keyboard-shortcuts-dialog-CcKSlK52.js +1 -0
  32. package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
  33. package/dist/client/assets/{main-CkIF0soY.js → main-mIHr_ble.js} +129 -17
  34. package/dist/client/assets/markdown-Cvjx9yec.js +1 -0
  35. package/dist/client/assets/{opencami-logo-CIxSO1oo.js → opencami-logo-CRIdKbbZ.js} +1 -1
  36. package/dist/client/assets/php-CDn_0X-4.js +1 -0
  37. package/dist/client/assets/python-B6aJPvgy.js +1 -0
  38. package/dist/client/assets/react-Cfq4ot0g.js +1 -0
  39. package/dist/client/assets/regexp-CDVJQ6XC.js +1 -0
  40. package/dist/client/assets/ruby-FDmvQDUv.js +1 -0
  41. package/dist/client/assets/rust-B1yitclQ.js +1 -0
  42. package/dist/client/assets/search-dialog-D19x_xaG.js +1 -0
  43. package/dist/client/assets/session-export-dialog-DRlJwhMa.js +1 -0
  44. package/dist/client/assets/settings-dialog-BA5FjiyP.js +1 -0
  45. package/dist/client/assets/shell-DfDnw5Jg.js +1 -0
  46. package/dist/client/assets/skills-lmNPZksG.js +2 -0
  47. package/dist/client/assets/skills-panel-Cv-N_MDk.js +5 -0
  48. package/dist/client/assets/sql-BLtJtn59.js +1 -0
  49. package/dist/client/assets/styles-JgjN_ZCd.css +1 -0
  50. package/dist/client/assets/swift-Dg5xB15N.js +1 -0
  51. package/dist/client/assets/switch-Bh9tVOYh.js +1 -0
  52. package/dist/client/assets/tabs-BfaEc9zS.js +1 -0
  53. package/dist/client/assets/toml-vGWfd6FD.js +1 -0
  54. package/dist/client/assets/tooltip-w9D-e_R-.js +1 -0
  55. package/dist/client/assets/tsx-COt5Ahok.js +1 -0
  56. package/dist/client/assets/typescript-BPQ3VLAy.js +1 -0
  57. package/dist/client/assets/use-file-explorer-state-CLaDuI9X.js +12 -0
  58. package/dist/client/assets/useButton-DsMdJPGn.js +1 -0
  59. package/dist/client/assets/useCompositeItem-CaYygSfB.js +1 -0
  60. package/dist/client/assets/{useControlled-Y306krcC.js → useControlled-wOKVgKF4.js} +1 -1
  61. package/dist/client/assets/{useMutation-0WgW4xQJ.js → useMutation-fJnleJAb.js} +1 -1
  62. package/dist/client/assets/visuallyHidden-CqGRL_Oq.js +9 -0
  63. package/dist/client/assets/vitesse-dark-D0r3Knsf.js +1 -0
  64. package/dist/client/assets/vitesse-light-CVO1_9PV.js +1 -0
  65. package/dist/client/assets/xml-sdJ4AIDG.js +1 -0
  66. package/dist/client/assets/yaml-Buea-lGh.js +1 -0
  67. package/dist/server/assets/{_sessionKey-BhFH4uWY.js → _sessionKey-B5UHBd2U.js} +190 -54
  68. package/dist/server/assets/_tanstack-start-manifest_v-D11xMFUx.js +4 -0
  69. package/dist/server/assets/{agents-Dz_i76VW.js → agents-CmQ4vvXm.js} +1 -1
  70. package/dist/server/assets/{agents-screen-CqQPJndp.js → agents-screen-bmrIyFbk.js} +43 -35
  71. package/dist/server/assets/{bots-6ryCIgKh.js → bots-Byt6jv0a.js} +1 -1
  72. package/dist/server/assets/bots-screen-C2TGFv42.js +474 -0
  73. package/dist/server/assets/{button-DtQ3rV1m.js → button-CwY2OHFj.js} +2 -2
  74. package/dist/server/assets/{connect-B8jpGQGK.js → connect-CbgijWz4.js} +2 -35
  75. package/dist/server/assets/{file-explorer-screen-DCfS_Ajx.js → file-explorer-screen-CVlFiAFu.js} +36 -36
  76. package/dist/server/assets/{files-D2GIrPF4.js → files-BIEcSPGp.js} +1 -1
  77. package/dist/server/assets/{index-B2JHn34C.js → index--_jH_0mX.js} +2 -1
  78. package/dist/server/assets/{index-BNSsDaLb.js → index-Dl2BOKP7.js} +116 -82
  79. package/dist/server/assets/{keyboard-shortcuts-dialog-CqIm8aYF.js → keyboard-shortcuts-dialog-CsNP85q8.js} +2 -2
  80. package/dist/server/assets/{router-Dme7USeO.js → router-DJA7GtMo.js} +356 -64
  81. package/dist/server/assets/{search-dialog-DG0D9KRN.js → search-dialog-C2a3OYm_.js} +64 -83
  82. package/dist/server/assets/{session-export-dialog-DLPZVlQV.js → session-export-dialog-CwclV0Aj.js} +2 -2
  83. package/dist/server/assets/{settings-dialog-BaGT4e5l.js → settings-dialog-CHVzrou9.js} +390 -128
  84. package/dist/server/assets/skills-Cy8xclXY.js +11 -0
  85. package/dist/server/assets/skills-panel-BnRNb7u9.js +762 -0
  86. package/dist/server/assets/{switch-DnX0MjGS.js → switch-BbkUeVDV.js} +1 -1
  87. package/dist/server/assets/tabs-DDFZob0m.js +67 -0
  88. package/dist/server/assets/{tooltip-gbV6rEVv.js → tooltip-DgsSPocE.js} +1 -1
  89. package/dist/server/assets/{use-file-explorer-state-DfAKF2gZ.js → use-file-explorer-state-Il1LlBAe.js} +1 -1
  90. package/dist/server/server.js +2 -2
  91. package/package.json +7 -2
  92. package/dist/client/assets/_sessionKey-DB95zj1L.js +0 -97
  93. package/dist/client/assets/agents-LFrWe-HX.js +0 -2
  94. package/dist/client/assets/agents-screen-CEBBk1yO.js +0 -1
  95. package/dist/client/assets/bots-CxDwf_WK.js +0 -2
  96. package/dist/client/assets/bots-screen-D6qma1wK.js +0 -1
  97. package/dist/client/assets/button-Il3CHIzX.js +0 -1
  98. package/dist/client/assets/file-explorer-screen-rtV6n-5_.js +0 -1
  99. package/dist/client/assets/files-DMemuq9D.js +0 -2
  100. package/dist/client/assets/index-CVV4XiZo.js +0 -153
  101. package/dist/client/assets/keyboard-shortcuts-dialog-DXC0YHoy.js +0 -1
  102. package/dist/client/assets/react-BhVdgA5r.js +0 -1
  103. package/dist/client/assets/search-dialog-I1jJplIh.js +0 -1
  104. package/dist/client/assets/session-export-dialog-CH5unryw.js +0 -1
  105. package/dist/client/assets/settings-dialog-B8v-GVJ8.js +0 -1
  106. package/dist/client/assets/styles-BaTVzdPa.css +0 -1
  107. package/dist/client/assets/switch-sQnv1YsK.js +0 -1
  108. package/dist/client/assets/tooltip-j_viC_EE.js +0 -1
  109. package/dist/client/assets/use-file-explorer-state-BUH-u7Jv.js +0 -12
  110. package/dist/client/assets/useButton-9VAzplAB.js +0 -9
  111. package/dist/server/assets/_tanstack-start-manifest_v-BaIrL1VQ.js +0 -4
  112. package/dist/server/assets/bots-screen-DS_ZF9Ec.js +0 -417
@@ -0,0 +1,12 @@
1
+ import{r,j as H,f as vt}from"./main-mIHr_ble.js";import{E as Rt,aa as Ge,ag as st,ah as Gn,ab as Le,af as Te,ae as Wn,C as Qt,c as Be,B as $n,ac as Ct}from"./button-BaHefIXU.js";import{j as Zt,a as xe,i as ke,u as pe,t as Ve,o as en,g as de,k as Ye,l as ct,h as Yn,m as nt,p as ot,q as tn,f as It,r as qn,d as ut,s as nn,v as on,w as rn,x as $e,y as Lt,z as _n,A as zn,B as Xn,b as Jn,D as Qn}from"./useButton-DsMdJPGn.js";import{u as Ie,e as Tt,f as Zn,h as Ne,i as wt,t as sn,j as Mt,k as Bt,l as jt,r as Pe,m as Ht,F as it,n as Et,o as an,p as eo,q as cn,C as to,v as no,w as lt,x as dt,y as Ot,z as Xe,A as un,B as ln,D as Ut,E as oo,G as dn,H as fn,I as pn,J as gn,K as Pt,R as mn,P as bn,L as hn,M as yn,N as Q,O as ro,Q as so,S as io,U as ao,V as co,W as uo,X as xn,Y as vn,Z as lo,_ as fo,$ as po,a0 as go,a1 as mo,a2 as bo,a3 as ho,a4 as yo,a5 as Vt,a6 as xo}from"./tooltip-w9D-e_R-.js";import{h as Ee,i as St,j as at,d as Ae,e as ie,k as Rn,l as Cn,s as Se,m as Ue,n as Kt,p as vo,q as Ro,a as ft,b as qe,c as _e,A as En,o as De,t as Sn,v as Co,u as Eo}from"./DirectionContext-DXnZc0zz.js";import{o as Gt,g as mt,b as Wt,c as So,d as bt,e as Io,f as To,k as wo,n as Je,t as In,v as Mo,C as Oo,u as Po}from"./useCompositeItem-CaYygSfB.js";import{a as ko}from"./visuallyHidden-CqGRL_Oq.js";import{c as Fo}from"./react-Cfq4ot0g.js";let $t=0;function rt(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame($t);const u=()=>e?.focus({preventScroll:n});i?u():$t=requestAnimationFrame(u)}const Ke={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Yt(e){return e==="inert"?Ke.inert:e==="aria-hidden"?Ke["aria-hidden"]:Ke.none}let Qe=new WeakSet,Ze={},ht=0;const Tn=e=>e&&(e.host||Tn(e.parentNode)),No=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Tn(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Do(e,t,n,o){const i="data-base-ui-inert",u=o?"inert":n?"aria-hidden":null,p=No(t,e),a=new Set,c=new Set(p),C=[];Ze[i]||(Ze[i]=new WeakMap);const x=Ze[i];p.forEach(v),h(t),a.clear();function v(y){!y||a.has(y)||(a.add(y),y.parentNode&&v(y.parentNode))}function h(y){!y||c.has(y)||[].forEach.call(y.children,g=>{if(Zt(g)!=="script")if(a.has(g))h(g);else{const d=u?g.getAttribute(u):null,f=d!==null&&d!=="false",m=Yt(u),l=(m.get(g)||0)+1,b=(x.get(g)||0)+1;m.set(g,l),x.set(g,b),C.push(g),l===1&&f&&Qe.add(g),b===1&&g.setAttribute(i,""),!f&&u&&g.setAttribute(u,u==="inert"?"":"true")}})}return ht+=1,()=>{C.forEach(y=>{const g=Yt(u),f=(g.get(y)||0)-1,m=(x.get(y)||0)-1;g.set(y,f),x.set(y,m),f||(!Qe.has(y)&&u&&y.removeAttribute(u),Qe.delete(y)),m||y.removeAttribute(i)}),ht-=1,ht||(Ke.inert=new WeakMap,Ke["aria-hidden"]=new WeakMap,Ke.none=new WeakMap,Qe=new WeakSet,Ze={})}}function Ao(e,t=!1,n=!1){const o=Ee(e[0]).body;return Do(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}function Lo(e,t){const n=ct(e.target);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"):""}const qt=20;let Fe=[];function kt(){Fe=Fe.filter(e=>e.isConnected)}function Bo(e){kt(),e&&Zt(e)!=="body"&&(Fe.push(e),Fe.length>qt&&(Fe=Fe.slice(-qt)))}function yt(){return kt(),Fe[Fe.length-1]}function jo(e){if(!e)return null;const t=Mt();return cn(e,t)?e:sn(e,t)[0]||e}function Ho(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Yn(e).display!=="none"}function _t(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Mt(),i=no(e,n).filter(p=>{const a=p.getAttribute("data-tabindex")||"";return cn(p,n)||p.hasAttribute("data-tabindex")&&!a.startsWith("-")}),u=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?u!=="0"&&e.setAttribute("tabindex","0"):(u!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function wn(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],initialFocus:u=!0,returnFocus:p=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:C=!0,openInteractionType:x="",getInsideElements:v=()=>[],nextFocusableElement:h,previousFocusableElement:y,beforeContentFocusGuardRef:g,externalTree:d}=e,f="rootStore"in t?t.rootStore:t,m=f.useState("open"),l=f.useState("domReferenceElement"),b=f.useState("floatingElement"),{events:M,dataRef:s}=f.context,I=xe(()=>s.current.floatingContext?.nodeId),k=xe(v),j=u===!1,A=St(l)&&j,K=Ie(i),G=Ie(u),z=Ie(p),W=Ie(x),Y=Tt(d),T=Zn(),$=r.useRef(null),oe=r.useRef(null),_=r.useRef(!1),re=r.useRef(!1),w=r.useRef(!1),te=r.useRef(-1),ae=r.useRef(""),O=r.useRef(""),ge=r.useRef(null),me=r.useRef(null),Re=Rt(ge,g,T?.beforeInsideRef),se=Rt(me,T?.afterInsideRef),be=Ne(),ue=Ne(),Z=wt(),q=T!=null,F=at(b),fe=xe((P=F)=>P?sn(P,Mt()):[]),he=xe(P=>{const S=fe(P);return K.current.map(()=>S).filter(Boolean).flat()});r.useEffect(()=>{if(o||!c)return;function P(B){B.key==="Tab"&&ie(F,Ae(Ee(F)))&&fe().length===0&&!A&&Se(B)}const S=Ee(F);return S.addEventListener("keydown",P),()=>{S.removeEventListener("keydown",P)}},[o,l,F,c,K,A,fe,he]),r.useEffect(()=>{if(o||!b)return;function P(S){const B=Ue(S),X=fe().indexOf(B);X!==-1&&(te.current=X)}return b.addEventListener("focusin",P),()=>{b.removeEventListener("focusin",P)}},[o,b,fe]),r.useEffect(()=>{if(o||!m)return;const P=Ee(F);function S(){w.current=!1}function B(X){const N=Ue(X),U=ie(b,N)||ie(l,N)||ie(T?.portalNode,N);w.current=!U,O.current=X.pointerType||"keyboard"}function D(){O.current="keyboard"}return P.addEventListener("pointerdown",B,!0),P.addEventListener("pointerup",S,!0),P.addEventListener("pointercancel",S,!0),P.addEventListener("keydown",D,!0),()=>{P.removeEventListener("pointerdown",B,!0),P.removeEventListener("pointerup",S,!0),P.removeEventListener("pointercancel",S,!0),P.removeEventListener("keydown",D,!0)}},[o,b,l,F,m,T]),r.useEffect(()=>{if(o||!C)return;function P(){re.current=!0,ue.start(0,()=>{re.current=!1})}function S(N){const U=N.relatedTarget,R=N.currentTarget,L=Ue(N);queueMicrotask(()=>{const E=I(),J=f.context.triggerElements,ne=U?.hasAttribute(Bt("focus-guard"))&&[ge.current,me.current,T?.beforeInsideRef.current,T?.afterInsideRef.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,Pe(y),Pe(h)].includes(U),le=!(ie(l,U)||ie(b,U)||ie(U,b)||ie(T?.portalNode,U)||U!=null&&J.hasElement(U)||J.hasMatchingElement(ce=>ie(ce,U))||ne||Y&&(Ht(Y.nodesRef.current,E).find(ce=>ie(ce.context?.elements.floating,U)||ie(ce.context?.elements.domReference,U))||jt(Y.nodesRef.current,E).find(ce=>[ce.context?.elements.floating,at(ce.context?.elements.floating)].includes(U)||ce.context?.elements.domReference===U)));if(R===l&&F&&_t(F,K),a&&R!==l&&!Ho(L)&&Ae(Ee(F))===Ee(F).body){if(ke(F)&&(F.focus(),a==="popup")){Z.request(()=>{F.focus()});return}const ce=te.current,we=fe(),Me=we[ce]||we[we.length-1]||F;ke(Me)&&Me.focus()}if(s.current.insideReactTree){s.current.insideReactTree=!1;return}(A||!c)&&U&&le&&!re.current&&(A||U!==yt())&&(_.current=!0,f.setOpen(!1,de(Ye,N)))})}function B(){w.current||(s.current.insideReactTree=!0,be.start(0,()=>{s.current.insideReactTree=!1}))}const D=ke(l)?l:null,X=[];if(!(!b&&!D))return D&&(D.addEventListener("focusout",S),D.addEventListener("pointerdown",P),X.push(()=>{D.removeEventListener("focusout",S),D.removeEventListener("pointerdown",P)})),b&&(b.addEventListener("focusout",S),T&&(b.addEventListener("focusout",B,!0),X.push(()=>{b.removeEventListener("focusout",B,!0)})),X.push(()=>{b.removeEventListener("focusout",S)})),()=>{X.forEach(N=>{N()})}},[o,l,b,F,c,Y,T,f,C,a,fe,A,I,K,s,be,ue,Z,h,y]),r.useEffect(()=>{if(o||!b||!m)return;const P=Array.from(T?.portalNode?.querySelectorAll(`[${Bt("portal")}]`)||[]),B=(Y?jt(Y.nodesRef.current,I()):[]).find(N=>St(N.context?.elements.domReference||null))?.context?.elements.domReference,D=[b,B,...P,...k(),$.current,oe.current,ge.current,me.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,Pe(y),Pe(h),A?l:null].filter(N=>N!=null),X=Ao(D,c||A);return()=>{X()}},[m,o,l,b,c,K,T,A,Y,I,k,h,y]),pe(()=>{if(!m||o||!ke(F))return;const P=Ee(F),S=Ae(P);queueMicrotask(()=>{const B=he(F),D=G.current,X=typeof D=="function"?D(W.current||""):D;if(X===void 0||X===!1)return;let N;X===!0||X===null?N=B[0]||F:N=Pe(X),N=N||B[0]||F,!ie(F,S)&&rt(N,{preventScroll:N===F})})},[o,m,F,j,he,G,W]),pe(()=>{if(o||!F)return;const P=Ee(F),S=Ae(P);Bo(S);function B(N){if(N.open||(ae.current=Lo(N.nativeEvent,O.current)),N.reason===Ve&&N.nativeEvent.type==="mouseleave"&&(_.current=!0),N.reason===en)if(N.nested)_.current=!1;else if(Rn(N.nativeEvent)||Cn(N.nativeEvent))_.current=!1;else{let U=!1;document.createElement("div").focus({get preventScroll(){return U=!0,!1}}),U?_.current=!1:_.current=!0}}M.on("openchange",B);const D=P.createElement("span");D.setAttribute("tabindex","-1"),D.setAttribute("aria-hidden","true"),Object.assign(D.style,ko),q&&l&&l.insertAdjacentElement("afterend",D);function X(){const N=z.current;let U=typeof N=="function"?N(ae.current):N;if(U===void 0||U===!1)return null;if(U===null&&(U=!0),typeof U=="boolean"){const L=l||yt();return L&&L.isConnected?L:D}const R=l||yt()||D;return Pe(U)||R}return()=>{M.off("openchange",B);const N=Ae(P),U=ie(b,N)||Y&&Ht(Y.nodesRef.current,I(),!1).some(L=>ie(L.context?.elements.floating,N)),R=X();queueMicrotask(()=>{const L=jo(R),E=typeof z.current!="boolean";z.current&&!_.current&&ke(L)&&(!(!E&&L!==N&&N!==P.body)||U)&&L.focus({preventScroll:!0}),D.remove()})}},[o,b,F,z,s,M,Y,q,l,I]),r.useEffect(()=>{queueMicrotask(()=>{_.current=!1})},[o]),r.useEffect(()=>{if(o||!m)return;function P(B){Ue(B)?.closest(`[${to}]`)&&(re.current=!0)}const S=Ee(F);return S.addEventListener("pointerdown",P,!0),()=>{S.removeEventListener("pointerdown",P,!0)}},[o,m,F]),pe(()=>{if(!o&&T)return T.setFocusManagerState({modal:c,closeOnFocusOut:C,open:m,onOpenChange:f.setOpen,domReference:l}),()=>{T.setFocusManagerState(null)}},[o,T,c,m,f,C,l]),pe(()=>{if(!(o||!F))return _t(F,K),()=>{queueMicrotask(kt)}},[o,F,K]);const ve=!o&&(c?!A:!0)&&(q||c);return H.jsxs(r.Fragment,{children:[ve&&H.jsx(it,{"data-type":"inside",ref:Re,onFocus:P=>{if(c){const S=he();rt(S[S.length-1])}else T?.portalNode&&(_.current=!1,Et(P,T.portalNode)?an(l)?.focus():Pe(y??T.beforeOutsideRef)?.focus())}}),n,ve&&H.jsx(it,{"data-type":"inside",ref:se,onFocus:P=>{c?rt(he()[0]):T?.portalNode&&(C&&(_.current=!0),Et(P,T.portalNode)?eo(l)?.focus():Pe(h??T.afterOutsideRef)?.focus())}})]})}function Uo(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:i=!0,event:u="click",toggle:p=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:C=0}=t,x=r.useRef(void 0),v=wt(),h=Ne(),y=r.useMemo(()=>({onPointerDown(g){x.current=g.pointerType},onMouseDown(g){const d=x.current,f=g.nativeEvent,m=n.select("open");if(g.button!==0||u==="click"||Kt(d,!0)&&a)return;const l=o.current.openEvent,b=l?.type,M=n.select("domReferenceElement")!==g.currentTarget,s=m&&M||!(m&&p&&(!(l&&c)||b==="click"||b==="mousedown"));if(Ro(f.target)){const k=de(nt,f,f.target);s&&d==="touch"&&C>0?h.start(C,()=>{n.setOpen(!0,k)}):n.setOpen(s,k);return}const I=g.currentTarget;v.request(()=>{const k=de(nt,f,I);s&&d==="touch"&&C>0?h.start(C,()=>{n.setOpen(!0,k)}):n.setOpen(s,k)})},onClick(g){if(u==="mousedown-only")return;const d=x.current;if(u==="mousedown"&&d){x.current=void 0;return}if(Kt(d,!0)&&a)return;const f=n.select("open"),m=o.current.openEvent,l=n.select("domReferenceElement")!==g.currentTarget,b=f&&l||!(f&&p&&(!(m&&c)||vo(m))),M=de(nt,g.nativeEvent,g.currentTarget);b&&d==="touch"&&C>0?h.start(C,()=>{n.setOpen(!0,M)}):n.setOpen(b,M)},onKeyDown(){x.current=void 0}}),[o,u,a,n,c,p,v,h,C]);return r.useMemo(()=>i?{reference:y}:Ge,[i,y])}const Vo="Escape";function pt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function et(e,t){return pt(t,e===En||e===ft,e===qe||e===_e)}function xt(e,t,n){return pt(t,e===ft,n?e===qe:e===_e)||e==="Enter"||e===" "||e===""}function Ko(e,t,n){return pt(t,n?e===qe:e===_e,e===ft)}function Go(e,t,n,o){const i=n?e===_e:e===qe,u=e===En;return t==="both"||t==="horizontal"&&o&&o>1?e===Vo:pt(t,i,u)}function Wo(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),i=n.useState("floatingElement"),u=n.useState("domReferenceElement"),p=n.context.dataRef,{listRef:a,activeIndex:c,onNavigate:C=()=>{},enabled:x=!0,selectedIndex:v=null,allowEscape:h=!1,loopFocus:y=!1,nested:g=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:m="auto",focusItemOnHover:l=!0,openOnArrowKeyDown:b=!0,disabledIndices:M=void 0,orientation:s="vertical",parentOrientation:I,cols:k=1,scrollItemIntoView:j=!0,itemSizes:A,dense:K=!1,id:G,resetOnPointerLeave:z=!0,externalTree:W}=t,Y=at(i),T=Ie(Y),$=lt(),oe=Tt(W);pe(()=>{p.current.orientation=s},[p,s]);const _=St(u),re=r.useRef(m),w=r.useRef(v??-1),te=r.useRef(null),ae=r.useRef(!0),O=xe(R=>{C(w.current===-1?null:w.current,R)}),ge=r.useRef(O),me=r.useRef(!!i),Re=r.useRef(o),se=r.useRef(!1),be=r.useRef(!1),ue=Ie(M),Z=Ie(o),q=Ie(j),F=Ie(v),fe=Ie(z),he=xe(()=>{function R(ne){f?oe?.events.emit("virtualfocus",ne):rt(ne,{sync:se.current,preventScroll:!0})}const L=a.current[w.current],E=be.current;L&&R(L),(se.current?ne=>ne():requestAnimationFrame)(()=>{const ne=a.current[w.current]||L;if(!ne)return;L||R(ne);const le=q.current;le&&P&&(E||!ae.current)&&ne.scrollIntoView?.(typeof le=="boolean"?{block:"nearest",inline:"nearest"}:le)})});pe(()=>{x&&(o&&i?(w.current=v??-1,re.current&&v!=null&&(be.current=!0,O())):me.current&&(w.current=-1,ge.current()))},[x,o,i,v,O]),pe(()=>{if(x){if(!o){se.current=!1;return}if(i)if(c==null){if(se.current=!1,F.current!=null)return;if(me.current&&(w.current=-1,he()),(!Re.current||!me.current)&&re.current&&(te.current!=null||re.current===!0&&te.current==null)){let R=0;const L=()=>{a.current[0]==null?(R<2&&(R?requestAnimationFrame:queueMicrotask)(L),R+=1):(w.current=te.current==null||xt(te.current,s,d)||g?mt(a):Wt(a),te.current=null,O())};L()}}else Gt(a,c)||(w.current=c,he(),be.current=!1)}},[x,o,i,c,F,g,a,s,d,O,he,ue]),pe(()=>{if(!x||i||!oe||f||!me.current)return;const R=oe.nodesRef.current,L=R.find(ne=>ne.id===$)?.context?.elements.floating,E=Ae(Ee(i)),J=R.some(ne=>ne.context&&ie(ne.context.elements.floating,E));L&&!J&&ae.current&&L.focus({preventScroll:!0})},[x,i,oe,$,f]),pe(()=>{ge.current=O,Re.current=o,me.current=!!i}),pe(()=>{o||(te.current=null,re.current=m)},[o,m]);const ve=c!=null,P=r.useMemo(()=>{function R(E){if(!Z.current)return;const J=a.current.indexOf(E.currentTarget);J!==-1&&w.current!==J&&(w.current=J,O(E))}return{onFocus(E){se.current=!0,R(E)},onClick:({currentTarget:E})=>E.focus({preventScroll:!0}),onMouseMove(E){se.current=!0,be.current=!1,l&&R(E)},onPointerLeave(E){if(!Z.current||!ae.current||E.pointerType==="touch")return;se.current=!0;const J=E.relatedTarget;!l||a.current.includes(J)||fe.current&&(w.current=-1,O(E),f||T.current?.focus({preventScroll:!0}))}}},[Z,T,l,a,O,fe,f]),S=r.useCallback(()=>I??oe?.nodesRef.current.find(R=>R.id===$)?.context?.dataRef?.current.orientation,[$,oe,I]),B=xe(R=>{if(ae.current=!1,se.current=!0,R.which===229||!Z.current&&R.currentTarget===T.current)return;if(g&&Go(R.key,s,d,k)){et(R.key,S())||Se(R),n.setOpen(!1,de(ot,R.nativeEvent)),ke(u)&&(f?oe?.events.emit("virtualfocus",u):u.focus());return}const L=w.current,E=mt(a,M),J=Wt(a,M);if(_||(R.key==="Home"&&(Se(R),w.current=E,O(R)),R.key==="End"&&(Se(R),w.current=J,O(R))),k>1){const ne=A||Array.from({length:a.current.length},()=>({width:1,height:1})),le=So(ne,k,K),ce=le.findIndex(Ce=>Ce!=null&&!bt(a,Ce,M)),we=le.reduce((Ce,Oe,V)=>Oe!=null&&!bt(a,Oe,M)?V:Ce,-1),Me=le[Io({current:le.map(Ce=>Ce!=null?a.current[Ce]:null)},{event:R,orientation:s,loopFocus:y,rtl:d,cols:k,disabledIndices:wo([...(typeof M!="function"?M:null)||a.current.map((Ce,Oe)=>bt(a,Oe,M)?Oe:void 0),void 0],le),minIndex:ce,maxIndex:we,prevIndex:To(w.current>J?E:w.current,ne,le,k,R.key===ft?"bl":R.key===(d?qe:_e)?"tr":"tl"),stopEvent:!0})];if(Me!=null&&(w.current=Me,O(R)),s==="both")return}if(et(R.key,s)){if(Se(R),o&&!f&&Ae(R.currentTarget.ownerDocument)===R.currentTarget){w.current=xt(R.key,s,d)?E:J,O(R);return}xt(R.key,s,d)?y?L>=J?h&&L!==a.current.length?w.current=-1:(se.current=!1,w.current=E):w.current=Je(a,{startingIndex:L,disabledIndices:M}):w.current=Math.min(J,Je(a,{startingIndex:L,disabledIndices:M})):y?L<=E?h&&L!==-1?w.current=a.current.length:(se.current=!1,w.current=J):w.current=Je(a,{startingIndex:L,decrement:!0,disabledIndices:M}):w.current=Math.max(E,Je(a,{startingIndex:L,decrement:!0,disabledIndices:M})),Gt(a,w.current)&&(w.current=-1),O(R)}}),D=r.useMemo(()=>f&&o&&ve&&{"aria-activedescendant":`${G}-${c}`},[f,o,ve,G,c]),X=r.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,..._?{}:D,onKeyDown(R){if(R.key==="Tab"&&R.shiftKey&&o&&!f){const L=Ue(R.nativeEvent);if(L&&!ie(T.current,L))return;Se(R),n.setOpen(!1,de(Ye,R.nativeEvent)),ke(u)&&u.focus();return}B(R)},onPointerMove(){ae.current=!0}}),[D,B,T,s,_,n,o,f,u]),N=r.useMemo(()=>{function R(E){m==="auto"&&Rn(E.nativeEvent)&&(re.current=!f)}function L(E){re.current=m,m==="auto"&&Cn(E.nativeEvent)&&(re.current=!0)}return{onKeyDown(E){const J=n.select("open");ae.current=!1;const ne=E.key.startsWith("Arrow"),le=Ko(E.key,S(),d),ce=et(E.key,s),we=(g?le:ce)||E.key==="Enter"||E.key.trim()==="";if(f&&J)return B(E);if(!(!J&&!b&&ne)){if(we){const Me=et(E.key,S());te.current=g&&Me?null:E.key}if(g){le&&(Se(E),J?(w.current=mt(a,ue.current),O(E)):n.setOpen(!0,de(ot,E.nativeEvent,E.currentTarget)));return}ce&&(F.current!=null&&(w.current=F.current),Se(E),!J&&b?n.setOpen(!0,de(ot,E.nativeEvent,E.currentTarget)):B(E),J&&O(E))}},onFocus(E){n.select("open")&&!f&&(w.current=-1,O(E))},onPointerDown:L,onPointerEnter:L,onMouseDown:R,onClick:R}},[B,ue,m,a,g,O,n,b,s,S,d,F,f]),U=r.useMemo(()=>({...D,...N}),[D,N]);return r.useMemo(()=>x?{reference:U,floating:X,item:P,trigger:N}:{},[x,U,X,N,P])}const $o=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Mn(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),i=n.useState("floatingId"),u=n.useState("domReferenceElement"),p=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,C=tn(),x=u?.id||C,v=r.useMemo(()=>at(p)?.id||i,[p,i]),h=$o.get(c)??c,g=lt()!=null,d=r.useMemo(()=>h==="tooltip"||c==="label"?Ge:{"aria-haspopup":h==="alertdialog"?"dialog":h,"aria-expanded":"false",...h==="listbox"&&{role:"combobox"},...h==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[h,g,c]),f=r.useMemo(()=>h==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?v:void 0}:{...d,"aria-expanded":o?"true":"false","aria-controls":o?v:void 0,...h==="menu"&&{id:x}},[h,v,o,x,c,d]),m=r.useMemo(()=>{const b={id:v,...h&&{role:h}};return h==="tooltip"||c==="label"?b:{...b,...h==="menu"&&{"aria-labelledby":x}}},[h,v,x,c]),l=r.useCallback(({active:b,selected:M})=>{const s={role:"option",...b&&{id:`${v}-fui-option`}};switch(c){case"select":case"combobox":return{...s,"aria-selected":M}}return{}},[v,c]);return r.useMemo(()=>a?{reference:f,floating:m,item:l,trigger:d}:{},[a,f,m,d,l])}function Yo(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),i=n.context.dataRef,{listRef:u,activeIndex:p,onMatch:a,onTypingChange:c,enabled:C=!0,findMatch:x=null,resetMs:v=750,ignoreKeys:h=st,selectedIndex:y=null}=t,g=Ne(),d=r.useRef(""),f=r.useRef(y??p??-1),m=r.useRef(null);pe(()=>{o&&(g.clear(),m.current=null,d.current="")},[o,g]),pe(()=>{o&&d.current===""&&(f.current=y??p??-1)},[o,y,p]);const l=xe(I=>{I?i.current.typing||(i.current.typing=I,c?.(I)):i.current.typing&&(i.current.typing=I,c?.(I))}),b=xe(I=>{function k(z,W,Y){const T=x?x(W,Y):W.find($=>$?.toLocaleLowerCase().indexOf(Y.toLocaleLowerCase())===0);return T?z.indexOf(T):-1}const j=u.current;if(d.current.length>0&&d.current[0]!==" "&&(k(j,j,d.current)===-1?l(!1):I.key===" "&&Se(I)),j==null||h.includes(I.key)||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;o&&I.key!==" "&&(Se(I),l(!0)),j.every(z=>z?z[0]?.toLocaleLowerCase()!==z[1]?.toLocaleLowerCase():!0)&&d.current===I.key&&(d.current="",f.current=m.current),d.current+=I.key,g.start(v,()=>{d.current="",f.current=m.current,l(!1)});const K=f.current,G=k(j,[...j.slice((K||0)+1),...j.slice(0,(K||0)+1)],d.current);G!==-1?(a?.(G),m.current=G):I.key!==" "&&(d.current="",l(!1))}),M=r.useMemo(()=>({onKeyDown:b}),[b]),s=r.useMemo(()=>({onKeyDown:b,onKeyUp(I){I.key===" "&&l(!1)}}),[b,l]);return r.useMemo(()=>C?{reference:M,floating:s}:{},[C,M,s])}function On(e){return Gn(19)?e:e?"true":void 0}const Pn=r.createContext(void 0);function je(e){const t=r.useContext(Pn);if(e===!1&&t===void 0)throw new Error(Le(27));return t}const qo={...dt,...Ot},_o=r.forwardRef(function(t,n){const{render:o,className:i,forceRender:u=!1,...p}=t,{store:a}=je(),c=a.useState("open"),C=a.useState("nested"),x=a.useState("mounted"),v=a.useState("transitionStatus"),h=r.useMemo(()=>({open:c,transitionStatus:v}),[c,v]);return Te("div",t,{state:h,ref:[a.context.backdropRef,n],stateAttributesMapping:qo,props:[{role:"presentation",hidden:!x,style:{userSelect:"none",WebkitUserSelect:"none"}},p],enabled:u||!C})}),zo=r.forwardRef(function(t,n){const{render:o,className:i,disabled:u=!1,nativeButton:p=!0,...a}=t,{store:c}=je(),C=c.useState("open");function x(g){C&&c.setOpen(!1,de(qn,g.nativeEvent))}const{getButtonProps:v,buttonRef:h}=It({disabled:u,native:p}),y=r.useMemo(()=>({disabled:u}),[u]);return Te("button",t,{state:y,ref:[n,h],props:[{onClick:x},a,v]})}),Xo=r.forwardRef(function(t,n){const{render:o,className:i,id:u,...p}=t,{store:a}=je(),c=ut(u);return a.useSyncedValueWithCleanup("descriptionElementId",c),Te("p",t,{ref:n,props:[{id:c},p]})});let Jo=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Qo=(function(e){return e[e.open=Xe.open]="open",e[e.closed=Xe.closed]="closed",e[e.startingStyle=Xe.startingStyle]="startingStyle",e[e.endingStyle=Xe.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const kn=r.createContext(void 0);function Zo(){const e=r.useContext(kn);if(e===void 0)throw new Error(Le(26));return e}const er={...dt,...Ot,nestedDialogOpen(e){return e?{[Qo.nestedDialogOpen]:""}:null}},tr=r.forwardRef(function(t,n){const{className:o,finalFocus:i,initialFocus:u,render:p,...a}=t,{store:c}=je(),C=c.useState("descriptionElementId"),x=c.useState("disablePointerDismissal"),v=c.useState("floatingRootContext"),h=c.useState("popupProps"),y=c.useState("modal"),g=c.useState("mounted"),d=c.useState("nested"),f=c.useState("nestedOpenDialogCount"),m=c.useState("open"),l=c.useState("openMethod"),b=c.useState("titleElementId"),M=c.useState("transitionStatus"),s=c.useState("role");Zo(),un({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}});function I(G){return G==="touch"?c.context.popupRef.current:!0}const k=u===void 0?I:u,j=f>0,A=r.useMemo(()=>({open:m,nested:d,transitionStatus:M,nestedDialogOpen:j}),[m,d,M,j]),K=Te("div",t,{state:A,props:[h,{"aria-labelledby":b??void 0,"aria-describedby":C??void 0,role:s,tabIndex:-1,hidden:!g,onKeyDown(G){In.has(G.key)&&G.stopPropagation()},style:{[Jo.nestedDialogs]:f}},a],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:er});return H.jsx(wn,{context:v,openInteractionType:l,disabled:!g,closeOnFocusOut:!x,initialFocus:k,returnFocus:i,modal:y!==!1,restoreFocus:"popup",children:K})}),Fn=r.forwardRef(function(t,n){const{cutout:o,...i}=t;let u;if(o){const p=o?.getBoundingClientRect();u=`polygon(
2
+ 0% 0%,
3
+ 100% 0%,
4
+ 100% 100%,
5
+ 0% 100%,
6
+ 0% 0%,
7
+ ${p.left}px ${p.top}px,
8
+ ${p.left}px ${p.bottom}px,
9
+ ${p.right}px ${p.bottom}px,
10
+ ${p.right}px ${p.top}px,
11
+ ${p.left}px ${p.top}px
12
+ )`}return H.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:u}})}),nr=r.forwardRef(function(t,n){const{keepMounted:o=!1,...i}=t,{store:u}=je(),p=u.useState("mounted"),a=u.useState("modal"),c=u.useState("open");return p||o?H.jsx(kn.Provider,{value:o,children:H.jsxs(ln,{ref:n,...i,children:[p&&a===!0&&H.jsx(Fn,{ref:u.context.internalBackdropRef,inert:On(!c)}),t.children]})}):null});let zt={},Xt={},Jt="";function or(e){if(typeof document>"u")return!1;const t=De(e);return ct(t).innerWidth-t.documentElement.clientWidth>0}function rr(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=De(e).documentElement,i={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const u=o.offsetWidth;o.style.overflowY="hidden";const p=o.offsetWidth;return Object.assign(o.style,i),u===p}function sr(e){const t=De(e),n=t.documentElement,o=t.body,i=nn(n)?n:o,u=i.style.overflow;return i.style.overflow="hidden",()=>{i.style.overflow=u}}function ir(e){const t=De(e),n=t.documentElement,o=t.body,i=ct(n);let u=0,p=0,a=!1;const c=oo.create();if(Co&&(i.visualViewport?.scale??1)!==1)return()=>{};function C(){const h=i.getComputedStyle(n),y=i.getComputedStyle(o),f=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";u=n.scrollTop,p=n.scrollLeft,zt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Jt=n.style.scrollBehavior,Xt={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const m=n.scrollHeight>n.clientHeight,l=n.scrollWidth>n.clientWidth,b=h.overflowY==="scroll"||y.overflowY==="scroll",M=h.overflowX==="scroll"||y.overflowX==="scroll",s=Math.max(0,i.innerWidth-o.clientWidth),I=Math.max(0,i.innerHeight-o.clientHeight),k=parseFloat(y.marginTop)+parseFloat(y.marginBottom),j=parseFloat(y.marginLeft)+parseFloat(y.marginRight),A=nn(n)?n:o;if(a=rr(e),a){n.style.scrollbarGutter=f,A.style.overflowY="hidden",A.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:f,overflowY:"hidden",overflowX:"hidden"}),(m||b)&&(n.style.overflowY="scroll"),(l||M)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:k||I?`calc(100dvh - ${k+I}px)`:"100dvh",width:j||s?`calc(100vw - ${j+s}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=u,o.scrollLeft=p,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function x(){Object.assign(n.style,zt),Object.assign(o.style,Xt),a||(n.scrollTop=u,n.scrollLeft=p,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Jt)}function v(){x(),c.request(C)}return C(),i.addEventListener("resize",v),()=>{c.cancel(),x(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",v)}}class ar{lockCount=0;restore=null;timeoutLock=Ut.create();timeoutUnlock=Ut.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=De(t).documentElement,i=ct(o).getComputedStyle(o).overflowY;if(i==="hidden"||i==="clip"){this.restore=Wn;return}const u=Sn||!or(t);this.restore=u?sr(t):ir(t)}}const cr=new ar;function Nn(e=!0,t=null){pe(()=>{if(e)return cr.acquire(t)},[e,t])}function ur(e){const t=r.useRef(""),n=r.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:r.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i&&e(i,i.pointerType),e(i,t.current),t.current=""},[e]),onPointerDown:n}}function Dn(e){const[t,n]=r.useState(null),o=xe((a,c)=>{e||n(c||(Sn?"touch":""))}),i=r.useCallback(()=>{n(null)},[]),{onClick:u,onPointerDown:p}=ur(o);return r.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:u,onPointerDown:p}}),[t,i,u,p])}function lr(e){const{store:t,parentContext:n,actionsRef:o}=e,i=t.useState("open"),u=t.useState("disablePointerDismissal"),p=t.useState("modal"),a=t.useState("popupElement"),{openMethod:c,triggerProps:C,reset:x}=Dn(i);dn(t);const{forceUnmount:v}=fn(i,t,()=>{x()}),h=xe(K=>{const G=de(K);return G.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},G}),y=r.useCallback(()=>{t.setOpen(!1,h(on))},[t,h]);r.useImperativeHandle(o,()=>({unmount:v,close:y}),[v,y]);const g=pn({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[d,f]=r.useState(0),m=d===0,l=Mn(g),b=gn(g,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:p==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(K){if("button"in K&&K.button!==0||"touches"in K&&K.touches.length!==1)return!1;const G=Ue(K);if(m&&!u){const z=G;return p&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===z||t.context.backdropRef.current===z||ie(z,a)&&!z?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:m});Nn(i&&p===!0,a);const{getReferenceProps:M,getFloatingProps:s,getTriggerProps:I}=Pt([l,b]);t.useContextCallback("onNestedDialogOpen",K=>{f(K+1)}),t.useContextCallback("onNestedDialogClose",()=>{f(0)}),r.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(d),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,d]);const k=r.useMemo(()=>M(C),[M,C]),j=r.useMemo(()=>I(C),[I,C]),A=r.useMemo(()=>s(),[s]);t.useSyncedValues({openMethod:c,activeTriggerProps:k,inactiveTriggerProps:j,popupProps:A,floatingRootContext:g,nestedOpenDialogCount:d})}const dr={...hn,modal:Q(e=>e.modal),nested:Q(e=>e.nested),nestedOpenDialogCount:Q(e=>e.nestedOpenDialogCount),disablePointerDismissal:Q(e=>e.disablePointerDismissal),openMethod:Q(e=>e.openMethod),descriptionElementId:Q(e=>e.descriptionElementId),titleElementId:Q(e=>e.titleElementId),viewportElement:Q(e=>e.viewportElement),role:Q(e=>e.role)};class fr extends mn{constructor(t){super(pr(t),{popupRef:r.createRef(),backdropRef:r.createRef(),internalBackdropRef:r.createRef(),triggerElements:new bn,onOpenChange:void 0,onOpenChangeComplete:void 0},dr)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const o={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",o);const i={open:t},u=n.trigger?.id??null;(u||t)&&(i.activeTriggerId=u,i.activeTriggerElement=n.trigger??null),this.update(i)}}function pr(e={}){return{...yn(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function gr(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:i,onOpenChangeComplete:u,disablePointerDismissal:p=!1,modal:a=!0,actionsRef:c,handle:C,triggerId:x,defaultTriggerId:v=null}=e,h=je(!0),y=!!h,g=Qt(()=>C?.store??new fr({open:n??o,activeTriggerId:x!==void 0?x:v,modal:a,disablePointerDismissal:p,nested:y})).current;g.useControlledProp("open",n,o),g.useControlledProp("activeTriggerId",x,v),g.useSyncedValues({disablePointerDismissal:p,nested:y,modal:a}),g.useContextCallback("onOpenChange",i),g.useContextCallback("onOpenChangeComplete",u);const d=g.useState("payload");lr({store:g,actionsRef:c,parentContext:h?.store.context});const f=r.useMemo(()=>({store:g}),[g]);return H.jsx(Pn.Provider,{value:f,children:typeof t=="function"?t({payload:d}):t})}const mr=r.forwardRef(function(t,n){const{render:o,className:i,id:u,...p}=t,{store:a}=je(),c=ut(u);return a.useSyncedValueWithCleanup("titleElementId",c),Te("h2",t,{ref:n,props:[{id:c},p]})});function qr({children:e,...t}){return H.jsx(gr,{...t,children:e})}function _r({className:e,children:t}){return H.jsxs(nr,{children:[H.jsx(_o,{className:"fixed inset-0 bg-ink/40 transition-all duration-150 data-[state=open]:opacity-100 data-[state=closed]:opacity-0 dark:bg-surface/40"}),H.jsx(tr,{className:Be("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2","w-[min(400px,92vw)] rounded-[20px] border border-primary-200 bg-primary-50 p-0 shadow-lg","transition-all duration-150","data-[state=open]:opacity-100 data-[state=closed]:opacity-0","data-[state=open]:scale-100 data-[state=closed]:scale-95",e),children:t})]})}function zr({className:e,...t}){return H.jsx(mr,{className:Be("text-lg font-medium text-primary-900",e),...t})}function Xr({className:e,...t}){return H.jsx(Xo,{className:Be("text-sm text-primary-600",e),...t})}function Jr({className:e,render:t,...n}){return H.jsx(zo,{render:t||H.jsx($n,{variant:"outline",className:Be(e)}),...n})}const An=r.createContext(void 0);function Ln(e){const t=r.useContext(An);if(t===void 0&&!e)throw new Error(Le(33));return t}const Bn=r.createContext(void 0);function He(e){const t=r.useContext(Bn);if(t===void 0&&!e)throw new Error(Le(36));return t}const br=r.createContext(void 0);function gt(e=!0){const t=r.useContext(br);if(t===void 0&&!e)throw new Error(Le(25));return t}const hr={type:"regular-item"};function yr(e){const{closeOnClick:t,disabled:n=!1,highlighted:o,id:i,store:u,nativeButton:p,itemMetadata:a,nodeId:c}=e,C=r.useRef(null),x=gt(!0),v=x!==void 0,{events:h}=u.useState("floatingTreeRoot"),{getButtonProps:y,buttonRef:g}=It({disabled:n,focusableWhenDisabled:!0,native:p}),d=r.useCallback(m=>Ct({id:i,role:"menuitem",tabIndex:o?0:-1,onMouseMove(l){c&&h.emit("itemhover",{nodeId:c,target:l.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(l){l.key===" "&&u.context.typingRef.current&&l.preventBaseUIHandler()},onClick(l){t&&h.emit("close",{domEvent:l,reason:rn})},onMouseUp(l){if(x){const b=x.initialCursorPointRef.current;if(x.initialCursorPointRef.current=null,v&&b&&Math.abs(l.clientX-b.x)<=1&&Math.abs(l.clientY-b.y)<=1)return}C.current&&u.context.allowMouseUpTriggerRef.current&&(!v||l.button===2)&&a.type==="regular-item"&&C.current.click()}},m,y),[i,o,y,t,h,u,v,x,a,c]),f=Rt(C,g);return r.useMemo(()=>({getItemProps:d,itemRef:f}),[d,f])}const xr=r.forwardRef(function(t,n){const{render:o,className:i,id:u,label:p,nativeButton:a=!1,disabled:c=!1,closeOnClick:C=!0,...x}=t,v=Mo({label:p}),h=Ln(!0),y=ut(u),{store:g}=He(),d=g.useState("isActive",v.index),f=g.useState("itemProps"),{getItemProps:m,itemRef:l}=yr({closeOnClick:C,disabled:c,highlighted:d,id:y,store:g,nativeButton:a,nodeId:h?.nodeId,itemMetadata:hr}),b=r.useMemo(()=>({disabled:c,highlighted:d}),[c,d]);return Te("div",t,{state:b,props:[f,x,m],ref:[l,n,v.ref]})}),vr=r.createContext(void 0);function Rr(e){return r.useContext(vr)}const Cr={...dt,...Ot},Er=r.forwardRef(function(t,n){const{render:o,className:i,finalFocus:u,...p}=t,{store:a}=He(),{side:c,align:C}=Ln(),x=Rr()!=null,v=a.useState("open"),h=a.useState("transitionStatus"),y=a.useState("popupProps"),g=a.useState("mounted"),d=a.useState("instantType"),f=a.useState("activeTriggerElement"),m=a.useState("parent"),l=a.useState("lastOpenChangeReason"),b=a.useState("rootId"),M=a.useState("floatingRootContext"),s=a.useState("floatingTreeRoot"),I=a.useState("closeDelay"),k=a.useState("activeTriggerElement"),j=m.type==="context-menu";un({open:v,ref:a.context.popupRef,onComplete(){v&&a.context.onOpenChangeComplete?.(!0)}}),r.useEffect(()=>{function Y(T){a.setOpen(!1,de(T.reason,T.domEvent))}return s.events.on("close",Y),()=>{s.events.off("close",Y)}},[s.events,a]);const A=a.useState("hoverEnabled"),K=a.useState("disabled");ro(M,{enabled:A&&!K&&!j&&m.type!=="menubar",closeDelay:I});const G=r.useMemo(()=>({transitionStatus:h,side:c,align:C,open:v,nested:m.type==="menu",instant:d}),[h,c,C,v,m.type,d]),z=Te("div",t,{state:G,ref:[n,a.context.popupRef],stateAttributesMapping:Cr,props:[y,{onKeyDown(Y){x&&In.has(Y.key)&&Y.stopPropagation()}},so(h),p,{"data-rootownerid":b}]});let W=m.type===void 0||j;return(f||m.type==="menubar"&&l!==en)&&(W=!0),H.jsx(wn,{context:M,modal:j,disabled:!g,returnFocus:u===void 0?W:u,initialFocus:m.type!=="menu",restoreFocus:!0,externalTree:m.type!=="menubar"?s:void 0,previousFocusableElement:k,nextFocusableElement:m.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:m.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:z})}),jn=r.createContext(void 0);function Sr(){const e=r.useContext(jn);if(e===void 0)throw new Error(Le(32));return e}const Ir=r.forwardRef(function(t,n){const{keepMounted:o=!1,...i}=t,{store:u}=He();return u.useState("mounted")||o?H.jsx(jn.Provider,{value:o,children:H.jsx(ln,{ref:n,...i})}):null}),Tr=r.forwardRef(function(t,n){const{anchor:o,positionMethod:i="absolute",className:u,render:p,side:a,align:c,sideOffset:C=0,alignOffset:x=0,collisionBoundary:v="clipping-ancestors",collisionPadding:h=5,arrowPadding:y=5,sticky:g=!1,disableAnchorTracking:d=!1,collisionAvoidance:f=io,...m}=t,{store:l}=He(),b=Sr(),M=gt(!0),s=l.useState("parent"),I=l.useState("floatingRootContext"),k=l.useState("floatingTreeRoot"),j=l.useState("mounted"),A=l.useState("open"),K=l.useState("modal"),G=l.useState("activeTriggerElement"),z=l.useState("lastOpenChangeReason"),W=l.useState("floatingNodeId"),Y=l.useState("floatingParentNodeId");let T=o,$=C,oe=x,_=c,re=f;s.type==="context-menu"&&(T=o??s.context?.anchor,_=_??"start",!a&&_!=="center"&&(oe=t.alignOffset??2,$=t.sideOffset??-5));let w=a,te=_;s.type==="menu"?(w=w??"inline-end",te=te??"start",re=t.collisionAvoidance??ao):s.type==="menubar"&&(w=w??"bottom",te=te??"start");const ae=s.type==="context-menu",O=co({anchor:T,floatingRootContext:I,positionMethod:M?"fixed":i,mounted:j,side:w,sideOffset:$,align:te,alignOffset:oe,arrowPadding:ae?0:y,collisionBoundary:v,collisionPadding:h,sticky:g,nodeId:W,keepMounted:b,disableAnchorTracking:d,collisionAvoidance:re,shiftCrossAxis:ae,externalTree:k}),ge=r.useMemo(()=>{const Z={};return A||(Z.pointerEvents="none"),{role:"presentation",hidden:!j,style:{...O.positionerStyles,...Z}}},[A,j,O.positionerStyles]);r.useEffect(()=>{function Z(q){q.open?(q.parentNodeId===W&&l.set("hoverEnabled",!1),q.nodeId!==W&&q.parentNodeId===l.select("floatingParentNodeId")&&l.setOpen(!1,de($e))):q.parentNodeId===W&&q.reason!==$e&&l.set("hoverEnabled",!0)}return k.events.on("menuopenchange",Z),()=>{k.events.off("menuopenchange",Z)}},[l,k.events,W]),r.useEffect(()=>{if(l.select("floatingParentNodeId")==null)return;function Z(q){if(q.open||q.nodeId!==l.select("floatingParentNodeId"))return;const F=q.reason??$e;l.setOpen(!1,de(F))}return k.events.on("menuopenchange",Z),()=>{k.events.off("menuopenchange",Z)}},[k.events,l]),r.useEffect(()=>{function Z(q){!A||q.nodeId!==l.select("floatingParentNodeId")||q.target&&G&&G!==q.target&&l.setOpen(!1,de($e))}return k.events.on("itemhover",Z),()=>{k.events.off("itemhover",Z)}},[k.events,A,G,l]),r.useEffect(()=>{const Z={open:A,nodeId:W,parentNodeId:Y,reason:l.select("lastOpenChangeReason")};k.events.emit("menuopenchange",Z)},[k.events,A,l,W,Y]);const me=r.useMemo(()=>({open:A,side:O.side,align:O.align,anchorHidden:O.anchorHidden,nested:s.type==="menu"}),[A,O.side,O.align,O.anchorHidden,s.type]),Re=r.useMemo(()=>({side:O.side,align:O.align,arrowRef:O.arrowRef,arrowUncentered:O.arrowUncentered,arrowStyles:O.arrowStyles,nodeId:O.context.nodeId}),[O.side,O.align,O.arrowRef,O.arrowUncentered,O.arrowStyles,O.context.nodeId]),se=Te("div",t,{state:me,stateAttributesMapping:dt,ref:[n,l.useStateSetter("positionerElement")],props:[ge,m]}),be=j&&s.type!=="menu"&&(s.type!=="menubar"&&K&&z!==Ve||s.type==="menubar"&&s.context.modal);let ue=null;return s.type==="menubar"?ue=s.context.contentElement:s.type===void 0&&(ue=G),H.jsxs(An.Provider,{value:Re,children:[be&&H.jsx(Fn,{ref:s.type==="context-menu"||s.type==="nested-context-menu"?s.context.internalBackdropRef:null,inert:On(!A),cutout:ue}),H.jsx(uo,{id:W,children:H.jsx(Oo,{elementsRef:l.context.itemDomElements,labelsRef:l.context.itemLabels,children:se})})]})}),wr=r.createContext(null);function Hn(e){return r.useContext(wr)}const Mr={...hn,disabled:Q(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Q(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Q(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:Q(e=>e.stickIfOpen),parent:Q(e=>e.parent),rootId:Q(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Q(e=>e.activeIndex),isActive:Q((e,t)=>e.activeIndex===t),hoverEnabled:Q(e=>e.hoverEnabled),instantType:Q(e=>e.instantType),lastOpenChangeReason:Q(e=>e.openChangeReason),floatingTreeRoot:Q(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Q(e=>e.floatingNodeId),floatingParentNodeId:Q(e=>e.floatingParentNodeId),itemProps:Q(e=>e.itemProps),closeDelay:Q(e=>e.closeDelay),keyboardEventRelay:Q(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Ft extends mn{constructor(t){super({...Or(),...t},{positionerRef:r.createRef(),popupRef:r.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:r.createRef(),beforeContentFocusGuardRef:r.createRef(),onOpenChangeComplete:void 0,triggerElements:new bn},Mr),this.observe(Q(n=>n.allowMouseEnter),(n,o)=>{this.state.parent.type==="menu"&&n!==o&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const o=Qt(()=>new Ft(n)).current;return t??o}unsubscribeParentListener=null}function Or(){return{...yn(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new xn,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ge,keyboardEventRelay:void 0,closeDelay:0}}const Pr=r.createContext(void 0);function kr(){return r.useContext(Pr)}function Fr(e){const{children:t,open:n,onOpenChange:o,onOpenChangeComplete:i,defaultOpen:u=!1,disabled:p=!1,modal:a,loopFocus:c=!0,orientation:C="vertical",actionsRef:x,closeParentOnEsc:v=!1,handle:h,triggerId:y,defaultTriggerId:g=null,highlightItemOnHover:d=!0}=e,f=gt(!0),m=He(!0),l=Hn(),b=kr(),M=r.useMemo(()=>b&&m?{type:"menu",store:m.store}:l?{type:"menubar",context:l}:f&&!m?{type:"context-menu",context:f}:{type:void 0},[f,m,l,b]),s=Ft.useStore(h?.store,{parent:M}),I=s.useState("floatingTreeRoot"),k=vn(I),j=lt();pe(()=>{f&&!m?s.update({parent:{type:"context-menu",context:f},floatingNodeId:k,floatingParentNodeId:j}):m&&s.update({floatingNodeId:k,floatingParentNodeId:j})},[f,m,k,j,s]),s.useControlledProp("open",n,u),s.useControlledProp("activeTriggerId",y,g),s.useContextCallback("onOpenChangeComplete",i);const A=s.useState("open"),K=s.useState("activeTriggerElement"),G=s.useState("positionerElement"),z=s.useState("hoverEnabled"),W=s.useState("modal"),Y=s.useState("disabled"),T=s.useState("lastOpenChangeReason"),$=s.useState("parent"),oe=s.useState("activeIndex"),_=s.useState("payload"),re=s.useState("floatingParentNodeId"),w=r.useRef(null),te=re!=null;let ae;s.useSyncedValues({disabled:p,modal:$.type===void 0?a:void 0,rootId:tn()});const{openMethod:O,triggerProps:ge,reset:me}=Dn(A);dn(s);const{forceUnmount:Re}=fn(A,s,()=>{s.update({allowMouseEnter:!1,stickIfOpen:!0}),me()}),se=r.useRef($.type!=="context-menu"),be=Ne();r.useEffect(()=>{if(A||(w.current=null),$.type==="context-menu"){if(!A){be.clear(),se.current=!1;return}be.start(500,()=>{se.current=!0})}},[be,A,$.type]),Nn(A&&W&&T!==Ve&&O!=="touch",G),pe(()=>{!A&&!z&&s.set("hoverEnabled",!0)},[A,z,s]);const ue=r.useRef(!0),Z=Ne(),q=xe((V,ee)=>{const ye=ee.reason;if(A===V&&ee.trigger===K&&T===ye||(ee.preventUnmountOnClose=()=>{s.set("preventUnmountingOnClose",!0)},!V&&ee.trigger==null&&(ee.trigger=K??void 0),o?.(V,ee),ee.isCanceled))return;const Vn={open:V,nativeEvent:ee.event,reason:ee.reason,nested:te};ae?.emit("openchange",Vn);const ze=ee.event;if(V===!1&&ze?.type==="click"&&ze.pointerType==="touch"&&!ue.current)return;if(!V&&oe!==null){const We=s.context.itemDomElements.current[oe];queueMicrotask(()=>{We?.setAttribute("tabindex","-1")})}V&&ye===Lt?(ue.current=!1,Z.start(300,()=>{ue.current=!0})):(ue.current=!0,Z.clear());const Nt=(ye===nt||ye===rn)&&ze.detail===0&&ze?.isTrusted,Kn=!V&&(ye===_n||ye==null);function Dt(){const We={open:V,openChangeReason:ye};w.current=ee.event??null;const At=ee.trigger?.id??null;(At||V)&&(We.activeTriggerId=At,We.activeTriggerElement=ee.trigger??null),s.update(We)}ye===Ve?vt.flushSync(Dt):Dt(),$.type==="menubar"&&(ye===Lt||ye===Ye||ye===Ve||ye===ot||ye===$e)?s.set("instantType","group"):Nt||Kn?s.set("instantType",Nt?"click":"dismiss"):s.set("instantType",void 0)}),F=r.useCallback(V=>{const ee=de(V);return ee.preventUnmountOnClose=()=>{s.set("preventUnmountingOnClose",!0)},ee},[s]),fe=r.useCallback(()=>{s.setOpen(!1,F(on))},[s,F]);r.useImperativeHandle(x,()=>({unmount:Re,close:fe}),[Re,fe]);let he;$.type==="context-menu"&&(he=$.context),r.useImperativeHandle(he?.positionerRef,()=>G,[G]),r.useImperativeHandle(he?.actionsRef,()=>({setOpen:q}),[q]);const ve=pn({popupStore:s,onOpenChange:q});ae=ve.context.events,r.useEffect(()=>{const V=({open:ee,eventDetails:ye})=>q(ee,ye);return ae.on("setOpen",V),()=>{ae?.off("setOpen",V)}},[ae,q]);const P=gn(ve,{enabled:!Y,bubbles:{escapeKey:v&&$.type==="menu"},outsidePress(){return $.type!=="context-menu"||w.current?.type==="contextmenu"?!0:se.current},externalTree:te?I:void 0}),S=Mn(ve,{role:"menu"}),B=Eo(),D=r.useCallback(V=>{s.select("activeIndex")!==V&&s.set("activeIndex",V)},[s]),X=Wo(ve,{enabled:!Y,listRef:s.context.itemDomElements,activeIndex:oe,nested:$.type!==void 0,loopFocus:c,orientation:C,parentOrientation:$.type==="menubar"?$.context.orientation:void 0,rtl:B==="rtl",disabledIndices:st,onNavigate:D,openOnArrowKeyDown:$.type!=="context-menu",externalTree:te?I:void 0,focusItemOnHover:d}),N=r.useCallback(V=>{s.context.typingRef.current=V},[s]),U=Yo(ve,{listRef:s.context.itemLabels,activeIndex:oe,resetMs:fo,onMatch:V=>{A&&V!==oe&&s.set("activeIndex",V)},onTypingChange:N}),{getReferenceProps:R,getFloatingProps:L,getItemProps:E,getTriggerProps:J}=Pt([P,S,X,U]),ne=r.useMemo(()=>{const V=Ct(R(),{onMouseEnter(){s.set("hoverEnabled",!0)},onMouseMove(){s.set("allowMouseEnter",!0)}},ge);return delete V.role,V},[R,s,ge]),le=r.useMemo(()=>{const V=J();if(!V)return V;const ee=Ct(V,ge);return delete ee.role,delete ee["aria-controls"],ee},[J,ge]),ce=wt(),we=r.useMemo(()=>L({onMouseEnter(){$.type==="menu"&&ce.request(()=>s.set("hoverEnabled",!1))},onMouseMove(){s.set("allowMouseEnter",!0)},onClick(){s.select("hoverEnabled")&&s.set("hoverEnabled",!1)},onKeyDown(V){const ee=s.select("keyboardEventRelay");ee&&!V.isPropagationStopped()&&ee(V)}}),[L,$.type,ce,s]),Me=r.useMemo(()=>E(),[E]);s.useSyncedValues({floatingRootContext:ve,activeTriggerProps:ne,inactiveTriggerProps:le,popupProps:we,itemProps:Me});const Ce=r.useMemo(()=>({store:s,parent:M}),[s,M]),Oe=H.jsx(Bn.Provider,{value:Ce,children:typeof t=="function"?t({payload:_}):t});return $.type===void 0||$.type==="context-menu"?H.jsx(lo,{externalTree:I,children:Oe}):Oe}function Nr(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const u=parseFloat(n.width)||0,p=parseFloat(n.height)||0,a=parseFloat(o.width)||0,c=parseFloat(o.height)||0,C=Math.max(t.width,u,a),x=Math.max(t.height,p,c),v=C-t.width,h=x-t.height;return{left:t.left-v/2,right:t.right+v/2,top:t.top-h/2,bottom:t.bottom+h/2}}function Dr(e){const{render:t,className:n,state:o=Ge,props:i=st,refs:u=st,metadata:p,stateAttributesMapping:a,tag:c="div",...C}=e,{compositeProps:x,compositeRef:v}=Po({metadata:p});return Te(c,e,{state:o,ref:[...u,v],props:[x,...i,C],stateAttributesMapping:a})}function Un(e){if(ke(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!zn(e))return Un(Xn(e))}function Ar(e){const{enabled:t=!0,mouseDownAction:n,open:o}=e,i=r.useRef(!1);return r.useMemo(()=>t?{onMouseDown:u=>{(n==="open"&&!o||n==="close"&&o)&&(i.current=!0,De(u.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:u=>{i.current&&(i.current=!1,u.preventBaseUIHandler())}}:Ge,[t,n,o])}const tt=2,Lr=r.forwardRef(function(t,n){const{render:o,className:i,disabled:u=!1,nativeButton:p=!0,id:a,openOnHover:c,delay:C=100,closeDelay:x=0,handle:v,payload:h,...y}=t,g=He(!0),d=v?.store??g?.store;if(!d)throw new Error(Le(85));const f=ut(a),m=d.useState("isTriggerActive",f),l=d.useState("floatingRootContext"),b=d.useState("isOpenedByTrigger",f),M=r.useRef(null),s=jr(),I=Jn(!0),k=Tt(),j=r.useMemo(()=>k??new xn,[k]),A=vn(j),K=lt(),{registerTrigger:G,isMountedByThisTrigger:z}=po(f,M,d,{payload:h,closeDelay:x,parent:s,floatingTreeRoot:j,floatingNodeId:A,floatingParentNodeId:K,keyboardEventRelay:I?.relayKeyboardEvent}),W=s.type==="menubar",Y=d.useState("disabled"),T=u||Y||W&&s.context.disabled,{getButtonProps:$,buttonRef:oe}=It({disabled:T,native:p});r.useEffect(()=>{!b&&s.type===void 0&&(d.context.allowMouseUpTriggerRef.current=!1)},[d,b,s.type]);const _=r.useRef(null),re=Ne(),w=xe(S=>{if(!_.current)return;re.clear(),d.context.allowMouseUpTriggerRef.current=!1;const B=S.target;if(ie(_.current,B)||ie(d.select("positionerElement"),B)||B===_.current||B!=null&&Un(B)===d.select("rootId"))return;const D=Nr(_.current);S.clientX>=D.left-tt&&S.clientX<=D.right+tt&&S.clientY>=D.top-tt&&S.clientY<=D.bottom+tt||j.events.emit("close",{domEvent:S,reason:Qn})});r.useEffect(()=>{b&&d.select("lastOpenChangeReason")===Ve&&De(_.current).addEventListener("mouseup",w,{once:!0})},[b,w,d]);const te=W&&s.context.hasSubmenuOpen,O=go(l,{enabled:(c??te)&&!T&&s.type!=="context-menu"&&(!W||te&&!z),handleClose:mo({blockPointerEvents:!W}),mouseOnly:!0,move:!1,restMs:s.type===void 0?C:void 0,delay:{close:x},triggerElementRef:M,externalTree:j,isActiveTrigger:m}),ge=Br(b,d.select("lastOpenChangeReason")),me=Uo(l,{enabled:!T&&s.type!=="context-menu",event:b&&W?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:s.type===void 0?ge:!1}),Re=bo(l,{enabled:!T&&te}),se=Ar({open:b,enabled:W,mouseDownAction:"open"}),be=Pt([me,Re]),ue=r.useMemo(()=>({disabled:T,open:b}),[T,b]),Z=d.useState("triggerProps",z),q=[_,n,oe,G,M],F=[be.getReferenceProps(),O??Ge,Z,{"aria-haspopup":"menu",id:f,onMouseDown:S=>{if(d.select("open"))return;re.start(200,()=>{d.context.allowMouseUpTriggerRef.current=!0}),De(S.currentTarget).addEventListener("mouseup",w,{once:!0})}},W?{role:"menuitem"}:{},se,y,$],fe=r.useRef(null),he=xe(S=>{vt.flushSync(()=>{d.setOpen(!1,de(Ye,S.nativeEvent,S.currentTarget))}),ho(fe.current)?.focus()}),ve=xe(S=>{const B=d.select("positionerElement");if(B&&Et(S,B))d.context.beforeContentFocusGuardRef.current?.focus();else{vt.flushSync(()=>{d.setOpen(!1,de(Ye,S.nativeEvent,S.currentTarget))});let D=yo(d.context.triggerFocusTargetRef.current||M.current);for(;D!==null&&ie(B,D);){const X=D;if(D=an(D),D===X)break}D?.focus()}}),P=Te("button",t,{enabled:!W,stateAttributesMapping:Vt,state:ue,ref:q,props:F});return W?H.jsx(Dr,{tag:"button",render:o,className:i,state:ue,refs:q,props:F,stateAttributesMapping:Vt}):b?H.jsxs(r.Fragment,{children:[H.jsx(it,{ref:fe,onFocus:he},`${f}-pre-focus-guard`),H.jsx(r.Fragment,{children:P},f),H.jsx(it,{ref:d.context.triggerFocusTargetRef,onFocus:ve},`${f}-post-focus-guard`)]}):H.jsx(r.Fragment,{children:P},f)});function Br(e,t){const n=Ne(),[o,i]=r.useState(!1);return pe(()=>{e&&t==="trigger-hover"?(i(!0),n.start(xo,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),o}function jr(){const e=gt(!0),t=He(!0),n=Hn();return r.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function Qr({children:e,...t}){return H.jsx(Fr,{...t,children:e})}function Zr({className:e,...t}){return H.jsx(Lr,{className:Be(e),...t})}function es({className:e,side:t="bottom",align:n="end",children:o}){return H.jsx(Ir,{children:H.jsx(Tr,{side:t,align:n,children:H.jsx(Er,{className:Be("min-w-[110px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10",e),children:o})})})}function ts({className:e,...t}){return H.jsx(xr,{className:Be("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900 hover:bg-primary-100 data-highlighted:bg-primary-100","select-none font-[450]",e),...t})}const ns=Fo((e,t)=>({currentPath:"/",viewMode:"list",sortBy:"name",sortAsc:!0,selectedFiles:new Set,editingFile:null,navigateTo:n=>{e({currentPath:n,selectedFiles:new Set})},setViewMode:n=>{e({viewMode:n})},setSortBy:n=>{const o=t().sortBy;e({sortBy:n,sortAsc:o===n?!t().sortAsc:!0})},toggleSort:()=>{e(n=>({sortAsc:!n.sortAsc}))},selectFile:n=>{e(o=>{const i=new Set(o.selectedFiles);return i.add(n),{selectedFiles:i}})},deselectFile:n=>{e(o=>{const i=new Set(o.selectedFiles);return i.delete(n),{selectedFiles:i}})},clearSelection:()=>{e({selectedFiles:new Set})},openInEditor:n=>{const o=n.includes("/")&&n.slice(0,n.lastIndexOf("/"))||"/";e({currentPath:o,editingFile:n,selectedFiles:new Set})},closeEditor:()=>{e({editingFile:null})},toggleFileSelection:n=>{const{selectedFiles:o,selectFile:i,deselectFile:u}=t();o.has(n)?u(n):i(n)}}));export{qr as D,Qr as M,_r as a,zr as b,Xr as c,Jr as d,Zr as e,es as f,ts as g,je as h,fr as i,lr as j,Pn as k,nr as l,_o as m,tr as n,mr as o,Xo as p,zo as q,ns as u};
@@ -0,0 +1 @@
1
+ import{C as V,aa as _,ab as Y,ac as j,ad as D}from"./button-BaHefIXU.js";import{r as l,e as x}from"./main-mIHr_ble.js";const G=()=>{},J=typeof document<"u"?l.useLayoutEffect:G;function m(){return typeof window<"u"}function E(e){return I(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function X(e){var t;return(t=(I(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I(e){return m()?e instanceof Node||e instanceof d(e).Node:!1}function T(e){return m()?e instanceof Element||e instanceof d(e).Element:!1}function h(e){return m()?e instanceof HTMLElement||e instanceof d(e).HTMLElement:!1}function k(e){return!m()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof d(e).ShadowRoot}const q=new Set(["inline","contents"]);function L(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=O(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!q.has(s)}const z=new Set(["table","td","th"]);function he(e){return z.has(E(e))}const Q=[":popover-open",":modal"];function Z(e){return Q.some(t=>{try{return e.matches(t)}catch{return!1}})}const ee=["transform","translate","scale","rotate","perspective"],te=["transform","translate","scale","rotate","perspective","filter"],ne=["paint","layout","strict","content"];function oe(e){const t=se(),n=T(e)?O(e):e;return ee.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||te.some(r=>(n.willChange||"").includes(r))||ne.some(r=>(n.contain||"").includes(r))}function Ce(e){let t=y(e);for(;h(t)&&!B(t);){if(oe(t))return t;if(Z(t))return null;t=y(t)}return null}function se(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const re=new Set(["html","body","#document"]);function B(e){return re.has(E(e))}function O(e){return d(e).getComputedStyle(e)}function De(e){return T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function y(e){if(E(e)==="html")return e;const t=e.assignedSlot||e.parentNode||k(e)&&e.host||X(e);return k(t)?t.host:t}function R(e){const t=y(e);return B(t)?e.ownerDocument?e.ownerDocument.body:e.body:h(t)&&L(t)?t:R(t)}function N(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=R(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=d(s);if(a){const u=ae(i);return t.concat(i,i.visualViewport||[],L(s)?s:[],u&&n?N(u):[])}return t.concat(s,N(s,[],n))}function ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const g=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ie=g&&g!==l.useLayoutEffect?g:e=>e();function S(e){const t=V(ce).current;return t.next=e,ie(t.effect),t.trampoline}function ce(){const e={next:void 0,callback:le,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function le(){}const ue={...x};let P=0;function fe(e,t="mui"){const[n,r]=l.useState(e),s=e||n;return l.useEffect(()=>{n==null&&(P+=1,r(`${t}-${P}`))},[n,t]),s}const v=ue.useId;function de(e,t){if(v!==void 0){const n=v();return e??(t?`${t}-${n}`:n)}return fe(e,t)}const ke="none",Ne="trigger-press",Se="trigger-hover",Pe="trigger-focus",ve="outside-press",xe="item-press",Ie="close-press",Te="focus-out",Le="escape-key",Be="list-navigation",Oe="cancel-open",Re="sibling-open",Ke="disabled",Me="imperative-action";function Fe(e,t,n,r){let s=!1,a=!1;const i=r??_;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:n,...i}}function Ue(e){return de(e,"base-ui")}const pe=l.createContext(void 0);function be(e=!1){const t=l.useContext(pe);if(t===void 0&&!e)throw new Error(Y(16));return t}function me(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,i=r&&t!==!1,u=r&&t===!1;return{props:l.useMemo(()=>{const f={onKeyDown(b){n&&t&&b.key!=="Tab"&&b.preventDefault()}};return r||(f.tabIndex=s,!a&&n&&(f.tabIndex=t?s:-1)),(a&&(t||i)||!a&&n)&&(f["aria-disabled"]=n),a&&(!t||u)&&(f.disabled=n),f},[r,n,t,i,u,a,s])}}function We(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0}=e,a=l.useRef(null),i=be(!0)!==void 0,u=S(()=>{const c=a.current;return!!(c?.tagName==="A"&&c?.href)}),{props:p}=me({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:s}),f=l.useCallback(()=>{const c=a.current;we(c)&&i&&t&&p.disabled===void 0&&c.disabled&&(c.disabled=!1)},[t,p.disabled,i]);J(f,[f]);const b=l.useCallback((c={})=>{const{onClick:w,onMouseDown:M,onKeyUp:F,onKeyDown:U,onPointerDown:W,...A}=c;return j({type:s?"button":void 0,onClick(o){if(t){o.preventDefault();return}w?.(o)},onMouseDown(o){t||M?.(o)},onKeyDown(o){if(t||(D(o),U?.(o)),o.baseUIHandlerPrevented)return;const H=o.target===o.currentTarget&&!s&&!u()&&!t,C=o.key==="Enter",$=o.key===" ";H&&(($||C)&&o.preventDefault(),C&&w?.(o))},onKeyUp(o){t||(D(o),F?.(o)),!o.baseUIHandlerPrevented&&o.target===o.currentTarget&&!s&&!t&&o.key===" "&&w?.(o)},onPointerDown(o){if(t){o.preventDefault();return}W?.(o)}},s?void 0:{role:"button"},p,A)},[t,p,s,u]),K=S(c=>{a.current=c,f()});return{getButtonProps:b,buttonRef:K}}function we(e){return h(e)&&e.tagName==="BUTTON"}export{B as A,y as B,pe as C,Oe as D,I as E,N as F,X as G,ae as H,se as I,Z as J,he as K,oe as L,Ce as M,De as N,Ke as O,S as a,be as b,k as c,Ue as d,T as e,We as f,Fe as g,O as h,h as i,E as j,Te as k,d as l,Ne as m,ke as n,ve as o,Be as p,de as q,Ie as r,L as s,Se as t,J as u,Me as v,xe as w,Re as x,Pe as y,Le as z};
@@ -0,0 +1 @@
1
+ import{A as $,s as S,a as Z,b as H,c as y,f as K}from"./DirectionContext-DXnZc0zz.js";import{i as F,u as P,a as N,b as q}from"./useButton-DsMdJPGn.js";import{r as E,j as J}from"./main-mIHr_ble.js";import{C as U,E as Q}from"./button-BaHefIXU.js";function A(t,e,a){return Math.floor(t/e)!==a}function I(t,e){return e<0||e>=t.current.length}function mt(t,e){return L(t,{disabledIndices:e})}function Ot(t,e){return L(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function L(t,{startingIndex:e=-1,decrement:a=!1,disabledIndices:i,amount:g=1}={}){let n=e;do n+=a?-g:g;while(n>=0&&n<=t.current.length-1&&V(t,n,i));return n}function Et(t,{event:e,orientation:a,loopFocus:i,rtl:g,cols:n,disabledIndices:c,minIndex:m,maxIndex:u,prevIndex:r,stopEvent:f=!1}){let o=r;const R=[],T={};let M=!1;{let s=null,d=-1;t.current.forEach((h,l)=>{if(h==null)return;const O=h.closest('[role="row"]');O&&(M=!0),(O!==s||d===-1)&&(s=O,d+=1,R[d]=[]),R[d].push(l),T[l]=d})}const w=M&&R.length>0&&R.some(s=>s.length!==n);function p(s){if(!w||r===-1)return;const d=T[r];if(d==null)return;const h=R[d].indexOf(r);let l=s==="up"?d-1:d+1;i&&(l<0?l=R.length-1:l>=R.length&&(l=0));const O=new Set;for(;l>=0&&l<R.length&&!O.has(l);){O.add(l);const b=R[l];if(b.length===0){l=s==="up"?l-1:l+1;continue}const X=Math.min(h,b.length-1);for(let D=X;D>=0;D-=1){const G=b[D];if(!V(t,G,c))return G}l=s==="up"?l-1:l+1,i&&(l<0?l=R.length-1:l>=R.length&&(l=0))}}if(e.key===$){const s=p("up");if(s!==void 0)f&&S(e),o=s;else{if(f&&S(e),r===-1)o=u;else if(o=L(t,{startingIndex:o,amount:n,decrement:!0,disabledIndices:c}),i&&(r-n<m||o<0)){const d=r%n,h=u%n,l=u-(h-d);h===d?o=u:o=h>d?l:l-n}I(t,o)&&(o=r)}}if(e.key===Z){const s=p("down");s!==void 0?(f&&S(e),o=s):(f&&S(e),r===-1?o=m:(o=L(t,{startingIndex:r,amount:n,disabledIndices:c}),i&&r+n>u&&(o=L(t,{startingIndex:r%n-n,amount:n,disabledIndices:c}))),I(t,o)&&(o=r))}if(a==="both"){const s=K(r/n);e.key===(g?H:y)&&(f&&S(e),r%n!==n-1?(o=L(t,{startingIndex:r,disabledIndices:c}),i&&A(o,n,s)&&(o=L(t,{startingIndex:r-r%n-1,disabledIndices:c}))):i&&(o=L(t,{startingIndex:r-r%n-1,disabledIndices:c})),A(o,n,s)&&(o=r)),e.key===(g?y:H)&&(f&&S(e),r%n!==0?(o=L(t,{startingIndex:r,decrement:!0,disabledIndices:c}),i&&A(o,n,s)&&(o=L(t,{startingIndex:r+(n-r%n),decrement:!0,disabledIndices:c}))):i&&(o=L(t,{startingIndex:r+(n-r%n),decrement:!0,disabledIndices:c})),A(o,n,s)&&(o=r));const d=K(u/n)===s;I(t,o)&&(i&&d?o=e.key===(g?y:H)?u:L(t,{startingIndex:r-r%n-1,disabledIndices:c}):o=r)}return o}function Tt(t,e,a){const i=[];let g=0;return t.forEach(({width:n,height:c},m)=>{let u=!1;for(a&&(g=0);!u;){const r=[];for(let f=0;f<n;f+=1)for(let o=0;o<c;o+=1)r.push(g+f+o*e);g%e+n<=e&&r.every(f=>i[f]==null)?(r.forEach(f=>{i[f]=m}),u=!0):g+=1}}),[...i]}function Lt(t,e,a,i,g){if(t===-1)return-1;const n=a.indexOf(t),c=e[t];switch(g){case"tl":return n;case"tr":return c?n+c.width-1:n;case"bl":return c?n+(c.height-1)*i:n;case"br":return a.lastIndexOf(t);default:return-1}}function wt(t,e){return e.flatMap((a,i)=>t.includes(a)?[i]:[])}function V(t,e,a){if(typeof a=="function")return a(e);if(a)return a.includes(e);const i=t.current[e];return i?i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true":!1}const k="ArrowUp",Y="ArrowDown",x="ArrowLeft",B="ArrowRight",C="Home",W="End",v=new Set([x,B]),pt=new Set([x,B,C,W]),tt=new Set([k,Y]),Pt=new Set([k,Y,C,W]),et=new Set([...v,...tt]),St=new Set([...et,C,W]),Nt=new Set([k,Y,x,B,C,W]),nt="Shift",rt="Control",st="Alt",ot="Meta",At=new Set([nt,rt,st,ot]);function it(t){return F(t)&&t.tagName==="INPUT"}function _t(t){return!!(it(t)&&t.selectionStart!=null||F(t)&&t.tagName==="TEXTAREA")}function Ct(t,e,a,i){if(!t||!e||!e.scrollTo)return;let g=t.scrollLeft,n=t.scrollTop;const c=t.clientWidth<t.scrollWidth,m=t.clientHeight<t.scrollHeight;if(c&&i!=="vertical"){const u=z(t,e,"left"),r=_(t),f=_(e);a==="ltr"&&(u+e.offsetWidth+f.scrollMarginRight>t.scrollLeft+t.clientWidth-r.scrollPaddingRight?g=u+e.offsetWidth+f.scrollMarginRight-t.clientWidth+r.scrollPaddingRight:u-f.scrollMarginLeft<t.scrollLeft+r.scrollPaddingLeft&&(g=u-f.scrollMarginLeft-r.scrollPaddingLeft)),a==="rtl"&&(u-f.scrollMarginRight<t.scrollLeft+r.scrollPaddingLeft?g=u-f.scrollMarginLeft-r.scrollPaddingLeft:u+e.offsetWidth+f.scrollMarginRight>t.scrollLeft+t.clientWidth-r.scrollPaddingRight&&(g=u+e.offsetWidth+f.scrollMarginRight-t.clientWidth+r.scrollPaddingRight))}if(m&&i!=="horizontal"){const u=z(t,e,"top"),r=_(t),f=_(e);u-f.scrollMarginTop<t.scrollTop+r.scrollPaddingTop?n=u-f.scrollMarginTop-r.scrollPaddingTop:u+e.offsetHeight+f.scrollMarginBottom>t.scrollTop+t.clientHeight-r.scrollPaddingBottom&&(n=u+e.offsetHeight+f.scrollMarginBottom-t.clientHeight+r.scrollPaddingBottom)}t.scrollTo({left:g,top:n,behavior:"auto"})}function z(t,e,a){const i=a==="left"?"offsetLeft":"offsetTop";let g=0;for(;e.offsetParent&&(g+=e[i],e.offsetParent!==t);)e=e.offsetParent;return g}function _(t){const e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}const j=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ft(){return E.useContext(j)}let at=(function(t){return t[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t})({});function ut(t={}){const{label:e,metadata:a,textRef:i,indexGuessBehavior:g,index:n}=t,{register:c,unregister:m,subscribeMapChange:u,elementsRef:r,labelsRef:f,nextIndexRef:o}=ft(),R=E.useRef(-1),[T,M]=E.useState(n??(g===at.GuessFromOrder?()=>{if(R.current===-1){const s=o.current;o.current+=1,R.current=s}return R.current}:-1)),w=E.useRef(null),p=E.useCallback(s=>{if(w.current=s,T!==-1&&s!==null&&(r.current[T]=s,f)){const d=e!==void 0;f.current[T]=d?e:i?.current?.textContent??s.textContent}},[T,r,f,e,i]);return P(()=>{if(n!=null)return;const s=w.current;if(s)return c(s,a),()=>{m(s)}},[n,c,m,a]),P(()=>{if(n==null)return u(s=>{const d=w.current?s.get(w.current)?.index:null;d!=null&&M(d)})},[n,u,M]),E.useMemo(()=>({ref:p,index:T}),[T,p])}function Wt(t){const{children:e,elementsRef:a,labelsRef:i,onMapChange:g}=t,n=N(g),c=E.useRef(0),m=U(lt).current,u=U(ct).current,[r,f]=E.useState(0),o=E.useRef(r),R=N((s,d)=>{u.set(s,d??null),o.current+=1,f(o.current)}),T=N(s=>{u.delete(s),o.current+=1,f(o.current)}),M=E.useMemo(()=>{const s=new Map;return Array.from(u.keys()).filter(h=>h.isConnected).sort(gt).forEach((h,l)=>{const O=u.get(h)??{};s.set(h,{...O,index:l})}),s},[u,r]);P(()=>{if(typeof MutationObserver!="function"||M.size===0)return;const s=new MutationObserver(d=>{const h=new Set,l=O=>h.has(O)?h.delete(O):h.add(O);d.forEach(O=>{O.removedNodes.forEach(l),O.addedNodes.forEach(l)}),h.size===0&&(o.current+=1,f(o.current))});return M.forEach((d,h)=>{h.parentElement&&s.observe(h.parentElement,{childList:!0})}),()=>{s.disconnect()}},[M]),P(()=>{o.current===r&&(a.current.length!==M.size&&(a.current.length=M.size),i&&i.current.length!==M.size&&(i.current.length=M.size),c.current=M.size),n(M)},[n,M,a,i,r]),P(()=>()=>{a.current=[]},[a]),P(()=>()=>{i&&(i.current=[])},[i]);const w=N(s=>(m.add(s),()=>{m.delete(s)}));P(()=>{m.forEach(s=>s(M))},[m,M]);const p=E.useMemo(()=>({register:R,unregister:T,subscribeMapChange:w,elementsRef:a,labelsRef:i,nextIndexRef:c}),[R,T,w,a,i,c]);return J.jsx(j.Provider,{value:p,children:e})}function ct(){return new Map}function lt(){return new Set}function gt(t,e){const a=t.compareDocumentPosition(e);return a&Node.DOCUMENT_POSITION_FOLLOWING||a&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:a&Node.DOCUMENT_POSITION_PRECEDING||a&Node.DOCUMENT_POSITION_CONTAINS?1:0}function bt(t={}){const{highlightItemOnHover:e,highlightedIndex:a,onHighlightedIndexChange:i}=q(),{ref:g,index:n}=ut(t),c=a===n,m=E.useRef(null),u=Q(g,m);return{compositeProps:E.useMemo(()=>({tabIndex:c?0:-1,onFocus(){i(n)},onMouseMove(){const f=m.current;if(!e||!f)return;const o=f.hasAttribute("disabled")||f.ariaDisabled==="true";!c&&!o&&f.focus()}}),[c,i,n,e]),compositeRef:u,index:n}}export{St as A,Wt as C,W as E,C as H,At as M,Pt as V,et as a,Ot as b,Tt as c,V as d,Et as e,Lt as f,mt as g,Y as h,_t as i,B as j,wt as k,x as l,k as m,L as n,I as o,tt as p,pt as q,v as r,Ct as s,Nt as t,bt as u,ut as v};
@@ -1 +1 @@
1
- import{r as e}from"./main-CkIF0soY.js";function d({controlled:t,default:s,name:c,state:f="value"}){const{current:a}=e.useRef(t!==void 0),[o,u]=e.useState(s),l=a?t:o,n=e.useCallback(r=>{a||u(r)},[]);return[l,n]}export{d as u};
1
+ import{r as e}from"./main-mIHr_ble.js";function d({controlled:t,default:s,name:c,state:f="value"}){const{current:a}=e.useRef(t!==void 0),[o,u]=e.useState(s),l=a?t:o,n=e.useCallback(r=>{a||u(r)},[]);return[l,n]}export{d as u};
@@ -1 +1 @@
1
- import{S as l,s as d,h as a,e as p,n as h,u as m,r as o,f as b,i as v}from"./main-CkIF0soY.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),d(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??p();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=m(),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(b)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
1
+ import{S as l,s as d,h as a,g as p,n as h,u as b,r as o,b as m,c as v}from"./main-mIHr_ble.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),d(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??p();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=b(),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
@@ -0,0 +1,9 @@
1
+ import{S as Br,p as Rn,k as G,s as xe,l as wt,b as Se,m as Pe,o as Dn,t as jr,q as jt,v as Nr,x as Ur,y as En,n as Qs,r as y,c as qs,u as Wr,j as Q}from"./main-mIHr_ble.js";var Kr=class extends Br{constructor(t,e){super(),this.options=e,this.#n=t,this.#i=null,this.#s=Rn(),this.bindMethods(),this.setOptions(e)}#n;#t=void 0;#p=void 0;#e=void 0;#o;#u;#s;#i;#m;#h;#f;#a;#l;#r;#d=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ln(this.#t,this.options)?this.#c():this.updateResult(),this.#T())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return be(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return be(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#n.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof G(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#P(),this.#t.setOptions(this.options),e._defaulted&&!xe(this.options,e)&&this.#n.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&In(this.#t,n,this.options,e)&&this.#c(),this.updateResult(),s&&(this.#t!==n||G(this.options.enabled,this.#t)!==G(e.enabled,this.#t)||wt(this.options.staleTime,this.#t)!==wt(e.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||G(this.options.enabled,this.#t)!==G(e.enabled,this.#t)||i!==this.#r)&&this.#v(i)}getOptimisticResult(t){const e=this.#n.getQueryCache().build(this.#n,t),n=this.createResult(e,t);return $r(this,n)&&(this.#e=n,this.#u=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),e?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#n.defaultQueryOptions(t),n=this.#n.getQueryCache().build(this.#n,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#c({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#c(t){this.#P();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Se)),e}#g(){this.#x();const t=wt(this.options.staleTime,this.#t);if(Pe||this.#e.isStale||!Dn(t))return;const n=jr(this.#e.dataUpdatedAt,t)+1;this.#a=jt.setTimeout(()=>{this.#e.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#S(),this.#r=t,!(Pe||G(this.options.enabled,this.#t)===!1||!Dn(this.#r)||this.#r===0)&&(this.#l=jt.setInterval(()=>{(this.options.refetchIntervalInBackground||Nr.isFocused())&&this.#c()},this.#r))}#T(){this.#g(),this.#v(this.#y())}#x(){this.#a&&(jt.clearTimeout(this.#a),this.#a=void 0)}#S(){this.#l&&(jt.clearInterval(this.#l),this.#l=void 0)}createResult(t,e){const n=this.#t,s=this.options,i=this.#e,o=this.#o,r=this.#u,l=t!==n?t.state:this.#p,{state:u}=t;let c={...u},h=!1,f;if(e._optimisticResults){const P=this.hasListeners(),C=!P&&Ln(t,e),R=P&&In(t,n,e,s);(C||R)&&(c={...c,...Ur(u.data,t.options)}),e._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:m}=c;f=c.data;let v=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let P;i?.isPlaceholderData&&e.placeholderData===r?.placeholderData?(P=i.data,v=!0):P=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,P!==void 0&&(m="success",f=En(i?.data,P,e),h=!0)}if(e.select&&f!==void 0&&!v)if(i&&f===o?.data&&e.select===this.#m)f=this.#h;else try{this.#m=e.select,f=e.select(f),f=En(i?.data,f,e),this.#h=f,this.#i=null}catch(P){this.#i=P}this.#i&&(d=this.#i,f=this.#h,p=Date.now(),m="error");const T=c.fetchStatus==="fetching",S=m==="pending",g=m==="error",w=S&&T,b=f!==void 0,V={status:m,fetchStatus:c.fetchStatus,isPending:S,isSuccess:m==="success",isError:g,isInitialLoading:w,isLoading:w,data:f,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:T,isRefetching:T&&!S,isLoadingError:g&&!b,isPaused:c.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:g&&b,isStale:ze(t,e),refetch:this.refetch,promise:this.#s,isEnabled:G(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=V.data!==void 0,C=V.status==="error"&&!P,R=J=>{C?J.reject(V.error):P&&J.resolve(V.data)},N=()=>{const J=this.#s=V.promise=Rn();R(J)},z=this.#s;switch(z.status){case"pending":t.queryHash===n.queryHash&&R(z);break;case"fulfilled":(C||V.data!==z.value)&&N();break;case"rejected":(!C||V.error!==z.reason)&&N();break}}return V}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#u=this.options,this.#o.data!==void 0&&(this.#f=this.#t),xe(e,t))return;this.#e=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#d.size)return!0;const o=new Set(i??this.#d);return this.options.throwOnError&&o.add("error"),Object.keys(this.#e).some(r=>{const a=r;return this.#e[a]!==t[a]&&o.has(a)})};this.#b({listeners:n()})}#P(){const t=this.#n.getQueryCache().build(this.#n,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#T()}#b(t){Qs.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#n.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function _r(t,e){return G(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Ln(t,e){return _r(t,e)||t.state.data!==void 0&&be(t,e,e.refetchOnMount)}function be(t,e,n){if(G(e.enabled,t)!==!1&&wt(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&ze(t,e)}return!1}function In(t,e,n,s){return(t!==e||G(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&ze(t,n)}function ze(t,e){return G(e.enabled,t)!==!1&&t.isStaleByTime(wt(e.staleTime,t))}function $r(t,e){return!xe(t.getCurrentResult(),e)}var Zs=y.createContext(!1),Hr=()=>y.useContext(Zs);Zs.Provider;function Gr(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var zr=y.createContext(Gr()),Xr=()=>y.useContext(zr),Yr=(t,e,n)=>{const s=n?.state.error&&typeof t.throwOnError=="function"?qs(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},Qr=t=>{y.useEffect(()=>{t.clearReset()},[t])},qr=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||qs(n,[t.error,s])),Zr=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Jr=(t,e)=>t.isLoading&&t.isFetching&&!e,to=(t,e)=>t?.suspense&&e.isPending,kn=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function eo(t,e,n){const s=Hr(),i=Xr(),o=Wr(),r=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(r);const a=o.getQueryCache().get(r.queryHash);r._optimisticResults=s?"isRestoring":"optimistic",Zr(r),Yr(r,i,a),Qr(i);const l=!o.getQueryCache().get(r.queryHash),[u]=y.useState(()=>new e(o,r)),c=u.getOptimisticResult(r),h=!s&&t.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(f=>{const d=h?u.subscribe(Qs.batchCalls(f)):Se;return u.updateResult(),d},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(r)},[r,u]),to(r,c))throw kn(r,u,i);if(qr({result:c,errorResetBoundary:i,throwOnError:r.throwOnError,query:a,suspense:r.suspense}))throw c.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(r,c),r.experimental_prefetchInRender&&!Pe&&Jr(c,s)&&(l?kn(r,u,i):a?.promise)?.catch(Se).finally(()=>{u.updateResult()}),r.notifyOnChangeProps?c:u.trackResult(c)}function Uu(t,e){return eo(t,Kr)}const Xe=y.createContext({});function Ye(t){const e=y.useRef(null);return e.current===null&&(e.current=t()),e.current}const Js=typeof window<"u",ti=Js?y.useLayoutEffect:y.useEffect,te=y.createContext(null);function Qe(t,e){t.indexOf(e)===-1&&t.push(e)}function qe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Y=(t,e,n)=>n>e?e:n<t?t:n;let Ze=()=>{};const Z={},ei=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ni(t){return typeof t=="object"&&t!==null}const si=t=>/^0[^.\s]+$/u.test(t);function Je(t){let e;return()=>(e===void 0&&(e=t()),e)}const _=t=>t,no=(t,e)=>n=>e(t(n)),kt=(...t)=>t.reduce(no),Rt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class tn{constructor(){this.subscriptions=[]}add(e){return Qe(this.subscriptions,e),()=>qe(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const q=t=>t*1e3,K=t=>t/1e3;function ii(t,e){return e?t*(1e3/e):0}const ri=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,so=1e-7,io=12;function ro(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=ri(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>so&&++a<io);return r}function Ft(t,e,n,s){if(t===e&&n===s)return _;const i=o=>ro(o,0,1,t,n);return o=>o===0||o===1?o:ri(i(o),e,s)}const oi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ai=t=>e=>1-t(1-e),li=Ft(.33,1.53,.69,.99),en=ai(li),ci=oi(en),ui=t=>(t*=2)<1?.5*en(t):.5*(2-Math.pow(2,-10*(t-1))),nn=t=>1-Math.sin(Math.acos(t)),hi=ai(nn),fi=oi(nn),oo=Ft(.42,0,1,1),ao=Ft(0,0,.58,1),di=Ft(.42,0,.58,1),lo=t=>Array.isArray(t)&&typeof t[0]!="number",pi=t=>Array.isArray(t)&&typeof t[0]=="number",co={linear:_,easeIn:oo,easeInOut:di,easeOut:ao,circIn:nn,circInOut:fi,circOut:hi,backIn:en,backInOut:ci,backOut:li,anticipate:ui},uo=t=>typeof t=="string",Fn=t=>{if(pi(t)){Ze(t.length===4);const[e,n,s,i]=t;return Ft(e,n,s,i)}else if(uo(t))return co[t];return t},Nt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ho(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){r.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&r.add(c),p.has(c)||p.add(c),c},cancel:c=>{s.delete(c),r.delete(c)},process:c=>{if(a=c,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,o&&(o=!1,u.process(c))}};return u}const fo=40;function mi(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Nt.reduce((g,w)=>(g[w]=ho(o),g),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:p}=r,m=()=>{const g=Z.useManualTiming?i.timestamp:performance.now();n=!1,Z.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,fo),1)),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},v=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Nt.reduce((g,w)=>{const b=r[w];return g[w]=(A,V=!1,P=!1)=>(n||v(),b.schedule(A,V,P)),g},{}),cancel:g=>{for(let w=0;w<Nt.length;w++)r[Nt[w]].cancel(g)},state:i,steps:r}}const{schedule:M,cancel:nt,state:F,steps:ie}=mi(typeof requestAnimationFrame<"u"?requestAnimationFrame:_,!0);let _t;function po(){_t=void 0}const B={now:()=>(_t===void 0&&B.set(F.isProcessing||Z.useManualTiming?F.timestamp:performance.now()),_t),set:t=>{_t=t,queueMicrotask(po)}},gi=t=>e=>typeof e=="string"&&e.startsWith(t),yi=gi("--"),mo=gi("var(--"),sn=t=>mo(t)?go.test(t.split("/*")[0].trim()):!1,go=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function On(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const vt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Dt={...vt,transform:t=>Y(0,1,t)},Ut={...vt,default:1},Ct=t=>Math.round(t*1e5)/1e5,rn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function yo(t){return t==null}const vo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,on=(t,e)=>n=>!!(typeof n=="string"&&vo.test(n)&&n.startsWith(t)||e&&!yo(n)&&Object.prototype.hasOwnProperty.call(n,e)),vi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(rn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},To=t=>Y(0,255,t),re={...vt,transform:t=>Math.round(To(t))},lt={test:on("rgb","red"),parse:vi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+re.transform(t)+", "+re.transform(e)+", "+re.transform(n)+", "+Ct(Dt.transform(s))+")"};function xo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const we={test:on("#"),parse:xo,transform:lt.transform},Ot=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),tt=Ot("deg"),X=Ot("%"),x=Ot("px"),So=Ot("vh"),Po=Ot("vw"),Bn={...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(t*100)},ft={test:on("hsl","hue"),parse:vi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+X.transform(Ct(e))+", "+X.transform(Ct(n))+", "+Ct(Dt.transform(s))+")"},L={test:t=>lt.test(t)||we.test(t)||ft.test(t),parse:t=>lt.test(t)?lt.parse(t):ft.test(t)?ft.parse(t):we.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?lt.transform(t):ft.transform(t),getAnimatableNone:t=>{const e=L.parse(t);return e.alpha=0,L.transform(e)}},bo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function wo(t){return isNaN(t)&&typeof t=="string"&&(t.match(rn)?.length||0)+(t.match(bo)?.length||0)>0}const Ti="number",xi="color",Co="var",Ao="var(",jn="${}",Vo=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Et(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(Vo,l=>(L.test(l)?(s.color.push(o),i.push(xi),n.push(L.parse(l))):l.startsWith(Ao)?(s.var.push(o),i.push(Co),n.push(l)):(s.number.push(o),i.push(Ti),n.push(parseFloat(l))),++o,jn)).split(jn);return{values:n,split:a,indexes:s,types:i}}function Si(t){return Et(t).values}function Pi(t){const{split:e,types:n}=Et(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===Ti?o+=Ct(i[r]):a===xi?o+=L.transform(i[r]):o+=i[r]}return o}}const Mo=t=>typeof t=="number"?0:L.test(t)?L.getAnimatableNone(t):t;function Ro(t){const e=Si(t);return Pi(t)(e.map(Mo))}const st={test:wo,parse:Si,createTransformer:Pi,getAnimatableNone:Ro};function oe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Do({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=oe(l,a,t+1/3),o=oe(l,a,t),r=oe(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function zt(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,ae=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Eo=[we,lt,ft],Lo=t=>Eo.find(e=>e.test(t));function Nn(t){const e=Lo(t);if(!e)return!1;let n=e.parse(t);return e===ft&&(n=Do(n)),n}const Un=(t,e)=>{const n=Nn(t),s=Nn(e);if(!n||!s)return zt(t,e);const i={...n};return o=>(i.red=ae(n.red,s.red,o),i.green=ae(n.green,s.green,o),i.blue=ae(n.blue,s.blue,o),i.alpha=D(n.alpha,s.alpha,o),lt.transform(i))},Ce=new Set(["none","hidden"]);function Io(t,e){return Ce.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ko(t,e){return n=>D(t,e,n)}function an(t){return typeof t=="number"?ko:typeof t=="string"?sn(t)?zt:L.test(t)?Un:Bo:Array.isArray(t)?bi:typeof t=="object"?L.test(t)?Un:Fo:zt}function bi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>an(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function Fo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=an(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function Oo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const Bo=(t,e)=>{const n=st.createTransformer(e),s=Et(t),i=Et(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ce.has(t)&&!i.values.length||Ce.has(e)&&!s.values.length?Io(t,e):kt(bi(Oo(s,i),i.values),n):zt(t,e)};function wi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):an(t)(t,e)}const jo=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>M.update(e,n),stop:()=>nt(e),now:()=>F.isProcessing?F.timestamp:B.now()}},Ci=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Xt=2e4;function ln(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Xt;)e+=n,s=t.next(e);return e>=Xt?1/0:e}function No(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ln(s),Xt);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:K(i)}}const Uo=5;function Ai(t,e,n){const s=Math.max(e-Uo,0);return ii(n-t(s),e-s)}const E={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},le=.001;function Wo({duration:t=E.duration,bounce:e=E.bounce,velocity:n=E.velocity,mass:s=E.mass}){let i,o,r=1-e;r=Y(E.minDamping,E.maxDamping,r),t=Y(E.minDuration,E.maxDuration,K(t)),r<1?(i=u=>{const c=u*r,h=c*t,f=c-n,d=Ae(u,r),p=Math.exp(-h);return le-f/d*p},o=u=>{const h=u*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=Ae(Math.pow(u,2),r);return(-i(u)+le>0?-1:1)*((f-d)*p)/m}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-le+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=_o(i,o,a);if(t=q(t),isNaN(l))return{stiffness:E.stiffness,damping:E.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Ko=12;function _o(t,e,n){let s=n;for(let i=1;i<Ko;i++)s=s-t(s)/e(s);return s}function Ae(t,e){return t*Math.sqrt(1-e*e)}const $o=["duration","bounce"],Ho=["stiffness","damping","mass"];function Wn(t,e){return e.some(n=>t[n]!==void 0)}function Go(t){let e={velocity:E.velocity,stiffness:E.stiffness,damping:E.damping,mass:E.mass,isResolvedFromDuration:!1,...t};if(!Wn(t,Ho)&&Wn(t,$o))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*Y(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:E.mass,stiffness:i,damping:o}}else{const n=Wo(t);e={...e,...n,mass:E.mass},e.isResolvedFromDuration=!0}return e}function Yt(t=E.visualDuration,e=E.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=Go({...n,velocity:-K(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(l*c)),v=r-o,T=K(Math.sqrt(l/c)),S=Math.abs(v)<5;s||(s=S?E.restSpeed.granular:E.restSpeed.default),i||(i=S?E.restDelta.granular:E.restDelta.default);let g;if(m<1){const b=Ae(T,m);g=A=>{const V=Math.exp(-m*T*A);return r-V*((p+m*T*v)/b*Math.sin(b*A)+v*Math.cos(b*A))}}else if(m===1)g=b=>r-Math.exp(-T*b)*(v+(p+T*v)*b);else{const b=T*Math.sqrt(m*m-1);g=A=>{const V=Math.exp(-m*T*A),P=Math.min(b*A,300);return r-V*((p+m*T*v)*Math.sinh(P)+b*v*Math.cosh(P))/b}}const w={calculatedDuration:d&&h||null,next:b=>{const A=g(b);if(d)a.done=b>=h;else{let V=b===0?p:0;m<1&&(V=b===0?q(p):Ai(g,b,A));const P=Math.abs(V)<=s,C=Math.abs(r-A)<=i;a.done=P&&C}return a.value=a.done?r:A,a},toString:()=>{const b=Math.min(ln(w),Xt),A=Ci(V=>w.next(b*V).value,b,30);return b+"ms "+A},toTransition:()=>{}};return w}Yt.applyToOptions=t=>{const e=No(t,100,Yt);return t.ease=e.ease,t.duration=q(e.duration),t.type="keyframes",t};function Ve({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=P=>a!==void 0&&P<a||l!==void 0&&P>l,p=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let m=n*e;const v=h+m,T=r===void 0?v:r(v);T!==v&&(m=T-h);const S=P=>-m*Math.exp(-P/s),g=P=>T+S(P),w=P=>{const C=S(P),R=g(P);f.done=Math.abs(C)<=u,f.value=f.done?T:R};let b,A;const V=P=>{d(f.value)&&(b=P,A=Yt({keyframes:[f.value,p(f.value)],velocity:Ai(g,P,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return V(0),{calculatedDuration:null,next:P=>{let C=!1;return!A&&b===void 0&&(C=!0,w(P),V(P)),b!==void 0&&P>=b?A.next(P-b):(!C&&w(P),f)}}}function zo(t,e,n){const s=[],i=n||Z.mix||wi,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||_:e;a=kt(l,a)}s.push(a)}return s}function Xo(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Ze(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=zo(e,s,i),l=a.length,u=c=>{if(r&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=Rt(t[h],t[h+1],c);return a[h](f)};return n?c=>u(Y(t[0],t[o-1],c)):u}function Yo(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Rt(0,e,s);t.push(D(n,1,i))}}function Qo(t){const e=[0];return Yo(e,t.length-1),e}function qo(t,e){return t.map(n=>n*e)}function Zo(t,e){return t.map(()=>e||di).splice(0,t.length-1)}function At({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=lo(s)?s.map(Fn):Fn(s),o={done:!1,value:e[0]},r=qo(n&&n.length===e.length?n:Qo(e),t),a=Xo(r,e,{ease:Array.isArray(i)?i:Zo(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Jo=t=>t!==null;function cn(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(Jo),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const ta={decay:Ve,inertia:Ve,tween:At,keyframes:At,spring:Yt};function Vi(t){typeof t.type=="string"&&(t.type=ta[t.type])}class un{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const ea=t=>t/100;class hn extends un{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==B.now()&&this.tick(B.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Vi(e);const{type:n=At,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=n||At;l!==At&&typeof a[0]!="number"&&(this.mixKeyframes=kt(ea,wi(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=ln(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const T=this.currentTime-u*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?T<0:T>i;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,w=s;if(h){const P=Math.min(this.currentTime,i)/a;let C=Math.floor(P),R=P%1;!R&&P>=1&&(R=1),R===1&&C--,C=Math.min(C,h+1),C%2&&(f==="reverse"?(R=1-R,d&&(R-=d/a)):f==="mirror"&&(w=r)),g=Y(0,1,R)*a}const b=S?{done:!1,value:c[0]}:w.next(g);o&&(b.value=o(b.value));let{done:A}=b;!S&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return V&&p!==Ve&&(b.value=cn(c,this.options,v,this.speed)),m&&m(b.value),V&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return K(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(this.currentTime)}set time(e){e=q(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(B.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=K(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=jo,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(B.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function na(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ct=t=>t*180/Math.PI,Me=t=>{const e=ct(Math.atan2(t[1],t[0]));return Re(e)},sa={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Me,rotateZ:Me,skewX:t=>ct(Math.atan(t[1])),skewY:t=>ct(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Re=t=>(t=t%360,t<0&&(t+=360),t),Kn=Me,_n=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),$n=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ia={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_n,scaleY:$n,scale:t=>(_n(t)+$n(t))/2,rotateX:t=>Re(ct(Math.atan2(t[6],t[5]))),rotateY:t=>Re(ct(Math.atan2(-t[2],t[0]))),rotateZ:Kn,rotate:Kn,skewX:t=>ct(Math.atan(t[4])),skewY:t=>ct(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function De(t){return t.includes("scale")?1:0}function Ee(t,e){if(!t||t==="none")return De(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=ia,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=sa,i=a}if(!i)return De(e);const o=s[e],r=i[1].split(",").map(oa);return typeof o=="function"?o(r):r[o]}const ra=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ee(n,e)};function oa(t){return parseFloat(t.trim())}const Tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xt=new Set(Tt),Hn=t=>t===vt||t===x,aa=new Set(["x","y","z"]),la=Tt.filter(t=>!aa.has(t));function ca(t){const e=[];return la.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const et={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ee(e,"x"),y:(t,{transform:e})=>Ee(e,"y")};et.translateX=et.x;et.translateY=et.y;const ut=new Set;let Le=!1,Ie=!1,ke=!1;function Mi(){if(Ie){const t=Array.from(ut).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=ca(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{s.getValue(o)?.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Ie=!1,Le=!1,ut.forEach(t=>t.complete(ke)),ut.clear()}function Ri(){ut.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ie=!0)})}function ua(){ke=!0,Ri(),Mi(),ke=!1}class fn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ut.add(this),Le||(Le=!0,M.read(Ri),M.resolveKeyframes(Mi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i?.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}na(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ha=t=>t.startsWith("--");function fa(t,e,n){ha(e)?t.style.setProperty(e,n):t.style[e]=n}const da=Je(()=>window.ScrollTimeline!==void 0),pa={};function ma(t,e){const n=Je(t);return()=>pa[e]??n()}const Di=ma(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Gn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pt([0,.65,.55,1]),circOut:Pt([.55,0,1,.45]),backIn:Pt([.31,.01,.66,-.59]),backOut:Pt([.33,1.53,.69,.99])};function Ei(t,e){if(t)return typeof t=="function"?Di()?Ci(t,e):"ease-out":pi(t)?Pt(t):Array.isArray(t)?t.map(n=>Ei(n,e)||Gn.easeOut):Gn[t]}function ga(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=Ei(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(c,f)}function Li(t){return typeof t=="function"&&"applyToOptions"in t}function ya({type:t,...e}){return Li(t)&&Di()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class va extends un{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,Ze(typeof e.type!="string");const u=ya(e);this.animation=ga(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=cn(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):fa(n,s,c),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return K(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=q(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&da()?(this.animation.timeline=e,_):n(this)}}const Ii={anticipate:ui,backInOut:ci,circInOut:fi};function Ta(t){return t in Ii}function xa(t){typeof t.ease=="string"&&Ta(t.ease)&&(t.ease=Ii[t.ease])}const ce=10;class Sa extends va{constructor(e){xa(e),Vi(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new hn({...r,autoplay:!1}),l=Math.max(ce,B.now()-this.startTime),u=Y(0,ce,l-ce);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const zn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(st.test(t)||t==="0")&&!t.startsWith("url("));function Pa(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function ba(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=zn(i,e),a=zn(o,e);return!r||!a?!1:Pa(t)||(n==="spring"||Li(n))&&s}function Fe(t){t.duration=0,t.type="keyframes"}const wa=new Set(["opacity","clipPath","filter","transform"]),Ca=Je(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Aa(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Ca()&&n&&wa.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const Va=40;class Ma extends un{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:u,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=B.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:l,motionValue:u,element:c,...h},d=c?.KeyframeResolver||fn;this.keyframeResolver=new d(a,(p,m,v)=>this.onKeyframesResolved(p,m,f,!v),l,u,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=B.now(),ba(e,o,r,a)||((Z.instantAnimations||!l)&&c?.(cn(e,s,n)),e[0]=e[e.length-1],Fe(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Va?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&Aa(f),p=f.motionValue?.owner?.current,m=d?new Sa({...f,element:p}):new hn(f);m.finished.then(()=>{this.notifyFinished()}).catch(_),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ua()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function ki(t,e,n,s=0,i=1){const o=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const Ra=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Da(t){const e=Ra.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Fi(t,e,n=1){const[s,i]=Da(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return ei(r)?parseFloat(r):r}return sn(i)?Fi(i,e,n+1):i}const Ea={type:"spring",stiffness:500,damping:25,restSpeed:10},La=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ia={type:"keyframes",duration:.8},ka={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fa=(t,{keyframes:e})=>e.length>2?Ia:xt.has(t)?t.startsWith("scale")?La(e[1]):Ea:ka,Oa=t=>t!==null;function Ba(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Oa),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}function dn(t,e){return t?.[e]??t?.default??t}function ja({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const pn=(t,e,n,s={},i,o)=>r=>{const a=dn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-q(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};ja(a)||Object.assign(c,Fa(t,c)),c.duration&&(c.duration=q(c.duration)),c.repeatDelay&&(c.repeatDelay=q(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Fe(c),c.delay===0&&(h=!0)),(Z.instantAnimations||Z.skipAnimations)&&(h=!0,Fe(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=Ba(c.keyframes,a);if(f!==void 0){M.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new hn(c):new Ma(c)};function Xn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function mn(t,e,n,s){if(typeof e=="function"){const[i,o]=Xn(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=Xn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function gt(t,e,n){const s=t.getProps();return mn(s,e,n!==void 0?n:s.custom,t)}const Oi=new Set(["width","height","top","left","right","bottom",...Tt]),Yn=30,Na=t=>!isNaN(parseFloat(t));class Ua{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=B.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=B.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Na(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new tn);const s=this.events[e].add(n);return e==="change"?()=>{s(),M.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=B.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Yn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Yn);return ii(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yt(t,e){return new Ua(t,e)}const Oe=t=>Array.isArray(t);function Wa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yt(n))}function Ka(t){return Oe(t)?t[t.length-1]||0:t}function _a(t,e){const n=gt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Ka(o[r]);Wa(t,r,a)}}const O=t=>!!(t&&t.getVelocity);function $a(t){return!!(O(t)&&t.add)}function Be(t,e){const n=t.getValue("willChange");if($a(n))return n.add(e);if(!n&&Z.WillChange){const s=new Z.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function gn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ha="framerAppearId",Bi="data-"+gn(Ha);function ji(t){return t.props[Bi]}function Ga({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ni(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;const l=o?.reduceMotion;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const f=t.getValue(h,t.latestValues[h]??null),d=a[h];if(d===void 0||c&&Ga(c,h))continue;const p={delay:n,...dn(o||{},h)},m=f.get();if(m!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===m&&!p.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const g=ji(t);if(g){const w=window.MotionHandoffAnimation(g,h,M);w!==null&&(p.startTime=w,v=!0)}}Be(t,h);const T=l??t.shouldReduceMotion;f.start(pn(h,f,d,T&&Oi.has(h)?{type:!1}:p,t,v));const S=f.animation;S&&u.push(S)}return r&&Promise.all(u).then(()=>{M.update(()=>{r&&_a(t,r)})}),u}function je(t,e,n={}){const s=gt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Ni(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=i;return za(t,e,l,u,c,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[o,r]:[r,o];return l().then(()=>u())}else return Promise.all([o(),r(n.delay)])}function za(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(je(l,e,{...r,delay:n+(typeof s=="function"?0:s)+ki(t.variantChildren,l,s,i,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Xa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>je(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=je(t,e,n);else{const i=typeof e=="function"?gt(t,e,n.custom):e;s=Promise.all(Ni(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ya={test:t=>t==="auto",parse:t=>t},Ui=t=>e=>e.test(t),Wi=[vt,x,X,tt,Po,So,Ya],Qn=t=>Wi.find(Ui(t));function Qa(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||si(t):!0}const qa=new Set(["brightness","contrast","saturate","opacity"]);function Za(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(rn)||[];if(!s)return t;const i=n.replace(s,"");let o=qa.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Ja=/\b([a-z-]*)\(.*?\)/gu,Ne={...st,getAnimatableNone:t=>{const e=t.match(Ja);return e?e.map(Za).join(" "):t}},qn={...vt,transform:Math.round},tl={rotate:tt,rotateX:tt,rotateY:tt,rotateZ:tt,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:tt,skewX:tt,skewY:tt,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:Dt,originX:Bn,originY:Bn,originZ:x},yn={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,inset:x,insetBlock:x,insetBlockStart:x,insetBlockEnd:x,insetInline:x,insetInlineStart:x,insetInlineEnd:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,paddingBlock:x,paddingBlockStart:x,paddingBlockEnd:x,paddingInline:x,paddingInlineStart:x,paddingInlineEnd:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,marginBlock:x,marginBlockStart:x,marginBlockEnd:x,marginInline:x,marginInlineStart:x,marginInlineEnd:x,fontSize:x,backgroundPositionX:x,backgroundPositionY:x,...tl,zIndex:qn,fillOpacity:Dt,strokeOpacity:Dt,numOctaves:qn},el={...yn,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:Ne,WebkitFilter:Ne},Ki=t=>el[t];function _i(t,e){let n=Ki(t);return n!==Ne&&(n=st),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const nl=new Set(["auto","none","0"]);function sl(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!nl.has(o)&&Et(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=_i(n,i)}class il extends fn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),sn(h))){const f=Fi(h,n.current);f!==void 0&&(e[c]=f),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Oi.has(s)||e.length!==2)return;const[i,o]=e,r=Qn(i),a=Qn(o),l=On(i),u=On(o);if(l!==u&&et[s]){this.needsMeasurement=!0;return}if(r!==a)if(Hn(r)&&Hn(a))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else et[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Qa(e[i]))&&s.push(i);s.length&&sl(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=et[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=et[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function rl(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const $i=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ue(t){return ni(t)&&"offsetHeight"in t}const{schedule:vn}=mi(queueMicrotask,!1),H={x:!1,y:!1};function Hi(){return H.x||H.y}function ol(t){return t==="x"||t==="y"?H[t]?null:(H[t]=!0,()=>{H[t]=!1}):H.x||H.y?null:(H.x=H.y=!0,()=>{H.x=H.y=!1})}function Gi(t,e){const n=rl(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Zn(t){return!(t.pointerType==="touch"||Hi())}function al(t,e,n={}){const[s,i,o]=Gi(t,n),r=a=>{if(!Zn(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=h=>{Zn(h)&&(u(h),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const zi=(t,e)=>e?t===e?!0:zi(t,e.parentElement):!1,Tn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,ll=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Xi(t){return ll.has(t.tagName)||t.isContentEditable===!0}const $t=new WeakSet;function Jn(t){return e=>{e.key==="Enter"&&t(e)}}function ue(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const cl=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Jn(()=>{if($t.has(n))return;ue(n,"down");const i=Jn(()=>{ue(n,"up")}),o=()=>ue(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function ts(t){return Tn(t)&&!Hi()}function ul(t,e,n={}){const[s,i,o]=Gi(t,n),r=a=>{const l=a.currentTarget;if(!ts(a))return;$t.add(l);const u=e(l,a),c=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),$t.has(l)&&$t.delete(l),ts(d)&&typeof u=="function"&&u(d,{success:p})},h=d=>{c(d,l===window||l===document||n.useGlobalTarget||zi(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Ue(a)&&(a.addEventListener("focus",u=>cl(u,i)),!Xi(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Yi(t){return ni(t)&&"ownerSVGElement"in t}function hl(t){return Yi(t)&&t.tagName==="svg"}const fl=[...Wi,L,st],dl=t=>fl.find(Ui(t)),es=()=>({translate:0,scale:1,origin:0,originPoint:0}),dt=()=>({x:es(),y:es()}),ns=()=>({min:0,max:0}),I=()=>({x:ns(),y:ns()}),We={current:null},Qi={current:!1},pl=typeof window<"u";function ml(){if(Qi.current=!0,!!pl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>We.current=t.matches;t.addEventListener("change",e),e()}else We.current=!1}const gl=new WeakMap;function ee(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Lt(t){return typeof t=="string"||Array.isArray(t)}const xn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sn=["initial",...xn];function ne(t){return ee(t.animate)||Sn.some(e=>Lt(t[e]))}function qi(t){return!!(ne(t)||t.variants)}function yl(t,e,n){for(const s in e){const i=e[s],o=n[s];if(O(i))t.addValue(s,i);else if(O(o))t.addValue(s,yt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,yt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ss=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qt={};function Zi(t){Qt=t}function vl(){return Qt}class Tl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=fn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=B.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,M.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=ne(n),this.isVariantNode=qi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&O(d)&&d.set(l[f])}}mount(e){this.current=e,gl.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Qi.current||ml(),this.shouldReduceMotion=We.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),nt(this.notifyUpdate),nt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=xt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&M.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Qt){const n=Qt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):I()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ss.length;s++){const i=ss[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=yl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=yt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(ei(s)||si(s))?s=parseFloat(s):!dl(s)&&st.test(n)&&(s=_i(e,n)),this.setBaseTarget(e,O(s)?s.get():s)),O(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=mn(this.props,n,this.presenceContext?.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!O(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new tn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){vn.render(this.render)}}class Ji extends Tl{constructor(){super(...arguments),this.KeyframeResolver=il}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;O(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class it{constructor(e){this.isMounted=!1,this.node=e}update(){}}function tr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function xl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Sl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function he(t){return t===void 0||t===1}function Ke({scale:t,scaleX:e,scaleY:n}){return!he(t)||!he(e)||!he(n)}function at(t){return Ke(t)||er(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function er(t){return is(t.x)||is(t.y)}function is(t){return t&&t!=="0%"}function qt(t,e,n){const s=t-n,i=e*s;return n+i}function rs(t,e,n,s,i){return i!==void 0&&(t=qt(t,i,s)),qt(t,n,s)+e}function _e(t,e=0,n=1,s,i){t.min=rs(t.min,e,n,s,i),t.max=rs(t.max,e,n,s,i)}function nr(t,{x:e,y:n}){_e(t.x,e.translate,e.scale,e.originPoint),_e(t.y,n.translate,n.scale,n.originPoint)}const os=.999999999999,as=1.0000000000001;function Pl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&mt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,nr(t,r)),s&&at(o.latestValues)&&mt(t,o.latestValues))}e.x<as&&e.x>os&&(e.x=1),e.y<as&&e.y>os&&(e.y=1)}function pt(t,e){t.min=t.min+e,t.max=t.max+e}function ls(t,e,n,s,i=.5){const o=D(t.min,t.max,i);_e(t,e,n,o,s)}function mt(t,e){ls(t.x,e.x,e.scaleX,e.scale,e.originX),ls(t.y,e.y,e.scaleY,e.scale,e.originY)}function sr(t,e){return tr(Sl(t.getBoundingClientRect(),e))}function bl(t,e,n){const s=sr(t,n),{scroll:i}=e;return i&&(pt(s.x,i.offset.x),pt(s.y,i.offset.y)),s}const wl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Cl=Tt.length;function Al(t,e,n){let s="",i=!0;for(let o=0;o<Cl;o++){const r=Tt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(r.startsWith("scale")?1:0);else{const u=parseFloat(a);l=r.startsWith("scale")?u===1:u===0}if(!l||n){const u=$i(a,yn[r]);if(!l){i=!1;const c=wl[r]||r;s+=`${c}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Pn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const u=e[l];if(xt.has(l)){r=!0;continue}else if(yi(l)){i[l]=u;continue}else{const c=$i(u,yn[l]);l.startsWith("origin")?(a=!0,o[l]=c):s[l]=c}}if(e.transform||(r||n?s.transform=Al(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=o;s.transformOrigin=`${l} ${u} ${c}`}}function ir(t,{style:e,vars:n},s,i){const o=t.style;let r;for(r in e)o[r]=e[r];i?.applyProjectionStyles(o,s);for(r in n)o.setProperty(r,n[r])}function cs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const St={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(x.test(t))t=parseFloat(t);else return t;const n=cs(t,e.target.x),s=cs(t,e.target.y);return`${n}% ${s}%`}},Vl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=st.parse(t);if(i.length>5)return s;const o=st.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=D(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},$e={borderRadius:{...St,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:St,borderTopRightRadius:St,borderBottomLeftRadius:St,borderBottomRightRadius:St,boxShadow:Vl};function rr(t,{layout:e,layoutId:n}){return xt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!$e[t]||t==="opacity")}function bn(t,e,n){const s=t.style,i=e?.style,o={};if(!s)return o;for(const r in s)(O(s[r])||i&&O(i[r])||rr(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function Ml(t){return window.getComputedStyle(t)}class Rl extends Ji{constructor(){super(...arguments),this.type="html",this.renderInstance=ir}readValueFromInstance(e,n){if(xt.has(n))return this.projection?.isProjecting?De(n):ra(e,n);{const s=Ml(e),i=(yi(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return sr(e,n)}build(e,n,s){Pn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return bn(e,n,s)}}const Dl={offset:"stroke-dashoffset",array:"stroke-dasharray"},El={offset:"strokeDashoffset",array:"strokeDasharray"};function Ll(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?Dl:El;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const Il=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function or(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if(Pn(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const d of Il)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Ll(h,i,o,r,!1)}const ar=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),lr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function kl(t,e,n,s){ir(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(ar.has(i)?i:gn(i),e.attrs[i])}function cr(t,e,n){const s=bn(t,e,n);for(const i in t)if(O(t[i])||O(e[i])){const o=Tt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class Fl extends Ji{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=I}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(xt.has(n)){const s=Ki(n);return s&&s.default||0}return n=ar.has(n)?n:gn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return cr(e,n,s)}build(e,n,s){or(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){kl(e,n,s,i)}mount(e){this.isSVGTag=lr(e.tagName),super.mount(e)}}const Ol=Sn.length;function ur(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ur(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Ol;n++){const s=Sn[n],i=t.props[s];(Lt(i)||i===!1)&&(e[s]=i)}return e}function hr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Bl=[...xn].reverse(),jl=xn.length;function Nl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Xa(t,n,s)))}function Ul(t){let e=Nl(t),n=us(),s=!0;const i=l=>(u,c)=>{const h=gt(t,c,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...p}=h;u={...u,...p,...d}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=ur(t.parent)||{},h=[],f=new Set;let d={},p=1/0;for(let v=0;v<jl;v++){const T=Bl[v],S=n[T],g=u[T]!==void 0?u[T]:c[T],w=Lt(g),b=T===l?S.isActive:null;b===!1&&(p=v);let A=g===c[T]&&g!==u[T]&&w;if(A&&s&&t.manuallyAnimateOnMount&&(A=!1),S.protectedKeys={...d},!S.isActive&&b===null||!g&&!S.prevProp||ee(g)||typeof g=="boolean")continue;const V=Wl(S.prevProp,g);let P=V||T===l&&S.isActive&&!A&&w||v>p&&w,C=!1;const R=Array.isArray(g)?g:[g];let N=R.reduce(i(T),{});b===!1&&(N={});const{prevResolvedValues:z={}}=S,J={...z,...N},Vn=k=>{P=!0,f.has(k)&&(C=!0,f.delete(k)),S.needsAnimating[k]=!0;const U=t.getValue(k);U&&(U.liveStyle=!1)};for(const k in J){const U=N[k],rt=z[k];if(d.hasOwnProperty(k))continue;let ht=!1;Oe(U)&&Oe(rt)?ht=!hr(U,rt):ht=U!==rt,ht?U!=null?Vn(k):f.add(k):U!==void 0&&f.has(k)?Vn(k):S.protectedKeys[k]=!0}S.prevProp=g,S.prevResolvedValues=N,S.isActive&&(d={...d,...N}),s&&t.blockInitialAnimation&&(P=!1);const Mn=A&&V;P&&(!Mn||C)&&h.push(...R.map(k=>{const U={type:T};if(typeof k=="string"&&s&&!Mn&&t.manuallyAnimateOnMount&&t.parent){const{parent:rt}=t,ht=gt(rt,k);if(rt.enteringChildren&&ht){const{delayChildren:Or}=ht.transition||{};U.delay=ki(rt.enteringChildren,t,Or)}}return{animation:k,options:U}}))}if(f.size){const v={};if(typeof u.initial!="boolean"){const T=gt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);T&&T.transition&&(v.transition=T.transition)}f.forEach(T=>{const S=t.getBaseTarget(T),g=t.getValue(T);g&&(g.liveStyle=!0),v[T]=S??null}),h.push({animation:v})}let m=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,m?e(h):Promise.resolve()}function a(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,u)),n[l].isActive=u;const c=r(l);for(const h in n)n[h].protectedKeys={};return c}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=us()}}}function Wl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!hr(e,t):!1}function ot(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function us(){return{animate:ot(!0),whileInView:ot(),whileHover:ot(),whileTap:ot(),whileDrag:ot(),whileFocus:ot(),exit:ot()}}function hs(t,e){t.min=e.min,t.max=e.max}function $(t,e){hs(t.x,e.x),hs(t.y,e.y)}function fs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const fr=1e-4,Kl=1-fr,_l=1+fr,dr=.01,$l=0-dr,Hl=0+dr;function j(t){return t.max-t.min}function Gl(t,e,n){return Math.abs(t-e)<=n}function ds(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=j(n)/j(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Kl&&t.scale<=_l||isNaN(t.scale))&&(t.scale=1),(t.translate>=$l&&t.translate<=Hl||isNaN(t.translate))&&(t.translate=0)}function Vt(t,e,n,s){ds(t.x,e.x,n.x,s?s.originX:void 0),ds(t.y,e.y,n.y,s?s.originY:void 0)}function ps(t,e,n){t.min=n.min+e.min,t.max=t.min+j(e)}function zl(t,e,n){ps(t.x,e.x,n.x),ps(t.y,e.y,n.y)}function ms(t,e,n){t.min=e.min-n.min,t.max=t.min+j(e)}function Zt(t,e,n){ms(t.x,e.x,n.x),ms(t.y,e.y,n.y)}function gs(t,e,n,s,i){return t-=e,t=qt(t,1/n,s),i!==void 0&&(t=qt(t,1/i,s)),t}function Xl(t,e=0,n=1,s=.5,i,o=t,r=t){if(X.test(e)&&(e=parseFloat(e),e=D(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=D(o.min,o.max,s);t===o&&(a-=e),t.min=gs(t.min,e,n,a,i),t.max=gs(t.max,e,n,a,i)}function ys(t,e,[n,s,i],o,r){Xl(t,e[n],e[s],e[i],e.scale,o,r)}const Yl=["x","scaleX","originX"],Ql=["y","scaleY","originY"];function vs(t,e,n,s){ys(t.x,e,Yl,n?n.x:void 0,s?s.x:void 0),ys(t.y,e,Ql,n?n.y:void 0,s?s.y:void 0)}function Ts(t){return t.translate===0&&t.scale===1}function pr(t){return Ts(t.x)&&Ts(t.y)}function xs(t,e){return t.min===e.min&&t.max===e.max}function ql(t,e){return xs(t.x,e.x)&&xs(t.y,e.y)}function Ss(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function mr(t,e){return Ss(t.x,e.x)&&Ss(t.y,e.y)}function Ps(t){return j(t.x)/j(t.y)}function bs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function W(t){return[t("x"),t("y")]}function Zl(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const gr=["TopLeft","TopRight","BottomLeft","BottomRight"],Jl=gr.length,ws=t=>typeof t=="string"?parseFloat(t):t,Cs=t=>typeof t=="number"||x.test(t);function tc(t,e,n,s,i,o){i?(t.opacity=D(0,n.opacity??1,ec(s)),t.opacityExit=D(e.opacity??1,0,nc(s))):o&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let r=0;r<Jl;r++){const a=`border${gr[r]}Radius`;let l=As(e,a),u=As(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Cs(l)===Cs(u)?(t[a]=Math.max(D(ws(l),ws(u),s),0),(X.test(u)||X.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function As(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const ec=yr(0,.5,hi),nc=yr(.5,.95,_);function yr(t,e,n){return s=>s<t?0:s>e?1:n(Rt(t,e,s))}function sc(t,e,n){const s=O(t)?t:yt(t);return s.start(pn("",s,e,n)),s.animation}function It(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const ic=(t,e)=>t.depth-e.depth;class rc{constructor(){this.children=[],this.isDirty=!1}add(e){Qe(this.children,e),this.isDirty=!0}remove(e){qe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ic),this.isDirty=!1,this.children.forEach(e)}}function oc(t,e){const n=B.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(nt(s),t(o-e))};return M.setup(s,!0),()=>nt(s)}function Ht(t){return O(t)?t.get():t}class ac{constructor(){this.members=[]}add(e){Qe(this.members,e),e.scheduleRender()}remove(e){if(qe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender();const i=s.options.layoutDependency,o=e.options.layoutDependency;i!==void 0&&o!==void 0&&i===o||(e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));const{crossfade:a}=e.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Gt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},fe=["","X","Y","Z"],lc=1e3;let cc=0;function de(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function vr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ji(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",M,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&vr(s)}function Tr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){this.id=cc++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(fc),this.nodes.forEach(gc),this.nodes.forEach(yc),this.nodes.forEach(dc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new rc)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new tn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=Yi(r)&&!hl(r),this.instance=r;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;M.read(()=>{h=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=oc(f,250),Gt.hasAnimatedSinceResize&&(Gt.hasAnimatedSinceResize=!1,this.nodes.forEach(Rs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Pc,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=u.getProps(),T=!this.targetLayout||!mr(this.targetLayout,d),S=!h&&f;if(this.options.layoutRoot||this.resumeFrom||S||h&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...dn(p,"layout"),onPlay:m,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(c,S)}else h||Rs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),nt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(vc),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&vr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Vs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ms);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(mc),this.nodes.forEach(uc),this.nodes.forEach(hc)):this.nodes.forEach(Ms),this.clearAllSnapshots();const a=B.now();F.delta=Y(0,1e3/60,a-F.timestamp),F.timestamp=a,F.isProcessing=!0,ie.update.process(F),ie.preRender.process(F),ie.render.process(F),F.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(pc),this.sharedNodes.forEach(Tc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,M.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){M.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!j(this.snapshot.measuredBox.x)&&!j(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=I(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!pr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&this.instance&&(a||at(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),bc(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return I();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(wc))){const{scroll:u}=this.root;u&&(pt(a.x,u.offset.x),pt(a.y,u.offset.y))}return a}removeElementScroll(r){const a=I();if($(a,r),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:h}=u;u!==this.root&&c&&h.layoutScroll&&(c.wasRoot&&$(a,r),pt(a.x,c.offset.x),pt(a.y,c.offset.y))}return a}applyTransform(r,a=!1){const l=I();$(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&mt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),at(c.latestValues)&&mt(l,c.latestValues)}return at(this.latestValues)&&mt(l,this.latestValues),l}removeTransform(r){const a=I();$(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!at(u.latestValues))continue;Ke(u.latestValues)&&u.updateSnapshot();const c=I(),h=u.measurePageBox();$(c,h),vs(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return at(this.latestValues)&&vs(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==F.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=F.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=I(),this.targetWithTransforms=I()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),nr(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ke(this.parent.latestValues)||er(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,l){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=I(),this.relativeTargetOrigin=I(),Zt(this.relativeTargetOrigin,a,l),$(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===F.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;$(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Pl(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=I());const{target:d}=r;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fs(this.prevProjectionDelta.x,this.projectionDelta.x),fs(this.prevProjectionDelta.y,this.projectionDelta.y)),Vt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!bs(this.projectionDelta.x,this.prevProjectionDelta.x)||!bs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dt(),this.projectionDelta=dt(),this.projectionDeltaWithTransform=dt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=dt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=I(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,v=this.getStack(),T=!v||v.members.length<=1,S=!!(m&&!T&&this.options.crossfade===!0&&!this.path.some(Sc));this.animationProgress=0;let g;this.mixTargetDelta=w=>{const b=w/1e3;Ds(h.x,r.x,b),Ds(h.y,r.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xc(this.relativeTarget,this.relativeTargetOrigin,f,b),g&&ql(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=I()),$(g,this.relativeTarget)),m&&(this.animationValues=c,tc(c,u,this.latestValues,b,S,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(nt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=M.update(()=>{Gt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=yt(0)),this.currentAnimation=sc(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&xr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||I();const h=j(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=j(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}$(a,l),mt(a,c),Vt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new ac),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&de("z",r,u,this.animationValues);for(let c=0;c<fe.length;c++)de(`rotate${fe[c]}`,r,u,this.animationValues),de(`skew${fe[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=Ht(a?.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=Ht(a?.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Zl(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),r.transform=h;const{x:f,y:d}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?r.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:r.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in $e){if(c[p]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:T}=$e[p],S=h==="none"?c[p]:m(c[p],u);if(v){const g=v.length;for(let w=0;w<g;w++)r[v[w]]=S}else T?this.options.visualElement.renderState.vars[p]=S:r[p]=S}this.options.layoutId&&(r.pointerEvents=u===this?Ht(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(Vs),this.root.sharedNodes.clear()}}}function uc(t){t.updateLayout()}function hc(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;i==="size"?W(c=>{const h=o?e.measuredBox[c]:e.layoutBox[c],f=j(h);h.min=n[c].min,h.max=h.min+f}):xr(i,e.layoutBox,n)&&W(c=>{const h=o?e.measuredBox[c]:e.layoutBox[c],f=j(n[c]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+f)});const r=dt();Vt(r,n,e.layoutBox);const a=dt();o?Vt(a,t.applyTransform(s,!0),e.measuredBox):Vt(a,n,e.layoutBox);const l=!pr(r);let u=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:f}=c;if(h&&f){const d=I();Zt(d,e.layoutBox,h.layoutBox);const p=I();Zt(p,n,f.layoutBox),mr(d,p)||(u=!0),c.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=d,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function fc(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function dc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function pc(t){t.clearSnapshot()}function Vs(t){t.clearMeasurements()}function Ms(t){t.isLayoutDirty=!1}function mc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Rs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function gc(t){t.resolveTargetDelta()}function yc(t){t.calcProjection()}function vc(t){t.resetSkewAndRotation()}function Tc(t){t.removeLeadSnapshot()}function Ds(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Es(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function xc(t,e,n,s){Es(t.x,e.x,n.x,s),Es(t.y,e.y,n.y,s)}function Sc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Pc={duration:.45,ease:[.4,0,.1,1]},Ls=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Is=Ls("applewebkit/")&&!Ls("chrome/")?Math.round:_;function ks(t){t.min=Is(t.min),t.max=Is(t.max)}function bc(t){ks(t.x),ks(t.y)}function xr(t,e,n){return t==="position"||t==="preserve-aspect"&&!Gl(Ps(e),Ps(n),.2)}function wc(t){return t!==t.root&&t.scroll?.wasRoot}const Cc=Tr({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),pe={current:void 0},Sr=Tr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pe.current){const t=new Cc({});t.mount(window),t.setOptions({layoutScroll:!0}),pe.current=t}return pe.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),wn=y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Fs(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Ac(...t){return e=>{let n=!1;const s=t.map(i=>{const o=Fs(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<s.length;i++){const o=s[i];typeof o=="function"?o():Fs(t[i],null)}}}}function Vc(...t){return y.useCallback(Ac(...t),t)}class Mc extends y.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=Ue(s)&&s.offsetWidth||0,o=Ue(s)&&s.offsetHeight||0,r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft,r.right=i-r.width-r.left,r.bottom=o-r.height-r.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Rc({children:t,isPresent:e,anchorX:n,anchorY:s,root:i}){const o=y.useId(),r=y.useRef(null),a=y.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=y.useContext(wn),u=t.props?.ref??t?.ref,c=Vc(r,u);return y.useInsertionEffect(()=>{const{width:h,height:f,top:d,left:p,right:m,bottom:v}=a.current;if(e||!r.current||!h||!f)return;const T=n==="left"?`left: ${p}`:`right: ${m}`,S=s==="bottom"?`bottom: ${v}`:`top: ${d}`;r.current.dataset.motionPopId=o;const g=document.createElement("style");l&&(g.nonce=l);const w=i??document.head;return w.appendChild(g),g.sheet&&g.sheet.insertRule(`
2
+ [data-motion-pop-id="${o}"] {
3
+ position: absolute !important;
4
+ width: ${h}px !important;
5
+ height: ${f}px !important;
6
+ ${T}px !important;
7
+ ${S}px !important;
8
+ }
9
+ `),()=>{w.contains(g)&&w.removeChild(g)}},[e]),Q.jsx(Mc,{isPresent:e,childRef:r,sizeRef:a,children:y.cloneElement(t,{ref:c})})}const Dc=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a,anchorY:l,root:u})=>{const c=Ye(Ec),h=y.useId();let f=!0,d=y.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const m of c.values())if(!m)return;s&&s()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,s]);return o&&f&&(d={...d}),y.useMemo(()=>{c.forEach((p,m)=>c.set(m,!1))},[n]),y.useEffect(()=>{!n&&!c.size&&s&&s()},[n]),r==="popLayout"&&(t=Q.jsx(Rc,{isPresent:n,anchorX:a,anchorY:l,root:u,children:t})),Q.jsx(te.Provider,{value:d,children:t})};function Ec(){return new Map}function Pr(t=!0){const e=y.useContext(te);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=y.useId();y.useEffect(()=>{if(t)return i(o)},[t]);const r=y.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Wt=t=>t.key||"";function Os(t){const e=[];return y.Children.forEach(t,n=>{y.isValidElement(n)&&e.push(n)}),e}const Ku=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[c,h]=Pr(r),f=y.useMemo(()=>Os(t),[t]),d=r&&!c?[]:f.map(Wt),p=y.useRef(!0),m=y.useRef(f),v=Ye(()=>new Map),T=y.useRef(new Set),[S,g]=y.useState(f),[w,b]=y.useState(f);ti(()=>{p.current=!1,m.current=f;for(let P=0;P<w.length;P++){const C=Wt(w[P]);d.includes(C)?(v.delete(C),T.current.delete(C)):v.get(C)!==!0&&v.set(C,!1)}},[w,d.length,d.join("-")]);const A=[];if(f!==S){let P=[...f];for(let C=0;C<w.length;C++){const R=w[C],N=Wt(R);d.includes(N)||(P.splice(C,0,R),A.push(R))}return o==="wait"&&A.length&&(P=A),b(Os(P)),g(f),null}const{forceRender:V}=y.useContext(Xe);return Q.jsx(Q.Fragment,{children:w.map(P=>{const C=Wt(P),R=r&&!c?!1:f===w||d.includes(C),N=()=>{if(T.current.has(C))return;if(T.current.add(C),v.has(C))v.set(C,!0);else return;let z=!0;v.forEach(J=>{J||(z=!1)}),z&&(V?.(),b(m.current),r&&h?.(),s&&s())};return Q.jsx(Dc,{isPresent:R,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,root:u,onExitComplete:R?void 0:N,anchorX:a,anchorY:l,children:P},C)})})},br=y.createContext({strict:!1}),Bs={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let js=!1;function Lc(){if(js)return;const t={};for(const e in Bs)t[e]={isEnabled:n=>Bs[e].some(s=>!!n[s])};Zi(t),js=!0}function wr(){return Lc(),vl()}function Ic(t){const e=wr();for(const n in t)e[n]={...e[n],...t[n]};Zi(e)}const kc=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Jt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kc.has(t)}let Cr=t=>!Jt(t);function Fc(t){typeof t=="function"&&(Cr=e=>e.startsWith("on")?!Jt(e):t(e))}try{Fc(require("@emotion/is-prop-valid").default)}catch{}function Oc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Cr(i)||n===!0&&Jt(i)||!e&&!Jt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const se=y.createContext({});function Bc(t,e){if(ne(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Lt(n)?n:void 0,animate:Lt(s)?s:void 0}}return t.inherit!==!1?e:{}}function jc(t){const{initial:e,animate:n}=Bc(t,y.useContext(se));return y.useMemo(()=>({initial:e,animate:n}),[Ns(e),Ns(n)])}function Ns(t){return Array.isArray(t)?t.join(" "):t}const Cn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ar(t,e,n){for(const s in e)!O(e[s])&&!rr(s,n)&&(t[s]=e[s])}function Nc({transformTemplate:t},e){return y.useMemo(()=>{const n=Cn();return Pn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Uc(t,e){const n=t.style||{},s={};return Ar(s,n,t),Object.assign(s,Nc(t,e)),s}function Wc(t,e){const n={},s=Uc(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Vr=()=>({...Cn(),attrs:{}});function Kc(t,e,n,s){const i=y.useMemo(()=>{const o=Vr();return or(o,e,lr(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Ar(o,t.style,t),i.style={...o,...i.style}}return i}const _c=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function An(t){return typeof t!="string"||t.includes("-")?!1:!!(_c.indexOf(t)>-1||/[A-Z]/u.test(t))}function $c(t,e,n,{latestValues:s},i,o=!1,r){const l=(r??An(t)?Kc:Wc)(e,s,i,t),u=Oc(e,typeof t=="string",o),c=t!==y.Fragment?{...u,...l,ref:n}:{},{children:h}=e,f=y.useMemo(()=>O(h)?h.get():h,[h]);return y.createElement(t,{...c,children:f})}function Hc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Gc(n,s,i,t),renderState:e()}}function Gc(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Ht(o[f]);let{initial:r,animate:a}=t;const l=ne(t),u=qi(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;if(h&&typeof h!="boolean"&&!ee(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=mn(t,f[d]);if(p){const{transitionEnd:m,transition:v,...T}=p;for(const S in T){let g=T[S];if(Array.isArray(g)){const w=c?g.length-1:0;g=g[w]}g!==null&&(i[S]=g)}for(const S in m)i[S]=m[S]}}}return i}const Mr=t=>(e,n)=>{const s=y.useContext(se),i=y.useContext(te),o=()=>Hc(t,e,s,i);return n?o():Ye(o)},zc=Mr({scrapeMotionValuesFromProps:bn,createRenderState:Cn}),Xc=Mr({scrapeMotionValuesFromProps:cr,createRenderState:Vr}),Yc=Symbol.for("motionComponentSymbol");function Qc(t,e,n){const s=y.useRef(n);y.useInsertionEffect(()=>{s.current=n});const i=y.useRef(null);return y.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const r=s.current;if(typeof r=="function")if(o){const a=r(o);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o)},[e])}const Rr=y.createContext({});function bt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qc(t,e,n,s,i,o){const{visualElement:r}=y.useContext(se),a=y.useContext(br),l=y.useContext(te),u=y.useContext(wn).reducedMotion,c=y.useRef(null),h=y.useRef(!1);s=s||a.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:r,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:o}),h.current&&c.current&&(c.current.manuallyAnimateOnMount=!0));const f=c.current,d=y.useContext(Rr);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Zc(c.current,n,i,d);const p=y.useRef(!1);y.useInsertionEffect(()=>{f&&p.current&&f.update(n,l)});const m=n[Bi],v=y.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return ti(()=>{h.current=!0,f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),v.current&&f.animationState&&f.animationState.animateChanges())}),y.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),v.current=!1),f.enteringChildren=void 0)}),f}function Zc(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Dr(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&bt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function Dr(t){if(t)return t.options.allowProjection!==!1?t.projection:Dr(t.parent)}function me(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Ic(s);const o=n?n==="svg":An(t),r=o?Xc:zc;function a(u,c){let h;const f={...y.useContext(wn),...u,layoutId:Jc(u)},{isStatic:d}=f,p=jc(u),m=r(u,d);if(!d&&Js){tu();const v=eu(f);h=v.MeasureLayout,p.visualElement=qc(t,m,f,i,v.ProjectionNode,o)}return Q.jsxs(se.Provider,{value:p,children:[h&&p.visualElement?Q.jsx(h,{visualElement:p.visualElement,...f}):null,$c(t,u,Qc(m,p.visualElement,c),m,d,e,o)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=y.forwardRef(a);return l[Yc]=t,l}function Jc({layoutId:t}){const e=y.useContext(Xe).id;return e&&t!==void 0?e+"-"+t:t}function tu(t,e){y.useContext(br).strict}function eu(t){const e=wr(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function nu(t,e){if(typeof Proxy>"u")return me;const n=new Map,s=(o,r)=>me(o,r,t,e),i=(o,r)=>s(o,r);return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,me(r,void 0,t,e)),n.get(r))})}const su=(t,e)=>e.isSVG??An(t)?new Fl(e):new Rl(e,{allowProjection:t!==y.Fragment});class iu extends it{constructor(e){super(e),e.animationState||(e.animationState=Ul(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ee(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let ru=0;class ou extends it{constructor(){super(...arguments),this.id=ru++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const au={animation:{Feature:iu},exit:{Feature:ou}};function Bt(t){return{point:{x:t.pageX,y:t.pageY}}}const lu=t=>e=>Tn(e)&&t(e,Bt(e));function Mt(t,e,n,s){return It(t,e,lu(n),s)}const Er=({current:t})=>t?t.ownerDocument.defaultView:null,Us=(t,e)=>Math.abs(t-e);function cu(t,e){const n=Us(t.x,e.x),s=Us(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ws=new Set(["auto","scroll"]);class Lr{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=ye(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=cu(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:v}=d,{timestamp:T}=F;this.history.push({...v,timestamp:T});const{onStart:S,onMove:g}=this.handlers;p||(S&&S(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ge(p,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:v,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=ye(d.type==="pointercancel"?this.lastMoveEventInfo:ge(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,S),v&&v(d,S)},!Tn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const l=Bt(e),u=ge(l,this.transformPagePoint),{point:c}=u,{timestamp:h}=F;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,ye(u,this.history)),this.removeListeners=kt(Mt(this.contextWindow,"pointermove",this.handlePointerMove),Mt(this.contextWindow,"pointerup",this.handlePointerUp),Mt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ws.has(s.overflowX)||Ws.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,i),M.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),nt(this.updatePoint)}}function ge(t,e){return e?{point:e(t.point)}:t}function Ks(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ye({point:t},e){return{point:t,delta:Ks(t,Ir(e)),offset:Ks(t,uu(e)),velocity:hu(e,.1)}}function uu(t){return t[0]}function Ir(t){return t[t.length-1]}function hu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ir(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>q(e)));)n--;if(!s)return{x:0,y:0};const o=K(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function fu(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function _s(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function du(t,{top:e,left:n,bottom:s,right:i}){return{x:_s(t.x,n,i),y:_s(t.y,e,s)}}function $s(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function pu(t,e){return{x:$s(t.x,e.x),y:$s(t.y,e.y)}}function mu(t,e){let n=.5;const s=j(t),i=j(e);return i>s?n=Rt(e.min,e.max-s,t.min):s>i&&(n=Rt(t.min,t.max-i,e.min)),Y(0,1,n)}function gu(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const He=.35;function yu(t=He){return t===!1?t=0:t===!0&&(t=He),{x:Hs(t,"left","right"),y:Hs(t,"top","bottom")}}function Hs(t,e,n){return{min:Gs(t,e),max:Gs(t,n)}}function Gs(t,e){return typeof t=="number"?t:t[e]||0}const vu=new WeakMap;class Tu{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=I(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=h=>{n?(this.stopAnimation(),this.snapToCursor(Bt(h).point)):this.pauseAnimation()},r=(h,f)=>{this.stopAnimation();const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ol(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),W(T=>{let S=this.getAxisMotionValue(T).get()||0;if(X.test(S)){const{projection:g}=this.visualElement;if(g&&g.layout){const w=g.layout.layoutBox[T];w&&(S=j(w)*(parseFloat(S)/100))}}this.originPoint[T]=S}),m&&M.postRender(()=>m(h,f)),Be(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:v}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:T}=f;if(p&&this.currentDirection===null){this.currentDirection=xu(T),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,T),this.updateAxis("y",f.point,T),this.visualElement.render(),v&&v(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>W(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Lr(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:Er(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&M.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Kt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=fu(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&bt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=du(s.layoutBox,e):this.constraints=!1,this.elastic=yu(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&W(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=gu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!bt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=bl(s,i.root,this.visualElement.getTransformPagePoint());let r=pu(i.layout.layoutBox,o);if(n){const a=n(xl(r));this.hasMutatedConstraints=!!a,a&&(r=tr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=W(c=>{if(!Kt(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Be(this.visualElement,e),s.start(pn(e,s,0,n,this.visualElement,!1))}stopAnimation(){W(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){W(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){W(n=>{const{drag:s}=this.getProps();if(!Kt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n],l=o.get()||0;o.set(e[n]-D(r,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!bt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};W(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=mu({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),W(r=>{if(!Kt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(D(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;vu.set(this.visualElement,this);const e=this.visualElement.current,n=Mt(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps(),h=l.target,f=h!==e&&Xi(h);u&&c&&!f&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();bt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),M.read(s);const r=It(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(W(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())}));return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=He,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Kt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function xu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Su extends it{constructor(e){super(e),this.removeGroupControls=_,this.removeListeners=_,this.controls=new Tu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const zs=t=>(e,n)=>{t&&M.postRender(()=>t(e,n))};class Pu extends it{constructor(){super(...arguments),this.removePointerDownListener=_}onPointerDown(e){this.session=new Lr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Er(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:zs(e),onStart:zs(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&M.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Mt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ve=!1;class bu extends y.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),ve&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Gt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,e.layoutDependency!==n&&r.setOptions({...r.options,layoutDependency:n}),ve=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||M.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;ve=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function kr(t){const[e,n]=Pr(),s=y.useContext(Xe);return Q.jsx(bu,{...t,layoutGroup:s,switchLayoutGroup:y.useContext(Rr),isPresent:e,safeToRemove:n})}const wu={pan:{Feature:Pu},drag:{Feature:Su,ProjectionNode:Sr,MeasureLayout:kr}};function Xs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&M.postRender(()=>o(e,Bt(e)))}class Cu extends it{mount(){const{current:e}=this.node;e&&(this.unmount=al(e,(n,s)=>(Xs(this.node,s,"Start"),i=>Xs(this.node,i,"End"))))}unmount(){}}class Au extends it{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=kt(It(this.node.current,"focus",()=>this.onFocus()),It(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ys(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&M.postRender(()=>o(e,Bt(e)))}class Vu extends it{mount(){const{current:e}=this.node;e&&(this.unmount=ul(e,(n,s)=>(Ys(this.node,s,"Start"),(i,{success:o})=>Ys(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ge=new WeakMap,Te=new WeakMap,Mu=t=>{const e=Ge.get(t.target);e&&e(t)},Ru=t=>{t.forEach(Mu)};function Du({root:t,...e}){const n=t||document;Te.has(n)||Te.set(n,{});const s=Te.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ru,{root:t,...e})),s[i]}function Eu(t,e,n){const s=Du(e);return Ge.set(t,n),s.observe(t),()=>{Ge.delete(t),s.unobserve(t)}}const Lu={some:0,all:1};class Iu extends it{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Lu[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Eu(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(ku(e,n))&&this.startObserver()}unmount(){}}function ku({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Fu={inView:{Feature:Iu},tap:{Feature:Vu},focus:{Feature:Au},hover:{Feature:Cu}},Ou={layout:{ProjectionNode:Sr,MeasureLayout:kr}},Bu={...au,...Fu,...wu,...Ou},_u=nu(Bu,su),Fr={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},$u={...Fr,position:"fixed",top:0,left:0},Hu={...Fr,position:"absolute"};export{Ku as A,$u as a,_u as m,Uu as u,Hu as v};